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

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.

Unloading Driver in WinDbg

Hello,

My Win2K Bus Driver seems to hang the target system when it boots up. Is
there any way I can unload my driver using WinDbg, so as to enable the
target system to boot properly ?

Thanks!
Puja

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    If it is WDM, you can do the following:

    1. enable initial breakpoint in WnDbg;
    2. when it breaks in, set a breakpoint at your DriverEntry routine;
    bp MyDriver.SYS!DriverEntry
    3. when it breaks there step thru (pro'lly you do nothing there but fill in
    structs) and upon exit from it set
    EAX=0xC0000099

    That'l tell the system not to leave the driver alone for this session.

    Later, you can go to Device Manager and remove the device (or delete the
    driver)

    -----

    Alternatively, try booting in safe mode (F8 at start) and delete your SYS
    file from disk.
    (This is what I'd do first!!!)

    -----

    Ilko Dossev
    SR Sw Eng
    Intelligraphics, Inc.


    ----- Original Message -----
    From: <[email protected]>
    To: "Kernel Debugging Interest List" <[email protected]>
    Sent: Friday, May 12, 2000 6:55 PM
    Subject: [windbg] Unloading Driver in WinDbg


    > Hello,
    >
    > My Win2K Bus Driver seems to hang the target system when it boots up. Is
    > there any way I can unload my driver using WinDbg, so as to enable the
    > target system to boot properly ?
    >
    > Thanks!
    > Puja
    >
    > ---
    > You are currently subscribed to windbg as: [email protected]
    > To unsubscribe send a blank email to $subst('Email.Unsub')
    >
  • Hello,

    My driver is a Win2K driver but not WDM (I donot include "wdm.h" file
    anywhere).
    So does it mean the technique you describe below will not work for me ?

    Thanks
    Puja

    On 05/12/00, ""Ilko Dossev" " wrote:
    > If it is WDM, you can do the following:
    >
    > 1. enable initial breakpoint in WnDbg;
    > 2. when it breaks in, set a breakpoint at your DriverEntry routine;
    > bp MyDriver.SYS!DriverEntry
    > 3. when it breaks there step thru (pro'lly you do nothing there but fill in
    > structs) and upon exit from it set
    > EAX=0xC0000099
    >
    > That'l tell the system not to leave the driver alone for this session.
    >
    > Later, you can go to Device Manager and remove the device (or delete the
    > driver)
    >
    > -----
    >
    > Alternatively, try booting in safe mode (F8 at start) and delete your SYS
    > file from disk.
    > (This is what I'd do first!!!)
    >
    > -----
    >
    > Ilko Dossev
    > SR Sw Eng
    > Intelligraphics, Inc.
    >
    >
    > ----- Original Message -----
    > From:
    > To: "Kernel Debugging Interest List"
    > Sent: Friday, May 12, 2000 6:55 PM
    > Subject: [windbg] Unloading Driver in WinDbg
    >
    >
    > > Hello,
    > >
    > > My Win2K Bus Driver seems to hang the target system when it boots up. Is
    > > there any way I can unload my driver using WinDbg, so as to enable the
    > > target system to boot properly ?
    > >
    > > Thanks!
    > > Puja
    > >
    > > ---
    > > You are currently subscribed to windbg as: [email protected]
    > > To unsubscribe send a blank email to $subst('Email.Unsub')
    > >
  • Thank you much, I pressed F8 and chose the option to Boot with Last Good HW
    Profile and the system booted fine. Is this what you are referring to as
    "safe mode" or is it different ?

    Thanks a lot!
    Puja


    > Alternatively, try booting in safe mode (F8 at start) and delete your SYS
    > file from disk.
    > (This is what I'd do first!!!)
    >
    > -----
    >
    > Ilko Dossev
    > SR Sw Eng
    > Intelligraphics, Inc.
    >
    >
    > ----- Original Message -----
    > From:
    > To: "Kernel Debugging Interest List"
    > Sent: Friday, May 12, 2000 6:55 PM
    > Subject: [windbg] Unloading Driver in WinDbg
    >
    >
    > > Hello,
    > >
    > > My Win2K Bus Driver seems to hang the target system when it boots up. Is
    > > there any way I can unload my driver using WinDbg, so as to enable the
    > > target system to boot properly ?
    > >
    > > Thanks!
    > > Puja
    > >
    > > ---
    > > You are currently subscribed to windbg as: [email protected]
    > > To unsubscribe send a blank email to $subst('Email.Unsub')
    > >
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    I am not absolutely certain, but pro'lly not.

    DriverEntry is *mandatory* export for WDM drivers.
    If it returns FALSE, no more processing, no more calls, no GPFs.
    (I use to do that myself, that's why I keep DriverEntry as simple as
    possible)

    Ilko



    ----- Original Message -----
    From: <[email protected]>
    To: "Kernel Debugging Interest List" <[email protected]>
    Sent: Monday, May 15, 2000 1:00 PM
    Subject: [windbg] Re: Unloading Driver in WinDbg


    > Hello,
    >
    > My driver is a Win2K driver but not WDM (I donot include "wdm.h" file
    > anywhere).
    > So does it mean the technique you describe below will not work for me ?
    >
    > Thanks
    > Puja
    >
    > On 05/12/00, ""Ilko Dossev" <[email protected]>" wrote:
    > > If it is WDM, you can do the following:
    > >
    > > 1. enable initial breakpoint in WnDbg;
    > > 2. when it breaks in, set a breakpoint at your DriverEntry routine;
    > > bp MyDriver.SYS!DriverEntry
    > > 3. when it breaks there step thru (pro'lly you do nothing there but fill
    in
    > > structs) and upon exit from it set
    > > EAX=0xC0000099
    > >
    > > That'l tell the system not to leave the driver alone for this session.
    > >
    > > Later, you can go to Device Manager and remove the device (or delete the
    > > driver)
    > >
    > > -----
    > >
    > > Alternatively, try booting in safe mode (F8 at start) and delete your
    SYS
    > > file from disk.
    > > (This is what I'd do first!!!)
    > >
    > > -----
    > >
    > > Ilko Dossev
    > > SR Sw Eng
    > > Intelligraphics, Inc.
    > >
    > >
    > > ----- Original Message -----
    > > From: <[email protected]>
    > > To: "Kernel Debugging Interest List" <[email protected]>
    > > Sent: Friday, May 12, 2000 6:55 PM
    > > Subject: [windbg] Unloading Driver in WinDbg
    > >
    > >
    > > > Hello,
    > > >
    > > > My Win2K Bus Driver seems to hang the target system when it boots up.
    Is
    > > > there any way I can unload my driver using WinDbg, so as to enable the
    > > > target system to boot properly ?
    > > >
    > > > Thanks!
    > > > Puja
    > > >
    > > > ---
    > > > You are currently subscribed to windbg as: [email protected]
    > > > To unsubscribe send a blank email to $subst('Email.Unsub')
    > > >
    >
    > ---
    > You are currently subscribed to windbg as: [email protected]
    > To unsubscribe send a blank email to $subst('Email.Unsub')
    >
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Absolutely. F8 tels system to avoid loading extra drivvers, only disk access
    and peripherals and VGA.
    Glad to read that you succeeded!

    Ilko :)


    ----- Original Message -----
    From: <[email protected]>
    To: "Kernel Debugging Interest List" <[email protected]>
    Sent: Monday, May 15, 2000 1:33 PM
    Subject: [windbg] Re: Unloading Driver in WinDbg


    >
    > Thank you much, I pressed F8 and chose the option to Boot with Last Good
    HW
    > Profile and the system booted fine. Is this what you are referring to as
    > "safe mode" or is it different ?
    >
    > Thanks a lot!
    > Puja
    >
    >
    > > Alternatively, try booting in safe mode (F8 at start) and delete your
    SYS
    > > file from disk.
    > > (This is what I'd do first!!!)
    > >
    > > -----
    > >
    > > Ilko Dossev
    > > SR Sw Eng
    > > Intelligraphics, Inc.
    > >
    > >
    > > ----- Original Message -----
    > > From: <[email protected]>
    > > To: "Kernel Debugging Interest List" <[email protected]>
    > > Sent: Friday, May 12, 2000 6:55 PM
    > > Subject: [windbg] Unloading Driver in WinDbg
    > >
    > >
    > > > Hello,
    > > >
    > > > My Win2K Bus Driver seems to hang the target system when it boots up.
    Is
    > > > there any way I can unload my driver using WinDbg, so as to enable the
    > > > target system to boot properly ?
    > > >
    > > > Thanks!
    > > > Puja
    > > >
    > > > ---
    > > > You are currently subscribed to windbg as: [email protected]
    > > > To unsubscribe send a blank email to $subst('Email.Unsub')
    > > >
    >
    > ---
    > You are currently subscribed to windbg as: [email protected]
    > To unsubscribe send a blank email to $subst('Email.Unsub')
    >
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