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
6bf2abfa
Commit
6bf2abfa
authored
Aug 29, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make window handles 32-bit before calling window procedure.
Don't clear window parent field when unlinking it.
parent
1a66d226
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
22 deletions
+33
-22
win.h
include/win.h
+1
-2
win.c
windows/win.c
+25
-6
winproc.c
windows/winproc.c
+7
-14
No files found.
include/win.h
View file @
6bf2abfa
...
...
@@ -85,8 +85,7 @@ extern WND* WIN_FindWndPtr( HWND hwnd );
extern
WND
*
WIN_LockWndPtr
(
WND
*
wndPtr
);
extern
void
WIN_ReleaseWndPtr
(
WND
*
wndPtr
);
extern
void
WIN_UpdateWndPtr
(
WND
**
oldPtr
,
WND
*
newPtr
);
extern
void
WIN_DumpWindow
(
HWND
hwnd
);
extern
void
WIN_WalkWindows
(
HWND
hwnd
,
int
indent
);
extern
HWND
WIN_GetFullHandle
(
HWND
hwnd
);
extern
void
WIN_LinkWindow
(
HWND
hwnd
,
HWND
parent
,
HWND
hwndInsertAfter
);
extern
void
WIN_UnlinkWindow
(
HWND
hwnd
);
extern
HWND
WIN_FindWinToRepaint
(
HWND
hwnd
);
...
...
windows/win.c
View file @
6bf2abfa
...
...
@@ -147,6 +147,26 @@ static WND *free_window_handle( HWND hwnd )
/***********************************************************************
* WIN_GetFullHandle
*
* Get the full 32-bit window handle from a possibly truncated handle.
*/
HWND
WIN_GetFullHandle
(
HWND
hwnd
)
{
if
(
!
HIWORD
(
hwnd
))
{
SERVER_START_REQ
(
get_window_info
)
{
req
->
handle
=
hwnd
;
if
(
!
SERVER_CALL_ERR
())
hwnd
=
req
->
full_handle
;
}
SERVER_END_REQ
;
}
return
hwnd
;
}
/***********************************************************************
* WIN_FindWndPtr
*
* Return a pointer to the WND structure corresponding to a HWND.
...
...
@@ -294,10 +314,9 @@ void WIN_LinkWindow( HWND hwnd, HWND parent, HWND hwndInsertAfter )
if
(
*
ppWnd
)
*
ppWnd
=
wndPtr
->
next
;
}
wndPtr
->
parent
=
parentPtr
;
if
(
parentPtr
)
{
wndPtr
->
parent
=
parentPtr
;
if
((
hwndInsertAfter
==
HWND_TOP
)
||
(
hwndInsertAfter
==
HWND_BOTTOM
))
{
ppWnd
=
&
parentPtr
->
child
;
/* Point to first sibling hwnd */
...
...
@@ -314,6 +333,7 @@ void WIN_LinkWindow( HWND hwnd, HWND parent, HWND hwndInsertAfter )
wndPtr
->
next
=
*
ppWnd
;
*
ppWnd
=
wndPtr
;
}
else
wndPtr
->
next
=
NULL
;
/* unlinked */
done:
WIN_ReleaseWndPtr
(
parentPtr
);
...
...
@@ -2155,11 +2175,10 @@ HWND WINAPI GetParent( HWND hwnd )
HWND
WINAPI
GetAncestor
(
HWND
hwnd
,
UINT
type
)
{
HWND
ret
;
WND
*
wndPtr
,
*
parent
;
WND
*
wndPtr
;
if
(
hwnd
==
GetDesktopWindow
())
return
0
;
if
(
!
(
wndPtr
=
WIN_FindWndPtr
(
hwnd
)))
return
0
;
parent
=
wndPtr
->
parent
;
switch
(
type
)
{
...
...
@@ -2173,7 +2192,7 @@ HWND WINAPI GetAncestor( HWND hwnd, UINT type )
case
GA_ROOTOWNER
:
while
(
wndPtr
->
parent
->
hwndSelf
!=
GetDesktopWindow
())
WIN_UpdateWndPtr
(
&
wndPtr
,
wndPtr
->
parent
);
while
(
wndPtr
->
owner
)
while
(
wndPtr
&&
wndPtr
->
owner
)
{
WND
*
ptr
=
WIN_FindWndPtr
(
wndPtr
->
owner
);
WIN_ReleaseWndPtr
(
wndPtr
);
...
...
@@ -2181,7 +2200,7 @@ HWND WINAPI GetAncestor( HWND hwnd, UINT type )
}
break
;
}
ret
=
wndPtr
->
hwndSelf
;
ret
=
wndPtr
?
wndPtr
->
hwndSelf
:
0
;
WIN_ReleaseWndPtr
(
wndPtr
);
return
ret
;
}
...
...
windows/winproc.c
View file @
6bf2abfa
...
...
@@ -162,6 +162,7 @@ static LRESULT WINPROC_CallWndProc( WNDPROC proc, HWND hwnd, UINT msg,
LRESULT
retvalue
;
int
iWndsLocks
;
hwnd
=
WIN_GetFullHandle
(
hwnd
);
if
(
TRACE_ON
(
relay
))
DPRINTF
(
"%08lx:Call window proc %p (hwnd=%08x,msg=%s,wp=%08x,lp=%08lx)
\n
"
,
GetCurrentThreadId
(),
proc
,
hwnd
,
SPY_GetMsgName
(
msg
),
wParam
,
lParam
);
...
...
@@ -516,28 +517,20 @@ WINDOWPROCTYPE WINPROC_GetProcType( HWINDOWPROC proc )
*
* Return TRUE if the lparam is a string
*/
static
BOOL
WINPROC_TestCBForStr
(
HWND
hwnd
)
inline
static
BOOL
WINPROC_TestCBForStr
(
HWND
hwnd
)
{
BOOL
retvalue
;
WND
*
wnd
=
WIN_FindWndPtr
(
hwnd
);
retvalue
=
(
!
(
LOWORD
(
wnd
->
dwStyle
)
&
(
CBS_OWNERDRAWFIXED
|
CBS_OWNERDRAWVARIABLE
))
||
(
LOWORD
(
wnd
->
dwStyle
)
&
CBS_HASSTRINGS
)
);
WIN_ReleaseWndPtr
(
wnd
);
return
retvalue
;
DWORD
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
return
(
!
(
style
&
(
CBS_OWNERDRAWFIXED
|
CBS_OWNERDRAWVARIABLE
))
||
(
style
&
CBS_HASSTRINGS
));
}
/**********************************************************************
* WINPROC_TestLBForStr
*
* Return TRUE if the lparam is a string
*/
static
BOOL
WINPROC_TestLBForStr
(
HWND
hwnd
)
inline
static
BOOL
WINPROC_TestLBForStr
(
HWND
hwnd
)
{
BOOL
retvalue
;
WND
*
wnd
=
WIN_FindWndPtr
(
hwnd
);
retvalue
=
(
!
(
LOWORD
(
wnd
->
dwStyle
)
&
(
LBS_OWNERDRAWFIXED
|
LBS_OWNERDRAWVARIABLE
))
||
(
LOWORD
(
wnd
->
dwStyle
)
&
LBS_HASSTRINGS
)
);
WIN_ReleaseWndPtr
(
wnd
);
return
retvalue
;
DWORD
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
return
(
!
(
style
&
(
LBS_OWNERDRAWFIXED
|
LBS_OWNERDRAWVARIABLE
))
||
(
style
&
LBS_HASSTRINGS
));
}
/**********************************************************************
...
...
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