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
March 2022
----- 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
1138 discussions
Start a n
N
ew thread
Hans Leidekker : crypt32: Add partial support for encoding signed OCSP requests.
by Alexandre Julliard
10 Mar '22
10 Mar '22
Module: wine Branch: master Commit: 85d2cbbe53e577daba7ca3f857e3e7226ecb6d1d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=85d2cbbe53e577daba7ca3f8…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Mar 10 14:15:49 2022 +0100 crypt32: Add partial support for encoding signed OCSP requests. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/encode.c | 30 ++++++++++++++++++++++++++++++ dlls/crypt32/tests/encode.c | 24 +++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index 3391e61679c..8086ad2fc0a 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -4664,6 +4664,33 @@ static BOOL WINAPI CRYPT_AsnEncodeOCSPRequest(DWORD dwCertEncodingType, return ret; } +static BOOL WINAPI CRYPT_AsnEncodeOCSPSignedRequest(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + BOOL ret; + + __TRY + { + const OCSP_SIGNED_REQUEST_INFO *info = pvStructInfo; + struct AsnEncodeSequenceItem items[] = { + { &info->ToBeSigned, CRYPT_CopyEncodedBlob, 0 }, + }; + + if (info->pOptionalSignatureInfo) FIXME("pOptionalSignatureInfo not supported\n"); + + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + ARRAY_SIZE(items), dwFlags, pEncodePara, pbEncoded, pcbEncoded); + } + __EXCEPT_PAGE_FAULT + { + SetLastError(STATUS_ACCESS_VIOLATION); + ret = FALSE; + } + __ENDTRY + return ret; +} + static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType, LPCSTR lpszStructType) { @@ -4807,6 +4834,9 @@ static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType, case LOWORD(OCSP_REQUEST): encodeFunc = CRYPT_AsnEncodeOCSPRequest; break; + case LOWORD(OCSP_SIGNED_REQUEST): + encodeFunc = CRYPT_AsnEncodeOCSPSignedRequest; + break; default: FIXME("Unimplemented encoder for lpszStructType OID %d\n", LOWORD(lpszStructType)); } diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 747b4a7d18f..c47fd823673 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -8667,6 +8667,14 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding) 0x0c, 0x0b, 0x4e, 0xc0, 0x09, 0x8a, 0xab, 0xd8, 0x04, 0x14, 0xb7, 0x6b, 0xa2, 0xea, 0xa8, 0xaa, 0x84, 0x8c, 0x79, 0xea, 0xb4, 0xda, 0x0f, 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9, 0xf4, 0x02, 0x10, 0xb1, 0xc1, 0x87, 0x54, 0x54, 0xac, 0x1e, 0x55, 0x40, 0xfb, 0xef, 0xd9, 0x6d, 0x8f, 0x49, 0x08}; + static const BYTE expected4[] = + {0x30, 0x6a, 0x30, 0x68, 0xa1, 0x17, 0x82, 0x15, 0x2a, 0x2e, 0x63, 0x6d, 0x2e, 0x73, 0x74, 0x65, + 0x61, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x65, 0x64, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x4d, 0x30, + 0x4b, 0x30, 0x49, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14, + 0xe4, 0xe3, 0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3, 0x1f, 0xf0, 0x98, 0x0c, 0x0b, 0x4e, 0xc0, + 0x09, 0x8a, 0xab, 0xd8, 0x04, 0x14, 0xb7, 0x6b, 0xa2, 0xea, 0xa8, 0xaa, 0x84, 0x8c, 0x79, 0xea, + 0xb4, 0xda, 0x0f, 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9, 0xf4, 0x02, 0x10, 0xb1, 0xc1, 0x87, 0x54, + 0x54, 0xac, 0x1e, 0x55, 0x40, 0xfb, 0xef, 0xd9, 0x6d, 0x8f, 0x49, 0x08}; static const BYTE issuer_name[] = {0xe4, 0xe3 ,0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3, 0x1f, 0xf0, 0x98, 0x0c, 0x0b, 0x4e, 0xc0, 0x09, 0x8a, 0xab, 0xd8}; @@ -8678,8 +8686,9 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding) OCSP_REQUEST_ENTRY entry[2]; CERT_ALT_NAME_ENTRY name; OCSP_REQUEST_INFO info; + OCSP_SIGNED_REQUEST_INFO info_signed; DWORD size; - BYTE *buf; + BYTE *buf, *buf2; BOOL ret; memset(&entry, 0, sizeof(entry)); @@ -8707,7 +8716,20 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding) ok(ret, "got %08lx\n", GetLastError()); ok(size == sizeof(expected), "got %lu\n", size); ok(!memcmp(buf, expected, sizeof(expected)), "unexpected value\n"); + + /* wrapped in OCSP_SIGNED_REQUEST_INFO */ + info_signed.ToBeSigned.cbData = size; + info_signed.ToBeSigned.pbData = buf; + info_signed.pOptionalSignatureInfo = NULL; + size = 0; + SetLastError(0xdeadbeef); + ret = pCryptEncodeObjectEx(dwEncoding, OCSP_SIGNED_REQUEST, &info_signed, CRYPT_ENCODE_ALLOC_FLAG, NULL, + &buf2, &size); + ok(ret, "got %08lx\n", GetLastError()); + ok(size == sizeof(expected4), "got %lu\n", size); + ok(!memcmp(buf2, expected4, sizeof(expected4)), "unexpected value\n"); LocalFree(buf); + LocalFree(buf2); /* two entries */ entry[1].CertId.HashAlgorithm.pszObjId = (char *)szOID_OIWSEC_sha1;
1
0
0
0
Hans Leidekker : crypt32: Requestor name is optional in OCSP request.
by Alexandre Julliard
10 Mar '22
10 Mar '22
Module: wine Branch: master Commit: 6de79d64fa930cfc2d1497f0519015af5788bb86 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6de79d64fa930cfc2d1497f0…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Mar 10 14:15:48 2022 +0100 crypt32: Requestor name is optional in OCSP request. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/encode.c | 21 ++++++++++++--------- dlls/crypt32/tests/encode.c | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index a506f197be1..3391e61679c 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -4632,18 +4632,21 @@ static BOOL WINAPI CRYPT_AsnEncodeOCSPRequest(DWORD dwCertEncodingType, { struct AsnConstructedItem name; struct AsnEncodeSequenceItem items[2]; - DWORD count = 1; - - name.tag = 1; - name.pvStructInfo = info->pRequestorName; - name.encodeFunc = CRYPT_AsnEncodeAltNameEntry; - items[0].pvStructInfo = &name; - items[0].encodeFunc = CRYPT_AsnEncodeConstructed; + DWORD count = 0; + if (info->pRequestorName) + { + name.tag = 1; + name.pvStructInfo = info->pRequestorName; + name.encodeFunc = CRYPT_AsnEncodeAltNameEntry; + items[count].pvStructInfo = &name; + items[count].encodeFunc = CRYPT_AsnEncodeConstructed; + count++; + } if (info->cRequestEntry) { - items[1].pvStructInfo = &info->cRequestEntry; - items[1].encodeFunc = CRYPT_AsnEncodeOCSPRequestEntries; + items[count].pvStructInfo = &info->cRequestEntry; + items[count].encodeFunc = CRYPT_AsnEncodeOCSPRequestEntries; count++; } diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 9d12223c54c..747b4a7d18f 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -8656,6 +8656,17 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding) 0xd8, 0x04, 0x14, 0xb7, 0x6b, 0xa2, 0xea, 0xa8, 0xaa, 0x84, 0x8c, 0x79, 0xea, 0xb4, 0xda, 0x0f, 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9, 0xf4, 0x02, 0x10, 0xb1, 0xc1, 0x87, 0x54, 0x54, 0xac, 0x1e, 0x55, 0x40, 0xfb, 0xef, 0xd9, 0x6d, 0x8f, 0x49, 0x08}; + static const BYTE expected3[] = + {0x30, 0x81, 0x9d, 0x30, 0x81, 0x9a, 0x30, 0x4b, 0x30, 0x49, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, + 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14, 0xe4, 0xe3, 0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3, + 0x1f, 0xf0, 0x98, 0x0c, 0x0b, 0x4e, 0xc0, 0x09, 0x8a, 0xab, 0xd8, 0x04, 0x14, 0xb7, 0x6b, 0xa2, + 0xea, 0xa8, 0xaa, 0x84, 0x8c, 0x79, 0xea, 0xb4, 0xda, 0x0f, 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9, + 0xf4, 0x02, 0x10, 0xb1, 0xc1, 0x87, 0x54, 0x54, 0xac, 0x1e, 0x55, 0x40, 0xfb, 0xef, 0xd9, 0x6d, + 0x8f, 0x49, 0x08, 0x30, 0x4b, 0x30, 0x49, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, + 0x05, 0x00, 0x04, 0x14, 0xe4, 0xe3, 0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3, 0x1f, 0xf0, 0x98, + 0x0c, 0x0b, 0x4e, 0xc0, 0x09, 0x8a, 0xab, 0xd8, 0x04, 0x14, 0xb7, 0x6b, 0xa2, 0xea, 0xa8, 0xaa, + 0x84, 0x8c, 0x79, 0xea, 0xb4, 0xda, 0x0f, 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9, 0xf4, 0x02, 0x10, + 0xb1, 0xc1, 0x87, 0x54, 0x54, 0xac, 0x1e, 0x55, 0x40, 0xfb, 0xef, 0xd9, 0x6d, 0x8f, 0x49, 0x08}; static const BYTE issuer_name[] = {0xe4, 0xe3 ,0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3, 0x1f, 0xf0, 0x98, 0x0c, 0x0b, 0x4e, 0xc0, 0x09, 0x8a, 0xab, 0xd8}; @@ -8715,6 +8726,16 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding) ok(size == sizeof(expected2), "got %lu\n", size); ok(!memcmp(buf, expected2, sizeof(expected2)), "unexpected value\n"); LocalFree(buf); + + /* requestor name not set */ + info.pRequestorName = NULL; + size = 0; + SetLastError(0xdeadbeef); + ret = pCryptEncodeObjectEx(dwEncoding, OCSP_REQUEST, &info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "got %08lx\n", GetLastError()); + ok(size == sizeof(expected3), "got %lu\n", size); + ok(!memcmp(buf, expected3, sizeof(expected3)), "unexpected value\n"); + LocalFree(buf); } START_TEST(encode)
1
0
0
0
Zhiyi Zhang : comctl32/tests: Fix a possible test failure.
by Alexandre Julliard
10 Mar '22
10 Mar '22
Module: wine Branch: master Commit: 7de22a743827e4a74b228b851f508db9eee1f8d1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7de22a743827e4a74b228b85…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Thu Mar 10 21:44:58 2022 +0800 comctl32/tests: Fix a possible test failure. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52639
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/toolbar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index 80f9e067c00..31c360304c6 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -2639,6 +2639,7 @@ static void test_visual(void) SendMessageA(toolbar, TB_BUTTONSTRUCTSIZE, sizeof(tbbutton), 0); ret = SendMessageA(toolbar, TB_ADDBUTTONSA, 1, (LPARAM)&tbbutton); ok(ret, "TB_ADDBUTTONSA failed.\n"); + flush_events(); theme = pGetWindowTheme(toolbar); ok(!theme, "Expected theme not opened by window.\n"); @@ -2650,7 +2651,6 @@ static void test_visual(void) ret = RedrawWindow(toolbar, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_ERASE | RDW_ERASENOW | RDW_UPDATENOW); ok(ret, "RedrawWindow failed.\n"); - flush_events(); mem_dc1 = CreateCompatibleDC(toolbar_dc); mem_bitmap1 = CreateCompatibleBitmap(toolbar_dc, width, height);
1
0
0
0
Jacek Caban : win32u: Move NtUserUpdateLayeredWindow implementation from user32.
by Alexandre Julliard
10 Mar '22
10 Mar '22
Module: wine Branch: master Commit: ba373a3eb2704d83679b78ba1f0d8db9887225ab URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ba373a3eb2704d83679b78ba…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Mar 10 14:33:27 2022 +0100 win32u: Move NtUserUpdateLayeredWindow implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/driver.c | 15 +--------- dlls/user32/win.c | 49 +++---------------------------- dlls/win32u/driver.c | 7 +++++ dlls/win32u/gdiobj.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 4 +++ dlls/win32u/window.c | 70 ++++++++++++++++++++++++++++++++++++++++++++ dlls/win32u/wrappers.c | 9 ++++++ include/ntuser.h | 3 ++ 9 files changed, 100 insertions(+), 60 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ba373a3eb2704d83679b…
1
0
0
0
Jacek Caban : win32u: Move NtUserSetLayeredWindowAttributes implementation from user32.
by Alexandre Julliard
10 Mar '22
10 Mar '22
Module: wine Branch: master Commit: 7e62ec6143db8ced4cc2f4d38b26103033b3a214 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7e62ec6143db8ced4cc2f4d3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Mar 10 14:33:11 2022 +0100 win32u: Move NtUserSetLayeredWindowAttributes implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/driver.c | 12 +----------- dlls/user32/user32.spec | 2 +- dlls/user32/win.c | 29 ----------------------------- dlls/win32u/driver.c | 6 ++++++ dlls/win32u/gdiobj.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 + dlls/win32u/window.c | 28 ++++++++++++++++++++++++++++ dlls/win32u/wrappers.c | 6 ++++++ include/ntuser.h | 1 + 10 files changed, 46 insertions(+), 42 deletions(-) diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index 29e8db73206..e3db8299b48 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -108,10 +108,6 @@ static void CDECL nulldrv_SetFocus( HWND hwnd ) { } -static void CDECL nulldrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) -{ -} - static void CDECL nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent ) { } @@ -187,11 +183,6 @@ static void CDECL loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT load_driver()->pGetDC( hdc, hwnd, top_win, win_rect, top_rect, flags ); } -static void CDECL loaderdrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) -{ - load_driver()->pSetLayeredWindowAttributes( hwnd, key, alpha, flags ); -} - static BOOL CDECL loaderdrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info, const RECT *window_rect ) { @@ -234,7 +225,7 @@ static struct user_driver_funcs lazy_load_driver = NULL, nulldrv_SetCapture, nulldrv_SetFocus, - loaderdrv_SetLayeredWindowAttributes, + NULL, nulldrv_SetParent, NULL, nulldrv_SetWindowIcon, @@ -281,7 +272,6 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v SET_USER_FUNC(ReleaseDC); SET_USER_FUNC(SetCapture); SET_USER_FUNC(SetFocus); - SET_USER_FUNC(SetLayeredWindowAttributes); SET_USER_FUNC(SetParent); SET_USER_FUNC(SetWindowIcon); SET_USER_FUNC(SetWindowStyle); diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 00700224f4a..65eb0755f61 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -675,7 +675,7 @@ @ stdcall SetInternalWindowPos(long long ptr ptr) @ stdcall SetKeyboardState(ptr) NtUserSetKeyboardState @ stdcall SetLastErrorEx(long long) -@ stdcall SetLayeredWindowAttributes(ptr long long long) +@ stdcall SetLayeredWindowAttributes(ptr long long long) NtUserSetLayeredWindowAttributes @ stdcall SetLogonNotifyWindow(long long) @ stdcall SetMenu(long long) @ stdcall SetMenuContextHelpId(long long) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 885c06c90ca..554d35635c5 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -3251,35 +3251,6 @@ BOOL CDECL __wine_set_pixel_format( HWND hwnd, int format ) } -/***************************************************************************** - * SetLayeredWindowAttributes (USER32.@) - */ -BOOL WINAPI SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) -{ - BOOL ret; - - TRACE("(%p,%08x,%d,%x)\n", hwnd, key, alpha, flags); - - SERVER_START_REQ( set_window_layered_info ) - { - req->handle = wine_server_user_handle( hwnd ); - req->color_key = key; - req->alpha = alpha; - req->flags = flags; - ret = !wine_server_call_err( req ); - } - SERVER_END_REQ; - - if (ret) - { - USER_Driver->pSetLayeredWindowAttributes( hwnd, key, alpha, flags ); - update_window_state( hwnd ); - } - - return ret; -} - - /***************************************************************************** * UpdateLayeredWindowIndirect (USER32.@) */ diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index f46436e524a..0e0c21c1eab 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -1137,6 +1137,11 @@ static void CDECL loaderdrv_FlashWindowEx( FLASHWINFO *info ) load_driver()->pFlashWindowEx( info ); } +static void CDECL loaderdrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) +{ + load_driver()->pSetLayeredWindowAttributes( hwnd, key, alpha, flags ); +} + static void CDECL loaderdrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) { load_driver()->pSetWindowRgn( hwnd, hrgn, redraw ); @@ -1174,6 +1179,7 @@ static const struct user_driver_funcs lazy_load_driver = /* windowing functions */ .pCreateDesktopWindow = loaderdrv_CreateDesktopWindow, .pFlashWindowEx = loaderdrv_FlashWindowEx, + .pSetLayeredWindowAttributes = loaderdrv_SetLayeredWindowAttributes, .pSetWindowRgn = loaderdrv_SetWindowRgn, .pMsgWaitForMultipleObjectsEx = nulldrv_MsgWaitForMultipleObjectsEx, .pScrollDC = nulldrv_ScrollDC, diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index e5c320f8bcc..72d11667ce9 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1188,6 +1188,7 @@ static struct unix_funcs unix_funcs = NtUserSetCursor, NtUserSetCursorIconData, NtUserSetCursorPos, + NtUserSetLayeredWindowAttributes, NtUserSetSysColors, NtUserSetWindowPos, NtUserSetWindowRgn, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index f011feb3ec7..cc1ee83167a 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1203,7 +1203,7 @@ @ stub NtUserSetInteractiveCtrlRotationAngle @ stub NtUserSetInternalWindowPos @ stdcall -syscall NtUserSetKeyboardState(ptr) -@ stub NtUserSetLayeredWindowAttributes +@ stdcall NtUserSetLayeredWindowAttributes(ptr long long long) @ stub NtUserSetMagnificationDesktopMagnifierOffsetsDWMUpdated @ stub NtUserSetManipulationInputTarget @ stub NtUserSetMenu diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index f1e59055e02..40ac0d05fef 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -234,6 +234,7 @@ struct unix_funcs BOOL (WINAPI *pNtUserSetCursorIconData)( HCURSOR cursor, UNICODE_STRING *module, UNICODE_STRING *res_name, struct cursoricon_desc *desc ); BOOL (WINAPI *pNtUserSetCursorPos)( INT x, INT y ); + BOOL (WINAPI *pNtUserSetLayeredWindowAttributes)( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ); BOOL (WINAPI *pNtUserSetSysColors)( INT count, const INT *colors, const COLORREF *values ); BOOL (WINAPI *pNtUserSetWindowPos)( HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags ); int (WINAPI *pNtUserSetWindowRgn)( HWND hwnd, HRGN hrgn, BOOL redraw ); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 35953143f37..d21cc0e6887 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1309,6 +1309,34 @@ BOOL WINAPI NtUserGetLayeredWindowAttributes( HWND hwnd, COLORREF *key, BYTE *al return ret; } +/***************************************************************************** + * NtUserSetLayeredWindowAttributes (win32u.@) + */ +BOOL WINAPI NtUserSetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) +{ + BOOL ret; + + TRACE( "(%p,%08x,%d,%x)\n", hwnd, key, alpha, flags ); + + SERVER_START_REQ( set_window_layered_info ) + { + req->handle = wine_server_user_handle( hwnd ); + req->color_key = key; + req->alpha = alpha; + req->flags = flags; + ret = !wine_server_call_err( req ); + } + SERVER_END_REQ; + + if (ret) + { + user_driver->pSetLayeredWindowAttributes( hwnd, key, alpha, flags ); + update_window_state( hwnd ); + } + + return ret; +} + /*********************************************************************** * list_children_from_point * diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c index b1c86949db2..40b5ea2d4cf 100644 --- a/dlls/win32u/wrappers.c +++ b/dlls/win32u/wrappers.c @@ -940,6 +940,12 @@ BOOL WINAPI NtUserSetCursorPos( INT x, INT y ) return unix_funcs->pNtUserSetCursorPos( x, y ); } +BOOL WINAPI NtUserSetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) +{ + if (!unix_funcs) return FALSE; + return unix_funcs->pNtUserSetLayeredWindowAttributes( hwnd, key, alpha, flags ); +} + BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values ) { if (!unix_funcs) return FALSE; diff --git a/include/ntuser.h b/include/ntuser.h index 9a25fe72419..82bf5f89b74 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -367,6 +367,7 @@ BOOL WINAPI NtUserSetCursorIconData( HCURSOR cursor, UNICODE_STRING *module, struct cursoricon_desc *desc ); BOOL WINAPI NtUserSetCursorPos( INT x, INT y ); BOOL WINAPI NtUserSetKeyboardState( BYTE *state ); +BOOL WINAPI NtUserSetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ); BOOL WINAPI NtUserSetProcessDpiAwarenessContext( ULONG awareness, ULONG unknown ); BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle ); BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle );
1
0
0
0
Jacek Caban : win32u: Move WM_WINE_UPDATEWINDOWSTATE implementation from user32.
by Alexandre Julliard
10 Mar '22
10 Mar '22
Module: wine Branch: master Commit: b5ddd14448d2a780ccab7bb672e66fbfd3ec7b4f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b5ddd14448d2a780ccab7bb6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Mar 10 14:32:56 2022 +0100 win32u: Move WM_WINE_UPDATEWINDOWSTATE implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 3 --- dlls/user32/user_main.c | 2 ++ dlls/user32/user_private.h | 1 - dlls/user32/win.c | 2 +- dlls/win32u/message.c | 11 +++++++++++ dlls/win32u/ntuser_private.h | 4 ++++ dlls/win32u/sysparams.c | 42 ++++++++++++++++++++++++++++++++++++++++++ dlls/win32u/win32u_private.h | 3 +++ dlls/win32u/window.c | 26 ++++++++++++++++++++++++++ 9 files changed, 89 insertions(+), 5 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 85b3b672cfc..577120032bf 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -1878,9 +1878,6 @@ LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar case WM_WINE_SETACTIVEWINDOW: if (!wparam && NtUserGetForegroundWindow() == hwnd) return 0; return (LRESULT)SetActiveWindow( (HWND)wparam ); - case WM_WINE_UPDATEWINDOWSTATE: - update_window_state( hwnd ); - return 0; default: { MSG m; diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 4103d3dc7a8..ef8b35128b4 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -136,6 +136,7 @@ static void dpiaware_init(void) static const struct user_callbacks user_funcs = { CopyImage, + PostMessageW, RedrawWindow, SendMessageTimeoutW, SendMessageW, @@ -146,6 +147,7 @@ static const struct user_callbacks user_funcs = register_builtin_classes, MSG_SendInternalMessageTimeout, (void *)__wine_set_user_driver, + set_window_pos, }; static void WINAPI User32CallFreeIcon( ULONG *param, ULONG size ) diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index e2e371e32c0..453eb58c30d 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -124,7 +124,6 @@ extern void move_window_bits( HWND hwnd, struct window_surface *old_surface, const RECT *window_rect, const RECT *valid_rects ) DECLSPEC_HIDDEN; extern void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect, const RECT *valid_rects ) DECLSPEC_HIDDEN; -extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN; extern void wait_graphics_driver_ready(void) DECLSPEC_HIDDEN; extern void *get_hook_proc( void *proc, const WCHAR *module, HMODULE *free_module ) DECLSPEC_HIDDEN; extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN; diff --git a/dlls/user32/win.c b/dlls/user32/win.c index bb792037640..885c06c90ca 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -308,7 +308,7 @@ static void send_parent_notify( HWND hwnd, UINT msg ) * * Trigger an update of the window's driver state and surface. */ -void update_window_state( HWND hwnd ) +static void update_window_state( HWND hwnd ) { DPI_AWARENESS_CONTEXT context; RECT window_rect, client_rect, valid_rects[2]; diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index abfbd7d9c69..b995ee60a0e 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -56,6 +56,9 @@ LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar return user_driver->pClipCursor( &rect ); } return user_driver->pClipCursor( NULL ); + case WM_WINE_UPDATEWINDOWSTATE: + update_window_state( hwnd ); + return 0; default: if (msg >= WM_WINE_FIRST_DRIVER_MSG && msg <= WM_WINE_LAST_DRIVER_MSG) return user_driver->pWindowMessage( hwnd, msg, wparam, lparam ); @@ -118,3 +121,11 @@ LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) if (!user_callbacks) return 0; return user_callbacks->pSendMessageW( hwnd, msg, wparam, lparam ); } + +/* see PostMessageW */ +LRESULT post_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) +{ + /* FIXME: move implementation from user32 */ + if (!user_callbacks) return 0; + return user_callbacks->pPostMessageW( hwnd, msg, wparam, lparam ); +} diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 654429b994b..52be42f61ea 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -30,6 +30,7 @@ struct dce; struct user_callbacks { HANDLE (WINAPI *pCopyImage)( HANDLE, UINT, INT, INT, UINT ); + BOOL (WINAPI *pPostMessageW)( HWND, UINT, WPARAM, LPARAM ); BOOL (WINAPI *pRedrawWindow)( HWND, const RECT*, HRGN, UINT ); LRESULT (WINAPI *pSendMessageTimeoutW)( HWND, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR ); LRESULT (WINAPI *pSendMessageW)( HWND, UINT, WPARAM, LPARAM ); @@ -40,6 +41,9 @@ struct user_callbacks void (CDECL *register_builtin_classes)(void); LRESULT (WINAPI *send_ll_message)( DWORD, DWORD, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR ); void (CDECL *set_user_driver)( void *, UINT ); + BOOL (CDECL *set_window_pos)( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *window_rect, const RECT *client_rect, + const RECT *valid_rects ); }; struct user_object diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 39f8cf53345..a342d35a947 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1436,6 +1436,48 @@ UINT get_system_dpi(void) return system_dpi; } +/* see GetAwarenessFromDpiAwarenessContext */ +static DPI_AWARENESS get_awareness_from_dpi_awareness_context( DPI_AWARENESS_CONTEXT context ) +{ + switch ((ULONG_PTR)context) + { + case 0x10: + case 0x11: + case 0x12: + case 0x80000010: + case 0x80000011: + case 0x80000012: + return (ULONG_PTR)context & 3; + case (ULONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE: + case (ULONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE: + case (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE: + return ~(ULONG_PTR)context; + default: + return DPI_AWARENESS_INVALID; + } +} + +/* see SetThreadDpiAwarenessContext */ +DPI_AWARENESS_CONTEXT set_thread_dpi_awareness_context( DPI_AWARENESS_CONTEXT context ) +{ + struct user_thread_info *info = get_user_thread_info(); + DPI_AWARENESS prev, val = get_awareness_from_dpi_awareness_context( context ); + + if (val == DPI_AWARENESS_INVALID) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return 0; + } + if (!(prev = info->dpi_awareness)) + { + prev = NtUserGetProcessDpiAwarenessContext( GetCurrentProcess() ) & 3; + prev |= 0x80000010; /* restore to process default */ + } + if (((ULONG_PTR)context & ~(ULONG_PTR)0x13) == 0x80000000) info->dpi_awareness = 0; + else info->dpi_awareness = val | 0x10; + return ULongToHandle( prev ); +} + /********************************************************************** * map_dpi_rect */ diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 6bdad368f70..f1e59055e02 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -284,6 +284,7 @@ extern BOOL get_cursor_pos( POINT *pt ) DECLSPEC_HIDDEN; extern DWORD get_input_state(void) DECLSPEC_HIDDEN; /* message.c */ +extern LRESULT post_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; extern LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; /* sysparams.c */ @@ -301,6 +302,7 @@ extern RECT map_dpi_rect( RECT rect, UINT dpi_from, UINT dpi_to ) DECLSPEC_HIDDE extern HMONITOR monitor_from_point( POINT pt, DWORD flags, UINT dpi ) DECLSPEC_HIDDEN; extern HMONITOR monitor_from_rect( const RECT *rect, DWORD flags, UINT dpi ) DECLSPEC_HIDDEN; extern HMONITOR monitor_from_window( HWND hwnd, DWORD flags, UINT dpi ) DECLSPEC_HIDDEN; +extern DPI_AWARENESS_CONTEXT set_thread_dpi_awareness_context( DPI_AWARENESS_CONTEXT context ) DECLSPEC_HIDDEN; extern void user_lock(void) DECLSPEC_HIDDEN; extern void user_unlock(void) DECLSPEC_HIDDEN; extern void user_check_not_lock(void) DECLSPEC_HIDDEN; @@ -316,6 +318,7 @@ extern DWORD get_window_long( HWND hwnd, INT offset ) DECLSPEC_HIDDEN; extern BOOL get_window_rect( HWND hwnd, RECT *rect, UINT dpi ) DECLSPEC_HIDDEN; extern void register_window_surface( struct window_surface *old, struct window_surface *new ) DECLSPEC_HIDDEN; +extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN; /* to release pointers retrieved by win_get_ptr */ static inline void release_win_ptr( struct tagWND *ptr ) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 1e80c5d39f8..35953143f37 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1642,6 +1642,32 @@ INT WINAPI NtUserInternalGetWindowText( HWND hwnd, WCHAR *text, INT count ) return lstrlenW(text); } +/******************************************************************* + * update_window_state + * + * Trigger an update of the window's driver state and surface. + */ +void update_window_state( HWND hwnd ) +{ + DPI_AWARENESS_CONTEXT context; + RECT window_rect, client_rect, valid_rects[2]; + + if (!is_current_thread_window( hwnd )) + { + post_message( hwnd, WM_WINE_UPDATEWINDOWSTATE, 0, 0 ); + return; + } + + context = set_thread_dpi_awareness_context( get_window_dpi_awareness_context( hwnd )); + get_window_rects( hwnd, COORDS_PARENT, &window_rect, &client_rect, get_thread_dpi() ); + valid_rects[0] = valid_rects[1] = client_rect; + if (user_callbacks) + user_callbacks->set_window_pos( hwnd, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | + SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW, + &window_rect, &client_rect, valid_rects ); + set_thread_dpi_awareness_context( context ); +} + /******************************************************************* * NtUserFlashWindowEx (win32u.@) */
1
0
0
0
Jacek Caban : win32u: Move GetWindowPlacement and MonitorFromWindow implementation from user32.
by Alexandre Julliard
10 Mar '22
10 Mar '22
Module: wine Branch: master Commit: c7e5ab198eaca24c6876c2268bb545882b3cf857 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c7e5ab198eaca24c6876c226…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Mar 10 14:32:34 2022 +0100 win32u: Move GetWindowPlacement and MonitorFromWindow implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/sysparams.c | 19 +---- dlls/user32/winpos.c | 80 +------------------- dlls/win32u/region.c | 2 +- dlls/win32u/sysparams.c | 23 +++++- dlls/win32u/win32u_private.h | 6 +- dlls/win32u/window.c | 174 +++++++++++++++++++++++++++++++++++++++++-- include/ntuser.h | 2 + 7 files changed, 201 insertions(+), 105 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c7e5ab198eaca24c6876…
1
0
0
0
Jacek Caban : win32u: Move NtUserWindowFromPoint implementation from user32.
by Alexandre Julliard
10 Mar '22
10 Mar '22
Module: wine Branch: master Commit: c45af8f3533e6418eb6cedb786031b40125b8831 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c45af8f3533e6418eb6cedb7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Mar 10 14:31:55 2022 +0100 win32u: Move NtUserWindowFromPoint implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/winpos.c | 3 +- dlls/win32u/gdiobj.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 + dlls/win32u/window.c | 107 ++++++++++++++++++++++++++++++++++++++++++- dlls/win32u/wrappers.c | 6 +++ include/ntuser.h | 1 + 7 files changed, 116 insertions(+), 5 deletions(-) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index d144c53f4e4..2d2c83f503c 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -233,8 +233,7 @@ HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) */ HWND WINAPI WindowFromPoint( POINT pt ) { - INT hittest; - return WINPOS_WindowFromPoint( 0, pt, &hittest ); + return NtUserWindowFromPoint( pt.x, pt.y ); } diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index bb4daf54279..e5c320f8bcc 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1198,6 +1198,7 @@ static struct unix_funcs unix_funcs = NtUserUnregisterClass, NtUserUnregisterHotKey, NtUserVkKeyScanEx, + NtUserWindowFromPoint, GetDCHook, SetDCHook, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 9e426b40e48..f011feb3ec7 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1311,7 +1311,7 @@ @ stub NtUserWaitMessage @ stub NtUserWindowFromDC @ stub NtUserWindowFromPhysicalPoint -@ stub NtUserWindowFromPoint +@ stdcall NtUserWindowFromPoint(long long) @ stub NtUserYieldTask @ stub NtValidateCompositionSurfaceHandle @ stub NtVisualCaptureBits diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index a3fbf8a8a4c..9db06e1dd76 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -247,6 +247,7 @@ struct unix_funcs struct client_menu_name *client_menu_name ); BOOL (WINAPI *pNtUserUnregisterHotKey)( HWND hwnd, INT id ); WORD (WINAPI *pNtUserVkKeyScanEx)( WCHAR chr, HKL layout ); + HWND (WINAPI *pNtUserWindowFromPoint)( LONG x, LONG y ); /* Wine-specific functions */ DWORD_PTR (WINAPI *pGetDCHook)( HDC hdc, DCHOOKPROC *proc ); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index e3564646d0a..e5907e8422d 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1257,8 +1257,8 @@ int WINAPI NtUserSetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) if (ret) { - UINT swp_flags = SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_FRAMECHANGED| - SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE; + UINT swp_flags = SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED | + SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE; if (!redraw) swp_flags |= SWP_NOREDRAW; user_driver->pSetWindowRgn( hwnd, hrgn, redraw ); NtUserSetWindowPos( hwnd, 0, 0, 0, 0, 0, swp_flags ); @@ -1309,6 +1309,109 @@ BOOL WINAPI NtUserGetLayeredWindowAttributes( HWND hwnd, COLORREF *key, BYTE *al return ret; } +/*********************************************************************** + * list_children_from_point + * + * Get the list of children that can contain point from the server. + * Point is in screen coordinates. + * Returned list must be freed by caller. + */ +static HWND *list_children_from_point( HWND hwnd, POINT pt ) +{ + int i, size = 128; + HWND *list; + + for (;;) + { + int count = 0; + + if (!(list = malloc( size * sizeof(HWND) ))) break; + + SERVER_START_REQ( get_window_children_from_point ) + { + req->parent = wine_server_user_handle( hwnd ); + req->x = pt.x; + req->y = pt.y; + req->dpi = get_thread_dpi(); + wine_server_set_reply( req, list, (size-1) * sizeof(user_handle_t) ); + if (!wine_server_call( req )) count = reply->count; + } + SERVER_END_REQ; + if (count && count < size) + { + /* start from the end since HWND is potentially larger than user_handle_t */ + for (i = count - 1; i >= 0; i--) + list[i] = wine_server_ptr_handle( ((user_handle_t *)list)[i] ); + list[count] = 0; + return list; + } + free( list ); + if (!count) break; + size = count + 1; /* restart with a large enough buffer */ + } + return NULL; +} + +/*********************************************************************** + * window_from_point + * + * Find the window and hittest for a given point. + */ +static HWND window_from_point( HWND hwnd, POINT pt, INT *hittest ) +{ + int i, res; + HWND ret, *list; + POINT win_pt; + + if (!hwnd) hwnd = get_desktop_window(); + + *hittest = HTNOWHERE; + + if (!(list = list_children_from_point( hwnd, pt ))) return 0; + + /* now determine the hittest */ + + for (i = 0; list[i]; i++) + { + LONG style = get_window_long( list[i], GWL_STYLE ); + + /* If window is minimized or disabled, return at once */ + if (style & WS_DISABLED) + { + *hittest = HTERROR; + break; + } + /* Send WM_NCCHITTEST (if same thread) */ + if (!is_current_thread_window( list[i] )) + { + *hittest = HTCLIENT; + break; + } + win_pt = map_dpi_point( pt, get_thread_dpi(), get_dpi_for_window( list[i] )); + res = send_message( list[i], WM_NCHITTEST, 0, MAKELPARAM( win_pt.x, win_pt.y )); + if (res != HTTRANSPARENT) + { + *hittest = res; /* Found the window */ + break; + } + /* continue search with next window in z-order */ + } + ret = list[i]; + free( list ); + TRACE( "scope %p (%d,%d) returning %p\n", hwnd, pt.x, pt.y, ret ); + return ret; +} + +/******************************************************************* + * NtUserWindowFromPoint (win32u.@) + */ +HWND WINAPI NtUserWindowFromPoint( LONG x, LONG y ) +{ + POINT pt = { .x = x, .y = y }; + INT hittest; + return window_from_point( 0, pt, &hittest ); +} + /***************************************************************************** * NtUserBuildHwndList (win32u.@) */ diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c index 99c01c326c3..b1c86949db2 100644 --- a/dlls/win32u/wrappers.c +++ b/dlls/win32u/wrappers.c @@ -1002,6 +1002,12 @@ WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout ) return unix_funcs->pNtUserVkKeyScanEx( chr, layout ); } +HWND WINAPI NtUserWindowFromPoint( LONG x, LONG y ) +{ + if (!unix_funcs) return 0; + return unix_funcs->pNtUserWindowFromPoint( x, y ); +} + DWORD_PTR WINAPI GetDCHook( HDC hdc, DCHOOKPROC *proc ) { if (!unix_funcs) return 0; diff --git a/include/ntuser.h b/include/ntuser.h index 3c5c73f5f48..e6c724fa683 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -389,5 +389,6 @@ BOOL WINAPI NtUserUnregisterClass( UNICODE_STRING *name, HINSTANCE instance, BOOL WINAPI NtUserUnregisterHotKey( HWND hwnd, INT id ); WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout ); DWORD WINAPI NtUserWaitForInputIdle( HANDLE process, DWORD timeout, BOOL wow ); +HWND WINAPI NtUserWindowFromPoint( LONG x, LONG y ); #endif /* _NTUSER_ */
1
0
0
0
Jacek Caban : win32u: Move NtUserMoveWindow implementation from user32.
by Alexandre Julliard
10 Mar '22
10 Mar '22
Module: wine Branch: master Commit: a34032b0f0afcc6b0d8d4cf1f00a01e90317accd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a34032b0f0afcc6b0d8d4cf1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Mar 10 14:32:16 2022 +0100 win32u: Move NtUserMoveWindow implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/mdi.c | 6 +++--- dlls/user32/scroll.c | 36 ++++++++++++++++++------------------ dlls/user32/user32.spec | 2 +- dlls/user32/winpos.c | 13 ------------- dlls/win32u/gdiobj.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 + dlls/win32u/window.c | 11 +++++++++++ dlls/win32u/wrappers.c | 6 ++++++ include/ntuser.h | 3 +++ 10 files changed, 45 insertions(+), 36 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a34032b0f0afcc6b0d8d…
1
0
0
0
Jacek Caban : win32u: Move NtUserSetWindowRgn implementation from user32.
by Alexandre Julliard
10 Mar '22
10 Mar '22
Module: wine Branch: master Commit: b308b9cb31716ffb60605fdc3edf8a7023abba64 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b308b9cb31716ffb60605fdc…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Mar 10 14:31:41 2022 +0100 win32u: Move NtUserSetWindowRgn implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/driver.c | 12 +------- dlls/user32/user32.spec | 2 +- dlls/user32/user_main.c | 1 + dlls/user32/winpos.c | 55 ------------------------------------- dlls/win32u/driver.c | 6 ++++ dlls/win32u/gdiobj.c | 2 ++ dlls/win32u/ntuser_private.h | 1 + dlls/win32u/win32u.spec | 4 +-- dlls/win32u/win32u_private.h | 2 ++ dlls/win32u/window.c | 65 ++++++++++++++++++++++++++++++++++++++++++++ dlls/win32u/wrappers.c | 12 ++++++++ include/ntuser.h | 2 ++ 12 files changed, 95 insertions(+), 69 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=b308b9cb31716ffb6060…
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
...
114
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
Results per page:
10
25
50
100
200