Jacek Caban : win32u: Implement NtGdiGetDCPoint.
Alexandre Julliard
julliard at winehq.org
Tue Apr 12 15:35:16 CDT 2022
Module: wine
Branch: master
Commit: 43126a5053ce62586d74fd70e87e9a1e7d267569
URL: https://source.winehq.org/git/wine.git/?a=commit;h=43126a5053ce62586d74fd70e87e9a1e7d267569
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Apr 12 13:09:06 2022 +0200
win32u: Implement NtGdiGetDCPoint.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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
@@ -1027,6 +1027,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.@)
*/
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,
More information about the wine-cvs
mailing list