xxxxx@hotmail.com wrote:
Certainly if you do a platform check in your code everything is
> going to be just fine.
…and we both don’t know, whether the OPs code (e.g. a modified MS
sample?) does the necessary checks, or not.
Because I have stumbled across it myself(*), I just wanted to point out
that there is a mechanism that can provoke such an error message.
In any case, he has to check whether these functions are actually
> exported on W2K before he does any adjustments to his code …
Ummm… actually not, Anton. This information is in his mail:
-
The OPs code does link with _NT_TARGET_VERSION_WINXP.
-
From the “unresolved external symbol” error messages thrown with
_NT_TARGET_VERSION_WIN2K, we know that the functions are definitely not
exported on W2K.
Anton, I assume you actually wanted to say:
“In any case, he has to check whether these functions are actually
CALLED on W2K before he does any adjustments to his BUILD ENVIRONMENT OR
code …”
In the case of bulkusb.sys, some functions are not available in the W2K
libs. As they are never called when the driver runs on W2K, it is OK to
link with the WXP libs instead.
General truths:
-
All drivers must be designed so that (during runtime on a “supported”
platform) they never call any unsupported function ! In fact, this is
true for ANY running program/application on any given OS.
-
Whenever a build/link reports an error, you have to investigate and
make sure you understand exactly what’s going on.
BR, -H
(*)During my first compile of bulkusb.sys on W2K I got the build.exe
error message “Platform not supported”.
As I did not understand why this error was thrown - for a driver for
which its developer notes state it is useable for W2K/WXP and Vista - I
tried to compile manually, and ran into the link problem.
When I investigated what these “missing” functions actually do, I learnt
that (a) it is required to use them and the XP libraries to provide
proper PnP support on XP and later, and (b) it is safe for earlier
platforms to link to them b/c the code checks the platform and they are
never invoked there.
The error I made was to assume a driver must be buildable on all
supported platforms.
This is not true - in fact, a multi-platform driver must be built on the
most recent platform that supports all required functionality.