ReactOS 0.4.15-dev-7654-g6bc40d3
NtOpenThreadToken.c File Reference
#include "precomp.h"
Include dependency graph for NtOpenThreadToken.c:

Go to the source code of this file.

Functions

 START_TEST (NtOpenThreadToken)
 

Function Documentation

◆ START_TEST()

START_TEST ( NtOpenThreadToken  )

Definition at line 10 of file NtOpenThreadToken.c.

11{
16 ULONG i;
17
18 TokenHandle = (HANDLE)0x55555555;
21 TRUE,
23 ok(Status == STATUS_NO_TOKEN, "Status = %lx\n", Status);
24 ok(TokenHandle == (HANDLE)0x55555555 /* 2003 */ ||
25 TokenHandle == NULL /* Win7 */, "TokenHandle = %p\n", TokenHandle);
26
28 ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status);
30 {
35 ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status);
36 if (NT_SUCCESS(Status))
37 {
38 ok((LONG_PTR)TokenHandle > 0, "TokenHandle = %p\n", TokenHandle);
40 ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status);
41 }
42
43 for (i = 0; i < RTL_NUMBER_OF(HandleAttributes); i++)
44 {
50 ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status);
51 if (NT_SUCCESS(Status))
52 {
53 ok((LONG_PTR)TokenHandle > 0, "TokenHandle = %p\n", TokenHandle);
55 ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status);
56 }
57 }
58 }
59
64 sizeof(TokenHandle));
65 ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status);
66}
unsigned char BOOLEAN
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define ok(value,...)
Definition: atltest.h:57
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
@ ThreadImpersonationToken
Definition: compat.h:940
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
@ SecurityImpersonation
Definition: lsa.idl:57
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
_In_ HANDLE _In_opt_ HANDLE _Out_opt_ PHANDLE _In_ ACCESS_MASK _In_ ULONG HandleAttributes
Definition: obfuncs.h:433
_In_ ACCESS_MASK _In_ ULONG _Out_ PHANDLE TokenHandle
Definition: psfuncs.h:718
NTSYSAPI NTSTATUS NTAPI RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
Definition: priv.c:45
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
NTSTATUS NTAPI NtSetInformationThread(IN HANDLE ThreadHandle, IN THREADINFOCLASS ThreadInformationClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
Definition: query.c:2018
NTSTATUS NTAPI NtOpenThreadToken(_In_ HANDLE ThreadHandle, _In_ ACCESS_MASK DesiredAccess, _In_ BOOLEAN OpenAsSelf, _Out_ PHANDLE TokenHandle)
Opens a token that is tied to a thread handle.
Definition: token.c:2474
NTSTATUS NTAPI NtOpenThreadTokenEx(_In_ HANDLE ThreadHandle, _In_ ACCESS_MASK DesiredAccess, _In_ BOOLEAN OpenAsSelf, _In_ ULONG HandleAttributes, _Out_ PHANDLE TokenHandle)
Opens a token that is tied to a thread handle.
Definition: token.c:2331
#define STATUS_NO_TOKEN
Definition: ntstatus.h:360
#define STATUS_SUCCESS
Definition: shellext.h:65
PVOID HANDLE
Definition: typedefs.h:73
uint32_t ULONG
Definition: typedefs.h:59
#define TOKEN_READ
Definition: setypes.h:951
_In_ ACCESS_MASK _In_ BOOLEAN OpenAsSelf
Definition: zwfuncs.h:700
#define NtCurrentThread()