6
0
mirror of https://github.com/JKornev/hidden synced 2024-06-20 14:08:05 +00:00

Windows 10 path normalization fix

This commit is contained in:
JKornev 2018-12-20 02:54:24 +03:00
parent 0e9e814c28
commit 7ad8dcaad3
2 changed files with 3 additions and 1 deletions

@ -207,6 +207,7 @@ NTSTATUS NormalizeDevicePath(PCUNICODE_STRING Path, PUNICODE_STRING Normalized)
return status;
// \Device\Harddisk0\Partition0\Windows -> \Device\Harddisk0\Partition0
// Win10: \Device\BootDevice\Windows -> \Device\BootDevice
winDir.Length = 0;
for (i = (resolvedLink.Length - sizeof(WCHAR)) / sizeof(WCHAR); i >= 0; i--)
@ -222,6 +223,7 @@ NTSTATUS NormalizeDevicePath(PCUNICODE_STRING Path, PUNICODE_STRING Normalized)
}
// \Device\Harddisk0\Partition0 -> \Device\HarddiskVolume1
// Win10: \Device\BootDevice -> \Device\HarddiskVolume2
status = ResolveSymbolicLink(&resolvedLink, Normalized);
if (!NT_SUCCESS(status))

@ -75,7 +75,7 @@ NTSTATUS QuerySystemInformation(SYSTEM_INFORMATION_CLASS Class, PVOID* InfoBuffe
NTSTATUS QueryProcessInformation(PROCESSINFOCLASS Class, HANDLE ProcessId, PVOID* InfoBuffer, PSIZE_T InfoSize);
VOID FreeInformation(PVOID Buffer);
#define NORMALIZE_INCREAMENT (USHORT)128
#define NORMALIZE_INCREAMENT (USHORT)0x200
NTSTATUS NormalizeDevicePath(PCUNICODE_STRING Path, PUNICODE_STRING Normalized);