mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-15 06:41:38 +00:00
Make builtins pretend to be loaded from the system directory.
This commit is contained in:
parent
2ad28d62d7
commit
9c6ba05436
|
@ -87,6 +87,8 @@ static void load_library( void *base, const char *filename )
|
||||||
{
|
{
|
||||||
HMODULE module = (HMODULE)base;
|
HMODULE module = (HMODULE)base;
|
||||||
WINE_MODREF *wm;
|
WINE_MODREF *wm;
|
||||||
|
char *fullname;
|
||||||
|
DWORD len;
|
||||||
|
|
||||||
if (!base)
|
if (!base)
|
||||||
{
|
{
|
||||||
|
@ -104,14 +106,27 @@ static void load_library( void *base, const char *filename )
|
||||||
if (GetModuleHandleA( filename ))
|
if (GetModuleHandleA( filename ))
|
||||||
MESSAGE( "Warning: loading builtin %s, but native version already present. Expect trouble.\n", filename );
|
MESSAGE( "Warning: loading builtin %s, but native version already present. Expect trouble.\n", filename );
|
||||||
|
|
||||||
/* Create 32-bit MODREF */
|
len = GetSystemDirectoryA( NULL, 0 );
|
||||||
if (!(wm = PE_CreateModule( module, filename, 0, 0, TRUE )))
|
if (!(fullname = HeapAlloc( GetProcessHeap(), 0, len + strlen(filename) + 1 )))
|
||||||
{
|
{
|
||||||
ERR( "can't load %s\n", filename );
|
ERR( "can't load %s\n", filename );
|
||||||
SetLastError( ERROR_OUTOFMEMORY );
|
SetLastError( ERROR_OUTOFMEMORY );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TRACE( "loaded %s %p %x\n", filename, wm, module );
|
GetSystemDirectoryA( fullname, len );
|
||||||
|
strcat( fullname, "\\" );
|
||||||
|
strcat( fullname, filename );
|
||||||
|
|
||||||
|
/* Create 32-bit MODREF */
|
||||||
|
if (!(wm = PE_CreateModule( module, fullname, 0, 0, TRUE )))
|
||||||
|
{
|
||||||
|
ERR( "can't load %s\n", filename );
|
||||||
|
HeapFree( GetProcessHeap(), 0, fullname );
|
||||||
|
SetLastError( ERROR_OUTOFMEMORY );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
TRACE( "loaded %s %p %x\n", fullname, wm, module );
|
||||||
|
HeapFree( GetProcessHeap(), 0, fullname );
|
||||||
wm->refCount++; /* we don't support freeing builtin dlls (FIXME)*/
|
wm->refCount++; /* we don't support freeing builtin dlls (FIXME)*/
|
||||||
|
|
||||||
/* setup relay debugging entry points */
|
/* setup relay debugging entry points */
|
||||||
|
|
Loading…
Reference in a new issue