1
0
Fork 0

DBG: updated DeviceNameResolver

This commit is contained in:
mrexodia 2016-06-27 01:05:23 +02:00
parent e626270bfc
commit 65c2a4dfee
No known key found for this signature in database
GPG Key ID: D72F9A4FAA0073B4
2 changed files with 7 additions and 7 deletions

View File

@ -8,12 +8,12 @@ extern "C"
{
#endif
__declspec(dllexport) bool DevicePathToPathW(const wchar_t* szDevicePath, wchar_t* szPath, size_t nSize);
__declspec(dllexport) bool DevicePathToPathA(const char* szDevicePath, char* szPath, size_t nSize);
__declspec(dllexport) bool DevicePathFromFileHandleW(HANDLE hFile, wchar_t* szDevicePath, size_t nSize);
__declspec(dllexport) bool DevicePathFromFileHandleA(HANDLE hFile, char* szDevicePath, size_t nSize);
__declspec(dllexport) bool PathFromFileHandleW(HANDLE hFile, wchar_t* szPath, size_t nSize);
__declspec(dllexport) bool PathFromFileHandleA(HANDLE hFile, char* szPath, size_t nSize);
__declspec(dllexport) bool DevicePathToPathW(const wchar_t* szDevicePath, wchar_t* szPath, size_t nSizeInChars);
__declspec(dllexport) bool DevicePathToPathA(const char* szDevicePath, char* szPath, size_t nSizeInChars);
__declspec(dllexport) bool DevicePathFromFileHandleW(HANDLE hFile, wchar_t* szDevicePath, size_t nSizeInChars);
__declspec(dllexport) bool DevicePathFromFileHandleA(HANDLE hFile, char* szDevicePath, size_t nSizeInChars);
__declspec(dllexport) bool PathFromFileHandleW(HANDLE hFile, wchar_t* szPath, size_t nSizeInChars);
__declspec(dllexport) bool PathFromFileHandleA(HANDLE hFile, char* szPath, size_t nSizeInChars);
#ifdef __cplusplus
}

View File

@ -230,7 +230,7 @@ bool GetFileNameFromProcessHandle(HANDLE hProcess, char* szFileName)
return false;
wchar_t wszFileName[MAX_PATH] = L"";
if(!DevicePathToPathW(wszDosFileName, wszFileName, MAX_PATH * sizeof(wchar_t)))
if(!DevicePathToPathW(wszDosFileName, wszFileName, _countof(wszFileName)))
return false;
strcpy_s(szFileName, MAX_PATH, StringUtils::Utf16ToUtf8(wszFileName).c_str());
return true;