Hi there,
MS said, IRP_MN_REMOVE_DEVICE will be sent after a failed IRP_MN_START_DEVICE. I have a driver which received an IRP_MN_REMOVE_DEVICE after a successful IRP_MN_START_DEVICE?
Thank you in advance,
Ben
Hi there,
MS said, IRP_MN_REMOVE_DEVICE will be sent after a failed IRP_MN_START_DEVICE. I have a driver which received an IRP_MN_REMOVE_DEVICE after a successful IRP_MN_START_DEVICE?
Thank you in advance,
Ben
Is there a filter above you? It could have easily failed the start? Also, a irp_mn_query_Device_state is sent, that could have marked the stack as failed. Regardless of how, you have to handle the transition from start to removed with no intervening query remove or surprise remove
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of smallbarrow@163.com
Sent: Monday, November 08, 2010 11:42 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Why received IRP_MN_REMOVE_DEVICE after a successful IRP_MN_START_DEVICE?
Hi there,
MS said, IRP_MN_REMOVE_DEVICE will be sent after a failed IRP_MN_START_DEVICE. I have a driver which received an IRP_MN_REMOVE_DEVICE after a successful IRP_MN_START_DEVICE?
Thank you in advance,
Ben
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 Doron.
I checked and found that drivers indeed received IRP_MN_QUERY_PNP_DEVICE_STATE event, however, my drivers don’t handle them, just complete it.
I have two drivers which implemented diskless functionality, there is not a filter driver. One driver has two roles, a bus driver and a disk image functional driver. The other driver is a storage class driver which is based on the first driver’s disk image functional driver. The current situation is that if I mount two disk files in remote machine, one disk can be found by system correctly, the other one cannot be found and there is an error 9 according to the property in device manager. It says that it had gotten an invalid hardware ID. I traced and found the reason is that the failed device had shut down after it received IRP_MN_REMOVE_DEVICE event.
Could you please give me any leads?
Thank you.
Ben
Look at the pnp logs
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of smallbarrow@163.com
Sent: Tuesday, November 09, 2010 6:55 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Why received IRP_MN_REMOVE_DEVICE after a successful IRP_MN_START_DEVICE?
Thank you Doron.
I checked and found that drivers indeed received IRP_MN_QUERY_PNP_DEVICE_STATE event, however, my drivers don’t handle them, just complete it.
I have two drivers which implemented diskless functionality, there is not a filter driver. One driver has two roles, a bus driver and a disk image functional driver. The other driver is a storage class driver which is based on the first driver’s disk image functional driver. The current situation is that if I mount two disk files in remote machine, one disk can be found by system correctly, the other one cannot be found and there is an error 9 according to the property in device manager. It says that it had gotten an invalid hardware ID. I traced and found the reason is that the failed device had shut down after it received IRP_MN_REMOVE_DEVICE event.
Could you please give me any leads?
Thank you.
Ben
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
An FDO should pass QUERY_PNP_DEVICE_STATE down, to let the PDO complete it.
>It says that it had gotten an invalid hardware ID.
Your driver likely reports the same serial number ( or others ID’s) for both drives. You need to change it.
Igor Sharovar
Thank you all!
Could you please tell me if I have to implement QUERY_PNP_DEVICE_STATE event and have to make that PDO (image functional driver) report different hardware ID? Actually, I have just ignored that event, and all PDOs hardware ID is the same. Another phenomenon is that after I reboot system, it works well and no issues appear. This issue seems like it appears after I have mounted a new disk image file. (This new disk image file has never existed before).
In addition, I have analyzed PNP events log for too many days, there is not a clue which indicates error happened.
Thank you again,
Ben
You need to report different hardware ID even if the same image mount to two disks as a boot and a non-boot. Change your code where you emulate a virtual disk.
Igor Sharovar
The storage stack always does a tear down after an initial install.
You don’t see this on the boot disk as it can’t get removed, but you
will see it on non boot disks. For boot disks you just get asked to
reboot the system (which is the big hammer version of
IRP_MN_REMOVE_DEVICE). I forget why this happens but it is rather
annoying, especially as the storage stack in question is generally
fully functional at the time.
Also uniqueness of disk device *hardware ids* is not usually required,
rather the disk itself has to provide a unique serial number as per
the scsi and sata specs. The hardware id for a disk is generally some
non-unique manufacturer string, unless you meant something other than
the pnp hardware id.
Mark Roddy
On Thu, Nov 11, 2010 at 11:15 AM, wrote:
> You need to report different hardware ID even if the same image mount to two disks as a boot and a non-boot. Change your code where you emulate a virtual disk.
>
> Igor Sharovar
>
>
> —
> 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
>
>Also uniqueness of disk device *hardware ids* is not usually required, rather the disk itself has >to provide a unique serial number as per the scsi and sata specs. The hardware id for a disk is >generally some non-unique manufacturer string, unless you meant something other than the >pnp hardware id.
I worked on the project which loads Windows on diskless computers and we faced similar problem as OP described. Some version Windows, I don’t remember which one, likely Vista and up, refuse mount the second disk with the same serial number. It is common problem for such systems/projects because hardware is emulated and to solve this the system needs advance configuration, which I expect OP will do. Such problem is not observed on “normal” system where Windows loaded from hard drive/USB device because it is loaded from hardware which has unique ID.
Igor Sharovar
Thank you all for your leads.
What you said is actually what I have not done. The PDOs that bus driver enumerated indeed have the same hardware ID. The disk device objects above those PDOs use different hardware ID.
To be honest, I am wondering about this, why it works well again after I reboot it?
BTW, Igor, I have heard of you as Julien told me. ![]()
Regards,
Ben