Commit c7171dea authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use syscall interface for bitmap functions.

parent 487ec2d4
......@@ -1077,11 +1077,9 @@ static struct unix_funcs unix_funcs =
NtGdiCloseFigure,
NtGdiCombineRgn,
NtGdiComputeXformCoefficients,
NtGdiCreateBitmap,
NtGdiCreateClientObj,
NtGdiCreateCompatibleBitmap,
NtGdiCreateCompatibleDC,
NtGdiCreateDIBSection,
NtGdiCreateDIBitmapInternal,
NtGdiCreateEllipticRgn,
NtGdiCreateHalftonePalette,
......@@ -1129,8 +1127,6 @@ static struct unix_funcs unix_funcs =
NtGdiFrameRgn,
NtGdiGetAndSetDCDword,
NtGdiGetAppClipBox,
NtGdiGetBitmapBits,
NtGdiGetBitmapDimension,
NtGdiGetBoundsRect,
NtGdiGetCharABCWidthsW,
NtGdiGetCharWidthW,
......@@ -1200,8 +1196,6 @@ static struct unix_funcs unix_funcs =
NtGdiSelectClipPath,
NtGdiSelectFont,
NtGdiSelectPen,
NtGdiSetBitmapBits,
NtGdiSetBitmapDimension,
NtGdiSetBrushOrg,
NtGdiSetBoundsRect,
NtGdiSetColorAdjustment,
......
......@@ -34,11 +34,17 @@
static void * const syscalls[] =
{
NtGdiCreateBitmap,
NtGdiCreateDIBBrush,
NtGdiCreateDIBSection,
NtGdiCreateHatchBrushInternal,
NtGdiCreatePatternBrushInternal,
NtGdiCreateSolidBrush,
NtGdiFlush,
NtGdiGetBitmapBits,
NtGdiGetBitmapDimension,
NtGdiSetBitmapBits,
NtGdiSetBitmapDimension,
};
static BYTE arguments[ARRAY_SIZE(syscalls)];
......
......@@ -139,7 +139,7 @@
@ stdcall NtGdiComputeXformCoefficients(long)
@ stub NtGdiConfigureOPMProtectedOutput
@ stub NtGdiConvertMetafileRect
@ stdcall NtGdiCreateBitmap(long long long long ptr)
@ stdcall -syscall NtGdiCreateBitmap(long long long long ptr)
@ stub NtGdiCreateBitmapFromDxSurface
@ stub NtGdiCreateBitmapFromDxSurface2
@ stdcall NtGdiCreateClientObj(long)
......@@ -148,7 +148,7 @@
@ stdcall NtGdiCreateCompatibleBitmap(long long long)
@ stdcall NtGdiCreateCompatibleDC(long)
@ stdcall -syscall NtGdiCreateDIBBrush(ptr long long long long ptr)
@ stdcall NtGdiCreateDIBSection(long long long ptr long long long long ptr)
@ stdcall -syscall NtGdiCreateDIBSection(long long long ptr long long long long ptr)
@ stdcall NtGdiCreateDIBitmapInternal(long long long long ptr ptr long long long long long)
@ stdcall NtGdiCreateEllipticRgn(long long long long)
@ stdcall NtGdiCreateHalftonePalette(long)
......@@ -444,8 +444,8 @@
@ stdcall NtGdiGetAndSetDCDword(long long long ptr)
@ stdcall NtGdiGetAppClipBox(long ptr)
@ stub NtGdiGetAppliedDeviceGammaRamp
@ stdcall NtGdiGetBitmapBits(long long ptr)
@ stdcall NtGdiGetBitmapDimension(long ptr)
@ stdcall -syscall NtGdiGetBitmapBits(long long ptr)
@ stdcall -syscall NtGdiGetBitmapDimension(long ptr)
@ stub NtGdiGetBitmapDpiScaleValue
@ stdcall NtGdiGetBoundsRect(long ptr long)
@ stub NtGdiGetCOPPCompatibleOPMInformation
......@@ -590,8 +590,8 @@
@ stdcall NtGdiSelectFont(long long)
@ stdcall NtGdiSelectPen(long long)
@ stub NtGdiSetBitmapAttributes
@ stdcall NtGdiSetBitmapBits(long long ptr)
@ stdcall NtGdiSetBitmapDimension(long long long ptr)
@ stdcall -syscall NtGdiSetBitmapBits(long long ptr)
@ stdcall -syscall NtGdiSetBitmapDimension(long long long ptr)
@ stdcall NtGdiSetBoundsRect(long ptr long)
@ stub NtGdiSetBrushAttributes
@ stdcall NtGdiSetBrushOrg(long long long ptr)
......
......@@ -61,14 +61,9 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiCloseFigure)( HDC hdc );
INT (WINAPI *pNtGdiCombineRgn)( HRGN dest, HRGN src1, HRGN src2, INT mode );
BOOL (WINAPI *pNtGdiComputeXformCoefficients)( HDC hdc );
HBITMAP (WINAPI *pNtGdiCreateBitmap)( INT width, INT height, UINT planes,
UINT bpp, const void *bits );
HANDLE (WINAPI *pNtGdiCreateClientObj)( ULONG type );
HBITMAP (WINAPI *pNtGdiCreateCompatibleBitmap)( HDC hdc, INT width, INT height );
HDC (WINAPI *pNtGdiCreateCompatibleDC)( HDC hdc );
HBITMAP (WINAPI *pNtGdiCreateDIBSection)( HDC hdc, HANDLE section, DWORD offset, const BITMAPINFO *bmi,
UINT usage, UINT header_size, ULONG flags,
ULONG_PTR color_space, void **bits );
HBITMAP (WINAPI *pNtGdiCreateDIBitmapInternal)( HDC hdc, INT width, INT height, DWORD init,
const void *bits, const BITMAPINFO *data,
UINT coloruse, UINT max_info, UINT max_bits,
......@@ -128,8 +123,6 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiFrameRgn)( HDC hdc, HRGN hrgn, HBRUSH brush, INT width, INT height );
BOOL (WINAPI *pNtGdiGetAndSetDCDword)( HDC hdc, UINT method, DWORD value, DWORD *result );
INT (WINAPI *pNtGdiGetAppClipBox)( HDC hdc, RECT *rect );
LONG (WINAPI *pNtGdiGetBitmapBits)( HBITMAP bitmap, LONG count, void *bits );
BOOL (WINAPI *pNtGdiGetBitmapDimension)( HBITMAP bitmap, SIZE *size );
UINT (WINAPI *pNtGdiGetBoundsRect)( HDC hdc, RECT *rect, UINT flags );
BOOL (WINAPI *pNtGdiGetCharABCWidthsW)( HDC hdc, UINT first, UINT last, WCHAR *chars,
ULONG flags, void *buffer );
......@@ -224,8 +217,6 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiSelectClipPath)( HDC hdc, INT mode );
HGDIOBJ (WINAPI *pNtGdiSelectFont)( HDC hdc, HGDIOBJ handle );
HGDIOBJ (WINAPI *pNtGdiSelectPen)( HDC hdc, HGDIOBJ handle );
LONG (WINAPI *pNtGdiSetBitmapBits)( HBITMAP hbitmap, LONG count, const void *bits );
BOOL (WINAPI *pNtGdiSetBitmapDimension)( HBITMAP hbitmap, INT x, INT y, SIZE *prev_size );
BOOL (WINAPI *pNtGdiSetBrushOrg)( HDC hdc, INT x, INT y, POINT *prev_org );
UINT (WINAPI *pNtGdiSetBoundsRect)( HDC hdc, const RECT *rect, UINT flags );
BOOL (WINAPI *pNtGdiSetColorAdjustment)( HDC hdc, const COLORADJUSTMENT *ca );
......
......@@ -98,11 +98,6 @@ BOOL WINAPI NtGdiComputeXformCoefficients( HDC hdc )
return unix_funcs->pNtGdiComputeXformCoefficients( hdc );
}
HBITMAP WINAPI NtGdiCreateBitmap( INT width, INT height, UINT planes, UINT bpp, const void *bits )
{
return unix_funcs->pNtGdiCreateBitmap( width, height, planes, bpp, bits );
}
HANDLE WINAPI NtGdiCreateClientObj( ULONG type )
{
return unix_funcs->pNtGdiCreateClientObj( type );
......@@ -118,14 +113,6 @@ HDC WINAPI NtGdiCreateCompatibleDC( HDC hdc )
return unix_funcs->pNtGdiCreateCompatibleDC( hdc );
}
HBITMAP WINAPI NtGdiCreateDIBSection( HDC hdc, HANDLE section, DWORD offset, const BITMAPINFO *bmi,
UINT usage, UINT header_size, ULONG flags,
ULONG_PTR color_space, void **bits )
{
return unix_funcs->pNtGdiCreateDIBSection( hdc, section, offset, bmi, usage, header_size, flags,
color_space, bits );
}
HBITMAP WINAPI NtGdiCreateDIBitmapInternal( HDC hdc, INT width, INT height, DWORD init,
const void *bits, const BITMAPINFO *data,
UINT coloruse, UINT max_info, UINT max_bits,
......@@ -311,16 +298,6 @@ INT WINAPI NtGdiGetAppClipBox( HDC hdc, RECT *rect )
return unix_funcs->pNtGdiGetAppClipBox( hdc, rect );
}
LONG WINAPI NtGdiGetBitmapBits( HBITMAP bitmap, LONG count, void *bits )
{
return unix_funcs->pNtGdiGetBitmapBits( bitmap, count, bits );
}
BOOL WINAPI NtGdiGetBitmapDimension( HBITMAP bitmap, SIZE *size )
{
return unix_funcs->pNtGdiGetBitmapDimension( bitmap, size );
}
UINT WINAPI NtGdiGetBoundsRect( HDC hdc, RECT *rect, UINT flags )
{
return unix_funcs->pNtGdiGetBoundsRect( hdc, rect, flags );
......@@ -695,16 +672,6 @@ HGDIOBJ WINAPI NtGdiSelectPen( HDC hdc, HGDIOBJ handle )
return unix_funcs->pNtGdiSelectPen( hdc, handle );
}
LONG WINAPI NtGdiSetBitmapBits( HBITMAP hbitmap, LONG count, const void *bits )
{
return unix_funcs->pNtGdiSetBitmapBits( hbitmap, count, bits );
}
BOOL WINAPI NtGdiSetBitmapDimension( HBITMAP hbitmap, INT x, INT y, SIZE *prev_size )
{
return unix_funcs->pNtGdiSetBitmapDimension( hbitmap, x, y, prev_size );
}
BOOL WINAPI NtGdiSetBrushOrg( HDC hdc, INT x, INT y, POINT *prev_org )
{
return unix_funcs->pNtGdiSetBrushOrg( hdc, x, y, prev_org );
......
......@@ -27,6 +27,74 @@
#include "ntgdi.h"
#include "wow64win_private.h"
NTSTATUS WINAPI wow64_NtGdiCreateBitmap( UINT *args )
{
INT width = get_ulong( &args );
INT height = get_ulong( &args );
UINT planes = get_ulong( &args );
UINT bpp = get_ulong( &args );
const void *bits = get_ptr( &args );
return HandleToUlong( NtGdiCreateBitmap( width, height, planes, bpp, bits ));
}
NTSTATUS WINAPI wow64_NtGdiGetBitmapBits( UINT *args )
{
HBITMAP bitmap = get_handle( &args );
LONG count = get_ulong( &args );
void *bits = get_ptr( &args );
return NtGdiGetBitmapBits( bitmap, count, bits );
}
NTSTATUS WINAPI wow64_NtGdiSetBitmapBits( UINT *args )
{
HBITMAP hbitmap = get_handle( &args );
LONG count = get_ulong( &args );
const void *bits = get_ptr( &args );
return NtGdiSetBitmapBits( hbitmap, count, bits );
}
NTSTATUS WINAPI wow64_NtGdiGetBitmapDimension( UINT *args )
{
HBITMAP bitmap = get_handle( &args );
SIZE *size = get_ptr( &args );
return NtGdiGetBitmapDimension( bitmap, size );
}
NTSTATUS WINAPI wow64_NtGdiSetBitmapDimension( UINT *args )
{
HBITMAP hbitmap = get_handle( &args );
INT x = get_ulong( &args );
INT y = get_ulong( &args );
SIZE *prev_size = get_ptr( &args );
return NtGdiSetBitmapDimension( hbitmap, x, y, prev_size );
}
NTSTATUS WINAPI wow64_NtGdiCreateDIBSection( UINT *args )
{
HDC hdc = get_handle( &args );
HANDLE section = get_handle( &args );
DWORD offset = get_ulong( &args );
const BITMAPINFO *bmi = get_ptr( &args );
UINT usage = get_ulong( &args );
UINT header_size = get_ulong( &args );
ULONG flags = get_ulong( &args );
ULONG_PTR color_space = get_ulong( &args );
void *bits32 = get_ptr( &args );
void *bits;
HBITMAP ret;
ret = NtGdiCreateDIBSection( hdc, section, offset, bmi, usage, header_size,
flags, color_space, addr_32to64( &bits, bits32 ));
if (ret) put_addr( bits32, bits );
return HandleToUlong( ret );
}
NTSTATUS WINAPI wow64_NtGdiCreateDIBBrush( UINT *args )
{
const void *data = get_ptr( &args );
......
......@@ -22,10 +22,16 @@
#define __WOW64WIN_SYSCALL_H
#define ALL_WIN32_SYSCALLS \
SYSCALL_ENTRY( NtGdiCreateBitmap ) \
SYSCALL_ENTRY( NtGdiCreateDIBBrush ) \
SYSCALL_ENTRY( NtGdiCreateDIBSection ) \
SYSCALL_ENTRY( NtGdiCreateHatchBrushInternal ) \
SYSCALL_ENTRY( NtGdiCreatePatternBrushInternal ) \
SYSCALL_ENTRY( NtGdiCreateSolidBrush ) \
SYSCALL_ENTRY( NtGdiFlush )
SYSCALL_ENTRY( NtGdiFlush ) \
SYSCALL_ENTRY( NtGdiGetBitmapBits ) \
SYSCALL_ENTRY( NtGdiGetBitmapDimension ) \
SYSCALL_ENTRY( NtGdiSetBitmapBits ) \
SYSCALL_ENTRY( NtGdiSetBitmapDimension )
#endif /* __WOW64WIN_SYSCALL_H */
......@@ -31,4 +31,16 @@ static inline ULONG get_ulong( UINT **args ) { return *(*args)++; }
static inline HANDLE get_handle( UINT **args ) { return LongToHandle( *(*args)++ ); }
static inline void *get_ptr( UINT **args ) { return ULongToPtr( *(*args)++ ); }
static inline void **addr_32to64( void **addr, ULONG *addr32 )
{
if (!addr32) return NULL;
*addr = ULongToPtr( *addr32 );
return addr;
}
static inline void put_addr( ULONG *addr32, void *addr )
{
if (addr32) *addr32 = PtrToUlong( addr );
}
#endif /* __WOW64WIN_PRIVATE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment