Hey,
I have a driver which up until now I have debugged on XP, but now I need to debug on Vista, and all my old DbgPrint statements no longer work so I need to do DbgPrintEx. However I get a linker error, so can anyone tell me which lib I am supposed to be linking to here?
Thanks,
Ben
DbgPrintEx is exported by Ntoskrnl.
Are you compiling with Vista DDK environment?
-----Mensaje original-----
De: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] En nombre de xxxxx@nchsoftware.com
Enviado el: lunes, 15 de octubre de 2007 3:05
Para: Windows System Software Devs Interest List
Asunto: [ntdev] Where is DbgPrintEx implemented?
Hey,
I have a driver which up until now I have debugged on XP, but now I need to debug on Vista, and all my old DbgPrint statements no longer work so I need to do DbgPrintEx. However I get a linker error, so can anyone tell me which lib I am supposed to be linking to here?
Thanks,
Ben
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
DbgPrint works fine on Vista, but you need to turn it on see
http://www.osronline.com/article.cfm?article=295
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
wrote in message news:xxxxx@ntdev…
> Hey,
> I have a driver which up until now I have debugged on XP, but now I need
> to debug on Vista, and all my old DbgPrint statements no longer work so I
> need to do DbgPrintEx. However I get a linker error, so can anyone tell me
> which lib I am supposed to be linking to here?
> Thanks,
> Ben
>
What is the exact linker error and message? I don’t really see how you could be getting this and this only unless you’re linking against ntoskrnl.lib for Win2K.
What Don said is also true - DbgPrint output is disabled by default on Vista. The details are fairly messy, but in a nutshell, to get started (once you’ve solved the linking problem):
ed nt!Kd_DEFAULT_Mask 0x0F
The article and the documentation for DbgPrintEx explain the rest.
Good luck,
mm
Thanks for the responses guys.
I had read the article on turning on DbgPrint, but the key it describes is certainly not on the Vista version I have. Instead I am “enabling it” using ed kd_DEFAULT_MASK 0xf.
The linker error is an unresolved symbol. I am building using the windows 2003 ddk.
I will keep fiddling, but until then I’ll just use DbgPrint.
Thanks,
Ben
But what Build Environment? That is, what does it say in the title of the command prompt at which you build when nothing is running?
mm
You should switch to the WDK 6000 build system.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@nchsoftware.com
Sent: Monday, October 15, 2007 5:16 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Where is DbgPrintEx implemented?
Thanks for the responses guys.
I had read the article on turning on DbgPrint, but the key it describes
is certainly not on the Vista version I have. Instead I am “enabling it”
using ed kd_DEFAULT_MASK 0xf.
The linker error is an unresolved symbol. I am building using the
windows 2003 ddk.
I will keep fiddling, but until then I’ll just use DbgPrint.
Thanks,
Ben
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
I know the linker error is an unresolved symbol, I asking what the actual text of the error (copy and paste from the log) is. The actual symbol name in the error might indicate if this is a C++/C declaration issue
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@nchsoftware.com
Sent: Monday, October 15, 2007 2:16 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Where is DbgPrintEx implemented?
Thanks for the responses guys.
I had read the article on turning on DbgPrint, but the key it describes is certainly not on the Vista version I have. Instead I am “enabling it” using ed kd_DEFAULT_MASK 0xf.
The linker error is an unresolved symbol. I am building using the windows 2003 ddk.
I will keep fiddling, but until then I’ll just use DbgPrint.
Thanks,
Ben
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
I am using the Windows 2003 server build. (Checked).
The exact linker error is:
1>Linking Executable - objchk_wnet_x86\i386\nchssvad.sys for i386
1>adapter.obj : error LNK2019: unresolved external symbol “unsigned long __cdecl DbgPrintEx(unsigned long,unsigned long,char *,…)” (?DbgPrintEx@@YAKKKPADZZ) referenced in function _DriverEntry@8
Thanks,
Ben
Do your files use the .cpp extension? If so, you need to enclose the #include <ntddk.h> statement:
extern “C”
{
#include <ntddk.h>
}
Even if they do not end in .cpp, or you’re not using either -TP or -Tp, I would give it a try.
Good luck,
mm</ntddk.h></ntddk.h>