ReactOS
0.4.16-dev-814-g656a5dc
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
NtDuplicateObject.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS Kernel
3
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4
* PURPOSE: Test for NtDuplicateObject
5
* COPYRIGHT: Copyright 2019 Thomas Faber (thomas.faber@reactos.org)
6
*/
7
8
#include "
precomp.h
"
9
10
#define OBJ_PROTECT_CLOSE 0x01
11
12
START_TEST
(
NtDuplicateObject
)
13
{
14
NTSTATUS
Status
;
15
HANDLE
Handle
;
16
17
Handle
=
NULL
;
18
Status
=
NtDuplicateObject
(
NtCurrentProcess
(),
19
NtCurrentProcess
(),
20
NtCurrentProcess
(),
21
&
Handle
,
22
GENERIC_ALL
,
23
OBJ_PROTECT_CLOSE
,
24
0);
25
ok_hex
(
Status
,
STATUS_SUCCESS
);
26
ok
(
Handle
!=
NULL
&&
Handle
!=
NtCurrentProcess
(),
27
"Handle = %p\n"
,
Handle
);
28
Status
=
NtClose
(
Handle
);
29
ok_hex
(
Status
,
STATUS_HANDLE_NOT_CLOSABLE
);
30
}
OBJ_PROTECT_CLOSE
#define OBJ_PROTECT_CLOSE
Definition:
NtDuplicateObject.c:10
ok_hex
#define ok_hex(expression, result)
Definition:
atltest.h:94
ok
#define ok(value,...)
Definition:
atltest.h:57
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
NTSTATUS
LONG NTSTATUS
Definition:
precomp.h:26
NULL
#define NULL
Definition:
types.h:112
Handle
ULONG Handle
Definition:
gdb_input.c:15
Status
Status
Definition:
gdiplustypes.h:25
void
Definition:
nsiface.idl:2307
NtCurrentProcess
#define NtCurrentProcess()
Definition:
nt_native.h:1657
GENERIC_ALL
#define GENERIC_ALL
Definition:
nt_native.h:92
NtClose
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition:
obhandle.c:3402
STATUS_HANDLE_NOT_CLOSABLE
#define STATUS_HANDLE_NOT_CLOSABLE
Definition:
ntstatus.h:697
NtDuplicateObject
NTSTATUS NTAPI NtDuplicateObject(IN HANDLE SourceProcessHandle, IN HANDLE SourceHandle, IN HANDLE TargetProcessHandle OPTIONAL, OUT PHANDLE TargetHandle OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG HandleAttributes, IN ULONG Options)
Definition:
obhandle.c:3410
STATUS_SUCCESS
#define STATUS_SUCCESS
Definition:
shellext.h:65
precomp.h
modules
rostests
apitests
ntdll
NtDuplicateObject.c
Generated on Thu Mar 13 2025 06:07:37 for ReactOS by
1.9.6