Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c40cd30b32e29dbc14bec013d8dbb1d46cea7c96
Ticket: 3508771fffffffffffffffffffffffffffffffff
load tclreg.dll in cygwin tclsh
User & Date: nijtmans on 2012-03-19 15:35:20
Changes

  1. assignee changed to: "nijtmans"
  2. cmimetype changed to: "text/plain"
  3. 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.
    
  4. foundin changed to: "obsolete: 8.5.11"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "nijtmans"
  10. subsystem changed to: "52. Portability Support"
  11. title changed to: "load tclreg.dll in cygwin tclsh"
  12. type changed to: "Bug"