Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
6e2ea185
Commit
6e2ea185
authored
May 12, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move NtUserInternalGetWindowIcon implementation from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
a8ed1c94
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
102 additions
and
50 deletions
+102
-50
user32.spec
dlls/user32/user32.spec
+1
-1
user_main.c
dlls/user32/user_main.c
+8
-0
win.c
dlls/user32/win.c
+0
-47
cursoricon.c
dlls/win32u/cursoricon.c
+21
-0
gdiobj.c
dlls/win32u/gdiobj.c
+1
-0
win32u.spec
dlls/win32u/win32u.spec
+1
-1
win32u_private.h
dlls/win32u/win32u_private.h
+1
-0
window.c
dlls/win32u/window.c
+48
-0
wrappers.c
dlls/win32u/wrappers.c
+7
-0
ntuser.h
include/ntuser.h
+14
-1
No files found.
dlls/user32/user32.spec
View file @
6e2ea185
...
...
@@ -445,7 +445,7 @@
@ stdcall InsertMenuItemA(long long long ptr)
@ stdcall InsertMenuItemW(long long long ptr)
@ stdcall InsertMenuW(long long long long ptr)
@ stdcall InternalGetWindowIcon(ptr long)
@ stdcall InternalGetWindowIcon(ptr long)
NtUserInternalGetWindowIcon
@ stdcall InternalGetWindowText(long ptr long) NtUserInternalGetWindowText
@ stdcall IntersectRect(ptr ptr ptr)
@ stdcall InvalidateRect(long ptr long)
...
...
dlls/user32/user_main.c
View file @
6e2ea185
...
...
@@ -164,6 +164,13 @@ static NTSTATUS WINAPI User32CopyImage( const struct copy_image_params *params,
return
HandleToUlong
(
ret
);
}
static
NTSTATUS
WINAPI
User32LoadImage
(
const
struct
load_image_params
*
params
,
ULONG
size
)
{
HANDLE
ret
=
LoadImageW
(
params
->
hinst
,
params
->
name
,
params
->
type
,
params
->
dx
,
params
->
dy
,
params
->
flags
);
return
HandleToUlong
(
ret
);
}
static
NTSTATUS
WINAPI
User32FreeCachedClipboardData
(
const
struct
free_cached_data_params
*
params
,
ULONG
size
)
{
...
...
@@ -193,6 +200,7 @@ static const void *kernel_callback_table[NtUserCallCount] =
User32CopyImage
,
User32FreeCachedClipboardData
,
User32LoadDriver
,
User32LoadImage
,
User32RegisterBuiltinClasses
,
User32RenderSsynthesizedFormat
,
};
...
...
dlls/user32/win.c
View file @
6e2ea185
...
...
@@ -1794,50 +1794,3 @@ BOOL WINAPI SetWindowCompositionAttribute(HWND hwnd, void *data)
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
}
/***********************************************************************
* InternalGetWindowIcon (USER32.@)
*/
HICON
WINAPI
InternalGetWindowIcon
(
HWND
hwnd
,
UINT
type
)
{
WND
*
win
=
WIN_GetPtr
(
hwnd
);
HICON
ret
;
TRACE
(
"hwnd %p, type %#x
\n
"
,
hwnd
,
type
);
if
(
!
win
)
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
win
==
WND_OTHER_PROCESS
||
win
==
WND_DESKTOP
)
{
if
(
IsWindow
(
hwnd
))
FIXME
(
"not supported on other process window %p
\n
"
,
hwnd
);
return
0
;
}
switch
(
type
)
{
case
ICON_BIG
:
ret
=
win
->
hIcon
;
if
(
!
ret
)
ret
=
(
HICON
)
GetClassLongPtrW
(
hwnd
,
GCLP_HICON
);
break
;
case
ICON_SMALL
:
case
ICON_SMALL2
:
ret
=
win
->
hIconSmall
?
win
->
hIconSmall
:
win
->
hIconSmall2
;
if
(
!
ret
)
ret
=
(
HICON
)
GetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
);
if
(
!
ret
)
ret
=
(
HICON
)
GetClassLongPtrW
(
hwnd
,
GCLP_HICON
);
break
;
default
:
SetLastError
(
ERROR_INVALID_PARAMETER
);
WIN_ReleasePtr
(
win
);
return
0
;
}
if
(
!
ret
)
ret
=
LoadIconW
(
0
,
(
const
WCHAR
*
)
IDI_APPLICATION
);
WIN_ReleasePtr
(
win
);
return
CopyIcon
(
ret
);
}
dlls/win32u/cursoricon.c
View file @
6e2ea185
...
...
@@ -801,3 +801,24 @@ HANDLE WINAPI CopyImage( HANDLE hwnd, UINT type, INT dx, INT dy, UINT flags )
ret
=
KeUserModeCallback
(
NtUserCopyImage
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
return
UlongToHandle
(
ret
);
}
/******************************************************************************
* LoadImage (win32u.so)
*/
HANDLE
WINAPI
LoadImageW
(
HINSTANCE
hinst
,
const
WCHAR
*
name
,
UINT
type
,
INT
dx
,
INT
dy
,
UINT
flags
)
{
void
*
ret_ptr
;
ULONG
ret_len
;
NTSTATUS
ret
;
struct
load_image_params
params
=
{
.
hinst
=
hinst
,
.
name
=
name
,
.
type
=
type
,
.
dx
=
dx
,
.
dy
=
dy
,
.
flags
=
flags
};
if
(
HIWORD
(
name
))
{
ERR
(
"name %s not supported in Unix modules
\n
"
,
debugstr_w
(
name
));
return
0
;
}
ret
=
KeUserModeCallback
(
NtUserLoadImage
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
return
UlongToHandle
(
ret
);
}
dlls/win32u/gdiobj.c
View file @
6e2ea185
...
...
@@ -1187,6 +1187,7 @@ static struct unix_funcs unix_funcs =
NtUserGetUpdatedClipboardFormats
,
NtUserGetWindowPlacement
,
NtUserHideCaret
,
NtUserInternalGetWindowIcon
,
NtUserIsClipboardFormatAvailable
,
NtUserMapVirtualKeyEx
,
NtUserMessageCall
,
...
...
dlls/win32u/win32u.spec
View file @
6e2ea185
...
...
@@ -1044,7 +1044,7 @@
@ stub NtUserInjectPointerInput
@ stub NtUserInjectTouchInput
@ stub NtUserInteractiveControlQueryUsage
@ st
ub NtUserInternalGetWindowIcon
@ st
dcall NtUserInternalGetWindowIcon(ptr long)
@ stdcall -syscall NtUserInternalGetWindowText(long ptr long)
@ stub NtUserInternalToUnicode
@ stub NtUserInvalidateRect
...
...
dlls/win32u/win32u_private.h
View file @
6e2ea185
...
...
@@ -249,6 +249,7 @@ struct unix_funcs
BOOL
(
WINAPI
*
pNtUserGetUpdatedClipboardFormats
)(
UINT
*
formats
,
UINT
size
,
UINT
*
out_size
);
BOOL
(
WINAPI
*
pNtUserGetWindowPlacement
)(
HWND
hwnd
,
WINDOWPLACEMENT
*
placement
);
BOOL
(
WINAPI
*
pNtUserHideCaret
)(
HWND
hwnd
);
HICON
(
WINAPI
*
pNtUserInternalGetWindowIcon
)(
HWND
hwnd
,
UINT
type
);
BOOL
(
WINAPI
*
pNtUserIsClipboardFormatAvailable
)(
UINT
format
);
UINT
(
WINAPI
*
pNtUserMapVirtualKeyEx
)(
UINT
code
,
UINT
type
,
HKL
layout
);
LRESULT
(
WINAPI
*
pNtUserMessageCall
)(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
...
...
dlls/win32u/window.c
View file @
6e2ea185
...
...
@@ -4555,6 +4555,54 @@ static BOOL set_window_context_help_id( HWND hwnd, DWORD id )
}
/***********************************************************************
* NtUserInternalGetWindowIcon (win32u.@)
*/
HICON
WINAPI
NtUserInternalGetWindowIcon
(
HWND
hwnd
,
UINT
type
)
{
WND
*
win
=
get_win_ptr
(
hwnd
);
HICON
ret
;
TRACE
(
"hwnd %p, type %#x
\n
"
,
hwnd
,
type
);
if
(
!
win
)
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
win
==
WND_OTHER_PROCESS
||
win
==
WND_DESKTOP
)
{
if
(
is_window
(
hwnd
))
FIXME
(
"not supported on other process window %p
\n
"
,
hwnd
);
return
0
;
}
switch
(
type
)
{
case
ICON_BIG
:
ret
=
win
->
hIcon
;
if
(
!
ret
)
ret
=
(
HICON
)
get_class_long_ptr
(
hwnd
,
GCLP_HICON
,
FALSE
);
break
;
case
ICON_SMALL
:
case
ICON_SMALL2
:
ret
=
win
->
hIconSmall
?
win
->
hIconSmall
:
win
->
hIconSmall2
;
if
(
!
ret
)
ret
=
(
HICON
)
get_class_long_ptr
(
hwnd
,
GCLP_HICONSM
,
FALSE
);
if
(
!
ret
)
ret
=
(
HICON
)
get_class_long_ptr
(
hwnd
,
GCLP_HICON
,
FALSE
);
break
;
default:
SetLastError
(
ERROR_INVALID_PARAMETER
);
release_win_ptr
(
win
);
return
0
;
}
release_win_ptr
(
win
);
if
(
!
ret
)
ret
=
LoadImageW
(
0
,
(
const
WCHAR
*
)
IDI_APPLICATION
,
IMAGE_ICON
,
0
,
0
,
LR_SHARED
|
LR_DEFAULTSIZE
);
return
CopyImage
(
ret
,
IMAGE_ICON
,
0
,
0
,
0
);
}
/***********************************************************************
* send_destroy_message
*/
static
void
send_destroy_message
(
HWND
hwnd
)
...
...
dlls/win32u/wrappers.c
View file @
6e2ea185
...
...
@@ -1029,12 +1029,19 @@ BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *ou
return
unix_funcs
->
pNtUserGetUpdatedClipboardFormats
(
formats
,
size
,
out_size
);
}
BOOL
WINAPI
NtUserGetWindowPlacement
(
HWND
hwnd
,
WINDOWPLACEMENT
*
placement
)
{
if
(
!
unix_funcs
)
return
FALSE
;
return
unix_funcs
->
pNtUserGetWindowPlacement
(
hwnd
,
placement
);
}
HICON
WINAPI
NtUserInternalGetWindowIcon
(
HWND
hwnd
,
UINT
type
)
{
if
(
!
unix_funcs
)
return
0
;
return
unix_funcs
->
pNtUserInternalGetWindowIcon
(
hwnd
,
type
);
}
BOOL
WINAPI
NtUserIsClipboardFormatAvailable
(
UINT
format
)
{
if
(
!
unix_funcs
)
return
FALSE
;
...
...
include/ntuser.h
View file @
6e2ea185
...
...
@@ -35,6 +35,7 @@ enum
NtUserCopyImage
,
NtUserFreeCachedClipboardData
,
NtUserLoadDriver
,
NtUserLoadImage
,
NtUserRegisterBuiltinClasses
,
NtUserRenderSynthesizedFormat
,
/* win16 hooks */
...
...
@@ -147,7 +148,7 @@ struct win_hook_params
WCHAR
module
[
MAX_PATH
];
};
/* NtUserCopy
Mess
age params */
/* NtUserCopy
Im
age params */
struct
copy_image_params
{
HANDLE
hwnd
;
...
...
@@ -164,6 +165,17 @@ struct free_cached_data_params
HANDLE
handle
;
};
/* NtUserLoadImage params */
struct
load_image_params
{
HINSTANCE
hinst
;
const
WCHAR
*
name
;
UINT
type
;
INT
dx
;
INT
dy
;
UINT
flags
;
};
/* NtUserRenderSynthesizedFormat params */
struct
render_synthesized_format_params
{
...
...
@@ -589,6 +601,7 @@ BOOL WINAPI NtUserHideCaret( HWND hwnd );
NTSTATUS
WINAPI
NtUserInitializeClientPfnArrays
(
const
struct
user_client_procs
*
client_procsA
,
const
struct
user_client_procs
*
client_procsW
,
const
void
*
client_workers
,
HINSTANCE
user_module
);
HICON
WINAPI
NtUserInternalGetWindowIcon
(
HWND
hwnd
,
UINT
type
);
INT
WINAPI
NtUserInternalGetWindowText
(
HWND
hwnd
,
WCHAR
*
text
,
INT
count
);
BOOL
WINAPI
NtUserIsClipboardFormatAvailable
(
UINT
format
);
BOOL
WINAPI
NtUserKillTimer
(
HWND
hwnd
,
UINT_PTR
id
);
...
...
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