[APPHELP] Try Dos and Nt path formats in SdbGetFileAttributes.

This commit is contained in:
Mark Jansen 2018-01-07 21:52:13 +01:00
parent 387067ad29
commit 0123f4745b

View File

@ -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))
{