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
1d556188
Commit
1d556188
authored
Jan 03, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Avoid function pointers for functions present since XP.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
79d58362
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
26 deletions
+12
-26
debugger.c
dlls/kernel32/tests/debugger.c
+12
-26
No files found.
dlls/kernel32/tests/debugger.c
View file @
1d556188
...
...
@@ -38,9 +38,6 @@ static int myARGC;
static
char
**
myARGV
;
static
BOOL
(
WINAPI
*
pCheckRemoteDebuggerPresent
)(
HANDLE
,
PBOOL
);
static
BOOL
(
WINAPI
*
pDebugActiveProcessStop
)(
DWORD
);
static
BOOL
(
WINAPI
*
pDebugSetProcessKillOnExit
)(
BOOL
);
static
BOOL
(
WINAPI
*
pIsDebuggerPresent
)(
void
);
static
void
(
WINAPI
*
pDbgBreakPoint
)(
void
);
...
...
@@ -509,7 +506,7 @@ static void doDebugger(int argc, char** argv)
blackbox
.
nokill_err
=
0
;
if
(
strstr
(
myARGV
[
2
],
"nokill"
))
{
blackbox
.
nokill_rc
=
p
DebugSetProcessKillOnExit
(
FALSE
);
blackbox
.
nokill_rc
=
DebugSetProcessKillOnExit
(
FALSE
);
if
(
!
blackbox
.
nokill_rc
)
blackbox
.
nokill_err
=
GetLastError
();
}
...
...
@@ -519,7 +516,7 @@ static void doDebugger(int argc, char** argv)
blackbox
.
detach_err
=
0
;
if
(
strstr
(
myARGV
[
2
],
"detach"
))
{
blackbox
.
detach_rc
=
p
DebugActiveProcessStop
(
blackbox
.
pid
);
blackbox
.
detach_rc
=
DebugActiveProcessStop
(
blackbox
.
pid
);
if
(
!
blackbox
.
detach_rc
)
blackbox
.
detach_err
=
GetLastError
();
}
...
...
@@ -764,17 +761,9 @@ static void test_ExitCode(void)
ok
(
disposition
==
REG_OPENED_EXISTING_KEY
,
"expected REG_OPENED_EXISTING_KEY, got %d
\n
"
,
disposition
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,event,order"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,event,code2"
);
if
(
pDebugSetProcessKillOnExit
)
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,event,nokill"
);
else
win_skip
(
"DebugSetProcessKillOnExit is not available
\n
"
);
if
(
pDebugActiveProcessStop
)
{
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,event,detach"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,detach,late"
);
}
else
win_skip
(
"DebugActiveProcessStop is not available
\n
"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,event,nokill"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,event,detach"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,detach,late"
);
crash_and_debug
(
hkey
,
test_exe
,
"dbg,attach,process,event,detach"
);
if
(
disposition
==
REG_CREATED_NEW_KEY
)
...
...
@@ -851,7 +840,7 @@ static void doChild(int argc, char **argv)
child_ok
(
ret
,
"CheckRemoteDebuggerPresent failed, last error %#x.
\n
"
,
GetLastError
());
child_ok
(
debug
,
"Expected debug != 0, got %#x.
\n
"
,
debug
);
ret
=
p
DebugActiveProcessStop
(
ppid
);
ret
=
DebugActiveProcessStop
(
ppid
);
child_ok
(
ret
,
"DebugActiveProcessStop failed, last error %#x.
\n
"
,
GetLastError
());
ret
=
pCheckRemoteDebuggerPresent
(
parent
,
&
debug
);
...
...
@@ -861,7 +850,7 @@ static void doChild(int argc, char **argv)
ret
=
CloseHandle
(
parent
);
child_ok
(
ret
,
"CloseHandle failed, last error %#x.
\n
"
,
GetLastError
());
ret
=
p
IsDebuggerPresent
();
ret
=
IsDebuggerPresent
();
child_ok
(
ret
,
"Expected ret != 0, got %#x.
\n
"
,
ret
);
ret
=
pCheckRemoteDebuggerPresent
(
GetCurrentProcess
(),
&
debug
);
child_ok
(
ret
,
"CheckRemoteDebuggerPresent failed, last error %#x.
\n
"
,
GetLastError
());
...
...
@@ -869,7 +858,7 @@ static void doChild(int argc, char **argv)
NtCurrentTeb
()
->
Peb
->
BeingDebugged
=
FALSE
;
ret
=
p
IsDebuggerPresent
();
ret
=
IsDebuggerPresent
();
child_ok
(
!
ret
,
"Expected ret != 0, got %#x.
\n
"
,
ret
);
ret
=
pCheckRemoteDebuggerPresent
(
GetCurrentProcess
(),
&
debug
);
child_ok
(
ret
,
"CheckRemoteDebuggerPresent failed, last error %#x.
\n
"
,
GetLastError
());
...
...
@@ -893,9 +882,9 @@ static void test_debug_loop(int argc, char **argv)
char
*
cmd
;
BOOL
ret
;
if
(
!
p
DebugActiveProcessStop
||
!
p
CheckRemoteDebuggerPresent
)
if
(
!
pCheckRemoteDebuggerPresent
)
{
win_skip
(
"
DebugActiveProcessStop or
CheckRemoteDebuggerPresent not available, skipping test.
\n
"
);
win_skip
(
"CheckRemoteDebuggerPresent not available, skipping test.
\n
"
);
return
;
}
...
...
@@ -1024,9 +1013,9 @@ static void test_debug_children(const char *name, DWORD flag, BOOL debug_child,
BOOL
debug
,
ret
;
struct
debugger_context
ctx
=
{
0
};
if
(
!
p
DebugActiveProcessStop
||
!
p
CheckRemoteDebuggerPresent
)
if
(
!
pCheckRemoteDebuggerPresent
)
{
win_skip
(
"
DebugActiveProcessStop or
CheckRemoteDebuggerPresent not available, skipping test.
\n
"
);
win_skip
(
"CheckRemoteDebuggerPresent not available, skipping test.
\n
"
);
return
;
}
...
...
@@ -1447,9 +1436,6 @@ START_TEST(debugger)
hdll
=
GetModuleHandleA
(
"kernel32.dll"
);
pCheckRemoteDebuggerPresent
=
(
void
*
)
GetProcAddress
(
hdll
,
"CheckRemoteDebuggerPresent"
);
pDebugActiveProcessStop
=
(
void
*
)
GetProcAddress
(
hdll
,
"DebugActiveProcessStop"
);
pDebugSetProcessKillOnExit
=
(
void
*
)
GetProcAddress
(
hdll
,
"DebugSetProcessKillOnExit"
);
pIsDebuggerPresent
=
(
void
*
)
GetProcAddress
(
hdll
,
"IsDebuggerPresent"
);
ntdll
=
GetModuleHandleA
(
"ntdll.dll"
);
pDbgBreakPoint
=
(
void
*
)
GetProcAddress
(
ntdll
,
"DbgBreakPoint"
);
...
...
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