summaryrefslogtreecommitdiff
path: root/Nt32Pkg
diff options
context:
space:
mode:
Diffstat (limited to 'Nt32Pkg')
-rw-r--r--Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c b/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c
index 1e12dd5204..12924e659f 100644
--- a/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c
+++ b/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c
@@ -1,6 +1,6 @@
/**@file
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -990,11 +990,15 @@ WinNtBlockIoWriteBlocks (
// According the Windows requirement, first need to lock the volume before
// write to it.
//
- Locked = Private->WinNtThunk->DeviceIoControl (Private->NtHandle, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &BytesReturned, NULL);
- if (Locked == 0) {
- DEBUG ((EFI_D_INIT, "ReadBlocks: Lock volume failed. (%d)\n", Private->WinNtThunk->GetLastError ()));
- Status = WinNtBlockIoError (Private);
- goto Done;
+ if (Private->DeviceType == EfiWinNtPhysicalDisks) {
+ Locked = Private->WinNtThunk->DeviceIoControl (Private->NtHandle, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &BytesReturned, NULL);
+ if (Locked == 0) {
+ DEBUG ((EFI_D_INIT, "ReadBlocks: Lock volume failed. (%d)\n", Private->WinNtThunk->GetLastError ()));
+ Status = WinNtBlockIoError (Private);
+ goto Done;
+ }
+ } else {
+ Locked = 0;
}
Flag = Private->WinNtThunk->WriteFile (Private->NtHandle, Buffer, (DWORD) BufferSize, (LPDWORD) &BytesWritten, NULL);
if (Locked != 0) {