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
fe2f86e9
Commit
fe2f86e9
authored
Dec 21, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Some tests for ZombifyActCtx().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1980834c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
actctx.c
dlls/kernel32/tests/actctx.c
+74
-0
No files found.
dlls/kernel32/tests/actctx.c
View file @
fe2f86e9
...
...
@@ -40,6 +40,7 @@ static BOOL (WINAPI *pIsDebuggerPresent)(void);
static
BOOL
(
WINAPI
*
pQueryActCtxW
)(
DWORD
,
HANDLE
,
PVOID
,
ULONG
,
PVOID
,
SIZE_T
,
SIZE_T
*
);
static
VOID
(
WINAPI
*
pReleaseActCtx
)(
HANDLE
);
static
BOOL
(
WINAPI
*
pFindActCtxSectionGuid
)(
DWORD
,
const
GUID
*
,
ULONG
,
const
GUID
*
,
PACTCTX_SECTION_KEYED_DATA
);
static
BOOL
(
WINAPI
*
pZombifyActCtx
)(
HANDLE
);
static
NTSTATUS
(
NTAPI
*
pRtlFindActivationContextSectionString
)(
DWORD
,
const
GUID
*
,
ULONG
,
PUNICODE_STRING
,
PACTCTX_SECTION_KEYED_DATA
);
static
BOOLEAN
(
NTAPI
*
pRtlCreateUnicodeStringFromAsciiz
)(
PUNICODE_STRING
,
PCSZ
);
...
...
@@ -2425,6 +2426,7 @@ static BOOL init_funcs(void)
X
(
QueryActCtxW
);
X
(
ReleaseActCtx
);
X
(
FindActCtxSectionGuid
);
X
(
ZombifyActCtx
);
hLibrary
=
GetModuleHandleA
(
"ntdll.dll"
);
X
(
RtlFindActivationContextSectionString
);
...
...
@@ -2435,6 +2437,77 @@ static BOOL init_funcs(void)
return
TRUE
;
}
static
void
test_ZombifyActCtx
(
void
)
{
ACTIVATION_CONTEXT_BASIC_INFORMATION
basicinfo
;
ULONG_PTR
cookie
;
HANDLE
handle
,
current
;
BOOL
ret
;
SetLastError
(
0xdeadbeef
);
ret
=
pZombifyActCtx
(
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
handle
=
create_manifest
(
"test.manifest"
,
testdep_manifest3
,
__LINE__
);
ret
=
pGetCurrentActCtx
(
&
current
);
ok
(
ret
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
current
==
NULL
,
"got %p
\n
"
,
current
);
ret
=
pActivateActCtx
(
handle
,
&
cookie
);
ok
(
ret
,
"ActivateActCtx failed: %u
\n
"
,
GetLastError
());
ret
=
pGetCurrentActCtx
(
&
current
);
ok
(
ret
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
handle
==
current
,
"got %p, %p
\n
"
,
current
,
handle
);
memset
(
&
basicinfo
,
0xff
,
sizeof
(
basicinfo
));
ret
=
pQueryActCtxW
(
0
,
handle
,
0
,
ActivationContextBasicInformation
,
&
basicinfo
,
sizeof
(
basicinfo
),
NULL
);
ok
(
ret
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
basicinfo
.
hActCtx
==
handle
,
"got %p
\n
"
,
basicinfo
.
hActCtx
);
ok
(
basicinfo
.
dwFlags
==
0
,
"got %x
\n
"
,
basicinfo
.
dwFlags
);
memset
(
&
basicinfo
,
0xff
,
sizeof
(
basicinfo
));
ret
=
pQueryActCtxW
(
QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX
,
NULL
,
0
,
ActivationContextBasicInformation
,
&
basicinfo
,
sizeof
(
basicinfo
),
NULL
);
ok
(
ret
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
basicinfo
.
hActCtx
==
handle
,
"got %p
\n
"
,
basicinfo
.
hActCtx
);
ok
(
basicinfo
.
dwFlags
==
0
,
"got %x
\n
"
,
basicinfo
.
dwFlags
);
ret
=
pZombifyActCtx
(
handle
);
todo_wine
ok
(
ret
,
"got %d
\n
"
,
ret
);
memset
(
&
basicinfo
,
0xff
,
sizeof
(
basicinfo
));
ret
=
pQueryActCtxW
(
0
,
handle
,
0
,
ActivationContextBasicInformation
,
&
basicinfo
,
sizeof
(
basicinfo
),
NULL
);
ok
(
ret
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
basicinfo
.
hActCtx
==
handle
,
"got %p
\n
"
,
basicinfo
.
hActCtx
);
ok
(
basicinfo
.
dwFlags
==
0
,
"got %x
\n
"
,
basicinfo
.
dwFlags
);
memset
(
&
basicinfo
,
0xff
,
sizeof
(
basicinfo
));
ret
=
pQueryActCtxW
(
QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX
,
NULL
,
0
,
ActivationContextBasicInformation
,
&
basicinfo
,
sizeof
(
basicinfo
),
NULL
);
ok
(
ret
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
basicinfo
.
hActCtx
==
handle
,
"got %p
\n
"
,
basicinfo
.
hActCtx
);
ok
(
basicinfo
.
dwFlags
==
0
,
"got %x
\n
"
,
basicinfo
.
dwFlags
);
ret
=
pGetCurrentActCtx
(
&
current
);
ok
(
ret
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
current
==
handle
,
"got %p
\n
"
,
current
);
/* one more time */
ret
=
pZombifyActCtx
(
handle
);
todo_wine
ok
(
ret
,
"got %d
\n
"
,
ret
);
ret
=
pDeactivateActCtx
(
0
,
cookie
);
ok
(
ret
,
"DeactivateActCtx failed: %u
\n
"
,
GetLastError
());
pReleaseActCtx
(
handle
);
}
START_TEST
(
actctx
)
{
int
argc
;
...
...
@@ -2457,5 +2530,6 @@ START_TEST(actctx)
test_actctx
();
test_CreateActCtx
();
test_findsectionstring
();
test_ZombifyActCtx
();
run_child_process
();
}
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