diff options
Diffstat (limited to 'windirstat/getosplatformstring.cpp')
-rw-r--r-- | windirstat/getosplatformstring.cpp | 7 |
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) { |