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
371827c3
Commit
371827c3
authored
Dec 21, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp/tests: Wait for child window to be up before testing.
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
d1789fbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
5 deletions
+45
-5
dbghelp.c
dlls/dbghelp/tests/dbghelp.c
+45
-5
No files found.
dlls/dbghelp/tests/dbghelp.c
View file @
371827c3
...
...
@@ -31,6 +31,42 @@ static WCHAR wow64_directory[MAX_PATH];
static
BOOL
(
*
WINAPI
pIsWow64Process2
)(
HANDLE
,
USHORT
*
,
USHORT
*
);
struct
startup_cb
{
DWORD
pid
;
HWND
wnd
;
};
static
BOOL
CALLBACK
startup_cb_window
(
HWND
wnd
,
LPARAM
lParam
)
{
struct
startup_cb
*
info
=
(
struct
startup_cb
*
)
lParam
;
DWORD
pid
;
if
(
GetWindowThreadProcessId
(
wnd
,
&
pid
)
&&
info
->
pid
==
pid
&&
IsWindowVisible
(
wnd
))
{
info
->
wnd
=
wnd
;
return
FALSE
;
}
return
TRUE
;
}
static
BOOL
wait_process_window_visible
(
HANDLE
proc
,
DWORD
pid
,
DWORD
timeout
)
{
DWORD
max_tc
=
GetTickCount
()
+
timeout
;
BOOL
ret
=
WaitForInputIdle
(
proc
,
timeout
);
struct
startup_cb
info
=
{
pid
,
NULL
};
if
(
!
ret
)
{
do
{
if
(
EnumWindows
(
startup_cb_window
,
(
LPARAM
)
&
info
))
Sleep
(
100
);
}
while
(
!
info
.
wnd
&&
GetTickCount
()
<
max_tc
);
}
return
info
.
wnd
!=
NULL
;
}
#if defined(__i386__) || defined(__x86_64__)
static
DWORD
CALLBACK
stack_walk_thread
(
void
*
arg
)
...
...
@@ -373,14 +409,18 @@ static BOOL wrapper_EnumerateLoadedModulesW64(HANDLE proc, PENUMLOADED_MODULES_C
{
BOOL
ret
;
int
retry
;
int
retry_count
=
!
strcmp
(
winetest_platform
,
"wine"
)
?
1
:
5
;
for
(
retry
=
!
strcmp
(
winetest_platform
,
"wine"
)
?
1
:
5
;
retry
>=
0
;
retry
--
)
for
(
retry
=
retry_count
-
1
;
retry
>=
0
;
retry
--
)
{
ret
=
EnumerateLoadedModulesW64
(
proc
,
cb
,
usr
);
if
(
ret
||
GetLastError
()
!=
STATUS_INFO_LENGTH_MISMATCH
)
break
;
Sleep
(
10
);
}
if
(
retry
+
1
<
retry_count
)
trace
(
"used wrapper retry: ret=%d retry=%d top=%d
\n
"
,
ret
,
retry
,
retry_count
);
return
ret
;
}
...
...
@@ -789,8 +829,8 @@ static void test_loaded_modules(void)
ret
=
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
ok
(
ret
,
"CreateProcess failed: %lu
\n
"
,
GetLastError
());
ret
=
WaitForInputIdle
(
pi
.
hProcess
,
5000
);
ok
(
!
ret
,
"wait timed out
\n
"
);
ret
=
wait_process_window_visible
(
pi
.
hProcess
,
pi
.
dwProcessId
,
5000
);
ok
(
ret
,
"wait timed out
\n
"
);
ret
=
SymInitialize
(
pi
.
hProcess
,
NULL
,
FALSE
);
ok
(
ret
,
"SymInitialize failed: %lu
\n
"
,
GetLastError
());
...
...
@@ -869,8 +909,8 @@ static void test_loaded_modules(void)
ret
=
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
if
(
ret
)
{
ret
=
WaitForInputIdle
(
pi
.
hProcess
,
5000
);
ok
(
!
ret
,
"wait timed out
\n
"
);
ret
=
wait_process_window_visible
(
pi
.
hProcess
,
pi
.
dwProcessId
,
5000
);
ok
(
ret
,
"wait timed out
\n
"
);
ret
=
SymInitialize
(
pi
.
hProcess
,
NULL
,
FALSE
);
ok
(
ret
,
"SymInitialize failed: %lu
\n
"
,
GetLastError
());
...
...
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