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

github.com/windirstat/windirstat.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'windirstat/getosplatformstring.cpp')
-rw-r--r--windirstat/getosplatformstring.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/windirstat/getosplatformstring.cpp b/windirstat/getosplatformstring.cpp
index 7e6f2ac..e04494d 100644
--- a/windirstat/getosplatformstring.cpp
+++ b/windirstat/getosplatformstring.cpp
@@ -45,7 +45,12 @@ CString GetOsPlatformString()
if(!RtlGetVersion)
{
- *(FARPROC*)&RtlGetVersion = GetProcAddress(GetModuleHandle(_T("ntdll.dll")), "RtlGetVersion");
+ HMODULE hNtDll = GetModuleHandle(_T("ntdll.dll"));
+ if(!hNtDll)
+ {
+ return LoadString(IDS__UNKNOWN_);
+ }
+ *(FARPROC*)&RtlGetVersion = GetProcAddress(hNtDll, "RtlGetVersion");
ASSERT(RtlGetVersion != NULL);
if(!RtlGetVersion)
{