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
April 2024
----- 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
590 discussions
Start a n
N
ew thread
Tuomas Räsänen : setupapi: Use INF parser to read class GUID and class name.
by Alexandre Julliard
25 Apr '24
25 Apr '24
Module: wine Branch: master Commit: 987695a427868e77704bb19c3e2cf9d6069364d2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/987695a427868e77704bb19c3e2cf9…
Author: Tuomas Räsänen <tuomas.rasanen(a)opinsys.fi> Date: Fri Apr 19 14:50:32 2024 +0300 setupapi: Use INF parser to read class GUID and class name. Previously, SetupDiGetINFClassW read INF files with GetPrivateProfileString, which does not substitute %strkey% tokens. This caused device installation to fail for devices which had driver INF files using %strkey% tokens in Version section. An example of such device is Vernier LabQuest Mini (08f7:0008) for which Vernier's LoggerPro application includes a driver. The INF file in question adds a new device setup class and has following entries in Version section: Class = %ClassName% ClassGuid = %DeviceClassGUID% Strings section includes following entries: DeviceClassGUID = "{6B8429BF-10AD-4b66-9FBA-2FE72B891721}" ClassName = "VST_WinUSB" Previously, when LoggerPro was installed and LabQuest Mini was hotplugged, device installation failed with the following error: fixme:setupapi:SetupDiGetINFClassW failed to convert "L"%DeviceClassGUID"" into a guid This caused GUID_NULL to be used and Class was not set to the registry for the device. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56579
--- dlls/setupapi/devinst.c | 67 ++++++++++++++++++++++++++++++++++--------- dlls/setupapi/tests/devinst.c | 3 +- 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 7e2d683daa6..019505b01ec 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -4280,8 +4280,11 @@ BOOL WINAPI SetupDiGetINFClassW(PCWSTR inf, LPGUID class_guid, PWSTR class_name, DWORD size, PDWORD required_size) { BOOL have_guid, have_name; - DWORD dret; + DWORD class_name_len; WCHAR buffer[MAX_PATH]; + INFCONTEXT inf_ctx; + HINF hinf; + BOOL retval = FALSE; if (!inf) { @@ -4302,30 +4305,63 @@ BOOL WINAPI SetupDiGetINFClassW(PCWSTR inf, LPGUID class_guid, PWSTR class_name, return FALSE; } - if (!GetPrivateProfileStringW(Version, Signature, NULL, buffer, MAX_PATH, inf)) + if ((hinf = SetupOpenInfFileW(inf, NULL, INF_STYLE_WIN4, NULL)) == INVALID_HANDLE_VALUE) + { + ERR("failed to open INF file %s\n", debugstr_w(inf)); return FALSE; + } + + if (!SetupFindFirstLineW(hinf, Version, Signature, &inf_ctx)) + { + ERR("INF file %s does not have mandatory [Version].Signature\n", debugstr_w(inf)); + goto out; + } + + if (!SetupGetStringFieldW(&inf_ctx, 1, buffer, ARRAY_SIZE(buffer), NULL)) + { + ERR("failed to get [Version].Signature string from %s\n", debugstr_w(inf)); + goto out; + } if (lstrcmpiW(buffer, Chicago) && lstrcmpiW(buffer, WindowsNT)) - return FALSE; + { + ERR("INF file %s has invalid [Version].Signature: %s\n", debugstr_w(inf), debugstr_w(buffer)); + goto out; + } + + have_guid = SetupFindFirstLineW(hinf, Version, ClassGUID, &inf_ctx); - buffer[0] = '\0'; - have_guid = 0 < GetPrivateProfileStringW(Version, ClassGUID, NULL, buffer, MAX_PATH, inf); if (have_guid) { + if (!SetupGetStringFieldW(&inf_ctx, 1, buffer, ARRAY_SIZE(buffer), NULL)) + { + ERR("failed to get [Version].ClassGUID as a string from '%s'\n", debugstr_w(inf)); + goto out; + } + buffer[lstrlenW(buffer)-1] = 0; if (RPC_S_OK != UuidFromStringW(buffer + 1, class_guid)) { - FIXME("failed to convert \"%s\" into a guid\n", debugstr_w(buffer)); + ERR("INF file %s has invalid [Version].ClassGUID: %s\n", debugstr_w(inf), debugstr_w(buffer)); SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + goto out; } } - buffer[0] = '\0'; - dret = GetPrivateProfileStringW(Version, Class, NULL, buffer, MAX_PATH, inf); - have_name = 0 < dret; + have_name = SetupFindFirstLineW(hinf, Version, Class, &inf_ctx); + + class_name_len = 0; + if (have_name) + { + if (!SetupGetStringFieldW(&inf_ctx, 1, buffer, ARRAY_SIZE(buffer), NULL)) + { + ERR("failed to get [Version].Class as a string from '%s'\n", debugstr_w(inf)); + goto out; + } + + class_name_len = lstrlenW(buffer); + } - if (dret >= MAX_PATH -1) FIXME("buffer might be too small\n"); if (have_guid && !have_name) { class_name[0] = '\0'; @@ -4334,7 +4370,7 @@ BOOL WINAPI SetupDiGetINFClassW(PCWSTR inf, LPGUID class_guid, PWSTR class_name, if (have_name) { - if (dret < size) lstrcpyW(class_name, buffer); + if (class_name_len < size) lstrcpyW(class_name, buffer); else { SetLastError(ERROR_INSUFFICIENT_BUFFER); @@ -4342,9 +4378,12 @@ BOOL WINAPI SetupDiGetINFClassW(PCWSTR inf, LPGUID class_guid, PWSTR class_name, } } - if (required_size) *required_size = dret + ((dret) ? 1 : 0); + if (required_size) *required_size = class_name_len + ((class_name_len) ? 1 : 0); - return (have_guid || have_name); + retval = (have_guid || have_name); +out: + SetupCloseInfFile(hinf); + return retval; } static LSTATUS get_device_property(struct device *device, const DEVPROPKEY *prop_key, DEVPROPTYPE *prop_type, diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index bc830aebc19..e54605d6987 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -2031,12 +2031,11 @@ static void test_get_inf_class(void) WritePrivateProfileStringA("Strings", "ClassGuid", "{deadbeef-dead-beef-dead-beefdeadbeef}", filename); count = 0xdeadbeef; retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); -todo_wine { ok(retval, "expected SetupDiGetINFClassA to succeed! error %lu\n", GetLastError()); ok(count == lstrlenA(deadbeef_class_name) + 1, "expected count=%d, got %lu\n", lstrlenA(deadbeef_class_name) + 1, count); ok(!lstrcmpA(deadbeef_class_name, cn), "expected class_name='%s', got '%s'\n", deadbeef_class_name, cn); ok(IsEqualGUID(&deadbeef_class_guid, &guid), "expected ClassGUID to be deadbeef-dead-beef-dead-beefdeadbeef\n"); -} + DeleteFileA(filename); } }
1
0
0
0
Tuomas Räsänen : setupapi/tests: Add tests for reading INF class with %strkey% tokens.
by Alexandre Julliard
25 Apr '24
25 Apr '24
Module: wine Branch: master Commit: d8bbf6d0aeaf98e52ed4df818b6d83791e6f7725 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d8bbf6d0aeaf98e52ed4df818b6d83…
Author: Tuomas Räsänen <tuomas.rasanen(a)opinsys.fi> Date: Sat Apr 20 14:37:19 2024 +0300 setupapi/tests: Add tests for reading INF class with %strkey% tokens. --- dlls/setupapi/tests/devinst.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 2dc891d61f1..bc830aebc19 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -1876,6 +1876,8 @@ static void test_get_inf_class(void) static const char inffile[] = "winetest.inf"; static const char content[] = "[Version]\r\n\r\n"; static const char* signatures[] = {"\"$CHICAGO$\"", "\"$Windows NT$\""}; + static const GUID deadbeef_class_guid = {0xdeadbeef,0xdead,0xbeef,{0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef}}; + static const char deadbeef_class_name[] = "DeadBeef"; char cn[MAX_PATH]; char filename[MAX_PATH]; @@ -2014,6 +2016,27 @@ static void test_get_inf_class(void) todo_wine ok(count == 4, "expected count==4, got %lu(%s)\n", count, cn); + /* Test Strings substitution */ + WritePrivateProfileStringA("Version", "Class", "%ClassName%", filename); + WritePrivateProfileStringA("Version", "ClassGUID", "%ClassGuid%", filename); + + /* Without Strings section the ClassGUID is invalid (has non-substituted strkey token) */ + retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, NULL); + ok(!retval, "expected SetupDiGetINFClassA to fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "expected error ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); + + /* With Strings section the ClassGUID and Class should be substituted */ + WritePrivateProfileStringA("Strings", "ClassName", deadbeef_class_name, filename); + WritePrivateProfileStringA("Strings", "ClassGuid", "{deadbeef-dead-beef-dead-beefdeadbeef}", filename); + count = 0xdeadbeef; + retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); +todo_wine { + ok(retval, "expected SetupDiGetINFClassA to succeed! error %lu\n", GetLastError()); + ok(count == lstrlenA(deadbeef_class_name) + 1, "expected count=%d, got %lu\n", lstrlenA(deadbeef_class_name) + 1, count); + ok(!lstrcmpA(deadbeef_class_name, cn), "expected class_name='%s', got '%s'\n", deadbeef_class_name, cn); + ok(IsEqualGUID(&deadbeef_class_guid, &guid), "expected ClassGUID to be deadbeef-dead-beef-dead-beefdeadbeef\n"); +} DeleteFileA(filename); } }
1
0
0
0
Dmitry Timoshkov : stdole32.tlb: Generate typelib in SLTG format.
by Alexandre Julliard
25 Apr '24
25 Apr '24
Module: wine Branch: master Commit: 7f190e67dacbbc488002933640a2bda13a0e698e URL:
https://gitlab.winehq.org/wine/wine/-/commit/7f190e67dacbbc488002933640a2bd…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Apr 24 11:03:39 2024 +0300 stdole32.tlb: Generate typelib in SLTG format. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- dlls/stdole32.tlb/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/stdole32.tlb/Makefile.in b/dlls/stdole32.tlb/Makefile.in index 8ae404a4711..4e5497f0525 100644 --- a/dlls/stdole32.tlb/Makefile.in +++ b/dlls/stdole32.tlb/Makefile.in @@ -1,5 +1,6 @@ MODULE = stdole32.tlb +EXTRAIDLFLAGS = --oldtlb --win32 EXTRADLLFLAGS = -Wb,--data-only SOURCES = \
1
0
0
0
Dmitry Timoshkov : widl: Fix calculation of the SLTG library block size.
by Alexandre Julliard
25 Apr '24
25 Apr '24
Module: wine Branch: master Commit: ce6fe5d06e92a9ecde0f402038eabf0678e27cde URL:
https://gitlab.winehq.org/wine/wine/-/commit/ce6fe5d06e92a9ecde0f402038eabf…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Apr 24 15:50:03 2024 +0300 widl: Fix calculation of the SLTG library block size. This patch fixes a regression in comparison with SLTG generator in wine-staging, and allows oleview.exe from PSDK correctly load SLTG typelib generated by widl. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- tools/widl/write_sltg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c index 1f9976f3fa8..d09fdb37c5c 100644 --- a/tools/widl/write_sltg.c +++ b/tools/widl/write_sltg.c @@ -767,7 +767,6 @@ static short write_var_desc(struct sltg_typelib *typelib, struct sltg_data *data size_instance = NULL; /* don't account for element size */ } - append_data(data, array, size); desc_offset = data->size; @@ -1618,8 +1617,10 @@ static void sltg_write_header(struct sltg_typelib *sltg, int *library_block_star /* library block length includes helpstrings and name table */ entry.length = sltg->blocks[sltg->block_count - 1].length + 0x40 /* pad after library block */ + - sizeof(sltg->typeinfo_count) + sltg->typeinfo_size + 4 /* library block offset */ + 6 /* dummy help strings */ + - 12 /* name table header */ + 0x200 /* name table hash */ + sltg->name_table.size; + sizeof(sltg->typeinfo_count) + sltg->typeinfo_size + 4 /* library block size */ + 6 /* dummy help strings */ + + 12 /* name table header */ + 0x200 /* name table hash */ + + sizeof(sltg->name_table.size) + sltg->name_table.size + + 4 /* 0x01ffff01 */ + 4 /* 0 */; entry.index_string = sltg->blocks[sltg->block_count - 1].index_string; entry.next = 0; chat("sltg_write_header: writing library block entry %d: length %#x, index_string %#x, next %#x\n",
1
0
0
0
Alexandre Julliard : sechost: Use fully interpreted IDL stubs.
by Alexandre Julliard
25 Apr '24
25 Apr '24
Module: wine Branch: master Commit: 2c05f9d08537fa9c56bb58a48b2b66f4f67b5fb9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2c05f9d08537fa9c56bb58a48b2b66…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 25 14:17:43 2024 +0200 sechost: Use fully interpreted IDL stubs. --- dlls/sechost/Makefile.in | 2 ++ dlls/sechost/service.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/sechost/Makefile.in b/dlls/sechost/Makefile.in index ec1eb100683..eeb20370e71 100644 --- a/dlls/sechost/Makefile.in +++ b/dlls/sechost/Makefile.in @@ -3,6 +3,8 @@ IMPORTLIB = sechost IMPORTS = kernelbase DELAYIMPORTS = rpcrt4 +EXTRAIDLFLAGS = -Oicf + SOURCES = \ plugplay.idl \ security.c \ diff --git a/dlls/sechost/service.c b/dlls/sechost/service.c index 240e048a4a5..446031e4043 100644 --- a/dlls/sechost/service.c +++ b/dlls/sechost/service.c @@ -284,9 +284,8 @@ SC_HANDLE WINAPI DECLSPEC_HOTPATCH OpenSCManagerW( const WCHAR *machine, const W } __ENDTRY - if (!err) return handle; SetLastError( err ); - return NULL; + return handle; } /******************************************************************************
1
0
0
0
Alexandre Julliard : schedsvc/tests: Use fully interpreted IDL stubs.
by Alexandre Julliard
25 Apr '24
25 Apr '24
Module: wine Branch: master Commit: 5ac51de688f995a2b99dd41008d7045fd854b1df URL:
https://gitlab.winehq.org/wine/wine/-/commit/5ac51de688f995a2b99dd41008d704…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 25 14:18:40 2024 +0200 schedsvc/tests: Use fully interpreted IDL stubs. --- dlls/schedsvc/tests/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/schedsvc/tests/Makefile.in b/dlls/schedsvc/tests/Makefile.in index d78da177906..6ecfa8483ac 100644 --- a/dlls/schedsvc/tests/Makefile.in +++ b/dlls/schedsvc/tests/Makefile.in @@ -1,6 +1,8 @@ TESTDLL = schedsvc.dll IMPORTS = advapi32 rpcrt4 ole32 +EXTRAIDLFLAGS = -Oicf + SOURCES = \ atsvc.idl \ atsvcapi.c \
1
0
0
0
Alexandre Julliard : schedsvc: Use fully interpreted IDL stubs.
by Alexandre Julliard
25 Apr '24
25 Apr '24
Module: wine Branch: master Commit: f7f3f96a64efbe8e882323a7a979b81b913c483e URL:
https://gitlab.winehq.org/wine/wine/-/commit/f7f3f96a64efbe8e882323a7a979b8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 25 14:18:29 2024 +0200 schedsvc: Use fully interpreted IDL stubs. --- dlls/schedsvc/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/schedsvc/Makefile.in b/dlls/schedsvc/Makefile.in index 40dee0b48df..1aeb43574e9 100644 --- a/dlls/schedsvc/Makefile.in +++ b/dlls/schedsvc/Makefile.in @@ -1,6 +1,8 @@ MODULE = schedsvc.dll IMPORTS = rpcrt4 advapi32 ole32 xmllite +EXTRAIDLFLAGS = -Oicf + SOURCES = \ atsvc.c \ atsvc.idl \
1
0
0
0
Alexandre Julliard : rpcrt4/tests: Use fully interpreted IDL stubs.
by Alexandre Julliard
25 Apr '24
25 Apr '24
Module: wine Branch: master Commit: 54cb9a2ab20d0190af4f69dd456d0bdceda6021b URL:
https://gitlab.winehq.org/wine/wine/-/commit/54cb9a2ab20d0190af4f69dd456d0b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 25 14:17:26 2024 +0200 rpcrt4/tests: Use fully interpreted IDL stubs. --- dlls/rpcrt4/tests/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/rpcrt4/tests/Makefile.in b/dlls/rpcrt4/tests/Makefile.in index 0e888069783..a079ea0a19a 100644 --- a/dlls/rpcrt4/tests/Makefile.in +++ b/dlls/rpcrt4/tests/Makefile.in @@ -1,8 +1,8 @@ TESTDLL = rpcrt4.dll IMPORTS = oleaut32 ole32 rpcrt4 secur32 advapi32 -EXTRAIDLFLAGS = --prefix-server=s_ EXTRADEFS = -DPROXY_DELEGATION +EXTRAIDLFLAGS = -Oicf --prefix-server=s_ server_EXTRAIDLFLAGS = -Os --prefix-client=mixed_ server_interp_EXTRAIDLFLAGS = -Oicf --prefix-client=interp_
1
0
0
0
Alexandre Julliard : rpcrt4: Use fully interpreted IDL stubs.
by Alexandre Julliard
25 Apr '24
25 Apr '24
Module: wine Branch: master Commit: 8f7e877a5571213a7b08639b52d369417b4db815 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8f7e877a5571213a7b08639b52d369…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 25 14:17:09 2024 +0200 rpcrt4: Use fully interpreted IDL stubs. --- dlls/rpcrt4/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/rpcrt4/Makefile.in b/dlls/rpcrt4/Makefile.in index f2f6d35b2a5..6ab5e231879 100644 --- a/dlls/rpcrt4/Makefile.in +++ b/dlls/rpcrt4/Makefile.in @@ -4,7 +4,7 @@ IMPORTLIB = rpcrt4 IMPORTS = uuid advapi32 DELAYIMPORTS = iphlpapi wininet secur32 user32 ws2_32 ole32 oleaut32 -ndr_types_EXTRAIDLFLAGS = -Oicf +EXTRAIDLFLAGS = -Oicf SOURCES = \ cproxy.c \
1
0
0
0
Hans Leidekker : wintrust: Add support for the PE image hash in CryptCATAdminCalcHashFromFileHandle().
by Alexandre Julliard
25 Apr '24
25 Apr '24
Module: wine Branch: master Commit: ab071858a413516b7dbaebc23662b4024e6744c0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ab071858a413516b7dbaebc23662b4…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Apr 19 13:44:51 2024 +0200 wintrust: Add support for the PE image hash in CryptCATAdminCalcHashFromFileHandle(). --- dlls/wintrust/crypt.c | 85 +++++++++++++++++++++++++++++++++++++++++-- dlls/wintrust/tests/softpub.c | 34 +++++++++++++++++ 2 files changed, 115 insertions(+), 4 deletions(-) diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index 7321b84eea4..b2c5e31e87f 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -214,11 +214,84 @@ HCATINFO WINAPI CryptCATAdminAddCatalog(HCATADMIN catAdmin, PWSTR catalogFile, return ci; } +static BOOL pe_image_hash( HANDLE file, HCRYPTHASH hash ) +{ + UINT32 size, offset, file_size, sig_pos; + HANDLE mapping; + BYTE *view; + IMAGE_NT_HEADERS *nt; + BOOL ret = FALSE; + + if ((file_size = GetFileSize( file, NULL )) == INVALID_FILE_SIZE) return FALSE; + + if ((mapping = CreateFileMappingW( file, NULL, PAGE_READONLY, 0, 0, NULL )) == INVALID_HANDLE_VALUE) + return FALSE; + + if (!(view = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 )) || !(nt = ImageNtHeader( view ))) goto done; + + if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) + { + const IMAGE_NT_HEADERS64 *nt64 = (const IMAGE_NT_HEADERS64 *)nt; + + /* offset from start of file to checksum */ + offset = (BYTE *)&nt64->OptionalHeader.CheckSum - view; + + /* area between checksum and security directory entry */ + size = FIELD_OFFSET( IMAGE_OPTIONAL_HEADER64, DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY] ) - + FIELD_OFFSET( IMAGE_OPTIONAL_HEADER64, Subsystem ); + + if (nt64->OptionalHeader.NumberOfRvaAndSizes < IMAGE_FILE_SECURITY_DIRECTORY + 1) goto done; + sig_pos = nt64->OptionalHeader.DataDirectory[IMAGE_FILE_SECURITY_DIRECTORY].VirtualAddress; + } + else if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) + { + const IMAGE_NT_HEADERS32 *nt32 = (const IMAGE_NT_HEADERS32 *)nt; + + /* offset from start of file to checksum */ + offset = (BYTE *)&nt32->OptionalHeader.CheckSum - view; + + /* area between checksum and security directory entry */ + size = FIELD_OFFSET( IMAGE_OPTIONAL_HEADER32, DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY] ) - + FIELD_OFFSET( IMAGE_OPTIONAL_HEADER32, Subsystem ); + + if (nt32->OptionalHeader.NumberOfRvaAndSizes < IMAGE_FILE_SECURITY_DIRECTORY + 1) goto done; + sig_pos = nt32->OptionalHeader.DataDirectory[IMAGE_FILE_SECURITY_DIRECTORY].VirtualAddress; + } + else goto done; + + if (!CryptHashData( hash, view, offset, 0 )) goto done; + offset += sizeof(DWORD); /* skip checksum */ + if (!CryptHashData( hash, view + offset, size, 0 )) goto done; + + offset += size + sizeof(IMAGE_DATA_DIRECTORY); /* skip security entry */ + if (offset > file_size) goto done; + if (sig_pos) + { + if (sig_pos < offset) goto done; + if (sig_pos > file_size) goto done; + size = sig_pos - offset; /* exclude signature */ + } + else size = file_size - offset; + + if (!CryptHashData( hash, view + offset, size, 0 )) goto done; + ret = TRUE; + + if (!sig_pos && (size = file_size % 8)) + { + static const BYTE pad[7]; + ret = CryptHashData( hash, pad, 8 - size, 0 ); + } + +done: + UnmapViewOfFile( view ); + CloseHandle( mapping ); + return ret; +} + /*********************************************************************** * CryptCATAdminCalcHashFromFileHandle (WINTRUST.@) */ -BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash, - BYTE* pbHash, DWORD dwFlags ) +BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD *pcbHash, BYTE *pbHash, DWORD dwFlags) { BOOL ret = FALSE; @@ -262,9 +335,13 @@ BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash, CryptReleaseContext(prov, 0); return FALSE; } - while ((ret = ReadFile(hFile, buffer, 4096, &bytes_read, NULL)) && bytes_read) + + if (!(ret = pe_image_hash(hFile, hash))) { - CryptHashData(hash, buffer, bytes_read, 0); + while ((ret = ReadFile(hFile, buffer, 4096, &bytes_read, NULL)) && bytes_read) + { + CryptHashData(hash, buffer, bytes_read, 0); + } } if (ret) ret = CryptGetHashParam(hash, HP_HASHVAL, pbHash, pcbHash, 0); diff --git a/dlls/wintrust/tests/softpub.c b/dlls/wintrust/tests/softpub.c index 46861766621..9654c296a78 100644 --- a/dlls/wintrust/tests/softpub.c +++ b/dlls/wintrust/tests/softpub.c @@ -1892,6 +1892,39 @@ static void test_multiple_signatures(void) DeleteFileW(pathW); } +static BOOL (WINAPI *pCryptCATAdminCalcHashFromFileHandle)(HANDLE,DWORD*,BYTE*,DWORD); + +static void test_pe_image_hash(void) +{ + static const char expected[] = + {0x8a,0xd5,0x45,0x53,0x3d,0x67,0xdf,0x2f,0x78,0xe0,0x55,0x0a,0xe0,0xd9,0x7a,0x28,0x3e,0xbf,0x45,0x2b}; + WCHAR path[MAX_PATH]; + HANDLE file; + BYTE sha1[20]; + DWORD size, count; + HMODULE wintrust = GetModuleHandleA("wintrust.dll"); + BOOL ret; + + pCryptCATAdminCalcHashFromFileHandle = (void *)GetProcAddress(wintrust, "CryptCATAdminCalcHashFromFileHandle"); + if (!pCryptCATAdminCalcHashFromFileHandle) + { + win_skip("hash function missing\n"); + return; + } + + file = create_temp_file(path); + WriteFile(file, &bin, sizeof(bin), &count, NULL); + + size = sizeof(sha1); + memset(sha1, 0, sizeof(sha1)); + ret = pCryptCATAdminCalcHashFromFileHandle(file, &size, sha1, 0); + ok(ret, "got %lu\n", GetLastError()); + ok(!memcmp(sha1, expected, sizeof(sha1)), "wrong hash\n"); + + CloseHandle(file); + DeleteFileW(path); +} + START_TEST(softpub) { InitFunctionPtrs(); @@ -1901,4 +1934,5 @@ START_TEST(softpub) test_wintrust_digest(); test_get_known_usages(); test_multiple_signatures(); + test_pe_image_hash(); }
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
59
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
Results per page:
10
25
50
100
200