Changeset View
Changeset View
Standalone View
Standalone View
files/d3d9-helper.patch
| From 58190cd8c0e5e9cefe55f3a74c5c2fe223eea3eb Mon Sep 17 00:00:00 2001 | From 08fe179f01e25a1ca594b9719529d3d5c47cc2c4 Mon Sep 17 00:00:00 2001 | ||||
| From: Nick Sarnie <sarnex@gentoo.org> | From: Nick Sarnie <sarnex@gentoo.org> | ||||
| Date: Sun, 2 Sep 2018 10:29:11 -0400 | Date: Sat, 13 Oct 2018 11:40:07 -0400 | ||||
| Subject: [PATCH] D3D9 Helper | Subject: [PATCH] D3D9 Helper | ||||
| Signed-off-by: Nick Sarnie <sarnex@gentoo.org> | Signed-off-by: Nick Sarnie <sarnex@gentoo.org> | ||||
| --- | --- | ||||
| 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 26b2431047..de57f5428b 100644 | index 31168c0972..741205757a 100644 | ||||
| --- a/dlls/ntdll/loader.c | --- a/dlls/ntdll/loader.c | ||||
| +++ b/dlls/ntdll/loader.c | +++ b/dlls/ntdll/loader.c | ||||
| @@ -110,6 +110,7 @@ struct builtin_load_info | @@ -110,6 +110,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; | ||||
| }; | }; | ||||
| @@ -135,7 +136,8 @@ static WINE_MODREF *cached_modref; | @@ -134,7 +135,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 ); | ||||
| @@ -511,7 +513,7 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS | @@ -510,7 +512,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) | ||||
| @@ -682,7 +684,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP | @@ -681,7 +683,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 */ | ||||
| { | { | ||||
| @@ -690,7 +692,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP | @@ -689,7 +691,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 ); | ||||
| } | } | ||||
| @@ -976,7 +978,7 @@ static NTSTATUS fixup_imports_ilonly( WINE_MODREF *wm, LPCWSTR load_path, void * | @@ -975,7 +977,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) | ||||
| { | { | ||||
| @@ -1064,7 +1066,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) | @@ -1063,7 +1065,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; | ||||
| @@ -1078,7 +1080,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename ) | @@ -1077,7 +1079,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 ); | ||||
| @@ -1745,7 +1747,7 @@ static void load_builtin_callback( void *module, const char *filename ) | @@ -1744,7 +1746,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) | ||||
| { | { | ||||
| @@ -1955,8 +1957,8 @@ static BOOL is_valid_binary( HMODULE module, const pe_image_info_t *info ) | @@ -1954,8 +1956,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; | ||||
| @@ -1999,7 +2001,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, | @@ -1998,7 +2000,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; | ||||
| @@ -2067,8 +2069,8 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, | @@ -2066,8 +2068,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; | ||||
| @@ -2088,6 +2090,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file, | @@ -2087,6 +2089,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; | ||||
| @@ -2286,6 +2289,108 @@ done: | @@ -2285,6 +2288,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 | ||||
| @@ -2332,7 +2437,7 @@ static HANDLE open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, struct | @@ -2331,7 +2436,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; | ||||
| @@ -2377,20 +2482,41 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, | @@ -2376,20 +2481,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 */ | ||||
| @@ -2438,8 +2564,10 @@ overflow: | @@ -2437,8 +2563,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; | ||||
| @@ -2456,7 +2584,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | @@ -2455,7 +2583,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; | ||||
| @@ -2476,6 +2604,25 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | @@ -2475,6 +2603,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 )) | ||||
| @@ -2498,22 +2645,22 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | @@ -2497,22 +2644,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)) | ||||
| { | { | ||||
| @@ -2523,7 +2670,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ | @@ -2522,7 +2669,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; | ||||
| } | } | ||||
| @@ -2556,7 +2703,7 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags, | @@ -2555,7 +2702,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)) | ||||
| { | { | ||||
| @@ -2595,7 +2742,7 @@ NTSTATUS WINAPI LdrGetDllHandle( LPCWSTR load_path, ULONG flags, const UNICODE_S | @@ -2594,7 +2741,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; | ||||
| @@ -3517,7 +3664,7 @@ void __wine_process_init(void) | @@ -3515,7 +3662,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 381 Lines • ▼ Show 20 Lines | |||||
| + ret = NULL; | + ret = NULL; | ||||
| + TRACE( "no redirection found for %s\n", debugstr_w(path) ); | + TRACE( "no redirection found for %s\n", debugstr_w(path) ); | ||||
| + | + | ||||
| + done: | + done: | ||||
| + RtlFreeHeap( GetProcessHeap(), 0, module ); | + RtlFreeHeap( GetProcessHeap(), 0, module ); | ||||
| + return ret; | + return ret; | ||||
| +} | +} | ||||
| diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h | diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h | ||||
| index 165f083425..78c6ee0710 100644 | index f4de3cf848..1e1990a0fb 100644 | ||||
| --- a/dlls/ntdll/ntdll_misc.h | --- a/dlls/ntdll/ntdll_misc.h | ||||
| +++ b/dlls/ntdll/ntdll_misc.h | +++ b/dlls/ntdll/ntdll_misc.h | ||||
| @@ -214,6 +214,7 @@ enum loadorder | @@ -213,6 +213,7 @@ enum loadorder | ||||
| }; | }; | ||||
| extern enum loadorder get_load_order( const WCHAR *app_name, const WCHAR *path ) DECLSPEC_HIDDEN; | extern enum loadorder get_load_order( const WCHAR *app_name, const WCHAR *path ) DECLSPEC_HIDDEN; | ||||
| +extern WCHAR* get_redirect( const WCHAR *app_name, const WCHAR *path, BYTE *buffer, ULONG size ) DECLSPEC_HIDDEN; | +extern WCHAR* get_redirect( const WCHAR *app_name, const WCHAR *path, BYTE *buffer, ULONG size ) DECLSPEC_HIDDEN; | ||||
| struct debug_info | struct debug_info | ||||
| { | { | ||||
| diff --git a/programs/winecfg/Makefile.in b/programs/winecfg/Makefile.in | diff --git a/programs/winecfg/Makefile.in b/programs/winecfg/Makefile.in | ||||
| ▲ Show 20 Lines • Show All 200 Lines • ▼ Show 20 Lines | |||||
| + LTEXT "The following settings are experimental and may break stuff!\nMake sure to reset them again in case of a problem.\nGallium Nine requires MESA graphic drivers and AMD/Nvidia GPU.\n",IDC_STATIC,16,16,230,24 | + LTEXT "The following settings are experimental and may break stuff!\nMake sure to reset them again in case of a problem.\nGallium Nine requires MESA graphic drivers and AMD/Nvidia GPU.\n",IDC_STATIC,16,16,230,24 | ||||
| + CONTROL "Enable &Gallium Nine for better D3D9 graphic performance.",IDC_ENABLE_NATIVE_D3D9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,40,230,8 | + CONTROL "Enable &Gallium Nine for better D3D9 graphic performance.",IDC_ENABLE_NATIVE_D3D9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,40,230,8 | ||||
| +END | +END | ||||
| + | + | ||||
| LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL | ||||
| /* @makedep: winecfg.ico */ | /* @makedep: winecfg.ico */ | ||||
| -- | -- | ||||
| 2.18.0 | 2.19.1 | ||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.