summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-06-17 21:57:41 +0100
committerJose Fonseca <jfonseca@vmware.com>2015-06-25 14:32:10 +0100
commit1b685b0bb3a33b7b9eac254b4c4172903ef2eb38 (patch)
treef48d08a89814ee85f6fe80026501edc9651ec2b5
parent1d46c903de4562a9b24a602ac7b6d3ef281e28d6 (diff)
common: Use GetModuleHandle to detect WINE.
Simpler and safer.
-rw-r--r--common/highlight.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/common/highlight.cpp b/common/highlight.cpp
index 6a1e783b..334ba57e 100644
--- a/common/highlight.cpp
+++ b/common/highlight.cpp
@@ -254,10 +254,9 @@ haveAnsi(void)
}
// http://wiki.winehq.org/DeveloperFaq#detect-wine
- HMODULE hNtDll = LoadLibraryA("ntdll");
+ HMODULE hNtDll = GetModuleHandleA("ntdll");
if (hNtDll) {
result = GetProcAddress(hNtDll, "wine_get_version") != NULL;
- FreeLibrary(hNtDll);
}
checked = true;