Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool NtPathToDosPath(const wchar_t* ntPath, wchar_t* buffer, size_t length)
- {
- wchar_t device_name[3] = L"A:";
- wchar_t target_path[128];
- for (wchar_t i = L'A'; i <= L'Z'; ++i)
- {
- device_name[0] = i;
- if (QueryDosDeviceW(device_name, target_path, 128))
- {
- size_t target_length = wcslen(target_path);
- if (!_wcsnicmp(ntPath, target_path, target_length))
- {
- wcscpy_s(buffer, length, device_name);
- wcscat_s(buffer, length, ntPath + target_length);
- return true;
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement