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 2021
----- 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
1030 discussions
Start a n
N
ew thread
Rémi Bernon : winexinput.sys: Translate lower reports into XInput HID reports.
by Alexandre Julliard
10 Sep '21
10 Sep '21
Module: wine Branch: master Commit: 2eea1d615ae7e74282fe19e015ecadd10b4be9ee URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2eea1d615ae7e74282fe19e0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 10 09:08:21 2021 +0200 winexinput.sys: Translate lower reports into XInput HID reports. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winexinput.sys/main.c | 188 +++++++++++++++++++++++++++++++++-- dlls/winexinput.sys/pop_hid_macros.h | 83 ++++++++++++++++ dlls/winexinput.sys/psh_hid_macros.h | 85 ++++++++++++++++ dlls/xinput1_3/tests/xinput.c | 25 ----- 4 files changed, 349 insertions(+), 32 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=2eea1d615ae7e74282fe…
1
0
0
0
Rémi Bernon : winexinput.sys: Look for caps in the lower HID report descriptor.
by Alexandre Julliard
10 Sep '21
10 Sep '21
Module: wine Branch: master Commit: b027f70a91421c01ee6ce4cee3572c0615f99506 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b027f70a91421c01ee6ce4ce…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 10 09:08:20 2021 +0200 winexinput.sys: Look for caps in the lower HID report descriptor. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winexinput.sys/main.c | 69 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 7 deletions(-) diff --git a/dlls/winexinput.sys/main.c b/dlls/winexinput.sys/main.c index 60f7a8ed5dd..dfe747d6515 100644 --- a/dlls/winexinput.sys/main.c +++ b/dlls/winexinput.sys/main.c @@ -82,6 +82,14 @@ struct func_device WCHAR instance_id[MAX_DEVICE_ID_LEN]; + HIDP_VALUE_CAPS lx_caps; + HIDP_VALUE_CAPS ly_caps; + HIDP_VALUE_CAPS lt_caps; + HIDP_VALUE_CAPS rx_caps; + HIDP_VALUE_CAPS ry_caps; + HIDP_VALUE_CAPS rt_caps; + HIDP_DEVICE_DESC device_desc; + /* everything below requires holding the cs */ CRITICAL_SECTION cs; ULONG report_len; @@ -442,13 +450,27 @@ static NTSTATUS sync_ioctl(DEVICE_OBJECT *device, DWORD code, void *in_buf, DWOR return io.Status; } +static void check_value_caps(struct func_device *fdo, USHORT usage, HIDP_VALUE_CAPS *caps) +{ + switch (usage) + { + case HID_USAGE_GENERIC_X: fdo->lx_caps = *caps; break; + case HID_USAGE_GENERIC_Y: fdo->ly_caps = *caps; break; + case HID_USAGE_GENERIC_Z: fdo->lt_caps = *caps; break; + case HID_USAGE_GENERIC_RX: fdo->rx_caps = *caps; break; + case HID_USAGE_GENERIC_RY: fdo->ry_caps = *caps; break; + case HID_USAGE_GENERIC_RZ: fdo->rt_caps = *caps; break; + } +} + static NTSTATUS initialize_device(DEVICE_OBJECT *device) { struct func_device *fdo = fdo_from_DEVICE_OBJECT(device); - ULONG i, report_desc_len, report_count; + ULONG i, u, button_count, report_desc_len, report_count; PHIDP_REPORT_DESCRIPTOR report_desc; PHIDP_PREPARSED_DATA preparsed; - HIDP_DEVICE_DESC device_desc; + HIDP_BUTTON_CAPS *button_caps; + HIDP_VALUE_CAPS *value_caps; HIDP_REPORT_IDS *reports; HID_DESCRIPTOR hid_desc; NTSTATUS status; @@ -461,16 +483,49 @@ static NTSTATUS initialize_device(DEVICE_OBJECT *device) if (!(report_desc = malloc(report_desc_len))) return STATUS_NO_MEMORY; status = sync_ioctl(fdo->bus_device, IOCTL_HID_GET_REPORT_DESCRIPTOR, NULL, 0, report_desc, report_desc_len); - if (!status) status = HidP_GetCollectionDescription(report_desc, report_desc_len, PagedPool, &device_desc); + if (!status) status = HidP_GetCollectionDescription(report_desc, report_desc_len, PagedPool, &fdo->device_desc); free(report_desc); if (status != HIDP_STATUS_SUCCESS) return status; - preparsed = device_desc.CollectionDesc->PreparsedData; + preparsed = fdo->device_desc.CollectionDesc->PreparsedData; status = HidP_GetCaps(preparsed, &caps); if (status != HIDP_STATUS_SUCCESS) return status; - reports = device_desc.ReportIDs; - report_count = device_desc.ReportIDsLength; + button_count = 0; + if (!(button_caps = malloc(sizeof(*button_caps) * caps.NumberInputButtonCaps))) return STATUS_NO_MEMORY; + status = HidP_GetButtonCaps(HidP_Input, button_caps, &caps.NumberInputButtonCaps, preparsed); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetButtonCaps returned %#x\n", status); + else for (i = 0; i < caps.NumberInputButtonCaps; i++) + { + if (button_caps[i].UsagePage != HID_USAGE_PAGE_BUTTON) continue; + if (button_caps[i].IsRange) button_count = max(button_count, button_caps[i].Range.UsageMax); + else button_count = max(button_count, button_caps[i].NotRange.Usage); + } + free(button_caps); + if (status != HIDP_STATUS_SUCCESS) return status; + if (button_count < 10) WARN("only %u buttons found\n", button_count); + + if (!(value_caps = malloc(sizeof(*value_caps) * caps.NumberInputValueCaps))) return STATUS_NO_MEMORY; + status = HidP_GetValueCaps(HidP_Input, value_caps, &caps.NumberInputValueCaps, preparsed); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetValueCaps returned %#x\n", status); + else for (i = 0; i < caps.NumberInputValueCaps; i++) + { + HIDP_VALUE_CAPS *caps = value_caps + i; + if (caps->UsagePage != HID_USAGE_PAGE_GENERIC) continue; + if (!caps->IsRange) check_value_caps(fdo, caps->NotRange.Usage, caps); + else for (u = caps->Range.UsageMin; u <=caps->Range.UsageMax; u++) check_value_caps(fdo, u, value_caps + i); + } + free(value_caps); + if (status != HIDP_STATUS_SUCCESS) return status; + if (!fdo->lx_caps.UsagePage) WARN("missing lx axis\n"); + if (!fdo->ly_caps.UsagePage) WARN("missing ly axis\n"); + if (!fdo->lt_caps.UsagePage) WARN("missing lt axis\n"); + if (!fdo->rx_caps.UsagePage) WARN("missing rx axis\n"); + if (!fdo->ry_caps.UsagePage) WARN("missing ry axis\n"); + if (!fdo->rt_caps.UsagePage) WARN("missing rt axis\n"); + + reports = fdo->device_desc.ReportIDs; + report_count = fdo->device_desc.ReportIDsLength; for (i = 0; i < report_count; ++i) if (!reports[i].ReportID || reports[i].InputLength) break; if (i == report_count) i = 0; /* no input report?!, just use first ID */ @@ -478,7 +533,6 @@ static NTSTATUS initialize_device(DEVICE_OBJECT *device) if (!(fdo->report_buf = malloc(fdo->report_len))) return STATUS_NO_MEMORY; fdo->report_buf[0] = reports[i].ReportID; - HidP_FreeCollectionDescription(&device_desc); return STATUS_SUCCESS; } @@ -556,6 +610,7 @@ static NTSTATUS WINAPI fdo_pnp(DEVICE_OBJECT *device, IRP *irp) status = IoCallDriver(fdo->bus_device, irp); IoDetachDevice(fdo->bus_device); RtlDeleteCriticalSection(&fdo->cs); + HidP_FreeCollectionDescription(&fdo->device_desc); free(fdo->report_buf); IoDeleteDevice(device); return status;
1
0
0
0
Dmitry Timoshkov : wininet: Add handling for remaining special errors to InternetErrorDlg.
by Alexandre Julliard
10 Sep '21
10 Sep '21
Module: wine Branch: master Commit: 03236a391aa5e4b34367bdba6d5d7dad6d05ef6f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=03236a391aa5e4b34367bdba…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri Sep 10 16:01:12 2021 +0200 wininet: Add handling for remaining special errors to InternetErrorDlg. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wininet/dialogs.c | 48 +++++++++++++++++++++++++++++++++++++++++-- dlls/wininet/tests/internet.c | 40 +++++------------------------------- 2 files changed, 51 insertions(+), 37 deletions(-) diff --git a/dlls/wininet/dialogs.c b/dlls/wininet/dialogs.c index 25ed1f2a651..a48c75865ac 100644 --- a/dlls/wininet/dialogs.c +++ b/dlls/wininet/dialogs.c @@ -514,11 +514,17 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest, } break; } + + case ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED: + if(!req) + return ERROR_INVALID_PARAMETER; + /* fall through */ case ERROR_INTERNET_SEC_CERT_ERRORS: case ERROR_INTERNET_SEC_CERT_CN_INVALID: case ERROR_INTERNET_SEC_CERT_DATE_INVALID: case ERROR_INTERNET_INVALID_CA: case ERROR_INTERNET_SEC_CERT_REV_FAILED: + case ERROR_INTERNET_SEC_CERT_WEAK_SIGNATURE: if( dwFlags & FLAGS_ERROR_UI_FLAGS_NO_UI ) { res = ERROR_CANCELLED; break; @@ -530,13 +536,51 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest, res = DialogBoxParamW( WININET_hModule, MAKEINTRESOURCEW( IDD_INVCERTDLG ), hWnd, WININET_InvalidCertificateDialog, (LPARAM) ¶ms ); break; + + case ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION: + if(dwFlags & FLAGS_ERROR_UI_FLAGS_NO_UI) { + res = ERROR_HTTP_COOKIE_DECLINED; + break; + } + FIXME("Need to display dialog for error %d\n", dwError); + res = ERROR_CANCELLED; + break; + + case ERROR_INTERNET_INSERT_CDROM: + if(!req) + return ERROR_INVALID_PARAMETER; + /* fall through */ + case ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION: + case ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT: + case ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT: + case ERROR_INTERNET_MIXED_SECURITY: + case ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR: + if(!(dwFlags & FLAGS_ERROR_UI_FLAGS_NO_UI)) + FIXME("Need to display dialog for error %d\n", dwError); + res = ERROR_CANCELLED; + break; + + case ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR: + case ERROR_INTERNET_CHG_POST_IS_NON_SECURE: + if(dwFlags & FLAGS_ERROR_UI_FLAGS_NO_UI) { + res = ERROR_SUCCESS; + break; + } + FIXME("Need to display dialog for error %d\n", dwError); + res = ERROR_CANCELLED; + break; + case ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR: case ERROR_INTERNET_POST_IS_NON_SECURE: - FIXME("Need to display dialog for error %d\n", dwError); + if (!(dwFlags & FLAGS_ERROR_UI_FLAGS_NO_UI)) + FIXME("Need to display dialog for error %d\n", dwError); res = ERROR_SUCCESS; break; + default: - res = ERROR_CANCELLED; + if(!(dwFlags & FLAGS_ERROR_UI_FILTER_FOR_ERRORS)) + res = ERROR_CANCELLED; + break; } if(req) diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index e83b142e998..8513aabe174 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -1566,29 +1566,14 @@ static void test_InternetErrorDlg(void) break; } - todo_wine_if(i == ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION || - i == ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR || - i == ERROR_INTERNET_CHG_POST_IS_NON_SECURE) - ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i); + ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i); /* Same thing with NULL hwnd */ res = InternetErrorDlg(NULL, req, i, FLAGS_ERROR_UI_FLAGS_NO_UI, NULL); - todo_wine_if(i == ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION || - i == ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR || - i == ERROR_INTERNET_CHG_POST_IS_NON_SECURE) - ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i); + ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i); res = InternetErrorDlg(NULL, req, i, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL); - todo_wine_if(i != ERROR_INTERNET_INCORRECT_PASSWORD && i != ERROR_INTERNET_SEC_CERT_DATE_INVALID && - i != ERROR_INTERNET_SEC_CERT_CN_INVALID && i != ERROR_INTERNET_INVALID_CA && - i != ERROR_INTERNET_SEC_CERT_ERRORS && i != ERROR_INTERNET_SEC_CERT_REV_FAILED && - i != ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR && i != ERROR_INTERNET_POST_IS_NON_SECURE && - i != ERROR_INTERNET_MIXED_SECURITY && - i != ERROR_INTERNET_POST_IS_NON_SECURE && i != ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED && - i != ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR && i != ERROR_INTERNET_INSERT_CDROM && - i != ERROR_INTERNET_SEC_CERT_WEAK_SIGNATURE && i != ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT && - i != ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT && i != ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION) - ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i); + ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i); /* With a null req */ if(test_flags & FLAG_NEEDREQ) @@ -1598,31 +1583,16 @@ static void test_InternetErrorDlg(void) } res = InternetErrorDlg(hwnd, NULL, i, FLAGS_ERROR_UI_FLAGS_NO_UI, NULL); - todo_wine_if(i == ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION || - i == ERROR_INTERNET_INSERT_CDROM || - i == ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED || - i == ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR || - i == ERROR_INTERNET_CHG_POST_IS_NON_SECURE) - ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i); + ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i); res = InternetErrorDlg(NULL, NULL, i, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL); - todo_wine_if(i != ERROR_INTERNET_SEC_CERT_DATE_INVALID && i != ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR && - i != ERROR_INTERNET_SEC_CERT_CN_INVALID && i != ERROR_INTERNET_INVALID_CA && - i != ERROR_INTERNET_SEC_CERT_ERRORS && i != ERROR_INTERNET_SEC_CERT_REV_FAILED && - i != ERROR_INTERNET_MIXED_SECURITY && i != ERROR_INTERNET_POST_IS_NON_SECURE && - i != ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR && i != ERROR_INTERNET_INCORRECT_PASSWORD && - i != ERROR_INTERNET_SEC_CERT_WEAK_SIGNATURE && i != ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT && - i != ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT && - i != ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION) - ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i); + ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i); } res = InternetErrorDlg(NULL, req, 0xdeadbeef, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL); -todo_wine ok(res == ERROR_SUCCESS, "Got %d, expected ERROR_SUCCESS\n", res); res = InternetErrorDlg(NULL, NULL, 0xdeadbeef, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL); -todo_wine ok(res == ERROR_SUCCESS, "Got %d, expected ERROR_SUCCESS\n", res); res = InternetCloseHandle(req);
1
0
0
0
Jacek Caban : gdi32: Remove no longer needed metafile special case from NtGdiExtTextOutW.
by Alexandre Julliard
10 Sep '21
10 Sep '21
Module: wine Branch: master Commit: 5e012f7bec0947a9e047d79d1b7bc7c42bdbab91 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5e012f7bec0947a9e047d79d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 10 14:28:44 2021 +0200 gdi32: Remove no longer needed metafile special case from NtGdiExtTextOutW. 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/gdi32/font.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 5758a999561..21cfe9ecb0b 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5020,7 +5020,6 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr SIZE sz; RECT rc; POINT *deltas = NULL, width = {0, 0}; - DWORD type; DC * dc = get_dc_ptr( hdc ); PHYSDEV physdev; INT breakRem; @@ -5041,13 +5040,6 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr update_dc( dc ); physdev = GET_DC_PHYSDEV( dc, pExtTextOut ); - type = GetObjectType(hdc); - if(type == OBJ_METADC || type == OBJ_ENHMETADC) - { - ret = physdev->funcs->pExtTextOut( physdev, x, y, flags, lprect, str, count, lpDx ); - release_dc_ptr( dc ); - return ret; - } if (flags & ETO_RTLREADING) align |= TA_RTLREADING; if (layout & LAYOUT_RTL)
1
0
0
0
Jacek Caban : gdi32: Directly use ntgdi functions in font.c.
by Alexandre Julliard
10 Sep '21
10 Sep '21
Module: wine Branch: master Commit: a8131cb3e709eeab34f1f4e2b078f1935a921e66 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a8131cb3e709eeab34f1f4e2…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 10 14:28:30 2021 +0200 gdi32: Directly use ntgdi functions in font.c. 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/gdi32/font.c | 51 +++++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index d32e8b8fe40..5758a999561 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3760,9 +3760,9 @@ static HFONT CDECL font_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) { LOGFONTW lf; FMAT2 dcmat; - BOOL can_use_bitmap = !!(GetDeviceCaps( dc->hSelf, TEXTCAPS ) & TC_RA_ABLE); + BOOL can_use_bitmap = !!(NtGdiGetDeviceCaps( dc->hSelf, TEXTCAPS ) & TC_RA_ABLE); - GetObjectW( hfont, sizeof(lf), &lf ); + NtGdiExtGetObjectW( hfont, sizeof(lf), &lf ); switch (lf.lfQuality) { case NONANTIALIASED_QUALITY: @@ -4218,7 +4218,7 @@ static void update_font_code_page( DC *dc, HANDLE font ) { LOGFONTW lf; - GetObjectW( font, sizeof(lf), &lf ); + NtGdiExtGetObjectW( font, sizeof(lf), &lf ); if (!(lf.lfClipPrecision & CLIP_DFA_DISABLE)) charset = DEFAULT_CHARSET; } @@ -4515,8 +4515,8 @@ BOOL WINAPI NtGdiGetTextMetricsW( HDC hdc, TEXTMETRICW *metrics, ULONG flags ) /* device layer returns values in device units * therefore we have to convert them to logical */ - metrics->tmDigitizedAspectX = GetDeviceCaps(hdc, LOGPIXELSX); - metrics->tmDigitizedAspectY = GetDeviceCaps(hdc, LOGPIXELSY); + metrics->tmDigitizedAspectX = NtGdiGetDeviceCaps(hdc, LOGPIXELSX); + metrics->tmDigitizedAspectY = NtGdiGetDeviceCaps(hdc, LOGPIXELSY); metrics->tmHeight = height_to_LP( dc, metrics->tmHeight ); metrics->tmAscent = height_to_LP( dc, metrics->tmAscent ); metrics->tmDescent = height_to_LP( dc, metrics->tmDescent ); @@ -4578,8 +4578,8 @@ UINT WINAPI NtGdiGetOutlineTextMetricsInternalW( HDC hdc, UINT cbData, if (lpOTM && ret) { - output->otmTextMetrics.tmDigitizedAspectX = GetDeviceCaps(hdc, LOGPIXELSX); - output->otmTextMetrics.tmDigitizedAspectY = GetDeviceCaps(hdc, LOGPIXELSY); + output->otmTextMetrics.tmDigitizedAspectX = NtGdiGetDeviceCaps(hdc, LOGPIXELSX); + output->otmTextMetrics.tmDigitizedAspectY = NtGdiGetDeviceCaps(hdc, LOGPIXELSY); output->otmTextMetrics.tmHeight = height_to_LP( dc, output->otmTextMetrics.tmHeight ); output->otmTextMetrics.tmAscent = height_to_LP( dc, output->otmTextMetrics.tmAscent ); output->otmTextMetrics.tmDescent = height_to_LP( dc, output->otmTextMetrics.tmDescent ); @@ -4700,7 +4700,7 @@ static DWORD get_glyph_bitmap( HDC hdc, UINT index, UINT flags, UINT aa_flags, for (i = 0; i < ARRAY_SIZE( indices ); i++) { index = indices[i]; - ret = GetGlyphOutlineW( hdc, index, aa_flags, metrics, 0, NULL, &identity ); + ret = NtGdiGetGlyphOutline( hdc, index, aa_flags, metrics, 0, NULL, &identity, FALSE ); if (ret != GDI_ERROR) break; } @@ -4722,7 +4722,8 @@ static DWORD get_glyph_bitmap( HDC hdc, UINT index, UINT flags, UINT aa_flags, image->is_copy = TRUE; image->free = free_heap_bits; - ret = GetGlyphOutlineW( hdc, index, aa_flags, metrics, size, image->ptr, &identity ); + ret = NtGdiGetGlyphOutline( hdc, index, aa_flags, metrics, size, image->ptr, + &identity, FALSE ); if (ret == GDI_ERROR) { HeapFree( GetProcessHeap(), 0, image->ptr ); @@ -4811,7 +4812,11 @@ static void draw_glyph( DC *dc, INT origin_x, INT origin_y, const GLYPHMETRICS * } assert( count <= max_count ); dp_to_lp( dc, pts, count ); - for (i = 0; i < count; i += 2) Polyline( dc->hSelf, pts + i, 2 ); + for (i = 0; i < count; i += 2) + { + const UINT pts_count = 2; + NtGdiPolyPolyDraw( dc->hSelf, pts + i, &pts_count, 1, NtGdiPolyPolyline ); + } HeapFree( GetProcessHeap(), 0, pts ); } @@ -4830,7 +4835,8 @@ BOOL CDECL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT if (flags & ETO_OPAQUE) { RECT rc = *rect; - HBRUSH brush = CreateSolidBrush( NtGdiGetNearestColor( dev->hdc, dc->attr->background_color )); + COLORREF brush_color = NtGdiGetNearestColor( dev->hdc, dc->attr->background_color ); + HBRUSH brush = NtGdiCreateSolidBrush( brush_color, NULL); if (brush) { @@ -4922,7 +4928,7 @@ BOOL CDECL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT } } - pen = CreatePen( PS_SOLID, 1, dc->attr->text_color ); + pen = NtGdiCreatePen( PS_SOLID, 1, dc->attr->text_color, NULL ); orig = NtGdiSelectPen( dev->hdc, pen ); for (i = 0; i < count; i++) @@ -5062,8 +5068,8 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr y = pt.y; } - GetTextMetricsW(hdc, &tm); - GetObjectW(dc->hFont, sizeof(lf), &lf); + NtGdiGetTextMetricsW( hdc, &tm, 0 ); + NtGdiExtGetObjectW( dc->hFont, sizeof(lf), &lf ); if(!(tm.tmPitchAndFamily & TMPF_VECTOR)) /* Non-scalable fonts shouldn't be rotated */ lf.lfEscapement = 0; @@ -5107,8 +5113,8 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr x = pt.x; y = pt.y; - char_extra = GetTextCharacterExtra(hdc); - if (char_extra && lpDx && GetDeviceCaps( hdc, TECHNOLOGY ) == DT_RASPRINTER) + char_extra = dc->attr->char_extra; + if (char_extra && lpDx && NtGdiGetDeviceCaps( hdc, TECHNOLOGY ) == DT_RASPRINTER) char_extra = 0; /* Printer drivers don't add char_extra if lpDx is supplied */ if(char_extra || dc->breakExtra || breakRem || lpDx || lf.lfEscapement != 0) @@ -5185,10 +5191,7 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr { POINT desired[2]; - if(flags & ETO_GLYPH_INDEX) - GetTextExtentPointI(hdc, str, count, &sz); - else - GetTextExtentPointW(hdc, str, count, &sz); + NtGdiGetTextExtentExW( hdc, str, count, 0, NULL, NULL, &sz, !!(flags & ETO_GLYPH_INDEX) ); desired[0].x = desired[0].y = 0; desired[1].x = sz.cx; desired[1].y = 0; @@ -5216,7 +5219,7 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr pt.x = x + width.x; pt.y = y + width.y; dp_to_lp(dc, &pt, 1); - MoveToEx(hdc, pt.x, pt.y, NULL); + NtGdiMoveTo( hdc, pt.x, pt.y, NULL ); } break; @@ -5233,7 +5236,7 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr pt.x = x; pt.y = y; dp_to_lp(dc, &pt, 1); - MoveToEx(hdc, pt.x, pt.y, NULL); + NtGdiMoveTo( hdc, pt.x, pt.y, NULL ); } break; } @@ -5289,7 +5292,7 @@ done: OUTLINETEXTMETRICW* otm = NULL; POINT pts[5]; HPEN hpen = NtGdiSelectPen( hdc, get_stock_object(NULL_PEN) ); - HBRUSH hbrush = CreateSolidBrush( dc->attr->text_color ); + HBRUSH hbrush = NtGdiCreateSolidBrush( dc->attr->text_color, NULL ); hbrush = NtGdiSelectBrush(hdc, hbrush); @@ -5821,7 +5824,7 @@ static BOOL CALLBACK load_enumed_resource(HMODULE hModule, LPCWSTR type, LPWSTR DWORD num_in_res; TRACE("Found resource %s - trying to load\n", wine_dbgstr_w(type)); - if (!AddFontMemResourceEx(pMem, SizeofResource(hModule, rsrc), NULL, &num_in_res)) + if (!NtGdiAddFontMemResourceEx( pMem, SizeofResource(hModule, rsrc), NULL, 0, &num_in_res )) { ERR("Failed to load PE font resource mod=%p ptr=%p\n", hModule, hMem); return FALSE;
1
0
0
0
Jacek Caban : gdi32: Fix some ntgdi names.
by Alexandre Julliard
10 Sep '21
10 Sep '21
Module: wine Branch: master Commit: d2d81327346f6d9e21c5baa89c75a08dbce140f0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d2d81327346f6d9e21c5baa8…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 10 14:28:04 2021 +0200 gdi32: Fix some ntgdi names. 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/gdi32/brush.c | 4 ++-- dlls/gdi32/font.c | 12 ++++++------ dlls/gdi32/gdi32.spec | 2 +- dlls/gdi32/objects.c | 2 +- dlls/gdi32/text.c | 12 ++++++------ include/ntgdi.h | 14 +++++++++----- 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/dlls/gdi32/brush.c b/dlls/gdi32/brush.c index 8ef902f60b9..f31dab0fdd4 100644 --- a/dlls/gdi32/brush.c +++ b/dlls/gdi32/brush.c @@ -207,11 +207,11 @@ HBRUSH create_brush( const LOGBRUSH *brush ) /*********************************************************************** - * NtGdiCreateHatchBrush (win32u.@) + * NtGdiCreateHatchBrushInternal (win32u.@) * * Create a logical brush with a hatched pattern. */ -HBRUSH WINAPI NtGdiCreateHatchBrush( INT style, COLORREF color, BOOL pen ) +HBRUSH WINAPI NtGdiCreateHatchBrushInternal( INT style, COLORREF color, BOOL pen ) { LOGBRUSH logbrush; diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index d642b474ded..d32e8b8fe40 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5447,11 +5447,11 @@ BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars /*********************************************************************** - * NtGdiGetGlyphOutlineW (win32u.@) + * NtGdiGetGlyphOutline (win32u.@) */ -DWORD WINAPI NtGdiGetGlyphOutlineW( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics, - DWORD size, void *buffer, const MAT2 *mat2, - BOOL ignore_rotation ) +DWORD WINAPI NtGdiGetGlyphOutline( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics, + DWORD size, void *buffer, const MAT2 *mat2, + BOOL ignore_rotation ) { DC *dc; DWORD ret; @@ -5732,9 +5732,9 @@ done: } /************************************************************************* - * NtGdiGetKerningPairsW (win32u.@) + * NtGdiGetKerningPairs (win32u.@) */ -DWORD WINAPI NtGdiGetKerningPairsW( HDC hdc, DWORD count, KERNINGPAIR *kern_pair ) +DWORD WINAPI NtGdiGetKerningPairs( HDC hdc, DWORD count, KERNINGPAIR *kern_pair ) { DC *dc; DWORD ret; diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index da37f8ba643..81a4dd5d1e9 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -309,7 +309,7 @@ @ stdcall GetICMProfileW(long ptr ptr) @ stdcall GetKerningPairs(long long ptr) GetKerningPairsA @ stdcall GetKerningPairsA(long long ptr) -@ stdcall GetKerningPairsW(long long ptr) NtGdiGetKerningPairsW +@ stdcall GetKerningPairsW(long long ptr) NtGdiGetKerningPairs @ stdcall GetLayout(long) @ stdcall GetLogColorSpaceA(long ptr long) @ stdcall GetLogColorSpaceW(long ptr long) diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c index 97b0fec5ecf..7f6893f0952 100644 --- a/dlls/gdi32/objects.c +++ b/dlls/gdi32/objects.c @@ -546,7 +546,7 @@ HBRUSH WINAPI CreateSolidBrush( COLORREF color ) */ HBRUSH WINAPI CreateHatchBrush( INT style, COLORREF color ) { - return NtGdiCreateHatchBrush( style, color, FALSE ); + return NtGdiCreateHatchBrushInternal( style, color, FALSE ); } /*********************************************************************** diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index c54dfac0a42..4037eaa4b65 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1083,7 +1083,7 @@ static int *kern_string( HDC hdc, const WCHAR *str, int len, int *kern_total ) ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(*ret) ); if (!ret) return NULL; - count = NtGdiGetKerningPairsW( hdc, 0, NULL ); + count = NtGdiGetKerningPairs( hdc, 0, NULL ); if (count) { kern = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*kern) ); @@ -1093,7 +1093,7 @@ static int *kern_string( HDC hdc, const WCHAR *str, int len, int *kern_total ) return NULL; } - NtGdiGetKerningPairsW( hdc, count, kern ); + NtGdiGetKerningPairs( hdc, count, kern ); } for (i = 0; i < len - 1; i++) @@ -1818,7 +1818,7 @@ DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metr DWORD WINAPI GetGlyphOutlineW( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics, DWORD size, void *buffer, const MAT2 *mat2 ) { - return NtGdiGetGlyphOutlineW( hdc, ch, format, metrics, size, buffer, mat2, FALSE ); + return NtGdiGetGlyphOutline( hdc, ch, format, metrics, size, buffer, mat2, FALSE ); } /************************************************************************* @@ -1849,11 +1849,11 @@ DWORD WINAPI GetKerningPairsA( HDC hdc, DWORD count, KERNINGPAIR *kern_pairA ) return 0; } - total_kern_pairs = NtGdiGetKerningPairsW( hdc, 0, NULL ); + total_kern_pairs = NtGdiGetKerningPairs( hdc, 0, NULL ); if (!total_kern_pairs) return 0; kern_pairW = HeapAlloc( GetProcessHeap(), 0, total_kern_pairs * sizeof(*kern_pairW) ); - NtGdiGetKerningPairsW( hdc, total_kern_pairs, kern_pairW ); + NtGdiGetKerningPairs( hdc, total_kern_pairs, kern_pairW ); for (i = 0; i < total_kern_pairs; i++) { @@ -1922,7 +1922,7 @@ DWORD WINAPI GetFontLanguageInfo( HDC hdc ) if (fontsig.fsCsb[0] & GCP_LIGATE_MASK) result |= GCP_LIGATE; - if (NtGdiGetKerningPairsW( hdc, 0, NULL )) + if (NtGdiGetKerningPairs( hdc, 0, NULL )) result |= GCP_USEKERNING; /* this might need a test for a HEBREW- or ARABIC_CHARSET as well */ diff --git a/include/ntgdi.h b/include/ntgdi.h index 4ee02942346..365935e40c4 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -255,7 +255,7 @@ HDC WINAPI NtGdiCreateCompatibleDC( HDC hdc ); HBRUSH WINAPI NtGdiCreateDIBBrush( const void *data, UINT coloruse, UINT size, BOOL is_8x8, BOOL pen, const void *client ); HRGN WINAPI NtGdiCreateEllipticRgn( INT left, INT top, INT right, INT bottom ); -HBRUSH WINAPI NtGdiCreateHatchBrush( INT style, COLORREF color, BOOL pen ); +HBRUSH WINAPI NtGdiCreateHatchBrushInternal( INT style, COLORREF color, BOOL pen ); HBRUSH WINAPI NtGdiCreatePatternBrushInternal( HBITMAP hbitmap, BOOL pen, BOOL is_8x8 ); HPEN WINAPI NtGdiCreatePen( INT style, INT width, COLORREF color, HBRUSH brush ); HRGN WINAPI NtGdiCreateRectRgn( INT left, INT top, INT right, INT bottom ); @@ -264,6 +264,8 @@ HRGN WINAPI NtGdiCreateRoundRectRgn( INT left, INT top, INT right, INT botto HBRUSH WINAPI NtGdiCreateSolidBrush( COLORREF color, HBRUSH brush ); BOOL WINAPI NtGdiDeleteClientObj( HGDIOBJ obj ); BOOL WINAPI NtGdiDeleteObjectApp( HGDIOBJ obj ); +INT WINAPI NtGdiDescribePixelFormat( HDC hdc, INT format, UINT size, + PIXELFORMATDESCRIPTOR *descr ); LONG WINAPI NtGdiDoPalette( HGDIOBJ handle, WORD start, WORD count, void *entries, DWORD func, BOOL inbound ); INT WINAPI NtGdiEndPage( HDC hdc ); @@ -288,6 +290,7 @@ BOOL WINAPI NtGdiFrameRgn( HDC hdc, HRGN hrgn, HBRUSH brush, BOOL WINAPI NtGdiFillPath( HDC hdc ); BOOL WINAPI NtGdiGetAndSetDCDword( HDC hdc, UINT method, DWORD value, DWORD *result ); INT WINAPI NtGdiGetAppClipBox( HDC hdc, RECT *rect ); +LONG WINAPI NtGdiGetBitmapBits( HBITMAP bitmap, LONG count, void *bits ); BOOL WINAPI NtGdiGetBitmapDimension( HBITMAP bitmap, SIZE *size ); UINT WINAPI NtGdiGetBoundsRect( HDC hdc, RECT *rect, UINT flags ); BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars, @@ -312,10 +315,10 @@ BOOL WINAPI NtGdiGetFontFileInfo( DWORD instance_id, DWORD file_index, struc DWORD WINAPI NtGdiGetFontUnicodeRanges( HDC hdc, GLYPHSET *lpgs ); DWORD WINAPI NtGdiGetGlyphIndicesW( HDC hdc, const WCHAR *str, INT count, WORD *indices, DWORD flags ); -DWORD WINAPI NtGdiGetGlyphOutlineW( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics, - DWORD size, void *buffer, const MAT2 *mat2, - BOOL ignore_rotation ); -DWORD WINAPI NtGdiGetKerningPairsW( HDC hdc, DWORD count, KERNINGPAIR *kern_pair ); +DWORD WINAPI NtGdiGetGlyphOutline( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics, + DWORD size, void *buffer, const MAT2 *mat2, + BOOL ignore_rotation ); +DWORD WINAPI NtGdiGetKerningPairs( HDC hdc, DWORD count, KERNINGPAIR *kern_pair ); BOOL WINAPI NtGdiGetMiterLimit( HDC hdc, FLOAT *limit ); COLORREF WINAPI NtGdiGetNearestColor( HDC hdc, COLORREF color ); UINT WINAPI NtGdiGetNearestPaletteIndex( HPALETTE hpalette, COLORREF color ); @@ -417,6 +420,7 @@ INT WINAPI NtGdiStretchDIBitsInternal( HDC hdc, INT x_dst, INT y_dst, INT w HANDLE xform ); BOOL WINAPI NtGdiStrokePath( HDC hdc ); BOOL WINAPI NtGdiStrokeAndFillPath( HDC hdc ); +BOOL WINAPI NtGdiSwapBuffers( HDC hdc ); BOOL WINAPI NtGdiTransparentBlt( HDC hdc, int x_dst, int y_dst, int width_dst, int height_dst, HDC hdc_src, int x_src, int y_src, int width_src, int height_src, UINT color );
1
0
0
0
Jacek Caban : gdi32/tests: Add GdiTransparentBlt tests.
by Alexandre Julliard
10 Sep '21
10 Sep '21
Module: wine Branch: master Commit: 33ecaf357e70c887e8bd6b6b6fdb5e76a35e61a5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=33ecaf357e70c887e8bd6b6b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 10 14:27:48 2021 +0200 gdi32/tests: Add GdiTransparentBlt tests. 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/gdi32/tests/metafile.c | 254 ++++++++++++++++++++++++-------------------- 1 file changed, 140 insertions(+), 114 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=33ecaf357e70c887e8bd…
1
0
0
0
Jacek Caban : gdi32: Use EMR_TRANSPARENTBLT to record GetTransparentBlt.
by Alexandre Julliard
10 Sep '21
10 Sep '21
Module: wine Branch: master Commit: 953a2190048e56866be5dc7af3711635ed7b9e08 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=953a2190048e56866be5dc7a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 10 14:27:39 2021 +0200 gdi32: Use EMR_TRANSPARENTBLT to record GetTransparentBlt. And use NtGdiTransparentBlt. 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/gdi32/bitblt.c | 44 +++++++++++++++++++++++++------------------- dlls/gdi32/emfdc.c | 11 ++++++++++- dlls/gdi32/gdi_private.h | 3 +++ dlls/gdi32/gdidc.c | 17 +++++++++++++++++ include/ntgdi.h | 3 +++ 5 files changed, 58 insertions(+), 20 deletions(-) diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c index 33ce6966f87..cff84bc1dce 100644 --- a/dlls/gdi32/bitblt.c +++ b/dlls/gdi32/bitblt.c @@ -835,11 +835,11 @@ BOOL WINAPI NtGdiMaskBlt( HDC hdcDest, INT nXDest, INT nYDest, INT nWidth, INT n } /****************************************************************************** - * GdiTransparentBlt [GDI32.@] + * NtGdiTransparentBlt (win32u.@) */ -BOOL WINAPI GdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest, int heightDest, - HDC hdcSrc, int xSrc, int ySrc, int widthSrc, int heightSrc, - UINT crTransparent ) +BOOL WINAPI NtGdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest, int heightDest, + HDC hdcSrc, int xSrc, int ySrc, int widthSrc, int heightSrc, + UINT crTransparent ) { BOOL ret = FALSE; HDC hdcWork; @@ -858,8 +858,8 @@ BOOL WINAPI GdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest, return FALSE; } - oldBackground = SetBkColor(hdcDest, RGB(255,255,255)); - oldForeground = SetTextColor(hdcDest, RGB(0,0,0)); + NtGdiGetAndSetDCDword( hdcDest, NtGdiSetBkColor, RGB(255,255,255), &oldBackground ); + NtGdiGetAndSetDCDword( hdcDest, NtGdiSetTextColor, RGB(0,0,0), &oldForeground ); /* Stretch bitmap */ oldStretchMode = GetStretchBltMode(hdcSrc); @@ -867,9 +867,9 @@ BOOL WINAPI GdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest, SetStretchBltMode(hdcSrc, COLORONCOLOR); hdcWork = NtGdiCreateCompatibleDC( hdcDest ); if ((GetObjectType( hdcDest ) != OBJ_MEMDC || - GetObjectW( NtGdiGetDCObject( hdcDest, NTGDI_OBJ_SURF ), - sizeof(dib), &dib ) == sizeof(BITMAP)) && - GetDeviceCaps( hdcDest, BITSPIXEL ) == 32) + NtGdiExtGetObjectW( NtGdiGetDCObject( hdcDest, NTGDI_OBJ_SURF ), + sizeof(dib), &dib ) == sizeof(BITMAP)) && + NtGdiGetDeviceCaps( hdcDest, BITSPIXEL ) == 32) { /* screen DCs or DDBs are not supposed to have an alpha channel, so use a 24-bpp bitmap as copy */ BITMAPINFO info; @@ -883,37 +883,43 @@ BOOL WINAPI GdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest, } else bmpWork = NtGdiCreateCompatibleBitmap( hdcDest, widthDest, heightDest ); oldWork = NtGdiSelectBitmap(hdcWork, bmpWork); - if(!StretchBlt(hdcWork, 0, 0, widthDest, heightDest, hdcSrc, xSrc, ySrc, widthSrc, heightSrc, SRCCOPY)) { + if (!NtGdiStretchBlt( hdcWork, 0, 0, widthDest, heightDest, hdcSrc, xSrc, ySrc, + widthSrc, heightSrc, SRCCOPY, 0 )) + { TRACE("Failed to stretch\n"); goto error; } - SetBkColor(hdcWork, crTransparent); + NtGdiGetAndSetDCDword( hdcWork, NtGdiSetBkColor, crTransparent, NULL ); /* Create mask */ hdcMask = NtGdiCreateCompatibleDC( hdcDest ); bmpMask = NtGdiCreateCompatibleBitmap( hdcMask, widthDest, heightDest ); oldMask = NtGdiSelectBitmap(hdcMask, bmpMask); - if(!BitBlt(hdcMask, 0, 0, widthDest, heightDest, hdcWork, 0, 0, SRCCOPY)) { + if (!NtGdiBitBlt( hdcMask, 0, 0, widthDest, heightDest, hdcWork, 0, 0, SRCCOPY, 0, 0 )) + { TRACE("Failed to create mask\n"); goto error; } /* Replace transparent color with black */ - SetBkColor(hdcWork, RGB(0,0,0)); - SetTextColor(hdcWork, RGB(255,255,255)); - if(!BitBlt(hdcWork, 0, 0, widthDest, heightDest, hdcMask, 0, 0, SRCAND)) { + NtGdiGetAndSetDCDword( hdcWork, NtGdiSetBkColor, RGB(0,0,0), NULL ); + NtGdiGetAndSetDCDword( hdcWork, NtGdiSetTextColor, RGB(255,255,255), NULL ); + if (!NtGdiBitBlt( hdcWork, 0, 0, widthDest, heightDest, hdcMask, 0, 0, SRCAND, 0, 0 )) + { TRACE("Failed to mask out background\n"); goto error; } /* Replace non-transparent area on destination with black */ - if(!BitBlt(hdcDest, xDest, yDest, widthDest, heightDest, hdcMask, 0, 0, SRCAND)) { + if (!NtGdiBitBlt( hdcDest, xDest, yDest, widthDest, heightDest, hdcMask, 0, 0, SRCAND, 0, 0 )) + { TRACE("Failed to clear destination area\n"); goto error; } /* Draw the image */ - if(!BitBlt(hdcDest, xDest, yDest, widthDest, heightDest, hdcWork, 0, 0, SRCPAINT)) { + if (!NtGdiBitBlt( hdcDest, xDest, yDest, widthDest, heightDest, hdcWork, 0, 0, SRCPAINT, 0, 0 )) + { TRACE("Failed to paint image\n"); goto error; } @@ -921,8 +927,8 @@ BOOL WINAPI GdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest, ret = TRUE; error: SetStretchBltMode(hdcSrc, oldStretchMode); - SetBkColor(hdcDest, oldBackground); - SetTextColor(hdcDest, oldForeground); + NtGdiGetAndSetDCDword( hdcDest, NtGdiSetBkColor, oldBackground, NULL ); + NtGdiGetAndSetDCDword( hdcDest, NtGdiSetTextColor, oldForeground, NULL ); if(hdcWork) { NtGdiSelectBitmap(hdcWork, oldWork); NtGdiDeleteObjectApp( hdcWork ); diff --git a/dlls/gdi32/emfdc.c b/dlls/gdi32/emfdc.c index 79220a5e1e0..a1c7eb74fd5 100644 --- a/dlls/gdi32/emfdc.c +++ b/dlls/gdi32/emfdc.c @@ -1287,7 +1287,7 @@ static BOOL emfdrv_stretchblt( struct emf *emf, INT x_dst, INT y_dst, INT width_ emr->cyDest = height_dst; emr->xSrc = x_src; emr->ySrc = y_src; - if (type == EMR_STRETCHBLT || type == EMR_ALPHABLEND) + if (type != EMR_BITBLT) { EMRSTRETCHBLT *emr_stretchblt = (EMRSTRETCHBLT *)emr; emr_stretchblt->cxSrc = width_src; @@ -1388,6 +1388,15 @@ BOOL EMFDC_StretchBlt( DC_ATTR *dc_attr, INT x_dst, INT y_dst, INT width_dst, IN height_src, rop, EMR_STRETCHBLT ); } +BOOL EMFDC_TransparentBlt( DC_ATTR *dc_attr, int x_dst, int y_dst, int width_dst, int height_dst, + HDC hdc_src, int x_src, int y_src, int width_src, int height_src, + UINT color ) +{ + return emfdrv_stretchblt( dc_attr->emf, x_dst, y_dst, width_dst, height_dst, + hdc_src, x_src, y_src, width_src, + height_src, color, EMR_TRANSPARENTBLT ); +} + BOOL EMFDC_MaskBlt( DC_ATTR *dc_attr, INT x_dst, INT y_dst, INT width_dst, INT height_dst, HDC hdc_src, INT x_src, INT y_src, HBITMAP mask, INT x_mask, INT y_mask, DWORD rop ) diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index efadf3a7c82..238ae3b7de1 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -271,6 +271,9 @@ extern BOOL EMFDC_StretchDIBits( DC_ATTR *dc_attr, INT x_dst, INT y_dst, INT wid UINT coloruse, DWORD rop ) DECLSPEC_HIDDEN; extern BOOL EMFDC_StrokeAndFillPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; extern BOOL EMFDC_StrokePath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; +extern BOOL EMFDC_TransparentBlt( DC_ATTR *dc_attr, int x_dst, int y_dst, int width_dst, + int height_dst, HDC hdc_src, int x_src, int y_src, int width_src, + int height_src, UINT color ) DECLSPEC_HIDDEN; extern BOOL EMFDC_WidenPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; extern HENHMETAFILE EMF_Create_HENHMETAFILE( ENHMETAHEADER *emh, DWORD filesize, diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 61b318ce067..b2e673fe581 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -1532,6 +1532,23 @@ BOOL WINAPI PlgBlt( HDC hdc, const POINT *points, HDC hdc_src, INT x_src, INT y_ mask, x_mask, y_mask, 0 /* FIXME */ ); } +/****************************************************************************** + * GdiTransparentBlt (GDI32.@) + */ +BOOL WINAPI GdiTransparentBlt( HDC hdc, int x_dst, int y_dst, int width_dst, int height_dst, + HDC hdc_src, int x_src, int y_src, int width_src, int height_src, + UINT color ) +{ + DC_ATTR *dc_attr; + + if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (dc_attr->emf && !EMFDC_TransparentBlt( dc_attr, x_dst, y_dst, width_dst, height_dst, hdc_src, + x_src, y_src, width_src, height_src, color )) + return FALSE; + return NtGdiTransparentBlt( hdc, x_dst, y_dst, width_dst, height_dst, hdc_src, x_src, y_src, + width_src, height_src, color ); +} + /****************************************************************************** * GdiAlphaBlend (GDI32.@) */ diff --git a/include/ntgdi.h b/include/ntgdi.h index 44a27878792..4ee02942346 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -417,6 +417,9 @@ INT WINAPI NtGdiStretchDIBitsInternal( HDC hdc, INT x_dst, INT y_dst, INT w HANDLE xform ); BOOL WINAPI NtGdiStrokePath( HDC hdc ); BOOL WINAPI NtGdiStrokeAndFillPath( HDC hdc ); +BOOL WINAPI NtGdiTransparentBlt( HDC hdc, int x_dst, int y_dst, int width_dst, int height_dst, + HDC hdc_src, int x_src, int y_src, int width_src, int height_src, + UINT color ); BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points_out, INT count, UINT mode ); BOOL WINAPI NtGdiUnrealizeObject( HGDIOBJ obj );
1
0
0
0
Jacek Caban : gdi32/test: Add tests for recording MaskBlt and PlgBlt in EMFs.
by Alexandre Julliard
10 Sep '21
10 Sep '21
Module: wine Branch: master Commit: 7b8a9db513a355d5d7fed853ffe60f81af7e0d54 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7b8a9db513a355d5d7fed853…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 10 14:27:20 2021 +0200 gdi32/test: Add tests for recording MaskBlt and PlgBlt in EMFs. 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/gdi32/tests/metafile.c | 185 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 693353ea5f2..1040408725a 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -1763,6 +1763,117 @@ static const unsigned char mf_palette_brush_bits[] = 0x00, 0x00, 0x00, 0x00 }; +static const unsigned char emf_mask_blit_bits[] = +{ + 0x01, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x35, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, + 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00, + 0x58, 0x03, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x77, 0x07, 0x00, 0x00, 0x3b, 0x04, 0x00, 0x00, + 0xfa, 0x01, 0x00, 0x00, 0x1f, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x12, 0xb7, 0x07, 0x00, + 0x4f, 0x5f, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0xcc, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0xa8, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, + 0x28, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, + 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, + 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, + 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, + 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, + 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0xcc, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0xa8, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, + 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, + 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, + 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, + 0x4f, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x8c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0xb4, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, + 0x28, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, + 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, + 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, + 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, + 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 +}; + /* For debugging or dumping the raw metafiles produced by * new test functions. */ @@ -2036,6 +2147,13 @@ static BOOL match_emf_record(const ENHMETARECORD *emr1, const ENHMETARECORD *emr if(!diff) diff = memcmp(eto1->aptl, eto2->aptl, eto1->cptl * sizeof(POINTL)); } + else if (emr1->iType == EMR_PLGBLT && emr2->iType == EMR_PLGBLT) + { + EMRPLGBLT *eto1 = (EMRPLGBLT *)emr1; + EMRPLGBLT *eto2 = (EMRPLGBLT *)emr2; + diff = memcmp(emr1, emr2, sizeof(*emr1)) || + memcmp(&eto1->aptlDest, &eto2->aptlDest, emr1->nSize - FIELD_OFFSET(EMRPLGBLT, aptlDest)); + } else diff = memcmp(emr1, emr2, emr1->nSize); @@ -4810,6 +4928,72 @@ static void test_emf_blit(void) ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError()); } +static void test_emf_mask_blit(void) +{ + BITMAPINFO bmi = {{ sizeof(bmi) }}; + HBITMAP bitmap, mask_bitmap; + HENHMETAFILE emf; + HDC hdc, dib_hdc; + unsigned int i; + void *bits; + BOOL ret; + + static const POINT plg_points[] = { { 2, 1 }, { 1, 1 }, { 1, 2 } }; + + hdc = CreateEnhMetaFileA(NULL, NULL, NULL, NULL); + ok(hdc != 0, "CreateMetaFileA failed\n"); + + dib_hdc = CreateCompatibleDC(NULL); + ok(!!dib_hdc, "CreateCompatibleDC failed\n"); + + bmi.bmiHeader.biHeight = 3; + bmi.bmiHeader.biWidth = 4; + bmi.bmiHeader.biBitCount = 24; + bmi.bmiHeader.biPlanes = 1; + bmi.bmiHeader.biCompression = BI_RGB; + bitmap = CreateDIBSection(dib_hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0); + ok(!!bitmap, "CreateDIBSection failed, error %d\n", GetLastError()); + for (i = 0; i < bmi.bmiHeader.biHeight * bmi.bmiHeader.biWidth * 3; i++) + ((BYTE *)bits)[i] = i + 10; + + bmi.bmiHeader.biHeight = 3; + bmi.bmiHeader.biWidth = 4; + bmi.bmiHeader.biBitCount = 1; + bmi.bmiHeader.biPlanes = 1; + bmi.bmiHeader.biCompression = BI_RGB; + mask_bitmap = CreateDIBSection(dib_hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0); + ok(!!mask_bitmap, "CreateDIBSection failed, error %d\n", GetLastError()); + memset(bits, ~0, bmi.bmiHeader.biHeight * 4); + + SelectObject(dib_hdc, bitmap); + + ret = MaskBlt(hdc, 0, 0, 3, 4, dib_hdc, 0, 0, mask_bitmap, 0, 0, SRCCOPY); + ok(ret, "MaskBlt failed\n"); + + ret = MaskBlt(hdc, 0, 0, 3, 4, dib_hdc, 0, 0, NULL, 0, 0, SRCCOPY); + ok(ret, "MaskBlt failed\n"); + + ret = PlgBlt(hdc, plg_points, dib_hdc, 0, 0, 3, 4, mask_bitmap, 0, 0); + ok(ret, "PlgBlt failed\n"); + + DeleteDC(dib_hdc); + DeleteObject(bitmap); + DeleteObject(mask_bitmap); + + emf = CloseEnhMetaFile(hdc); + ok(emf != 0, "CloseMetaFile failed\n"); + + if (compare_emf_bits(emf, emf_mask_blit_bits, sizeof(emf_mask_blit_bits), + "emf_mask_blit", FALSE) != 0) + { + dump_emf_bits(emf, "emf_mask_blit"); + dump_emf_records(emf, "emf_mask_blit"); + } + + ret = DeleteEnhMetaFile(emf); + ok(ret, "DeleteMetaFile(%p) error %d\n", emf, GetLastError()); +} + static void test_mf_ExtTextOut_on_path(void) { HDC hdcMetafile; @@ -7621,6 +7805,7 @@ START_TEST(metafile) test_emf_select(); test_emf_blit(); test_emf_pattern_brush(); + test_emf_mask_blit(); /* For win-format metafiles (mfdrv) */ test_mf_SaveDC();
1
0
0
0
Eric Pouech : dbghelp: Ensure all adresses are stored at least in DWORD_PTR.
by Alexandre Julliard
10 Sep '21
10 Sep '21
Module: wine Branch: master Commit: f4afcb3f5a99e3090c3aa1f00ce0903f6e8c48a9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f4afcb3f5a99e3090c3aa1f0…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Fri Sep 10 15:52:09 2021 +0200 dbghelp: Ensure all adresses are stored at least in DWORD_PTR. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/cpu_arm64.c | 2 +- dlls/dbghelp/pe_module.c | 6 +++--- dlls/dbghelp/symbol.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/dbghelp/cpu_arm64.c b/dlls/dbghelp/cpu_arm64.c index 515294fe95c..2c767e78de4 100644 --- a/dlls/dbghelp/cpu_arm64.c +++ b/dlls/dbghelp/cpu_arm64.c @@ -264,7 +264,7 @@ static BOOL arm64_fetch_minidump_thread(struct dump_context* dc, unsigned index, { /* FIXME: crop values across module boundaries, */ #ifdef __aarch64__ - ULONG base = ctx->Pc <= 0x80 ? 0 : ctx->Pc - 0x80; + ULONG64 base = ctx->Pc <= 0x80 ? 0 : ctx->Pc - 0x80; minidump_add_memory_block(dc, base, ctx->Pc + 0x80 - base, 0); #endif } diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 38829d6e6de..278f3c71c98 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -652,7 +652,7 @@ static BOOL pe_load_export_debug_info(const struct process* pcs, struct module* struct image_file_map* fmap = &module->format_info[DFI_PE]->u.pe_info->fmap; unsigned int i; const IMAGE_EXPORT_DIRECTORY* exports; - DWORD base = module->module.BaseOfImage; + DWORD_PTR base = module->module.BaseOfImage; DWORD size; IMAGE_NT_HEADERS* nth; void* mapping; @@ -716,7 +716,7 @@ static BOOL pe_load_export_debug_info(const struct process* pcs, struct module* if ((ordinals[j] == i) && names[j]) break; if (j < exports->NumberOfNames) continue; snprintf(buffer, sizeof(buffer), "%d", i + exports->Base); - symt_new_public(module, NULL, buffer, FALSE, base + (DWORD)functions[i], 1); + symt_new_public(module, NULL, buffer, FALSE, base + functions[i], 1); } } } @@ -906,7 +906,7 @@ struct module* pe_load_builtin_module(struct process* pcs, const WCHAR* name, PVOID WINAPI ImageDirectoryEntryToDataEx( PVOID base, BOOLEAN image, USHORT dir, PULONG size, PIMAGE_SECTION_HEADER *section ) { const IMAGE_NT_HEADERS *nt; - DWORD addr; + DWORD_PTR addr; *size = 0; if (section) *section = NULL; diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 28c906c10a3..3b44315eebd 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -929,7 +929,7 @@ static BOOL symt_enum_locals_helper(struct module_pair* pair, struct symt_function* func, const struct vector* v) { struct symt* lsym = NULL; - DWORD pc = pair->pcs->ctx_frame.InstructionOffset; + DWORD_PTR pc = pair->pcs->ctx_frame.InstructionOffset; unsigned int i; WCHAR* nameW; BOOL ret;
1
0
0
0
← Newer
1
...
72
73
74
75
76
77
78
...
103
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
Results per page:
10
25
50
100
200