PRB: WDM Driver Written in C++ May Fail to Load

ID: Q222820


The information in this article applies to:


SYMPTOMS

A WDM driver written in C++ fails to load under Windows 98 if it uses one of the following WDM functions:

RtlLargeIntegerAdd
RtlEnlargedIntegerMultiply
RtlEnlargedUnsignedMultiply
RtlEnlargedUnsignedDivide
RtlLargeIntegerNegate
RtlLargeIntegerSubtract


CAUSE

The WDM.h header file included in the Windows 98 DDK defines these functions differently depending upon whether or not the __cplusplus constant is defined. If the __cplusplus constant is defined, WDM.h defines prototypes for these functions; if __cplusplus is not defined, WDM.h defines inline versions of these functions.

In the case where prototypes are defined for these functions, the resulting driver fails to load because none of these functions are actually implemented in the Windows 98 WDM implementation, and therefore the WDM loader cannot resolve the implicit links to these functions in the driver.


RESOLUTION

Developers who want to use these functions in a WDM driver using C++ should provide their own versions of these functions. Developers can view the inline versions of these functions in WDM.h for an example of how they should be implemented.

Additional query words:


Keywords          : kbDDK kbKMode kbWinOS98 
Version           : Win98:
Platform          : Win98 
Issue type        : kbprb 

Last Reviewed: March 26, 1999