Changeset 9450eca in tol for toltcl


Ignore:
Timestamp:
Jan 11, 2016, 1:14:34 PM (11 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
8685395
Parents:
a61660c
Message:

fixes #1908,

Aseguramos que windows busque las dll primero en el directorio bin de tol. Si invocamos la funcion SetDllDirectory deshabilitamos el modo "safe DLL search" que cambia el orden de búsqueda de las dll. Ver los enlaces más abajo para una descripción de este modo.

Dynamic-Link Library Search Order: ​https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx

SetDllDirectory function: ​https://msdn.microsoft.com/en-us/library/windows/desktop/ms686203(v=vs.85).aspx

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@7186 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • toltcl/generic/tolsh.c

    ra61660c r9450eca  
    22#include "toltcl.h"
    33
    4 #if !defined(WIN32)
     4#if defined(WIN32)
     5#include "windows.h"
     6#else
    57#include "tol/tol_init.h"
    68#endif
    … …  
    2729}
    2830
     31#if defined(WIN32)
     32void SetupDllSearchPath( const char *argv0 )
     33{
     34  int n;
     35  //const char **strArr;
     36  const char **ptr;
     37  Tcl_DString dstr;
     38 
     39  //ptr = &strArr;
     40  Tcl_SplitPath( argv0, &n, &ptr );
     41  if( n >= 2 )
     42    {
     43          Tcl_DStringInit( &dstr );
     44      Tcl_JoinPath( n - 1, ptr,  &dstr );
     45          SetDllDirectory( Tcl_DStringValue( &dstr ) );
     46          Tcl_DStringFree( &dstr );
     47    }
     48  Tcl_Free( (char*)ptr );
     49}
     50#endif
     51
    2952int AppInit(Tcl_Interp *interp)
    3053{
    … …  
    3457    }
    3558  SetupArgv( interp );
     59  const char *argv0 = Tcl_GetNameOfExecutable();
     60#if defined(WIN32)
     61  SetupDllSearchPath( argv0 );
     62#endif   
    3663  Tcl_VarEval( interp, "lappend", " auto_path", " [file join",
    37                " [file dir [file dir ", Tcl_GetNameOfExecutable(),
     64               " [file dir [file dir ", argv0,
    3865               " ] ] lib ]", NULL );
    3966  if ( !Tcl_PkgRequire( interp, "TolshApp", TOLTCL_VERSION, 1) )
Note: See TracChangeset for help on using the changeset viewer.