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
Hide 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
...
@@ -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
)
static
NTSTATUS
WINAPI
macdrv_app_icon
(
void
*
arg
,
ULONG
size
)
{
{
struct
app_icon_params
*
params
=
arg
;
struct
app_icon_entry
entries
[
64
];
struct
app_icon_result
*
result
=
param_ptr
(
params
->
result
);
HRSRC
res_info
;
HRSRC
res_info
;
HGLOBAL
res_data
;
HGLOBAL
res_data
;
GRPICONDIR
*
icon_dir
;
GRPICONDIR
*
icon_dir
;
unsigned
count
;
int
i
;
int
i
;
TRACE
(
"()
\n
"
);
TRACE
(
"()
\n
"
);
result
->
count
=
0
;
count
=
0
;
res_info
=
NULL
;
res_info
=
NULL
;
EnumResourceNamesW
(
NULL
,
(
LPCWSTR
)
RT_GROUP_ICON
,
get_first_resource
,
(
LONG_PTR
)
&
res_info
);
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)
...
@@ -274,9 +274,9 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
goto
cleanup
;
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
width
=
icon_dir
->
idEntries
[
i
].
bWidth
;
int
height
=
icon_dir
->
idEntries
[
i
].
bHeight
;
int
height
=
icon_dir
->
idEntries
[
i
].
bHeight
;
BOOL
found_better_bpp
=
FALSE
;
BOOL
found_better_bpp
=
FALSE
;
...
@@ -338,7 +338,7 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
...
@@ -338,7 +338,7 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
{
{
entry
->
png
=
(
UINT_PTR
)
icon_bits
;
entry
->
png
=
(
UINT_PTR
)
icon_bits
;
entry
->
icon
=
0
;
entry
->
icon
=
0
;
result
->
count
++
;
count
++
;
}
}
else
else
{
{
...
@@ -348,7 +348,7 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
...
@@ -348,7 +348,7 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
{
{
entry
->
icon
=
HandleToUlong
(
icon
);
entry
->
icon
=
HandleToUlong
(
icon
);
entry
->
png
=
0
;
entry
->
png
=
0
;
result
->
count
++
;
count
++
;
}
}
else
else
WARN
(
"failed to create icon %d from resource with ID %hd
\n
"
,
i
,
icon_dir
->
idEntries
[
i
].
nID
);
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)
...
@@ -363,7 +363,7 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
cleanup:
cleanup:
FreeResource
(
res_data
);
FreeResource
(
res_data
);
return
0
;
return
NtCallbackReturn
(
entries
,
count
*
sizeof
(
entries
[
0
]),
0
)
;
}
}
typedef
NTSTATUS
(
WINAPI
*
kernel_callback
)(
void
*
params
,
ULONG
size
);
typedef
NTSTATUS
(
WINAPI
*
kernel_callback
)(
void
*
params
,
ULONG
size
);
...
...
dlls/winemac.drv/image.c
View file @
67b10761
...
@@ -249,27 +249,33 @@ cleanup:
...
@@ -249,27 +249,33 @@ cleanup:
*/
*/
CFArrayRef
create_app_icon_images
(
void
)
CFArrayRef
create_app_icon_images
(
void
)
{
{
struct
app_icon_result
icons
;
struct
app_icon_params
params
=
{
.
result
=
(
UINT_PTR
)
&
icons
};
CFMutableArrayRef
images
=
NULL
;
CFMutableArrayRef
images
=
NULL
;
struct
app_icon_entry
*
entries
;
ULONG
ret_len
;
unsigned
count
;
int
i
;
int
i
;
TRACE
(
"()
\n
"
);
TRACE
(
"()
\n
"
);
macdrv_client_func
(
client_func_app_icon
,
&
params
,
sizeof
(
params
));
if
(
KeUserModeCallback
(
client_func_app_icon
,
NULL
,
0
,
(
void
**
)
&
entries
,
&
ret_len
)
||
(
ret_len
%
sizeof
(
*
entries
)))
if
(
!
icons
.
count
)
return
NULL
;
{
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
)
if
(
!
images
)
{
{
WARN
(
"failed to create images array
\n
"
);
WARN
(
"failed to create images array
\n
"
);
return
NULL
;
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
;
CGImageRef
cgimage
=
NULL
;
if
(
icon
->
png
)
if
(
icon
->
png
)
...
...
dlls/winemac.drv/unixlib.h
View file @
67b10761
...
@@ -104,18 +104,6 @@ struct app_icon_entry
...
@@ -104,18 +104,6 @@ struct app_icon_entry
UINT64
png
;
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 */
/* macdrv_app_quit_request params */
struct
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