Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/taviso/loadlibrary.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCube <alessandro.devito91@gmail.com>2021-01-10 23:25:23 +0300
committerCube <alessandro.devito91@gmail.com>2021-01-10 23:25:23 +0300
commit8585b6352e8c90460e2b78fe6a4d90c5674e85b8 (patch)
tree5555a4766b25c232bc05f6a8f10a4ca6590c2429
parent829b960b50643b14d1af680f3bba231feb953d9d (diff)
Fixed GetLongPathNameW
-rw-r--r--peloader/winapi/Paths.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/peloader/winapi/Paths.c b/peloader/winapi/Paths.c
index 8a51aa8..6cb00ea 100644
--- a/peloader/winapi/Paths.c
+++ b/peloader/winapi/Paths.c
@@ -59,11 +59,11 @@ DWORD WINAPI GetLongPathNameW(LPCWSTR lpszShortPath,
DWORD cchBuffer)
{
// For now we just return the 8.3 format path as the long path
- if (cchBuffer > strlen(lpszShortPath)) {
- memcpy(lpszLongPath, lpszShortPath, sizeof(lpszShortPath));
+ if (cchBuffer > CountWideChars(lpszShortPath)) {
+ memcpy(lpszLongPath, lpszShortPath, CountWideChars(lpszShortPath) * sizeof(WCHAR));
}
- return strlen(lpszShortPath);
+ return CountWideChars(lpszShortPath);
}
DECLARE_CRT_EXPORT("GetTempPathW", GetTempPathW);