Debugging a UMDF driver on BOOT in Vista

Hi,
I’m trying to debug a scenario which happens at system boot.
My driver is written in UMDF and runs on Vista, so I cannot use the Log Boot option in DebugView.
Does TraceView support logging at boot time? If so, how is this option enabled?
If not, what other way is there to know what happens at boot time?
I’ve tried writing to a file, using standard user-mode C++ functions (fopen, fprintf and fclose), but the file fails to open. Maybe I should use other functions in order to write to file from the driver?
Thanks,
Gadi

UMDF driver cannot be loaded on boot. It can only be loaded when the UMDF
user mode process started, which is rather late.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hi,
> I’m trying to debug a scenario which happens at system boot.
> My driver is written in UMDF and runs on Vista, so I cannot use the Log Boot
option in DebugView.
> Does TraceView support logging at boot time? If so, how is this option
enabled?
> If not, what other way is there to know what happens at boot time?
> I’ve tried writing to a file, using standard user-mode C++ functions (fopen,
fprintf and fclose), but the file fails to open. Maybe I should use other
functions in order to write to file from the driver?
> Thanks,
> Gadi
>

So you have a problem which occurs only during system startup? How far into boot do you have to go before the problem doesn’t occur (i.e. if you plug the device in when the login screen is up does it work? How about once you’re logged in?)

Have you looked at the error returned from fopen? The most likely error is access denied, in which case you would need to write a location which grants LOCAL_SERVICE write access.

Otherwise you probably need to debug it from the kernel debugger. See http://msdn2.microsoft.com/en-us/library/aa510985.aspx for details if you need to break in. Of course with KD setup you can also use DbgPrintEx to print to the screen if you’re having trouble with WPP. Or if you’re on Vista you can setup an autologger (http://msdn2.microsoft.com/en-us/library/ms797181.aspx) to catch the WPP messages your driver puts out.

If you’re having trouble during boot I would guess that you’re trying to access a service which hasn’t started yet, so that’s where I’d look.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@n-trig.com
Sent: Thursday, April 26, 2007 8:00 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Debugging a UMDF driver on BOOT in Vista

Hi,
I’m trying to debug a scenario which happens at system boot.
My driver is written in UMDF and runs on Vista, so I cannot use the Log Boot option in DebugView.
Does TraceView support logging at boot time? If so, how is this option enabled?
If not, what other way is there to know what happens at boot time?
I’ve tried writing to a file, using standard user-mode C++ functions (fopen, fprintf and fclose), but the file fails to open. Maybe I should use other functions in order to write to file from the driver?
Thanks,
Gadi


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi,
I’ve followed the instructions of the AutoLogger on Vista, and found that the log I get doesn’t fit what I define in the registry.
I changed the EnableLevel and EnableFlags values in the registry, and saw no change in the new log file after boot, that’s why i concluded the values I define in the registry somehow don’t actually define the log file.
The values I defined for AutoLogger01 are: (I’m referring to the screenshots in the example in http://msdn2.microsoft.com/en-us/library/ms797179.aspx)

FileName - I chose a path on the desktop
Guid - something i generated with genguid.exe
Start - 0x1
Status - (was put there automatically after the first reboot)

Values in AutoLoggerProviders->{da5fbdfd-1eae-4ecf-b426-a3818f325ddb}
(I took the GUID from internal.h in the FX2 example:
#define WPP_CONTROL_GUIDS \
WPP_DEFINE_CONTROL_GUID( \
WudfOsrUsbFx2TraceGuid, (da5fbdfd,1eae,4ecf,b426,a3818f325ddb) )

Enabled - 0x1
EnableFlags - 0xf (I wanted all 4 flags to be chosen, as in TraceView default - MYDRIVER_ALL_INFO, TEST_TRACE_DRIVER, TEST_TRACE_DEVICE, TEST_TRACE_QUEUE. Is this the correct value?)
EnableLevel - 0x4 (I wanted the “Information” level, defined in evntrace.h)
LoggerName - AutoLogger01

And what I actually see when I open the updated .etl file is:
Group ID/Session Name - LogSession0
State - EXISTING
Event Count -1
Buffers Read- 1
Flags - 0x7fffffff (this value was not affected when I changed the EnableFlags value in the registry)
Level - 0xff (this value was not changed too)
Log File Name - the path to this log file.

I see only one event (called Header, at system Time 0) in the actual log, whereas the driver actually sends a lot of WPP traces.

So it seems that there is a missing link here, and the log file does not fit the registry values I defined.

Another thing is that since I added these registry values, when I do real-time trace, initiated by me, I see new messages from another GUID that I did not define: Unknown (18):GUID=14410d7a… (No Format information found).
These are interleaved with the messages I used to see before touching the registry.

Any idea what I’m doing wrong?
Thanks,
Gadi