Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

Questions on Win2000 Windeg

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Win2000 and WinNT4 don't contain runwdeb.wrf file.


I need some help on Win2000 Windbg.

1. How to load my own driver symbols? I followed the following steps to
try to load my driver symbols:

1. Compile my driver with Win2000 DDK to get MyDriver.sys and
MyDriver.pdb
2. Create "MySymbols" with "sys" subdir and copy MyDriver.pdb
to "sys" directory on the host system
3. Copy MyDriver.sys file to %winnt%\system32\drivers directory
on the target system
4. Set "Debug Symbol Search Path" in "Windows Debugger
Options\Symbols" to "MySymbols"

When MyDriver.sys is loaded, the corresponding symbols can not be
loaded. What is wrong?

2. How to debug driver in source level? How to set "Default Search
Path" and "Path Mapping Pairs" ("Source" and "Mapped to") in "Windows
Debugger Options\Source files"? I checked Win2000 DDK document but couldn't
find the solution.

Thanks

James


-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Friday, February 25, 2000 12:47 AM
To: NT Developers Interest List
Subject: [ntdev] RE: 0x18 PnP IRP???


In your runwdeb.wrf file add the following:
/s:C:\SymDir\MySymFile.Sym

That's how Win9x WDEB386 works. I believe WinDbg should require the same
semantics.


<< The major function is IRP_MJ_PNP (0x1b) and the minor function is 0x18.

So Dinker, do you know normally how to handle this function? My device is a
USB device. Currently, I don't handle it.

Another question: How to add my own driver symbols to WinDbg in Win2000?
Right now, I have a symbols directory and a sub directory sys for my driver
and copied *.pdb (I also tried *.sys, *.sym) to the sub directory and in
WinDbg setting, I set the directory path. But when my driver is loaded,
WinDbg still can not find the symbol. Waht's wrong?

Thanks

James >>

---
You are currently subscribed to ntdev as: [email protected]
To unsubscribe send a blank email to $subst('Email.Unsub')

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    > -----Original Message-----
    > From: Zhou, James [mailto:[email protected]]
    > Sent: Sunday, February 27, 2000 11:45 PM
    > To: NT Developers Interest List
    > Subject: [ntdev] Questions on Win2000 Windeg
    >
    >
    > Win2000 and WinNT4 don't contain runwdeb.wrf file.
    >
    >
    > I need some help on Win2000 Windbg.
    >
    > 1. How to load my own driver symbols? I followed the
    > following steps to
    > try to load my driver symbols:
    >
    > 1. Compile my driver with Win2000 DDK to get
    > MyDriver.sys and
    > MyDriver.pdb
    > 2. Create "MySymbols" with "sys" subdir and copy
    > MyDriver.pdb
    > to "sys" directory on the host system

    No. Just copy the .sys file to the symbols directory. The pdb file will be
    picked up by windbag looking in the sys file and finding the path to the pdb
    file. This works fine of course if you are compiling on the same machine you
    are running windbag on.

    Also, you really need to install the W2K symbols on your host machine as
    well.

    > 3. Copy MyDriver.sys file to
    > %winnt%\system32\drivers directory
    > on the target system
    > 4. Set "Debug Symbol Search Path" in "Windows Debugger
    > Options\Symbols" to "MySymbols"
    >
    > When MyDriver.sys is loaded, the corresponding symbols
    > can not be
    > loaded. What is wrong?
    >
    > 2. How to debug driver in source level? How to set "Default Search
    > Path" and "Path Mapping Pairs" ("Source" and "Mapped to") in "Windows
    > Debugger Options\Source files"? I checked Win2000 DDK
    > document but couldn't
    > find the solution.


    I no longer bother trying to get the GUI setup working in windbag. Starting
    with RC2, windbag has developed enough defects to make it nearly unusable.
    Instead I start windbag from the command line, explicitly setting all the
    options that need to be set. So for example I have a windbag icon on my
    desktop that has the command line:

    H:NTDDK\bin\windbg.exe -k x86 com2 57600 -y "G:\Symbols"

    I've installed the complete w2k symbols at G:\Symbols and I copy my driver
    .sys files to both the G:Symbols directory (top level not in sys) and to the
    target machine. I have lots of problems with windbag, but finding the
    symbols is not currently one of them.

    Hope this helps, sorry windbag is such a mess.
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    > When MyDriver.sys is loaded, the corresponding symbols can not be
    > loaded. What is wrong?

    In NT4 on target + w2k windbg build 1999, it worked if:
    - you set the Symbols Path to some dir.
    - you place all .dbg/.pdb/.sys files of build result to this directory.
    - no "sys" subdir.

    > 2. How to debug driver in source level?

    Impossible if windbg did not find symbols. But if symbols are found - just
    open a source file by File/Open, having the debuggee loaded, & set
    breakpoints there by mouse.

    Max
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Internals & Software Drivers 15 November 2021 Live, Online
Writing WDF Drivers TBD Live, Online
Developing Minifilters 7 February 2022 Live, Online
Kernel Debugging 21 March 2022 Live, Online