ReactOS  0.4.15-dev-1384-g878186b
NtQueryInformationThread.c File Reference
#include "precomp.h"
Include dependency graph for NtQueryInformationThread.c:

Go to the source code of this file.

Functions

static void Test_ThreadBasicInformationClass (void)
 
 START_TEST (NtQueryInformationThread)
 

Function Documentation

◆ START_TEST()

START_TEST ( NtQueryInformationThread  )

Definition at line 103 of file NtQueryInformationThread.c.

104 {
106 }
static void Test_ThreadBasicInformationClass(void)

◆ Test_ThreadBasicInformationClass()

static void Test_ThreadBasicInformationClass ( void  )
static

Definition at line 12 of file NtQueryInformationThread.c.

13 {
15  PTHREAD_BASIC_INFORMATION ThreadInfoBasic;
17 
19  if (!ThreadInfoBasic)
20  {
21  skip("Failed to allocate memory for THREAD_BASIC_INFORMATION!\n");
22  return;
23  }
24 
25  /* Everything is NULL */
28  NULL,
29  0,
30  NULL);
32 
33  /* Don't give a valid thread handle */
36  ThreadInfoBasic,
38  NULL);
40 
41  /* The information length is incorrect */
44  ThreadInfoBasic,
45  0,
46  NULL);
48 
49  /* Don't query anything from the function */
52  NULL,
54  NULL);
56 
57  /* The buffer is misaligned and length information is wrong */
60  (PVOID)1,
61  0,
62  NULL);
64 
65  /* The buffer is misaligned */
68  (PVOID)1,
70  NULL);
72 
73  /* The buffer is misaligned, try with an alignment size of 2 */
76  (PVOID)2,
78  NULL);
80 
81  /* Query the basic information we need from the thread */
84  ThreadInfoBasic,
88  ok(ReturnedLength != 0, "The size of the buffer pointed by ThreadInformation shouldn't be 0!\n");
89 
90  /* Output the thread basic information details */
91  trace("ReturnedLength = %lu\n", ReturnedLength);
92  trace("ThreadInfoBasic->ExitStatus = 0x%08lx\n", ThreadInfoBasic->ExitStatus);
93  trace("ThreadInfoBasic->TebBaseAddress = %p\n", ThreadInfoBasic->TebBaseAddress);
94  trace("ThreadInfoBasic->ClientId.UniqueProcess = %p\n", ThreadInfoBasic->ClientId.UniqueProcess);
95  trace("ThreadInfoBasic->ClientId.UniqueThread = %p\n", ThreadInfoBasic->ClientId.UniqueThread);
96  trace("ThreadInfoBasic->AffinityMask = %lu\n", ThreadInfoBasic->AffinityMask);
97  trace("ThreadInfoBasic->Priority = %li\n", ThreadInfoBasic->Priority);
98  trace("ThreadInfoBasic->BasePriority = %li\n", ThreadInfoBasic->BasePriority);
99 
100  HeapFree(GetProcessHeap(), 0, ThreadInfoBasic);
101 }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
KAFFINITY AffinityMask
Definition: compat.h:789
LONG NTSTATUS
Definition: precomp.h:26
HANDLE UniqueProcess
Definition: compat.h:684
#define ok_hex(expression, result)
Definition: atltest.h:94
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:245
KPRIORITY BasePriority
Definition: compat.h:791
HANDLE WINAPI GetCurrentThread(VOID)
Definition: proc.c:1148
Status
Definition: gdiplustypes.h:24
#define GetProcessHeap()
Definition: compat.h:595
#define trace
Definition: atltest.h:70
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
NTSTATUS NTAPI NtQueryInformationThread(IN HANDLE ThreadHandle, IN THREADINFOCLASS ThreadInformationClass, OUT PVOID ThreadInformation, IN ULONG ThreadInformationLength, OUT PULONG ReturnLength OPTIONAL)
Definition: query.c:2501
HANDLE UniqueThread
Definition: compat.h:685
_In_ ULONG _In_ BATTERY_QUERY_INFORMATION_LEVEL _In_ LONG _In_ ULONG _Out_ PULONG ReturnedLength
Definition: batclass.h:187
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define skip(...)
Definition: atltest.h:64
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:183
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_SUCCESS
Definition: shellext.h:65
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by START_TEST().