win32u: Introduce NtUserEnableDC.

And use it instead of SetHookFlags in user.exe.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-03-15 14:28:35 +01:00 committed by Alexandre Julliard
parent 1df20bb22a
commit e17ec9e8b7
8 changed files with 5 additions and 13 deletions

View File

@ -24,8 +24,7 @@
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "ntuser.h"
#include "winreg.h"
#include "winternl.h"
#include "wine/windef16.h"

View File

@ -23,7 +23,6 @@
#include "user_private.h"
#include "wine/list.h"
#include "wine/server.h"
#include "wine/gdi_driver.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(win);
@ -676,7 +675,7 @@ HDC16 WINAPI GetWindowDC16( HWND16 hwnd )
INT16 WINAPI ReleaseDC16( HWND16 hwnd, HDC16 hdc )
{
INT16 ret = (INT16)ReleaseDC( WIN_Handle32(hwnd), HDC_32(hdc) );
SetHookFlags( HDC_32(hdc), DCHF_ENABLEDC );
NtUserCallOneParam( HandleToUlong( HDC_32(hdc) ), NtUserEnableDC );
return ret;
}

View File

@ -1216,7 +1216,6 @@ static struct unix_funcs unix_funcs =
NtUserWindowFromPoint,
SetDIBits,
SetHookFlags,
__wine_get_brush_bitmap_info,
__wine_get_file_outline_text_metric,
__wine_get_icm_profile,

View File

@ -4635,6 +4635,8 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code )
return HandleToUlong( begin_defer_window_pos( arg ));
case NtUserCreateCursorIcon:
return HandleToUlong( alloc_cursoricon_handle( arg ));
case NtUserEnableDC:
return SetHookFlags( UlongToHandle(arg), DCHF_ENABLEDC );
case NtUserGetClipCursor:
return get_clip_cursor( (RECT *)arg );
case NtUserGetCursorPos:

View File

@ -1321,7 +1321,6 @@
# Wine internal extensions
# user32
@ stdcall SetHookFlags(long long)
@ cdecl __wine_set_visible_region(long long ptr ptr ptr)
# Graphics drivers

View File

@ -273,7 +273,6 @@ struct unix_funcs
INT (WINAPI *pSetDIBits)( HDC hdc, HBITMAP hbitmap, UINT startscan,
UINT lines, const void *bits, const BITMAPINFO *info,
UINT coloruse );
WORD (WINAPI *pSetHookFlags)( HDC hdc, WORD flags );
BOOL (CDECL *get_brush_bitmap_info)( HBRUSH handle, BITMAPINFO *info, void *bits, UINT *usage );
BOOL (CDECL *get_file_outline_text_metric)( const WCHAR *path, OUTLINETEXTMETRICW *otm );
BOOL (CDECL *get_icm_profile)( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename );

View File

@ -1112,12 +1112,6 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
return unix_funcs->pSetDIBits( hdc, hbitmap, startscan, lines, bits, info, coloruse );
}
WORD WINAPI SetHookFlags( HDC hdc, WORD flags )
{
if (!unix_funcs) return 0;
return unix_funcs->pSetHookFlags( hdc, flags );
}
BOOL CDECL __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename )
{
if (!unix_funcs) return FALSE;

View File

@ -99,6 +99,7 @@ enum
{
NtUserBeginDeferWindowPos,
NtUserCreateCursorIcon,
NtUserEnableDC,
NtUserGetClipCursor,
NtUserGetCursorPos,
NtUserGetIconParam,