Import Tcl 8.6.10
This commit is contained in:
@@ -95,7 +95,7 @@ static void FileThreadActionProc(ClientData instanceData,
|
||||
static int FileTruncateProc(ClientData instanceData,
|
||||
Tcl_WideInt length);
|
||||
static DWORD FileGetType(HANDLE handle);
|
||||
static int NativeIsComPort(const TCHAR *nativeName);
|
||||
static int NativeIsComPort(const WCHAR *nativeName);
|
||||
/*
|
||||
* This structure describes the channel type structure for file based IO.
|
||||
*/
|
||||
@@ -836,7 +836,7 @@ TclpOpenFileChannel(
|
||||
Tcl_Channel channel = 0;
|
||||
int channelPermissions = 0;
|
||||
DWORD accessMode = 0, createMode, shareMode, flags;
|
||||
const TCHAR *nativeName;
|
||||
const WCHAR *nativeName;
|
||||
HANDLE handle;
|
||||
char channelName[16 + TCL_INTEGER_SPACE];
|
||||
TclFile readFile = NULL, writeFile = NULL;
|
||||
@@ -932,7 +932,7 @@ TclpOpenFileChannel(
|
||||
flags = FILE_ATTRIBUTE_READONLY;
|
||||
}
|
||||
} else {
|
||||
flags = GetFileAttributes(nativeName);
|
||||
flags = GetFileAttributesW(nativeName);
|
||||
if (flags == 0xFFFFFFFF) {
|
||||
flags = 0;
|
||||
}
|
||||
@@ -948,7 +948,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) {
|
||||
@@ -1540,7 +1540,7 @@ FileGetType(
|
||||
|
||||
static int
|
||||
NativeIsComPort(
|
||||
const TCHAR *nativePath) /* Path of file to access, native encoding. */
|
||||
const WCHAR *nativePath) /* Path of file to access, native encoding. */
|
||||
{
|
||||
const WCHAR *p = (const WCHAR *) nativePath;
|
||||
int i, len = wcslen(p);
|
||||
|
||||
Reference in New Issue
Block a user