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
3cd9f971
Commit
3cd9f971
authored
Mar 30, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Pack the appbar data structure to allow crossing 32/64 boundaries.
parent
01578f51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
37 deletions
+68
-37
appbar.c
dlls/shell32/appbar.c
+28
-9
appbar.c
programs/explorer/appbar.c
+40
-28
No files found.
dlls/shell32/appbar.c
View file @
3cd9f971
...
@@ -36,17 +36,26 @@
...
@@ -36,17 +36,26 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
appbar
);
WINE_DEFAULT_DEBUG_CHANNEL
(
appbar
);
struct
appbar_data_msg
/* platform-independent data */
{
ULONG
hWnd
;
UINT
uCallbackMessage
;
UINT
uEdge
;
RECT
rc
;
ULONGLONG
lParam
;
};
struct
appbar_cmd
struct
appbar_cmd
{
{
HANDLE
return_map
;
ULONG
return_map
;
DWORD
return_process
;
DWORD
return_process
;
APPBARDATA
abd
;
struct
appbar_data_msg
abd
;
};
};
struct
appbar_response
struct
appbar_response
{
{
U
INT_PTR
result
;
U
LONGLONG
result
;
APPBARDATA
abd
;
struct
appbar_data_msg
abd
;
};
};
/*************************************************************************
/*************************************************************************
...
@@ -75,7 +84,11 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
...
@@ -75,7 +84,11 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
return
FALSE
;
return
FALSE
;
}
}
command
.
abd
=
*
data
;
command
.
abd
.
hWnd
=
HandleToLong
(
data
->
hWnd
);
command
.
abd
.
uCallbackMessage
=
data
->
uCallbackMessage
;
command
.
abd
.
uEdge
=
data
->
uEdge
;
command
.
abd
.
rc
=
data
->
rc
;
command
.
abd
.
lParam
=
data
->
lParam
;
return_map
=
CreateFileMappingW
(
INVALID_HANDLE_VALUE
,
0
,
PAGE_READWRITE
,
0
,
sizeof
(
struct
appbar_response
),
NULL
);
return_map
=
CreateFileMappingW
(
INVALID_HANDLE_VALUE
,
0
,
PAGE_READWRITE
,
0
,
sizeof
(
struct
appbar_response
),
NULL
);
if
(
return_map
==
NULL
)
if
(
return_map
==
NULL
)
...
@@ -83,7 +96,7 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
...
@@ -83,7 +96,7 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
ERR
(
"couldn't create file mapping
\n
"
);
ERR
(
"couldn't create file mapping
\n
"
);
return
0
;
return
0
;
}
}
command
.
return_map
=
return_map
;
command
.
return_map
=
HandleToUlong
(
return_map
)
;
command
.
return_process
=
GetCurrentProcessId
();
command
.
return_process
=
GetCurrentProcessId
();
...
@@ -112,8 +125,14 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
...
@@ -112,8 +125,14 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
response
=
return_view
;
response
=
return_view
;
ret
=
response
->
result
;
ret
=
response
->
result
;
*
data
=
response
->
abd
;
if
(
ret
)
{
data
->
hWnd
=
UlongToHandle
(
response
->
abd
.
hWnd
);
data
->
uCallbackMessage
=
response
->
abd
.
uCallbackMessage
;
data
->
uEdge
=
response
->
abd
.
uEdge
;
data
->
rc
=
response
->
abd
.
rc
;
data
->
lParam
=
response
->
abd
.
lParam
;
}
UnmapViewOfFile
(
return_view
);
UnmapViewOfFile
(
return_view
);
CloseHandle
(
return_map
);
CloseHandle
(
return_map
);
...
...
programs/explorer/appbar.c
View file @
3cd9f971
...
@@ -37,17 +37,26 @@
...
@@ -37,17 +37,26 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
appbar
);
WINE_DEFAULT_DEBUG_CHANNEL
(
appbar
);
struct
appbar_data_msg
/* platform-independent data */
{
LONG
hWnd
;
UINT
uCallbackMessage
;
UINT
uEdge
;
RECT
rc
;
ULONGLONG
lParam
;
};
struct
appbar_cmd
struct
appbar_cmd
{
{
HANDLE
return_map
;
ULONG
return_map
;
DWORD
return_process
;
DWORD
return_process
;
APPBARDATA
abd
;
struct
appbar_data_msg
abd
;
};
};
struct
appbar_response
struct
appbar_response
{
{
U
INT_PTR
result
;
U
LONGLONG
result
;
APPBARDATA
abd
;
struct
appbar_data_msg
abd
;
};
};
static
HWND
appbarmsg_window
=
NULL
;
static
HWND
appbarmsg_window
=
NULL
;
...
@@ -92,12 +101,12 @@ static void send_poschanged(HWND hwnd)
...
@@ -92,12 +101,12 @@ static void send_poschanged(HWND hwnd)
}
}
/* appbar_cliprect: cut out parts of the rectangle that interfere with existing appbars */
/* appbar_cliprect: cut out parts of the rectangle that interfere with existing appbars */
static
void
appbar_cliprect
(
PAPPBARDATA
abd
)
static
void
appbar_cliprect
(
HWND
hwnd
,
RECT
*
rect
)
{
{
struct
appbar_data
*
data
;
struct
appbar_data
*
data
;
LIST_FOR_EACH_ENTRY
(
data
,
&
appbars
,
struct
appbar_data
,
entry
)
LIST_FOR_EACH_ENTRY
(
data
,
&
appbars
,
struct
appbar_data
,
entry
)
{
{
if
(
data
->
hwnd
==
abd
->
hW
nd
)
if
(
data
->
hwnd
==
hw
nd
)
{
{
/* we only care about appbars that were added before this one */
/* we only care about appbars that were added before this one */
return
;
return
;
...
@@ -108,30 +117,31 @@ static void appbar_cliprect(PAPPBARDATA abd)
...
@@ -108,30 +117,31 @@ static void appbar_cliprect(PAPPBARDATA abd)
switch
(
data
->
edge
)
switch
(
data
->
edge
)
{
{
case
ABE_BOTTOM
:
case
ABE_BOTTOM
:
abd
->
rc
.
bottom
=
min
(
abd
->
rc
.
bottom
,
data
->
rc
.
top
);
rect
->
bottom
=
min
(
rect
->
bottom
,
data
->
rc
.
top
);
break
;
break
;
case
ABE_LEFT
:
case
ABE_LEFT
:
abd
->
rc
.
left
=
max
(
abd
->
rc
.
left
,
data
->
rc
.
right
);
rect
->
left
=
max
(
rect
->
left
,
data
->
rc
.
right
);
break
;
break
;
case
ABE_RIGHT
:
case
ABE_RIGHT
:
abd
->
rc
.
right
=
min
(
abd
->
rc
.
right
,
data
->
rc
.
left
);
rect
->
right
=
min
(
rect
->
right
,
data
->
rc
.
left
);
break
;
break
;
case
ABE_TOP
:
case
ABE_TOP
:
abd
->
rc
.
top
=
max
(
abd
->
rc
.
top
,
data
->
rc
.
bottom
);
rect
->
top
=
max
(
rect
->
top
,
data
->
rc
.
bottom
);
break
;
break
;
}
}
}
}
}
}
}
}
static
UINT_PTR
handle_appbarmessage
(
DWORD
msg
,
PAPPBARDATA
abd
)
static
UINT_PTR
handle_appbarmessage
(
DWORD
msg
,
struct
appbar_data_msg
*
abd
)
{
{
struct
appbar_data
*
data
;
struct
appbar_data
*
data
;
HWND
hwnd
=
LongToHandle
(
abd
->
hWnd
);
switch
(
msg
)
switch
(
msg
)
{
{
case
ABM_NEW
:
case
ABM_NEW
:
if
(
get_appbar
(
abd
->
hW
nd
))
if
(
get_appbar
(
hw
nd
))
{
{
/* fail when adding an hwnd the second time */
/* fail when adding an hwnd the second time */
return
FALSE
;
return
FALSE
;
...
@@ -143,42 +153,42 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
...
@@ -143,42 +153,42 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
WINE_ERR
(
"out of memory
\n
"
);
WINE_ERR
(
"out of memory
\n
"
);
return
FALSE
;
return
FALSE
;
}
}
data
->
hwnd
=
abd
->
hW
nd
;
data
->
hwnd
=
hw
nd
;
data
->
callback_msg
=
abd
->
uCallbackMessage
;
data
->
callback_msg
=
abd
->
uCallbackMessage
;
list_add_tail
(
&
appbars
,
&
data
->
entry
);
list_add_tail
(
&
appbars
,
&
data
->
entry
);
return
TRUE
;
return
TRUE
;
case
ABM_REMOVE
:
case
ABM_REMOVE
:
if
((
data
=
get_appbar
(
abd
->
hW
nd
)))
if
((
data
=
get_appbar
(
hw
nd
)))
{
{
list_remove
(
&
data
->
entry
);
list_remove
(
&
data
->
entry
);
send_poschanged
(
abd
->
hW
nd
);
send_poschanged
(
hw
nd
);
HeapFree
(
GetProcessHeap
(),
0
,
data
);
HeapFree
(
GetProcessHeap
(),
0
,
data
);
}
}
else
else
WINE_WARN
(
"removing hwnd %p not on the list
\n
"
,
abd
->
hW
nd
);
WINE_WARN
(
"removing hwnd %p not on the list
\n
"
,
hw
nd
);
return
TRUE
;
return
TRUE
;
case
ABM_QUERYPOS
:
case
ABM_QUERYPOS
:
if
(
abd
->
uEdge
>
ABE_BOTTOM
)
if
(
abd
->
uEdge
>
ABE_BOTTOM
)
WINE_WARN
(
"invalid edge %i for %p
\n
"
,
abd
->
uEdge
,
abd
->
hW
nd
);
WINE_WARN
(
"invalid edge %i for %p
\n
"
,
abd
->
uEdge
,
hw
nd
);
appbar_cliprect
(
abd
);
appbar_cliprect
(
hwnd
,
&
abd
->
rc
);
return
TRUE
;
return
TRUE
;
case
ABM_SETPOS
:
case
ABM_SETPOS
:
if
(
abd
->
uEdge
>
ABE_BOTTOM
)
if
(
abd
->
uEdge
>
ABE_BOTTOM
)
{
{
WINE_WARN
(
"invalid edge %i for %p
\n
"
,
abd
->
uEdge
,
abd
->
hW
nd
);
WINE_WARN
(
"invalid edge %i for %p
\n
"
,
abd
->
uEdge
,
hw
nd
);
return
TRUE
;
return
TRUE
;
}
}
if
((
data
=
get_appbar
(
abd
->
hW
nd
)))
if
((
data
=
get_appbar
(
hw
nd
)))
{
{
/* calculate acceptable space */
/* calculate acceptable space */
appbar_cliprect
(
abd
);
appbar_cliprect
(
hwnd
,
&
abd
->
rc
);
if
(
!
EqualRect
(
&
abd
->
rc
,
&
data
->
rc
))
if
(
!
EqualRect
(
&
abd
->
rc
,
&
data
->
rc
))
send_poschanged
(
abd
->
hW
nd
);
send_poschanged
(
hw
nd
);
/* reserve that space for this appbar */
/* reserve that space for this appbar */
data
->
edge
=
abd
->
uEdge
;
data
->
edge
=
abd
->
uEdge
;
...
@@ -187,14 +197,14 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
...
@@ -187,14 +197,14 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
}
}
else
else
{
{
WINE_WARN
(
"app sent ABM_SETPOS message for %p without ABM_ADD
\n
"
,
abd
->
hW
nd
);
WINE_WARN
(
"app sent ABM_SETPOS message for %p without ABM_ADD
\n
"
,
hw
nd
);
}
}
return
TRUE
;
return
TRUE
;
case
ABM_GETSTATE
:
case
ABM_GETSTATE
:
WINE_FIXME
(
"SHAppBarMessage(ABM_GETSTATE): stub
\n
"
);
WINE_FIXME
(
"SHAppBarMessage(ABM_GETSTATE): stub
\n
"
);
return
ABS_ALWAYSONTOP
|
ABS_AUTOHIDE
;
return
ABS_ALWAYSONTOP
|
ABS_AUTOHIDE
;
case
ABM_GETTASKBARPOS
:
case
ABM_GETTASKBARPOS
:
WINE_FIXME
(
"SHAppBarMessage(ABM_GETTASKBARPOS, hwnd=%p): stub
\n
"
,
abd
->
hW
nd
);
WINE_FIXME
(
"SHAppBarMessage(ABM_GETTASKBARPOS, hwnd=%p): stub
\n
"
,
hw
nd
);
/* Report the taskbar is at the bottom of the screen. */
/* Report the taskbar is at the bottom of the screen. */
abd
->
rc
.
left
=
0
;
abd
->
rc
.
left
=
0
;
abd
->
rc
.
right
=
GetSystemMetrics
(
SM_CXSCREEN
);
abd
->
rc
.
right
=
GetSystemMetrics
(
SM_CXSCREEN
);
...
@@ -205,10 +215,11 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
...
@@ -205,10 +215,11 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
case
ABM_ACTIVATE
:
case
ABM_ACTIVATE
:
return
TRUE
;
return
TRUE
;
case
ABM_GETAUTOHIDEBAR
:
case
ABM_GETAUTOHIDEBAR
:
WINE_FIXME
(
"SHAppBarMessage(ABM_GETAUTOHIDEBAR, hwnd=%p, edge=%x): stub
\n
"
,
abd
->
hW
nd
,
abd
->
uEdge
);
WINE_FIXME
(
"SHAppBarMessage(ABM_GETAUTOHIDEBAR, hwnd=%p, edge=%x): stub
\n
"
,
hw
nd
,
abd
->
uEdge
);
return
0
;
return
0
;
case
ABM_SETAUTOHIDEBAR
:
case
ABM_SETAUTOHIDEBAR
:
WINE_FIXME
(
"SHAppBarMessage(ABM_SETAUTOHIDEBAR, hwnd=%p, edge=%x, lparam=%lx): stub
\n
"
,
abd
->
hWnd
,
abd
->
uEdge
,
abd
->
lParam
);
WINE_FIXME
(
"SHAppBarMessage(ABM_SETAUTOHIDEBAR, hwnd=%p, edge=%x, lparam=%s): stub
\n
"
,
hwnd
,
abd
->
uEdge
,
wine_dbgstr_longlong
(
abd
->
lParam
));
return
TRUE
;
return
TRUE
;
case
ABM_WINDOWPOSCHANGED
:
case
ABM_WINDOWPOSCHANGED
:
return
TRUE
;
return
TRUE
;
...
@@ -246,7 +257,8 @@ static LRESULT CALLBACK appbar_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
...
@@ -246,7 +257,8 @@ static LRESULT CALLBACK appbar_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
return
TRUE
;
return
TRUE
;
}
}
if
(
!
DuplicateHandle
(
return_hproc
,
cmd
.
return_map
,
GetCurrentProcess
(),
&
return_map
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
))
if
(
!
DuplicateHandle
(
return_hproc
,
UlongToHandle
(
cmd
.
return_map
),
GetCurrentProcess
(),
&
return_map
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
))
{
{
WINE_ERR
(
"couldn't duplicate handle
\n
"
);
WINE_ERR
(
"couldn't duplicate handle
\n
"
);
CloseHandle
(
return_hproc
);
CloseHandle
(
return_hproc
);
...
...
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