Hi,
I have a question, which place in WDM driver is correct to there code, which must be executed,
when Windows is going to be shutdown?
Is “case IRP_MN_REMOVE_DEVICE:” correct place?
Thank you,
regards,
Andy
Hi,
I have a question, which place in WDM driver is correct to there code, which must be executed,
when Windows is going to be shutdown?
Is “case IRP_MN_REMOVE_DEVICE:” correct place?
Thank you,
regards,
Andy
Well IRP_MN_REMOVE_DEVICE is where the device is removed but that can be
done without shuting down. Look at IoRegisterShutdownNotifification.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
“Andrey Kamchatnikov” wrote in message
news:xxxxx@ntdev…
Hi,
I have a question, which place in WDM driver is correct to there code,
which must be executed,
when Windows is going to be shutdown?
Is “case IRP_MN_REMOVE_DEVICE:” correct place?
Thank you,
regards,
Andy
IoRegisterShutdownNotifification is primarily for NT4 style drivers. If
you want to do something on system shutdown, do it when processing
IRP_MJ_POWER/IRP_MN_SET_POWER(SystemPowerState, Sx).
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Wednesday, August 01, 2007 7:55 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] rebooting system
Well IRP_MN_REMOVE_DEVICE is where the device is removed but that can be
done without shuting down. Look at IoRegisterShutdownNotifification.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
“Andrey Kamchatnikov” wrote in
message
news:xxxxx@ntdev…
Hi,
I have a question, which place in WDM driver is correct to there code,
which must be executed,
when Windows is going to be shutdown?
Is “case IRP_MN_REMOVE_DEVICE:” correct place?
Thank you,
regards,
Andy
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Thank you for you respond.
But how then I can synchronize IRP_MN_REMOVE_DEVICE and IRP_MJ_POWER?
In IRP_MN_REMOVE_DEVICE I have to kill a thread, but before I need to
execute a code
in IRP_MJ_POWER?
----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, August 01, 2007 6:09 PM
Subject: RE: [ntdev] rebooting system
IoRegisterShutdownNotifification is primarily for NT4 style drivers. If
you want to do something on system shutdown, do it when processing
IRP_MJ_POWER/IRP_MN_SET_POWER(SystemPowerState, Sx).
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Wednesday, August 01, 2007 7:55 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] rebooting system
Well IRP_MN_REMOVE_DEVICE is where the device is removed but that can be
done without shuting down. Look at IoRegisterShutdownNotifification.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
“Andrey Kamchatnikov” wrote in
message
news:xxxxx@ntdev…
Hi,
I have a question, which place in WDM driver is correct to there code,
which must be executed,
when Windows is going to be shutdown?
Is “case IRP_MN_REMOVE_DEVICE:” correct place?
Thank you,
regards,
Andy
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Pnp state changing irps are synchronized with system power irps, so you
will never get an Sx/S0 irp while processing a pnp state changing irp
(like remove device). Let’s take a step back for a second, why do you
need to kill the thread on power down? Why not leave the thread alone
and then only kill it on remove device? If the system shuts down, not a
big deal, all other OS related threading data is gone anyways.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey
Kamchatnikov
Sent: Wednesday, August 01, 2007 11:11 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] rebooting system
Thank you for you respond.
But how then I can synchronize IRP_MN_REMOVE_DEVICE and IRP_MJ_POWER?
In IRP_MN_REMOVE_DEVICE I have to kill a thread, but before I need to
execute a code
in IRP_MJ_POWER?
----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, August 01, 2007 6:09 PM
Subject: RE: [ntdev] rebooting system
IoRegisterShutdownNotifification is primarily for NT4 style drivers. If
you want to do something on system shutdown, do it when processing
IRP_MJ_POWER/IRP_MN_SET_POWER(SystemPowerState, Sx).
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Wednesday, August 01, 2007 7:55 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] rebooting system
Well IRP_MN_REMOVE_DEVICE is where the device is removed but that can be
done without shuting down. Look at IoRegisterShutdownNotifification.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
“Andrey Kamchatnikov” wrote in
message
news:xxxxx@ntdev…
Hi,
I have a question, which place in WDM driver is correct to there code,
which must be executed,
when Windows is going to be shutdown?
Is “case IRP_MN_REMOVE_DEVICE:” correct place?
Thank you,
regards,
Andy
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Is it guaranteed that during shutdown the driver image will never get
unloaded then? Otherwise that’s a bugcheck waiting to happen if the thread
happens to wake up from a wait and the code it was supposed to be running
has been ripped out from under it.
–
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
“Doron Holan” wrote in message
news:xxxxx@ntdev…
Pnp state changing irps are synchronized with system power irps, so you
will never get an Sx/S0 irp while processing a pnp state changing irp
(like remove device). Let’s take a step back for a second, why do you
need to kill the thread on power down? Why not leave the thread alone
and then only kill it on remove device? If the system shuts down, not a
big deal, all other OS related threading data is gone anyways.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey
Kamchatnikov
Sent: Wednesday, August 01, 2007 11:11 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] rebooting system
Thank you for you respond.
But how then I can synchronize IRP_MN_REMOVE_DEVICE and IRP_MJ_POWER?
In IRP_MN_REMOVE_DEVICE I have to kill a thread, but before I need to
execute a code
in IRP_MJ_POWER?
----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, August 01, 2007 6:09 PM
Subject: RE: [ntdev] rebooting system
IoRegisterShutdownNotifification is primarily for NT4 style drivers. If
you want to do something on system shutdown, do it when processing
IRP_MJ_POWER/IRP_MN_SET_POWER(SystemPowerState, Sx).
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Wednesday, August 01, 2007 7:55 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] rebooting system
Well IRP_MN_REMOVE_DEVICE is where the device is removed but that can be
done without shuting down. Look at IoRegisterShutdownNotifification.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
“Andrey Kamchatnikov” wrote in
message
news:xxxxx@ntdev…
Hi,
I have a question, which place in WDM driver is correct to there code,
which must be executed,
when Windows is going to be shutdown?
Is “case IRP_MN_REMOVE_DEVICE:” correct place?
Thank you,
regards,
Andy
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
A pnp driver is only unloaded after the last of its devices is pnp
removed. On an Sx transition, S5 included, pnp stacks are not torn
down, they are sent S5 set power irps.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Skywing
Sent: Wednesday, August 01, 2007 12:02 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] rebooting system
Is it guaranteed that during shutdown the driver image will never get
unloaded then? Otherwise that’s a bugcheck waiting to happen if the
thread
happens to wake up from a wait and the code it was supposed to be
running
has been ripped out from under it.
–
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
“Doron Holan” wrote in message
news:xxxxx@ntdev…
Pnp state changing irps are synchronized with system power irps, so you
will never get an Sx/S0 irp while processing a pnp state changing irp
(like remove device). Let’s take a step back for a second, why do you
need to kill the thread on power down? Why not leave the thread alone
and then only kill it on remove device? If the system shuts down, not a
big deal, all other OS related threading data is gone anyways.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey
Kamchatnikov
Sent: Wednesday, August 01, 2007 11:11 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] rebooting system
Thank you for you respond.
But how then I can synchronize IRP_MN_REMOVE_DEVICE and IRP_MJ_POWER?
In IRP_MN_REMOVE_DEVICE I have to kill a thread, but before I need to
execute a code
in IRP_MJ_POWER?
----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, August 01, 2007 6:09 PM
Subject: RE: [ntdev] rebooting system
IoRegisterShutdownNotifification is primarily for NT4 style drivers. If
you want to do something on system shutdown, do it when processing
IRP_MJ_POWER/IRP_MN_SET_POWER(SystemPowerState, Sx).
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Wednesday, August 01, 2007 7:55 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] rebooting system
Well IRP_MN_REMOVE_DEVICE is where the device is removed but that can be
done without shuting down. Look at IoRegisterShutdownNotifification.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
“Andrey Kamchatnikov” wrote in
message
news:xxxxx@ntdev…
Hi,
I have a question, which place in WDM driver is correct to there code,
which must be executed,
when Windows is going to be shutdown?
Is “case IRP_MN_REMOVE_DEVICE:” correct place?
Thank you,
regards,
Andy
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer