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
2c576e88
Commit
2c576e88
authored
Sep 27, 2009
by
Stefan Leichter
Committed by
Alexandre Julliard
Sep 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Check parameter of CheckRemoteDebuggerPresent with tests.
parent
d1099eb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
debugger.c
dlls/kernel32/debugger.c
+5
-0
debugger.c
dlls/kernel32/tests/debugger.c
+33
-0
No files found.
dlls/kernel32/debugger.c
View file @
2c576e88
...
@@ -402,6 +402,11 @@ BOOL WINAPI IsDebuggerPresent(void)
...
@@ -402,6 +402,11 @@ BOOL WINAPI IsDebuggerPresent(void)
*/
*/
BOOL
WINAPI
CheckRemoteDebuggerPresent
(
HANDLE
process
,
PBOOL
DebuggerPresent
)
BOOL
WINAPI
CheckRemoteDebuggerPresent
(
HANDLE
process
,
PBOOL
DebuggerPresent
)
{
{
if
(
!
process
||
!
DebuggerPresent
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
FIXME
(
"(%p)->(%p): Stub!
\n
"
,
process
,
DebuggerPresent
);
FIXME
(
"(%p)->(%p): Stub!
\n
"
,
process
,
DebuggerPresent
);
*
DebuggerPresent
=
FALSE
;
*
DebuggerPresent
=
FALSE
;
return
TRUE
;
return
TRUE
;
...
...
dlls/kernel32/tests/debugger.c
View file @
2c576e88
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
static
int
myARGC
;
static
int
myARGC
;
static
char
**
myARGV
;
static
char
**
myARGV
;
static
BOOL
(
WINAPI
*
pCheckRemoteDebuggerPresent
)(
HANDLE
,
PBOOL
);
static
BOOL
(
WINAPI
*
pDebugActiveProcessStop
)(
DWORD
);
static
BOOL
(
WINAPI
*
pDebugActiveProcessStop
)(
DWORD
);
static
BOOL
(
WINAPI
*
pDebugSetProcessKillOnExit
)(
BOOL
);
static
BOOL
(
WINAPI
*
pDebugSetProcessKillOnExit
)(
BOOL
);
...
@@ -431,11 +432,42 @@ static void test_ExitCode(void)
...
@@ -431,11 +432,42 @@ static void test_ExitCode(void)
}
}
}
}
static
void
test_RemoteDebugger
(
void
)
{
BOOL
bret
,
present
;
if
(
!
pCheckRemoteDebuggerPresent
)
{
win_skip
(
"CheckRemoteDebuggerPresent is not available
\n
"
);
return
;
}
present
=
TRUE
;
SetLastError
(
0xdeadbeef
);
bret
=
pCheckRemoteDebuggerPresent
(
GetCurrentProcess
(),
&
present
);
ok
(
bret
,
"expected CheckRemoteDebuggerPresent to succeed
\n
"
);
ok
(
0xdeadbeef
==
GetLastError
(),
"expected error to be unchanged, got %d/%x
\n
"
,
GetLastError
(),
GetLastError
());
present
=
TRUE
;
SetLastError
(
0xdeadbeef
);
bret
=
pCheckRemoteDebuggerPresent
(
NULL
,
&
present
);
ok
(
!
bret
,
"expected CheckRemoteDebuggerPresent to fail
\n
"
);
ok
(
present
,
"expected parameter to be unchanged
\n
"
);
ok
(
ERROR_INVALID_PARAMETER
==
GetLastError
(),
"expected error ERROR_INVALID_PARAMETER, got %d/%x
\n
"
,
GetLastError
(),
GetLastError
());
SetLastError
(
0xdeadbeef
);
bret
=
pCheckRemoteDebuggerPresent
(
GetCurrentProcess
(),
NULL
);
ok
(
!
bret
,
"expected CheckRemoteDebuggerPresent to fail
\n
"
);
ok
(
ERROR_INVALID_PARAMETER
==
GetLastError
(),
"expected error ERROR_INVALID_PARAMETER, got %d/%x
\n
"
,
GetLastError
(),
GetLastError
());
}
START_TEST
(
debugger
)
START_TEST
(
debugger
)
{
{
HMODULE
hdll
;
HMODULE
hdll
;
hdll
=
GetModuleHandle
(
"kernel32.dll"
);
hdll
=
GetModuleHandle
(
"kernel32.dll"
);
pCheckRemoteDebuggerPresent
=
(
void
*
)
GetProcAddress
(
hdll
,
"CheckRemoteDebuggerPresent"
);
pDebugActiveProcessStop
=
(
void
*
)
GetProcAddress
(
hdll
,
"DebugActiveProcessStop"
);
pDebugActiveProcessStop
=
(
void
*
)
GetProcAddress
(
hdll
,
"DebugActiveProcessStop"
);
pDebugSetProcessKillOnExit
=
(
void
*
)
GetProcAddress
(
hdll
,
"DebugSetProcessKillOnExit"
);
pDebugSetProcessKillOnExit
=
(
void
*
)
GetProcAddress
(
hdll
,
"DebugSetProcessKillOnExit"
);
...
@@ -451,5 +483,6 @@ START_TEST(debugger)
...
@@ -451,5 +483,6 @@ START_TEST(debugger)
else
else
{
{
test_ExitCode
();
test_ExitCode
();
test_RemoteDebugger
();
}
}
}
}
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