startDevice () not called for all but first disk;

After I complete the IRP_MN_START_DEVICE in my upper disk filter driver for the first disk, I see that startDevice is not called for any other disks in the system.

StartDevice just gets called only once. Any clue why this is happening? Following is the code of my startDevice, output of !locks -v and !devstack. Thanks.

NTSTATUS MyFltrIdentifyDevices (IN PDEVICE_OBJECT DeviceObject)
{
PDEVICE_EXTENSION deviceExtension = DeviceObject->DeviceExtension;
ANSI_STRING signature;

PAGED_CODE ();
/* get disk IDENTIFY DATA using IOCTL_ATA_PASS_THROUGH
*/
if (!MyFltrGetIdentifyData (DeviceObject, &signature)) {
return (STATUS_SUCCESS);
}
/* now examine the IDENTIFY DATA
*/
ExAcquireFastMutexUnsafe (&MyFltrGlobal->DevicesLookupMutex);

if (MyFltrGlobal->Dev1) {
goto DEV2_LOOKUP;
}
if (!RtlEqualString (&MyFltrDataG->Dev1Signature,
&signature,
TRUE)) {
goto DEV2_LOOKUP;
}
MyDbgPrint (DPFLTR_INFO_LEVEL, “DEV1 [0x%x] found !!!\n”, DeviceObject);
MyFltrGlobal->Dev1 = DeviceObject;
/* Dev1 & Dev2 cannot be the same device
*/
goto END;

DEV2_LOOKUP:
if (MyFltrGlobal->Dev2) {
goto END;
}
if (!RtlEqualString (&MyFltrGlobal->Dev2Signature,
&signature,
TRUE)) {
goto END;
}
MyDbgPrint (DPFLTR_ERROR_LEVEL,
“DEV2 [0x%x] found !!!\n”,
DeviceObject);

MyFltrGlobal->Dev2 = DeviceObject;

END:
ExReleaseFastMutexUnsafe (&MyFltrGlobal->DevicesLookupMutex);

return (STATUS_SUCCESS);
}

NTSTATUS MyFltrStartDevice (IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PDEVICE_EXTENSION deviceExtension;
NTSTATUS status;

PAGED_CODE ();

deviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;

// copied from diskperf.c
status = MyFltrForwardIrpSynchronous (DeviceObject, Irp);
// copied from diskperf.c
MyFltrSyncFilterWithTarget (DeviceObject,
deviceExtension->TargetDeviceObject);
// copied from diskperf.c
MyFltrRegisterDevice (DeviceObject);
/* check if this the device I 'm looking for
*/
MyFltrIdentifyDevices (DeviceObject);
/* Complete the Irp
*/
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);

return (status);
}

0: kd> !locks -v
**** DUMP OF ALL RESOURCE OBJECTS ****

Resource @ nt!ExpFirmwareTableResource (0x8278e880) Available

Resource @ nt!PsLoadedModuleResource (0x827a1860) Available

Resource @ nt!MmSectionExtendResource (0x827a16e0) Available

Resource @ nt!MmSectionExtendSetResource (0x827a1720) Available

Resource @ nt!SepRmDbLock (0x8278bf98) Available

Resource @ nt!SepRmDbLock (0x8278bfd0) Available

Resource @ nt!SepRmDbLock (0x8278c008) Available

Resource @ nt!SepRmDbLock (0x8278c040) Available

Resource @ nt!SepRmGlobalSaclLock (0x8278c098) Available

Resource @ nt!SepLsaAuditQueueInfo (0x8278bf20) Available

Resource @ nt!SepLsaDeletedLogonQueueInfo (0x8278be70) Available

Resource @ 0x85238c38 Available

Resource @ nt!VdmIoListCreationResource (0x82799b80) Available

Resource @ nt!PnpRegistryDeviceResource (0x827bfda0) Available

Resource @ nt!PopPolicyLock (0x8279a4e0) Available

Resource @ 0x85275920 Available

Resource @ 0x85281650 Available

Resource @ CI!g_StoreLock (0x806ca8c0) Available

Resource @ nt!CmpRegistryLock (0x82785500) Available

Resource @ 0x852a2b60 Available

Resource @ 0x852a2ac0 Available

Resource @ 0x852a2a20 Available

Resource @ nt!ExpTimeRefreshLock (0x8278e900) Available

Resource @ 0x852a0008 Available

Resource @ 0x852a0040 Available

Resource @ 0x852a0078 Available

Resource @ 0x852a00b0 Available

Resource @ 0x852a00e8 Available

Resource @ 0x852a0120 Available

Resource @ 0x852a0158 Available

Resource @ 0x852a0190 Available

Resource @ 0x852a01c8 Available

Resource @ 0x852a0200 Available

Resource @ 0x852a0238 Available

Resource @ 0x852a0270 Available

Resource @ 0x852a02a8 Available

Resource @ 0x852a02e0 Available

Resource @ 0x852a0318 Available

Resource @ 0x852a0350 Available

Resource @ nt!IopDriverLoadResource (0x827c0720) Available

Resource @ nt!IopDatabaseResource (0x827c0760) Available

Resource @ nt!IopSecurityResource (0x827c06e0) Available

Resource @ nt!IopCrashDumpLock (0x827c0320) Available

Resource @ nt!PiDDBLock (0x827bfd00) Available

Resource @ nt!IopDeviceTreeLock (0x827bff00) Shared 1 owning threads
Threads: 85202a30-01<*>

THREAD 85202a30 Cid 0004.0008 Teb: 00000000 Win32Thread: 00000000 WAIT: (Executive) KernelMode Non-Alertable
80598600 NotificationEvent
IRP List:
8603dc18: (0006,01d8) Flags: 00060000 Mdl: 8603ddf8
Not impersonating
DeviceMap 8d005800
Owning Process 0 Image:
Attached Process 85202d08 Image: System
Wait Start TickCount 507 Ticks: 1027 (0:00:00:16.046)
Context Switch Count 527
UserTime 00:00:00.000
KernelTime 00:00:03.906
Win32 Start Address nt!Phase1Initialization (0x827df365)
Stack Init 80598fd0 Current 80598438 Base 80599000 Limit 80596000 Call 0
Priority 31 BasePriority 8 PriorityDecrement 0 IoPriority 2 PagePriority 5
ChildEBP RetAddr
80598450 8269a51d nt!KiSwapContext+0x26 (FPO: [Uses EBP] [0,0,4])
80598494 826e0460 nt!KiSwapThread+0x57b
805984e8 8269dcaf nt!KiCommitThreadWait+0x340
805985c4 8264b565 nt!KeWaitForSingleObject+0x3ee
80598610 827d279a nt!HalExamineMBR+0xb7
80598768 827c7398 nt!IopCreateArcName+0x170
80598770 8c098a91 nt!IoCreateArcName+0x10
805987d4 8c09dce1 partmgr!PmStartDevice+0x139 (FPO: [Non-Fpo])
805987f4 8c0971cc partmgr!PmPnp+0xe4 (FPO: [Non-Fpo])
80598808 826997ce partmgr!PmGlobalDispatch+0x1d (FPO: [Non-Fpo])
80598820 8281d987 nt!IofCallDriver+0x63
8059883c 8265e9bb nt!PnpAsynchronousCall+0x95
805988a0 82819ccd nt!PnpStartDevice+0xe1
805988fc 82819a46 nt!PnpStartDeviceNode+0x27c
80598918 8281c59e nt!PipProcessStartPhase1+0x65
80598b14 8265f837 nt!PipProcessDevNodeTree+0x188
80598b5c 8265f705 nt!PnpDeviceActionWorker+0x123
80598b74 829fcf2a nt!PnpRequestDeviceAction+0x11f
80598bec 829fed72 nt!IopInitializeBootDrivers+0x3bd
80598c64 82a04008 nt!IoInitSystem+0x5af
80598d44 827df372 nt!Phase1InitializationDiscard+0xbee
80598d4c 82849aad nt!Phase1Initialization+0xd
80598d90 82692535 nt!PspSystemThreadStartup+0x9e
00000000 00000000 nt!KiThreadStartup+0x19

Resource @ nt!IopSurpriseRemoveListLock (0x827bfec0) Available

Resource @ nt!PnpDevicePropertyLock (0x827bdde0) Available

Resource @ nt!PiEngineLock (0x827bfe80) Exclusively owned
Threads: 85202a30-01<*>

THREAD 85202a30 Cid 0004.0008 Teb: 00000000 Win32Thread: 00000000 WAIT: (Executive) KernelMode Non-Alertable
80598600 NotificationEvent
IRP List:
8603dc18: (0006,01d8) Flags: 00060000 Mdl: 8603ddf8
Not impersonating
DeviceMap 8d005800
Owning Process 0 Image:
Attached Process 85202d08 Image: System
Wait Start TickCount 507 Ticks: 1027 (0:00:00:16.046)
Context Switch Count 527
UserTime 00:00:00.000
KernelTime 00:00:03.906
Win32 Start Address nt!Phase1Initialization (0x827df365)
Stack Init 80598fd0 Current 80598438 Base 80599000 Limit 80596000 Call 0
Priority 31 BasePriority 8 PriorityDecrement 0 IoPriority 2 PagePriority 5
ChildEBP RetAddr
80598450 8269a51d nt!KiSwapContext+0x26 (FPO: [Uses EBP] [0,0,4])
80598494 826e0460 nt!KiSwapThread+0x57b
805984e8 8269dcaf nt!KiCommitThreadWait+0x340
805985c4 8264b565 nt!KeWaitForSingleObject+0x3ee
80598610 827d279a nt!HalExamineMBR+0xb7
80598768 827c7398 nt!IopCreateArcName+0x170
80598770 8c098a91 nt!IoCreateArcName+0x10
805987d4 8c09dce1 partmgr!PmStartDevice+0x139 (FPO: [Non-Fpo])
805987f4 8c0971cc partmgr!PmPnp+0xe4 (FPO: [Non-Fpo])
80598808 826997ce partmgr!PmGlobalDispatch+0x1d (FPO: [Non-Fpo])
80598820 8281d987 nt!IofCallDriver+0x63
8059883c 8265e9bb nt!PnpAsynchronousCall+0x95
805988a0 82819ccd nt!PnpStartDevice+0xe1
805988fc 82819a46 nt!PnpStartDeviceNode+0x27c
80598918 8281c59e nt!PipProcessStartPhase1+0x65
80598b14 8265f837 nt!PipProcessDevNodeTree+0x188
80598b5c 8265f705 nt!PnpDeviceActionWorker+0x123
80598b74 829fcf2a nt!PnpRequestDeviceAction+0x11f
80598bec 829fed72 nt!IopInitializeBootDrivers+0x3bd
80598c64 82a04008 nt!IoInitSystem+0x5af
80598d44 827df372 nt!Phase1InitializationDiscard+0xbee
80598d4c 82849aad nt!Phase1Initialization+0xd
80598d90 82692535 nt!PspSystemThreadStartup+0x9e
00000000 00000000 nt!KiThreadStartup+0x19

Resource @ nt!PiDependencyRelationsLock (0x827bfe20) Available

Resource @ 0x8525cb10 Available

Resource @ 0x852afa70 Available

Resource @ 0x852afa30 Available

Resource @ 0x852af9f0 Available

Resource @ 0x852af9b0 Available

Resource @ 0x852af970 Available

Resource @ nt!g_CacheLock (0x8278dec0) Available

Resource @ nt!g_ServiceLock (0x8278de80) Available

Resource @ WDFLDR!WdfLdrGlobals (0x807e815c) Available

Resource @ NETIO!NsipCachedRegistryKeyListLock (0x8c361420) Available

Resource @ 0x851a7e98 Available

Resource @ 0x85b841d0 Available

Resource @ 0x85201ad0 Available

Resource @ 0x85efa500 Available

Resource @ 0x85f152e0 Available

Resource @ 0x85f1b600 Available

Resource @ 0x851fe728 Available

Resource @ 0x85f2d748 Available

Resource @ fltmgr!FltGlobals (0x8c168900) Available

Resource @ 0x85f2bdd4 Available

Resource @ 0x85f2bce4 Available

Resource @ 0x85f2bd28 Available

Resource @ 0x85f5b5f0 Available

Resource @ 0x85f6774c Available

Resource @ 0x85f2ae04 Available

Resource @ 0x85f2ae44 Available

Resource @ 0x85f2ae84 Available

Resource @ 0x85f2aec4 Available

Resource @ 0x85f2af04 Available

Resource @ 0x85f2af44 Available

Resource @ 0x85f2af84 Available

Resource @ 0x85f2afc4 Available

Resource @ cng!g_PrvReg (0x8c262ef8) Available

Resource @ 0x85f20218 Available

Resource @ cng!g_PrvReg (0x8c262eb8) Available

Resource @ cng!g_CfgReg (0x8c262e70) Available

Resource @ 0x85f201d8 Available

Resource @ ndis!SharedMemoryResource (0x8c2b9f88) Available

Resource @ 0x85f74700 Available

Resource @ 0x85286000 Available

Resource @ 0x85282000 Available

Resource @ Ntfs!NtfsData (0x8c6475e8) Available

Resource @ Ntfs!NtfsData (0x8c647694) Available

Resource @ Ntfs!NtfsData (0x8c647414) Available

Resource @ Ntfs!SqmData (0x8c646718) Available

Resource @ Ntfs!LfsData (0x8c64b710) Available

Resource @ mup!MupProviderTable (0x8c7a7214) Available

Resource @ mup!MupiSurrogateList (0x8c7a7194) Available

Resource @ 0x8527c9f8 Available

Resource @ 0x8527cc9c Available

Resource @ 0x8527cce0 Available

Resource @ 0x8527cdc0 Available
101 total locks, 2 locks currently held

!devstack 8603A5C0
!DevObj !DrvObj !DevExt ObjectName
8603b020 \Driver\partmgr 8603b0d8
> 8603a5c0 \Driver\myfltr 8603a678
8603a9d0 \Driver\Disk 8603aa88
85294660 \Driver\ACPI 85201cb8
85f5b940 \Driver\atapi 85f5b9f8
!DevNode 85f66e88 :
DeviceInst is “IDE\DiskST3160815AS __________________________4.AAB \5&2b98b2e5&0&0.0.0”
ServiceName is “disk”

Do you have code which pends reads or writes? It looks like the hal is reading the mbr and waiting for that to finish. Maybe your filter pended its io.

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@yahoo.com
Sent: Friday, May 29, 2009 8:10 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] startDevice () not called for all but first disk;

After I complete the IRP_MN_START_DEVICE in my upper disk filter driver for the first disk, I see that startDevice is not called for any other disks in the system.

StartDevice just gets called only once. Any clue why this is happening? Following is the code of my startDevice, output of !locks -v and !devstack. Thanks.

NTSTATUS MyFltrIdentifyDevices (IN PDEVICE_OBJECT DeviceObject)
{
PDEVICE_EXTENSION deviceExtension = DeviceObject->DeviceExtension;
ANSI_STRING signature;

PAGED_CODE ();
/* get disk IDENTIFY DATA using IOCTL_ATA_PASS_THROUGH
/
if (!MyFltrGetIdentifyData (DeviceObject, &signature)) {
return (STATUS_SUCCESS);
}
/
now examine the IDENTIFY DATA
/
ExAcquireFastMutexUnsafe (&MyFltrGlobal->DevicesLookupMutex);

if (MyFltrGlobal->Dev1) {
goto DEV2_LOOKUP;
}
if (!RtlEqualString (&MyFltrDataG->Dev1Signature,
&signature,
TRUE)) {
goto DEV2_LOOKUP;
}
MyDbgPrint (DPFLTR_INFO_LEVEL, “DEV1 [0x%x] found !!!\n”, DeviceObject);
MyFltrGlobal->Dev1 = DeviceObject;
/
Dev1 & Dev2 cannot be the same device
/
goto END;

DEV2_LOOKUP:
if (MyFltrGlobal->Dev2) {
goto END;
}
if (!RtlEqualString (&MyFltrGlobal->Dev2Signature,
&signature,
TRUE)) {
goto END;
}
MyDbgPrint (DPFLTR_ERROR_LEVEL,
“DEV2 [0x%x] found !!!\n”,
DeviceObject);

MyFltrGlobal->Dev2 = DeviceObject;

END:
ExReleaseFastMutexUnsafe (&MyFltrGlobal->DevicesLookupMutex);

return (STATUS_SUCCESS);
}

NTSTATUS MyFltrStartDevice (IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PDEVICE_EXTENSION deviceExtension;
NTSTATUS status;

PAGED_CODE ();

deviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;

// copied from diskperf.c
status = MyFltrForwardIrpSynchronous (DeviceObject, Irp);
// copied from diskperf.c
MyFltrSyncFilterWithTarget (DeviceObject,
deviceExtension->TargetDeviceObject);
// copied from diskperf.c
MyFltrRegisterDevice (DeviceObject);
/
check if this the device I 'm looking for
/
MyFltrIdentifyDevices (DeviceObject);
/
Complete the Irp
/
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);

return (status);
}

0: kd> !locks -v
DUMP OF ALL RESOURCE OBJECTS

Resource @ nt!ExpFirmwareTableResource (0x8278e880) Available

Resource @ nt!PsLoadedModuleResource (0x827a1860) Available

Resource @ nt!MmSectionExtendResource (0x827a16e0) Available

Resource @ nt!MmSectionExtendSetResource (0x827a1720) Available

Resource @ nt!SepRmDbLock (0x8278bf98) Available

Resource @ nt!SepRmDbLock (0x8278bfd0) Available

Resource @ nt!SepRmDbLock (0x8278c008) Available

Resource @ nt!SepRmDbLock (0x8278c040) Available

Resource @ nt!SepRmGlobalSaclLock (0x8278c098) Available

Resource @ nt!SepLsaAuditQueueInfo (0x8278bf20) Available

Resource @ nt!SepLsaDeletedLogonQueueInfo (0x8278be70) Available

Resource @ 0x85238c38 Available

Resource @ nt!VdmIoListCreationResource (0x82799b80) Available

Resource @ nt!PnpRegistryDeviceResource (0x827bfda0) Available

Resource @ nt!PopPolicyLock (0x8279a4e0) Available

Resource @ 0x85275920 Available

Resource @ 0x85281650 Available

Resource @ CI!g_StoreLock (0x806ca8c0) Available

Resource @ nt!CmpRegistryLock (0x82785500) Available

Resource @ 0x852a2b60 Available

Resource @ 0x852a2ac0 Available

Resource @ 0x852a2a20 Available

Resource @ nt!ExpTimeRefreshLock (0x8278e900) Available

Resource @ 0x852a0008 Available

Resource @ 0x852a0040 Available

Resource @ 0x852a0078 Available

Resource @ 0x852a00b0 Available

Resource @ 0x852a00e8 Available

Resource @ 0x852a0120 Available

Resource @ 0x852a0158 Available

Resource @ 0x852a0190 Available

Resource @ 0x852a01c8 Available

Resource @ 0x852a0200 Available

Resource @ 0x852a0238 Available

Resource @ 0x852a0270 Available

Resource @ 0x852a02a8 Available

Resource @ 0x852a02e0 Available

Resource @ 0x852a0318 Available

Resource @ 0x852a0350 Available

Resource @ nt!IopDriverLoadResource (0x827c0720) Available

Resource @ nt!IopDatabaseResource (0x827c0760) Available

Resource @ nt!IopSecurityResource (0x827c06e0) Available

Resource @ nt!IopCrashDumpLock (0x827c0320) Available

Resource @ nt!PiDDBLock (0x827bfd00) Available

Resource @ nt!IopDeviceTreeLock (0x827bff00) Shared 1 owning threads
Threads: 85202a30-01<
>

THREAD 85202a30 Cid 0004.0008 Teb: 00000000 Win32Thread: 00000000 WAIT: (Executive) KernelMode Non-Alertable
80598600 NotificationEvent
IRP List:
8603dc18: (0006,01d8) Flags: 00060000 Mdl: 8603ddf8
Not impersonating
DeviceMap 8d005800
Owning Process 0 Image:
Attached Process 85202d08 Image: System
Wait Start TickCount 507 Ticks: 1027 (0:00:00:16.046)
Context Switch Count 527
UserTime 00:00:00.000
KernelTime 00:00:03.906
Win32 Start Address nt!Phase1Initialization (0x827df365)
Stack Init 80598fd0 Current 80598438 Base 80599000 Limit 80596000 Call 0
Priority 31 BasePriority 8 PriorityDecrement 0 IoPriority 2 PagePriority 5
ChildEBP RetAddr
80598450 8269a51d nt!KiSwapContext+0x26 (FPO: [Uses EBP] [0,0,4])
80598494 826e0460 nt!KiSwapThread+0x57b
805984e8 8269dcaf nt!KiCommitThreadWait+0x340
805985c4 8264b565 nt!KeWaitForSingleObject+0x3ee
80598610 827d279a nt!HalExamineMBR+0xb7
80598768 827c7398 nt!IopCreateArcName+0x170
80598770 8c098a91 nt!IoCreateArcName+0x10
805987d4 8c09dce1 partmgr!PmStartDevice+0x139 (FPO: [Non-Fpo])
805987f4 8c0971cc partmgr!PmPnp+0xe4 (FPO: [Non-Fpo])
80598808 826997ce partmgr!PmGlobalDispatch+0x1d (FPO: [Non-Fpo])
80598820 8281d987 nt!IofCallDriver+0x63
8059883c 8265e9bb nt!PnpAsynchronousCall+0x95
805988a0 82819ccd nt!PnpStartDevice+0xe1
805988fc 82819a46 nt!PnpStartDeviceNode+0x27c
80598918 8281c59e nt!PipProcessStartPhase1+0x65
80598b14 8265f837 nt!PipProcessDevNodeTree+0x188
80598b5c 8265f705 nt!PnpDeviceActionWorker+0x123
80598b74 829fcf2a nt!PnpRequestDeviceAction+0x11f
80598bec 829fed72 nt!IopInitializeBootDrivers+0x3bd
80598c64 82a04008 nt!IoInitSystem+0x5af
80598d44 827df372 nt!Phase1InitializationDiscard+0xbee
80598d4c 82849aad nt!Phase1Initialization+0xd
80598d90 82692535 nt!PspSystemThreadStartup+0x9e
00000000 00000000 nt!KiThreadStartup+0x19

Resource @ nt!IopSurpriseRemoveListLock (0x827bfec0) Available

Resource @ nt!PnpDevicePropertyLock (0x827bdde0) Available

Resource @ nt!PiEngineLock (0x827bfe80) Exclusively owned
Threads: 85202a30-01<*>

THREAD 85202a30 Cid 0004.0008 Teb: 00000000 Win32Thread: 00000000 WAIT: (Executive) KernelMode Non-Alertable
80598600 NotificationEvent
IRP List:
8603dc18: (0006,01d8) Flags: 00060000 Mdl: 8603ddf8
Not impersonating
DeviceMap 8d005800
Owning Process 0 Image:
Attached Process 85202d08 Image: System
Wait Start TickCount 507 Ticks: 1027 (0:00:00:16.046)
Context Switch Count 527
UserTime 00:00:00.000
KernelTime 00:00:03.906
Win32 Start Address nt!Phase1Initialization (0x827df365)
Stack Init 80598fd0 Current 80598438 Base 80599000 Limit 80596000 Call 0
Priority 31 BasePriority 8 PriorityDecrement 0 IoPriority 2 PagePriority 5
ChildEBP RetAddr
80598450 8269a51d nt!KiSwapContext+0x26 (FPO: [Uses EBP] [0,0,4])
80598494 826e0460 nt!KiSwapThread+0x57b
805984e8 8269dcaf nt!KiCommitThreadWait+0x340
805985c4 8264b565 nt!KeWaitForSingleObject+0x3ee
80598610 827d279a nt!HalExamineMBR+0xb7
80598768 827c7398 nt!IopCreateArcName+0x170
80598770 8c098a91 nt!IoCreateArcName+0x10
805987d4 8c09dce1 partmgr!PmStartDevice+0x139 (FPO: [Non-Fpo])
805987f4 8c0971cc partmgr!PmPnp+0xe4 (FPO: [Non-Fpo])
80598808 826997ce partmgr!PmGlobalDispatch+0x1d (FPO: [Non-Fpo])
80598820 8281d987 nt!IofCallDriver+0x63
8059883c 8265e9bb nt!PnpAsynchronousCall+0x95
805988a0 82819ccd nt!PnpStartDevice+0xe1
805988fc 82819a46 nt!PnpStartDeviceNode+0x27c
80598918 8281c59e nt!PipProcessStartPhase1+0x65
80598b14 8265f837 nt!PipProcessDevNodeTree+0x188
80598b5c 8265f705 nt!PnpDeviceActionWorker+0x123
80598b74 829fcf2a nt!PnpRequestDeviceAction+0x11f
80598bec 829fed72 nt!IopInitializeBootDrivers+0x3bd
80598c64 82a04008 nt!IoInitSystem+0x5af
80598d44 827df372 nt!Phase1InitializationDiscard+0xbee
80598d4c 82849aad nt!Phase1Initialization+0xd
80598d90 82692535 nt!PspSystemThreadStartup+0x9e
00000000 00000000 nt!KiThreadStartup+0x19

Resource @ nt!PiDependencyRelationsLock (0x827bfe20) Available

Resource @ 0x8525cb10 Available

Resource @ 0x852afa70 Available

Resource @ 0x852afa30 Available

Resource @ 0x852af9f0 Available

Resource @ 0x852af9b0 Available

Resource @ 0x852af970 Available

Resource @ nt!g_CacheLock (0x8278dec0) Available

Resource @ nt!g_ServiceLock (0x8278de80) Available

Resource @ WDFLDR!WdfLdrGlobals (0x807e815c) Available

Resource @ NETIO!NsipCachedRegistryKeyListLock (0x8c361420) Available

Resource @ 0x851a7e98 Available

Resource @ 0x85b841d0 Available

Resource @ 0x85201ad0 Available

Resource @ 0x85efa500 Available

Resource @ 0x85f152e0 Available

Resource @ 0x85f1b600 Available

Resource @ 0x851fe728 Available

Resource @ 0x85f2d748 Available

Resource @ fltmgr!FltGlobals (0x8c168900) Available

Resource @ 0x85f2bdd4 Available

Resource @ 0x85f2bce4 Available

Resource @ 0x85f2bd28 Available

Resource @ 0x85f5b5f0 Available

Resource @ 0x85f6774c Available

Resource @ 0x85f2ae04 Available

Resource @ 0x85f2ae44 Available

Resource @ 0x85f2ae84 Available

Resource @ 0x85f2aec4 Available

Resource @ 0x85f2af04 Available

Resource @ 0x85f2af44 Available

Resource @ 0x85f2af84 Available

Resource @ 0x85f2afc4 Available

Resource @ cng!g_PrvReg (0x8c262ef8) Available

Resource @ 0x85f20218 Available

Resource @ cng!g_PrvReg (0x8c262eb8) Available

Resource @ cng!g_CfgReg (0x8c262e70) Available

Resource @ 0x85f201d8 Available

Resource @ ndis!SharedMemoryResource (0x8c2b9f88) Available

Resource @ 0x85f74700 Available

Resource @ 0x85286000 Available

Resource @ 0x85282000 Available

Resource @ Ntfs!NtfsData (0x8c6475e8) Available

Resource @ Ntfs!NtfsData (0x8c647694) Available

Resource @ Ntfs!NtfsData (0x8c647414) Available

Resource @ Ntfs!SqmData (0x8c646718) Available

Resource @ Ntfs!LfsData (0x8c64b710) Available

Resource @ mup!MupProviderTable (0x8c7a7214) Available

Resource @ mup!MupiSurrogateList (0x8c7a7194) Available

Resource @ 0x8527c9f8 Available

Resource @ 0x8527cc9c Available

Resource @ 0x8527cce0 Available

Resource @ 0x8527cdc0 Available
101 total locks, 2 locks currently held

!devstack 8603A5C0
!DevObj !DrvObj !DevExt ObjectName
8603b020 \Driver\partmgr 8603b0d8
> 8603a5c0 \Driver\myfltr 8603a678
8603a9d0 \Driver\Disk 8603aa88
85294660 \Driver\ACPI 85201cb8
85f5b940 \Driver\atapi 85f5b9f8
!DevNode 85f66e88 :
DeviceInst is “IDE\DiskST3160815AS __________________________4.AAB \5&2b98b2e5&0&0.0.0”
ServiceName is “disk”


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

Yes MyFltrReadWrite pends (and queues) the initial IO on DEV1 until MyFltr driver has detected both DEV1 and DEV2. Once they are detected all the queued IO on DEV1 is processed. But what puzzles me is that how pending io on disk can affect the startDevice of another disk?

I have tested this on several machines and it works fine but on this specific machine, I never see a startDevice for all but the first disk.

Your design is broken. you are blocking a pnp start irp from completing, by blocking an mbr read by the hal. One of your stacks clearly shows this.

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@yahoo.com
Sent: Saturday, May 30, 2009 12:30 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] startDevice () not called for all but first disk;

Yes MyFltrReadWrite pends (and queues) the initial IO on DEV1 until MyFltr driver has detected both DEV1 and DEV2. Once they are detected all the queued IO on DEV1 is processed. But what puzzles me is that how pending io on disk can affect the startDevice of another disk?

I have tested this on several machines and it works fine but on this specific machine, I never see a startDevice for all but the first disk.


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

My assumption was that any io will be started only after all the devices have started. Is it incorrect? Do you have any suggestions on how can I achieve my objective of identifying both DEV1 and DEV2 before I can serve any io for DEV1 (where DEV1 is the boot device). Thanks.

What are you trying to accomplish by doing this?

  • S

-----Original Message-----
From: xxxxx@yahoo.com
Sent: Saturday, May 30, 2009 11:47
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] startDevice () not called for all but first disk;

My assumption was that any io will be started only after all the devices have started. Is it incorrect? Do you have any suggestions on how can I achieve my objective of identifying both DEV1 and DEV2 before I can serve any io for DEV1 (where DEV1 is the boot device). Thanks.


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

Every write to DEV1 should go to DEV2 also and while reading back from DEV1 I want to verify that data from both the disks are same.

Device mirroring using a filter driver is difficult because of the
need to hide one of the devices from stack components above the
filter.

An intermediate driver that exposes one upper device object for N
lower device objects, effectively hiding those lower device objects
from the upper drivers on the stack works better.

On Saturday, May 30, 2009, wrote:
> Every write to DEV1 should go to DEV2 also and while reading back from DEV1 I want to verify that data from both the disks are same.
>
> —
> 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
>


Mark Roddy

>> An intermediate driver that exposes one upper device object for N lower device objects, effectively hiding those lower device objects from the upper drivers on the stack works better.

And what/where would that driver be? Thanks.

You would write that driver. Generally you would also need bus filter
driver functionality to change the pnp ids of the lower devices you
are currently filtering into new pnp ids that your intermediate mux
driver is the function driver for. The intermediate driver produces
new device objects on its upper edge that match the expectations of
the driver that was above your filter driver. In this fashion your
intermediate driver inserts itself into an existing stack (such as the
storage stack) and can do useful things like mirroring data. Of course
then you will have the next problem: how to get this through WHQL. Bus
filtering and intermediate driver can of course all be one driver that
performs multiple roles.

Mark Roddy

On Sat, May 30, 2009 at 11:55 PM, wrote:
>>> An intermediate driver that exposes one upper device object for N lower device objects, effectively hiding those lower device objects from the upper drivers on the stack works better.
>
> And what/where would that driver be? Thanks.
>
> —
> 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
>