Partager via


C28164

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 C28164: The argument is being passed to a function that expects a pointer to an object (not a pointer to a pointer)

This warning is reported when a pointer to a pointer is used in a call to a function that is expecting a pointer to an object.

The function takes a PVOID in this position. Usually, this indicates that &pXXX was used when pXXX is required.

Some polymorphic functions (functions that can evaluate to, and be applied to, values of different types) are implemented in C by using a PVOID argument that takes any pointer type. However, this allows the programmer to code a pointer to a pointer without causing a compiler error, even when this type is not appropriate.

Example

The following code example generates this warning:

PFAST_MUTEX pFm;  
...  
KeWaitForSingleObject(&pFm, UserRequest, UserMode, false, NULL);  

The following code example avoids the warning:

PFAST_MUTEX pFm;  
...  
KeWaitForSingleObject(pFm, UserRequest, UserMode, false, NULL);