Updated ntdll-NtDevicePath patchset

This commit is contained in:
Alistair Leslie-Hughes 2020-04-01 17:08:26 +11:00
parent 7757a2d4f6
commit db80e169c7

View File

@ -90,7 +90,7 @@ index 32699fe3cc4..97b42398bb0 100644
+ while (!NtQueryDirectoryObject( handle, info, sizeof(data), TRUE, FALSE, &ctx, NULL ))
+ {
+ if (read_nt_symlink( handle, &info->ObjectName, symlinkW, MAX_DIR_ENTRY_LEN )) continue;
+ if (strlenW( symlinkW ) != length || memicmpW( symlinkW, name, length )) continue;
+ if (wcslen( symlinkW ) != length || memicmpW( symlinkW, name, length )) continue;
+ if (info->ObjectName.Length != 2 * sizeof(WCHAR) || info->ObjectName.Buffer[1] != ':') continue;
+
+ *device_ret = info->ObjectName.Buffer[0];
@ -139,7 +139,7 @@ index 32699fe3cc4..97b42398bb0 100644
+ else
+ return nt_to_unix_file_name_internal( nameW, unix_name_ret, disposition, check_case );
+
+ name_len = sizeof(dosprefixW) + strlenW(prefix) * sizeof(WCHAR) +
+ name_len = sizeof(dosprefixW) + wcslen(prefix) * sizeof(WCHAR) +
+ nameW->Length - offset * sizeof(WCHAR) + sizeof(WCHAR);
+ if (!(name = RtlAllocateHeap( GetProcessHeap(), 0, name_len )))
+ return STATUS_NO_MEMORY;
@ -147,8 +147,8 @@ index 32699fe3cc4..97b42398bb0 100644
+ ptr = name;
+ memcpy( ptr, dosprefixW, sizeof(dosprefixW) );
+ ptr += sizeof(dosprefixW) / sizeof(WCHAR);
+ strcpyW( ptr, prefix );
+ ptr += strlenW(ptr);
+ wcscpy( ptr, prefix );
+ ptr += wcslen(ptr);
+ memcpy( ptr, nameW->Buffer + offset, nameW->Length - offset * sizeof(WCHAR) );
+ ptr[ nameW->Length / sizeof(WCHAR) - offset ] = 0;
+