winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
672 discussions
Start a n
N
ew thread
Alexandre Julliard : crypt32: Don' t build password_to_ascii without GnuTLS.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 5cfeed53974ed8d670170131b61fe17403f17e4e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5cfeed53974ed8d670170131…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 11 18:32:12 2019 +0100 crypt32: Don't build password_to_ascii without GnuTLS. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/pfx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/crypt32/pfx.c b/dlls/crypt32/pfx.c index 46bf356..a515585 100644 --- a/dlls/crypt32/pfx.c +++ b/dlls/crypt32/pfx.c @@ -240,8 +240,6 @@ done: return prov; } -#endif - static char *password_to_ascii( const WCHAR *str ) { char *ret; @@ -257,6 +255,8 @@ static char *password_to_ascii( const WCHAR *str ) return ret; } +#endif + HCERTSTORE WINAPI PFXImportCertStore( CRYPT_DATA_BLOB *pfx, const WCHAR *password, DWORD flags ) { #ifdef SONAME_LIBGNUTLS
1
0
0
0
Andrey Gusev : crypt32: Remove duplicate condition in CRYPT_AsnDecodeNameValueInternal().
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 15b7112d07dc4f13c90c03c3f1e6776e7727148a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=15b7112d07dc4f13c90c03c3…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Mon Feb 11 16:29:23 2019 +0200 crypt32: Remove duplicate condition in CRYPT_AsnDecodeNameValueInternal(). Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/decode.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index d886abb..27f4870 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -1588,15 +1588,12 @@ static BOOL CRYPT_AsnDecodeNameValueInternal(const BYTE *pbEncoded, case ASN_VISIBLESTRING: case ASN_GENERALSTRING: value->Value.cbData = dataLen; - if (dataLen) - { - if (!(dwFlags & CRYPT_DECODE_NOCOPY_FLAG)) - memcpy(value->Value.pbData, - pbEncoded + 1 + lenBytes, dataLen); - else - value->Value.pbData = (LPBYTE)pbEncoded + 1 + - lenBytes; - } + if (!(dwFlags & CRYPT_DECODE_NOCOPY_FLAG)) + memcpy(value->Value.pbData, + pbEncoded + 1 + lenBytes, dataLen); + else + value->Value.pbData = (LPBYTE)pbEncoded + 1 + + lenBytes; break; case ASN_BMPSTRING: {
1
0
0
0
Andrey Gusev : msi: Remove duplicate condition in msi_dialog_destroy().
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 57dd594865b002205edb4e053102241bed72bd1a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=57dd594865b002205edb4e05…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Mon Feb 11 16:28:38 2019 +0200 msi: Remove duplicate condition in msi_dialog_destroy(). Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/dialog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index b6de1f5..a3e5481 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -4129,10 +4129,10 @@ void msi_dialog_destroy( msi_dialog *dialog ) } if( dialog->hwnd ) + { ShowWindow( dialog->hwnd, SW_HIDE ); - - if( dialog->hwnd ) DestroyWindow( dialog->hwnd ); + } /* unsubscribe events */ event_cleanup_subscriptions( dialog->package, dialog->name );
1
0
0
0
Paul Gofman : d3d8/tests: Add test for MaxVertexW device capability.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: e70c4846ff4f7755f7c00b19947c0b2cc44665d3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e70c4846ff4f7755f7c00b19…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Mon Feb 11 14:04:55 2019 +0300 d3d8/tests: Add test for MaxVertexW device capability. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d8/tests/device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 315640d..39a2359 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -8758,6 +8758,8 @@ static void test_device_caps(void) /* AMD gives 6, Nvidia returns 8. */ ok(caps.MaxUserClipPlanes <= 8, "MaxUserClipPlanes field has unexpected value %u.\n", caps.MaxUserClipPlanes); + ok(caps.MaxVertexW == 0.0f || caps.MaxVertexW >= 1e10f, + "MaxVertexW field has unexpected value %.8e.\n", caps.MaxVertexW); refcount = IDirect3DDevice8_Release(device); ok(!refcount, "Device has %u references left.\n", refcount);
1
0
0
0
Paul Gofman : d3d9/tests: Add test for MaxVertexW device capability.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 2416578e32d0181f548582cce322874ee17d358c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2416578e32d0181f548582cc…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Mon Feb 11 14:04:54 2019 +0300 d3d9/tests: Add test for MaxVertexW device capability. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index ad1d289..2217569 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -12643,6 +12643,8 @@ static void test_device_caps(void) /* AMD gives 6, Nvidia returns 8. */ ok(caps.MaxUserClipPlanes <= 8, "MaxUserClipPlanes field has unexpected value %u.\n", caps.MaxUserClipPlanes); + ok(caps.MaxVertexW == 0.0f || caps.MaxVertexW >= 1e10f, + "MaxVertexW field has unexpected value %.8e.\n", caps.MaxVertexW); refcount = IDirect3DDevice9_Release(device); ok(!refcount, "Device has %u references left.\n", refcount);
1
0
0
0
Paul Gofman : wined3d: Return 1e10f for MaxVertexW from wined3d_get_device_caps().
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 91b43bca94750baf683cdb5852e9bc259a81e1db URL:
https://source.winehq.org/git/wine.git/?a=commit;h=91b43bca94750baf683cdb58…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Mon Feb 11 14:04:53 2019 +0300 wined3d: Return 1e10f for MaxVertexW from wined3d_get_device_caps(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=23863
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/directx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 75622be..827d4f6 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2179,7 +2179,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte caps->MaxTextureRepeat = 32768; caps->MaxTextureAspectRatio = d3d_info->limits.texture_size; - caps->MaxVertexW = 1.0f; + caps->MaxVertexW = 1e10f; caps->GuardBandLeft = 0.0f; caps->GuardBandTop = 0.0f;
1
0
0
0
Alexandre Julliard : ntdll: Skip dlls of the wrong machine type when searching through the load path.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 9839bb7691a1b1c57a4ca501d03825420c1609d7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9839bb7691a1b1c57a4ca501…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Feb 9 21:21:47 2019 +0100 ntdll: Skip dlls of the wrong machine type when searching through the load path. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/loader.c | 2 +- dlls/ntdll/loader.c | 30 +++++++++++++++++++----------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 165c05e..7046afc 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -685,7 +685,7 @@ static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header, const IMAG /* some dlls with invalid entry point will crash, but this means we loaded the test dll */ ok( !expect_fallback, "%u: got test dll but expected fallback\n", line ); } - else todo_wine_if( !expect_status ) + else { ok( ldr_status == expect_status || broken(il_only && !expect_status && ldr_status == STATUS_INVALID_IMAGE_FORMAT), diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index dd6f437..56a6c2d 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1999,12 +1999,6 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, const UNICODE_STRING *nt_nam TRACE("Trying native dll %s\n", debugstr_us(nt_name)); - if (!is_valid_binary( module, image_info )) - { - NtUnmapViewOfSection( NtCurrentProcess(), module ); - return STATUS_INVALID_IMAGE_FORMAT; - } - /* perform base relocation, if necessary */ if ((status = perform_relocations( module, nt, image_info->map_size ))) @@ -2363,6 +2357,12 @@ static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_ if (status == STATUS_IMAGE_NOT_AT_BASE) status = STATUS_SUCCESS; NtClose( mapping ); } + if (!status && !is_valid_binary( *module, image_info )) + { + TRACE( "%s is for arch %x, continuing search\n", debugstr_us(nt_name), image_info->machine ); + NtUnmapViewOfSection( NtCurrentProcess(), *module ); + status = STATUS_IMAGE_MACHINE_TYPE_MISMATCH; + } return status; } @@ -2377,6 +2377,7 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING * struct stat *st ) { WCHAR *name; + BOOL found_image = FALSE; NTSTATUS status = STATUS_DLL_NOT_FOUND; ULONG len = strlenW( paths ); @@ -2397,15 +2398,20 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING * if (len && name[len - 1] != '\\') name[len++] = '\\'; strcpyW( name + len, search ); status = open_dll_file( name, nt_name, pwm, module, image_info, st ); - if (status != STATUS_DLL_NOT_FOUND) goto done; + if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH) found_image = TRUE; + else if (status != STATUS_DLL_NOT_FOUND) goto done; RtlFreeUnicodeString( nt_name ); paths = ptr; } - /* not found, return file in the system dir to be loaded as builtin */ - strcpyW( name, system_dir ); - strcatW( name, search ); - if (!RtlDosPathNameToNtPathName_U( name, nt_name, NULL, NULL )) status = STATUS_NO_MEMORY; + if (!found_image) + { + /* not found, return file in the system dir to be loaded as builtin */ + strcpyW( name, system_dir ); + strcatW( name, search ); + if (!RtlDosPathNameToNtPathName_U( name, nt_name, NULL, NULL )) status = STATUS_NO_MEMORY; + } + else status = STATUS_IMAGE_MACHINE_TYPE_MISMATCH; done: RtlFreeHeap( GetProcessHeap(), 0, name ); @@ -2463,6 +2469,8 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, else status = open_dll_file( libname, nt_name, pwm, module, image_info, st ); + if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH) status = STATUS_INVALID_IMAGE_FORMAT; + done: RtlFreeHeap( GetProcessHeap(), 0, dllname ); return status;
1
0
0
0
Alexandre Julliard : ntdll: Use the image info to check for fake dlls.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 2062df7e6cf62ba616f2d9957ae965957de1d9f8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2062df7e6cf62ba616f2d995…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Feb 9 15:29:54 2019 +0100 ntdll: Use the image info to check for fake dlls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 68 ++++++++++++++--------------------------------------- 1 file changed, 17 insertions(+), 51 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 497b75d..dd6f437 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1635,29 +1635,6 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name, /*********************************************************************** - * is_fake_dll - * - * Check if a loaded native dll is a Wine fake dll. - */ -static BOOL is_fake_dll( HANDLE handle ) -{ - static const char fakedll_signature[] = "Wine placeholder DLL"; - char buffer[sizeof(IMAGE_DOS_HEADER) + sizeof(fakedll_signature)]; - const IMAGE_DOS_HEADER *dos = (const IMAGE_DOS_HEADER *)buffer; - IO_STATUS_BLOCK io; - LARGE_INTEGER offset; - - offset.QuadPart = 0; - if (NtReadFile( handle, 0, NULL, 0, &io, buffer, sizeof(buffer), &offset, NULL )) return FALSE; - if (io.Information < sizeof(buffer)) return FALSE; - if (dos->e_magic != IMAGE_DOS_SIGNATURE) return FALSE; - if (dos->e_lfanew >= sizeof(*dos) + sizeof(fakedll_signature) && - !memcmp( dos + 1, fakedll_signature, sizeof(fakedll_signature) )) return TRUE; - return FALSE; -} - - -/*********************************************************************** * get_builtin_fullname * * Build the full pathname for a builtin dll. @@ -2323,7 +2300,7 @@ done: * Open a file for a new dll. Helper for find_dll_file. */ static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_MODREF **pwm, - HANDLE *handle, void **module, pe_image_info_t *image_info, struct stat *st ) + void **module, pe_image_info_t *image_info, struct stat *st ) { FILE_BASIC_INFORMATION info; OBJECT_ATTRIBUTES attr; @@ -2331,7 +2308,7 @@ static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_ LARGE_INTEGER size; SIZE_T len = 0; NTSTATUS status; - HANDLE mapping; + HANDLE handle, mapping; int fd, needs_close; nt_name->Buffer = NULL; @@ -2345,7 +2322,7 @@ static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_ attr.ObjectName = nt_name; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - if ((status = NtOpenFile( handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, + if ((status = NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_DELETE, FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE ))) { @@ -2360,7 +2337,7 @@ static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_ return STATUS_DLL_NOT_FOUND; } - if (!server_get_unix_fd( *handle, 0, &fd, &needs_close, NULL, NULL )) + if (!server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL )) { fstat( fd, st ); if (needs_close) close( fd ); @@ -2368,8 +2345,7 @@ static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_ { TRACE( "%s is the same file as existing module %p %s\n", debugstr_w( nt_name->Buffer ), (*pwm)->ldr.BaseAddress, debugstr_w( (*pwm)->ldr.FullDllName.Buffer )); - NtClose( *handle ); - *handle = 0; + NtClose( handle ); return STATUS_SUCCESS; } } @@ -2377,7 +2353,9 @@ static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_ size.QuadPart = 0; status = NtCreateSection( &mapping, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_EXECUTE, - NULL, &size, PAGE_EXECUTE_READ, SEC_IMAGE, *handle ); + NULL, &size, PAGE_EXECUTE_READ, SEC_IMAGE, handle ); + NtClose( handle ); + if (!status) { status = virtual_map_section( mapping, module, 0, 0, NULL, &len, @@ -2385,11 +2363,6 @@ static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_ if (status == STATUS_IMAGE_NOT_AT_BASE) status = STATUS_SUCCESS; NtClose( mapping ); } - if (status) - { - NtClose( *handle ); - *handle = 0; - } return status; } @@ -2400,8 +2373,8 @@ static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_ * Search for dll in the specified paths. */ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING *nt_name, - WINE_MODREF **pwm, HANDLE *handle, void **module, - pe_image_info_t *image_info, struct stat *st ) + WINE_MODREF **pwm, void **module, pe_image_info_t *image_info, + struct stat *st ) { WCHAR *name; NTSTATUS status = STATUS_DLL_NOT_FOUND; @@ -2423,7 +2396,7 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING * memcpy( name, paths, len * sizeof(WCHAR) ); if (len && name[len - 1] != '\\') name[len++] = '\\'; strcpyW( name + len, search ); - status = open_dll_file( name, nt_name, pwm, handle, module, image_info, st ); + status = open_dll_file( name, nt_name, pwm, module, image_info, st ); if (status != STATUS_DLL_NOT_FOUND) goto done; RtlFreeUnicodeString( nt_name ); paths = ptr; @@ -2447,15 +2420,13 @@ done: */ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNICODE_STRING *nt_name, WINE_MODREF **pwm, - HANDLE *handle, void **module, pe_image_info_t *image_info, - struct stat *st ) + void **module, pe_image_info_t *image_info, struct stat *st ) { WCHAR *ext, *dllname; NTSTATUS status = STATUS_SUCCESS; /* first append .dll if needed */ - *handle = 0; *pwm = NULL; *module = NULL; dllname = NULL; @@ -2488,9 +2459,9 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, } if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH) - status = search_dll_file( load_path, libname, nt_name, pwm, handle, module, image_info, st ); + status = search_dll_file( load_path, libname, nt_name, pwm, module, image_info, st ); else - status = open_dll_file( libname, nt_name, pwm, handle, module, image_info, st ); + status = open_dll_file( libname, nt_name, pwm, module, image_info, st ); done: RtlFreeHeap( GetProcessHeap(), 0, dllname ); @@ -2510,14 +2481,13 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ WINE_MODREF *main_exe; UNICODE_STRING nt_name; struct stat st; - HANDLE handle; void *module; pe_image_info_t image_info; NTSTATUS nts; TRACE( "looking for %s in %s\n", debugstr_w(libname), debugstr_w(load_path) ); - nts = find_dll_file( load_path, libname, &nt_name, pwm, &handle, &module, &image_info, &st ); + nts = find_dll_file( load_path, libname, &nt_name, pwm, &module, &image_info, &st ); if (*pwm) /* found already loaded module */ { @@ -2554,7 +2524,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ break; case STATUS_SUCCESS: /* valid PE file */ - if (!is_fake_dll( handle )) + if (!(image_info.image_flags & IMAGE_FLAGS_WineFakeDll)) { switch (loadorder) { @@ -2587,12 +2557,10 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ nts = STATUS_DLL_NOT_FOUND; break; } - NtClose( handle ); if (module) NtUnmapViewOfSection( NtCurrentProcess(), module ); break; } TRACE( "%s is a fake Wine dll\n", debugstr_us(&nt_name) ); - NtClose( handle ); NtUnmapViewOfSection( NtCurrentProcess(), module ); /* fall through */ @@ -2661,7 +2629,6 @@ NTSTATUS WINAPI LdrGetDllHandle( LPCWSTR load_path, ULONG flags, const UNICODE_S NTSTATUS status; UNICODE_STRING nt_name; WINE_MODREF *wm; - HANDLE handle; void *module; pe_image_info_t image_info; struct stat st; @@ -2670,8 +2637,7 @@ NTSTATUS WINAPI LdrGetDllHandle( LPCWSTR load_path, ULONG flags, const UNICODE_S if (!load_path) load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; - status = find_dll_file( load_path, name->Buffer, &nt_name, &wm, &handle, &module, &image_info, &st ); - if (handle) NtClose( handle ); + status = find_dll_file( load_path, name->Buffer, &nt_name, &wm, &module, &image_info, &st ); if (wm) *base = wm->ldr.BaseAddress; else
1
0
0
0
Alexandre Julliard : server: Add custom flag for fake dlls in PE image information.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: f244c3b5ebfae0bcbe13b127c4b3abd356a22f7e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f244c3b5ebfae0bcbe13b127…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Feb 9 15:23:47 2019 +0100 server: Add custom flag for fake dlls in PE image information. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/virtual.c | 2 +- include/wine/server_protocol.h | 3 ++- server/mapping.c | 20 +++++++++++++++----- server/protocol.def | 1 + 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 030c658..c008db7 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -3200,7 +3200,7 @@ void virtual_fill_image_information( const pe_image_info_t *pe_info, SECTION_IMA info->DllCharacteristics = pe_info->dll_charact; info->Machine = pe_info->machine; info->ImageContainsCode = pe_info->contains_code; - info->u.ImageFlags = pe_info->image_flags; + info->u.ImageFlags = pe_info->image_flags & ~IMAGE_FLAGS_WineFakeDll; info->LoaderFlags = pe_info->loader_flags; info->ImageFileSize = pe_info->file_size; info->CheckSum = pe_info->checksum; diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 48c9723..63f65cd 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -714,6 +714,7 @@ typedef struct #define IMAGE_FLAGS_ImageDynamicallyRelocated 0x04 #define IMAGE_FLAGS_ImageMappedFlat 0x08 #define IMAGE_FLAGS_BaseBelow4gb 0x10 +#define IMAGE_FLAGS_WineFakeDll 0x80 struct rawinput_device { @@ -6553,6 +6554,6 @@ union generic_reply struct terminate_job_reply terminate_job_reply; }; -#define SERVER_PROTOCOL_VERSION 571 +#define SERVER_PROTOCOL_VERSION 572 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/mapping.c b/server/mapping.c index bc59b21..37c17b0 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -555,11 +555,17 @@ static int load_clr_header( IMAGE_COR20_HEADER *hdr, size_t va, size_t size, int /* retrieve the mapping parameters for an executable (PE) image */ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_size, int unix_fd ) { - IMAGE_DOS_HEADER dos; + static const char fakedll_signature[] = "Wine placeholder DLL"; + IMAGE_COR20_HEADER clr; IMAGE_SECTION_HEADER sec[96]; struct { + IMAGE_DOS_HEADER dos; + char buffer[sizeof(fakedll_signature)]; + } mz; + struct + { DWORD Signature; IMAGE_FILE_HEADER FileHeader; union @@ -570,15 +576,17 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s } nt; off_t pos; int size; - size_t clr_va, clr_size; + size_t mz_size, clr_va, clr_size; unsigned int i, cpu_mask = get_supported_cpu_mask(); /* load the headers */ if (!file_size) return STATUS_INVALID_FILE_FOR_SECTION; - if (pread( unix_fd, &dos, sizeof(dos), 0 ) != sizeof(dos)) return STATUS_INVALID_IMAGE_NOT_MZ; - if (dos.e_magic != IMAGE_DOS_SIGNATURE) return STATUS_INVALID_IMAGE_NOT_MZ; - pos = dos.e_lfanew; + size = pread( unix_fd, &mz, sizeof(mz), 0 ); + if (size < sizeof(mz.dos)) return STATUS_INVALID_IMAGE_NOT_MZ; + if (mz.dos.e_magic != IMAGE_DOS_SIGNATURE) return STATUS_INVALID_IMAGE_NOT_MZ; + mz_size = size; + pos = mz.dos.e_lfanew; size = pread( unix_fd, &nt, sizeof(nt), pos ); if (size < sizeof(nt.Signature) + sizeof(nt.FileHeader)) return STATUS_INVALID_IMAGE_FORMAT; @@ -691,6 +699,8 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s mapping->image.gp = 0; /* FIXME */ mapping->image.file_size = file_size; mapping->image.loader_flags = clr_va && clr_size; + if (mz_size == sizeof(mz) && !memcmp( mz.buffer, fakedll_signature, sizeof(fakedll_signature) )) + mapping->image.image_flags |= IMAGE_FLAGS_WineFakeDll; /* load the section headers */ diff --git a/server/protocol.def b/server/protocol.def index 73e0868..e65b984 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -730,6 +730,7 @@ typedef struct #define IMAGE_FLAGS_ImageDynamicallyRelocated 0x04 #define IMAGE_FLAGS_ImageMappedFlat 0x08 #define IMAGE_FLAGS_BaseBelow4gb 0x10 +#define IMAGE_FLAGS_WineFakeDll 0x80 struct rawinput_device {
1
0
0
0
Alexandre Julliard : ntdll: Create the memory mapping for a dll directly at open time.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: f1bb3580e3676d5e389689a475a0faab576ea9cc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f1bb3580e3676d5e389689a4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Feb 9 10:59:47 2019 +0100 ntdll: Create the memory mapping for a dll directly at open time. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 214 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 124 insertions(+), 90 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f1bb3580e3676d5e3896…
1
0
0
0
← Newer
1
...
44
45
46
47
48
49
50
...
68
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Results per page:
10
25
50
100
200