Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collapse the table of content
Expand the table of content


warning C28159: Consider using another function instead.

This warning is reported for Drivers is suggesting that you use a preferred function call that is semantically equivalent to the function that the driver is calling. This is a general warning message; the annotation __drv_preferredFunction was used (possibly with a conditional a __drv_when() annotation) to flag a bad coding practice.

The following code example generates this warning:

char buff[MAX_PATH];

OemToChar(buff, input);

    // if strlen(input) > MAX_PATH
....// leads to buffer overrun

The following code example avoids this warning:

char buff[MAX_PATH];

OemToCharBuff(buff, input, MAX_PATH);

© 2015 Microsoft