Created
July 18, 2017 18:09
-
-
Save Warepire/6d4530983859493ee2a982be70a36da0 to your computer and use it in GitHub Desktop.
Mega-hacky fix to allow remote mounted drives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index 940ab77..bebc562 100644 | |
--- a/source/application/wintaser.cpp | |
+++ b/source/application/wintaser.cpp | |
@@ -362,7 +362,20 @@ static std::wstring TranslateDeviceName(const std::wstring& filename) | |
size_t name_len = wcslen(name); | |
if (name_len < MAX_PATH) | |
{ | |
- found = (_wcsnicmp(filename.c_str(), name, name_len) == 0); | |
+ if (filename.find(L"\\Device\\Mup") == 0) // HACK! - Symbolic links can't be resolved properly for \\Device\\Mup paths. | |
+ { | |
+ std::wstring substr = filename.substr(wcslen(L"\\Device\\Mup")); | |
+ size_t substr_end = substr.find(L'\\'); | |
+ substr_end = substr.find(L'\\', substr_end + 1); // hostname | |
+ substr_end = substr.find(L'\\', substr_end + 1); // share name | |
+ substr = substr.substr(0, substr_end); | |
+ found = (wcsstr(name, substr.c_str()) != nullptr); | |
+ name_len = wcslen(L"\\Device\\Mup") + substr.size(); | |
+ } | |
+ else | |
+ { | |
+ found = (_wcsnicmp(filename.c_str(), name, name_len) == 0); | |
+ } | |
if (found) | |
{ | |
WCHAR temp_file[MAX_PATH]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment