X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=sdk%2Flib%2Ffslib%2Fvfatlib%2Fcheck%2Fio.c;h=2eca2abdd4aac616b847f85fac077a26b43dae64;hp=17db7a1c8e76181475052da87e27305e57394900;hb=6a224a38a15bd3b02ce3b20eef3a3f2ccf68ab96;hpb=287d7cd80a5308624002a5d035bfdd7a56fc2c11;ds=sidebyside diff --git a/sdk/lib/fslib/vfatlib/check/io.c b/sdk/lib/fslib/vfatlib/check/io.c index 17db7a1c8e7..2eca2abdd4a 100644 --- a/sdk/lib/fslib/vfatlib/check/io.c +++ b/sdk/lib/fslib/vfatlib/check/io.c @@ -159,7 +159,7 @@ static off_t WIN32lseek(HANDLE fd, off_t offset, int whence) /******************************************************************************/ -void fs_open(PUNICODE_STRING DriveRoot, int read_write) +NTSTATUS fs_open(PUNICODE_STRING DriveRoot, int read_write) { NTSTATUS Status; OBJECT_ATTRIBUTES ObjectAttributes; @@ -180,11 +180,14 @@ void fs_open(PUNICODE_STRING DriveRoot, int read_write) if (!NT_SUCCESS(Status)) { DPRINT1("NtOpenFile() failed with status 0x%.08x\n", Status); - return; + return Status; } // If read_write is specified, then the volume should be exclusively locked - if (read_write) fs_lock(TRUE); + if (read_write) + { + Status = fs_lock(TRUE); + } // Query geometry and partition info, to have bytes per sector, etc @@ -192,6 +195,8 @@ void fs_open(PUNICODE_STRING DriveRoot, int read_write) changes = last = NULL; did_change = 0; + + return Status; } BOOLEAN fs_isdirty(void) @@ -231,6 +236,13 @@ NTSTATUS fs_lock(BOOLEAN LockVolume) if (!NT_SUCCESS(Status)) { DPRINT1("NtFsControlFile() failed with Status 0x%08x\n", Status); +#if 1 + /* FIXME: ReactOS HACK for 1stage due to IopParseDevice() hack */ + if (Status == STATUS_INVALID_DEVICE_REQUEST) + { + Status = STATUS_ACCESS_DENIED; + } +#endif } return Status;