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
55557319
Commit
55557319
authored
Oct 23, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A couple of optimizations.
parent
b517b764
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
8 deletions
+50
-8
win.c
windows/win.c
+50
-8
No files found.
windows/win.c
View file @
55557319
...
...
@@ -1871,9 +1871,13 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
TRACE
(
"%x %d %lx %x
\n
"
,
hwnd
,
offset
,
newval
,
type
);
if
(
!
WIN_IsCurrent
Thread
(
hwnd
))
if
(
!
WIN_IsCurrent
Process
(
hwnd
))
{
ERR
(
"set %x %d %x
\n
"
,
hwnd
,
offset
,
newval
);
if
(
offset
==
GWL_WNDPROC
)
{
SetLastError
(
ERROR_ACCESS_DENIED
);
return
0
;
}
return
SendMessageW
(
hwnd
,
WM_WINE_SETWINDOWLONG
,
offset
,
newval
);
}
...
...
@@ -2702,24 +2706,62 @@ HWND WINAPI GetLastActivePopup( HWND hwnd )
*/
HWND
*
WIN_ListParents
(
HWND
hwnd
)
{
HWND
*
list
=
NULL
;
WND
*
win
;
HWND
current
,
*
list
;
int
pos
=
0
,
size
=
16
,
count
;
if
(
!
(
list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
HWND
)
)))
return
NULL
;
current
=
hwnd
;
for
(;;)
{
if
(
!
(
win
=
WIN_GetPtr
(
current
)))
goto
empty
;
if
(
win
==
WND_OTHER_PROCESS
)
break
;
/* need to do it the hard way */
list
[
pos
]
=
win
->
parent
;
WIN_ReleasePtr
(
win
);
if
(
!
(
current
=
list
[
pos
]))
{
if
(
!
pos
)
goto
empty
;
return
list
;
}
if
(
++
pos
==
size
-
1
)
{
/* need to grow the list */
HWND
*
new_list
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
list
,
(
size
+
16
)
*
sizeof
(
HWND
)
);
if
(
!
new_list
)
goto
empty
;
list
=
new_list
;
size
+=
16
;
}
}
/* at least one parent belongs to another process, have to query the server */
SERVER_START_VAR_REQ
(
get_window_parents
,
REQUEST_MAX_VAR_SIZE
)
{
req
->
handle
=
hwnd
;
if
(
!
SERVER_CALL
())
{
user_handle_t
*
data
=
server_data_ptr
(
req
);
int
i
,
count
=
server_data_size
(
req
)
/
sizeof
(
*
data
);
if
(
count
&&
((
list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
count
+
1
)
*
sizeof
(
HWND
)
)))
)
count
=
server_data_size
(
req
)
/
sizeof
(
*
data
);
if
(
count
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
list
[
i
]
=
data
[
i
];
list
[
i
]
=
0
;
HWND
*
new_list
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
list
,
(
count
+
1
)
*
sizeof
(
HWND
)
);
if
(
new_list
)
{
list
=
new_list
;
for
(
pos
=
0
;
pos
<
count
;
pos
++
)
list
[
pos
]
=
data
[
pos
];
list
[
pos
]
=
0
;
}
else
count
=
0
;
}
}
}
SERVER_END_VAR_REQ
;
return
list
;
if
(
count
)
return
list
;
empty:
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
NULL
;
}
...
...
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