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
9dc6f6cf
Commit
9dc6f6cf
authored
Aug 31, 2007
by
Francois Gouget
Committed by
Alexandre Julliard
Aug 31, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for DebugActiveProcessStop() and DebugSetProcessKillOnExit().
parent
b6aa2470
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
debugger.c
dlls/kernel32/tests/debugger.c
+35
-1
No files found.
dlls/kernel32/tests/debugger.c
View file @
9dc6f6cf
...
@@ -32,6 +32,8 @@
...
@@ -32,6 +32,8 @@
static
int
myARGC
;
static
int
myARGC
;
static
char
**
myARGV
;
static
char
**
myARGV
;
static
BOOL
(
WINAPI
*
pDebugActiveProcessStop
)(
DWORD
);
static
BOOL
(
WINAPI
*
pDebugSetProcessKillOnExit
)(
BOOL
);
/* Copied from the process test */
/* Copied from the process test */
static
void
get_file_name
(
char
*
buf
)
static
void
get_file_name
(
char
*
buf
)
...
@@ -119,6 +121,10 @@ typedef struct
...
@@ -119,6 +121,10 @@ typedef struct
DWORD
debug_err
;
DWORD
debug_err
;
BOOL
attach_rc
;
BOOL
attach_rc
;
DWORD
attach_err
;
DWORD
attach_err
;
BOOL
nokill_rc
;
DWORD
nokill_err
;
BOOL
detach_rc
;
DWORD
detach_err
;
}
debugger_blackbox_t
;
}
debugger_blackbox_t
;
static
void
doDebugger
(
int
argc
,
char
**
argv
)
static
void
doDebugger
(
int
argc
,
char
**
argv
)
...
@@ -157,6 +163,24 @@ static void doDebugger(int argc, char** argv)
...
@@ -157,6 +163,24 @@ static void doDebugger(int argc, char** argv)
WaitForSingleObject
(
start_event
,
INFINITE
);
WaitForSingleObject
(
start_event
,
INFINITE
);
}
}
if
(
strstr
(
myARGV
[
2
],
"nokill"
))
{
blackbox
.
nokill_rc
=
pDebugSetProcessKillOnExit
(
FALSE
);
if
(
!
blackbox
.
nokill_rc
)
blackbox
.
nokill_err
=
GetLastError
();
}
else
blackbox
.
nokill_rc
=
TRUE
;
if
(
strstr
(
myARGV
[
2
],
"detach"
))
{
blackbox
.
detach_rc
=
pDebugActiveProcessStop
(
blackbox
.
pid
);
if
(
!
blackbox
.
detach_rc
)
blackbox
.
detach_err
=
GetLastError
();
}
else
blackbox
.
detach_rc
=
TRUE
;
save_blackbox
(
logfile
,
&
blackbox
,
sizeof
(
blackbox
));
save_blackbox
(
logfile
,
&
blackbox
,
sizeof
(
blackbox
));
trace
(
"debugger: done debugging...
\n
"
);
trace
(
"debugger: done debugging...
\n
"
);
SetEvent
(
done_event
);
SetEvent
(
done_event
);
...
@@ -234,6 +258,8 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks)
...
@@ -234,6 +258,8 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks)
ok
(
dbg_blackbox
.
pid
==
crash_blackbox
.
pid
,
"the child and debugged pids don't match: %d != %d
\n
"
,
crash_blackbox
.
pid
,
dbg_blackbox
.
pid
);
ok
(
dbg_blackbox
.
pid
==
crash_blackbox
.
pid
,
"the child and debugged pids don't match: %d != %d
\n
"
,
crash_blackbox
.
pid
,
dbg_blackbox
.
pid
);
ok
(
dbg_blackbox
.
debug_rc
,
"debugger: SetEvent(debug_event) failed err=%d
\n
"
,
dbg_blackbox
.
debug_err
);
ok
(
dbg_blackbox
.
debug_rc
,
"debugger: SetEvent(debug_event) failed err=%d
\n
"
,
dbg_blackbox
.
debug_err
);
ok
(
dbg_blackbox
.
attach_rc
,
"DebugActiveProcess(%d) failed err=%d
\n
"
,
dbg_blackbox
.
pid
,
dbg_blackbox
.
attach_err
);
ok
(
dbg_blackbox
.
attach_rc
,
"DebugActiveProcess(%d) failed err=%d
\n
"
,
dbg_blackbox
.
pid
,
dbg_blackbox
.
attach_err
);
ok
(
dbg_blackbox
.
nokill_rc
,
"DebugSetProcessKillOnExit(FALSE) failed err=%d
\n
"
,
dbg_blackbox
.
nokill_err
);
ok
(
dbg_blackbox
.
detach_rc
,
"DebugActiveProcessStop(%d) failed err=%d
\n
"
,
dbg_blackbox
.
pid
,
dbg_blackbox
.
detach_err
);
assert
(
DeleteFileA
(
dbglog
)
!=
0
);
assert
(
DeleteFileA
(
dbglog
)
!=
0
);
assert
(
DeleteFileA
(
childlog
)
!=
0
);
assert
(
DeleteFileA
(
childlog
)
!=
0
);
...
@@ -327,6 +353,10 @@ static void test_ExitCode(void)
...
@@ -327,6 +353,10 @@ static void test_ExitCode(void)
crash_and_debug
(
hkey
,
test_exe
,
"dbg,none"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,none"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,event,order"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,event,order"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,event,code2"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,event,code2"
);
if
(
pDebugSetProcessKillOnExit
)
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,event,nokill"
);
if
(
pDebugActiveProcessStop
)
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,event,detach"
);
if
(
disposition
==
REG_CREATED_NEW_KEY
)
if
(
disposition
==
REG_CREATED_NEW_KEY
)
{
{
...
@@ -355,9 +385,13 @@ static void test_ExitCode(void)
...
@@ -355,9 +385,13 @@ static void test_ExitCode(void)
START_TEST
(
debugger
)
START_TEST
(
debugger
)
{
{
HMODULE
hdll
;
myARGC
=
winetest_get_mainargs
(
&
myARGV
);
hdll
=
GetModuleHandle
(
"kernel32.dll"
);
pDebugActiveProcessStop
=
(
void
*
)
GetProcAddress
(
hdll
,
"DebugActiveProcessStop"
);
pDebugSetProcessKillOnExit
=
(
void
*
)
GetProcAddress
(
hdll
,
"DebugSetProcessKillOnExit"
);
myARGC
=
winetest_get_mainargs
(
&
myARGV
);
if
(
myARGC
>=
3
&&
strcmp
(
myARGV
[
2
],
"crash"
)
==
0
)
if
(
myARGC
>=
3
&&
strcmp
(
myARGV
[
2
],
"crash"
)
==
0
)
{
{
doCrash
(
myARGC
,
myARGV
);
doCrash
(
myARGC
,
myARGV
);
...
...
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