diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index d25229b67..1d2bae8e1 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -1601,19 +1601,19 @@ unsigned int I_MakeRNGSeed() FString I_GetLongPathName(FString shortpath) { static TOptWin32Proc - GetLongPathName("kernel32.dll", "GetLongPathNameA", NULL); + GetLongPathNameA("kernel32.dll", "GetLongPathNameA"); // Doesn't exist on NT4 if (GetLongPathName == NULL) return shortpath; - DWORD buffsize = GetLongPathName.Call(shortpath.GetChars(), NULL, 0); + DWORD buffsize = GetLongPathNameA.Call(shortpath.GetChars(), NULL, 0); if (buffsize == 0) { // nothing to change (it doesn't exist, maybe?) return shortpath; } TCHAR *buff = new TCHAR[buffsize]; - DWORD buffsize2 = GetLongPathName.Call(shortpath.GetChars(), buff, buffsize); + DWORD buffsize2 = GetLongPathNameA.Call(shortpath.GetChars(), buff, buffsize); if (buffsize2 >= buffsize) { // Failure! Just return the short path delete[] buff; diff --git a/src/win32/i_system.h b/src/win32/i_system.h index 6872ca232..566ca1977 100644 --- a/src/win32/i_system.h +++ b/src/win32/i_system.h @@ -56,25 +56,20 @@ extern os_t OSPlatform; template class TOptWin32Proc { - static Proto GetOptionalWin32Proc(const char* module, const char* function, const char* alt) + static Proto GetOptionalWin32Proc(const char* module, const char* function) { HMODULE hmodule = GetModuleHandle(module); if (hmodule == NULL) return NULL; - Proto ret = (Proto)GetProcAddress(hmodule, function); - if(ret != NULL || alt == NULL) - return ret; - - // Lookup alternate function name (ex. ProcW -> ProcA) - return (Proto)GetProcAddress(hmodule, alt); + return (Proto)GetProcAddress(hmodule, function); } public: const Proto Call; - TOptWin32Proc(const char* module, const char* function, const char* alt=NULL) - : Call(GetOptionalWin32Proc(module, function, alt)) {} + TOptWin32Proc(const char* module, const char* function) + : Call(GetOptionalWin32Proc(module, function)) {} // Wrapper object can be tested against NULL, but not directly called. operator const void*() const { return Call; }