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
September 2018
----- 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
2 participants
670 discussions
Start a n
N
ew thread
Nikolay Sivov : crypt32: Add CRYPT_STRING_BINARY mode for CryptBinaryToStringW().
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 71f3a2251991b03e9e6afea5899f08d627422d11 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=71f3a2251991b03e9e6afea5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Sep 27 17:27:56 2018 +0300 crypt32: Add CRYPT_STRING_BINARY mode for CryptBinaryToStringW(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/base64.c | 27 ++++++++++++++++++++++++--- dlls/crypt32/tests/base64.c | 5 +---- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/dlls/crypt32/base64.c b/dlls/crypt32/base64.c index ac288b7..d158c1a 100644 --- a/dlls/crypt32/base64.c +++ b/dlls/crypt32/base64.c @@ -88,8 +88,7 @@ static BOOL EncodeBinaryToBinaryA(const BYTE *pbBinary, memcpy(pszString, pbBinary, cbBinary); } else - - *pcchString = cbBinary; + *pcchString = cbBinary; return ret; } @@ -294,6 +293,26 @@ BOOL WINAPI CryptBinaryToStringA(const BYTE *pbBinary, return encoder(pbBinary, cbBinary, dwFlags, pszString, pcchString); } +static BOOL EncodeBinaryToBinaryW(const BYTE *in_buf, DWORD in_len, DWORD flags, WCHAR *out_buf, DWORD *out_len) +{ + BOOL ret = TRUE; + + if (out_buf) + { + if (*out_len < in_len) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + ret = FALSE; + } + else if (in_len) + memcpy(out_buf, in_buf, in_len); + } + else + *out_len = in_len; + + return ret; +} + static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep, WCHAR* out_buf, DWORD *out_len) { @@ -472,13 +491,15 @@ BOOL WINAPI CryptBinaryToStringW(const BYTE *pbBinary, switch (dwFlags & 0x0fffffff) { + case CRYPT_STRING_BINARY: + encoder = EncodeBinaryToBinaryW; + break; case CRYPT_STRING_BASE64: case CRYPT_STRING_BASE64HEADER: case CRYPT_STRING_BASE64REQUESTHEADER: case CRYPT_STRING_BASE64X509CRLHEADER: encoder = BinaryToBase64W; break; - case CRYPT_STRING_BINARY: case CRYPT_STRING_HEX: case CRYPT_STRING_HEXASCII: case CRYPT_STRING_HEXADDR: diff --git a/dlls/crypt32/tests/base64.c b/dlls/crypt32/tests/base64.c index e6adc7a..4ff7627 100644 --- a/dlls/crypt32/tests/base64.c +++ b/dlls/crypt32/tests/base64.c @@ -284,17 +284,14 @@ static void test_CryptBinaryToString(void) strLen = 0; ret = CryptBinaryToStringW(tests[i].toEncode, tests[i].toEncodeLen, CRYPT_STRING_BINARY, NULL, &strLen); - todo_wine { ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError()); ok(strLen == tests[i].toEncodeLen, "Unexpected required length %u.\n", strLen); - } + strLen2 = strLen; strW = heap_alloc(strLen); ret = CryptBinaryToStringW(tests[i].toEncode, tests[i].toEncodeLen, CRYPT_STRING_BINARY, strW, &strLen2); - todo_wine ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError()); ok(strLen == strLen2, "Expected length %u, got %u\n", strLen, strLen2); - todo_wine ok(!memcmp(strW, tests[i].toEncode, tests[i].toEncodeLen), "Unexpected value\n"); heap_free(strW);
1
0
0
0
Hans Leidekker : msi: Add support for ARPNOMODIFY, APRNOREMOVE and ARPNOREPAIR.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 78af6e341fcdf1030bb5b0a4bed4b32e5caf09a3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=78af6e341fcdf1030bb5b0a4…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Sep 27 15:00:31 2018 +0200 msi: Add support for ARPNOMODIFY, APRNOREMOVE and ARPNOREPAIR. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/action.c | 66 ++++++++++++++++++++++++++++++++++++------------- dlls/msi/tests/action.c | 51 +++++++++++++++++++++++--------------- 2 files changed, 80 insertions(+), 37 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=78af6e341fcdf1030bb5…
1
0
0
0
Hans Leidekker : msi/tests: SQLGetInstalledDrivers fails if there are no ODBC drivers installed.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 1be65cbb46bf792773a5aabc550851ed51f727cd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1be65cbb46bf792773a5aabc…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Sep 27 15:00:30 2018 +0200 msi/tests: SQLGetInstalledDrivers fails if there are no ODBC drivers installed. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/tests/custom.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index cd6cb0c..c7ce4d2 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -1424,9 +1424,10 @@ UINT WINAPI odbc_present(MSIHANDLE hinst) WORD len; BOOL r; + buffer[0] = 0; + len = sizeof(buffer); r = SQLGetInstalledDrivers(buffer, sizeof(buffer), &len); - ok(hinst, len < sizeof(buffer), "buffer too small\n"); - ok(hinst, r, "SQLGetInstalledDrivers failed\n"); + if (r) ok(hinst, len < sizeof(buffer), "buffer too small\n"); for (p = buffer; *p; p += strlen(p) + 1) { if (!strcmp(p, "ODBC test driver")) @@ -1446,9 +1447,10 @@ UINT WINAPI odbc_absent(MSIHANDLE hinst) WORD len; BOOL r; + buffer[0] = 0; + len = sizeof(buffer); r = SQLGetInstalledDrivers(buffer, sizeof(buffer), &len); - ok(hinst, len < sizeof(buffer), "buffer too small\n"); - ok(hinst, r, "SQLGetInstalledDrivers failed\n"); + if (r) ok(hinst, len < sizeof(buffer), "buffer too small\n"); for (p = buffer; *p; p += strlen(p) + 1) { if (!strcmp(p, "ODBC test driver"))
1
0
0
0
Louis Lenders : mscms: Update spec to Windows 7.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: bd755f4f0f1b8afcaf86494f0f827d61fe4e41e4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bd755f4f0f1b8afcaf86494f…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Thu Sep 27 13:12:29 2018 +0200 mscms: Update spec to Windows 7. Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mscms/mscms.spec | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/dlls/mscms/mscms.spec b/dlls/mscms/mscms.spec index 421a8fc..9992bf5 100644 --- a/dlls/mscms/mscms.spec +++ b/dlls/mscms/mscms.spec @@ -3,6 +3,20 @@ @ stdcall CheckBitmapBits(ptr ptr ptr long long long ptr ptr long) @ stdcall CheckColors(ptr ptr long long ptr) @ stdcall CloseColorProfile(ptr) +@ stub CloseDisplay +@ stub ColorCplGetDefaultProfileScope +@ stub ColorCplGetDefaultRenderingIntentScope +@ stub ColorCplGetProfileProperties +@ stub ColorCplHasSystemWideAssociationListChanged +@ stub ColorCplInitialize +@ stub ColorCplLoadAssociationList +@ stub ColorCplMergeAssociationLists +@ stub ColorCplOverwritePerUserAssociationList +@ stub ColorCplReleaseProfileProperties +@ stub ColorCplResetSystemWideAssociationListChangedWarning +@ stub ColorCplSaveAssociationList +@ stub ColorCplSetUsePerUserProfiles +@ stub ColorCplUninitialize @ stdcall ConvertColorNameToIndex(ptr ptr ptr long) @ stdcall ConvertIndexToColorName(ptr ptr ptr long) @ stdcall CreateColorTransformA(ptr ptr ptr long) @@ -11,9 +25,17 @@ @ stdcall CreateMultiProfileTransform(ptr long ptr long long long) @ stdcall CreateProfileFromLogColorSpaceA(ptr ptr) @ stdcall CreateProfileFromLogColorSpaceW(ptr ptr) +@ stub DccwCreateDisplayProfileAssociationList +@ stub DccwGetDisplayProfileAssociationList +@ stub DccwGetGamutSize +@ stub DccwReleaseDisplayProfileAssociationList +@ stub DccwSetDisplayProfileAssociationList @ stdcall DeleteColorTransform(ptr) +@ stub DeviceRenameEvent @ stdcall DisassociateColorProfileFromDeviceA(str str str) @ stdcall DisassociateColorProfileFromDeviceW(wstr wstr wstr) +#@ stub DllCanUnloadNow +#@ stub DllGetClassObject @ stdcall EnumColorProfilesA(str ptr ptr ptr ptr) @ stdcall EnumColorProfilesW(wstr ptr ptr ptr ptr) @ stdcall GenerateCopyFilePaths(wstr wstr ptr long ptr ptr ptr ptr long) @@ -38,11 +60,14 @@ @ stub InternalGetPS2ColorRenderingDictionary @ stub InternalGetPS2ColorSpaceArray @ stub InternalGetPS2PreviewCRD +@ stub InternalRefreshCalibration @ stub InternalSetDeviceConfig +@ stub InternalWcsAssociateColorProfileWithDevice @ stdcall IsColorProfileTagPresent(ptr long ptr) @ stdcall IsColorProfileValid(ptr ptr) @ stdcall OpenColorProfileA(ptr long long long) @ stdcall OpenColorProfileW(ptr long long long) +@ stub OpenDisplay @ stdcall RegisterCMMA(str long str) @ stdcall RegisterCMMW(wstr long wstr) @ stdcall SelectCMM(long) @@ -59,4 +84,22 @@ @ stdcall UninstallColorProfileW(wstr wstr long) @ stdcall UnregisterCMMA(str long) @ stdcall UnregisterCMMW(wstr long) +@ stub WcsAssociateColorProfileWithDevice +@ stub WcsCheckColors +@ stub WcsCreateIccProfile +@ stub WcsDisassociateColorProfileFromDevice +@ stub WcsEnumColorProfiles +@ stub WcsEnumColorProfilesSize +@ stub WcsGetCalibrationManagementState +@ stub WcsGetDefaultColorProfile +@ stub WcsGetDefaultColorProfileSize +@ stub WcsGetDefaultRenderingIntent @ stdcall WcsGetUsePerUserProfiles(wstr long ptr) +@ stub WcsGpCanInstallOrUninstallProfiles +@ stub WcsOpenColorProfileA +@ stub WcsOpenColorProfileW +@ stub WcsSetCalibrationManagementState +@ stub WcsSetDefaultColorProfile +@ stub WcsSetDefaultRenderingIntent +@ stub WcsSetUsePerUserProfiles +@ stub WcsTranslateColors
1
0
0
0
Louis Lenders : mscms: Add stub for WcsGetUsePerUserProfiles.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 82c7f7977b9e13d297b8398b0902c5b3b8e630e9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82c7f7977b9e13d297b8398b…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Thu Sep 27 13:12:28 2018 +0200 mscms: Add stub for WcsGetUsePerUserProfiles. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45861
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mscms/mscms.spec | 1 + dlls/mscms/profile.c | 10 ++++++++++ include/icm.h | 1 + 3 files changed, 12 insertions(+) diff --git a/dlls/mscms/mscms.spec b/dlls/mscms/mscms.spec index dd404f1..421a8fc 100644 --- a/dlls/mscms/mscms.spec +++ b/dlls/mscms/mscms.spec @@ -59,3 +59,4 @@ @ stdcall UninstallColorProfileW(wstr wstr long) @ stdcall UnregisterCMMA(str long) @ stdcall UnregisterCMMW(wstr long) +@ stdcall WcsGetUsePerUserProfiles(wstr long ptr) diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c index cb4908c..53016ef 100644 --- a/dlls/mscms/profile.c +++ b/dlls/mscms/profile.c @@ -1525,3 +1525,13 @@ BOOL WINAPI CloseColorProfile( HPROFILE profile ) #endif /* HAVE_LCMS2 */ return ret; } + +/****************************************************************************** + * WcsGetUsePerUserProfiles [MSCMS.@] + */ +BOOL WINAPI WcsGetUsePerUserProfiles( const WCHAR* name, DWORD class, BOOL* use_per_user_profile ) +{ + FIXME( "%s %s %p\n", debugstr_w(name), dbgstr_tag(class), use_per_user_profile ); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} diff --git a/include/icm.h b/include/icm.h index 34b0b63..8a666fa 100644 --- a/include/icm.h +++ b/include/icm.h @@ -403,6 +403,7 @@ BOOL WINAPI UninstallColorProfileW(PCWSTR,PCWSTR,BOOL); BOOL WINAPI UnregisterCMMA(PCSTR,DWORD); BOOL WINAPI UnregisterCMMW(PCWSTR,DWORD); #define UnregisterCMM WINELIB_NAME_AW(UnregisterCMM) +BOOL WINAPI WcsGetUsePerUserProfiles(const WCHAR*,DWORD,BOOL*); #define PROFILE_FILENAME 1 #define PROFILE_MEMBUFFER 2
1
0
0
0
Alexandre Julliard : kernel32: Get rid of the binary_info structure.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: ec13f6ec2ac84f32cc572148d542e92a57f47008 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ec13f6ec2ac84f32cc572148…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 27 14:54:01 2018 +0200 kernel32: Get rid of the binary_info structure. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/process.c | 205 +++++++++++++++++++++++------------------------- 1 file changed, 98 insertions(+), 107 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ec13f6ec2ac84f32cc57…
1
0
0
0
Alexandre Julliard : kernel32: Return the binary type from get_binary_info ().
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: df637816bc3ad1afa10135fcb2b784eca49e6f06 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=df637816bc3ad1afa10135fc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 27 14:44:47 2018 +0200 kernel32: Return the binary type from get_binary_info(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/process.c | 71 +++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 40 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 02dce89..59a829b 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -207,7 +207,7 @@ static NTSTATUS get_pe_info( HANDLE handle, pe_image_info_t *info ) /*********************************************************************** * get_binary_info */ -static void get_binary_info( HANDLE hfile, struct binary_info *info ) +static enum binary_type get_binary_info( HANDLE hfile, struct binary_info *info ) { union { @@ -256,24 +256,21 @@ static void get_binary_info( HANDLE hfile, struct binary_info *info ) switch (status) { case STATUS_SUCCESS: - info->type = BINARY_PE; - return; + return BINARY_PE; case STATUS_INVALID_IMAGE_WIN_32: - info->type = BINARY_PE; - return; + return BINARY_PE; case STATUS_INVALID_IMAGE_WIN_64: - info->type = BINARY_PE; - return; + return BINARY_PE; case STATUS_INVALID_IMAGE_WIN_16: case STATUS_INVALID_IMAGE_NE_FORMAT: case STATUS_INVALID_IMAGE_PROTECT: - info->type = BINARY_WIN16; - return; + return BINARY_WIN16; } /* Seek to the start of the file and read the header information. */ - if (SetFilePointer( hfile, 0, NULL, SEEK_SET ) == -1) return; - if (!ReadFile( hfile, &header, sizeof(header), &len, NULL ) || len != sizeof(header)) return; + if (SetFilePointer( hfile, 0, NULL, SEEK_SET ) == -1) return BINARY_UNKNOWN; + if (!ReadFile( hfile, &header, sizeof(header), &len, NULL ) || len != sizeof(header)) + return BINARY_UNKNOWN; if (!memcmp( header.elf.magic, "\177ELF", 4 )) { @@ -287,11 +284,19 @@ static void get_binary_info( HANDLE hfile, struct binary_info *info ) header.elf.type = RtlUshortByteSwap( header.elf.type ); header.elf.machine = RtlUshortByteSwap( header.elf.machine ); } + switch(header.elf.machine) + { + case 3: info->pe.machine = IMAGE_FILE_MACHINE_I386; break; + case 20: info->pe.machine = IMAGE_FILE_MACHINE_POWERPC; break; + case 40: info->pe.machine = IMAGE_FILE_MACHINE_ARMNT; break; + case 50: info->pe.machine = IMAGE_FILE_MACHINE_IA64; break; + case 62: info->pe.machine = IMAGE_FILE_MACHINE_AMD64; break; + case 183: info->pe.machine = IMAGE_FILE_MACHINE_ARM64; break; + } switch(header.elf.type) { case 2: - info->type = BINARY_UNIX_EXE; - break; + return BINARY_UNIX_EXE; case 3: { LARGE_INTEGER phoff; @@ -309,30 +314,15 @@ static void get_binary_info( HANDLE hfile, struct binary_info *info ) } while (phnum--) { - if (SetFilePointerEx( hfile, phoff, NULL, FILE_BEGIN ) == -1) return; - if (!ReadFile( hfile, &type, sizeof(type), &len, NULL ) || len < sizeof(type)) return; + if (SetFilePointerEx( hfile, phoff, NULL, FILE_BEGIN ) == -1) return BINARY_UNKNOWN; + if (!ReadFile( hfile, &type, sizeof(type), &len, NULL ) || len < sizeof(type)) + return BINARY_UNKNOWN; if (byteswap) type = RtlUlongByteSwap( type ); - if (type == 3) - { - info->type = BINARY_UNIX_EXE; - break; - } + if (type == 3) return BINARY_UNIX_EXE; phoff.QuadPart += (header.elf.class == 2) ? 56 : 32; } - if (!info->type) info->type = BINARY_UNIX_LIB; - break; - } - default: - return; + return BINARY_UNIX_LIB; } - switch(header.elf.machine) - { - case 3: info->pe.machine = IMAGE_FILE_MACHINE_I386; break; - case 20: info->pe.machine = IMAGE_FILE_MACHINE_POWERPC; break; - case 40: info->pe.machine = IMAGE_FILE_MACHINE_ARMNT; break; - case 50: info->pe.machine = IMAGE_FILE_MACHINE_IA64; break; - case 62: info->pe.machine = IMAGE_FILE_MACHINE_AMD64; break; - case 183: info->pe.machine = IMAGE_FILE_MACHINE_ARM64; break; } } /* Mach-o File with Endian set to Big Endian or Little Endian */ @@ -344,11 +334,6 @@ static void get_binary_info( HANDLE hfile, struct binary_info *info ) header.macho.filetype = RtlUlongByteSwap( header.macho.filetype ); header.macho.cputype = RtlUlongByteSwap( header.macho.cputype ); } - switch(header.macho.filetype) - { - case 2: info->type = BINARY_UNIX_EXE; break; - case 8: info->type = BINARY_UNIX_LIB; break; - } switch(header.macho.cputype) { case 0x00000007: info->pe.machine = IMAGE_FILE_MACHINE_I386; break; @@ -357,7 +342,13 @@ static void get_binary_info( HANDLE hfile, struct binary_info *info ) case 0x0100000c: info->pe.machine = IMAGE_FILE_MACHINE_ARM64; break; case 0x00000012: info->pe.machine = IMAGE_FILE_MACHINE_POWERPC; break; } + switch(header.macho.filetype) + { + case 2: return BINARY_UNIX_EXE; + case 8: return BINARY_UNIX_LIB; + } } + return BINARY_UNKNOWN; } @@ -452,7 +443,7 @@ static HANDLE open_exe_file( const WCHAR *name, struct binary_info *binary_info if (contains_path( name ) && get_builtin_path( name, NULL, buffer, sizeof(buffer), binary_info )) handle = 0; } - else get_binary_info( handle, binary_info ); + else binary_info->type = get_binary_info( handle, binary_info ); return handle; } @@ -477,7 +468,7 @@ static BOOL find_exe_file( const WCHAR *name, WCHAR *buffer, int buflen, if ((*handle = CreateFileW( buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0 )) != INVALID_HANDLE_VALUE) { - get_binary_info( *handle, binary_info ); + binary_info->type = get_binary_info( *handle, binary_info ); return TRUE; } return FALSE;
1
0
0
0
Alexandre Julliard : kernel32: Determine 32/ 64-bitness from the PE architecture.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: da40de3ced303178610e4da4640d1beead4096fb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=da40de3ced303178610e4da4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 27 14:23:52 2018 +0200 kernel32: Determine 32/64-bitness from the PE architecture. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/process.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 49e6bc2..02dce89 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -123,12 +123,9 @@ enum binary_type BINARY_UNIX_LIB }; -#define BINARY_FLAG_64BIT 0x02 - struct binary_info { enum binary_type type; - DWORD flags; pe_image_info_t pe; }; @@ -174,6 +171,15 @@ static inline unsigned int is_path_prefix( const WCHAR *prefix, const WCHAR *fil /*********************************************************************** + * is_64bit_arch + */ +static inline BOOL is_64bit_arch( WORD machine ) +{ + return (machine == IMAGE_FILE_MACHINE_AMD64 || machine == IMAGE_FILE_MACHINE_ARM64); +} + + +/*********************************************************************** * get_pe_info */ static NTSTATUS get_pe_info( HANDLE handle, pe_image_info_t *info ) @@ -251,15 +257,12 @@ static void get_binary_info( HANDLE hfile, struct binary_info *info ) { case STATUS_SUCCESS: info->type = BINARY_PE; - if (info->pe.machine == IMAGE_FILE_MACHINE_AMD64 || info->pe.machine == IMAGE_FILE_MACHINE_ARM64) - info->flags |= BINARY_FLAG_64BIT; return; case STATUS_INVALID_IMAGE_WIN_32: info->type = BINARY_PE; return; case STATUS_INVALID_IMAGE_WIN_64: info->type = BINARY_PE; - info->flags |= BINARY_FLAG_64BIT; return; case STATUS_INVALID_IMAGE_WIN_16: case STATUS_INVALID_IMAGE_NE_FORMAT: @@ -279,7 +282,6 @@ static void get_binary_info( HANDLE hfile, struct binary_info *info ) #else BOOL byteswap = (header.elf.data == 2); #endif - if (header.elf.class == 2) info->flags |= BINARY_FLAG_64BIT; if (byteswap) { header.elf.type = RtlUshortByteSwap( header.elf.type ); @@ -337,7 +339,6 @@ static void get_binary_info( HANDLE hfile, struct binary_info *info ) else if (header.macho.magic == 0xfeedface || header.macho.magic == 0xcefaedfe || header.macho.magic == 0xfeedfacf || header.macho.magic == 0xcffaedfe) { - if ((header.macho.cputype >> 24) == 1) info->flags |= BINARY_FLAG_64BIT; if (header.macho.magic == 0xcefaedfe || header.macho.magic == 0xcffaedfe) { header.macho.filetype = RtlUlongByteSwap( header.macho.filetype ); @@ -371,7 +372,7 @@ static BOOL get_builtin_path( const WCHAR *libname, const WCHAR *ext, WCHAR *fil WCHAR *file_part; UINT len; void *redir_disabled = 0; - unsigned int flags = (sizeof(void*) > sizeof(int) ? BINARY_FLAG_64BIT : 0); + BOOL is_64bit = (sizeof(void*) > sizeof(int)); /* builtin names cannot be empty or contain spaces */ if (!libname[0] || strchrW( libname, ' ' ) || strchrW( libname, '\t' )) return FALSE; @@ -387,11 +388,11 @@ static BOOL get_builtin_path( const WCHAR *libname, const WCHAR *ext, WCHAR *fil if ((len = is_path_prefix( DIR_System, filename ))) { - if (is_wow64 && redir_disabled) flags = BINARY_FLAG_64BIT; + if (is_wow64 && redir_disabled) is_64bit = TRUE; } else if (DIR_SysWow64 && (len = is_path_prefix( DIR_SysWow64, filename ))) { - flags = 0; + is_64bit = FALSE; } else return FALSE; @@ -405,7 +406,7 @@ static BOOL get_builtin_path( const WCHAR *libname, const WCHAR *ext, WCHAR *fil file_part = filename + len; if (file_part > filename && file_part[-1] != '\\') *file_part++ = '\\'; strcpyW( file_part, libname ); - if (is_wow64 && redir_disabled) flags = BINARY_FLAG_64BIT; + if (is_wow64 && redir_disabled) is_64bit = TRUE; } if (ext && !strchrW( file_part, '.' )) { @@ -415,10 +416,9 @@ static BOOL get_builtin_path( const WCHAR *libname, const WCHAR *ext, WCHAR *fil } memset( binary_info, 0, sizeof(*binary_info) ); binary_info->type = BINARY_UNIX_LIB; - binary_info->flags = flags; /* assume current arch */ #if defined(__i386__) || defined(__x86_64__) - binary_info->pe.machine = (flags & BINARY_FLAG_64BIT) ? IMAGE_FILE_MACHINE_AMD64 : IMAGE_FILE_MACHINE_I386; + binary_info->pe.machine = is_64bit ? IMAGE_FILE_MACHINE_AMD64 : IMAGE_FILE_MACHINE_I386; #elif defined(__powerpc__) binary_info->pe.machine = IMAGE_FILE_MACHINE_POWERPC; #elif defined(__arm__) && !defined(__ARMEB__) @@ -2078,7 +2078,7 @@ static pid_t exec_loader( LPCWSTR cmd_line, unsigned int flags, int socketfd, argv = build_argv( cmd_line, 1 ); - if (!is_win64 ^ !(binary_info->flags & BINARY_FLAG_64BIT)) + if (!is_win64 ^ !is_64bit_arch( binary_info->pe.machine )) loader = get_alternate_loader( &wineloader ); if (exec_only || !(pid = fork())) /* child */ @@ -2678,7 +2678,7 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A { case BINARY_PE: TRACE( "starting %s as Win%d binary (%s-%s, arch %04x)\n", - debugstr_w(name), (binary_info.flags & BINARY_FLAG_64BIT) ? 64 : 32, + debugstr_w(name), is_64bit_arch(binary_info.pe.machine) ? 64 : 32, wine_dbgstr_longlong(binary_info.pe.base), wine_dbgstr_longlong(binary_info.pe.base + binary_info.pe.map_size), binary_info.pe.machine ); @@ -2692,7 +2692,7 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A break; case BINARY_UNIX_LIB: TRACE( "starting %s as %d-bit Winelib app\n", - debugstr_w(name), (binary_info.flags & BINARY_FLAG_64BIT) ? 64 : 32 ); + debugstr_w(name), is_64bit_arch(binary_info.pe.machine) ? 64 : 32 ); retv = create_process( hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr, inherit, flags, startup_info, info, unixdir, &binary_info, FALSE ); break; @@ -2830,7 +2830,7 @@ static void exec_process( LPCWSTR name ) { case BINARY_PE: TRACE( "starting %s as Win%d binary (%s-%s, arch %04x)\n", - debugstr_w(name), (binary_info.flags & BINARY_FLAG_64BIT) ? 64 : 32, + debugstr_w(name), is_64bit_arch(binary_info.pe.machine) ? 64 : 32, wine_dbgstr_longlong(binary_info.pe.base), wine_dbgstr_longlong(binary_info.pe.base + binary_info.pe.map_size), binary_info.pe.machine );
1
0
0
0
Alexandre Julliard : kernel32: Retrieve binary information from the server for PE files.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 9d3a5a969c6c45468e012cdfc591f6485ad28ae7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9d3a5a969c6c45468e012cdf…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 27 13:37:30 2018 +0200 kernel32: Retrieve binary information from the server for PE files. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/process.c | 180 ++++++++++++++++++++++-------------------------- 1 file changed, 82 insertions(+), 98 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=9d3a5a969c6c45468e01…
1
0
0
0
Alexandre Julliard : kernel32: Move MODULE_get_binary_info implementation to process.c.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 8b492467d91d9a8c9a75d5d9f15bcbeebd25e6cc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8b492467d91d9a8c9a75d5d9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 27 13:27:28 2018 +0200 kernel32: Move MODULE_get_binary_info implementation to process.c. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/kernel_private.h | 24 ----- dlls/kernel32/module.c | 200 ------------------------------------ dlls/kernel32/process.c | 228 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 226 insertions(+), 226 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=8b492467d91d9a8c9a75…
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
67
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
Results per page:
10
25
50
100
200