summaryrefslogtreecommitdiffstats
path: root/win/tclWinInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r--win/tclWinInit.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 0574c37..afa6bf4 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -17,7 +17,7 @@
#include <lmcons.h>
/*
- * GetUserName() is found in advapi32.dll
+ * GetUserNameW() is found in advapi32.dll
*/
#ifdef _MSC_VER
# pragma comment(lib, "advapi32.lib")
@@ -166,7 +166,7 @@ TclpInitPlatform(void)
/*
* Fill available functions depending on windows version
*/
- handle = GetModuleHandle(TEXT("KERNEL32"));
+ handle = GetModuleHandleW(L"KERNEL32");
tclWinProcs.cancelSynchronousIo =
(BOOL (WINAPI *)(HANDLE)) GetProcAddress(handle,
"CancelSynchronousIo");
@@ -525,15 +525,15 @@ TclpGetUserName(
Tcl_DStringInit(bufferPtr);
if (TclGetEnv("USERNAME", bufferPtr) == NULL) {
- TCHAR szUserName[UNLEN+1];
+ WCHAR szUserName[UNLEN+1];
DWORD cchUserNameLen = UNLEN;
- if (!GetUserName(szUserName, &cchUserNameLen)) {
+ if (!GetUserNameW(szUserName, &cchUserNameLen)) {
return NULL;
}
cchUserNameLen--;
- cchUserNameLen *= sizeof(TCHAR);
- Tcl_WinTCharToUtf(szUserName, cchUserNameLen, bufferPtr);
+ cchUserNameLen *= sizeof(WCHAR);
+ Tcl_WinTCharToUtf((TCHAR *)szUserName, cchUserNameLen, bufferPtr);
}
return Tcl_DStringValue(bufferPtr);
}
@@ -573,7 +573,7 @@ TclpSetVariables(
TclGetProcessGlobalValue(&defaultLibraryDir), TCL_GLOBAL_ONLY);
if (!osInfoInitialized) {
- HMODULE handle = GetModuleHandle(TEXT("NTDLL"));
+ HMODULE handle = GetModuleHandleW(L"NTDLL");
int(__stdcall *getversion)(void *) =
(int(__stdcall *)(void *)) GetProcAddress(handle, "RtlGetVersion");
osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);