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
August 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
1 participants
1051 discussions
Start a n
N
ew thread
Francois Gouget : user32/tests: Use WineTest contexts to simplify test_LoadImage{Bitmap,File}().
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 261956b6fd6a67acfb7485d4fab598d059029058 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=261956b6fd6a67acfb7485d4…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Aug 27 15:44:09 2021 +0200 user32/tests: Use WineTest contexts to simplify test_LoadImage{Bitmap,File}(). Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/cursoricon.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/user32/tests/cursoricon.c b/dlls/user32/tests/cursoricon.c index f84312f3ea2..33ca2e3cb63 100644 --- a/dlls/user32/tests/cursoricon.c +++ b/dlls/user32/tests/cursoricon.c @@ -1139,7 +1139,7 @@ static const DWORD biSize_tests[] = { 0xffffffff }; -static void test_LoadImageBitmap(const char * test_desc, HBITMAP hbm) +static void test_LoadImageBitmap(HBITMAP hbm) { BITMAP bm; BITMAPINFO bmi; @@ -1157,9 +1157,9 @@ static void test_LoadImageBitmap(const char * test_desc, HBITMAP hbm) bmi.bmiHeader.biBitCount= 24; bmi.bmiHeader.biCompression= BI_RGB; ret = GetDIBits(hdc, hbm, 0, bm.bmHeight, &pixel, &bmi, DIB_RGB_COLORS); - ok(ret == bm.bmHeight, "%s: %d lines were converted, not %d\n", test_desc, ret, bm.bmHeight); + ok(ret == bm.bmHeight, "%d lines were converted, not %d\n", ret, bm.bmHeight); - ok(color_match(pixel, 0x00ffffff), "%s: Pixel is 0x%08x\n", test_desc, pixel); + ok(color_match(pixel, 0x00ffffff), "Pixel is 0x%08x\n", pixel); ReleaseDC(NULL, hdc); } @@ -1172,6 +1172,7 @@ static void test_LoadImageFile(const char * test_desc, const unsigned char * ima DWORD error, bytes_written; char filename[64]; + winetest_push_context("%s", test_desc); strcpy(filename, "test."); strcat(filename, ext); @@ -1186,7 +1187,7 @@ static void test_LoadImageFile(const char * test_desc, const unsigned char * ima /* Load as cursor. For all tested formats, this should fail */ SetLastError(0xdeadbeef); handle = LoadImageA(NULL, filename, IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE); - ok(handle == NULL, "%s: IMAGE_CURSOR succeeded incorrectly.\n", test_desc); + ok(handle == NULL, "IMAGE_CURSOR succeeded incorrectly\n"); error = GetLastError(); ok(error == 0 || broken(error == 0xdeadbeef) || /* Win9x */ @@ -1197,7 +1198,7 @@ static void test_LoadImageFile(const char * test_desc, const unsigned char * ima /* Load as icon. For all tested formats, this should fail */ SetLastError(0xdeadbeef); handle = LoadImageA(NULL, filename, IMAGE_ICON, 0, 0, LR_LOADFROMFILE); - ok(handle == NULL, "%s: IMAGE_ICON succeeded incorrectly.\n", test_desc); + ok(handle == NULL, "IMAGE_ICON succeeded incorrectly\n"); error = GetLastError(); ok(error == 0 || broken(error == 0xdeadbeef) || /* Win9x */ @@ -1214,13 +1215,14 @@ static void test_LoadImageFile(const char * test_desc, const unsigned char * ima "Last error: %u\n", error); if (expect_success) { - ok(handle != NULL, "%s: IMAGE_BITMAP failed.\n", test_desc); - if (handle != NULL) test_LoadImageBitmap(test_desc, handle); + ok(handle != NULL, "IMAGE_BITMAP failed\n"); + if (handle != NULL) test_LoadImageBitmap(handle); } - else ok(handle == NULL, "%s: IMAGE_BITMAP succeeded incorrectly.\n", test_desc); + else ok(handle == NULL, "IMAGE_BITMAP succeeded incorrectly\n"); if (handle != NULL) DeleteObject(handle); DeleteFileA(filename); + winetest_pop_context(); } typedef struct {
1
0
0
0
Zebediah Figura : kernel32: Call kernelbase DeviceIoControl() in kernel32 DeviceIoControl().
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: c4ff18f765b5d932f5e25aaf705522f13c6c0a36 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c4ff18f765b5d932f5e25aaf…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Aug 26 20:54:11 2021 -0500 kernel32: Call kernelbase DeviceIoControl() in kernel32 DeviceIoControl(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/file.c | 57 +++++++-------------------------------------- dlls/kernel32/kernel32.spec | 2 +- 2 files changed, 10 insertions(+), 49 deletions(-) diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 92022063ecc..4d6f893c92d 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -389,21 +389,16 @@ HANDLE WINAPI OpenVxDHandle(HANDLE hHandleRing3) /**************************************************************************** * DeviceIoControl (KERNEL32.@) */ -BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, - LPVOID lpvInBuffer, DWORD cbInBuffer, - LPVOID lpvOutBuffer, DWORD cbOutBuffer, - LPDWORD lpcbBytesReturned, - LPOVERLAPPED lpOverlapped) +BOOL WINAPI KERNEL32_DeviceIoControl( HANDLE handle, DWORD code, void *in_buff, DWORD in_count, + void *out_buff, DWORD out_count, DWORD *returned, + OVERLAPPED *overlapped ) { - NTSTATUS status; - - TRACE( "(%p,%x,%p,%d,%p,%d,%p,%p)\n", - hDevice,dwIoControlCode,lpvInBuffer,cbInBuffer, - lpvOutBuffer,cbOutBuffer,lpcbBytesReturned,lpOverlapped ); + TRACE( "(%p,%#x,%p,%d,%p,%d,%p,%p)\n", + handle, code, in_buff, in_count, out_buff, out_count, returned, overlapped ); /* Check if this is a user defined control code for a VxD */ - if (HIWORD( dwIoControlCode ) == 0 && (GetVersion() & 0x80000000)) + if (HIWORD( code ) == 0 && (GetVersion() & 0x80000000)) { typedef BOOL (WINAPI *DeviceIoProc)(DWORD, LPVOID, DWORD, LPVOID, DWORD, LPDWORD, LPOVERLAPPED); static DeviceIoProc (*vxd_get_proc)(HANDLE); @@ -411,45 +406,11 @@ BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, if (!vxd_get_proc) vxd_get_proc = (void *)GetProcAddress( GetModuleHandleW(L"krnl386.exe16"), "__wine_vxd_get_proc" ); - if (vxd_get_proc) proc = vxd_get_proc( hDevice ); - if (proc) return proc( dwIoControlCode, lpvInBuffer, cbInBuffer, - lpvOutBuffer, cbOutBuffer, lpcbBytesReturned, lpOverlapped ); + if (vxd_get_proc) proc = vxd_get_proc( handle ); + if (proc) return proc( code, in_buff, in_count, out_buff, out_count, returned, overlapped ); } - /* Not a VxD, let ntdll handle it */ - - if (lpOverlapped) - { - LPVOID cvalue = ((ULONG_PTR)lpOverlapped->hEvent & 1) ? NULL : lpOverlapped; - lpOverlapped->Internal = STATUS_PENDING; - lpOverlapped->InternalHigh = 0; - if (HIWORD(dwIoControlCode) == FILE_DEVICE_FILE_SYSTEM) - status = NtFsControlFile(hDevice, lpOverlapped->hEvent, - NULL, cvalue, (PIO_STATUS_BLOCK)lpOverlapped, - dwIoControlCode, lpvInBuffer, cbInBuffer, - lpvOutBuffer, cbOutBuffer); - else - status = NtDeviceIoControlFile(hDevice, lpOverlapped->hEvent, - NULL, cvalue, (PIO_STATUS_BLOCK)lpOverlapped, - dwIoControlCode, lpvInBuffer, cbInBuffer, - lpvOutBuffer, cbOutBuffer); - if (lpcbBytesReturned) *lpcbBytesReturned = lpOverlapped->InternalHigh; - } - else - { - IO_STATUS_BLOCK iosb; - - if (HIWORD(dwIoControlCode) == FILE_DEVICE_FILE_SYSTEM) - status = NtFsControlFile(hDevice, NULL, NULL, NULL, &iosb, - dwIoControlCode, lpvInBuffer, cbInBuffer, - lpvOutBuffer, cbOutBuffer); - else - status = NtDeviceIoControlFile(hDevice, NULL, NULL, NULL, &iosb, - dwIoControlCode, lpvInBuffer, cbInBuffer, - lpvOutBuffer, cbOutBuffer); - if (lpcbBytesReturned) *lpcbBytesReturned = iosb.Information; - } - return set_ntstatus( status ); + return DeviceIoControl( handle, code, in_buff, in_count, out_buff, out_count, returned, overlapped ); } diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 6c02b17c7cf..90b503af19f 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -377,7 +377,7 @@ @ stdcall DeleteVolumeMountPointA(str) @ stdcall -import DeleteVolumeMountPointW(wstr) @ stdcall -arch=x86_64 DequeueUmsCompletionListItems(ptr long ptr) -@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) +@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) KERNEL32_DeviceIoControl @ stdcall -import DisableThreadLibraryCalls(long) @ stdcall -import DisconnectNamedPipe(long) @ stdcall DnsHostnameToComputerNameA (str ptr ptr)
1
0
0
0
Zebediah Figura : ntoskrnl/tests: Add more tests for IRP status handling.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 8d37962b43e5074bc0421611267dc41593114f85 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8d37962b43e5074bc0421611…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Aug 26 20:54:10 2021 -0500 ntoskrnl/tests: Add more tests for IRP status handling. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/tests/driver.c | 99 ++++---- dlls/ntoskrnl.exe/tests/driver.h | 40 ++-- dlls/ntoskrnl.exe/tests/driver_pnp.c | 6 +- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 435 +++++++++++++++++++++++++++++------ 4 files changed, 452 insertions(+), 128 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=8d37962b43e5074bc042…
1
0
0
0
Zebediah Figura : ntdll/tests: Also test the IOSB status in test_volume_info().
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: a5b1d5159413d5668735a142550def17cab38746 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a5b1d5159413d5668735a142…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Aug 26 20:54:09 2021 -0500 ntdll/tests: Also test the IOSB status in test_volume_info(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/pipe.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c index 662dc1d55cb..1118f41f81f 100644 --- a/dlls/ntdll/tests/pipe.c +++ b/dlls/ntdll/tests/pipe.c @@ -1662,8 +1662,10 @@ static void test_volume_info(void) PIPE_TYPE_MESSAGE, 4096 )) return; memset( buffer, 0xaa, sizeof(buffer) ); + memset( &iosb, 0xaa, sizeof(iosb) ); status = pNtQueryVolumeInformationFile( read, &iosb, buffer, sizeof(buffer), FileFsDeviceInformation ); ok( status == STATUS_SUCCESS, "NtQueryVolumeInformationFile failed: %x\n", status ); + ok( iosb.Status == STATUS_SUCCESS, "got status %#x\n", iosb.Status ); ok( iosb.Information == sizeof(*device_info), "Information = %lu\n", iosb.Information ); device_info = (FILE_FS_DEVICE_INFORMATION*)buffer; ok( device_info->DeviceType == FILE_DEVICE_NAMED_PIPE, "DeviceType = %u\n", device_info->DeviceType ); @@ -1671,8 +1673,10 @@ static void test_volume_info(void) "Characteristics = %x\n", device_info->Characteristics ); memset( buffer, 0xaa, sizeof(buffer) ); + memset( &iosb, 0xaa, sizeof(iosb) ); status = pNtQueryVolumeInformationFile( write, &iosb, buffer, sizeof(buffer), FileFsDeviceInformation ); ok( status == STATUS_SUCCESS, "NtQueryVolumeInformationFile failed: %x\n", status ); + ok( iosb.Status == STATUS_SUCCESS, "got status %#x\n", iosb.Status ); ok( iosb.Information == sizeof(*device_info), "Information = %lu\n", iosb.Information ); device_info = (FILE_FS_DEVICE_INFORMATION*)buffer; ok( device_info->DeviceType == FILE_DEVICE_NAMED_PIPE, "DeviceType = %u\n", device_info->DeviceType );
1
0
0
0
Jacek Caban : gdi32: Use ntgdi name for GetFontData.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: fba1746091bfb480cfd79fc64da9e932fe0902dc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fba1746091bfb480cfd79fc6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 27 13:51:56 2021 +0100 gdi32: Use ntgdi name for GetFontData. 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 | 5 ++--- dlls/gdi32/gdi32.spec | 2 +- dlls/gdi32/uniscribe/opentype.c | 6 +++--- dlls/gdi32/uniscribe/shape.c | 12 ++++++------ dlls/gdi32/uniscribe/usp10.c | 4 ++-- include/ntgdi.h | 1 + 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index b65f1e54bee..c5e36ef584b 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -6045,7 +6045,7 @@ BOOL WINAPI TranslateCharsetInfo( } /************************************************************************* - * GetFontData [GDI32.@] + * NtGdiGetFontData (win32u.@) * * Retrieve data for TrueType font. * @@ -6059,8 +6059,7 @@ BOOL WINAPI TranslateCharsetInfo( * Calls SetLastError() * */ -DWORD WINAPI GetFontData(HDC hdc, DWORD table, DWORD offset, - LPVOID buffer, DWORD length) +DWORD WINAPI NtGdiGetFontData( HDC hdc, DWORD table, DWORD offset, void *buffer, DWORD length ) { DC *dc = get_dc_ptr(hdc); PHYSDEV dev; diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 7862a5c3077..309e9e1ccbe 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -289,7 +289,7 @@ # @ stub GetEnhMetaFilePixelFormat @ stdcall GetEnhMetaFileW(wstr) # @ stub GetFontAssocStatus -@ stdcall GetFontData(long long long ptr long) +@ stdcall GetFontData(long long long ptr long) NtGdiGetFontData @ stdcall GetFontFileData(long long int64 ptr long) @ stdcall GetFontFileInfo(long long ptr long ptr) @ stdcall GetFontLanguageInfo(long) diff --git a/dlls/gdi32/uniscribe/opentype.c b/dlls/gdi32/uniscribe/opentype.c index a6ce76072d9..a6dbc6c4d28 100644 --- a/dlls/gdi32/uniscribe/opentype.c +++ b/dlls/gdi32/uniscribe/opentype.c @@ -23,7 +23,7 @@ #include "windef.h" #include "winbase.h" -#include "wingdi.h" +#include "ntgdi.h" #include "winuser.h" #include "winnls.h" #include "usp10.h" @@ -632,11 +632,11 @@ static VOID *load_CMAP_format12_table(HDC hdc, ScriptCache *psc) if (!psc->CMAP_Table) { - length = GetFontData(hdc, CMAP_TAG , 0, NULL, 0); + length = NtGdiGetFontData(hdc, CMAP_TAG , 0, NULL, 0); if (length != GDI_ERROR) { psc->CMAP_Table = heap_alloc(length); - GetFontData(hdc, CMAP_TAG , 0, psc->CMAP_Table, length); + NtGdiGetFontData(hdc, CMAP_TAG , 0, psc->CMAP_Table, length); TRACE("Loaded cmap table of %i bytes\n",length); } else diff --git a/dlls/gdi32/uniscribe/shape.c b/dlls/gdi32/uniscribe/shape.c index d65476f67b4..709924597d3 100644 --- a/dlls/gdi32/uniscribe/shape.c +++ b/dlls/gdi32/uniscribe/shape.c @@ -669,11 +669,11 @@ static INT apply_GSUB_feature_to_glyph(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCach static VOID *load_gsub_table(HDC hdc) { VOID* GSUB_Table = NULL; - int length = GetFontData(hdc, MS_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, 0); + int length = NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, 0); if (length != GDI_ERROR) { GSUB_Table = heap_alloc(length); - GetFontData(hdc, MS_MAKE_TAG('G', 'S', 'U', 'B'), 0, GSUB_Table, length); + NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'S', 'U', 'B'), 0, GSUB_Table, length); TRACE("Loaded GSUB table of %i bytes\n",length); } return GSUB_Table; @@ -682,11 +682,11 @@ static VOID *load_gsub_table(HDC hdc) static VOID *load_gpos_table(HDC hdc) { VOID* GPOS_Table = NULL; - int length = GetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, NULL, 0); + int length = NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, NULL, 0); if (length != GDI_ERROR) { GPOS_Table = heap_alloc(length); - GetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, GPOS_Table, length); + NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, GPOS_Table, length); TRACE("Loaded GPOS table of %i bytes\n",length); } return GPOS_Table; @@ -695,11 +695,11 @@ static VOID *load_gpos_table(HDC hdc) static VOID *load_gdef_table(HDC hdc) { VOID* GDEF_Table = NULL; - int length = GetFontData(hdc, MS_MAKE_TAG('G', 'D', 'E', 'F'), 0, NULL, 0); + int length = NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'D', 'E', 'F'), 0, NULL, 0); if (length != GDI_ERROR) { GDEF_Table = heap_alloc(length); - GetFontData(hdc, MS_MAKE_TAG('G', 'D', 'E', 'F'), 0, GDEF_Table, length); + NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'D', 'E', 'F'), 0, GDEF_Table, length); TRACE("Loaded GDEF table of %i bytes\n",length); } return GDEF_Table; diff --git a/dlls/gdi32/uniscribe/usp10.c b/dlls/gdi32/uniscribe/usp10.c index 50f38f957b2..32fae22c816 100644 --- a/dlls/gdi32/uniscribe/usp10.c +++ b/dlls/gdi32/uniscribe/usp10.c @@ -30,7 +30,7 @@ #include "windef.h" #include "winbase.h" -#include "wingdi.h" +#include "ntgdi.h" #include "winuser.h" #include "winnls.h" #include "winreg.h" @@ -822,7 +822,7 @@ static HRESULT init_script_cache(const HDC hdc, SCRIPT_CACHE *psc) sc->otm->otmSize = size; GetOutlineTextMetricsW(hdc, size, sc->otm); } - sc->sfnt = (GetFontData(hdc, MS_MAKE_TAG('h','e','a','d'), 0, NULL, 0)!=GDI_ERROR); + sc->sfnt = (NtGdiGetFontData(hdc, MS_MAKE_TAG('h','e','a','d'), 0, NULL, 0) != GDI_ERROR); if (!set_cache_font_properties(hdc, sc)) { heap_free(sc); diff --git a/include/ntgdi.h b/include/ntgdi.h index f9ad9da2060..995c2017b55 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -242,6 +242,7 @@ BOOL WINAPI NtGdiGetDCDword( HDC hdc, UINT method, DWORD *result ); BOOL WINAPI NtGdiGetDCPoint( HDC hdc, UINT method, POINT *result ); INT WINAPI NtGdiGetDeviceCaps( HDC hdc, INT cap ); BOOL WINAPI NtGdiGetDeviceGammaRamp( HDC hdc, void *ptr ); +DWORD WINAPI NtGdiGetFontData( HDC hdc, DWORD table, DWORD offset, void *buffer, DWORD length ); DWORD WINAPI NtGdiGetGlyphOutlineW( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics, DWORD size, void *buffer, const MAT2 *mat2, BOOL ignore_rotation );
1
0
0
0
Jacek Caban : gdi32: Move GetFontLanguageInfo to text.c.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 3b686c3eca42f28cc2975c0752fbb87e79f6b73c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3b686c3eca42f28cc2975c07…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 27 13:51:55 2021 +0100 gdi32: Move GetFontLanguageInfo to text.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 | 49 ------------------------------------------------- dlls/gdi32/text.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 49 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index f825562b37f..b65f1e54bee 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -6044,55 +6044,6 @@ BOOL WINAPI TranslateCharsetInfo( return TRUE; } -/************************************************************************* - * GetFontLanguageInfo (GDI32.@) - */ -DWORD WINAPI GetFontLanguageInfo(HDC hdc) -{ - FONTSIGNATURE fontsig; - static const DWORD GCP_DBCS_MASK=FS_JISJAPAN|FS_CHINESESIMP|FS_WANSUNG|FS_CHINESETRAD|FS_JOHAB, - GCP_DIACRITIC_MASK=0x00000000, - FLI_GLYPHS_MASK=0x00000000, - GCP_GLYPHSHAPE_MASK=FS_ARABIC, - GCP_KASHIDA_MASK=0x00000000, - GCP_LIGATE_MASK=0x00000000, - GCP_REORDER_MASK=FS_HEBREW|FS_ARABIC; - - DWORD result=0; - - NtGdiGetTextCharsetInfo( hdc, &fontsig, 0 ); - /* We detect each flag we return using a bitmask on the Codepage Bitfields */ - - if( (fontsig.fsCsb[0]&GCP_DBCS_MASK)!=0 ) - result|=GCP_DBCS; - - if( (fontsig.fsCsb[0]&GCP_DIACRITIC_MASK)!=0 ) - result|=GCP_DIACRITIC; - - if( (fontsig.fsCsb[0]&FLI_GLYPHS_MASK)!=0 ) - result|=FLI_GLYPHS; - - if( (fontsig.fsCsb[0]&GCP_GLYPHSHAPE_MASK)!=0 ) - result|=GCP_GLYPHSHAPE; - - if( (fontsig.fsCsb[0]&GCP_KASHIDA_MASK)!=0 ) - result|=GCP_KASHIDA; - - if( (fontsig.fsCsb[0]&GCP_LIGATE_MASK)!=0 ) - result|=GCP_LIGATE; - - if( NtGdiGetKerningPairsW( hdc, 0, NULL ) ) - result|=GCP_USEKERNING; - - /* this might need a test for a HEBREW- or ARABIC_CHARSET as well */ - if( GetTextAlign( hdc) & TA_RTLREADING ) - if( (fontsig.fsCsb[0]&GCP_REORDER_MASK)!=0 ) - result|=GCP_REORDER; - - return result; -} - - /************************************************************************* * GetFontData [GDI32.@] * diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index ba86a1a3b1d..72b721a48a2 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1849,3 +1849,51 @@ DWORD WINAPI GetKerningPairsA( HDC hdc, DWORD count, KERNINGPAIR *kern_pairA ) HeapFree( GetProcessHeap(), 0, kern_pairW ); return kern_pairs_copied; } + +/************************************************************************* + * GetFontLanguageInfo (GDI32.@) + */ +DWORD WINAPI GetFontLanguageInfo( HDC hdc ) +{ + FONTSIGNATURE fontsig; + DWORD result = 0; + + static const DWORD GCP_DBCS_MASK = FS_JISJAPAN|FS_CHINESESIMP|FS_WANSUNG|FS_CHINESETRAD|FS_JOHAB, + GCP_DIACRITIC_MASK = 0x00000000, + FLI_GLYPHS_MASK = 0x00000000, + GCP_GLYPHSHAPE_MASK = FS_ARABIC, + GCP_KASHIDA_MASK = 0x00000000, + GCP_LIGATE_MASK = 0x00000000, + GCP_REORDER_MASK = FS_HEBREW|FS_ARABIC; + + + NtGdiGetTextCharsetInfo( hdc, &fontsig, 0 ); + /* We detect each flag we return using a bitmask on the Codepage Bitfields */ + + if (fontsig.fsCsb[0] & GCP_DBCS_MASK) + result |= GCP_DBCS; + + if (fontsig.fsCsb[0] & GCP_DIACRITIC_MASK) + result |= GCP_DIACRITIC; + + if (fontsig.fsCsb[0] & FLI_GLYPHS_MASK) + result |= FLI_GLYPHS; + + if (fontsig.fsCsb[0] & GCP_GLYPHSHAPE_MASK) + result |= GCP_GLYPHSHAPE; + + if (fontsig.fsCsb[0] & GCP_KASHIDA_MASK) + result |= GCP_KASHIDA; + + if (fontsig.fsCsb[0] & GCP_LIGATE_MASK) + result |= GCP_LIGATE; + + if (NtGdiGetKerningPairsW( hdc, 0, NULL )) + result |= GCP_USEKERNING; + + /* this might need a test for a HEBREW- or ARABIC_CHARSET as well */ + if ((GetTextAlign( hdc ) & TA_RTLREADING) && (fontsig.fsCsb[0] & GCP_REORDER_MASK)) + result |= GCP_REORDER; + + return result; +}
1
0
0
0
Jacek Caban : gdi32: Use NtGdiGetKerningPairsW for GetKerningPairsW.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 43d0e401495c45ba918e9bdddb0cb08a6324c7f9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=43d0e401495c45ba918e9bdd…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 27 13:51:54 2021 +0100 gdi32: Use NtGdiGetKerningPairsW for GetKerningPairsW. 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 | 82 +++++---------------------------------------------- dlls/gdi32/gdi32.spec | 2 +- dlls/gdi32/text.c | 67 +++++++++++++++++++++++++++++++++++++++-- include/ntgdi.h | 5 ++-- 4 files changed, 77 insertions(+), 79 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 12d56de35d9..f825562b37f 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5976,93 +5976,27 @@ done: } /************************************************************************* - * GetKerningPairsA (GDI32.@) + * NtGdiGetKerningPairsW (win32u.@) */ -DWORD WINAPI GetKerningPairsA( HDC hDC, DWORD cPairs, - LPKERNINGPAIR kern_pairA ) -{ - UINT cp; - CPINFO cpi; - DWORD i, total_kern_pairs, kern_pairs_copied = 0; - KERNINGPAIR *kern_pairW; - - if (!cPairs && kern_pairA) - { - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - cp = GdiGetCodePage(hDC); - - /* GetCPInfo() will fail on CP_SYMBOL, and WideCharToMultiByte is supposed - * to fail on an invalid character for CP_SYMBOL. - */ - cpi.DefaultChar[0] = 0; - if (cp != CP_SYMBOL && !GetCPInfo(cp, &cpi)) - { - FIXME("Can't find codepage %u info\n", cp); - return 0; - } - - total_kern_pairs = GetKerningPairsW(hDC, 0, NULL); - if (!total_kern_pairs) return 0; - - kern_pairW = HeapAlloc(GetProcessHeap(), 0, total_kern_pairs * sizeof(*kern_pairW)); - GetKerningPairsW(hDC, total_kern_pairs, kern_pairW); - - for (i = 0; i < total_kern_pairs; i++) - { - char first, second; - - if (!WideCharToMultiByte(cp, 0, &kern_pairW[i].wFirst, 1, &first, 1, NULL, NULL)) - continue; - - if (!WideCharToMultiByte(cp, 0, &kern_pairW[i].wSecond, 1, &second, 1, NULL, NULL)) - continue; - - if (first == cpi.DefaultChar[0] || second == cpi.DefaultChar[0]) - continue; - - if (kern_pairA) - { - if (kern_pairs_copied >= cPairs) break; - - kern_pairA->wFirst = (BYTE)first; - kern_pairA->wSecond = (BYTE)second; - kern_pairA->iKernAmount = kern_pairW[i].iKernAmount; - kern_pairA++; - } - kern_pairs_copied++; - } - - HeapFree(GetProcessHeap(), 0, kern_pairW); - - return kern_pairs_copied; -} - -/************************************************************************* - * GetKerningPairsW (GDI32.@) - */ -DWORD WINAPI GetKerningPairsW( HDC hDC, DWORD cPairs, - LPKERNINGPAIR lpKerningPairs ) +DWORD WINAPI NtGdiGetKerningPairsW( HDC hdc, DWORD count, KERNINGPAIR *kern_pair ) { DC *dc; DWORD ret; PHYSDEV dev; - TRACE("(%p,%d,%p)\n", hDC, cPairs, lpKerningPairs); + TRACE( "(%p,%d,%p)\n", hdc, count, kern_pair ); - if (!cPairs && lpKerningPairs) + if (!count && kern_pair) { - SetLastError(ERROR_INVALID_PARAMETER); + SetLastError( ERROR_INVALID_PARAMETER ); return 0; } - dc = get_dc_ptr(hDC); + dc = get_dc_ptr( hdc ); if (!dc) return 0; dev = GET_DC_PHYSDEV( dc, pGetKerningPairs ); - ret = dev->funcs->pGetKerningPairs( dev, cPairs, lpKerningPairs ); + ret = dev->funcs->pGetKerningPairs( dev, count, kern_pair ); release_dc_ptr( dc ); return ret; } @@ -6147,7 +6081,7 @@ DWORD WINAPI GetFontLanguageInfo(HDC hdc) if( (fontsig.fsCsb[0]&GCP_LIGATE_MASK)!=0 ) result|=GCP_LIGATE; - if( GetKerningPairsW( hdc, 0, NULL ) ) + if( NtGdiGetKerningPairsW( hdc, 0, NULL ) ) result|=GCP_USEKERNING; /* this might need a test for a HEBREW- or ARABIC_CHARSET as well */ diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 5bddcd26de6..7862a5c3077 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) +@ stdcall GetKerningPairsW(long long ptr) NtGdiGetKerningPairsW @ stdcall GetLayout(long) @ stdcall GetLogColorSpaceA(long ptr long) @ stdcall GetLogColorSpaceW(long ptr long) diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 7e9b882bdb1..ba86a1a3b1d 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1049,7 +1049,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 = GetKerningPairsW( hdc, 0, NULL ); + count = NtGdiGetKerningPairsW( hdc, 0, NULL ); if (count) { kern = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*kern) ); @@ -1059,7 +1059,7 @@ static int *kern_string( HDC hdc, const WCHAR *str, int len, int *kern_total ) return NULL; } - GetKerningPairsW( hdc, count, kern ); + NtGdiGetKerningPairsW( hdc, count, kern ); } for (i = 0; i < len - 1; i++) @@ -1786,3 +1786,66 @@ DWORD WINAPI GetGlyphOutlineW( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metr { return NtGdiGetGlyphOutlineW( hdc, ch, format, metrics, size, buffer, mat2, FALSE ); } + +/************************************************************************* + * GetKerningPairsA (GDI32.@) + */ +DWORD WINAPI GetKerningPairsA( HDC hdc, DWORD count, KERNINGPAIR *kern_pairA ) +{ + DWORD i, total_kern_pairs, kern_pairs_copied = 0; + KERNINGPAIR *kern_pairW; + CPINFO cpi; + UINT cp; + + if (!count && kern_pairA) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return 0; + } + + cp = GdiGetCodePage( hdc ); + + /* GetCPInfo() will fail on CP_SYMBOL, and WideCharToMultiByte is supposed + * to fail on an invalid character for CP_SYMBOL. + */ + cpi.DefaultChar[0] = 0; + if (cp != CP_SYMBOL && !GetCPInfo( cp, &cpi )) + { + FIXME( "Can't find codepage %u info\n", cp ); + return 0; + } + + total_kern_pairs = NtGdiGetKerningPairsW( 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 ); + + for (i = 0; i < total_kern_pairs; i++) + { + char first, second; + + if (!WideCharToMultiByte( cp, 0, &kern_pairW[i].wFirst, 1, &first, 1, NULL, NULL )) + continue; + + if (!WideCharToMultiByte( cp, 0, &kern_pairW[i].wSecond, 1, &second, 1, NULL, NULL )) + continue; + + if (first == cpi.DefaultChar[0] || second == cpi.DefaultChar[0]) + continue; + + if (kern_pairA) + { + if (kern_pairs_copied >= count) break; + + kern_pairA->wFirst = (BYTE)first; + kern_pairA->wSecond = (BYTE)second; + kern_pairA->iKernAmount = kern_pairW[i].iKernAmount; + kern_pairA++; + } + kern_pairs_copied++; + } + + HeapFree( GetProcessHeap(), 0, kern_pairW ); + return kern_pairs_copied; +} diff --git a/include/ntgdi.h b/include/ntgdi.h index c8958cf83c9..f9ad9da2060 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -225,6 +225,8 @@ BOOL WINAPI NtGdiFillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ); INT WINAPI NtGdiExtEscape( HDC hdc, WCHAR *driver, INT driver_id, INT escape, INT input_size, const char *input, INT output_size, char *output ); BOOL WINAPI NtGdiExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, UINT type ); +BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *rect, + const WCHAR *str, UINT count, const INT *dx, DWORD cp ); BOOL WINAPI NtGdiFrameRgn( HDC hdc, HRGN hrgn, HBRUSH brush, INT width, INT height ); BOOL WINAPI NtGdiFillPath( HDC hdc ); @@ -243,8 +245,7 @@ BOOL WINAPI NtGdiGetDeviceGammaRamp( HDC hdc, void *ptr ); DWORD WINAPI NtGdiGetGlyphOutlineW( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics, DWORD size, void *buffer, const MAT2 *mat2, BOOL ignore_rotation ); -BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *rect, - const WCHAR *str, UINT count, const INT *dx, DWORD cp ); +DWORD WINAPI NtGdiGetKerningPairsW( 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 );
1
0
0
0
Jacek Caban : gdi32: Use NtGdiGetGlyphOutlineW for GetGlyphOutlineW.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: c221571468bd315725ccb0b5ca2d2e65694949b9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c221571468bd315725ccb0b5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 27 13:51:53 2021 +0100 gdi32: Use NtGdiGetGlyphOutlineW for GetGlyphOutlineW. 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 | 50 +++++++------------------------------------------- dlls/gdi32/text.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ include/ntgdi.h | 3 +++ 3 files changed, 54 insertions(+), 43 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 59438939474..12d56de35d9 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5646,61 +5646,25 @@ BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars /*********************************************************************** - * GetGlyphOutlineA (GDI32.@) + * NtGdiGetGlyphOutlineW (win32u.@) */ -DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT uChar, UINT fuFormat, - LPGLYPHMETRICS lpgm, DWORD cbBuffer, - LPVOID lpBuffer, const MAT2 *lpmat2 ) -{ - if (!lpmat2) return GDI_ERROR; - - if(!(fuFormat & GGO_GLYPH_INDEX)) { - UINT cp; - int len; - char mbchs[2]; - WCHAR wChar; - - cp = GdiGetCodePage(hdc); - if (IsDBCSLeadByteEx(cp, uChar >> 8)) { - len = 2; - mbchs[0] = (uChar & 0xff00) >> 8; - mbchs[1] = (uChar & 0xff); - } else { - len = 1; - mbchs[0] = (uChar & 0xff); - } - wChar = 0; - MultiByteToWideChar(cp, 0, mbchs, len, &wChar, 1); - uChar = wChar; - } - - return GetGlyphOutlineW(hdc, uChar, fuFormat, lpgm, cbBuffer, lpBuffer, - lpmat2); -} - -/*********************************************************************** - * GetGlyphOutlineW (GDI32.@) - */ -DWORD WINAPI GetGlyphOutlineW( HDC hdc, UINT uChar, UINT fuFormat, - LPGLYPHMETRICS lpgm, DWORD cbBuffer, - LPVOID lpBuffer, const MAT2 *lpmat2 ) +DWORD WINAPI NtGdiGetGlyphOutlineW( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics, + DWORD size, void *buffer, const MAT2 *mat2, + BOOL ignore_rotation ) { DC *dc; DWORD ret; PHYSDEV dev; - TRACE("(%p, %04x, %04x, %p, %d, %p, %p)\n", - hdc, uChar, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2 ); + TRACE( "(%p, %04x, %04x, %p, %d, %p, %p)\n", hdc, ch, format, metrics, size, buffer, mat2 ); - if (!lpmat2) return GDI_ERROR; + if (!mat2) return GDI_ERROR; dc = get_dc_ptr(hdc); if(!dc) return GDI_ERROR; - uChar &= 0xffff; - dev = GET_DC_PHYSDEV( dc, pGetGlyphOutline ); - ret = dev->funcs->pGetGlyphOutline( dev, uChar, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2 ); + ret = dev->funcs->pGetGlyphOutline( dev, ch & 0xffff, format, metrics, size, buffer, mat2 ); release_dc_ptr( dc ); return ret; } diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index beb9908f6ce..7e9b882bdb1 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1742,3 +1742,47 @@ BOOL WINAPI GetCharABCWidthsI( HDC hdc, UINT first, UINT count, WORD *glyphs, AB NTGDI_GETCHARABCWIDTHS_INDICES | NTGDI_GETCHARABCWIDTHS_INT, buffer ); } + +/*********************************************************************** + * GetGlyphOutlineA (GDI32.@) + */ +DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics, DWORD size, + void *buffer, const MAT2 *mat2 ) +{ + if (!mat2) return GDI_ERROR; + + if (!(format & GGO_GLYPH_INDEX)) + { + UINT cp; + int len; + char mbchs[2]; + WCHAR wChar; + + cp = GdiGetCodePage( hdc ); + if (IsDBCSLeadByteEx( cp, ch >> 8 )) + { + len = 2; + mbchs[0] = (ch & 0xff00) >> 8; + mbchs[1] = (ch & 0xff); + } + else + { + len = 1; + mbchs[0] = ch & 0xff; + } + wChar = 0; + MultiByteToWideChar(cp, 0, mbchs, len, &wChar, 1 ); + ch = wChar; + } + + return GetGlyphOutlineW( hdc, ch, format, metrics, size, buffer, mat2 ); +} + +/*********************************************************************** + * GetGlyphOutlineW (GDI32.@) + */ +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 ); +} diff --git a/include/ntgdi.h b/include/ntgdi.h index 39f478bd418..c8958cf83c9 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -240,6 +240,9 @@ BOOL WINAPI NtGdiGetDCDword( HDC hdc, UINT method, DWORD *result ); BOOL WINAPI NtGdiGetDCPoint( HDC hdc, UINT method, POINT *result ); INT WINAPI NtGdiGetDeviceCaps( HDC hdc, INT cap ); BOOL WINAPI NtGdiGetDeviceGammaRamp( HDC hdc, void *ptr ); +DWORD WINAPI NtGdiGetGlyphOutlineW( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics, + DWORD size, void *buffer, const MAT2 *mat2, + BOOL ignore_rotation ); BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *rect, const WCHAR *str, UINT count, const INT *dx, DWORD cp ); BOOL WINAPI NtGdiGetMiterLimit( HDC hdc, FLOAT *limit );
1
0
0
0
Jacek Caban : gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsFloatA.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 9fe27a704da943b833e0fcc7b6ebce432404c09f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9fe27a704da943b833e0fcc7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 27 13:51:52 2021 +0100 gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsFloatA. 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 | 88 ------------------------------------------------------- dlls/gdi32/text.c | 15 ++++++++++ 2 files changed, 15 insertions(+), 88 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 07dcb77627a..59438939474 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -4813,60 +4813,6 @@ UINT WINAPI NtGdiGetOutlineTextMetricsInternalW( HDC hdc, UINT cbData, return ret; } -static LPSTR FONT_GetCharsByRangeA(HDC hdc, UINT firstChar, UINT lastChar, PINT pByteLen) -{ - INT i, count = lastChar - firstChar + 1; - UINT mbcp; - UINT c; - LPSTR str; - - if (count <= 0) - return NULL; - - mbcp = GdiGetCodePage(hdc); - switch (mbcp) - { - case 932: - case 936: - case 949: - case 950: - case 1361: - if (lastChar > 0xffff) - return NULL; - if ((firstChar ^ lastChar) > 0xff) - return NULL; - break; - default: - if (lastChar > 0xff) - return NULL; - mbcp = 0; - break; - } - - str = HeapAlloc(GetProcessHeap(), 0, count * 2 + 1); - if (str == NULL) - return NULL; - - for(i = 0, c = firstChar; c <= lastChar; i++, c++) - { - if (mbcp) { - if (c > 0xff) - str[i++] = (BYTE)(c >> 8); - if (c <= 0xff && IsDBCSLeadByteEx(mbcp, c)) - str[i] = 0x1f; /* FIXME: use default character */ - else - str[i] = (BYTE)c; - } - else - str[i] = (BYTE)c; - } - str[i] = '\0'; - - *pByteLen = i; - - return str; -} - /*********************************************************************** * NtGdiGetCharWidthW (win32u.@) */ @@ -6320,40 +6266,6 @@ DWORD WINAPI GetGlyphIndicesW(HDC hdc, LPCWSTR lpstr, INT count, return ret; } -/************************************************************************* - * GetCharABCWidthsFloatA [GDI32.@] - * - * See GetCharABCWidthsFloatW. - */ -BOOL WINAPI GetCharABCWidthsFloatA( HDC hdc, UINT first, UINT last, LPABCFLOAT abcf ) -{ - INT i, wlen; - LPSTR str; - LPWSTR wstr; - BOOL ret = TRUE; - - str = FONT_GetCharsByRangeA(hdc, first, last, &i); - if (str == NULL) - return FALSE; - - wstr = FONT_mbtowc( hdc, str, i, &wlen, NULL ); - - for (i = 0; i < wlen; i++) - { - if (!GetCharABCWidthsFloatW( hdc, wstr[i], wstr[i], abcf )) - { - ret = FALSE; - break; - } - abcf++; - } - - HeapFree( GetProcessHeap(), 0, str ); - HeapFree( GetProcessHeap(), 0, wstr ); - - return ret; -} - /*********************************************************************** * * * Font Resource API * diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index a119615e002..beb9908f6ce 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1717,6 +1717,21 @@ BOOL WINAPI GetCharABCWidthsFloatW( HDC hdc, UINT first, UINT last, ABCFLOAT *ab return NtGdiGetCharABCWidthsW( hdc, first, last, NULL, 0, abcf ); } +/*********************************************************************** + * GetCharABCWidthsFloatA (GDI32.@) + */ +BOOL WINAPI GetCharABCWidthsFloatA( HDC hdc, UINT first, UINT last, ABCFLOAT *abcf ) +{ + WCHAR *chars; + INT count; + BOOL ret; + + if (!(chars = get_chars_by_range( hdc, first, last, &count ))) return FALSE; + ret = NtGdiGetCharABCWidthsW( hdc, 0, count, chars, 0, abcf ); + HeapFree( GetProcessHeap(), 0, chars ); + return ret; +} + /*********************************************************************** * GetCharABCWidthsI (GDI32.@) */
1
0
0
0
Jacek Caban : gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsFloatW.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: fb5a3ba5410f9ee3927cdfb6a933ca80c2ddb68c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fb5a3ba5410f9ee3927cdfb6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 27 13:51:51 2021 +0100 gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsFloatW. 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 | 91 ++++++++++++++++++------------------------------------- dlls/gdi32/text.c | 9 ++++++ 2 files changed, 39 insertions(+), 61 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index e9071a571e3..07dcb77627a 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5650,12 +5650,15 @@ BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars } else { - /* unlike GetCharABCWidthsFloatW, this one is supposed to fail on non-scalable fonts */ - dev = GET_DC_PHYSDEV( dc, pGetTextMetrics ); - if (!dev->funcs->pGetTextMetrics( dev, &tm ) || !(tm.tmPitchAndFamily & TMPF_VECTOR)) + if (flags & NTGDI_GETCHARABCWIDTHS_INT) { - release_dc_ptr( dc ); - return FALSE; + /* unlike float variant, this one is supposed to fail on non-scalable fonts */ + dev = GET_DC_PHYSDEV( dc, pGetTextMetrics ); + if (!dev->funcs->pGetTextMetrics( dev, &tm ) || !(tm.tmPitchAndFamily & TMPF_VECTOR)) + { + release_dc_ptr( dc ); + return FALSE; + } } if (!chars) count = last - first + 1; @@ -5666,13 +5669,29 @@ BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars if (ret) { ABC *abc = buffer; - /* convert device units to logical */ - for (i = 0; i < count; i++) + if (flags & NTGDI_GETCHARABCWIDTHS_INT) { - abc[i].abcA = width_to_LP( dc, abc[i].abcA ); - abc[i].abcB = width_to_LP( dc, abc[i].abcB ); - abc[i].abcC = width_to_LP( dc, abc[i].abcC ); - } + /* convert device units to logical */ + for (i = 0; i < count; i++) + { + abc[i].abcA = width_to_LP( dc, abc[i].abcA ); + abc[i].abcB = width_to_LP( dc, abc[i].abcB ); + abc[i].abcC = width_to_LP( dc, abc[i].abcC ); + } + } + else + { + /* convert device units to logical */ + FLOAT scale = fabs( dc->xformVport2World.eM11 ); + ABCFLOAT *abcf = buffer; + + for (i = 0; i < count; i++) + { + abcf[i].abcfA = abc[i].abcA * scale; + abcf[i].abcfB = abc[i].abcB * scale; + abcf[i].abcfC = abc[i].abcC * scale; + } + } } release_dc_ptr( dc ); @@ -6335,56 +6354,6 @@ BOOL WINAPI GetCharABCWidthsFloatA( HDC hdc, UINT first, UINT last, LPABCFLOAT a return ret; } -/************************************************************************* - * GetCharABCWidthsFloatW [GDI32.@] - * - * Retrieves widths of a range of characters. - * - * PARAMS - * hdc [I] Handle to device context. - * first [I] First character in range to query. - * last [I] Last character in range to query. - * abcf [O] Array of LPABCFLOAT structures. - * - * RETURNS - * Success: TRUE - * Failure: FALSE - */ -BOOL WINAPI GetCharABCWidthsFloatW( HDC hdc, UINT first, UINT last, LPABCFLOAT abcf ) -{ - UINT i; - ABC *abc; - PHYSDEV dev; - BOOL ret = FALSE; - DC *dc = get_dc_ptr( hdc ); - - TRACE("%p, %d, %d, %p\n", hdc, first, last, abcf); - - if (!dc) return FALSE; - - if (!abcf) goto done; - if (!(abc = HeapAlloc( GetProcessHeap(), 0, (last - first + 1) * sizeof(*abc) ))) goto done; - - dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths ); - ret = dev->funcs->pGetCharABCWidths( dev, first, last - first + 1, NULL, abc ); - if (ret) - { - /* convert device units to logical */ - FLOAT scale = fabs( dc->xformVport2World.eM11 ); - for (i = first; i <= last; i++, abcf++) - { - abcf->abcfA = abc[i - first].abcA * scale; - abcf->abcfB = abc[i - first].abcB * scale; - abcf->abcfC = abc[i - first].abcC * scale; - } - } - HeapFree( GetProcessHeap(), 0, abc ); - -done: - release_dc_ptr( dc ); - return ret; -} - /*********************************************************************** * * * Font Resource API * diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 1238a8f9f45..a119615e002 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1708,6 +1708,15 @@ BOOL WINAPI GetCharABCWidthsA( HDC hdc, UINT first, UINT last, ABC *abc ) return ret; } +/*********************************************************************** + * GetCharABCWidthsFloatW (GDI32.@) + */ +BOOL WINAPI GetCharABCWidthsFloatW( HDC hdc, UINT first, UINT last, ABCFLOAT *abcf ) +{ + TRACE( "%p, %d, %d, %p\n", hdc, first, last, abcf ); + return NtGdiGetCharABCWidthsW( hdc, first, last, NULL, 0, abcf ); +} + /*********************************************************************** * GetCharABCWidthsI (GDI32.@) */
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
106
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
Results per page:
10
25
50
100
200