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.

Trouble with Pnp functionality in Bus Driver

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Having trouble getting my Bus Driver to implement the enable/disable
features of the Win2000 Device Manager.

I can disable the device, but when I select re-enable the machine requires a
reboot. The "in the box" driver does not require a reboot.

The function driver that controls the device (written by MSFT) is normally
set to SYSTEM_START and gets unloaded in the "disable" phase. If I set it
to BOOT_START the driver never gets unloaded and the "enable" functionality
works.

What could I be doing wrong in my handling of PNP Irps (on the enable path)
that does not get this driver re-loaded?

Daniel Nemiroff
System Software Engineering
Intel Corp.
(916)356-5723

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Have you traced through your code to see how your driver is reacting to
    IRP_MN_START_DEVICE? Also, if any driver above you returns an error
    condition to IRP_MN_START_DEVICE then a reboot will be required.

    Jim

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Nemiroff, Daniel
    Sent: Thursday, April 13, 2000 9:15 AM
    To: NT Developers Interest List
    Subject: [ntdev] Trouble with Pnp functionality in Bus Driver


    Having trouble getting my Bus Driver to implement the enable/disable
    features of the Win2000 Device Manager.

    I can disable the device, but when I select re-enable the machine requires a
    reboot. The "in the box" driver does not require a reboot.

    The function driver that controls the device (written by MSFT) is normally
    set to SYSTEM_START and gets unloaded in the "disable" phase. If I set it
    to BOOT_START the driver never gets unloaded and the "enable" functionality
    works.

    What could I be doing wrong in my handling of PNP Irps (on the enable path)
    that does not get this driver re-loaded?

    Daniel Nemiroff
    System Software Engineering
    Intel Corp.
    (916)356-5723



    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    The main problem is that the driver for the FDO (that would normally attach
    to my PDO) has been unloaded. Therefore no AddDevice gets called and
    subsequently no START.

    I'm trying to understand what I need to do (i.e. how I'm responding
    incorrectly to PNP IRPs) that results in the driver for the FDO not getting
    reloaded.

    Any ideas.

    -Daniel

    -----Original Message-----
    From: Jim Young [mailto:[email protected]]
    Sent: Saturday, April 15, 2000 10:01 PM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Trouble with Pnp functionality in Bus Driver


    Have you traced through your code to see how your driver is reacting to
    IRP_MN_START_DEVICE? Also, if any driver above you returns an error
    condition to IRP_MN_START_DEVICE then a reboot will be required.

    Jim

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Nemiroff, Daniel
    Sent: Thursday, April 13, 2000 9:15 AM
    To: NT Developers Interest List
    Subject: [ntdev] Trouble with Pnp functionality in Bus Driver


    Having trouble getting my Bus Driver to implement the enable/disable
    features of the Win2000 Device Manager.

    I can disable the device, but when I select re-enable the machine requires a
    reboot. The "in the box" driver does not require a reboot.

    The function driver that controls the device (written by MSFT) is normally
    set to SYSTEM_START and gets unloaded in the "disable" phase. If I set it
    to BOOT_START the driver never gets unloaded and the "enable" functionality
    works.

    What could I be doing wrong in my handling of PNP Irps (on the enable path)
    that does not get this driver re-loaded?

    Daniel Nemiroff
    System Software Engineering
    Intel Corp.
    (916)356-5723



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


    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • Eliyas_YakubEliyas_Yakub Member Posts: 229
    Follow the toaster sample. Returning succesfully from your unload routine
    doesn't mean your driver is unloaded. It's possible that there might be
    outstanding references to your DriverObject which prevents the driver from
    getting unloaded from the system. Use windbg !drvObj and !devobj !lm
    !devstack commands to check whether everything is being deleted completely.


    -----Original Message-----
    From: Nemiroff, Daniel [mailto:[email protected]]
    Sent: Wednesday, April 19, 2000 9:20 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Trouble with Pnp functionality in Bus Driver


    The main problem is that the driver for the FDO (that would normally attach
    to my PDO) has been unloaded. Therefore no AddDevice gets called and
    subsequently no START.

    I'm trying to understand what I need to do (i.e. how I'm responding
    incorrectly to PNP IRPs) that results in the driver for the FDO not getting
    reloaded.

    Any ideas.

    -Daniel

    -----Original Message-----
    From: Jim Young [mailto:[email protected]]
    Sent: Saturday, April 15, 2000 10:01 PM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Trouble with Pnp functionality in Bus Driver


    Have you traced through your code to see how your driver is reacting to
    IRP_MN_START_DEVICE? Also, if any driver above you returns an error
    condition to IRP_MN_START_DEVICE then a reboot will be required.

    Jim

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Nemiroff, Daniel
    Sent: Thursday, April 13, 2000 9:15 AM
    To: NT Developers Interest List
    Subject: [ntdev] Trouble with Pnp functionality in Bus Driver


    Having trouble getting my Bus Driver to implement the enable/disable
    features of the Win2000 Device Manager.

    I can disable the device, but when I select re-enable the machine requires a
    reboot. The "in the box" driver does not require a reboot.

    The function driver that controls the device (written by MSFT) is normally
    set to SYSTEM_START and gets unloaded in the "disable" phase. If I set it
    to BOOT_START the driver never gets unloaded and the "enable" functionality
    works.

    What could I be doing wrong in my handling of PNP Irps (on the enable path)
    that does not get this driver re-loaded?

    Daniel Nemiroff
    System Software Engineering
    Intel Corp.
    (916)356-5723



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


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



    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    I guess I wasn't clear.

    My driver's Unload routine never gets called and thus it is not unloaded.
    Besides, since I'm a boot_start driver I can't get unloaded.

    It is the driver for the FDO that layers above me gets unloaded after I
    return successful from my REMOVE Irp.

    The toaster sample did provide help in my early development, but lacks
    certain features for help in this area.

    Daniel

    -----Original Message-----
    From: Eliyas Yakub [mailto:[email protected]]
    Sent: Wednesday, April 19, 2000 2:45 PM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Trouble with Pnp functionality in Bus Driver


    Follow the toaster sample. Returning succesfully from your unload routine
    doesn't mean your driver is unloaded. It's possible that there might be
    outstanding references to your DriverObject which prevents the driver from
    getting unloaded from the system. Use windbg !drvObj and !devobj !lm
    !devstack commands to check whether everything is being deleted completely.


    -----Original Message-----
    From: Nemiroff, Daniel [mailto:[email protected]]
    Sent: Wednesday, April 19, 2000 9:20 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Trouble with Pnp functionality in Bus Driver


    The main problem is that the driver for the FDO (that would normally attach
    to my PDO) has been unloaded. Therefore no AddDevice gets called and
    subsequently no START.

    I'm trying to understand what I need to do (i.e. how I'm responding
    incorrectly to PNP IRPs) that results in the driver for the FDO not getting
    reloaded.

    Any ideas.

    -Daniel

    -----Original Message-----
    From: Jim Young [mailto:[email protected]]
    Sent: Saturday, April 15, 2000 10:01 PM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Trouble with Pnp functionality in Bus Driver


    Have you traced through your code to see how your driver is reacting to
    IRP_MN_START_DEVICE? Also, if any driver above you returns an error
    condition to IRP_MN_START_DEVICE then a reboot will be required.

    Jim

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Nemiroff, Daniel
    Sent: Thursday, April 13, 2000 9:15 AM
    To: NT Developers Interest List
    Subject: [ntdev] Trouble with Pnp functionality in Bus Driver


    Having trouble getting my Bus Driver to implement the enable/disable
    features of the Win2000 Device Manager.

    I can disable the device, but when I select re-enable the machine requires a
    reboot. The "in the box" driver does not require a reboot.

    The function driver that controls the device (written by MSFT) is normally
    set to SYSTEM_START and gets unloaded in the "disable" phase. If I set it
    to BOOT_START the driver never gets unloaded and the "enable" functionality
    works.

    What could I be doing wrong in my handling of PNP Irps (on the enable path)
    that does not get this driver re-loaded?

    Daniel Nemiroff
    System Software Engineering
    Intel Corp.
    (916)356-5723



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


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



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

    ---
    You are currently subscribed to ntdev 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!
Writing WDF Drivers 24 January 2022 Live, Online
Internals & Software Drivers 7 February 2022 Live, Online
Kernel Debugging 21 March 2022 Live, Online
Developing Minifilters 23 May 2022 Live, Online