Share via


C28125

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

warning C28125: The function must be called from within a try/except block

The driver is calling a function that must be called from within a try/except block, such as ProbeForRead, ProbeForWrite, MmProbeAndLockPages.

Example

The following code example generates this warning:

ProbeForRead(addr, len, 4);  

The following code example avoids this warning:

  
__try  
{  
    ProbeForRead(addr, len, 4);  
}  
__except(EXCEPTION_EXECUTE_HANDLER)  
{  
    Status = GetExceptionCode();  
    ... report error status  
}