summaryrefslogtreecommitdiffstats
path: root/win/tclWinPipe.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-19 18:27:06 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-19 18:27:06 (GMT)
commitdafb810a4c0e1aa0eb3b1bd284813838bd8fa4e2 (patch)
tree7403b32378476c8e8c666143dd7e0c3871904a60 /win/tclWinPipe.c
parent0ed58066db9436b71256547107abe09abfd6c78d (diff)
parentfc76ac72f81faebf18fac875f079912966dd2717 (diff)
downloadtcl-dafb810a4c0e1aa0eb3b1bd284813838bd8fa4e2.zip
tcl-dafb810a4c0e1aa0eb3b1bd284813838bd8fa4e2.tar.gz
tcl-dafb810a4c0e1aa0eb3b1bd284813838bd8fa4e2.tar.bz2
Merge 8.7
Diffstat (limited to 'win/tclWinPipe.c')
-rw-r--r--win/tclWinPipe.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 38112e4..ed4bc22 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -468,14 +468,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);
}
/*
@@ -588,7 +588,7 @@ TclpOpenFile(
flags = 0;
if (!(mode & O_CREAT)) {
- flags = GetFileAttributes(nativePath);
+ flags = GetFileAttributesW(nativePath);
if (flags == 0xFFFFFFFF) {
flags = 0;
}
@@ -604,7 +604,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);
@@ -661,7 +661,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) {
@@ -723,7 +723,7 @@ TclpCreateTempFile(
TclWinConvertError(GetLastError());
CloseHandle(handle);
- DeleteFile(name);
+ DeleteFileW(name);
return NULL;
}
@@ -939,7 +939,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;
@@ -1050,7 +1050,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,
@@ -1070,7 +1070,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,
@@ -1136,7 +1136,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());
@@ -1158,7 +1158,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
*/
@@ -1277,7 +1277,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
@@ -1296,7 +1296,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) {
@@ -1308,7 +1308,7 @@ ApplicationType(
* known type.
*/
- attr = GetFileAttributes(nativeFullPath);
+ attr = GetFileAttributesW(nativeFullPath);
if ((attr == 0xffffffff) || (attr & FILE_ATTRIBUTE_DIRECTORY)) {
continue;
}
@@ -1323,7 +1323,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) {
@@ -1403,7 +1403,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);
@@ -1417,7 +1417,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.
*
@@ -1791,7 +1791,7 @@ TclpCreateCommandChannel(
* Start the background reader thread.
*/
- infoPtr->readable = CreateEvent(NULL, TRUE, TRUE, NULL);
+ infoPtr->readable = CreateEventW(NULL, TRUE, TRUE, NULL);
infoPtr->readThread = CreateThread(NULL, 256, PipeReaderThread,
TclPipeThreadCreateTI(&infoPtr->readTI, infoPtr, infoPtr->readable),
0, NULL);
@@ -1806,7 +1806,7 @@ TclpCreateCommandChannel(
* Start the background writer thread.
*/
- infoPtr->writable = CreateEvent(NULL, TRUE, TRUE, NULL);
+ infoPtr->writable = CreateEventW(NULL, TRUE, TRUE, NULL);
infoPtr->writeThread = CreateThread(NULL, 256, PipeWriterThread,
TclPipeThreadCreateTI(&infoPtr->writeTI, infoPtr, infoPtr->writable),
0, NULL);
@@ -3212,7 +3212,7 @@ TclpOpenTemporaryFile(
}
namePtr = (char *) name;
- length = GetTempPath(MAX_PATH, name);
+ length = GetTempPathW(MAX_PATH, name);
if (length == 0) {
goto gotError;
}
@@ -3247,7 +3247,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
@@ -3296,7 +3296,7 @@ TclPipeThreadCreateTI(
#else
pipeTI = (TclPipeThreadInfo *)ckalloc(sizeof(TclPipeThreadInfo));
#endif /* !_PTI_USE_CKALLOC */
- pipeTI->evControl = CreateEvent(NULL, FALSE, FALSE, NULL);
+ pipeTI->evControl = CreateEventW(NULL, FALSE, FALSE, NULL);
pipeTI->state = PTI_STATE_IDLE;
pipeTI->clientData = clientData;
pipeTI->evWakeUp = wakeEvent;