ReactOS  0.4.14-dev-77-gd9e7c48
GetUserObjectInformation.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS API tests
3  * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
4  * PURPOSE: Test for GetUserObjectInformation
5  * PROGRAMMERS: Thomas Faber <thomas.faber@reactos.org>
6  */
7 
8 #include "precomp.h"
9 
10 #include <ndk/mmfuncs.h>
11 #include <ndk/pstypes.h>
12 #include <strsafe.h>
13 
14 static
15 BOOLEAN
17  PVOID Buffer,
18  SIZE_T Size,
19  UCHAR Value)
20 {
21  PUCHAR Array = Buffer;
22  SIZE_T i;
23 
24  for (i = 0; i < Size; i++)
25  if (Array[i] != Value)
26  {
27  trace("Expected %x, found %x at offset %lu\n", Value, Array[i], (ULONG)i);
28  return FALSE;
29  }
30  return TRUE;
31 }
32 
33 static
34 PVOID
36  SIZE_T SizeRequested)
37 {
39  SIZE_T Size = PAGE_ROUND_UP(SizeRequested + PAGE_SIZE);
40  PVOID VirtualMemory = NULL;
41  PCHAR StartOfBuffer;
42 
44 
45  if (!NT_SUCCESS(Status))
46  return NULL;
47 
48  Size -= PAGE_SIZE;
49  if (Size)
50  {
52  if (!NT_SUCCESS(Status))
53  {
54  Size = 0;
56  ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status);
57  return NULL;
58  }
59  }
60 
61  StartOfBuffer = VirtualMemory;
62  StartOfBuffer += Size - SizeRequested;
63 
64  return StartOfBuffer;
65 }
66 
67 static
68 VOID
70  PVOID Pointer)
71 {
73  PVOID VirtualMemory = (PVOID)PAGE_ROUND_DOWN((SIZE_T)Pointer);
74  SIZE_T Size = 0;
75 
77  ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status);
78 }
79 
80 #define xok ok // Make the test succeed on Win2003
81 //#define xok(...) // This should make the test succeed on all Windows versions
82 #define NOTSET 1234
83 
84 #define TestUserObjectInfo(Handle, Index, Buffer, Length, Ret, Error, LengthNeeded) do \
85  { \
86  DWORD _LengthNeeded = NOTSET; \
87  DECLSPEC_ALIGN(16) CHAR _LengthBuffer[2 * sizeof(DWORD)]; \
88  DWORD _Error; \
89  BOOL _Ret; \
90  \
91  SetLastError(0xdeadbeef); \
92  _Ret = GetUserObjectInformationW(Handle, Index, Buffer, Length, NULL); \
93  _Error = GetLastError(); \
94  ok(_Ret == (Ret), "Ret = %d\n", _Ret); \
95  xok(_Error == (Error), "Error = %lu\n", _Error); \
96  \
97  SetLastError(0xdeadbeef); \
98  _Ret = GetUserObjectInformationW(Handle, Index, Buffer, Length, &_LengthNeeded);\
99  _Error = GetLastError(); \
100  ok(_Ret == (Ret), "Ret = %d\n", _Ret); \
101  xok(_Error == (Error), "Error = %lu\n", _Error); \
102  xok(_LengthNeeded == (LengthNeeded), "LengthNeeded = %lu\n", _LengthNeeded); \
103  \
104  SetLastError(0xdeadbeef); \
105  *(PDWORD)&_LengthBuffer[1] = NOTSET; \
106  _Ret = GetUserObjectInformationW(Handle, Index, Buffer, Length, \
107  (PDWORD)&_LengthBuffer[1]); \
108  _Error = GetLastError(); \
109  ok(_Ret == (Ret), "Ret = %d\n", _Ret); \
110  xok(_Error == (Error), "Error = %lu\n", _Error); \
111  _LengthNeeded = *(PDWORD)&_LengthBuffer[1]; \
112  xok(_LengthNeeded == (LengthNeeded), "LengthNeeded = %lu\n", _LengthNeeded); \
113  \
114  SetLastError(0xdeadbeef); \
115  _Ret = GetUserObjectInformationW(Handle, Index, Buffer, Length, (PVOID)-4); \
116  _Error = GetLastError(); \
117  ok(_Ret == FALSE, "Ret = %d\n", _Ret); \
118  ok(_Error == ERROR_NOACCESS, "Error = %lu\n", _Error); \
119  } while (0)
120 
121 #define TestUserObjectInfoWithString(Handle, Index, Buffer, BufferSize, String) do \
122  { \
123  BOOLEAN _Check; \
124  SIZE_T SizeOfString = wcslen(String) * sizeof(WCHAR) + sizeof(UNICODE_NULL); \
125  TestUserObjectInfo(Handle, Index, NULL, 0, FALSE, ERROR_INSUFFICIENT_BUFFER, SizeOfString); \
126  TestUserObjectInfo(Handle, Index, UlongToPtr(1), 0, FALSE, ERROR_INSUFFICIENT_BUFFER, SizeOfString); \
127  TestUserObjectInfo(Handle, Index, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET); \
128  TestUserObjectInfo(Handle, Index, UlongToPtr(1), 1, FALSE, ERROR_NOACCESS, NOTSET); \
129  RtlFillMemory(Buffer, BufferSize, 0x55); \
130  TestUserObjectInfo(Handle, Index, Buffer, SizeOfString - 2, FALSE, ERROR_INSUFFICIENT_BUFFER, SizeOfString); \
131  _Check = CheckBuffer(Buffer, BufferSize, 0x55); \
132  ok(_Check == TRUE, "CheckBuffer failed\n"); \
133  RtlFillMemory(Buffer, BufferSize, 0x55); \
134  TestUserObjectInfo(Handle, Index, Buffer, SizeOfString - 1, FALSE, ERROR_INSUFFICIENT_BUFFER, SizeOfString); \
135  _Check = CheckBuffer(Buffer, BufferSize, 0x55); \
136  ok(_Check == TRUE, "CheckBuffer failed\n"); \
137  RtlFillMemory(Buffer, BufferSize, 0x55); \
138  Buffer[BufferSize / sizeof(WCHAR) - 1] = UNICODE_NULL; \
139  TestUserObjectInfo(Handle, Index, Buffer, SizeOfString, TRUE, 0xdeadbeef, SizeOfString); \
140  ok(wcscmp(Buffer, String) == 0, "Buffer '%ls', expected '%ls'\n", Buffer, String); \
141  _Check = CheckBuffer(Buffer + SizeOfString / sizeof(Buffer[0]), BufferSize - SizeOfString - sizeof(WCHAR), 0x55); \
142  ok(_Check == TRUE, "CheckBuffer failed\n"); \
143  RtlFillMemory(Buffer, BufferSize, 0x55); \
144  Buffer[BufferSize / sizeof(WCHAR) - 1] = UNICODE_NULL; \
145  TestUserObjectInfo(Handle, Index, Buffer, BufferSize, TRUE, 0xdeadbeef, SizeOfString); \
146  ok(wcscmp(Buffer, String) == 0, "Buffer '%ls', expected '%ls'\n", Buffer, String); \
147  _Check = CheckBuffer(Buffer + SizeOfString / sizeof(Buffer[0]), BufferSize - SizeOfString - sizeof(WCHAR), 0x55); \
148  ok(_Check == TRUE, "CheckBuffer failed\n"); \
149  } while (0)
150 
151 static
152 void
154 {
155  USEROBJECTFLAGS UserObjectFlags;
156  PWCHAR Buffer;
157  ULONG BufferSize = 64 * sizeof(WCHAR);
158  HDESK Desktop;
159  HDESK Desktop2;
160  HWINSTA WinSta;
161  HANDLE Token;
162  TOKEN_STATISTICS Statistics;
163  WCHAR WinStaName[64];
164  BOOL Success;
165  ULONG Length;
166 
168 
174  TestUserObjectInfo(NULL, UOI_FLAGS, &UserObjectFlags, sizeof(UserObjectFlags), FALSE, ERROR_INVALID_HANDLE, 0);
175 
181 
187 
189  if (!Desktop)
190  {
191  skip("Failed to get desktop handle\n");
193  return;
194  }
195 
196  WinSta = GetProcessWindowStation();
197  if (!WinSta)
198  {
199  skip("Failed to get winsta handle\n");
201  return;
202  }
203 
209  TestUserObjectInfo(Desktop, UOI_FLAGS, &UserObjectFlags, sizeof(UserObjectFlags), TRUE, 0xdeadbeef, sizeof(USEROBJECTFLAGS));
210 
213 
214  TestUserObjectInfoWithString(WinSta, UOI_TYPE, Buffer, BufferSize, L"WindowStation");
216 
217  /* Autogenerated name will be Service-0x<luidhigh>-<luidlow>$ */
218  StringCbCopyW(WinStaName, sizeof(WinStaName), L"<failed>");
220  ok(Success == TRUE, "OpenProcessToken failed with %lu\n", GetLastError());
221  if (Success)
222  {
225  &Statistics,
226  sizeof(Statistics),
227  &Length);
228  ok(Success == TRUE, "GetTokenInformation failed with %lu\n", GetLastError());
229  if (Success)
230  {
231  StringCbPrintfW(WinStaName,
232  sizeof(WinStaName),
233  L"Service-0x%lx-%lx$",
234  Statistics.AuthenticationId.HighPart,
235  Statistics.AuthenticationId.LowPart);
236  trace("Expected autogenerated Winsta name: %ls\n", WinStaName);
237  }
239  }
240 
241  /* Create our own Winsta */
243  ok(WinSta != NULL, "CreateWindowStationW failed with %lu\n", GetLastError());
244  if (WinSta)
245  {
246  TestUserObjectInfoWithString(WinSta, UOI_TYPE, Buffer, BufferSize, L"WindowStation");
248  CloseWindowStation(WinSta);
249  }
250  else
251  {
252  skip("Failed to create winsta\n");
253  }
254 
256  ok(WinSta != NULL, "CreateWindowStationW failed with %lu\n", GetLastError());
257  if (WinSta)
258  {
259  TestUserObjectInfoWithString(WinSta, UOI_TYPE, Buffer, BufferSize, L"WindowStation");
261  CloseWindowStation(WinSta);
262  }
263  else
264  {
265  skip("Failed to create winsta\n");
266  }
267 
268  WinSta = CreateWindowStationW(L"GetUserObjectInformation_apitest_winsta", 0, WINSTA_READATTRIBUTES, NULL);
269  ok(WinSta != NULL, "CreateWindowStationW failed with %lu\n", GetLastError());
270  if (WinSta)
271  {
272  TestUserObjectInfoWithString(WinSta, UOI_TYPE, Buffer, BufferSize, L"WindowStation");
273  TestUserObjectInfoWithString(WinSta, UOI_NAME, Buffer, BufferSize, L"GetUserObjectInformation_apitest_winsta");
274  CloseWindowStation(WinSta);
275  }
276  else
277  {
278  skip("Failed to create winsta\n");
279  }
280 
282  ok(WinSta != NULL, "CreateWindowStationW failed with %lu\n", GetLastError());
283  if (WinSta)
284  {
285  TestUserObjectInfoWithString(WinSta, UOI_TYPE, Buffer, BufferSize, L"WindowStation");
287  CloseWindowStation(WinSta);
288  }
289  else
290  {
291  skip("Failed to create winsta\n");
292  }
293 
294  /* Create our own desktop */
296  ok(Desktop2 == NULL, "CreateDesktopW succeeded\n");
297  if (Desktop2) CloseDesktop(Desktop2);
298 
300  ok(Desktop2 == NULL, "CreateDesktopW succeeded\n");
301  if (Desktop2) CloseDesktop(Desktop2);
302 
304  ok(Desktop2 != NULL, "CreateDesktopW failed with %lu\n", GetLastError());
305  if (Desktop2)
306  {
309  }
310  else
311  {
312  skip("Failed to create winsta\n");
313  }
314 
315  CloseDesktop(Desktop2);
316 
318 
319  /* Make sure nothing behind the needed buffer is touched */
320  BufferSize = sizeof(L"Desktop");
322  TestUserObjectInfo(Desktop, UOI_TYPE, Buffer, BufferSize, TRUE, 0xdeadbeef, sizeof(L"Desktop"));
325 }
326 
327 #undef TestUserObjectInfo
328 #define TestUserObjectInfo(Handle, Index, Buffer, Length, Ret, Error, LengthNeeded) do \
329  { \
330  DWORD _LengthNeeded = NOTSET; \
331  DECLSPEC_ALIGN(16) CHAR _LengthBuffer[2 * sizeof(DWORD)]; \
332  DWORD _Error; \
333  BOOL _Ret; \
334  \
335  SetLastError(0xdeadbeef); \
336  _Ret = GetUserObjectInformationA(Handle, Index, Buffer, Length, NULL); \
337  _Error = GetLastError(); \
338  ok(_Ret == (Ret), "Ret = %d\n", _Ret); \
339  xok(_Error == (Error), "Error = %lu\n", _Error); \
340  \
341  SetLastError(0xdeadbeef); \
342  _Ret = GetUserObjectInformationA(Handle, Index, Buffer, Length, &_LengthNeeded);\
343  _Error = GetLastError(); \
344  ok(_Ret == (Ret), "Ret = %d\n", _Ret); \
345  xok(_Error == (Error), "Error = %lu\n", _Error); \
346  xok(_LengthNeeded == (LengthNeeded), "LengthNeeded = %lu\n", _LengthNeeded); \
347  \
348  SetLastError(0xdeadbeef); \
349  *(PDWORD)&_LengthBuffer[1] = NOTSET; \
350  _Ret = GetUserObjectInformationA(Handle, Index, Buffer, Length, \
351  (PDWORD)&_LengthBuffer[1]); \
352  _Error = GetLastError(); \
353  ok(_Ret == (Ret), "Ret = %d\n", _Ret); \
354  xok(_Error == (Error), "Error = %lu\n", _Error); \
355  _LengthNeeded = *(PDWORD)&_LengthBuffer[1]; \
356  xok(_LengthNeeded == (LengthNeeded), "LengthNeeded = %lu\n", _LengthNeeded); \
357  \
358  SetLastError(0xdeadbeef); \
359  _Ret = GetUserObjectInformationA(Handle, Index, Buffer, Length, (PVOID)-4); \
360  _Error = GetLastError(); \
361  ok(_Ret == FALSE, "Ret = %d\n", _Ret); \
362  ok(_Error == ERROR_NOACCESS, "Error = %lu\n", _Error); \
363  } while (0)
364 
365 #undef TestUserObjectInfoWithString
366 #define TestUserObjectInfoWithString(Handle, Index, Buffer, BufferSize, String) do \
367  { \
368  BOOLEAN _Check; \
369  TestUserObjectInfo(Handle, Index, NULL, 0, FALSE, ERROR_INSUFFICIENT_BUFFER, sizeof(String) * sizeof(WCHAR));\
370  TestUserObjectInfo(Handle, Index, (PVOID)1, 0, FALSE, ERROR_INSUFFICIENT_BUFFER, sizeof(String) * sizeof(WCHAR));\
371  TestUserObjectInfo(Handle, Index, NULL, 1, FALSE, ERROR_INSUFFICIENT_BUFFER, sizeof(String) * sizeof(WCHAR));\
372  TestUserObjectInfo(Handle, Index, (PVOID)1, 1, FALSE, ERROR_INSUFFICIENT_BUFFER, sizeof(String) * sizeof(WCHAR));\
373  RtlFillMemory(Buffer, BufferSize, 0x55); \
374  TestUserObjectInfo(Handle, Index, Buffer, sizeof(String) - 2, FALSE, ERROR_INSUFFICIENT_BUFFER, sizeof(String) * sizeof(WCHAR));\
375  _Check = CheckBuffer(Buffer, BufferSize, 0x55); \
376  ok(_Check == TRUE, "CheckBuffer failed\n"); \
377  RtlFillMemory(Buffer, BufferSize, 0x55); \
378  TestUserObjectInfo(Handle, Index, Buffer, sizeof(String) - 1, FALSE, ERROR_INSUFFICIENT_BUFFER, sizeof(String) * sizeof(WCHAR));\
379  _Check = CheckBuffer(Buffer, BufferSize, 0x55); \
380  ok(_Check == TRUE, "CheckBuffer failed\n"); \
381  RtlFillMemory(Buffer, BufferSize, 0x55); \
382  TestUserObjectInfo(Handle, Index, Buffer, sizeof(String), TRUE, 0xdeadbeef, sizeof(String)); \
383  ok(strcmp(Buffer, String) == 0, "Buffer '%s'\n", Buffer); \
384  _Check = CheckBuffer(Buffer + sizeof(String), BufferSize - sizeof(String), 0x55); \
385  ok(_Check == TRUE, "CheckBuffer failed\n"); \
386  RtlFillMemory(Buffer, BufferSize, 0x55); \
387  TestUserObjectInfo(Handle, Index, Buffer, BufferSize, TRUE, 0xdeadbeef, sizeof(String)); \
388  ok(strcmp(Buffer, String) == 0, "Buffer '%s'\n", Buffer); \
389  _Check = CheckBuffer(Buffer + sizeof(String), BufferSize - sizeof(String), 0x55); \
390  ok(_Check == TRUE, "CheckBuffer failed\n"); \
391  } while (0)
392 
393 static
394 void
396 {
397  USEROBJECTFLAGS UserObjectFlags;
398  PCHAR Buffer;
399  ULONG BufferSize = 64;
400  HDESK Desktop;
401  HWINSTA WinSta;
402 
404 
410  TestUserObjectInfo(NULL, UOI_FLAGS, &UserObjectFlags, sizeof(UserObjectFlags), FALSE, ERROR_INVALID_HANDLE, 0);
411 
417 
423 
425  if (!Desktop)
426  {
427  skip("Failed to get desktop handle\n");
429  return;
430  }
431 
432  WinSta = GetProcessWindowStation();
433  if (!WinSta)
434  {
435  skip("Failed to get winsta handle\n");
437  return;
438  }
439 
445  TestUserObjectInfo(Desktop, UOI_FLAGS, &UserObjectFlags, sizeof(UserObjectFlags), TRUE, 0xdeadbeef, sizeof(USEROBJECTFLAGS));
446 
449 
450  TestUserObjectInfoWithString(WinSta, UOI_TYPE, Buffer, BufferSize, "WindowStation");
452 
454 
455  /* Make sure nothing behind the needed buffer is touched */
456  BufferSize = sizeof("Desktop");
458  TestUserObjectInfo(Desktop, UOI_TYPE, Buffer, BufferSize, TRUE, 0xdeadbeef, sizeof("Desktop"));
459  TestUserObjectInfo(Desktop, UOI_TYPE, Buffer, BufferSize + 1, TRUE, 0xdeadbeef, sizeof("Desktop"));
461 }
462 
464 {
467 }
#define NOTSET
LUID AuthenticationId
Definition: setypes.h:1033
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
signed char * PCHAR
Definition: retypes.h:7
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TestUserObjectInfoWithString(Handle, Index, Buffer, BufferSize, String)
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
static PVOID AllocateGuarded(SIZE_T SizeRequested)
unsigned char * PUCHAR
Definition: retypes.h:3
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
LONG NTSTATUS
Definition: precomp.h:26
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID _Out_ PHANDLE Token
HDESK WINAPI GetThreadDesktop(_In_ DWORD)
#define PAGE_ROUND_DOWN(x)
Definition: mmtypes.h:36
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
uint16_t * PWCHAR
Definition: typedefs.h:54
#define TestUserObjectInfo(Handle, Index, Buffer, Length, Ret, Error, LengthNeeded)
#define MEM_COMMIT
Definition: nt_native.h:1313
#define PAGE_ROUND_UP(x)
Definition: scsiport_int.h:13
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 ERROR_NOACCESS
Definition: winerror.h:578
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOLEAN CheckBuffer(PVOID Buffer, SIZE_T Size, UCHAR Value)
#define MEM_RESERVE
Definition: nt_native.h:1314
#define DESKTOP_READOBJECTS
Definition: winuser.h:222
#define PAGE_NOACCESS
Definition: nt_native.h:1302
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
static CHAR Desktop[MAX_PATH]
Definition: dem.c:256
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define UlongToPtr(u)
Definition: config.h:106
#define NtCurrentProcess()
Definition: nt_native.h:1657
#define trace
Definition: atltest.h:70
#define TOKEN_QUERY
Definition: setypes.h:874
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static void TestGetUserObjectInfoA(void)
DWORD LowPart
#define UOI_NAME
Definition: winuser.h:1074
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
static VOID FreeGuarded(PVOID Pointer)
#define WINSTA_READATTRIBUTES
Definition: winuser.h:414
#define BufferSize
Definition: classpnp.h:419
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
unsigned char UCHAR
Definition: xmlstorage.h:181
static const WCHAR L[]
Definition: oid.c:1250
LONG HighPart
START_TEST(GetUserObjectInformation)
#define PAGE_SIZE
Definition: env_spec_w32.h:49
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define GetUserObjectInformation
Definition: winuser.h:5696
NTSTATUS NTAPI NtAllocateVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *UBaseAddress, IN ULONG_PTR ZeroBits, IN OUT PSIZE_T URegionSize, IN ULONG AllocationType, IN ULONG Protect)
Definition: virtual.c:4367
#define DESKTOP_CREATEWINDOW
Definition: winuser.h:217
static void TestGetUserObjectInfoW(void)
#define UOI_TYPE
Definition: winuser.h:1075
#define ok(value,...)
Definition: atltest.h:57
#define UOI_FLAGS
Definition: winuser.h:1073
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
HWINSTA WINAPI GetProcessWindowStation(void)
Definition: ntwrapper.h:124
#define skip(...)
Definition: atltest.h:64
#define MEM_RELEASE
Definition: nt_native.h:1316
HWINSTA WINAPI CreateWindowStationW(_In_opt_ LPCWSTR lpwinsta, _In_ DWORD dwFlags, _In_ ACCESS_MASK dwDesiredAccess, _In_opt_ LPSECURITY_ATTRIBUTES lpsa)
BOOL WINAPI CloseDesktop(_In_ HDESK)
unsigned int ULONG
Definition: retypes.h:1
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
HDESK WINAPI CreateDesktopW(LPCWSTR lpszDesktop, LPCWSTR lpszDevice, LPDEVMODEW pDevmode, DWORD dwFlags, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa)
Definition: desktop.c:473
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
return STATUS_SUCCESS
Definition: btrfs.c:2966
BOOL WINAPI CloseWindowStation(_In_ HWINSTA)
#define PAGE_READWRITE
Definition: nt_native.h:1304
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
NTSTATUS NTAPI NtFreeVirtualMemory(IN HANDLE ProcessHandle, IN PVOID *UBaseAddress, IN PSIZE_T URegionSize, IN ULONG FreeType)
Definition: virtual.c:5090