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

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/Windows/ProcessUtils.h')
-rw-r--r--CPP/Windows/ProcessUtils.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/CPP/Windows/ProcessUtils.h b/CPP/Windows/ProcessUtils.h
index fb9e8dbb..c7226813 100644
--- a/CPP/Windows/ProcessUtils.h
+++ b/CPP/Windows/ProcessUtils.h
@@ -65,9 +65,9 @@ public:
{ return ::GetModuleBaseName(_handle, hModule, baseName, size); }
bool MyGetModuleBaseName(HMODULE hModule, CSysString &name)
{
- const int length = 1000;
- DWORD resultLen = MyGetModuleBaseName(hModule, name.GetBuffer(length), length);
- name.ReleaseBuffer();
+ const unsigned len = MAX_PATH + 100;
+ DWORD resultLen = MyGetModuleBaseName(hModule, name.GetBuf(len), len);
+ name.ReleaseBuf_CalcLen(len);
return (resultLen != 0);
}
@@ -75,9 +75,9 @@ public:
{ return ::GetModuleFileNameEx(_handle, hModule, baseName, size); }
bool MyGetModuleFileNameEx(HMODULE hModule, CSysString &name)
{
- const int length = MAX_PATH + 100;
- DWORD resultLen = MyGetModuleFileNameEx(hModule, name.GetBuffer(length), length);
- name.ReleaseBuffer();
+ const unsigned len = MAX_PATH + 100;
+ DWORD resultLen = MyGetModuleFileNameEx(hModule, name.GetBuf(len), len);
+ name.ReleaseBuf_CalcLen(len);
return (resultLen != 0);
}