Hello,
Please forgive me if this is off topic but I really need help.
I’m just a beginner in WDM development so I bought Walter Oney’s book and I
was trying the examples using DDK 3790.1830, with XP SP2, and Visual Studio
C++ 6.
Everything was OK until I tried to create a log file. I tried something like
this:
#include <wdm.h>
#include < ntstrsafe.h>
(.)
wchar_t buffer[5000];
(.)
RtlStringCbPrintfW ( buffer, sizeof(buffer), L"Error in function ABC!");
When I build I get a
Error LNK2019: unresolved external symbol imp vsnwprintf referenced
(etc.)
Can someone point me the way to correct this?</wdm.h>
Are you building the driver in VS6? Or just using it for editting files? What is the DRIVERTYPE in your sources file? You need to be linking against ntoskrnl.lib to resolve this import, not wdm.lib. Note that your driver will only load in XP and later if you do this. You can load on win2k by doing the following:
#define NTSTRSAFE_LIB
#include < ntstrsafe.h>
and then linking against ntstrsafe.lib in TARGETLIBS.
d
Thank you very much for the fast reply.
You are correct, I added ntoskrn.lib to the project and the build didn’t
generate any errors.
Thank you very much again.
wrote in message news:xxxxx@ntdev…
> Are you building the driver in VS6? Or just using it for editting files?
> What is the DRIVERTYPE in your sources file? You need to be linking
> against ntoskrnl.lib to resolve this import, not wdm.lib. Note that your
> driver will only load in XP and later if you do this. You can load on
> win2k by doing the following:
>
> #define NTSTRSAFE_LIB
> #include < ntstrsafe.h>
>
> and then linking against ntstrsafe.lib in TARGETLIBS.
>
> d
>
>
>