https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0123f4745b359983fb6c0…
commit 0123f4745b359983fb6c0c47bc5f71d60be87c6f
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sun Jan 7 21:52:13 2018 +0100
[APPHELP] Try Dos and Nt path formats in SdbGetFileAttributes.
---
dll/appcompat/apphelp/sdbapi.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/dll/appcompat/apphelp/sdbapi.c b/dll/appcompat/apphelp/sdbapi.c
index f7d01f9935..ba60048ca5 100644
--- a/dll/appcompat/apphelp/sdbapi.c
+++ b/dll/appcompat/apphelp/sdbapi.c
@@ -177,15 +177,22 @@ BOOL WINAPI SdbpOpenMemMappedFile(LPCWSTR path, PMEMMAPPED mapping)
RtlZeroMemory(mapping, sizeof(*mapping));
- if(!RtlDosPathNameToNtPathName_U(path, &FileName, NULL, NULL))
- {
- RtlFreeUnicodeString(&FileName);
- return FALSE;
- }
+ RtlInitUnicodeString(&FileName, path);
InitializeObjectAttributes(&ObjectAttributes, &FileName,
OBJ_CASE_INSENSITIVE, NULL, NULL);
Status = NtOpenFile(&mapping->file, GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes, &IoStatusBlock, FILE_SHARE_READ,
FILE_SYNCHRONOUS_IO_NONALERT);
- RtlFreeUnicodeString(&FileName);
+
+ if (Status == STATUS_OBJECT_NAME_INVALID || Status == STATUS_OBJECT_PATH_SYNTAX_BAD)
+ {
+ if (!RtlDosPathNameToNtPathName_U(path, &FileName, NULL, NULL))
+ {
+ SHIM_ERR("Failed to convert %S to Nt path: 0x%lx\n", path,
Status);
+ return FALSE;
+ }
+ InitializeObjectAttributes(&ObjectAttributes, &FileName,
OBJ_CASE_INSENSITIVE, NULL, NULL);
+ Status = NtOpenFile(&mapping->file, GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes, &IoStatusBlock, FILE_SHARE_READ,
FILE_SYNCHRONOUS_IO_NONALERT);
+ RtlFreeUnicodeString(&FileName);
+ }
if (!NT_SUCCESS(Status))
{