summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclPlatDecls.h2
-rw-r--r--unix/tclSelectNotfy.c6
-rw-r--r--win/tclWin32Dll.c12
-rw-r--r--win/tclWinChan.c4
-rw-r--r--win/tclWinFCmd.c124
-rw-r--r--win/tclWinFile.c82
-rw-r--r--win/tclWinInit.c10
-rw-r--r--win/tclWinLoad.c4
-rw-r--r--win/tclWinNotify.c16
-rw-r--r--win/tclWinPipe.c40
-rw-r--r--win/tclWinSerial.c6
-rw-r--r--win/tclWinSock.c18
-rw-r--r--win/tclWinTest.c4
13 files changed, 164 insertions, 164 deletions
diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h
index 354d752..edf1ba3 100644
--- a/generic/tclPlatDecls.h
+++ b/generic/tclPlatDecls.h
@@ -125,7 +125,7 @@ extern const TclPlatStubs *tclPlatStubsPtr;
#define Tcl_WinUtfToTChar(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \
(TCHAR *)Tcl_UtfToChar16DString((string), (len), (dsPtr)))
#define Tcl_WinTCharToUtf(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \
- (char *)Tcl_Char16ToUtfDString((string), ((((len) + 2) >> 1) - 1), (dsPtr)))
+ (char *)Tcl_Char16ToUtfDString((const unsigned short *)(string), ((((len) + 2) >> 1) - 1), (dsPtr)))
#endif
#endif
diff --git a/unix/tclSelectNotfy.c b/unix/tclSelectNotfy.c
index a0dea57..cb8addf 100644
--- a/unix/tclSelectNotfy.c
+++ b/unix/tclSelectNotfy.c
@@ -231,7 +231,7 @@ typedef struct {
void *hbrBackground;
void *lpszMenuName;
const void *lpszClassName;
-} WNDCLASS;
+} WNDCLASSW;
extern void __stdcall CloseHandle(void *);
extern void *__stdcall CreateEventW(void *, unsigned char, unsigned char,
@@ -249,7 +249,7 @@ extern unsigned char __stdcall PeekMessageW(MSG *, void *, int, int, int);
extern unsigned char __stdcall PostMessageW(void *, unsigned int, void *,
void *);
extern void __stdcall PostQuitMessage(int);
-extern void *__stdcall RegisterClassW(const WNDCLASS *);
+extern void *__stdcall RegisterClassW(const WNDCLASSW *);
extern unsigned char __stdcall ResetEvent(void *);
extern unsigned char __stdcall TranslateMessage(const MSG *);
@@ -297,7 +297,7 @@ Tcl_InitNotifier(void)
*/
if (tsdPtr->waitCVinitialized == 0) {
#ifdef __CYGWIN__
- WNDCLASS class;
+ WNDCLASSW class;
class.style = 0;
class.cbClsExtra = 0;
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 2b05bf3..2fed58b 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -314,7 +314,7 @@ TclWinDriveLetterForVolMountPoint(
* Try to read the volume mount point and see where it points.
*/
- if (GetVolumeNameForVolumeMountPoint(drive,
+ if (GetVolumeNameForVolumeMountPointW(drive,
Target, 55) != 0) {
if (wcscmp(dlIter->volumeName, Target) == 0) {
/*
@@ -373,7 +373,7 @@ TclWinDriveLetterForVolMountPoint(
* Try to read the volume mount point and see where it points.
*/
- if (GetVolumeNameForVolumeMountPoint(drive,
+ if (GetVolumeNameForVolumeMountPointW(drive,
Target, 55) != 0) {
int alreadyStored = 0;
@@ -465,7 +465,7 @@ TclWinDriveLetterForVolMountPoint(
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
#undef Tcl_WinUtfToTChar
-WCHAR *
+TCHAR *
Tcl_WinUtfToTChar(
const char *string, /* Source string in UTF-8. */
int len, /* Source string length in bytes, or -1 for
@@ -474,19 +474,19 @@ Tcl_WinUtfToTChar(
* converted string is stored. */
{
Tcl_DStringInit(dsPtr);
- return Tcl_UtfToWCharDString(string, len, dsPtr);
+ return (TCHAR *)Tcl_UtfToWCharDString(string, len, dsPtr);
}
#undef Tcl_WinTCharToUtf
char *
Tcl_WinTCharToUtf(
- const WCHAR *string, /* Source string in Unicode. */
+ const TCHAR *string, /* Source string in Unicode. */
int len, /* Source string length in bytes, or -1 for
* platform-specific string length. */
Tcl_DString *dsPtr) /* Uninitialized or free DString in which the
* converted string is stored. */
{
Tcl_DStringInit(dsPtr);
- return Tcl_WCharToUtfDString(string, len >> 1, dsPtr);
+ return Tcl_WCharToUtfDString((WCHAR *)string, len >> 1, dsPtr);
}
#endif /* !defined(TCL_NO_DEPRECATED) */
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index 3b6e4e4..d300269 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -946,7 +946,7 @@ TclpOpenFileChannel(
flags = FILE_ATTRIBUTE_READONLY;
}
} else {
- flags = GetFileAttributes(nativeName);
+ flags = GetFileAttributesW(nativeName);
if (flags == 0xFFFFFFFF) {
flags = 0;
}
@@ -962,7 +962,7 @@ TclpOpenFileChannel(
* Now we get to create the file.
*/
- handle = CreateFile(nativeName, accessMode, shareMode,
+ handle = CreateFileW(nativeName, accessMode, shareMode,
NULL, createMode, flags, (HANDLE) NULL);
if (handle == INVALID_HANDLE_VALUE) {
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c
index f8fa463..8885e33 100644
--- a/win/tclWinFCmd.c
+++ b/win/tclWinFCmd.c
@@ -214,12 +214,12 @@ DoRenameFile(
"movl %%edx, %%fs:0" "\n\t"
/*
- * Call MoveFile(nativeSrc, nativeDst)
+ * Call MoveFileW(nativeSrc, nativeDst)
*/
"pushl %%ebx" "\n\t"
"pushl %%ecx" "\n\t"
- "movl %[moveFile], %%eax" "\n\t"
+ "movl %[moveFileW], %%eax" "\n\t"
"call *%%eax" "\n\t"
/*
@@ -256,7 +256,7 @@ DoRenameFile(
[registration] "m" (registration),
[nativeDst] "m" (nativeDst),
[nativeSrc] "m" (nativeSrc),
- [moveFile] "r" (MoveFile)
+ [moveFileW] "r" (MoveFileW)
:
"%eax", "%ebx", "%ecx", "%edx", "memory"
);
@@ -267,7 +267,7 @@ DoRenameFile(
#ifndef HAVE_NO_SEH
__try {
#endif
- if ((*MoveFile)(nativeSrc, nativeDst) != FALSE) {
+ if ((*MoveFileW)(nativeSrc, nativeDst) != FALSE) {
retval = TCL_OK;
}
#ifndef HAVE_NO_SEH
@@ -281,10 +281,10 @@ DoRenameFile(
TclWinConvertError(GetLastError());
- srcAttr = GetFileAttributes(nativeSrc);
- dstAttr = GetFileAttributes(nativeDst);
+ srcAttr = GetFileAttributesW(nativeSrc);
+ dstAttr = GetFileAttributesW(nativeDst);
if (srcAttr == 0xffffffff) {
- if (GetFullPathName(nativeSrc, 0, NULL,
+ if (GetFullPathNameW(nativeSrc, 0, NULL,
NULL) >= MAX_PATH) {
errno = ENAMETOOLONG;
return TCL_ERROR;
@@ -292,7 +292,7 @@ DoRenameFile(
srcAttr = 0;
}
if (dstAttr == 0xffffffff) {
- if (GetFullPathName(nativeDst, 0, NULL,
+ if (GetFullPathNameW(nativeDst, 0, NULL,
NULL) >= MAX_PATH) {
errno = ENAMETOOLONG;
return TCL_ERROR;
@@ -315,18 +315,18 @@ DoRenameFile(
Tcl_DString srcString, dstString;
const char *src, *dst;
- size = GetFullPathName(nativeSrc, MAX_PATH,
+ size = GetFullPathNameW(nativeSrc, MAX_PATH,
nativeSrcPath, &nativeSrcRest);
if ((size == 0) || (size > MAX_PATH)) {
return TCL_ERROR;
}
- size = GetFullPathName(nativeDst, MAX_PATH,
+ size = GetFullPathNameW(nativeDst, MAX_PATH,
nativeDstPath, &nativeDstRest);
if ((size == 0) || (size > MAX_PATH)) {
return TCL_ERROR;
}
- CharLower(nativeSrcPath);
- CharLower(nativeDstPath);
+ CharLowerW(nativeSrcPath);
+ CharLowerW(nativeDstPath);
Tcl_DStringInit(&srcString);
Tcl_DStringInit(&dstString);
@@ -410,7 +410,7 @@ DoRenameFile(
* directory back, for completeness.
*/
- if (MoveFile(nativeSrc,
+ if (MoveFileW(nativeSrc,
nativeDst) != FALSE) {
return TCL_OK;
}
@@ -421,8 +421,8 @@ DoRenameFile(
*/
TclWinConvertError(GetLastError());
- CreateDirectory(nativeDst, NULL);
- SetFileAttributes(nativeDst, dstAttr);
+ CreateDirectoryW(nativeDst, NULL);
+ SetFileAttributesW(nativeDst, dstAttr);
if (Tcl_GetErrno() == EACCES) {
/*
* Decode the EACCES to a more meaningful error.
@@ -451,7 +451,7 @@ DoRenameFile(
int result, size;
WCHAR tempBuf[MAX_PATH];
- size = GetFullPathName(nativeDst, MAX_PATH,
+ size = GetFullPathNameW(nativeDst, MAX_PATH,
tempBuf, &nativeRest);
if ((size == 0) || (size > MAX_PATH) || (nativeRest == NULL)) {
return TCL_ERROR;
@@ -460,8 +460,8 @@ DoRenameFile(
nativeRest[0] = '\0';
result = TCL_ERROR;
- nativePrefix = (WCHAR *) L"tclr";
- if (GetTempFileName(nativeTmp, nativePrefix,
+ nativePrefix = (WCHAR *)L"tclr";
+ if (GetTempFileNameW(nativeTmp, nativePrefix,
0, tempBuf) != 0) {
/*
* Strictly speaking, need the following DeleteFile and
@@ -471,15 +471,15 @@ DoRenameFile(
*/
nativeTmp = tempBuf;
- DeleteFile(nativeTmp);
- if (MoveFile(nativeDst, nativeTmp) != FALSE) {
- if (MoveFile(nativeSrc, nativeDst) != FALSE) {
- SetFileAttributes(nativeTmp, FILE_ATTRIBUTE_NORMAL);
- DeleteFile(nativeTmp);
+ DeleteFileW(nativeTmp);
+ if (MoveFileW(nativeDst, nativeTmp) != FALSE) {
+ if (MoveFileW(nativeSrc, nativeDst) != FALSE) {
+ SetFileAttributesW(nativeTmp, FILE_ATTRIBUTE_NORMAL);
+ DeleteFileW(nativeTmp);
return TCL_OK;
} else {
- DeleteFile(nativeDst);
- MoveFile(nativeTmp, nativeDst);
+ DeleteFileW(nativeDst);
+ MoveFileW(nativeTmp, nativeDst);
}
}
@@ -603,10 +603,10 @@ DoCopyFile(
"movl %%edx, %%fs:0" "\n\t"
/*
- * Call CopyFile(nativeSrc, nativeDst, 0)
+ * Call CopyFileW(nativeSrc, nativeDst, 0)
*/
- "movl %[copyFile], %%eax" "\n\t"
+ "movl %[copyFileW], %%eax" "\n\t"
"pushl $0" "\n\t"
"pushl %%ebx" "\n\t"
"pushl %%ecx" "\n\t"
@@ -646,7 +646,7 @@ DoCopyFile(
[registration] "m" (registration),
[nativeDst] "m" (nativeDst),
[nativeSrc] "m" (nativeSrc),
- [copyFile] "r" (CopyFile)
+ [copyFileW] "r" (CopyFileW)
:
"%eax", "%ebx", "%ecx", "%edx", "memory"
);
@@ -657,7 +657,7 @@ DoCopyFile(
#ifndef HAVE_NO_SEH
__try {
#endif
- if (CopyFile(nativeSrc, nativeDst, 0) != FALSE) {
+ if (CopyFileW(nativeSrc, nativeDst, 0) != FALSE) {
retval = TCL_OK;
}
#ifndef HAVE_NO_SEH
@@ -677,8 +677,8 @@ DoCopyFile(
if (Tcl_GetErrno() == EACCES) {
DWORD srcAttr, dstAttr;
- srcAttr = GetFileAttributes(nativeSrc);
- dstAttr = GetFileAttributes(nativeDst);
+ srcAttr = GetFileAttributesW(nativeSrc);
+ dstAttr = GetFileAttributesW(nativeDst);
if (srcAttr != 0xffffffff) {
if (dstAttr == 0xffffffff) {
dstAttr = 0;
@@ -694,9 +694,9 @@ DoCopyFile(
Tcl_SetErrno(EISDIR);
}
if (dstAttr & FILE_ATTRIBUTE_READONLY) {
- SetFileAttributes(nativeDst,
+ SetFileAttributesW(nativeDst,
dstAttr & ~((DWORD)FILE_ATTRIBUTE_READONLY));
- if (CopyFile(nativeSrc, nativeDst,
+ if (CopyFileW(nativeSrc, nativeDst,
0) != FALSE) {
return TCL_OK;
}
@@ -707,7 +707,7 @@ DoCopyFile(
*/
TclWinConvertError(GetLastError());
- SetFileAttributes(nativeDst, dstAttr);
+ SetFileAttributesW(nativeDst, dstAttr);
}
}
}
@@ -763,13 +763,13 @@ TclpDeleteFile(
return TCL_ERROR;
}
- if (DeleteFile(path) != FALSE) {
+ if (DeleteFileW(path) != FALSE) {
return TCL_OK;
}
TclWinConvertError(GetLastError());
if (Tcl_GetErrno() == EACCES) {
- attr = GetFileAttributes(path);
+ attr = GetFileAttributesW(path);
if (attr != 0xffffffff) {
if (attr & FILE_ATTRIBUTE_DIRECTORY) {
if (attr & FILE_ATTRIBUTE_REPARSE_POINT) {
@@ -790,21 +790,21 @@ TclpDeleteFile(
Tcl_SetErrno(EISDIR);
} else if (attr & FILE_ATTRIBUTE_READONLY) {
- int res = SetFileAttributes(path,
+ int res = SetFileAttributesW(path,
attr & ~((DWORD) FILE_ATTRIBUTE_READONLY));
if ((res != 0) &&
- (DeleteFile(path) != FALSE)) {
+ (DeleteFileW(path) != FALSE)) {
return TCL_OK;
}
TclWinConvertError(GetLastError());
if (res != 0) {
- SetFileAttributes(path, attr);
+ SetFileAttributesW(path, attr);
}
}
}
} else if (Tcl_GetErrno() == ENOENT) {
- attr = GetFileAttributes(path);
+ attr = GetFileAttributesW(path);
if (attr != 0xffffffff) {
if (attr & FILE_ATTRIBUTE_DIRECTORY) {
/*
@@ -863,7 +863,7 @@ static int
DoCreateDirectory(
const WCHAR *nativePath) /* Pathname of directory to create (native). */
{
- if (CreateDirectory(nativePath, NULL) == 0) {
+ if (CreateDirectoryW(nativePath, NULL) == 0) {
DWORD error = GetLastError();
TclWinConvertError(error);
@@ -1035,7 +1035,7 @@ DoRemoveJustDirectory(
return TCL_ERROR;
}
- attr = GetFileAttributes(nativePath);
+ attr = GetFileAttributesW(nativePath);
if (attr & FILE_ATTRIBUTE_REPARSE_POINT) {
/*
@@ -1049,7 +1049,7 @@ DoRemoveJustDirectory(
* Ordinary directory.
*/
- if (RemoveDirectory(nativePath) != FALSE) {
+ if (RemoveDirectoryW(nativePath) != FALSE) {
return TCL_OK;
}
}
@@ -1057,7 +1057,7 @@ DoRemoveJustDirectory(
TclWinConvertError(GetLastError());
if (Tcl_GetErrno() == EACCES) {
- attr = GetFileAttributes(nativePath);
+ attr = GetFileAttributesW(nativePath);
if (attr != 0xffffffff) {
if ((attr & FILE_ATTRIBUTE_DIRECTORY) == 0) {
/*
@@ -1081,15 +1081,15 @@ DoRemoveJustDirectory(
if (attr & FILE_ATTRIBUTE_READONLY) {
attr &= ~FILE_ATTRIBUTE_READONLY;
- if (SetFileAttributes(nativePath,
+ if (SetFileAttributesW(nativePath,
attr) == FALSE) {
goto end;
}
- if (RemoveDirectory(nativePath) != FALSE) {
+ if (RemoveDirectoryW(nativePath) != FALSE) {
return TCL_OK;
}
TclWinConvertError(GetLastError());
- SetFileAttributes(nativePath,
+ SetFileAttributesW(nativePath,
attr | FILE_ATTRIBUTE_READONLY);
}
}
@@ -1191,7 +1191,7 @@ TraverseWinTree(
WCHAR *nativeSource, *nativeTarget, *nativeErrfile;
int result, found, sourceLen, targetLen = 0, oldSourceLen, oldTargetLen;
HANDLE handle;
- WIN32_FIND_DATA data;
+ WIN32_FIND_DATAW data;
nativeErrfile = NULL;
result = TCL_OK;
@@ -1202,7 +1202,7 @@ TraverseWinTree(
(targetPtr == NULL ? NULL : Tcl_DStringValue(targetPtr));
oldSourceLen = Tcl_DStringLength(sourcePtr);
- sourceAttr = GetFileAttributes(nativeSource);
+ sourceAttr = GetFileAttributesW(nativeSource);
if (sourceAttr == 0xffffffff) {
nativeErrfile = nativeSource;
goto end;
@@ -1229,7 +1229,7 @@ TraverseWinTree(
Tcl_DStringSetLength(sourcePtr, Tcl_DStringLength(sourcePtr) - 1);
nativeSource = (WCHAR *) Tcl_DStringValue(sourcePtr);
- handle = FindFirstFile(nativeSource, &data);
+ handle = FindFirstFileW(nativeSource, &data);
if (handle == INVALID_HANDLE_VALUE) {
/*
* Can't read directory.
@@ -1262,7 +1262,7 @@ TraverseWinTree(
}
found = 1;
- for (; found; found = FindNextFile(handle, &data)) {
+ for (; found; found = FindNextFileW(handle, &data)) {
WCHAR *nativeName;
int len;
@@ -1378,9 +1378,9 @@ TraversalCopy(
break;
case DOTREE_PRED:
if (DoCreateDirectory(nativeDst) == TCL_OK) {
- DWORD attr = GetFileAttributes(nativeSrc);
+ DWORD attr = GetFileAttributesW(nativeSrc);
- if (SetFileAttributes(nativeDst,
+ if (SetFileAttributesW(nativeDst,
attr) != FALSE) {
return TCL_OK;
}
@@ -1518,7 +1518,7 @@ GetWinFileAttributes(
int attr;
nativeName = Tcl_FSGetNativePath(fileName);
- result = GetFileAttributes(nativeName);
+ result = GetFileAttributesW(nativeName);
if (result == 0xffffffff) {
StatError(interp, fileName);
@@ -1649,7 +1649,7 @@ ConvertFileNameFormat(
Tcl_DString dsTemp;
const WCHAR *nativeName;
const char *tempString;
- WIN32_FIND_DATA data;
+ WIN32_FIND_DATAW data;
HANDLE handle;
DWORD attr;
@@ -1665,16 +1665,16 @@ ConvertFileNameFormat(
Tcl_DStringInit(&ds);
nativeName = Tcl_UtfToWCharDString(tempString, length, &ds);
Tcl_DecrRefCount(tempPath);
- handle = FindFirstFile(nativeName, &data);
+ handle = FindFirstFileW(nativeName, &data);
if (handle == INVALID_HANDLE_VALUE) {
/*
- * FindFirstFile() doesn't like root directories. We would
+ * FindFirstFileW() doesn't like root directories. We would
* only get a root directory here if the caller specified "c:"
* or "c:." and the current directory on the drive was the
* root directory
*/
- attr = GetFileAttributes(nativeName);
+ attr = GetFileAttributesW(nativeName);
if ((attr!=0xFFFFFFFF) && (attr & FILE_ATTRIBUTE_DIRECTORY)) {
Tcl_DStringFree(&ds);
goto simple;
@@ -1844,7 +1844,7 @@ SetWinFileAttributes(
const WCHAR *nativeName;
nativeName = Tcl_FSGetNativePath(fileName);
- fileAttributes = old = GetFileAttributes(nativeName);
+ fileAttributes = old = GetFileAttributesW(nativeName);
if (fileAttributes == 0xffffffff) {
StatError(interp, fileName);
@@ -1863,7 +1863,7 @@ SetWinFileAttributes(
}
if ((fileAttributes != old)
- && !SetFileAttributes(nativeName, fileAttributes)) {
+ && !SetFileAttributesW(nativeName, fileAttributes)) {
StatError(interp, fileName);
return TCL_ERROR;
}
@@ -1936,10 +1936,10 @@ TclpObjListVolumes(void)
if (GetLogicalDriveStringsA(sizeof(buf), buf) == 0) {
/*
- * GetVolumeInformation() will detects all drives, but causes
+ * GetVolumeInformationW() will detects all drives, but causes
* chattering on empty floppy drives. We only do this if
* GetLogicalDriveStrings() didn't work. It has also been reported
- * that on some laptops it takes a while for GetVolumeInformation() to
+ * that on some laptops it takes a while for GetVolumeInformationW() to
* return when pinging an empty floppy drive, another reason to try to
* avoid calling it.
*/
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index f3c45ef..4d2c474 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -203,7 +203,7 @@ WinLink(
* Get the full path referenced by the target.
*/
- if (!GetFullPathName(linkTargetPath, MAX_PATH, tempFileName,
+ if (!GetFullPathNameW(linkTargetPath, MAX_PATH, tempFileName,
&tempFilePart)) {
/*
* Invalid file.
@@ -217,7 +217,7 @@ WinLink(
* Make sure source file doesn't exist.
*/
- attr = GetFileAttributes(linkSourcePath);
+ attr = GetFileAttributesW(linkSourcePath);
if (attr != INVALID_FILE_ATTRIBUTES) {
Tcl_SetErrno(EEXIST);
return -1;
@@ -227,7 +227,7 @@ WinLink(
* Get the full path referenced by the source file/directory.
*/
- if (!GetFullPathName(linkSourcePath, MAX_PATH, tempFileName,
+ if (!GetFullPathNameW(linkSourcePath, MAX_PATH, tempFileName,
&tempFilePart)) {
/*
* Invalid file.
@@ -241,7 +241,7 @@ WinLink(
* Check the target.
*/
- attr = GetFileAttributes(linkTargetPath);
+ attr = GetFileAttributesW(linkTargetPath);
if (attr == INVALID_FILE_ATTRIBUTES) {
/*
* The target doesn't exist.
@@ -254,7 +254,7 @@ WinLink(
*/
if (linkAction & TCL_CREATE_HARD_LINK) {
- if (CreateHardLink(linkSourcePath, linkTargetPath, NULL)) {
+ if (CreateHardLinkW(linkSourcePath, linkTargetPath, NULL)) {
/*
* Success!
*/
@@ -316,7 +316,7 @@ WinReadLink(
* Get the full path referenced by the target.
*/
- if (!GetFullPathName(linkSourcePath, MAX_PATH, tempFileName,
+ if (!GetFullPathNameW(linkSourcePath, MAX_PATH, tempFileName,
&tempFilePart)) {
/*
* Invalid file.
@@ -330,7 +330,7 @@ WinReadLink(
* Make sure source file does exist.
*/
- attr = GetFileAttributes(linkSourcePath);
+ attr = GetFileAttributesW(linkSourcePath);
if (attr == INVALID_FILE_ATTRIBUTES) {
/*
* The source doesn't exist.
@@ -487,7 +487,7 @@ TclWinSymLinkDelete(
memset(reparseBuffer, 0, sizeof(DUMMY_REPARSE_BUFFER));
reparseBuffer->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
- hFile = CreateFile(linkOrigPath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
+ hFile = CreateFileW(linkOrigPath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
@@ -502,7 +502,7 @@ TclWinSymLinkDelete(
} else {
CloseHandle(hFile);
if (!linkOnly) {
- RemoveDirectory(linkOrigPath);
+ RemoveDirectoryW(linkOrigPath);
}
return 0;
}
@@ -547,7 +547,7 @@ WinReadLinkDirectory(
Tcl_DString ds;
const char *copy;
- attr = GetFileAttributes(linkDirPath);
+ attr = GetFileAttributesW(linkDirPath);
if (!(attr & FILE_ATTRIBUTE_REPARSE_POINT)) {
goto invalidError;
}
@@ -681,7 +681,7 @@ NativeReadReparse(
HANDLE hFile;
DWORD returnedLength;
- hFile = CreateFile(linkDirPath, desiredAccess, FILE_SHARE_READ, NULL,
+ hFile = CreateFileW(linkDirPath, desiredAccess, FILE_SHARE_READ, NULL,
OPEN_EXISTING,
FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL);
@@ -741,7 +741,7 @@ NativeWriteReparse(
* Create the directory - it must not already exist.
*/
- if (CreateDirectory(linkDirPath, NULL) == 0) {
+ if (CreateDirectoryW(linkDirPath, NULL) == 0) {
/*
* Error creating directory.
*/
@@ -749,7 +749,7 @@ NativeWriteReparse(
TclWinConvertError(GetLastError());
return -1;
}
- hFile = CreateFile(linkDirPath, GENERIC_WRITE, 0, NULL,
+ hFile = CreateFileW(linkDirPath, GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT
| FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
@@ -774,7 +774,7 @@ NativeWriteReparse(
TclWinConvertError(GetLastError());
CloseHandle(hFile);
- RemoveDirectory(linkDirPath);
+ RemoveDirectoryW(linkDirPath);
return -1;
}
CloseHandle(hFile);
@@ -940,7 +940,7 @@ TclpMatchInDirectory(
native = Tcl_FSGetNativePath(pathPtr);
- if (GetFileAttributesEx(native,
+ if (GetFileAttributesExW(native,
GetFileExInfoStandard, &data) != TRUE) {
return TCL_OK;
}
@@ -954,7 +954,7 @@ TclpMatchInDirectory(
} else {
DWORD attr;
HANDLE handle;
- WIN32_FIND_DATA data;
+ WIN32_FIND_DATAW data;
const char *dirName; /* UTF-8 dir name, later with pattern
* appended. */
int dirLength;
@@ -983,7 +983,7 @@ TclpMatchInDirectory(
if (native == NULL) {
return TCL_OK;
}
- attr = GetFileAttributes(native);
+ attr = GetFileAttributesW(native);
if ((attr == INVALID_FILE_ATTRIBUTES)
|| ((attr & FILE_ATTRIBUTE_DIRECTORY) == 0)) {
@@ -1027,13 +1027,13 @@ TclpMatchInDirectory(
Tcl_DStringInit(&ds);
native = Tcl_UtfToWCharDString(dirName, -1, &ds);
if ((types == NULL) || (types->type != TCL_GLOB_TYPE_DIR)) {
- handle = FindFirstFile(native, &data);
+ handle = FindFirstFileW(native, &data);
} else {
/*
* We can be more efficient, for pure directory requests.
*/
- handle = FindFirstFileEx(native,
+ handle = FindFirstFileExW(native,
FindExInfoStandard, &data,
FindExSearchLimitToDirectories, NULL, 0);
}
@@ -1159,7 +1159,7 @@ TclpMatchInDirectory(
*/
Tcl_DStringFree(&ds);
- } while (FindNextFile(handle, &data) == TRUE);
+ } while (FindNextFileW(handle, &data) == TRUE);
FindClose(handle);
Tcl_DStringFree(&dsOrig);
@@ -1593,7 +1593,7 @@ NativeAccess(
{
DWORD attr;
- attr = GetFileAttributes(nativePath);
+ attr = GetFileAttributesW(nativePath);
if (attr == INVALID_FILE_ATTRIBUTES) {
/*
@@ -1662,7 +1662,7 @@ NativeAccess(
mask |= GENERIC_EXECUTE;
}
- hFile = CreateFile(nativePath, mask,
+ hFile = CreateFileW(nativePath, mask,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
@@ -1712,7 +1712,7 @@ NativeAccess(
*/
size = 0;
- GetFileSecurity(nativePath,
+ GetFileSecurityW(nativePath,
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION
| DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION,
0, 0, &size);
@@ -1743,10 +1743,10 @@ NativeAccess(
}
/*
- * Call GetFileSecurity() for real.
+ * Call GetFileSecurityW() for real.
*/
- if (!GetFileSecurity(nativePath,
+ if (!GetFileSecurityW(nativePath,
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION
| DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION,
sdPtr, size, &size)) {
@@ -1925,7 +1925,7 @@ TclpObjChdir(
if (!nativePath) {
return -1;
}
- result = SetCurrentDirectory(nativePath);
+ result = SetCurrentDirectoryW(nativePath);
if (result == 0) {
TclWinConvertError(GetLastError());
@@ -1966,7 +1966,7 @@ TclpGetCwd(
char *p;
WCHAR *native;
- if (GetCurrentDirectory(MAX_PATH, buffer) == 0) {
+ if (GetCurrentDirectoryW(MAX_PATH, buffer) == 0) {
TclWinConvertError(GetLastError());
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -2067,7 +2067,7 @@ NativeStat(
* and if successful, mock up a BY_HANDLE_FILE_INFORMATION structure.
*/
- fileHandle = CreateFile(nativePath, GENERIC_READ,
+ fileHandle = CreateFileW(nativePath, GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, NULL);
@@ -2125,17 +2125,17 @@ NativeStat(
WIN32_FILE_ATTRIBUTE_DATA data;
- if (GetFileAttributesEx(nativePath,
+ if (GetFileAttributesExW(nativePath,
GetFileExInfoStandard, &data) != TRUE) {
HANDLE hFind;
- WIN32_FIND_DATA ffd;
+ WIN32_FIND_DATAW ffd;
DWORD lasterror = GetLastError();
if (lasterror != ERROR_SHARING_VIOLATION) {
TclWinConvertError(lasterror);
return -1;
}
- hFind = FindFirstFile(nativePath, &ffd);
+ hFind = FindFirstFileW(nativePath, &ffd);
if (hFind == INVALID_HANDLE_VALUE) {
TclWinConvertError(GetLastError());
return -1;
@@ -2193,7 +2193,7 @@ NativeDev(
WCHAR *nativePart;
const char *fullPath;
- GetFullPathName(nativePath, MAX_PATH, nativeFullPath, &nativePart);
+ GetFullPathNameW(nativePath, MAX_PATH, nativeFullPath, &nativePart);
Tcl_DStringInit(&ds);
fullPath = Tcl_WCharToUtfDString(nativeFullPath, -1, &ds);
@@ -2219,11 +2219,11 @@ NativeDev(
Tcl_DStringInit(&volString);
nativeVol = Tcl_UtfToWCharDString(fullPath, p - fullPath, &volString);
dw = (DWORD) -1;
- GetVolumeInformation(nativeVol, NULL, 0, &dw, NULL, NULL, NULL, 0);
+ GetVolumeInformationW(nativeVol, NULL, 0, &dw, NULL, NULL, NULL, 0);
/*
- * GetFullPathName() turns special devices like "NUL" into "\\.\NUL",
- * but GetVolumeInformation() returns failure for "\\.\NUL". This will
+ * GetFullPathNameW() turns special devices like "NUL" into "\\.\NUL",
+ * but GetVolumeInformationW() returns failure for "\\.\NUL". This will
* cause "NUL" to get a drive number of -1, which makes about as much
* sense as anything since the special devices don't live on any
* drive.
@@ -2365,7 +2365,7 @@ TclpGetNativeCwd(
{
WCHAR buffer[MAX_PATH];
- if (GetCurrentDirectory(MAX_PATH, buffer) == 0) {
+ if (GetCurrentDirectoryW(MAX_PATH, buffer) == 0) {
TclWinConvertError(GetLastError());
return NULL;
}
@@ -2481,13 +2481,13 @@ TclpFilesystemPathType(
firstSeparator = strchr(path, '/');
if (firstSeparator == NULL) {
- found = GetVolumeInformation(Tcl_FSGetNativePath(pathPtr),
+ found = GetVolumeInformationW(Tcl_FSGetNativePath(pathPtr),
NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE);
} else {
Tcl_Obj *driveName = Tcl_NewStringObj(path, firstSeparator - path+1);
Tcl_IncrRefCount(driveName);
- found = GetVolumeInformation(Tcl_FSGetNativePath(driveName),
+ found = GetVolumeInformationW(Tcl_FSGetNativePath(driveName),
NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE);
Tcl_DecrRefCount(driveName);
}
@@ -2574,7 +2574,7 @@ TclpObjNormalizePath(
nativePath = Tcl_UtfToWCharDString(path,
currentPathEndPosition - path, &ds);
- if (GetFileAttributesEx(nativePath,
+ if (GetFileAttributesExW(nativePath,
GetFileExInfoStandard, &data) != TRUE) {
/*
* File doesn't exist.
@@ -3249,7 +3249,7 @@ TclpUtime(
native = Tcl_FSGetNativePath(pathPtr);
- attr = GetFileAttributes(native);
+ attr = GetFileAttributesW(native);
if (attr != INVALID_FILE_ATTRIBUTES && attr & FILE_ATTRIBUTE_DIRECTORY) {
flags = FILE_FLAG_BACKUP_SEMANTICS;
@@ -3260,7 +3260,7 @@ TclpUtime(
* savings complications that utime gets wrong.
*/
- fileHandle = CreateFile(native, FILE_WRITE_ATTRIBUTES, 0, NULL,
+ fileHandle = CreateFileW(native, FILE_WRITE_ATTRIBUTES, 0, NULL,
OPEN_EXISTING, flags, NULL);
if (fileHandle == INVALID_HANDLE_VALUE ||
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 852e5f7..1669ede 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")
@@ -149,13 +149,13 @@ TclpInitPlatform(void)
* invoked.
*/
- TclWinInit(GetModuleHandle(NULL));
+ TclWinInit(GetModuleHandleW(NULL));
#endif
/*
* Fill available functions depending on windows version
*/
- handle = GetModuleHandle(L"KERNEL32");
+ handle = GetModuleHandleW(L"KERNEL32");
tclWinProcs.cancelSynchronousIo =
(BOOL (WINAPI *)(HANDLE)) GetProcAddress(handle,
"CancelSynchronousIo");
@@ -472,7 +472,7 @@ TclpGetUserName(
WCHAR szUserName[UNLEN+1];
DWORD cchUserNameLen = UNLEN;
- if (!GetUserName(szUserName, &cchUserNameLen)) {
+ if (!GetUserNameW(szUserName, &cchUserNameLen)) {
return NULL;
}
cchUserNameLen--;
@@ -517,7 +517,7 @@ TclpSetVariables(
TclGetProcessGlobalValue(&defaultLibraryDir), TCL_GLOBAL_ONLY);
if (!osInfoInitialized) {
- HMODULE handle = GetModuleHandle(L"NTDLL");
+ HMODULE handle = GetModuleHandleW(L"NTDLL");
int(__stdcall *getversion)(void *) =
(int(__stdcall *)(void *)) GetProcAddress(handle, "RtlGetVersion");
osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c
index ae68956..b79a4ca 100644
--- a/win/tclWinLoad.c
+++ b/win/tclWinLoad.c
@@ -76,7 +76,7 @@ TclpDlopen(
nativeName = Tcl_FSGetNativePath(pathPtr);
if (nativeName != NULL) {
- hInstance = LoadLibraryEx(nativeName, NULL,
+ hInstance = LoadLibraryExW(nativeName, NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
}
if (hInstance == NULL) {
@@ -97,7 +97,7 @@ TclpDlopen(
Tcl_DStringInit(&ds);
nativeName = Tcl_UtfToWCharDString(Tcl_GetString(pathPtr), -1, &ds);
- hInstance = LoadLibraryEx(nativeName, NULL,
+ hInstance = LoadLibraryExW(nativeName, NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
Tcl_DStringFree(&ds);
}
diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c
index dba7a31..8dc0d7c 100644
--- a/win/tclWinNotify.c
+++ b/win/tclWinNotify.c
@@ -98,7 +98,7 @@ Tcl_InitNotifier(void)
EnterCriticalSection(&notifierMutex);
if (notifierCount == 0) {
- WNDCLASS clazz;
+ WNDCLASSW clazz;
clazz.style = 0;
clazz.cbClsExtra = 0;
@@ -111,7 +111,7 @@ Tcl_InitNotifier(void)
clazz.hIcon = NULL;
clazz.hCursor = NULL;
- if (!RegisterClass(&clazz)) {
+ if (!RegisterClassW(&clazz)) {
Tcl_Panic("Unable to register TclNotifier window class");
}
}
@@ -195,7 +195,7 @@ Tcl_FinalizeNotifier(
if (notifierCount) {
notifierCount--;
if (notifierCount == 0) {
- UnregisterClass(className, TclWinGetTclInstance());
+ UnregisterClassW(className, TclWinGetTclInstance());
}
}
LeaveCriticalSection(&notifierMutex);
@@ -359,7 +359,7 @@ Tcl_ServiceModeHook(
*/
if (mode == TCL_SERVICE_ALL && !tsdPtr->hwnd) {
- tsdPtr->hwnd = CreateWindow(className, className,
+ tsdPtr->hwnd = CreateWindowW(className, className,
WS_TILED, 0, 0, 0, 0, NULL, NULL, TclWinGetTclInstance(),
NULL);
@@ -479,7 +479,7 @@ Tcl_WaitForEvent(
* events currently sitting in the queue.
*/
- if (!PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
+ if (!PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE)) {
/*
* Wait for something to happen (a signal from another thread, a
* message, or timeout) or loop servicing asynchronous procedure
@@ -501,12 +501,12 @@ Tcl_WaitForEvent(
* Check to see if there are any messages to process.
*/
- if (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
+ if (PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE)) {
/*
* Retrieve and dispatch the first message.
*/
- result = GetMessage(&msg, NULL, 0, 0);
+ result = GetMessageW(&msg, NULL, 0, 0);
if (result == 0) {
/*
* We received a request to exit this thread (WM_QUIT), so
@@ -524,7 +524,7 @@ Tcl_WaitForEvent(
status = -1;
} else {
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageW(&msg);
status = 1;
}
} else {
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index a04d4e7..75f5034 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -466,14 +466,14 @@ TempFileName(
* gets stored. */
{
const WCHAR *prefix = L"TCL";
- if (GetTempPath(MAX_PATH, name) != 0) {
- if (GetTempFileName(name, prefix, 0, name) != 0) {
+ if (GetTempPathW(MAX_PATH, name) != 0) {
+ if (GetTempFileNameW(name, prefix, 0, name) != 0) {
return 1;
}
}
name[0] = '.';
name[1] = '\0';
- return GetTempFileName(name, prefix, 0, name);
+ return GetTempFileNameW(name, prefix, 0, name);
}
/*
@@ -586,7 +586,7 @@ TclpOpenFile(
flags = 0;
if (!(mode & O_CREAT)) {
- flags = GetFileAttributes(nativePath);
+ flags = GetFileAttributesW(nativePath);
if (flags == 0xFFFFFFFF) {
flags = 0;
}
@@ -602,7 +602,7 @@ TclpOpenFile(
* Now we get to create the file.
*/
- handle = CreateFile(nativePath, accessMode, shareMode,
+ handle = CreateFileW(nativePath, accessMode, shareMode,
NULL, createMode, flags, NULL);
Tcl_DStringFree(&ds);
@@ -659,7 +659,7 @@ TclpCreateTempFile(
return NULL;
}
- handle = CreateFile(name,
+ handle = CreateFileW(name,
GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_TEMPORARY|FILE_FLAG_DELETE_ON_CLOSE, NULL);
if (handle == INVALID_HANDLE_VALUE) {
@@ -721,7 +721,7 @@ TclpCreateTempFile(
TclWinConvertError(GetLastError());
CloseHandle(handle);
- DeleteFile(name);
+ DeleteFileW(name);
return NULL;
}
@@ -937,7 +937,7 @@ TclpCreateProcess(
{
int result, applType, createFlags;
Tcl_DString cmdLine; /* Complete command line (WCHAR). */
- STARTUPINFO startInfo;
+ STARTUPINFOW startInfo;
PROCESS_INFORMATION procInfo;
SECURITY_ATTRIBUTES secAtts;
HANDLE hProcess, h, inputHandle, outputHandle, errorHandle;
@@ -1048,7 +1048,7 @@ TclpCreateProcess(
* sink.
*/
- startInfo.hStdOutput = CreateFile(L"NUL:", GENERIC_WRITE, 0,
+ startInfo.hStdOutput = CreateFileW(L"NUL:", GENERIC_WRITE, 0,
&secAtts, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
} else {
DuplicateHandle(hProcess, outputHandle, hProcess,
@@ -1068,7 +1068,7 @@ TclpCreateProcess(
* sink.
*/
- startInfo.hStdError = CreateFile(L"NUL:", GENERIC_WRITE, 0,
+ startInfo.hStdError = CreateFileW(L"NUL:", GENERIC_WRITE, 0,
&secAtts, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
} else {
DuplicateHandle(hProcess, errorHandle, hProcess, &startInfo.hStdError,
@@ -1134,7 +1134,7 @@ TclpCreateProcess(
BuildCommandLine(execPath, argc, argv, &cmdLine);
- if (CreateProcess(NULL, (WCHAR *) Tcl_DStringValue(&cmdLine),
+ if (CreateProcessW(NULL, (WCHAR *) Tcl_DStringValue(&cmdLine),
NULL, NULL, TRUE, (DWORD) createFlags, NULL, NULL, &startInfo,
&procInfo) == 0) {
TclWinConvertError(GetLastError());
@@ -1156,7 +1156,7 @@ TclpCreateProcess(
* will be created for each process but the previous instances may not be
* cleaned up. This results in a significant virtual memory loss each time
* the process is spawned. If there is a WaitForInputIdle() call between
- * CreateProcess() and CloseHandle(), the problem does not occur." PSS ID
+ * CreateProcessW() and CloseHandle(), the problem does not occur." PSS ID
* Number: Q124121
*/
@@ -1275,7 +1275,7 @@ ApplicationType(
* is, then try adding .com, .exe, .bat and .cmd, in that order, to the name,
* looking for an executable.
*
- * Using the raw SearchPath() function doesn't do quite what is necessary.
+ * Using the raw SearchPathW() function doesn't do quite what is necessary.
* If the name of the executable already contains a '.' character, it will
* not try appending the specified extension when searching (in other
* words, SearchPath will not find the program "a.b.exe" if the arguments
@@ -1294,7 +1294,7 @@ ApplicationType(
Tcl_DStringInit(&ds);
nativeName = Tcl_UtfToWCharDString(Tcl_DStringValue(&nameBuf),
Tcl_DStringLength(&nameBuf), &ds);
- found = SearchPath(NULL, nativeName, NULL, MAX_PATH,
+ found = SearchPathW(NULL, nativeName, NULL, MAX_PATH,
nativeFullPath, &rest);
Tcl_DStringFree(&ds);
if (found == 0) {
@@ -1306,7 +1306,7 @@ ApplicationType(
* known type.
*/
- attr = GetFileAttributes(nativeFullPath);
+ attr = GetFileAttributesW(nativeFullPath);
if ((attr == 0xffffffff) || (attr & FILE_ATTRIBUTE_DIRECTORY)) {
continue;
}
@@ -1321,7 +1321,7 @@ ApplicationType(
break;
}
- hFile = CreateFile(nativeFullPath,
+ hFile = CreateFileW(nativeFullPath,
GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
@@ -1401,7 +1401,7 @@ ApplicationType(
* application name from the arguments.
*/
- GetShortPathName(nativeFullPath, nativeFullPath, MAX_PATH);
+ GetShortPathNameW(nativeFullPath, nativeFullPath, MAX_PATH);
Tcl_DStringInit(&ds);
strcpy(fullName, Tcl_WCharToUtfDString(nativeFullPath, -1, &ds));
Tcl_DStringFree(&ds);
@@ -1415,7 +1415,7 @@ ApplicationType(
* BuildCommandLine --
*
* The command line arguments are stored in linePtr separated by spaces,
- * in a form that CreateProcess() understands. Special characters in
+ * in a form that CreateProcessW() understands. Special characters in
* individual arguments from argv[] must be quoted when being stored in
* cmdLine.
*
@@ -3206,7 +3206,7 @@ TclpOpenTemporaryFile(
}
namePtr = (char *) name;
- length = GetTempPath(MAX_PATH, name);
+ length = GetTempPathW(MAX_PATH, name);
if (length == 0) {
goto gotError;
}
@@ -3241,7 +3241,7 @@ TclpOpenTemporaryFile(
memcpy(namePtr, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf) + 1);
Tcl_DStringFree(&buf);
- handle = CreateFile(name,
+ handle = CreateFileW(name,
GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, flags, NULL);
} while (handle == INVALID_HANDLE_VALUE
&& --counter2 > 0
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c
index d6fa567..f8ec79d 100644
--- a/win/tclWinSerial.c
+++ b/win/tclWinSerial.c
@@ -1403,7 +1403,7 @@ TclWinSerialOpen(
* If an open channel is specified, close it
*/
- if ( handle != INVALID_HANDLE_VALUE && CloseHandle(handle) == FALSE) {
+ if (handle != INVALID_HANDLE_VALUE && CloseHandle(handle) == FALSE) {
return INVALID_HANDLE_VALUE;
}
@@ -1413,7 +1413,7 @@ TclWinSerialOpen(
* finished
*/
- handle = CreateFile(name, access, 0, 0, OPEN_EXISTING,
+ handle = CreateFileW(name, access, 0, 0, OPEN_EXISTING,
FILE_FLAG_OVERLAPPED, 0);
return handle;
@@ -1671,7 +1671,7 @@ SerialSetOptionProc(
}
Tcl_DStringInit(&ds);
native = Tcl_UtfToWCharDString(value, -1, &ds);
- result = BuildCommDCB(native, &dcb);
+ result = BuildCommDCBW(native, &dcb);
Tcl_DStringFree(&ds);
if (result == FALSE) {
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index e483eb4..8c12796 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -235,7 +235,7 @@ typedef struct {
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
-static WNDCLASS windowClass;
+static WNDCLASSW windowClass;
/*
* Static routines for this file:
@@ -363,17 +363,17 @@ InitializeHostName(
unsigned int *lengthPtr,
Tcl_Encoding *encodingPtr)
{
- WCHAR tbuf[MAX_COMPUTERNAME_LENGTH + 1];
+ WCHAR wbuf[MAX_COMPUTERNAME_LENGTH + 1];
DWORD length = MAX_COMPUTERNAME_LENGTH + 1;
Tcl_DString ds;
Tcl_DStringInit(&ds);
- if (GetComputerName(tbuf, &length) != 0) {
+ if (GetComputerNameW(wbuf, &length) != 0) {
/*
* Convert string from native to UTF then change to lowercase.
*/
- Tcl_UtfToLower(Tcl_WCharToUtfDString(tbuf, -1, &ds));
+ Tcl_UtfToLower(Tcl_WCharToUtfDString(wbuf, -1, &ds));
} else {
if (TclpHasSockets(NULL) == TCL_OK) {
@@ -2504,7 +2504,7 @@ InitSockets(void)
windowClass.hIcon = NULL;
windowClass.hCursor = NULL;
- if (!RegisterClass(&windowClass)) {
+ if (!RegisterClassW(&windowClass)) {
TclWinConvertError(GetLastError());
goto initFailure;
}
@@ -2629,7 +2629,7 @@ SocketExitHandler(
*/
TclpFinalizeSockets();
- UnregisterClass(className, TclWinGetTclInstance());
+ UnregisterClassW(className, TclWinGetTclInstance());
initialized = 0;
Tcl_MutexUnlock(&socketMutex);
}
@@ -3176,7 +3176,7 @@ SocketThread(
* Create a dummy window receiving socket events.
*/
- tsdPtr->hwnd = CreateWindow(className, className, WS_TILED, 0, 0, 0, 0,
+ tsdPtr->hwnd = CreateWindowW(className, className, WS_TILED, 0, 0, 0, 0,
NULL, NULL, windowClass.hInstance, arg);
/*
@@ -3199,8 +3199,8 @@ SocketThread(
* PostMessage(SOCKET_TERMINATE) in TclpFinalizeSockets().
*/
- while (GetMessage(&msg, NULL, 0, 0) > 0) {
- DispatchMessage(&msg);
+ while (GetMessageW(&msg, NULL, 0, 0) > 0) {
+ DispatchMessageW(&msg);
}
/*
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index 04d5c75..cd0e07f 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -139,7 +139,7 @@ TesteventloopCmd(
while (!done) {
MSG msg;
- if (!GetMessage(&msg, NULL, 0, 0)) {
+ if (!GetMessageW(&msg, NULL, 0, 0)) {
/*
* The application is exiting, so repost the quit message and
* start unwinding.
@@ -149,7 +149,7 @@ TesteventloopCmd(
break;
}
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ DispatchMessageW(&msg);
}
(void) Tcl_SetServiceMode(oldMode);
framePtr = oldFramePtr;