From 43126a5053ce62586d74fd70e87e9a1e7d267569 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 12 Apr 2022 13:09:06 +0200 Subject: [PATCH] win32u: Implement NtGdiGetDCPoint. Signed-off-by: Jacek Caban Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/win32u/dc.c | 36 ++++++++++++++++++++++++++++++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/gdi.c | 9 +++++++++ dlls/wow64win/syscall.h | 1 + include/ntgdi.h | 8 ++++++++ 6 files changed, 56 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c index 01a9c5d258a..216b3813729 100644 --- a/dlls/win32u/dc.c +++ b/dlls/win32u/dc.c @@ -1028,6 +1028,42 @@ BOOL WINAPI NtGdiGetDCDword( HDC hdc, UINT method, DWORD *result ) /*********************************************************************** + * NtGdiGetDCPoint (win32u.@) + */ +BOOL WINAPI NtGdiGetDCPoint( HDC hdc, UINT method, POINT *result ) +{ + BOOL ret = TRUE; + DC *dc; + + if (!(dc = get_dc_ptr( hdc ))) return 0; + + switch (method) + { + case NtGdiGetBrushOrgEx: + *result = dc->attr->brush_org; + break; + + case NtGdiGetCurrentPosition: + *result = dc->attr->cur_pos; + break; + + case NtGdiGetDCOrg: + result->x = dc->attr->vis_rect.left; + result->y = dc->attr->vis_rect.top; + break; + + default: + WARN( "unknown method %u\n", method ); + ret = FALSE; + break; + } + + release_dc_ptr( dc ); + return ret; +} + + +/*********************************************************************** * NtGdiSetBrushOrg (win32u.@) */ BOOL WINAPI NtGdiSetBrushOrg( HDC hdc, INT x, INT y, POINT *oldorg ) diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index f9e1d67bb6b..d19ab54fa90 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -72,6 +72,7 @@ static void * const syscalls[] = NtGdiGetColorAdjustment, NtGdiGetDCDword, NtGdiGetDCObject, + NtGdiGetDCPoint, NtGdiGetFontFileData, NtGdiGetFontFileInfo, NtGdiGetNearestPaletteIndex, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 522f280f9ae..8c2073d0fb1 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -464,7 +464,7 @@ @ stub NtGdiGetDCDpiScaleValue @ stdcall -syscall NtGdiGetDCDword(long long ptr) @ stdcall -syscall NtGdiGetDCObject(long long) -@ stub NtGdiGetDCPoint +@ stdcall -syscall NtGdiGetDCPoint(long long ptr) @ stub NtGdiGetDCforBitmap @ stdcall NtGdiGetDIBitsInternal(long long long long ptr ptr long long long) @ stdcall NtGdiGetDeviceCaps(long long) diff --git a/dlls/wow64win/gdi.c b/dlls/wow64win/gdi.c index 15dae62c1e0..ed85754640d 100644 --- a/dlls/wow64win/gdi.c +++ b/dlls/wow64win/gdi.c @@ -67,6 +67,15 @@ NTSTATUS WINAPI wow64_NtGdiGetDCObject( UINT *args ) return HandleToUlong( NtGdiGetDCObject( hdc, type )); } +NTSTATUS WINAPI wow64_NtGdiGetDCPoint( UINT *args ) +{ + HDC hdc = get_handle( &args ); + UINT method = get_ulong( &args ); + POINT *result = get_ptr( &args ); + + return NtGdiGetDCPoint( hdc, method, result ); +} + NTSTATUS WINAPI wow64_NtGdiCreateBitmap( UINT *args ) { INT width = get_ulong( &args ); diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 1632f007e34..ba921e7e543 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -59,6 +59,7 @@ SYSCALL_ENTRY( NtGdiGetColorAdjustment ) \ SYSCALL_ENTRY( NtGdiGetDCDword ) \ SYSCALL_ENTRY( NtGdiGetDCObject ) \ + SYSCALL_ENTRY( NtGdiGetDCPoint ) \ SYSCALL_ENTRY( NtGdiGetFontFileData ) \ SYSCALL_ENTRY( NtGdiGetFontFileInfo ) \ SYSCALL_ENTRY( NtGdiGetNearestPaletteIndex ) \ diff --git a/include/ntgdi.h b/include/ntgdi.h index 8f3d4c05178..78d0f620be3 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -131,6 +131,14 @@ enum NtGdiIsMemDC, }; +/* NtGdiGetDCPoint parameter, not compatible with Windows */ +enum +{ + NtGdiGetBrushOrgEx, + NtGdiGetCurrentPosition, + NtGdiGetDCOrg, +}; + enum { NtGdiAnimatePalette, -- 2.11.4.GIT