diff options
Diffstat (limited to 'storage/class/disk/src')
| -rw-r--r-- | storage/class/disk/src/disk.c | 21 | ||||
| -rw-r--r-- | storage/class/disk/src/disk.vcxproj | 4 | ||||
| -rw-r--r-- | storage/class/disk/src/disk.vcxproj.Filters | 8 | ||||
| -rw-r--r-- | storage/class/disk/src/geometry.c | 4 | ||||
| -rw-r--r-- | storage/class/disk/src/pnp.c | 3 |
5 files changed, 26 insertions, 14 deletions
diff --git a/storage/class/disk/src/disk.c b/storage/class/disk/src/disk.c index 3d4d19b4..05f0d6d3 100644 --- a/storage/class/disk/src/disk.c +++ b/storage/class/disk/src/disk.c @@ -1550,6 +1550,7 @@ Return Value: PIO_STACK_LOCATION irpSp = NULL; PSTOR_ADDR_BTL8 storAddrBtl8; PSRBEX_DATA_SCSI_CDB16 srbExDataCdb16; + NTSTATUS SyncCacheStatus = STATUS_SUCCESS; // // Fill in the srb fields appropriately @@ -1623,7 +1624,7 @@ Return Value: TracePrint((TRACE_LEVEL_VERBOSE, TRACE_FLAG_SCSI, "DiskFlushDispatch: sending sync cache\n")); - ClassSendSrbSynchronous(Fdo, srb, NULL, 0, TRUE); + SyncCacheStatus = ClassSendSrbSynchronous(Fdo, srb, NULL, 0, TRUE); } // @@ -1669,7 +1670,7 @@ Return Value: irpSp->MajorFunction = IRP_MJ_SCSI; irpSp->Parameters.Scsi.Srb = srb; - IoSetCompletionRoutine(FlushContext->CurrIrp, DiskFlushComplete, NULL, TRUE, TRUE, TRUE); + IoSetCompletionRoutine(FlushContext->CurrIrp, DiskFlushComplete, (PVOID)SyncCacheStatus, TRUE, TRUE, TRUE); TracePrint((TRACE_LEVEL_VERBOSE, TRACE_FLAG_SCSI, "DiskFlushDispatch: sending srb flush on irp %p\n", FlushContext->CurrIrp)); @@ -1700,7 +1701,9 @@ Arguments: Fdo - The device object which requested the completion routine Irp - The irp that is being completed - Context - The flush group context + Context - If disk had write cache enabled and SYNC CACHE command was sent as 1st part of FLUSH processing + then context must carry the completion status of SYNC CACHE request, + else context must be set to STATUS_SUCCESS. Return Value: @@ -1713,8 +1716,7 @@ Return Value: NTSTATUS status; PFUNCTIONAL_DEVICE_EXTENSION fdoExt; PDISK_DATA diskData; - - UNREFERENCED_PARAMETER(Context); + NTSTATUS SyncCacheStatus = (NTSTATUS) Context; TracePrint((TRACE_LEVEL_VERBOSE, TRACE_FLAG_GENERAL, "DiskFlushComplete: %p %p\n", Fdo, Irp)); @@ -1742,6 +1744,15 @@ Return Value: NT_ASSERT(status != STATUS_MORE_PROCESSING_REQUIRED); // + // If sync cache failed earlier, final status of the flush request needs to be failure + // even if SRB_FUNCTION_FLUSH srb request succeeded + // + if (NT_SUCCESS(status) && + (!NT_SUCCESS(SyncCacheStatus))) { + Irp->IoStatus.Status = status = SyncCacheStatus; + } + + // // Complete the flush requests tagged to this one // diff --git a/storage/class/disk/src/disk.vcxproj b/storage/class/disk/src/disk.vcxproj index 1f52e370..bc5efddb 100644 --- a/storage/class/disk/src/disk.vcxproj +++ b/storage/class/disk/src/disk.vcxproj @@ -19,12 +19,12 @@ </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> - <ProjectGuid>{0900F953-9DAF-4C58-9137-45A2DEC9C62C}</ProjectGuid> + <ProjectGuid>{C4E8B1CC-0131-442C-8EB8-8E84F938878A}</ProjectGuid> <RootNamespace>$(MSBuildProjectName)</RootNamespace> <SupportsPackaging>false</SupportsPackaging> <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{6222553B-2B65-4267-9522-973010FB316D}</SampleGuid> + <SampleGuid>{1257A10C-96B8-46FB-9FFD-6726981343C7}</SampleGuid> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> diff --git a/storage/class/disk/src/disk.vcxproj.Filters b/storage/class/disk/src/disk.vcxproj.Filters index 1a2af052..5c982e78 100644 --- a/storage/class/disk/src/disk.vcxproj.Filters +++ b/storage/class/disk/src/disk.vcxproj.Filters @@ -3,19 +3,19 @@ <ItemGroup> <Filter Include="Source Files"> <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{9D58AF57-E3D3-492B-A93C-CD4BD860C101}</UniqueIdentifier> + <UniqueIdentifier>{5312DB94-F2AD-4908-9DC6-C3525D0469E6}</UniqueIdentifier> </Filter> <Filter Include="Header Files"> <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{5021C225-A54E-4A00-A24F-A0AEC3B6B92A}</UniqueIdentifier> + <UniqueIdentifier>{1EA3AD8C-6E4B-4964-A3D1-62178CDEC868}</UniqueIdentifier> </Filter> <Filter Include="Resource Files"> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{2092A6B9-C332-464C-B263-00060DE1B3E0}</UniqueIdentifier> + <UniqueIdentifier>{2A5B4A49-7B7B-4C84-9F4D-4B3B50FFA526}</UniqueIdentifier> </Filter> <Filter Include="Driver Files"> <Extensions>inf;inv;inx;mof;mc;</Extensions> - <UniqueIdentifier>{2F3C9ECA-BD6F-472C-915B-51096E28B70C}</UniqueIdentifier> + <UniqueIdentifier>{48E85F2C-8024-453C-8D4D-AFA7E6BB0AB7}</UniqueIdentifier> </Filter> </ItemGroup> <ItemGroup> diff --git a/storage/class/disk/src/geometry.c b/storage/class/disk/src/geometry.c index 911a33a4..a852c092 100644 --- a/storage/class/disk/src/geometry.c +++ b/storage/class/disk/src/geometry.c @@ -1358,8 +1358,8 @@ Return Value: // ISSUE-2000/5/24-henrygab - figure out if there's a way to keep // removals from happening while doing this. // - - for(deviceObject = DriverObject->DeviceObject, unmatchedDiskCount = 0; + unmatchedDiskCount = 0; + for(deviceObject = DriverObject->DeviceObject; deviceObject != NULL; #pragma prefast(suppress:28175, "Need to access the opaque field to scan through the list of disks") deviceObject = deviceObject->NextDevice) { diff --git a/storage/class/disk/src/pnp.c b/storage/class/disk/src/pnp.c index bb3a33c5..5eb333e7 100644 --- a/storage/class/disk/src/pnp.c +++ b/storage/class/disk/src/pnp.c @@ -122,9 +122,10 @@ Return Value: LEAVE; } - queryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; + queryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_TYPECHECK; queryTable[0].Name = L"RootPartitionMountable"; queryTable[0].EntryContext = &(rootPartitionMountable); + queryTable[0].DefaultType = (REG_DWORD << RTL_QUERY_REGISTRY_TYPECHECK_SHIFT) | REG_NONE; #pragma prefast(suppress:6309, "We don't have QueryRoutine so Context doesn't make any sense") status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, |
