summaryrefslogtreecommitdiffstats
path: root/win/tclWinInt.h
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinInt.h')
-rw-r--r--win/tclWinInt.h151
1 files changed, 58 insertions, 93 deletions
diff --git a/win/tclWinInt.h b/win/tclWinInt.h
index a76865d..5e28d19 100644
--- a/win/tclWinInt.h
+++ b/win/tclWinInt.h
@@ -15,14 +15,6 @@
#include "tclInt.h"
/*
- * The following specifies how much stack space TclpCheckStackSpace()
- * ensures is available. TclpCheckStackSpace() is called by Tcl_EvalObj()
- * to help avoid overflowing the stack in the case of infinite recursion.
- */
-
-#define TCL_WIN_STACK_THRESHOLD 0x8000
-
-/*
* Some versions of Borland C have a define for the OSVERSIONINFO for
* Win32s and for NT, but not for Windows 95.
* Define VER_PLATFORM_WIN32_CE for those without newer headers.
@@ -36,7 +28,7 @@
#endif
/*
- * The following structure keeps track of whether we are using the
+ * The following structure keeps track of whether we are using the
* multi-byte or the wide-character interfaces to the operating system.
* System calls should be made through the following function table.
*/
@@ -48,104 +40,78 @@ typedef union {
typedef struct TclWinProcs {
int useWide;
-
- BOOL (WINAPI *buildCommDCBProc)(CONST TCHAR *, LPDCB);
- TCHAR *(WINAPI *charLowerProc)(TCHAR *);
- BOOL (WINAPI *copyFileProc)(CONST TCHAR *, CONST TCHAR *, BOOL);
- BOOL (WINAPI *createDirectoryProc)(CONST TCHAR *, LPSECURITY_ATTRIBUTES);
- HANDLE (WINAPI *createFileProc)(CONST TCHAR *, DWORD, DWORD,
+ BOOL (WINAPI *buildCommDCBProc)(const TCHAR *, LPDCB);
+ TCHAR * (WINAPI *charLowerProc)(TCHAR *);
+ BOOL (WINAPI *copyFileProc)(const TCHAR *, const TCHAR *, BOOL);
+ BOOL (WINAPI *createDirectoryProc)(const TCHAR *, LPSECURITY_ATTRIBUTES);
+ HANDLE (WINAPI *createFileProc)(const TCHAR *, DWORD, DWORD,
LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE);
- BOOL (WINAPI *createProcessProc)(CONST TCHAR *, TCHAR *,
- LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD,
- LPVOID, CONST TCHAR *, LPSTARTUPINFOA, LPPROCESS_INFORMATION);
- BOOL (WINAPI *deleteFileProc)(CONST TCHAR *);
- HANDLE (WINAPI *findFirstFileProc)(CONST TCHAR *, WIN32_FIND_DATAT *);
+ BOOL (WINAPI *createProcessProc)(const TCHAR *, TCHAR *,
+ LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD,
+ LPVOID, const TCHAR *, LPSTARTUPINFO, LPPROCESS_INFORMATION);
+ BOOL (WINAPI *deleteFileProc)(const TCHAR *);
+ HANDLE (WINAPI *findFirstFileProc)(const TCHAR *, WIN32_FIND_DATAT *);
BOOL (WINAPI *findNextFileProc)(HANDLE, WIN32_FIND_DATAT *);
- BOOL (WINAPI *getComputerNameProc)(WCHAR *, LPDWORD);
- DWORD (WINAPI *getCurrentDirectoryProc)(DWORD, WCHAR *);
- DWORD (WINAPI *getFileAttributesProc)(CONST TCHAR *);
- DWORD (WINAPI *getFullPathNameProc)(CONST TCHAR *, DWORD nBufferLength,
- WCHAR *, TCHAR **);
- DWORD (WINAPI *getModuleFileNameProc)(HMODULE, WCHAR *, int);
- DWORD (WINAPI *getShortPathNameProc)(CONST TCHAR *, WCHAR *, DWORD);
- UINT (WINAPI *getTempFileNameProc)(CONST TCHAR *, CONST TCHAR *, UINT,
- WCHAR *);
- DWORD (WINAPI *getTempPathProc)(DWORD, WCHAR *);
- BOOL (WINAPI *getVolumeInformationProc)(CONST TCHAR *, WCHAR *, DWORD,
- LPDWORD, LPDWORD, LPDWORD, WCHAR *, DWORD);
- HINSTANCE (WINAPI *loadLibraryExProc)(CONST TCHAR *, HANDLE, DWORD);
- TCHAR (WINAPI *lstrcpyProc)(WCHAR *, CONST TCHAR *);
- BOOL (WINAPI *moveFileProc)(CONST TCHAR *, CONST TCHAR *);
- BOOL (WINAPI *removeDirectoryProc)(CONST TCHAR *);
- DWORD (WINAPI *searchPathProc)(CONST TCHAR *, CONST TCHAR *,
- CONST TCHAR *, DWORD, WCHAR *, TCHAR **);
- BOOL (WINAPI *setCurrentDirectoryProc)(CONST TCHAR *);
- BOOL (WINAPI *setFileAttributesProc)(CONST TCHAR *, DWORD);
- /*
+ BOOL (WINAPI *getComputerNameProc)(TCHAR *, LPDWORD);
+ DWORD (WINAPI *getCurrentDirectoryProc)(DWORD, TCHAR *);
+ DWORD (WINAPI *getFileAttributesProc)(const TCHAR *);
+ DWORD (WINAPI *getFullPathNameProc)(const TCHAR *, DWORD, TCHAR *,
+ TCHAR **);
+ DWORD (WINAPI *getShortPathNameProc)(const TCHAR *, TCHAR *, DWORD);
+ UINT (WINAPI *getTempFileNameProc)(const TCHAR *, const TCHAR *, UINT,
+ TCHAR *);
+ DWORD (WINAPI *getTempPathProc)(DWORD, TCHAR *);
+ BOOL (WINAPI *getVolumeInformationProc)(const TCHAR *, TCHAR *, DWORD,
+ LPDWORD, LPDWORD, LPDWORD, TCHAR *, DWORD);
+ HINSTANCE (WINAPI *loadLibraryExProc)(const TCHAR *, HANDLE, DWORD);
+ BOOL (WINAPI *moveFileProc)(const TCHAR *, const TCHAR *);
+ BOOL (WINAPI *removeDirectoryProc)(const TCHAR *);
+ DWORD (WINAPI *searchPathProc)(const TCHAR *, const TCHAR *,
+ const TCHAR *, DWORD, TCHAR *, TCHAR **);
+ BOOL (WINAPI *setCurrentDirectoryProc)(const TCHAR *);
+ BOOL (WINAPI *setFileAttributesProc)(const TCHAR *, DWORD);
+ /*
* These two function pointers will only be set when
* Tcl_FindExecutable is called. If you don't ever call that
* function, the application will crash whenever WinTcl tries to call
* functions through these null pointers. That is not a bug in Tcl
* -- Tcl_FindExecutable is obligatory in recent Tcl releases.
*/
- BOOL (WINAPI *getFileAttributesExProc)(CONST TCHAR *,
+ BOOL (WINAPI *getFileAttributesExProc)(const TCHAR *,
GET_FILEEX_INFO_LEVELS, LPVOID);
- BOOL (WINAPI *createHardLinkProc)(CONST TCHAR*, CONST TCHAR*,
- LPSECURITY_ATTRIBUTES);
-
- /* deleted INT (__cdecl *utimeProc)(CONST TCHAR*, struct _utimbuf *); */
+ BOOL (WINAPI *createHardLinkProc)(const TCHAR *, const TCHAR *,
+ LPSECURITY_ATTRIBUTES);
+
/* These two are also NULL at start; see comment above */
- HANDLE (WINAPI *findFirstFileExProc)(CONST TCHAR*, UINT,
- LPVOID, UINT,
- LPVOID, DWORD);
- BOOL (WINAPI *getVolumeNameForVMPProc)(CONST TCHAR*, TCHAR*, DWORD);
- DWORD (WINAPI *getLongPathNameProc)(CONST TCHAR*, TCHAR*, DWORD);
- /*
+ HANDLE (WINAPI *findFirstFileExProc)(const TCHAR *, UINT,
+ LPVOID, UINT, LPVOID, DWORD);
+ BOOL (WINAPI *getVolumeNameForVMPProc)(const TCHAR *, TCHAR *, DWORD);
+ DWORD (WINAPI *getLongPathNameProc)(const TCHAR *, TCHAR *, DWORD);
+ /*
* These six are for the security sdk to get correct file
* permissions on NT, 2000, XP, etc. On 95,98,ME they are
* always null.
*/
- BOOL (WINAPI *getFileSecurityProc)(LPCTSTR lpFileName,
- SECURITY_INFORMATION RequestedInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD nLength,
- LPDWORD lpnLengthNeeded);
- BOOL (WINAPI *impersonateSelfProc) (SECURITY_IMPERSONATION_LEVEL
- ImpersonationLevel);
- BOOL (WINAPI *openThreadTokenProc) (HANDLE ThreadHandle,
- DWORD DesiredAccess, BOOL OpenAsSelf,
- PHANDLE TokenHandle);
+ BOOL (WINAPI *getFileSecurityProc)(LPCTSTR, SECURITY_INFORMATION,
+ PSECURITY_DESCRIPTOR, DWORD, LPDWORD);
+ BOOL (WINAPI *impersonateSelfProc) (SECURITY_IMPERSONATION_LEVEL);
+ BOOL (WINAPI *openThreadTokenProc) (HANDLE, DWORD, BOOL, PHANDLE);
BOOL (WINAPI *revertToSelfProc) (void);
- VOID (WINAPI *mapGenericMaskProc) (PDWORD AccessMask,
- PGENERIC_MAPPING GenericMapping);
- BOOL (WINAPI *accessCheckProc)(PSECURITY_DESCRIPTOR pSecurityDescriptor,
- HANDLE ClientToken, DWORD DesiredAccess,
- PGENERIC_MAPPING GenericMapping,
- PPRIVILEGE_SET PrivilegeSet,
- LPDWORD PrivilegeSetLength,
- LPDWORD GrantedAccess,
- LPBOOL AccessStatus);
+ void (WINAPI *mapGenericMaskProc) (PDWORD, PGENERIC_MAPPING);
+ BOOL (WINAPI *accessCheckProc)(PSECURITY_DESCRIPTOR, HANDLE, DWORD,
+ PGENERIC_MAPPING, PPRIVILEGE_SET, LPDWORD, LPDWORD, LPBOOL);
/*
* Unicode console support. WriteConsole and ReadConsole
*/
- BOOL (WINAPI *readConsoleProc)(
- HANDLE hConsoleInput,
- LPVOID lpBuffer,
- DWORD nNumberOfCharsToRead,
- LPDWORD lpNumberOfCharsRead,
- LPVOID lpReserved
- );
- BOOL (WINAPI *writeConsoleProc)(
- HANDLE hConsoleOutput,
- const VOID* lpBuffer,
- DWORD nNumberOfCharsToWrite,
- LPDWORD lpNumberOfCharsWritten,
- LPVOID lpReserved
- );
- BOOL (WINAPI *getUserName)(LPTSTR lpBuffer, LPDWORD lpnSize);
+ BOOL (WINAPI *readConsoleProc)(HANDLE, LPVOID, DWORD, LPDWORD, LPVOID);
+ BOOL (WINAPI *writeConsoleProc)(HANDLE, const void *, DWORD, LPDWORD,
+ LPVOID);
+ BOOL (WINAPI *getUserName)(LPTSTR, LPDWORD);
+ const TCHAR *(*utf2tchar)(const char *, int, Tcl_DString *);
+ const char *(*tchar2utf)(const TCHAR *, int, Tcl_DString *);
} TclWinProcs;
-MODULE_SCOPE TclWinProcs *tclWinProcs;
+MODULE_SCOPE const TclWinProcs *const tclWinProcs;
/*
* Declarations of functions that are not accessible by way of the
@@ -153,7 +119,7 @@ MODULE_SCOPE TclWinProcs *tclWinProcs;
*/
MODULE_SCOPE char TclWinDriveLetterForVolMountPoint(
- CONST WCHAR *mountPoint);
+ const TCHAR *mountPoint);
MODULE_SCOPE void TclWinEncodingsCleanup();
MODULE_SCOPE void TclWinInit(HINSTANCE hInst);
MODULE_SCOPE TclFile TclWinMakeFile(HANDLE handle);
@@ -163,12 +129,11 @@ MODULE_SCOPE Tcl_Channel TclWinOpenFileChannel(HANDLE handle, char *channelName,
int permissions, int appendMode);
MODULE_SCOPE Tcl_Channel TclWinOpenSerialChannel(HANDLE handle,
char *channelName, int permissions);
-MODULE_SCOPE void TclWinResetInterfaceEncodings();
-MODULE_SCOPE HANDLE TclWinSerialReopen(HANDLE handle, CONST TCHAR *name,
+MODULE_SCOPE HANDLE TclWinSerialReopen(HANDLE handle, const TCHAR *name,
DWORD access);
-MODULE_SCOPE int TclWinSymLinkCopyDirectory(CONST TCHAR* LinkOriginal,
- CONST TCHAR* LinkCopy);
-MODULE_SCOPE int TclWinSymLinkDelete(CONST TCHAR* LinkOriginal,
+MODULE_SCOPE int TclWinSymLinkCopyDirectory(const TCHAR *LinkOriginal,
+ const TCHAR *LinkCopy);
+MODULE_SCOPE int TclWinSymLinkDelete(const TCHAR *LinkOriginal,
int linkOnly);
#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
MODULE_SCOPE void TclWinFreeAllocCache(void);