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

win32u: Move NtUserGetDCEx implementation from user32.

parent 4bb7e5af
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "ntuser.h"
#include "wine/server.h" #include "wine/server.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -52,7 +52,7 @@ static void CARET_DisplayCaret( HWND hwnd, const RECT *r ) ...@@ -52,7 +52,7 @@ static void CARET_DisplayCaret( HWND hwnd, const RECT *r )
HDC hCompDC; HDC hCompDC;
/* do not use DCX_CACHE here, for x,y,width,height are in logical units */ /* do not use DCX_CACHE here, for x,y,width,height are in logical units */
if (!(hdc = GetDCEx( hwnd, 0, DCX_USESTYLE /*| DCX_CACHE*/ ))) return; if (!(hdc = NtUserGetDCEx( hwnd, 0, DCX_USESTYLE /*| DCX_CACHE*/ ))) return;
hCompDC = CreateCompatibleDC(hdc); hCompDC = CreateCompatibleDC(hdc);
if (hCompDC) if (hCompDC)
{ {
......
...@@ -361,26 +361,6 @@ WNDPROC get_class_winproc( CLASS *class ) ...@@ -361,26 +361,6 @@ WNDPROC get_class_winproc( CLASS *class )
/*********************************************************************** /***********************************************************************
* get_class_dce
*/
struct dce *get_class_dce( CLASS *class )
{
return class->dce;
}
/***********************************************************************
* set_class_dce
*/
struct dce *set_class_dce( CLASS *class, struct dce *dce )
{
if (class->dce) return class->dce; /* already set, don't change it */
class->dce = dce;
return dce;
}
/***********************************************************************
* RegisterClassA (USER32.@) * RegisterClassA (USER32.@)
* *
* Register a window class. * Register a window class.
......
...@@ -115,8 +115,6 @@ extern ATOM get_int_atom_value( UNICODE_STRING *name ) DECLSPEC_HIDDEN; ...@@ -115,8 +115,6 @@ extern ATOM get_int_atom_value( UNICODE_STRING *name ) DECLSPEC_HIDDEN;
extern void register_builtin_classes(void) DECLSPEC_HIDDEN; extern void register_builtin_classes(void) DECLSPEC_HIDDEN;
extern void register_desktop_class(void) DECLSPEC_HIDDEN; extern void register_desktop_class(void) DECLSPEC_HIDDEN;
extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN; extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN;
extern struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN;
extern struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN;
/* defwnd proc */ /* defwnd proc */
extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN; extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
......
...@@ -83,11 +83,6 @@ static void CDECL nulldrv_DestroyWindow( HWND hwnd ) ...@@ -83,11 +83,6 @@ static void CDECL nulldrv_DestroyWindow( HWND hwnd )
{ {
} }
static void CDECL nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
const RECT *top_rect, DWORD flags )
{
}
static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout, static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
DWORD mask, DWORD flags ) DWORD mask, DWORD flags )
{ {
...@@ -96,10 +91,6 @@ static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDL ...@@ -96,10 +91,6 @@ static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDL
timeout, flags & MWMO_ALERTABLE ); timeout, flags & MWMO_ALERTABLE );
} }
static void CDECL nulldrv_ReleaseDC( HWND hwnd, HDC hdc )
{
}
static void CDECL nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent ) static void CDECL nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent )
{ {
} }
...@@ -163,12 +154,6 @@ static BOOL CDECL loaderdrv_CreateWindow( HWND hwnd ) ...@@ -163,12 +154,6 @@ static BOOL CDECL loaderdrv_CreateWindow( HWND hwnd )
return load_driver()->pCreateWindow( hwnd ); return load_driver()->pCreateWindow( hwnd );
} }
static void CDECL loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
const RECT *top_rect, DWORD flags )
{
load_driver()->pGetDC( hdc, hwnd, top_win, win_rect, top_rect, flags );
}
static struct user_driver_funcs lazy_load_driver = static struct user_driver_funcs lazy_load_driver =
{ {
{ NULL }, { NULL },
...@@ -199,9 +184,9 @@ static struct user_driver_funcs lazy_load_driver = ...@@ -199,9 +184,9 @@ static struct user_driver_funcs lazy_load_driver =
loaderdrv_CreateWindow, loaderdrv_CreateWindow,
nulldrv_DestroyWindow, nulldrv_DestroyWindow,
NULL, NULL,
loaderdrv_GetDC, NULL,
nulldrv_MsgWaitForMultipleObjectsEx, nulldrv_MsgWaitForMultipleObjectsEx,
nulldrv_ReleaseDC, NULL,
NULL, NULL,
NULL, NULL,
NULL, NULL,
...@@ -247,9 +232,7 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v ...@@ -247,9 +232,7 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v
SET_USER_FUNC(UpdateClipboard); SET_USER_FUNC(UpdateClipboard);
SET_USER_FUNC(CreateWindow); SET_USER_FUNC(CreateWindow);
SET_USER_FUNC(DestroyWindow); SET_USER_FUNC(DestroyWindow);
SET_USER_FUNC(GetDC);
SET_USER_FUNC(MsgWaitForMultipleObjectsEx); SET_USER_FUNC(MsgWaitForMultipleObjectsEx);
SET_USER_FUNC(ReleaseDC);
SET_USER_FUNC(SetParent); SET_USER_FUNC(SetParent);
SET_USER_FUNC(SetWindowIcon); SET_USER_FUNC(SetWindowIcon);
SET_USER_FUNC(SetWindowStyle); SET_USER_FUNC(SetWindowStyle);
......
...@@ -775,7 +775,7 @@ static void LISTBOX_RepaintItem( LB_DESCR *descr, INT index, UINT action ) ...@@ -775,7 +775,7 @@ static void LISTBOX_RepaintItem( LB_DESCR *descr, INT index, UINT action )
return; return;
} }
if (LISTBOX_GetItemRect( descr, index, &rect ) != 1) return; if (LISTBOX_GetItemRect( descr, index, &rect ) != 1) return;
if (!(hdc = GetDCEx( descr->self, 0, DCX_CACHE ))) return; if (!(hdc = NtUserGetDCEx( descr->self, 0, DCX_CACHE ))) return;
if (descr->font) oldFont = SelectObject( hdc, descr->font ); if (descr->font) oldFont = SelectObject( hdc, descr->font );
hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX, hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
(WPARAM)hdc, (LPARAM)descr->self ); (WPARAM)hdc, (LPARAM)descr->self );
...@@ -806,7 +806,7 @@ static void LISTBOX_DrawFocusRect( LB_DESCR *descr, BOOL on ) ...@@ -806,7 +806,7 @@ static void LISTBOX_DrawFocusRect( LB_DESCR *descr, BOOL on )
if (!descr->caret_on || !descr->in_focus) return; if (!descr->caret_on || !descr->in_focus) return;
if (LISTBOX_GetItemRect( descr, descr->focus_item, &rect ) != 1) return; if (LISTBOX_GetItemRect( descr, descr->focus_item, &rect ) != 1) return;
if (!(hdc = GetDCEx( descr->self, 0, DCX_CACHE ))) return; if (!(hdc = NtUserGetDCEx( descr->self, 0, DCX_CACHE ))) return;
if (descr->font) oldFont = SelectObject( hdc, descr->font ); if (descr->font) oldFont = SelectObject( hdc, descr->font );
if (!IsWindowEnabled(descr->self)) if (!IsWindowEnabled(descr->self))
SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) ); SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
...@@ -1408,7 +1408,7 @@ static INT LISTBOX_SetFont( LB_DESCR *descr, HFONT font ) ...@@ -1408,7 +1408,7 @@ static INT LISTBOX_SetFont( LB_DESCR *descr, HFONT font )
descr->font = font; descr->font = font;
if (!(hdc = GetDCEx( descr->self, 0, DCX_CACHE ))) if (!(hdc = NtUserGetDCEx( descr->self, 0, DCX_CACHE )))
{ {
ERR("unable to get DC.\n" ); ERR("unable to get DC.\n" );
return 16; return 16;
......
...@@ -2035,7 +2035,7 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex, ...@@ -2035,7 +2035,7 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex,
if (lppop->FocusedItem == wIndex) return; if (lppop->FocusedItem == wIndex) return;
if (lppop->wFlags & MF_POPUP) hdc = GetDC( lppop->hWnd ); if (lppop->wFlags & MF_POPUP) hdc = GetDC( lppop->hWnd );
else hdc = GetDCEx( lppop->hWnd, 0, DCX_CACHE | DCX_WINDOW); else hdc = NtUserGetDCEx( lppop->hWnd, 0, DCX_CACHE | DCX_WINDOW);
if (!top_popup) { if (!top_popup) {
top_popup = lppop->hWnd; top_popup = lppop->hWnd;
top_popup_hmenu = hmenu; top_popup_hmenu = hmenu;
...@@ -2382,7 +2382,7 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu, ...@@ -2382,7 +2382,7 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
if (!(item->fState & MF_HILITE)) if (!(item->fState & MF_HILITE))
{ {
if (menu->wFlags & MF_POPUP) hdc = GetDC( menu->hWnd ); if (menu->wFlags & MF_POPUP) hdc = GetDC( menu->hWnd );
else hdc = GetDCEx( menu->hWnd, 0, DCX_CACHE | DCX_WINDOW); else hdc = NtUserGetDCEx( menu->hWnd, 0, DCX_CACHE | DCX_WINDOW);
SelectObject( hdc, get_menu_font(FALSE)); SelectObject( hdc, get_menu_font(FALSE));
...@@ -3642,7 +3642,7 @@ UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth, ...@@ -3642,7 +3642,7 @@ UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
if (!(lppop = MENU_GetMenu( GetMenu(hwnd) ))) return 0; if (!(lppop = MENU_GetMenu( GetMenu(hwnd) ))) return 0;
hdc = GetDCEx( hwnd, 0, DCX_CACHE | DCX_WINDOW ); hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_WINDOW );
SelectObject( hdc, get_menu_font(FALSE)); SelectObject( hdc, get_menu_font(FALSE));
SetRect(&rectBar, orgX, orgY, orgX+menubarWidth, orgY+GetSystemMetrics(SM_CYMENU)); SetRect(&rectBar, orgX, orgY, orgX+menubarWidth, orgY+GetSystemMetrics(SM_CYMENU));
MENU_MenuBarCalcSize( hdc, &rectBar, lppop, hwnd ); MENU_MenuBarCalcSize( hdc, &rectBar, lppop, hwnd );
......
...@@ -998,11 +998,11 @@ static void NC_DoNCPaint( HWND hwnd, HRGN clip ) ...@@ -998,11 +998,11 @@ static void NC_DoNCPaint( HWND hwnd, HRGN clip )
if (clip > (HRGN)1) if (clip > (HRGN)1)
{ {
CombineRgn( hrgn, clip, hrgn, RGN_DIFF ); CombineRgn( hrgn, clip, hrgn, RGN_DIFF );
hdc = GetDCEx( hwnd, hrgn, DCX_USESTYLE | DCX_WINDOW | DCX_INTERSECTRGN ); hdc = NtUserGetDCEx( hwnd, hrgn, DCX_USESTYLE | DCX_WINDOW | DCX_INTERSECTRGN );
} }
else else
{ {
hdc = GetDCEx( hwnd, hrgn, DCX_USESTYLE | DCX_WINDOW | DCX_EXCLUDERGN ); hdc = NtUserGetDCEx( hwnd, hrgn, DCX_USESTYLE | DCX_WINDOW | DCX_EXCLUDERGN );
} }
if (!hdc) if (!hdc)
......
...@@ -732,8 +732,7 @@ void SCROLL_DrawNCScrollBar( HWND hwnd, HDC hdc, BOOL draw_horizontal, BOOL draw ...@@ -732,8 +732,7 @@ void SCROLL_DrawNCScrollBar( HWND hwnd, HDC hdc, BOOL draw_horizontal, BOOL draw
static void SCROLL_RefreshScrollBar( HWND hwnd, INT nBar, static void SCROLL_RefreshScrollBar( HWND hwnd, INT nBar,
BOOL arrows, BOOL interior ) BOOL arrows, BOOL interior )
{ {
HDC hdc = GetDCEx( hwnd, 0, HDC hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW) );
DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW) );
if (!hdc) return; if (!hdc) return;
SCROLL_DrawScrollBar( hwnd, hdc, nBar, g_tracking_info.hit_test, &g_tracking_info, arrows, interior ); SCROLL_DrawScrollBar( hwnd, hdc, nBar, g_tracking_info.hit_test, &g_tracking_info, arrows, interior );
...@@ -836,7 +835,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt ) ...@@ -836,7 +835,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt )
return; return;
} }
hdc = GetDCEx( hwnd, 0, DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW)); hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW));
vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect, vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect,
&arrowSize, &thumbSize, &thumbPos ); &arrowSize, &thumbSize, &thumbPos );
hwndOwner = (nBar == SB_CTL) ? GetParent(hwnd) : hwnd; hwndOwner = (nBar == SB_CTL) ? GetParent(hwnd) : hwnd;
......
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
@ stdcall GetCursorInfo(ptr) NtUserGetCursorInfo @ stdcall GetCursorInfo(ptr) NtUserGetCursorInfo
@ stdcall GetCursorPos(ptr) @ stdcall GetCursorPos(ptr)
@ stdcall GetDC(long) @ stdcall GetDC(long)
@ stdcall GetDCEx(long long long) @ stdcall GetDCEx(long long long) NtUserGetDCEx
@ stdcall GetDesktopWindow() @ stdcall GetDesktopWindow()
@ stdcall GetDialogBaseUnits() @ stdcall GetDialogBaseUnits()
@ stdcall GetDisplayAutoRotationPreferences(ptr) @ stdcall GetDisplayAutoRotationPreferences(ptr)
......
...@@ -151,7 +151,6 @@ static const struct user_callbacks user_funcs = ...@@ -151,7 +151,6 @@ static const struct user_callbacks user_funcs =
SendNotifyMessageW, SendNotifyMessageW,
SetWindowPos, SetWindowPos,
WaitForInputIdle, WaitForInputIdle,
free_dce,
notify_ime, notify_ime,
register_builtin_classes, register_builtin_classes,
MSG_SendInternalMessageTimeout, MSG_SendInternalMessageTimeout,
......
...@@ -110,8 +110,6 @@ extern void create_offscreen_window_surface( const RECT *visible_rect, struct wi ...@@ -110,8 +110,6 @@ extern void create_offscreen_window_surface( const RECT *visible_rect, struct wi
extern void CLIPBOARD_ReleaseOwner( HWND hwnd ) DECLSPEC_HIDDEN; extern void CLIPBOARD_ReleaseOwner( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL FOCUS_MouseActivate( HWND hwnd ) DECLSPEC_HIDDEN; extern BOOL FOCUS_MouseActivate( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECLSPEC_HIDDEN; extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECLSPEC_HIDDEN;
extern void WINAPI free_dce( struct dce *dce, HWND hwnd ) DECLSPEC_HIDDEN;
extern void invalidate_dce( struct tagWND *win, const RECT *rect ) DECLSPEC_HIDDEN;
extern HDC get_display_dc(void) DECLSPEC_HIDDEN; extern HDC get_display_dc(void) DECLSPEC_HIDDEN;
extern void release_display_dc( HDC hdc ) DECLSPEC_HIDDEN; extern void release_display_dc( HDC hdc ) DECLSPEC_HIDDEN;
extern void erase_now( HWND hwnd, UINT rdw_flags ) DECLSPEC_HIDDEN; extern void erase_now( HWND hwnd, UINT rdw_flags ) DECLSPEC_HIDDEN;
......
...@@ -2729,7 +2729,7 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam ) ...@@ -2729,7 +2729,7 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
} }
/* Retrieve a default cache DC (without using the window style) */ /* Retrieve a default cache DC (without using the window style) */
hdc = GetDCEx( parent, 0, DCX_CACHE ); hdc = NtUserGetDCEx( parent, 0, DCX_CACHE );
/* we only allow disabling the full window drag for child windows */ /* we only allow disabling the full window drag for child windows */
if (parent) SystemParametersInfoW( SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0 ); if (parent) SystemParametersInfoW( SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0 );
......
...@@ -272,6 +272,24 @@ static CLASS *find_class( HINSTANCE module, UNICODE_STRING *name ) ...@@ -272,6 +272,24 @@ static CLASS *find_class( HINSTANCE module, UNICODE_STRING *name )
} }
/*********************************************************************** /***********************************************************************
* get_class_dce
*/
struct dce *get_class_dce( CLASS *class )
{
return class->dce;
}
/***********************************************************************
* set_class_dce
*/
struct dce *set_class_dce( CLASS *class, struct dce *dce )
{
if (class->dce) return class->dce; /* already set, don't change it */
class->dce = dce;
return dce;
}
/***********************************************************************
* NtUserRegisterClassExWOW (win32u.@) * NtUserRegisterClassExWOW (win32u.@)
*/ */
ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *name, UNICODE_STRING *version, ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *name, UNICODE_STRING *version,
...@@ -399,7 +417,7 @@ BOOL WINAPI NtUserUnregisterClass( UNICODE_STRING *name, HINSTANCE instance, ...@@ -399,7 +417,7 @@ BOOL WINAPI NtUserUnregisterClass( UNICODE_STRING *name, HINSTANCE instance,
TRACE( "%p\n", class ); TRACE( "%p\n", class );
user_lock(); user_lock();
if (class->dce && user_callbacks) user_callbacks->free_dce( class->dce, 0 ); if (class->dce) free_dce( class->dce, 0 );
list_remove( &class->entry ); list_remove( &class->entry );
if (class->hbrBackground > (HBRUSH)(COLOR_GRADIENTINACTIVECAPTION + 1)) if (class->hbrBackground > (HBRUSH)(COLOR_GRADIENTINACTIVECAPTION + 1))
NtGdiDeleteObjectApp( class->hbrBackground ); NtGdiDeleteObjectApp( class->hbrBackground );
......
...@@ -1132,6 +1132,12 @@ static BOOL CDECL loaderdrv_CreateDesktopWindow( HWND hwnd ) ...@@ -1132,6 +1132,12 @@ static BOOL CDECL loaderdrv_CreateDesktopWindow( HWND hwnd )
return load_driver()->pCreateDesktopWindow( hwnd ); return load_driver()->pCreateDesktopWindow( hwnd );
} }
static void CDECL loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
const RECT *top_rect, DWORD flags )
{
load_driver()->pGetDC( hdc, hwnd, top_win, win_rect, top_rect, flags );
}
static void CDECL loaderdrv_FlashWindowEx( FLASHWINFO *info ) static void CDECL loaderdrv_FlashWindowEx( FLASHWINFO *info )
{ {
load_driver()->pFlashWindowEx( info ); load_driver()->pFlashWindowEx( info );
...@@ -1185,10 +1191,12 @@ static const struct user_driver_funcs lazy_load_driver = ...@@ -1185,10 +1191,12 @@ static const struct user_driver_funcs lazy_load_driver =
/* windowing functions */ /* windowing functions */
.pCreateDesktopWindow = loaderdrv_CreateDesktopWindow, .pCreateDesktopWindow = loaderdrv_CreateDesktopWindow,
.pFlashWindowEx = loaderdrv_FlashWindowEx, .pFlashWindowEx = loaderdrv_FlashWindowEx,
.pGetDC = loaderdrv_GetDC,
.pSetCapture = nulldrv_SetCapture, .pSetCapture = nulldrv_SetCapture,
.pSetLayeredWindowAttributes = loaderdrv_SetLayeredWindowAttributes, .pSetLayeredWindowAttributes = loaderdrv_SetLayeredWindowAttributes,
.pSetWindowRgn = loaderdrv_SetWindowRgn, .pSetWindowRgn = loaderdrv_SetWindowRgn,
.pMsgWaitForMultipleObjectsEx = nulldrv_MsgWaitForMultipleObjectsEx, .pMsgWaitForMultipleObjectsEx = nulldrv_MsgWaitForMultipleObjectsEx,
.pReleaseDC = nulldrv_ReleaseDC,
.pScrollDC = nulldrv_ScrollDC, .pScrollDC = nulldrv_ScrollDC,
.pSetFocus = nulldrv_SetFocus, .pSetFocus = nulldrv_SetFocus,
.pUpdateLayeredWindow = loaderdrv_UpdateLayeredWindow, .pUpdateLayeredWindow = loaderdrv_UpdateLayeredWindow,
......
...@@ -1168,6 +1168,7 @@ static struct unix_funcs unix_funcs = ...@@ -1168,6 +1168,7 @@ static struct unix_funcs unix_funcs =
NtUserGetAsyncKeyState, NtUserGetAsyncKeyState,
NtUserGetClassInfoEx, NtUserGetClassInfoEx,
NtUserGetCursorInfo, NtUserGetCursorInfo,
NtUserGetDCEx,
NtUserGetDisplayConfigBufferSizes, NtUserGetDisplayConfigBufferSizes,
NtUserGetIconInfo, NtUserGetIconInfo,
NtUserGetKeyNameText, NtUserGetKeyNameText,
...@@ -1206,7 +1207,6 @@ static struct unix_funcs unix_funcs = ...@@ -1206,7 +1207,6 @@ static struct unix_funcs unix_funcs =
NtUserWindowFromPoint, NtUserWindowFromPoint,
GetDCHook, GetDCHook,
SetDCHook,
SetDIBits, SetDIBits,
SetHookFlags, SetHookFlags,
__wine_get_brush_bitmap_info, __wine_get_brush_bitmap_info,
......
...@@ -38,7 +38,6 @@ struct user_callbacks ...@@ -38,7 +38,6 @@ struct user_callbacks
BOOL (WINAPI *pSendNotifyMessageW)( HWND, UINT, WPARAM, LPARAM ); BOOL (WINAPI *pSendNotifyMessageW)( HWND, UINT, WPARAM, LPARAM );
BOOL (WINAPI *pSetWindowPos)( HWND, HWND, INT, INT, INT, INT, UINT ); BOOL (WINAPI *pSetWindowPos)( HWND, HWND, INT, INT, INT, INT, UINT );
DWORD (WINAPI *pWaitForInputIdle)( HANDLE, DWORD ); DWORD (WINAPI *pWaitForInputIdle)( HANDLE, DWORD );
void (WINAPI *free_dce)( struct dce *dce, HWND hwnd );
void (CDECL *notify_ime)( HWND hwnd, UINT param ); void (CDECL *notify_ime)( HWND hwnd, UINT param );
void (CDECL *register_builtin_classes)(void); void (CDECL *register_builtin_classes)(void);
LRESULT (WINAPI *send_ll_message)( DWORD, DWORD, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR ); LRESULT (WINAPI *send_ll_message)( DWORD, DWORD, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR );
...@@ -243,10 +242,16 @@ ULONG_PTR get_class_long_ptr( HWND hwnd, INT offset, BOOL ansi ) DECLSPEC_HIDDEN ...@@ -243,10 +242,16 @@ ULONG_PTR get_class_long_ptr( HWND hwnd, INT offset, BOOL ansi ) DECLSPEC_HIDDEN
WORD get_class_word( HWND hwnd, INT offset ) DECLSPEC_HIDDEN; WORD get_class_word( HWND hwnd, INT offset ) DECLSPEC_HIDDEN;
ATOM get_int_atom_value( UNICODE_STRING *name ) DECLSPEC_HIDDEN; ATOM get_int_atom_value( UNICODE_STRING *name ) DECLSPEC_HIDDEN;
WNDPROC get_winproc( WNDPROC proc, BOOL ansi ) DECLSPEC_HIDDEN; WNDPROC get_winproc( WNDPROC proc, BOOL ansi ) DECLSPEC_HIDDEN;
struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN;
struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN;
/* cursoricon.c */ /* cursoricon.c */
HICON alloc_cursoricon_handle( BOOL is_icon ) DECLSPEC_HIDDEN; HICON alloc_cursoricon_handle( BOOL is_icon ) DECLSPEC_HIDDEN;
/* dce.c */
extern void free_dce( struct dce *dce, HWND hwnd ) DECLSPEC_HIDDEN;
extern void invalidate_dce( WND *win, const RECT *extra_rect ) DECLSPEC_HIDDEN;
/* message.c */ /* message.c */
LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
......
...@@ -4720,10 +4720,16 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code ...@@ -4720,10 +4720,16 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code
return HandleToUlong( alloc_user_handle( (struct user_object *)arg1, arg2 )); return HandleToUlong( alloc_user_handle( (struct user_object *)arg1, arg2 ));
case NtUserAllocWinProc: case NtUserAllocWinProc:
return (UINT_PTR)alloc_winproc( (WNDPROC)arg1, arg2 ); return (UINT_PTR)alloc_winproc( (WNDPROC)arg1, arg2 );
case NtUserFreeDCE:
free_dce( (struct dce *)arg1, UlongToHandle(arg2) );
return 0;
case NtUserFreeHandle: case NtUserFreeHandle:
return (UINT_PTR)free_user_handle( UlongToHandle(arg1), arg2 ); return (UINT_PTR)free_user_handle( UlongToHandle(arg1), arg2 );
case NtUserGetHandlePtr: case NtUserGetHandlePtr:
return (UINT_PTR)get_user_handle_ptr( UlongToHandle(arg1), arg2 ); return (UINT_PTR)get_user_handle_ptr( UlongToHandle(arg1), arg2 );
case NtUserInvalidateDCE:
invalidate_dce( (void *)arg1, (const RECT *)arg2 );
return 0;
case NtUserRegisterWindowSurface: case NtUserRegisterWindowSurface:
register_window_surface( (struct window_surface *)arg1, (struct window_surface *)arg2 ); register_window_surface( (struct window_surface *)arg1, (struct window_surface *)arg2 );
return 0; return 0;
......
...@@ -916,7 +916,7 @@ ...@@ -916,7 +916,7 @@
@ stdcall -syscall NtUserGetCursorFrameInfo(long long ptr ptr) @ stdcall -syscall NtUserGetCursorFrameInfo(long long ptr ptr)
@ stdcall NtUserGetCursorInfo(ptr) @ stdcall NtUserGetCursorInfo(ptr)
@ stub NtUserGetDC @ stub NtUserGetDC
@ stub NtUserGetDCEx @ stdcall NtUserGetDCEx(long long long)
@ stub NtUserGetDManipHookInitFunction @ stub NtUserGetDManipHookInitFunction
@ stub NtUserGetDesktopID @ stub NtUserGetDesktopID
@ stub NtUserGetDisplayAutoRotationPreferences @ stub NtUserGetDisplayAutoRotationPreferences
...@@ -1322,7 +1322,6 @@ ...@@ -1322,7 +1322,6 @@
# user32 # user32
@ stdcall GetDCHook(long ptr) @ stdcall GetDCHook(long ptr)
@ stdcall SetDCHook(long ptr long)
@ stdcall SetHookFlags(long long) @ stdcall SetHookFlags(long long)
@ cdecl __wine_set_visible_region(long long ptr ptr ptr) @ cdecl __wine_set_visible_region(long long ptr ptr ptr)
......
...@@ -207,6 +207,7 @@ struct unix_funcs ...@@ -207,6 +207,7 @@ struct unix_funcs
ATOM (WINAPI *pNtUserGetClassInfoEx)( HINSTANCE instance, UNICODE_STRING *name, WNDCLASSEXW *wc, ATOM (WINAPI *pNtUserGetClassInfoEx)( HINSTANCE instance, UNICODE_STRING *name, WNDCLASSEXW *wc,
struct client_menu_name *menu_name, BOOL ansi ); struct client_menu_name *menu_name, BOOL ansi );
BOOL (WINAPI *pNtUserGetCursorInfo)( CURSORINFO *info ); BOOL (WINAPI *pNtUserGetCursorInfo)( CURSORINFO *info );
HDC (WINAPI *pNtUserGetDCEx)( HWND hwnd, HRGN clip_rgn, DWORD flags );
LONG (WINAPI *pNtUserGetDisplayConfigBufferSizes)( UINT32 flags, UINT32 *num_path_info, LONG (WINAPI *pNtUserGetDisplayConfigBufferSizes)( UINT32 flags, UINT32 *num_path_info,
UINT32 *num_mode_info ); UINT32 *num_mode_info );
BOOL (WINAPI *pNtUserGetIconInfo)( HICON icon, ICONINFO *info, UNICODE_STRING *module, BOOL (WINAPI *pNtUserGetIconInfo)( HICON icon, ICONINFO *info, UNICODE_STRING *module,
...@@ -259,7 +260,6 @@ struct unix_funcs ...@@ -259,7 +260,6 @@ struct unix_funcs
/* Wine-specific functions */ /* Wine-specific functions */
DWORD_PTR (WINAPI *pGetDCHook)( HDC hdc, DCHOOKPROC *proc ); DWORD_PTR (WINAPI *pGetDCHook)( HDC hdc, DCHOOKPROC *proc );
BOOL (WINAPI *pSetDCHook)( HDC hdc, DCHOOKPROC proc, DWORD_PTR data );
INT (WINAPI *pSetDIBits)( HDC hdc, HBITMAP hbitmap, UINT startscan, INT (WINAPI *pSetDIBits)( HDC hdc, HBITMAP hbitmap, UINT startscan,
UINT lines, const void *bits, const BITMAPINFO *info, UINT lines, const void *bits, const BITMAPINFO *info,
UINT coloruse ); UINT coloruse );
...@@ -329,12 +329,17 @@ struct tagWND; ...@@ -329,12 +329,17 @@ struct tagWND;
extern HWND get_desktop_window(void) DECLSPEC_HIDDEN; extern HWND get_desktop_window(void) DECLSPEC_HIDDEN;
extern HWND get_full_window_handle( HWND hwnd ) DECLSPEC_HIDDEN; extern HWND get_full_window_handle( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN; extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN;
extern DPI_AWARENESS_CONTEXT get_window_dpi_awareness_context( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL get_window_placement( HWND hwnd, WINDOWPLACEMENT *placement ) DECLSPEC_HIDDEN; extern BOOL get_window_placement( HWND hwnd, WINDOWPLACEMENT *placement ) DECLSPEC_HIDDEN;
extern DWORD get_window_thread( HWND hwnd, DWORD *process ) DECLSPEC_HIDDEN; extern DWORD get_window_thread( HWND hwnd, DWORD *process ) DECLSPEC_HIDDEN;
extern HWND is_current_process_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND is_current_thread_window( HWND hwnd ) DECLSPEC_HIDDEN; extern HWND is_current_thread_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL is_iconic( HWND hwnd ) DECLSPEC_HIDDEN; extern BOOL is_iconic( HWND hwnd ) DECLSPEC_HIDDEN;
extern DWORD get_window_long( HWND hwnd, INT offset ) DECLSPEC_HIDDEN; extern DWORD get_window_long( HWND hwnd, INT offset ) DECLSPEC_HIDDEN;
extern BOOL get_window_rect( HWND hwnd, RECT *rect, UINT dpi ) DECLSPEC_HIDDEN; extern BOOL get_window_rect( HWND hwnd, RECT *rect, UINT dpi ) DECLSPEC_HIDDEN;
enum coords_relative;
extern BOOL get_window_rects( HWND hwnd, enum coords_relative relative, RECT *window_rect,
RECT *client_rect, UINT dpi ) DECLSPEC_HIDDEN;
extern HWND *list_window_children( HDESK desktop, HWND hwnd, UNICODE_STRING *class, extern HWND *list_window_children( HDESK desktop, HWND hwnd, UNICODE_STRING *class,
DWORD tid ) DECLSPEC_HIDDEN; DWORD tid ) DECLSPEC_HIDDEN;
extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN; extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN;
......
...@@ -258,6 +258,22 @@ HWND is_current_thread_window( HWND hwnd ) ...@@ -258,6 +258,22 @@ HWND is_current_thread_window( HWND hwnd )
return ret; return ret;
} }
/***********************************************************************
* is_current_process_window
*
* Check whether a given window belongs to the current process (and return the full handle).
*/
HWND is_current_process_window( HWND hwnd )
{
WND *ptr;
HWND ret;
if (!(ptr = get_win_ptr( hwnd )) || ptr == WND_OTHER_PROCESS || ptr == WND_DESKTOP) return 0;
ret = ptr->obj.handle;
release_win_ptr( ptr );
return ret;
}
/* see IsWindow */ /* see IsWindow */
BOOL is_window( HWND hwnd ) BOOL is_window( HWND hwnd )
{ {
...@@ -686,7 +702,7 @@ static BOOL is_window_unicode( HWND hwnd ) ...@@ -686,7 +702,7 @@ static BOOL is_window_unicode( HWND hwnd )
} }
/* see GetWindowDpiAwarenessContext */ /* see GetWindowDpiAwarenessContext */
static DPI_AWARENESS_CONTEXT get_window_dpi_awareness_context( HWND hwnd ) DPI_AWARENESS_CONTEXT get_window_dpi_awareness_context( HWND hwnd )
{ {
DPI_AWARENESS_CONTEXT ret = 0; DPI_AWARENESS_CONTEXT ret = 0;
WND *win; WND *win;
......
...@@ -814,6 +814,12 @@ BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info ) ...@@ -814,6 +814,12 @@ BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info )
return unix_funcs->pNtUserGetCursorInfo( info ); return unix_funcs->pNtUserGetCursorInfo( info );
} }
HDC WINAPI NtUserGetDCEx( HWND hwnd, HRGN clip_rgn, DWORD flags )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserGetDCEx( hwnd, clip_rgn, flags );
}
LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info, LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info,
UINT32 *num_mode_info ) UINT32 *num_mode_info )
{ {
...@@ -1047,12 +1053,6 @@ DWORD_PTR WINAPI GetDCHook( HDC hdc, DCHOOKPROC *proc ) ...@@ -1047,12 +1053,6 @@ DWORD_PTR WINAPI GetDCHook( HDC hdc, DCHOOKPROC *proc )
return unix_funcs->pGetDCHook( hdc, proc ); return unix_funcs->pGetDCHook( hdc, proc );
} }
BOOL WINAPI SetDCHook( HDC hdc, DCHOOKPROC proc, DWORD_PTR data )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pSetDCHook( hdc, proc, data );
}
INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan, INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
UINT lines, const void *bits, const BITMAPINFO *info, UINT lines, const void *bits, const BITMAPINFO *info,
UINT coloruse ) UINT coloruse )
......
...@@ -133,8 +133,10 @@ enum ...@@ -133,8 +133,10 @@ enum
/* temporary exports */ /* temporary exports */
NtUserAllocHandle, NtUserAllocHandle,
NtUserAllocWinProc, NtUserAllocWinProc,
NtUserFreeDCE,
NtUserFreeHandle, NtUserFreeHandle,
NtUserGetHandlePtr, NtUserGetHandlePtr,
NtUserInvalidateDCE,
NtUserRegisterWindowSurface, NtUserRegisterWindowSurface,
NtUserSetHandlePtr, NtUserSetHandlePtr,
}; };
...@@ -316,6 +318,7 @@ HCURSOR WINAPI NtUserGetCursor(void); ...@@ -316,6 +318,7 @@ HCURSOR WINAPI NtUserGetCursor(void);
HCURSOR WINAPI NtUserGetCursorFrameInfo( HCURSOR hCursor, DWORD istep, DWORD *rate_jiffies, HCURSOR WINAPI NtUserGetCursorFrameInfo( HCURSOR hCursor, DWORD istep, DWORD *rate_jiffies,
DWORD *num_steps ); DWORD *num_steps );
BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info ); BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info );
HDC WINAPI NtUserGetDCEx( HWND hwnd, HRGN clip_rgn, DWORD flags );
LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info, LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info,
UINT32 *num_mode_info ); UINT32 *num_mode_info );
UINT WINAPI NtUserGetDoubleClickTime(void); UINT WINAPI NtUserGetDoubleClickTime(void);
......
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