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
1b69aae3
Commit
1b69aae3
authored
Sep 17, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Use platform-independent types for user callback params.
parent
4467589a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
37 deletions
+45
-37
dllmain.c
dlls/winemac.drv/dllmain.c
+7
-6
dragdrop.c
dlls/winemac.drv/dragdrop.c
+3
-3
event.c
dlls/winemac.drv/event.c
+8
-8
image.c
dlls/winemac.drv/image.c
+5
-4
ime.c
dlls/winemac.drv/ime.c
+6
-5
unixlib.h
dlls/winemac.drv/unixlib.h
+16
-11
No files found.
dlls/winemac.drv/dllmain.c
View file @
1b69aae3
...
...
@@ -245,7 +245,7 @@ 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
s
->
result
;
struct
app_icon_result
*
result
=
param
_ptr
(
params
->
result
)
;
HRSRC
res_info
;
HGLOBAL
res_data
;
GRPICONDIR
*
icon_dir
;
...
...
@@ -337,17 +337,18 @@ static NTSTATUS WINAPI macdrv_app_icon(void *arg, ULONG size)
if
(
!
memcmp
(
icon_bits
,
png_magic
,
sizeof
(
png_magic
)))
{
entry
->
png
=
icon_bits
;
entry
->
png
=
(
UINT_PTR
)
icon_bits
;
entry
->
icon
=
0
;
result
->
count
++
;
}
else
{
entry
->
icon
=
CreateIconFromResourceEx
(
icon_bits
,
icon_dir
->
idEntries
[
i
].
dwBytesInRes
,
TRUE
,
0x00030000
,
width
,
height
,
0
);
if
(
entry
->
icon
)
HICON
icon
=
CreateIconFromResourceEx
(
icon_bits
,
icon_dir
->
idEntries
[
i
].
dwBytesInRes
,
TRUE
,
0x00030000
,
width
,
height
,
0
);
if
(
icon
)
{
entry
->
png
=
NULL
;
entry
->
icon
=
HandleToUlong
(
icon
);
entry
->
png
=
0
;
result
->
count
++
;
}
else
...
...
dlls/winemac.drv/dragdrop.c
View file @
1b69aae3
...
...
@@ -428,7 +428,7 @@ NTSTATUS WINAPI macdrv_dnd_query_drop(void *arg, ULONG size)
BOOL
ret
=
FALSE
;
POINT
pt
;
TRACE
(
"win %
p
x,y %d,%d effect %x pasteboard %s
\n
"
,
params
->
hwnd
,
params
->
x
,
params
->
y
,
TRACE
(
"win %
x
x,y %d,%d effect %x pasteboard %s
\n
"
,
params
->
hwnd
,
params
->
x
,
params
->
y
,
params
->
effect
,
wine_dbgstr_longlong
(
params
->
handle
));
pt
.
x
=
params
->
x
;
...
...
@@ -511,7 +511,7 @@ NTSTATUS WINAPI macdrv_dnd_query_drop(void *arg, ULONG size)
NTSTATUS
WINAPI
macdrv_dnd_query_exited
(
void
*
arg
,
ULONG
size
)
{
struct
dnd_query_exited_params
*
params
=
arg
;
HWND
hwnd
=
params
->
hwnd
;
HWND
hwnd
=
UlongToHandle
(
params
->
hwnd
)
;
IDropTarget
*
droptarget
;
TRACE
(
"win %p
\n
"
,
hwnd
);
...
...
@@ -542,7 +542,7 @@ NTSTATUS WINAPI macdrv_dnd_query_exited(void *arg, ULONG size)
NTSTATUS
WINAPI
macdrv_dnd_query_drag
(
void
*
arg
,
ULONG
size
)
{
struct
dnd_query_drag_params
*
params
=
arg
;
HWND
hwnd
=
params
->
hwnd
;
HWND
hwnd
=
UlongToHandle
(
params
->
hwnd
)
;
BOOL
ret
=
FALSE
;
POINT
pt
;
DWORD
effect
;
...
...
dlls/winemac.drv/event.c
View file @
1b69aae3
...
...
@@ -162,8 +162,8 @@ static void macdrv_im_set_text(const macdrv_event *event)
size
=
offsetof
(
struct
ime_set_text_params
,
text
[
length
]);
if
(
!
(
params
=
malloc
(
size
)))
return
;
params
->
hwnd
=
hwnd
;
params
->
data
=
event
->
im_set_text
.
data
;
params
->
hwnd
=
HandleToUlong
(
hwnd
)
;
params
->
data
=
(
UINT_PTR
)
event
->
im_set_text
.
data
;
params
->
cursor_pos
=
event
->
im_set_text
.
cursor_pos
;
params
->
complete
=
event
->
im_set_text
.
complete
;
...
...
@@ -229,7 +229,7 @@ static BOOL query_drag_drop(macdrv_query *query)
return
FALSE
;
}
params
.
hwnd
=
hwnd
;
params
.
hwnd
=
HandleToUlong
(
hwnd
)
;
params
.
effect
=
drag_operations_to_dropeffects
(
query
->
drag_drop
.
op
);
params
.
x
=
query
->
drag_drop
.
x
+
data
->
whole_rect
.
left
;
params
.
y
=
query
->
drag_drop
.
y
+
data
->
whole_rect
.
top
;
...
...
@@ -244,7 +244,7 @@ static BOOL query_drag_drop(macdrv_query *query)
static
BOOL
query_drag_exited
(
macdrv_query
*
query
)
{
struct
dnd_query_exited_params
params
;
params
.
hwnd
=
macdrv_get_window_hwnd
(
query
->
window
);
params
.
hwnd
=
HandleToUlong
(
macdrv_get_window_hwnd
(
query
->
window
)
);
return
macdrv_client_func
(
client_func_dnd_query_exited
,
&
params
,
sizeof
(
params
));
}
...
...
@@ -265,7 +265,7 @@ static BOOL query_drag_operation(macdrv_query *query)
return
FALSE
;
}
params
.
hwnd
=
hwnd
;
params
.
hwnd
=
HandleToUlong
(
hwnd
)
;
params
.
effect
=
drag_operations_to_dropeffects
(
query
->
drag_operation
.
offered_ops
);
params
.
x
=
query
->
drag_operation
.
x
+
data
->
whole_rect
.
left
;
params
.
y
=
query
->
drag_operation
.
y
+
data
->
whole_rect
.
top
;
...
...
@@ -297,9 +297,9 @@ BOOL query_ime_char_rect(macdrv_query* query)
TRACE_
(
imm
)(
"win %p/%p himc %p range %ld-%ld
\n
"
,
hwnd
,
query
->
window
,
himc
,
range
->
location
,
range
->
length
);
params
.
hwnd
=
hwnd
;
params
.
data
=
himc
;
params
.
result
=
&
result
;
params
.
hwnd
=
HandleToUlong
(
hwnd
)
;
params
.
data
=
(
UINT_PTR
)
himc
;
params
.
result
=
(
UINT_PTR
)
&
result
;
params
.
location
=
range
->
location
;
params
.
length
=
range
->
length
;
ret
=
macdrv_client_func
(
client_func_ime_query_char_rect
,
&
params
,
sizeof
(
params
));
...
...
dlls/winemac.drv/image.c
View file @
1b69aae3
...
...
@@ -250,7 +250,7 @@ cleanup:
CFArrayRef
create_app_icon_images
(
void
)
{
struct
app_icon_result
icons
;
struct
app_icon_params
params
=
{
.
result
=
&
icons
};
struct
app_icon_params
params
=
{
.
result
=
(
UINT_PTR
)
&
icons
};
CFMutableArrayRef
images
=
NULL
;
int
i
;
...
...
@@ -274,7 +274,7 @@ CFArrayRef create_app_icon_images(void)
if
(
icon
->
png
)
{
CFDataRef
data
=
CFDataCreate
(
NULL
,
icon
->
png
,
icon
->
size
);
CFDataRef
data
=
CFDataCreate
(
NULL
,
param_ptr
(
icon
->
png
)
,
icon
->
size
);
if
(
data
)
{
CGDataProviderRef
provider
=
CGDataProviderCreateWithCFData
(
data
);
...
...
@@ -289,8 +289,9 @@ CFArrayRef create_app_icon_images(void)
}
else
{
cgimage
=
create_cgimage_from_icon
(
icon
->
icon
,
icon
->
width
,
icon
->
height
);
NtUserDestroyCursor
(
icon
->
icon
,
0
);
HICON
handle
=
UlongToHandle
(
icon
->
icon
);
cgimage
=
create_cgimage_from_icon
(
handle
,
icon
->
width
,
icon
->
height
);
NtUserDestroyCursor
(
handle
,
0
);
}
if
(
cgimage
)
...
...
dlls/winemac.drv/ime.c
View file @
1b69aae3
...
...
@@ -1397,7 +1397,8 @@ NTSTATUS WINAPI macdrv_ime_set_text(void *arg, ULONG size)
{
struct
ime_set_text_params
*
params
=
arg
;
ULONG
length
=
(
size
-
offsetof
(
struct
ime_set_text_params
,
text
))
/
sizeof
(
WCHAR
);
void
*
himc
=
params
->
data
;
void
*
himc
=
param_ptr
(
params
->
data
);
HWND
hwnd
=
UlongToHandle
(
params
->
hwnd
);
if
(
!
himc
)
himc
=
RealIMC
(
FROM_MACDRV
);
...
...
@@ -1420,10 +1421,10 @@ NTSTATUS WINAPI macdrv_ime_set_text(void *arg, ULONG size)
{
input
.
ki
.
wScan
=
params
->
text
[
i
];
input
.
ki
.
dwFlags
=
KEYEVENTF_UNICODE
;
__wine_send_input
(
params
->
hwnd
,
&
input
,
NULL
);
__wine_send_input
(
hwnd
,
&
input
,
NULL
);
input
.
ki
.
dwFlags
=
KEYEVENTF_UNICODE
|
KEYEVENTF_KEYUP
;
__wine_send_input
(
params
->
hwnd
,
&
input
,
NULL
);
__wine_send_input
(
hwnd
,
&
input
,
NULL
);
}
}
}
...
...
@@ -1439,8 +1440,8 @@ NTSTATUS WINAPI macdrv_ime_set_text(void *arg, ULONG size)
NTSTATUS
WINAPI
macdrv_ime_query_char_rect
(
void
*
arg
,
ULONG
size
)
{
struct
ime_query_char_rect_params
*
params
=
arg
;
struct
ime_query_char_rect_result
*
result
=
param
s
->
result
;
void
*
himc
=
param
s
->
data
;
struct
ime_query_char_rect_result
*
result
=
param
_ptr
(
params
->
result
)
;
void
*
himc
=
param
_ptr
(
params
->
data
)
;
IMECHARPOSITION
charpos
;
BOOL
ret
=
FALSE
;
...
...
dlls/winemac.drv/unixlib.h
View file @
1b69aae3
...
...
@@ -117,8 +117,8 @@ struct app_icon_entry
UINT32
width
;
UINT32
height
;
UINT32
size
;
void
*
png
;
HICON
icon
;
UINT32
icon
;
UINT64
png
;
};
struct
app_icon_result
...
...
@@ -130,7 +130,7 @@ struct app_icon_result
/* macdrv_app_icon params */
struct
app_icon_params
{
struct
app_icon_result
*
result
;
/* FIXME: Use NtCallbackReturn instead */
UINT64
result
;
/* FIXME: Use NtCallbackReturn instead */
};
/* macdrv_app_quit_request params */
...
...
@@ -142,7 +142,7 @@ struct app_quit_request_params
/* macdrv_dnd_query_drag params */
struct
dnd_query_drag_params
{
HWND
hwnd
;
UINT32
hwnd
;
UINT32
effect
;
INT32
x
;
INT32
y
;
...
...
@@ -152,7 +152,7 @@ struct dnd_query_drag_params
/* macdrv_dnd_query_drop params */
struct
dnd_query_drop_params
{
HWND
hwnd
;
UINT32
hwnd
;
UINT32
effect
;
INT32
x
;
INT32
y
;
...
...
@@ -162,7 +162,7 @@ struct dnd_query_drop_params
/* macdrv_dnd_query_exited params */
struct
dnd_query_exited_params
{
HWND
hwnd
;
UINT32
hwnd
;
};
/* macdrv_ime_query_char_rect result */
...
...
@@ -176,21 +176,26 @@ struct ime_query_char_rect_result
/* macdrv_ime_query_char_rect params */
struct
ime_query_char_rect_params
{
HWND
hwnd
;
void
*
data
;
UINT32
hwnd
;
UINT32
location
;
UINT64
data
;
UINT64
result
;
/* FIXME: Use NtCallbackReturn instead */
UINT32
length
;
struct
ime_query_char_rect_result
*
result
;
/* FIXME: Use NtCallbackReturn instead */
};
/* macdrv_ime_set_text params */
struct
ime_set_text_params
{
HWND
hwnd
;
void
*
data
;
UINT32
hwnd
;
UINT32
cursor_pos
;
UINT64
data
;
UINT32
complete
;
WCHAR
text
[
1
];
};
static
inline
void
*
param_ptr
(
UINT64
param
)
{
return
(
void
*
)(
UINT_PTR
)
param
;
}
C_ASSERT
(
client_func_last
<=
NtUserDriverCallbackLast
+
1
);
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