Changeset View
Changeset View
Standalone View
Standalone View
files/d3d9-helper.patch
| From 1b441555922dc0d80699de41b52aa0fa51e65aaf Mon Sep 17 00:00:00 2001 | From 5ddf2f0c5e72b819bdc45cc64096fec81d9503ee Mon Sep 17 00:00:00 2001 | ||||
| From: Nick Sarnie <commendsarnex@gmail.com> | From: Nick Sarnie <commendsarnex@gmail.com> | ||||
| Date: Sun, 4 Mar 2018 12:55:12 -0500 | Date: Sat, 17 Mar 2018 19:16:55 -0400 | ||||
| Subject: [PATCH] D3D9 Helper | Subject: [PATCH] D3D9 Helper | ||||
| Signed-off-by: Nick Sarnie <commendsarnex@gmail.com> | Signed-off-by: Nick Sarnie <commendsarnex@gmail.com> | ||||
| --- | --- | ||||
| dlls/ntdll/loader.c | 205 ++++++++++++++++++++++++----- | dlls/ntdll/loader.c | 205 ++++++++++++++++++++++++----- | ||||
| dlls/ntdll/loadorder.c | 298 ++++++++++++++++++++++++++++++++----------- | dlls/ntdll/loadorder.c | 298 ++++++++++++++++++++++++++++++++----------- | ||||
| dlls/ntdll/ntdll_misc.h | 1 + | dlls/ntdll/ntdll_misc.h | 1 + | ||||
| programs/winecfg/Makefile.in | 1 + | programs/winecfg/Makefile.in | 1 + | ||||
| programs/winecfg/main.c | 12 +- | programs/winecfg/main.c | 12 +- | ||||
| programs/winecfg/resource.h | 5 + | programs/winecfg/resource.h | 5 + | ||||
| programs/winecfg/staging.c | 93 ++++++++++++++ | programs/winecfg/staging.c | 93 ++++++++++++++ | ||||
| programs/winecfg/winecfg.h | 1 + | programs/winecfg/winecfg.h | 1 + | ||||
| programs/winecfg/winecfg.rc | 10 ++ | programs/winecfg/winecfg.rc | 10 ++ | ||||
| 9 files changed, 522 insertions(+), 104 deletions(-) | 9 files changed, 522 insertions(+), 104 deletions(-) | ||||
| create mode 100644 programs/winecfg/staging.c | create mode 100644 programs/winecfg/staging.c | ||||
| diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c | diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c | ||||
| index de2cc543bc..b8b990ba70 100644 | index fe5ce9d1e4..ebb7aea4d0 100644 | ||||
| --- a/dlls/ntdll/loader.c | --- a/dlls/ntdll/loader.c | ||||
| +++ b/dlls/ntdll/loader.c | +++ b/dlls/ntdll/loader.c | ||||
| @@ -99,6 +99,7 @@ struct builtin_load_info | @@ -100,6 +100,7 @@ struct builtin_load_info | ||||
| { | { | ||||
| const WCHAR *load_path; | const WCHAR *load_path; | ||||
| const WCHAR *filename; | const WCHAR *filename; | ||||
| + const WCHAR *fakemodule; | + const WCHAR *fakemodule; | ||||
| NTSTATUS status; | NTSTATUS status; | ||||
| WINE_MODREF *wm; | WINE_MODREF *wm; | ||||
| }; | }; | ||||
| @@ -124,7 +125,8 @@ static WINE_MODREF *cached_modref; | @@ -125,7 +126,8 @@ static WINE_MODREF *cached_modref; | ||||
| static WINE_MODREF *current_modref; | static WINE_MODREF *current_modref; | ||||
| static WINE_MODREF *last_failed_modref; | static WINE_MODREF *last_failed_modref; | ||||
| -static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_MODREF** pwm ); | -static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_MODREF** pwm ); | ||||
| +static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, LPCWSTR fakemodule, | +static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, LPCWSTR fakemodule, | ||||
| + DWORD flags, WINE_MODREF** pwm ); | + DWORD flags, WINE_MODREF** pwm ); | ||||
| static NTSTATUS process_attach( WINE_MODREF *wm, LPVOID lpReserved ); | static NTSTATUS process_attach( WINE_MODREF *wm, LPVOID lpReserved ); | ||||
| static FARPROC find_ordinal_export( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports, | static FARPROC find_ordinal_export( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports, | ||||
| DWORD exp_size, DWORD ordinal, LPCWSTR load_path ); | DWORD exp_size, DWORD ordinal, LPCWSTR load_path ); | ||||
| @@ -477,7 +479,7 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS | @@ -478,7 +480,7 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS | ||||
| if (!(wm = find_basename_module( mod_name ))) | if (!(wm = find_basename_module( mod_name ))) | ||||
| { | { | ||||
| TRACE( "delay loading %s for '%s'\n", debugstr_w(mod_name), forward ); | TRACE( "delay loading %s for '%s'\n", debugstr_w(mod_name), forward ); | ||||
| - if (load_dll( load_path, mod_name, 0, &wm ) == STATUS_SUCCESS && | - if (load_dll( load_path, mod_name, 0, &wm ) == STATUS_SUCCESS && | ||||
| + if (load_dll( load_path, mod_name, NULL, 0, &wm ) == STATUS_SUCCESS && | + if (load_dll( load_path, mod_name, NULL, 0, &wm ) == STATUS_SUCCESS && | ||||
| !(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) | !(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) | ||||
| { | { | ||||
| if (!imports_fixup_done && current_modref) | if (!imports_fixup_done && current_modref) | ||||
| @@ -647,7 +649,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP | @@ -649,7 +651,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP | ||||
| { | { | ||||
| ascii_to_unicode( buffer, name, len ); | ascii_to_unicode( buffer, name, len ); | ||||
| buffer[len] = 0; | buffer[len] = 0; | ||||
| - status = load_dll( load_path, buffer, 0, &wmImp ); | - status = load_dll( load_path, buffer, 0, &wmImp ); | ||||
| + status = load_dll( load_path, buffer, NULL, 0, &wmImp ); | + status = load_dll( load_path, buffer, NULL, 0, &wmImp ); | ||||
| } | } | ||||
| else /* need to allocate a larger buffer */ | else /* need to allocate a larger buffer */ | ||||
| { | { | ||||
| @@ -655,7 +657,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP | @@ -657,7 +659,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP | ||||
| if (!ptr) return FALSE; | if (!ptr) return FALSE; | ||||
| ascii_to_unicode( ptr, name, len ); | ascii_to_unicode( ptr, name, len ); | ||||
| ptr[len] = 0; | ptr[len] = 0; | ||||
| - status = load_dll( load_path, ptr, 0, &wmImp ); | - status = load_dll( load_path, ptr, 0, &wmImp ); | ||||
| + status = load_dll( load_path, ptr, NULL, 0, &wmImp ); | + status = load_dll( load_path, ptr, NULL, 0, &wmImp ); | ||||
| RtlFreeHeap( GetProcessHeap(), 0, ptr ); | RtlFreeHeap( GetProcessHeap(), 0, ptr ); | ||||
| } | } | ||||
| @@ -940,7 +942,7 @@ static NTSTATUS fixup_imports_ilonly( WINE_MODREF *wm, LPCWSTR load_path, void * | @@ -943,7 +945,7 @@ static NTSTATUS fixup_imports_ilonly( WINE_MODREF *wm, LPCWSTR load_path, void * | ||||
| prev = current_modref; | prev = current_modref; | ||||
| current_modref = wm; | current_modref = wm; | ||||
| - if (!(status = load_dll( load_path, mscoreeW, 0, &imp ))) wm->deps[0] = imp; | - if (!(status = load_dll( load_path, mscoreeW, 0, &imp ))) wm->deps[0] = imp; | ||||
| + if (!(status = load_dll( load_path, mscoreeW, NULL, 0, &imp ))) wm->deps[0] = imp; | + if (!(status = load_dll( load_path, mscoreeW, NULL, 0, &imp ))) wm->deps[0] = imp; | ||||
| current_modref = prev; | current_modref = prev; | ||||
| if (status) | if (status) | ||||
| { | { | ||||
| @@ -1023,7 +1025,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) | @@ -1028,7 +1030,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) | ||||
| * Allocate a WINE_MODREF structure and add it to the process list | * Allocate a WINE_MODREF structure and add it to the process list | ||||
| * The loader_section must be locked while calling this function. | * The loader_section must be locked while calling this function. | ||||
| */ | */ | ||||
| -static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename ) | -static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename ) | ||||
| +static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename, LPCWSTR fakemodule ) | +static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename, LPCWSTR fakemodule ) | ||||
| { | { | ||||
| WINE_MODREF *wm; | WINE_MODREF *wm; | ||||
| const WCHAR *p; | const WCHAR *p; | ||||
| @@ -1037,7 +1039,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename ) | @@ -1042,7 +1044,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename ) | ||||
| wm->ldr.TlsIndex = -1; | wm->ldr.TlsIndex = -1; | ||||
| wm->ldr.LoadCount = 1; | wm->ldr.LoadCount = 1; | ||||
| - RtlCreateUnicodeString( &wm->ldr.FullDllName, filename ); | - RtlCreateUnicodeString( &wm->ldr.FullDllName, filename ); | ||||
| + RtlCreateUnicodeString( &wm->ldr.FullDllName, fakemodule ? fakemodule : filename ); | + RtlCreateUnicodeString( &wm->ldr.FullDllName, fakemodule ? fakemodule : filename ); | ||||
| if ((p = strrchrW( wm->ldr.FullDllName.Buffer, '\\' ))) p++; | if ((p = strrchrW( wm->ldr.FullDllName.Buffer, '\\' ))) p++; | ||||
| else p = wm->ldr.FullDllName.Buffer; | else p = wm->ldr.FullDllName.Buffer; | ||||
| RtlInitUnicodeString( &wm->ldr.BaseDllName, p ); | RtlInitUnicodeString( &wm->ldr.BaseDllName, p ); | ||||
| @@ -1649,7 +1651,7 @@ static void load_builtin_callback( void *module, const char *filename ) | @@ -1654,7 +1656,7 @@ static void load_builtin_callback( void *module, const char *filename ) | ||||
| return; | return; | ||||
| } | } | ||||
| - wm = alloc_module( module, fullname ); | - wm = alloc_module( module, fullname ); | ||||
| + wm = alloc_module( module, fullname, builtin_load_info->fakemodule ); | + wm = alloc_module( module, fullname, builtin_load_info->fakemodule ); | ||||
| RtlFreeHeap( GetProcessHeap(), 0, fullname ); | RtlFreeHeap( GetProcessHeap(), 0, fullname ); | ||||
| if (!wm) | if (!wm) | ||||
| { | { | ||||
| @@ -1859,8 +1861,8 @@ static BOOL is_valid_binary( HMODULE module, const pe_image_info_t *info ) | @@ -1864,8 +1866,8 @@ static BOOL is_valid_binary( HMODULE module, const pe_image_info_t *info ) | ||||
| /****************************************************************************** | /****************************************************************************** | ||||
| * load_native_dll (internal) | * load_native_dll (internal) | ||||
| */ | */ | ||||
| -static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, | -static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, | ||||
| - DWORD flags, WINE_MODREF** pwm, struct stat *st ) | - DWORD flags, WINE_MODREF** pwm, struct stat *st ) | ||||
| +static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, LPCWSTR fakemodule, | +static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, LPCWSTR fakemodule, | ||||
| + HANDLE file, DWORD flags, WINE_MODREF** pwm, struct stat *st ) | + HANDLE file, DWORD flags, WINE_MODREF** pwm, struct stat *st ) | ||||
| { | { | ||||
| void *module; | void *module; | ||||
| HANDLE mapping; | HANDLE mapping; | ||||
| @@ -1903,7 +1905,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, | @@ -1908,7 +1910,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, | ||||
| /* create the MODREF */ | /* create the MODREF */ | ||||
| - if (!(wm = alloc_module( module, name ))) | - if (!(wm = alloc_module( module, name ))) | ||||
| + if (!(wm = alloc_module( module, name, fakemodule ))) | + if (!(wm = alloc_module( module, name, fakemodule ))) | ||||
| { | { | ||||
| if (module) NtUnmapViewOfSection( NtCurrentProcess(), module ); | if (module) NtUnmapViewOfSection( NtCurrentProcess(), module ); | ||||
| return STATUS_NO_MEMORY; | return STATUS_NO_MEMORY; | ||||
| @@ -1967,8 +1969,8 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, | @@ -1972,8 +1974,8 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, | ||||
| /*********************************************************************** | /*********************************************************************** | ||||
| * load_builtin_dll | * load_builtin_dll | ||||
| */ | */ | ||||
| -static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file, | -static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file, | ||||
| - DWORD flags, WINE_MODREF** pwm ) | - DWORD flags, WINE_MODREF** pwm ) | ||||
| +static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, LPCWSTR fakemodule, | +static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, LPCWSTR fakemodule, | ||||
| + HANDLE file, DWORD flags, WINE_MODREF** pwm ) | + HANDLE file, DWORD flags, WINE_MODREF** pwm ) | ||||
| { | { | ||||
| char error[256], dllname[MAX_PATH]; | char error[256], dllname[MAX_PATH]; | ||||
| const WCHAR *name, *p; | const WCHAR *name, *p; | ||||
| @@ -1988,6 +1990,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file, | @@ -1993,6 +1995,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file, | ||||
| */ | */ | ||||
| info.load_path = load_path; | info.load_path = load_path; | ||||
| info.filename = NULL; | info.filename = NULL; | ||||
| + info.fakemodule = fakemodule; | + info.fakemodule = fakemodule; | ||||
| info.status = STATUS_SUCCESS; | info.status = STATUS_SUCCESS; | ||||
| info.wm = NULL; | info.wm = NULL; | ||||
| @@ -2186,6 +2189,108 @@ done: | @@ -2191,6 +2194,108 @@ done: | ||||
| return status; | return status; | ||||
| } | } | ||||
| +#if defined(__i386__) | +#if defined(__i386__) | ||||
| +#define CURRENT_ARCH IMAGE_FILE_MACHINE_I386 | +#define CURRENT_ARCH IMAGE_FILE_MACHINE_I386 | ||||
| +#elif defined(__x86_64__) | +#elif defined(__x86_64__) | ||||
| +#define CURRENT_ARCH IMAGE_FILE_MACHINE_AMD64 | +#define CURRENT_ARCH IMAGE_FILE_MACHINE_AMD64 | ||||
| +#elif defined(__arm__) | +#elif defined(__arm__) | ||||
| ▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| + return ext_header.FileHeader.Machine; | + return ext_header.FileHeader.Machine; | ||||
| + } | + } | ||||
| + | + | ||||
| + return 0; | + return 0; | ||||
| +} | +} | ||||
| /*********************************************************************** | /*********************************************************************** | ||||
| * open_dll_file | * open_dll_file | ||||
| @@ -2232,7 +2337,7 @@ static HANDLE open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, struct | @@ -2237,7 +2342,7 @@ static HANDLE open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, struct | ||||
| */ | */ | ||||
| static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, | static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, | ||||
| WCHAR *filename, ULONG *size, WINE_MODREF **pwm, | WCHAR *filename, ULONG *size, WINE_MODREF **pwm, | ||||
| - HANDLE *handle, struct stat *st ) | - HANDLE *handle, struct stat *st ) | ||||
| + HANDLE *handle, struct stat *st, BOOL check_arch ) | + HANDLE *handle, struct stat *st, BOOL check_arch ) | ||||
| { | { | ||||
| UNICODE_STRING nt_name; | UNICODE_STRING nt_name; | ||||
| WCHAR *file_part, *ext, *dllname; | WCHAR *file_part, *ext, *dllname; | ||||
| @@ -2277,20 +2382,41 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, | @@ -2282,20 +2387,41 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, | ||||
| if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH) | if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH) | ||||
| { | { | ||||
| - /* we need to search for it */ | - /* we need to search for it */ | ||||
| - len = RtlDosSearchPath_U( load_path, libname, NULL, *size, filename, &file_part ); | - len = RtlDosSearchPath_U( load_path, libname, NULL, *size, filename, &file_part ); | ||||
| - if (len) | - if (len) | ||||
| + while (load_path) | + while (load_path) | ||||
| { | { | ||||
| Show All 29 Lines | |||||
| + if (*handle) goto found; | + if (*handle) goto found; | ||||
| + | + | ||||
| + next: | + next: | ||||
| + load_path = strchrW(load_path, ';'); | + load_path = strchrW(load_path, ';'); | ||||
| + if (load_path) load_path++; | + if (load_path) load_path++; | ||||
| } | } | ||||
| /* not found */ | /* not found */ | ||||
| @@ -2338,8 +2464,10 @@ overflow: | @@ -2343,8 +2469,10 @@ overflow: | ||||
| * Load a PE style module according to the load order. | * Load a PE style module according to the load order. | ||||
| * The loader_section must be locked while calling this function. | * The loader_section must be locked while calling this function. | ||||
| */ | */ | ||||
| -static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_MODREF** pwm ) | -static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_MODREF** pwm ) | ||||
| +static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, LPCWSTR fakemodule, | +static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, LPCWSTR fakemodule, | ||||
| + DWORD flags, WINE_MODREF** pwm ) | + DWORD flags, WINE_MODREF** pwm ) | ||||
| { | { | ||||
| + BOOL data = flags & (LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE); | + BOOL data = flags & (LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE); | ||||
| enum loadorder loadorder; | enum loadorder loadorder; | ||||
| WCHAR buffer[64]; | WCHAR buffer[64]; | ||||
| WCHAR *filename; | WCHAR *filename; | ||||
| @@ -2356,7 +2484,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | @@ -2361,7 +2489,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | ||||
| size = sizeof(buffer); | size = sizeof(buffer); | ||||
| for (;;) | for (;;) | ||||
| { | { | ||||
| - nts = find_dll_file( load_path, libname, filename, &size, pwm, &handle, &st ); | - nts = find_dll_file( load_path, libname, filename, &size, pwm, &handle, &st ); | ||||
| + nts = find_dll_file( load_path, libname, filename, &size, pwm, &handle, &st, !data ); | + nts = find_dll_file( load_path, libname, filename, &size, pwm, &handle, &st, !data ); | ||||
| if (nts == STATUS_SUCCESS) break; | if (nts == STATUS_SUCCESS) break; | ||||
| if (filename != buffer) RtlFreeHeap( GetProcessHeap(), 0, filename ); | if (filename != buffer) RtlFreeHeap( GetProcessHeap(), 0, filename ); | ||||
| if (nts != STATUS_BUFFER_TOO_SMALL) return nts; | if (nts != STATUS_BUFFER_TOO_SMALL) return nts; | ||||
| @@ -2376,6 +2504,25 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | @@ -2381,6 +2509,25 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | ||||
| } | } | ||||
| main_exe = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress ); | main_exe = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress ); | ||||
| + | + | ||||
| + /* handle dll redirection */ | + /* handle dll redirection */ | ||||
| + if (!fakemodule) | + if (!fakemodule) | ||||
| + { | + { | ||||
| + BYTE buffer2[sizeof(KEY_VALUE_PARTIAL_INFORMATION) + MAX_PATH * sizeof(WCHAR)]; | + BYTE buffer2[sizeof(KEY_VALUE_PARTIAL_INFORMATION) + MAX_PATH * sizeof(WCHAR)]; | ||||
| Show All 9 Lines | |||||
| + if (filename != buffer) RtlFreeHeap( GetProcessHeap(), 0, filename ); | + if (filename != buffer) RtlFreeHeap( GetProcessHeap(), 0, filename ); | ||||
| + return nts; | + return nts; | ||||
| + } | + } | ||||
| + } | + } | ||||
| + | + | ||||
| loadorder = get_load_order( main_exe ? main_exe->ldr.BaseDllName.Buffer : NULL, filename ); | loadorder = get_load_order( main_exe ? main_exe->ldr.BaseDllName.Buffer : NULL, filename ); | ||||
| if (handle && is_fake_dll( handle )) | if (handle && is_fake_dll( handle )) | ||||
| @@ -2398,22 +2545,22 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | @@ -2403,22 +2550,22 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | ||||
| if (!handle) nts = STATUS_DLL_NOT_FOUND; | if (!handle) nts = STATUS_DLL_NOT_FOUND; | ||||
| else | else | ||||
| { | { | ||||
| - nts = load_native_dll( load_path, filename, handle, flags, pwm, &st ); | - nts = load_native_dll( load_path, filename, handle, flags, pwm, &st ); | ||||
| + nts = load_native_dll( load_path, filename, fakemodule, handle, flags, pwm, &st ); | + nts = load_native_dll( load_path, filename, fakemodule, handle, flags, pwm, &st ); | ||||
| if (nts == STATUS_INVALID_IMAGE_NOT_MZ) | if (nts == STATUS_INVALID_IMAGE_NOT_MZ) | ||||
| /* not in PE format, maybe it's a builtin */ | /* not in PE format, maybe it's a builtin */ | ||||
| - nts = load_builtin_dll( load_path, filename, handle, flags, pwm ); | - nts = load_builtin_dll( load_path, filename, handle, flags, pwm ); | ||||
| Show All 11 Lines | + nts = load_builtin_dll( load_path, filename, fakemodule, handle, flags, pwm ); | ||||
| if (!handle) break; /* nothing else we can try */ | if (!handle) break; /* nothing else we can try */ | ||||
| /* file is not a builtin library, try without using the specified file */ | /* file is not a builtin library, try without using the specified file */ | ||||
| if (nts != STATUS_SUCCESS) | if (nts != STATUS_SUCCESS) | ||||
| - nts = load_builtin_dll( load_path, filename, 0, flags, pwm ); | - nts = load_builtin_dll( load_path, filename, 0, flags, pwm ); | ||||
| + nts = load_builtin_dll( load_path, filename, fakemodule, 0, flags, pwm ); | + nts = load_builtin_dll( load_path, filename, fakemodule, 0, flags, pwm ); | ||||
| if (nts == STATUS_SUCCESS && loadorder == LO_DEFAULT && | if (nts == STATUS_SUCCESS && loadorder == LO_DEFAULT && | ||||
| (MODULE_InitDLL( *pwm, DLL_WINE_PREATTACH, NULL ) != STATUS_SUCCESS)) | (MODULE_InitDLL( *pwm, DLL_WINE_PREATTACH, NULL ) != STATUS_SUCCESS)) | ||||
| { | { | ||||
| @@ -2423,7 +2570,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | @@ -2428,7 +2575,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | ||||
| nts = STATUS_DLL_NOT_FOUND; | nts = STATUS_DLL_NOT_FOUND; | ||||
| } | } | ||||
| if (nts == STATUS_DLL_NOT_FOUND && loadorder != LO_BUILTIN) | if (nts == STATUS_DLL_NOT_FOUND && loadorder != LO_BUILTIN) | ||||
| - nts = load_native_dll( load_path, filename, handle, flags, pwm, &st ); | - nts = load_native_dll( load_path, filename, handle, flags, pwm, &st ); | ||||
| + nts = load_native_dll( load_path, filename, fakemodule, handle, flags, pwm, &st ); | + nts = load_native_dll( load_path, filename, fakemodule, handle, flags, pwm, &st ); | ||||
| break; | break; | ||||
| } | } | ||||
| @@ -2456,7 +2603,7 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags, | @@ -2461,7 +2608,7 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags, | ||||
| RtlEnterCriticalSection( &loader_section ); | RtlEnterCriticalSection( &loader_section ); | ||||
| if (!path_name) path_name = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; | if (!path_name) path_name = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; | ||||
| - nts = load_dll( path_name, libname->Buffer, flags, &wm ); | - nts = load_dll( path_name, libname->Buffer, flags, &wm ); | ||||
| + nts = load_dll( path_name, libname->Buffer, NULL, flags, &wm ); | + nts = load_dll( path_name, libname->Buffer, NULL, flags, &wm ); | ||||
| if (nts == STATUS_SUCCESS && !(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) | if (nts == STATUS_SUCCESS && !(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) | ||||
| { | { | ||||
| @@ -2495,7 +2642,7 @@ NTSTATUS WINAPI LdrGetDllHandle( LPCWSTR load_path, ULONG flags, const UNICODE_S | @@ -2500,7 +2647,7 @@ NTSTATUS WINAPI LdrGetDllHandle( LPCWSTR load_path, ULONG flags, const UNICODE_S | ||||
| size = sizeof(buffer); | size = sizeof(buffer); | ||||
| for (;;) | for (;;) | ||||
| { | { | ||||
| - status = find_dll_file( load_path, name->Buffer, filename, &size, &wm, &handle, &st ); | - status = find_dll_file( load_path, name->Buffer, filename, &size, &wm, &handle, &st ); | ||||
| + status = find_dll_file( load_path, name->Buffer, filename, &size, &wm, &handle, &st, TRUE ); | + status = find_dll_file( load_path, name->Buffer, filename, &size, &wm, &handle, &st, TRUE ); | ||||
| if (handle) NtClose( handle ); | if (handle) NtClose( handle ); | ||||
| if (filename != buffer) RtlFreeHeap( GetProcessHeap(), 0, filename ); | if (filename != buffer) RtlFreeHeap( GetProcessHeap(), 0, filename ); | ||||
| if (status != STATUS_BUFFER_TOO_SMALL) break; | if (status != STATUS_BUFFER_TOO_SMALL) break; | ||||
| @@ -3420,7 +3567,7 @@ void __wine_process_init(void) | @@ -3422,7 +3569,7 @@ void __wine_process_init(void) | ||||
| /* setup the load callback and create ntdll modref */ | /* setup the load callback and create ntdll modref */ | ||||
| wine_dll_set_callback( load_builtin_callback ); | wine_dll_set_callback( load_builtin_callback ); | ||||
| - if ((status = load_builtin_dll( NULL, kernel32W, 0, 0, &wm )) != STATUS_SUCCESS) | - if ((status = load_builtin_dll( NULL, kernel32W, 0, 0, &wm )) != STATUS_SUCCESS) | ||||
| + if ((status = load_builtin_dll( NULL, kernel32W, NULL, 0, 0, &wm )) != STATUS_SUCCESS) | + if ((status = load_builtin_dll( NULL, kernel32W, NULL, 0, 0, &wm )) != STATUS_SUCCESS) | ||||
| { | { | ||||
| MESSAGE( "wine: could not load kernel32.dll, status %x\n", status ); | MESSAGE( "wine: could not load kernel32.dll, status %x\n", status ); | ||||
| exit(1); | exit(1); | ||||
| ▲ Show 20 Lines • Show All 611 Lines • Show Last 20 Lines | |||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.