Returning Error Codes Received from Runtime Functions
Calls to the Direct3D version 9 user-mode display driver-supplied functions must return error codes that they receive when they call the Direct3D runtime-supplied kernel-services accessing functions. For example, the runtime might call a user-mode display driver function, such as the CreateResource function. This, in turn, calls a runtime-supplied function, such as the pfnAllocateCb function, to perform a specific operation, in this case to allocate memory for the resource. If the user-mode display driver receives an error code from the call to the runtime-supplied function, it must return that error code back to the runtime.