Overview
| Artifact ID: | c40cd30b32e29dbc14bec013d8dbb1d46cea7c96 |
|---|---|
| Ticket: | 3508771fffffffffffffffffffffffffffffffff
load tclreg.dll in cygwin tclsh |
| User & Date: | nijtmans on 2012-03-19 15:35:20 |
Changes
- assignee changed to: "nijtmans"
- cmimetype changed to: "text/plain"
- comment changed to:
Using the stubs mechanism, it should be possible to load tclreg.dll (compiled with mingw or vc++) in a tclsh compiled with cygwin. I tried it, and it almost works, but not quite..... tclreg.dll calls the function TclWinGetPlatformId(), inits init function: if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) { regWinProcs = &unicodeProcs; } else { regWinProcs = &asciiProcs; } which resides in slot 9 of tclIntPlatStubs. But cygwin uses the UNIX stubs, which has TclpCreateTempFile() in slot 9. So, everything seems to work, but in fact a temporary file is created, and a handle to it is returned. This handle is != VER_PLATFORM_WIN32_NT, so this instructs tclreg.dll to use the ASCII variants of the registry functions. Solution: move TclpCreateTempFile from slot 9 to slot 22, and put TclWinGetPlatformId in slot 9. On UNIX, TclWinGetPlatformId does not exist, so use some #define to map it back to TclpCreateTempFile on non-cygwin. The same potential problem exists with the functions Tcl_WinUtfToTChar and Tcl_WinTCharToUtf, which are in the public API. TclWinGetPlatformId is not public, but because it is used in tclreg.dll I would like to make an exception for that. - foundin changed to: "obsolete: 8.5.11"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nijtmans"
- subsystem changed to: "52. Portability Support"
- title changed to: "load tclreg.dll in cygwin tclsh"
- type changed to: "Bug"