How to unload/reload a driver from win32

Hello,

I’m searching for information regarding unload/reload drivers from a win32
program. Something’s similar to “Device Manager”.
Thank you for your help.

Hello.

Use:

CreateService\OpenService

StartService //Load and start
ControlService(,SERVICE_CONTROL_STOP,); //Unload
CloseServiceHandle

Regards,
Yan Vugenfirer.

-----Original Message-----
From: ChuBun [mailto:xxxxx@yahoo.com]
Sent: ??? ??? 05 ??? 2003 18:38
To: NT Developers Interest List
Subject: [ntdev] How to unload/reload a driver from win32

Hello,

I’m searching for information regarding unload/reload drivers from a win32
program. Something’s similar to “Device Manager”.
Thank you for your help.


You are currently subscribed to ntdev as: xxxxx@smlink.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks again. But it only works on non-pnp driver. I got this error when
trying to stop my pnp driver:
“The requested control is not valid for this service.”
Am I missing something?

“yan” wrote in message news:xxxxx@ntdev…
>
> Hello.
>
> Use:
>
> CreateService\OpenService
>
> StartService //Load and start
> ControlService(,SERVICE_CONTROL_STOP,); //Unload
> CloseServiceHandle
>
> Regards,
> Yan Vugenfirer.
>
> -----Original Message-----
> From: ChuBun [mailto:xxxxx@yahoo.com]
> Sent: ??? ??? 05 ??? 2003 18:38
> To: NT Developers Interest List
> Subject: [ntdev] How to unload/reload a driver from win32
>
>
> Hello,
>
> I’m searching for information regarding unload/reload drivers from a win32
> program. Something’s similar to “Device Manager”.
> Thank you for your help.
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@smlink.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>

You will need to disable every device on which your driver is loaded.
This will result in the unload of your driver.

You should read up on the SetupDi API in the DDK documentation. This
API will let you enumerate devices and control their state.

-p

-----Original Message-----
From: ChuBun [mailto:xxxxx@yahoo.com]
Sent: Wednesday, March 05, 2003 10:24 AM
To: NT Developers Interest List

Thanks again. But it only works on non-pnp driver. I got this error
when
trying to stop my pnp driver:
“The requested control is not valid for this service.”
Am I missing something?

“yan” wrote in message news:xxxxx@ntdev…
>
> Hello.
>
> Use:
>
> CreateService\OpenService
>
> StartService //Load and start
> ControlService(,SERVICE_CONTROL_STOP,); //Unload CloseServiceHandle
>
> Regards,
> Yan Vugenfirer.
>
> -----Original Message-----
> From: ChuBun [mailto:xxxxx@yahoo.com]
> Sent: ??? ??? 05 ??? 2003 18:38
> To: NT Developers Interest List
> Subject: [ntdev] How to unload/reload a driver from win32
>
>
> Hello,
>
> I’m searching for information regarding unload/reload drivers from a
> win32 program. Something’s similar to “Device Manager”.
> Thank you for your help.
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@smlink.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks.

“Peter Wieland” wrote in message
news:xxxxx@ntdev…
>
> You will need to disable every device on which your driver is loaded.
> This will result in the unload of your driver.
>
> You should read up on the SetupDi API in the DDK documentation. This
> API will let you enumerate devices and control their state.
>
> -p