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
67b10761
Commit
67b10761
authored
Sep 30, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac.drv: Use NtCallbackReturn to send back app's icons to unixlib.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55658
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
b4b39bfb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
28 deletions
+22
-28
dllmain.c
dlls/winemac.drv/dllmain.c
+8
-8
image.c
dlls/winemac.drv/image.c
+14
-8
unixlib.h
dlls/winemac.drv/unixlib.h
+0
-12
No files found.
dlls/winemac.drv/dllmain.c
View file @
67b10761
...
...
@@ -243,16 +243,16 @@ static BOOL CALLBACK get_first_resource(HMODULE module, LPCWSTR type, LPWSTR nam
*/
static
NTSTATUS
WINAPI
macdrv_app_icon
(
void
*
arg
,
ULONG
size
)
{
struct
app_icon_params
*
params
=
arg
;
struct
app_icon_result
*
result
=
param_ptr
(
params
->
result
);
struct
app_icon_entry
entries
[
64
];
HRSRC
res_info
;
HGLOBAL
res_data
;
GRPICONDIR
*
icon_dir
;
unsigned
count
;
int
i
;
TRACE
(
"()
\n
"
);
result
->
count
=
0
;
count
=
0
;
res_info
=
NULL
;
EnumResourceNamesW
(
NULL
,
(
LPCWSTR
)
RT_GROUP_ICON
,
get_first_resource
,
(
LONG_PTR
)
&
res_info
);
...
...
@@ -274,9 +274,9 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
goto
cleanup
;
}
for
(
i
=
0
;
i
<
icon_dir
->
idCount
&&
result
->
count
<
ARRAYSIZE
(
result
->
entries
);
i
++
)
for
(
i
=
0
;
i
<
icon_dir
->
idCount
&&
count
<
ARRAYSIZE
(
entries
);
i
++
)
{
struct
app_icon_entry
*
entry
=
&
result
->
entries
[
result
->
count
];
struct
app_icon_entry
*
entry
=
&
entries
[
count
];
int
width
=
icon_dir
->
idEntries
[
i
].
bWidth
;
int
height
=
icon_dir
->
idEntries
[
i
].
bHeight
;
BOOL
found_better_bpp
=
FALSE
;
...
...
@@ -338,7 +338,7 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
{
entry
->
png
=
(
UINT_PTR
)
icon_bits
;
entry
->
icon
=
0
;
result
->
count
++
;
count
++
;
}
else
{
...
...
@@ -348,7 +348,7 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
{
entry
->
icon
=
HandleToUlong
(
icon
);
entry
->
png
=
0
;
result
->
count
++
;
count
++
;
}
else
WARN
(
"failed to create icon %d from resource with ID %hd
\n
"
,
i
,
icon_dir
->
idEntries
[
i
].
nID
);
...
...
@@ -363,7 +363,7 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
cleanup:
FreeResource
(
res_data
);
return
0
;
return
NtCallbackReturn
(
entries
,
count
*
sizeof
(
entries
[
0
]),
0
)
;
}
typedef
NTSTATUS
(
WINAPI
*
kernel_callback
)(
void
*
params
,
ULONG
size
);
...
...
dlls/winemac.drv/image.c
View file @
67b10761
...
...
@@ -249,27 +249,33 @@ cleanup:
*/
CFArrayRef
create_app_icon_images
(
void
)
{
struct
app_icon_result
icons
;
struct
app_icon_params
params
=
{
.
result
=
(
UINT_PTR
)
&
icons
};
CFMutableArrayRef
images
=
NULL
;
struct
app_icon_entry
*
entries
;
ULONG
ret_len
;
unsigned
count
;
int
i
;
TRACE
(
"()
\n
"
);
macdrv_client_func
(
client_func_app_icon
,
&
params
,
sizeof
(
params
));
if
(
!
icons
.
count
)
return
NULL
;
if
(
KeUserModeCallback
(
client_func_app_icon
,
NULL
,
0
,
(
void
**
)
&
entries
,
&
ret_len
)
||
(
ret_len
%
sizeof
(
*
entries
)))
{
WARN
(
"incorrect callback result
\n
"
);
return
NULL
;
}
count
=
ret_len
/
sizeof
(
*
entries
);
if
(
!
count
||
!
entries
)
return
NULL
;
images
=
CFArrayCreateMutable
(
NULL
,
icons
.
count
,
&
kCFTypeArrayCallBacks
);
images
=
CFArrayCreateMutable
(
NULL
,
count
,
&
kCFTypeArrayCallBacks
);
if
(
!
images
)
{
WARN
(
"failed to create images array
\n
"
);
return
NULL
;
}
for
(
i
=
0
;
i
<
icons
.
count
;
i
++
)
for
(
i
=
0
;
i
<
count
;
i
++
)
{
struct
app_icon_entry
*
icon
=
&
icons
.
entries
[
i
];
struct
app_icon_entry
*
icon
=
&
entries
[
i
];
CGImageRef
cgimage
=
NULL
;
if
(
icon
->
png
)
...
...
dlls/winemac.drv/unixlib.h
View file @
67b10761
...
...
@@ -104,18 +104,6 @@ struct app_icon_entry
UINT64
png
;
};
struct
app_icon_result
{
UINT32
count
;
struct
app_icon_entry
entries
[
64
];
};
/* macdrv_app_icon params */
struct
app_icon_params
{
UINT64
result
;
/* FIXME: Use NtCallbackReturn instead */
};
/* macdrv_app_quit_request params */
struct
app_quit_request_params
{
...
...
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