Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
be6f5ed9
Commit
be6f5ed9
authored
Nov 28, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move NtUserGetDC implementation from user32.
parent
6905b76b
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
42 additions
and
39 deletions
+42
-39
button.c
dlls/user32/button.c
+2
-2
clipboard.c
dlls/user32/clipboard.c
+3
-3
combo.c
dlls/user32/combo.c
+2
-2
dialog.c
dlls/user32/dialog.c
+1
-1
edit.c
dlls/user32/edit.c
+5
-5
icontitle.c
dlls/user32/icontitle.c
+1
-1
mdi.c
dlls/user32/mdi.c
+1
-1
msgbox.c
dlls/user32/msgbox.c
+1
-1
painting.c
dlls/user32/painting.c
+0
-16
static.c
dlls/user32/static.c
+1
-1
user32.spec
dlls/user32/user32.spec
+1
-1
dce.c
dlls/win32u/dce.c
+9
-0
menu.c
dlls/win32u/menu.c
+3
-3
syscall.c
dlls/win32u/syscall.c
+1
-0
sysparams.c
dlls/win32u/sysparams.c
+1
-1
win32u.spec
dlls/win32u/win32u.spec
+1
-1
syscall.h
dlls/wow64win/syscall.h
+1
-0
user.c
dlls/wow64win/user.c
+7
-0
ntuser.h
include/ntuser.h
+1
-0
No files found.
dlls/user32/button.c
View file @
be6f5ed9
...
...
@@ -141,7 +141,7 @@ static inline void paint_button( HWND hwnd, LONG style, UINT action )
{
if
(
btnPaintFunc
[
style
]
&&
IsWindowVisible
(
hwnd
))
{
HDC
hdc
=
GetDC
(
hwnd
);
HDC
hdc
=
NtUser
GetDC
(
hwnd
);
btnPaintFunc
[
style
](
hwnd
,
hdc
,
action
);
NtUserReleaseDC
(
hwnd
,
hdc
);
}
...
...
@@ -328,7 +328,7 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
/* Clear an old text here as Windows does */
if
(
IsWindowVisible
(
hWnd
))
{
HDC
hdc
=
GetDC
(
hWnd
);
HDC
hdc
=
NtUser
GetDC
(
hWnd
);
HBRUSH
hbrush
;
RECT
client
,
rc
;
HWND
parent
=
GetParent
(
hWnd
);
...
...
dlls/user32/clipboard.c
View file @
be6f5ed9
...
...
@@ -349,7 +349,7 @@ static HANDLE render_synthesized_bitmap( HANDLE data, UINT from )
{
BITMAPINFO
*
bmi
;
HANDLE
ret
=
0
;
HDC
hdc
=
GetDC
(
0
);
HDC
hdc
=
NtUser
GetDC
(
0
);
if
((
bmi
=
GlobalLock
(
data
)))
{
...
...
@@ -369,7 +369,7 @@ static HANDLE render_synthesized_dib( HANDLE data, UINT format, UINT from )
BITMAPINFO
*
bmi
,
*
src
;
DWORD
src_size
,
header_size
,
bits_size
;
HANDLE
ret
=
0
;
HDC
hdc
=
GetDC
(
0
);
HDC
hdc
=
NtUser
GetDC
(
0
);
if
(
from
==
CF_BITMAP
)
{
...
...
@@ -428,7 +428,7 @@ static HANDLE render_synthesized_metafile( HANDLE data )
void
*
bits
;
METAFILEPICT
*
pict
;
ENHMETAHEADER
header
;
HDC
hdc
=
GetDC
(
0
);
HDC
hdc
=
NtUser
GetDC
(
0
);
size
=
GetWinMetaFileBits
(
data
,
0
,
NULL
,
MM_ISOTROPIC
,
hdc
);
if
((
bits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
...
...
dlls/user32/combo.c
View file @
be6f5ed9
...
...
@@ -162,7 +162,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
static
INT
combo_get_text_height
(
const
HEADCOMBO
*
combo
)
{
HDC
hdc
=
GetDC
(
combo
->
self
);
HDC
hdc
=
NtUser
GetDC
(
combo
->
self
);
HFONT
prev_font
=
0
;
TEXTMETRICW
tm
;
...
...
@@ -659,7 +659,7 @@ static void CBPaintText(
else
if
(
!
(
lphc
->
wState
&
CBF_NOREDRAW
)
&&
IsWindowVisible
(
lphc
->
self
))
{
/* paint text field ourselves */
HDC
hdc
=
hdc_paint
?
hdc_paint
:
GetDC
(
lphc
->
self
);
HDC
hdc
=
hdc_paint
?
hdc_paint
:
NtUser
GetDC
(
lphc
->
self
);
UINT
itemState
=
ODS_COMBOBOXEDIT
;
HFONT
hPrevFont
=
(
lphc
->
hFont
)
?
SelectObject
(
hdc
,
lphc
->
hFont
)
:
0
;
HBRUSH
hPrevBrush
,
hBkgBrush
;
...
...
dlls/user32/dialog.c
View file @
be6f5ed9
...
...
@@ -469,7 +469,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
if
(
template
.
style
&
DS_SETFONT
)
{
HDC
dc
=
GetDC
(
0
);
HDC
dc
=
NtUser
GetDC
(
0
);
if
(
template
.
pointSize
==
0x7fff
)
{
...
...
dlls/user32/edit.c
View file @
be6f5ed9
...
...
@@ -380,7 +380,7 @@ static SCRIPT_STRING_ANALYSIS EDIT_UpdateUniscribeData_linedef(EDITSTATE *es, HD
HRESULT
hr
;
if
(
!
udc
)
udc
=
GetDC
(
es
->
hwndSelf
);
udc
=
NtUser
GetDC
(
es
->
hwndSelf
);
if
(
es
->
font
)
old_font
=
SelectObject
(
udc
,
es
->
font
);
...
...
@@ -421,7 +421,7 @@ static SCRIPT_STRING_ANALYSIS EDIT_UpdateUniscribeData(EDITSTATE *es, HDC dc, IN
HDC
udc
=
dc
;
if
(
!
udc
)
udc
=
GetDC
(
es
->
hwndSelf
);
udc
=
NtUser
GetDC
(
es
->
hwndSelf
);
if
(
es
->
font
)
old_font
=
SelectObject
(
udc
,
es
->
font
);
...
...
@@ -2885,7 +2885,7 @@ static void EDIT_EM_SetMargins(EDITSTATE *es, INT action,
/* Set the default margins depending on the font */
if
(
es
->
font
&&
(
left
==
EC_USEFONTINFO
||
right
==
EC_USEFONTINFO
))
{
HDC
dc
=
GetDC
(
es
->
hwndSelf
);
HDC
dc
=
NtUser
GetDC
(
es
->
hwndSelf
);
HFONT
old_font
=
SelectObject
(
dc
,
es
->
font
);
LONG
width
=
GdiGetCharDimensions
(
dc
,
&
tm
,
NULL
),
rc_width
;
RECT
rc
;
...
...
@@ -3798,7 +3798,7 @@ static void EDIT_WM_SetFocus(EDITSTATE *es)
/* single line edit updates itself */
if
(
IsWindowVisible
(
es
->
hwndSelf
)
&&
!
(
es
->
style
&
ES_MULTILINE
))
{
HDC
hdc
=
GetDC
(
es
->
hwndSelf
);
HDC
hdc
=
NtUser
GetDC
(
es
->
hwndSelf
);
EDIT_WM_Paint
(
es
,
hdc
);
NtUserReleaseDC
(
es
->
hwndSelf
,
hdc
);
}
...
...
@@ -3859,7 +3859,7 @@ static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw)
es
->
font
=
font
;
EDIT_InvalidateUniscribeData
(
es
);
dc
=
GetDC
(
es
->
hwndSelf
);
dc
=
NtUser
GetDC
(
es
->
hwndSelf
);
if
(
font
)
old_font
=
SelectObject
(
dc
,
font
);
GetTextMetricsW
(
dc
,
&
tm
);
...
...
dlls/user32/icontitle.c
View file @
be6f5ed9
...
...
@@ -47,7 +47,7 @@ static BOOL ICONTITLE_SetTitlePos( HWND hwnd, HWND owner )
length
=
lstrlenW
(
str
);
}
if
(
!
(
hDC
=
GetDC
(
hwnd
)))
return
FALSE
;
if
(
!
(
hDC
=
NtUser
GetDC
(
hwnd
)))
return
FALSE
;
hPrevFont
=
SelectObject
(
hDC
,
hIconTitleFont
);
...
...
dlls/user32/mdi.c
View file @
be6f5ed9
...
...
@@ -823,7 +823,7 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild )
{
HDC
hMemDC
;
HBITMAP
hBitmap
,
hOldBitmap
;
HDC
hdc
=
GetDC
(
hChild
);
HDC
hdc
=
NtUser
GetDC
(
hChild
);
if
(
hdc
)
{
...
...
dlls/user32/msgbox.c
View file @
be6f5ed9
...
...
@@ -231,7 +231,7 @@ static void MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
ileft
=
rect
.
left
;
iwidth
=
rect
.
right
-
ileft
;
hdc
=
GetDC
(
hwnd
);
hdc
=
NtUser
GetDC
(
hwnd
);
hPrevFont
=
SelectObject
(
hdc
,
(
HFONT
)
SendMessageW
(
hwnd
,
WM_GETFONT
,
0
,
0
));
/* Get the number of visible buttons and their size */
...
...
dlls/user32/painting.c
View file @
be6f5ed9
...
...
@@ -23,22 +23,6 @@
/***********************************************************************
* GetDC (USER32.@)
*
* Get a device context.
*
* RETURNS
* Success: Handle to the device context
* Failure: NULL.
*/
HDC
WINAPI
GetDC
(
HWND
hwnd
)
{
if
(
!
hwnd
)
return
NtUserGetDCEx
(
0
,
0
,
DCX_CACHE
|
DCX_WINDOW
);
return
NtUserGetDCEx
(
hwnd
,
0
,
DCX_USESTYLE
);
}
/***********************************************************************
* GetWindowDC (USER32.@)
*/
HDC
WINAPI
GetWindowDC
(
HWND
hwnd
)
...
...
dlls/user32/static.c
View file @
be6f5ed9
...
...
@@ -275,7 +275,7 @@ static VOID STATIC_TryPaintFcn(HWND hwnd, LONG full_style)
LONG
style
=
full_style
&
SS_TYPEMASK
;
GetClientRect
(
hwnd
,
&
rc
);
hdc
=
GetDC
(
hwnd
);
hdc
=
NtUser
GetDC
(
hwnd
);
hrgn
=
set_control_clipping
(
hdc
,
&
rc
);
hbrush
=
STATIC_SendWmCtlColorStatic
(
hwnd
,
hdc
);
if
(
staticPaintFunc
[
style
])
...
...
dlls/user32/user32.spec
View file @
be6f5ed9
...
...
@@ -287,7 +287,7 @@
@ stdcall GetCursorFrameInfo(long long long ptr ptr)
@ stdcall GetCursorInfo(ptr) NtUserGetCursorInfo
@ stdcall GetCursorPos(ptr)
@ stdcall GetDC(long)
@ stdcall GetDC(long)
NtUserGetDC
@ stdcall GetDCEx(long long long) NtUserGetDCEx
@ stdcall GetDesktopWindow()
@ stdcall GetDialogBaseUnits()
...
...
dlls/win32u/dce.c
View file @
be6f5ed9
...
...
@@ -1029,6 +1029,15 @@ INT WINAPI NtUserReleaseDC( HWND hwnd, HDC hdc )
return
release_dc
(
hwnd
,
hdc
,
FALSE
);
}
/***********************************************************************
* NtUserGetDC (win32u.@)
*/
HDC
WINAPI
NtUserGetDC
(
HWND
hwnd
)
{
if
(
!
hwnd
)
return
NtUserGetDCEx
(
0
,
0
,
DCX_CACHE
|
DCX_WINDOW
);
return
NtUserGetDCEx
(
hwnd
,
0
,
DCX_USESTYLE
);
}
/**********************************************************************
* NtUserWindowFromDC (win32u.@)
*/
...
...
dlls/win32u/menu.c
View file @
be6f5ed9
...
...
@@ -2960,7 +2960,7 @@ static void calc_popup_menu_size( struct menu *menu, UINT max_height )
SetRectEmpty
(
&
menu
->
items_rect
);
if
(
menu
->
nItems
==
0
)
return
;
hdc
=
NtUserGetDC
Ex
(
0
,
0
,
DCX_CACHE
|
DCX_WINDOW
);
hdc
=
NtUserGetDC
(
0
);
NtGdiSelectFont
(
hdc
,
get_menu_font
(
FALSE
));
...
...
@@ -3163,7 +3163,7 @@ static void select_item( HWND owner, HMENU hmenu, UINT index, BOOL send_select,
if
(
!
menu
||
!
menu
->
nItems
||
!
menu
->
hWnd
)
return
;
if
(
menu
->
FocusedItem
==
index
)
return
;
if
(
menu
->
wFlags
&
MF_POPUP
)
hdc
=
NtUserGetDC
Ex
(
menu
->
hWnd
,
0
,
DCX_USESTYLE
);
if
(
menu
->
wFlags
&
MF_POPUP
)
hdc
=
NtUserGetDC
(
menu
->
hWnd
);
else
hdc
=
NtUserGetDCEx
(
menu
->
hWnd
,
0
,
DCX_CACHE
|
DCX_WINDOW
);
if
(
!
top_popup
)
{
...
...
@@ -3369,7 +3369,7 @@ static HMENU show_sub_popup( HWND owner, HMENU hmenu, BOOL select_first, UINT fl
/* correct item if modified as a reaction to WM_INITMENUPOPUP message */
if
(
!
(
item
->
fState
&
MF_HILITE
))
{
if
(
menu
->
wFlags
&
MF_POPUP
)
hdc
=
NtUserGetDC
Ex
(
menu
->
hWnd
,
0
,
DCX_USESTYLE
);
if
(
menu
->
wFlags
&
MF_POPUP
)
hdc
=
NtUserGetDC
(
menu
->
hWnd
);
else
hdc
=
NtUserGetDCEx
(
menu
->
hWnd
,
0
,
DCX_CACHE
|
DCX_WINDOW
);
NtGdiSelectFont
(
hdc
,
get_menu_font
(
FALSE
));
...
...
dlls/win32u/syscall.c
View file @
be6f5ed9
...
...
@@ -169,6 +169,7 @@ static void * const syscalls[] =
NtUserGetCursor
,
NtUserGetCursorFrameInfo
,
NtUserGetCursorInfo
,
NtUserGetDC
,
NtUserGetDCEx
,
NtUserGetDisplayConfigBufferSizes
,
NtUserGetDoubleClickTime
,
...
...
dlls/win32u/sysparams.c
View file @
be6f5ed9
...
...
@@ -3496,7 +3496,7 @@ DWORD get_dialog_base_units(void)
{
HDC
hdc
;
if
((
hdc
=
NtUserGetDC
Ex
(
0
,
0
,
DCX_CACHE
|
DCX_WINDOW
)))
if
((
hdc
=
NtUserGetDC
(
0
)))
{
cx
=
get_char_dimensions
(
hdc
,
NULL
,
&
cy
);
NtUserReleaseDC
(
0
,
hdc
);
...
...
dlls/win32u/win32u.spec
View file @
be6f5ed9
...
...
@@ -915,7 +915,7 @@
@ stdcall -syscall NtUserGetCursor()
@ stdcall -syscall NtUserGetCursorFrameInfo(long long ptr ptr)
@ stdcall -syscall NtUserGetCursorInfo(ptr)
@ st
ub NtUserGetDC
@ st
dcall -syscall NtUserGetDC(long)
@ stdcall -syscall NtUserGetDCEx(long long long)
@ stub NtUserGetDManipHookInitFunction
@ stub NtUserGetDesktopID
...
...
dlls/wow64win/syscall.h
View file @
be6f5ed9
...
...
@@ -155,6 +155,7 @@
SYSCALL_ENTRY( NtUserGetCursor ) \
SYSCALL_ENTRY( NtUserGetCursorFrameInfo ) \
SYSCALL_ENTRY( NtUserGetCursorInfo ) \
SYSCALL_ENTRY( NtUserGetDC ) \
SYSCALL_ENTRY( NtUserGetDCEx ) \
SYSCALL_ENTRY( NtUserGetDisplayConfigBufferSizes ) \
SYSCALL_ENTRY( NtUserGetDoubleClickTime ) \
...
...
dlls/wow64win/user.c
View file @
be6f5ed9
...
...
@@ -1918,6 +1918,13 @@ NTSTATUS WINAPI wow64_NtUserGetCursorInfo( UINT *args )
return
TRUE
;
}
NTSTATUS
WINAPI
wow64_NtUserGetDC
(
UINT
*
args
)
{
HWND
hwnd
=
get_handle
(
&
args
);
return
HandleToUlong
(
NtUserGetDC
(
hwnd
));
}
NTSTATUS
WINAPI
wow64_NtUserGetDCEx
(
UINT
*
args
)
{
HWND
hwnd
=
get_handle
(
&
args
);
...
...
include/ntuser.h
View file @
be6f5ed9
...
...
@@ -733,6 +733,7 @@ HCURSOR WINAPI NtUserGetCursor(void);
HCURSOR
WINAPI
NtUserGetCursorFrameInfo
(
HCURSOR
hCursor
,
DWORD
istep
,
DWORD
*
rate_jiffies
,
DWORD
*
num_steps
);
BOOL
WINAPI
NtUserGetCursorInfo
(
CURSORINFO
*
info
);
HDC
WINAPI
NtUserGetDC
(
HWND
hwnd
);
HDC
WINAPI
NtUserGetDCEx
(
HWND
hwnd
,
HRGN
clip_rgn
,
DWORD
flags
);
LONG
WINAPI
NtUserGetDisplayConfigBufferSizes
(
UINT32
flags
,
UINT32
*
num_path_info
,
UINT32
*
num_mode_info
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment