Index: libs/wine/loader.c =================================================================== RCS file: /home/wine/wine/libs/wine/loader.c,v retrieving revision 1.4 diff -u -r1.4 loader.c --- libs/wine/loader.c 3 Jul 2003 18:23:10 -0000 1.4 +++ libs/wine/loader.c 22 Jul 2003 11:42:05 -0000 @@ -125,9 +125,14 @@ } /* open a library for a given dll, searching in the dll path - * 'name' must be the Windows dll name (e.g. "kernel32.dll") */ + * 'name' must be the Windows dll name (e.g. "kernel32.dll") + * 'flags' value : + * - 0x0 dlopen RTLD_NOW + * - 0x1 test only + * - 0x2 dlopen RTLD_NOW | RTLD_GLOBAL (only on Darwin) + */ static void *dlopen_dll( const char *name, char *error, int errorsize, - int test_only, int *exists ) + int flags, int *exists ) { int i, namelen = strlen(name); char *buffer, *p; @@ -149,7 +154,10 @@ int len = strlen(dll_paths[i]); p = buffer + dll_path_maxlen - len; memcpy( p, dll_paths[i], len ); - if (!test_only && (ret = wine_dlopen( p, RTLD_NOW, error, errorsize ))) break; + if (!flags && (ret = wine_dlopen( p, RTLD_NOW, error, errorsize ))) break; +#ifdef __APPLE__ + if ((flags == 0x2) && (ret = wine_dlopen( p, RTLD_NOW | RTLD_GLOBAL, error, errorsize ))) break; +#endif if ((*exists = file_exists( p ))) break; /* exists but cannot be loaded, return the error */ } free( buffer ); @@ -422,7 +430,7 @@ void *ntdll; void (*init_func)(int, char **); - if (!(ntdll = dlopen_dll( "ntdll.dll", error, error_size, 0, &file_exists ))) return; + if (!(ntdll = dlopen_dll( "ntdll.dll", error, error_size, 0x2, &file_exists ))) return; if (!(init_func = wine_dlsym( ntdll, "__wine_process_init", error, error_size ))) return; init_func( argc, argv ); }