ReactOS  0.4.12-dev-708-g95ed44e
ObType.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS kernel-mode tests
3  * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory
4  * PURPOSE: Kernel-Mode Test Suite Ob Regressions KM-Test
5  * PROGRAMMER: Aleksey Bragin <aleksey@reactos.org>
6  * Thomas Faber <thomas.faber@reactos.org>
7  */
8 
9 /* TODO: split this into multiple tests! ObLife, ObHandle, ObName, ... */
10 
11 #include <kmt_test.h>
12 
13 #define NDEBUG
14 #include <debug.h>
15 
16 #define CheckObject(Handle, Pointers, Handles) do \
17 { \
18  PUBLIC_OBJECT_BASIC_INFORMATION ObjectInfo; \
19  Status = ZwQueryObject(Handle, ObjectBasicInformation, \
20  &ObjectInfo, sizeof ObjectInfo, NULL); \
21  ok_eq_hex(Status, STATUS_SUCCESS); \
22  ok_eq_ulong(ObjectInfo.PointerCount, Pointers); \
23  ok_eq_ulong(ObjectInfo.HandleCount, Handles); \
24 } while (0)
25 
26 #define NUM_OBTYPES 5
27 
28 typedef struct _MY_OBJECT1
29 {
32 
33 typedef struct _MY_OBJECT2
34 {
38 
49 
50 typedef struct _COUNTS
51 {
59 } COUNTS, *PCOUNTS;
60 static COUNTS Counts;
61 
62 static
63 VOID
64 NTAPI
66  IN PVOID Object,
67  IN POB_DUMP_CONTROL DumpControl)
68 {
69  DPRINT("DumpProc() called\n");
70  ++Counts.Dump;
71 }
72 
73 static
75 NTAPI
77  IN OB_OPEN_REASON OpenReason,
79  IN PVOID Object,
81  IN ULONG HandleCount)
82 {
83  DPRINT("OpenProc() 0x%p, OpenReason %d, HandleCount %lu, AccessMask 0x%lX\n",
84  Object, OpenReason, HandleCount, GrantedAccess);
85  ++Counts.Open;
86  return STATUS_SUCCESS;
87 }
88 
89 static
90 VOID
91 NTAPI
94  IN PVOID Object,
97  IN ULONG SystemHandleCount)
98 {
99  DPRINT("CloseProc() 0x%p, ProcessHandleCount %lu, SystemHandleCount %lu, AccessMask 0x%lX\n",
100  Object, ProcessHandleCount, SystemHandleCount, GrantedAccess);
101  ++Counts.Close;
102 }
103 
104 static
105 VOID
106 NTAPI
108  IN PVOID Object)
109 {
110  DPRINT("DeleteProc() 0x%p\n", Object);
111  ++Counts.Delete;
112 }
113 
114 static
115 NTSTATUS
116 NTAPI
118  IN PVOID ParseObject,
123  IN OUT PUNICODE_STRING CompleteName,
127  OUT PVOID *Object)
128 {
129  DPRINT("ParseProc() called\n");
130  *Object = NULL;
131 
132  ++Counts.Parse;
133  return STATUS_OBJECT_NAME_NOT_FOUND;//STATUS_SUCCESS;
134 }
135 
136 static
137 BOOLEAN
138 NTAPI
141  IN PVOID Object,
142  IN HANDLE Handle,
144 {
145  DPRINT("OkayToCloseProc() 0x%p, Handle 0x%p, AccessMask 0x%lX\n",
148  return TRUE;
149 }
150 
151 static
152 NTSTATUS
153 NTAPI
155  IN PVOID Object,
156  IN BOOLEAN HasObjectName,
157  OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
158  IN ULONG Length,
161 {
162  DPRINT("QueryNameProc() 0x%p, HasObjectName %d, Len %lu, AccessMask 0x%lX\n",
163  Object, HasObjectName, Length, AccessMode);
164  ++Counts.QueryName;
165 
166  ObjectNameInfo = NULL;
167  ReturnLength = 0;
169 }
170 
171 static
172 VOID
174 {
175  INT i;
177  struct
178  {
179  WCHAR DirectoryName[sizeof "\\ObjectTypes\\" - 1];
180  WCHAR TypeName[15];
181  } Name;
183  HANDLE ObjectTypeHandle;
184  UNICODE_STRING ObjectPath;
185 
186  RtlCopyMemory(&Name.DirectoryName, L"\\ObjectTypes\\", sizeof Name.DirectoryName);
187 
188  for (i = 0; i < NUM_OBTYPES; ++i)
189  {
190  Status = RtlStringCbPrintfW(Name.TypeName, sizeof Name.TypeName, L"MyObjectType%x", i);
192  RtlInitUnicodeString(&ObTypeName[i], Name.TypeName);
193  DPRINT("Creating object type %wZ\n", &ObTypeName[i]);
194 
200 
201  // Test for invalid parameter
202  // FIXME: Make it more exact, to see which params Win2k3 checks
203  // existence of
206 
214  //ObTypeInitializer[i].SecurityProcedure = SecurityProc;
215 
218  {
219  /* as we cannot delete the object types, get a pointer if they
220  * already exist */
221  RtlInitUnicodeString(&ObjectPath, Name.DirectoryName);
223  Status = ObOpenObjectByName(&ObjectAttributes, NULL, KernelMode, NULL, 0, NULL, &ObjectTypeHandle);
225  ok(ObjectTypeHandle != NULL, "ObjectTypeHandle = NULL\n");
226  if (!skip(Status == STATUS_SUCCESS && ObjectTypeHandle, "No handle\n"))
227  {
228  Status = ObReferenceObjectByHandle(ObjectTypeHandle, 0, NULL, KernelMode, (PVOID)&ObTypes[i], NULL);
230  if (!skip(Status == STATUS_SUCCESS && ObTypes[i], "blah\n"))
231  {
239  }
240  Status = ZwClose(ObjectTypeHandle);
241  }
242  }
243 
245  ok(ObTypes[i] != NULL, "ObType = NULL\n");
246  }
247 }
248 
249 static
250 VOID
252 {
254 
255  RtlInitUnicodeString(&ObDirectoryName, L"\\ObtDirectory");
259  CheckObject(DirectoryHandle, 3LU, 1LU);
260 }
261 
262 #define CheckCounts(OpenCount, CloseCount, DeleteCount, ParseCount, \
263  OkayToCloseCount, QueryNameCount) do \
264 { \
265  ok_eq_uint(Counts.Open, OpenCount); \
266  ok_eq_uint(Counts.Close, CloseCount); \
267  ok_eq_uint(Counts.Delete, DeleteCount); \
268  ok_eq_uint(Counts.Parse, ParseCount); \
269  ok_eq_uint(Counts.OkayToClose, OkayToCloseCount); \
270  ok_eq_uint(Counts.QueryName, QueryNameCount); \
271 } while (0)
272 
273 #define SaveCounts(Save) memcpy(&Save, &Counts, sizeof Counts)
274 
275 /* TODO: make this the same as NUM_OBTYPES */
276 #define NUM_OBTYPES2 2
277 static
278 VOID
280 {
284  INT i;
286  ULONG ObjectSize[NUM_OBTYPES2] = { sizeof(MY_OBJECT1), sizeof(MY_OBJECT2) };
287 
288  // Create two objects
289  for (i = 0; i < NUM_OBTYPES2; ++i)
290  {
291  ASSERT(sizeof Name[i] == MAX_PATH * sizeof(WCHAR));
292  Status = RtlStringCbPrintfW(Name[i], sizeof Name[i], L"\\ObtDirectory\\MyObject%d", i + 1);
296  }
297  CheckObject(DirectoryHandle, 3LU, 1LU);
298 
299  for (i = 0; i < NUM_OBTYPES2; ++i)
300  {
301  Status = ObCreateObject(KernelMode, ObTypes[i], &ObAttributes[i], KernelMode, NULL, ObjectSize[i], 0L, 0L, &ObBody[i]);
303  }
304 
306 
307  // Insert them
308  for (i = 0; i < NUM_OBTYPES2; ++i)
309  {
310  CheckObject(DirectoryHandle, 3LU + i, 1LU);
311  Status = ObInsertObject(ObBody[i], NULL, Access[i], 0, &ObBody[i], &ObHandle1[i]);
313  ok(ObBody[i] != NULL, "Object body = NULL\n");
314  ok(ObHandle1[i] != NULL, "Handle = NULL\n");
315  CheckObject(ObHandle1[i], 3LU, 1LU);
316  CheckCounts(SaveCounts.Open + 1, SaveCounts.Close, SaveCounts.Delete, SaveCounts.Parse, SaveCounts.OkayToClose, SaveCounts.QueryName);
318  CheckObject(DirectoryHandle, 4LU + i, 1LU);
319  }
320 
321  //DPRINT1("%d %d %d %d %d %d %d\n", DumpCount, OpenCount, CloseCount, DeleteCount, ParseCount, OkayToCloseCount, QueryNameCount);
322  CheckCounts(SaveCounts.Open, SaveCounts.Close, SaveCounts.Delete, SaveCounts.Parse, SaveCounts.OkayToClose, SaveCounts.QueryName);
323 }
324 
325 static
326 VOID
328  BOOLEAN Clean,
329  BOOLEAN AlternativeMethod)
330 {
332  LONG_PTR Ret;
333  PVOID TypeObject;
334  INT i;
335  UNICODE_STRING ObPathName[NUM_OBTYPES];
337 
338  // Close what we have opened and free what we allocated
339  for (i = 0; i < NUM_OBTYPES2; ++i)
340  {
341  if (!skip(ObBody[i] != NULL, "Nothing to dereference\n"))
342  {
343  if (ObHandle1[i]) CheckObject(ObHandle1[i], 3LU, 1LU);
344  Ret = ObReferenceObject(ObBody[i]);
345  if (ObHandle1[i]) CheckObject(ObHandle1[i], 4LU, 1LU);
346  Ret = ObDereferenceObject(ObBody[i]);
347  ok_eq_longptr(Ret, (LONG_PTR)2);
348  if (ObHandle1[i]) CheckObject(ObHandle1[i], 3LU, 1LU);
349  ObBody[i] = NULL;
350  }
351  if (!skip(ObHandle1[i] != NULL, "Nothing to close\n"))
352  {
355  ObHandle1[i] = NULL;
356  }
357  }
358 
359  if (skip(Clean, "Not cleaning up, as requested. Use ObTypeClean to clean up\n"))
360  return;
361 
362  // Now we have to get rid of a directory object
363  // Since it is permanent, we have to firstly make it temporary
364  // and only then kill
365  // (this procedure is described in DDK)
366  if (!skip(DirectoryHandle != NULL, "No directory handle\n"))
367  {
368  CheckObject(DirectoryHandle, 3LU, 1LU);
369 
372  CheckObject(DirectoryHandle, 3LU, 1LU);
373 
376  }
377 
378  /* we don't delete the object types we created. It makes Windows unstable.
379  * TODO: perhaps make it work in ROS anyway */
380  return;
381  if (!AlternativeMethod)
382  {
383  for (i = 0; i < NUM_OBTYPES; ++i)
384  if (!skip(ObTypes[i] != NULL, "No object type to delete\n"))
385  {
386  Ret = ObDereferenceObject(ObTypes[i]);
387  ok_eq_longptr(Ret, (LONG_PTR)0);
388  ObTypes[i] = NULL;
389  }
390  }
391  else
392  {
393  for (i = 0; i < NUM_OBTYPES; ++i)
394  {
395  if (!skip(ObTypes[i] != NULL, "No object type to delete\n"))
396  {
397  Status = RtlStringCbPrintfW(Name, sizeof Name, L"\\ObjectTypes\\MyObjectType%d", i);
398  RtlInitUnicodeString(&ObPathName[i], Name);
399  Status = ObReferenceObjectByName(&ObPathName[i], OBJ_CASE_INSENSITIVE, NULL, 0L, NULL, KernelMode, NULL, &TypeObject);
400 
401  Ret = ObDereferenceObject(TypeObject);
402  ok_eq_longptr(Ret, (LONG_PTR)2);
403  Ret = ObDereferenceObject(TypeObject);
404  ok_eq_longptr(Ret, (LONG_PTR)1);
405  DPRINT("Reference Name %wZ = %p, ObTypes[%d] = %p\n",
406  ObPathName[i], TypeObject, i, ObTypes[i]);
407  ObTypes[i] = NULL;
408  }
409  }
410  }
411 }
412 
413 static
414 VOID
416  IN BOOLEAN Clean)
417 {
418  RtlZeroMemory(&Counts, sizeof Counts);
419 
421  DPRINT("ObtCreateObjectTypes() done\n");
422 
424  DPRINT("ObtCreateDirectory() done\n");
425 
426  if (!skip(ObTypes[0] != NULL, "No object types!\n"))
428  DPRINT("ObtCreateObjects() done\n");
429 
430  ObtClose(Clean, FALSE);
431 }
432 
433 START_TEST(ObType)
434 {
436 }
437 
438 /* run this to see the objects created in user mode */
439 START_TEST(ObTypeNoClean)
440 {
442 }
443 
444 /* run this to clean up after ObTypeNoClean */
445 START_TEST(ObTypeClean)
446 {
447  ObtClose(TRUE, FALSE);
448 }
NTSTATUS NTAPI ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN OUT PVOID ParseContext, OUT PHANDLE Handle)
Definition: obhandle.c:2529
struct _MY_OBJECT2 MY_OBJECT2
#define STATUS_OBJECT_NAME_COLLISION
Definition: udferr_usr.h:150
static VOID ObtCreateDirectory(VOID)
Definition: ObType.c:251
OB_DUMP_METHOD DumpProcedure
Definition: obtypes.h:366
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
ObjectType
Definition: metafile.c:80
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
#define IN
Definition: typedefs.h:38
NTSTATUS NTAPI ObCreateObjectType(IN PUNICODE_STRING TypeName, IN POBJECT_TYPE_INITIALIZER ObjectTypeInitializer, IN PVOID Reserved, OUT POBJECT_TYPE *ObjectType)
Definition: oblife.c:1048
#define GENERIC_ALL
Definition: nt_native.h:92
static VOID ObtCreateObjects(VOID)
Definition: ObType.c:279
struct _MY_OBJECT1 * PMY_OBJECT1
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define CheckCounts(OpenCount, CloseCount, DeleteCount, ParseCount, OkayToCloseCount, QueryNameCount)
Definition: ObType.c:262
static NTSTATUS NTAPI QueryNameProc(IN PVOID Object, IN BOOLEAN HasObjectName, OUT POBJECT_NAME_INFORMATION ObjectNameInfo, IN ULONG Length, OUT PULONG ReturnLength, IN KPROCESSOR_MODE AccessMode)
Definition: ObType.c:154
static VOID NTAPI CloseProc(IN PEPROCESS Process, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG ProcessHandleCount, IN ULONG SystemHandleCount)
Definition: ObType.c:92
#define NUM_OBTYPES2
Definition: ObType.c:276
OB_OKAYTOCLOSE_METHOD OkayToCloseProcedure
Definition: obtypes.h:373
static UNICODE_STRING ObDirectoryName
Definition: ObType.c:43
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
__wchar_t WCHAR
Definition: xmlstorage.h:180
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
static NTSTATUS NTAPI ParseProc(IN PVOID ParseObject, IN PVOID ObjectType, IN OUT PACCESS_STATE AccessState, IN KPROCESSOR_MODE AccessMode, IN ULONG Attributes, IN OUT PUNICODE_STRING CompleteName, IN OUT PUNICODE_STRING RemainingName, IN OUT PVOID Context OPTIONAL, IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL, OUT PVOID *Object)
Definition: ObType.c:117
static HANDLE DirectoryHandle
Definition: ObType.c:48
#define OBJ_PERMANENT
Definition: winternl.h:226
#define NUM_OBTYPES
Definition: ObType.c:26
static OBJECT_TYPE_INITIALIZER ObTypeInitializer[NUM_OBTYPES]
Definition: ObType.c:42
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
static VOID ObtClose(BOOLEAN Clean, BOOLEAN AlternativeMethod)
Definition: ObType.c:327
static OBJECT_ATTRIBUTES ObDirectoryAttributes
Definition: ObType.c:44
int32_t INT
Definition: typedefs.h:56
struct _MY_OBJECT2 * PMY_OBJECT2
static HANDLE ObHandle1[NUM_OBTYPES]
Definition: ObType.c:47
static PVOID ObBody[NUM_OBTYPES]
Definition: ObType.c:46
static UNICODE_STRING ObTypeName[NUM_OBTYPES]
Definition: ObType.c:40
struct _COUNTS COUNTS
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
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:496
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
static UNICODE_STRING ObName[NUM_OBTYPES]
Definition: ObType.c:41
BOOLEAN MaintainHandleCount
Definition: obtypes.h:361
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:396
struct NameRec_ * Name
Definition: cdprocs.h:464
NTSYSAPI NTSTATUS NTAPI ZwCreateDirectoryObject(_Out_ PHANDLE DirectoryHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes)
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
OB_CLOSE_METHOD CloseProcedure
Definition: obtypes.h:368
struct _COUNTS * PCOUNTS
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
Definition: oblife.c:952
#define ok(value,...)
Definition: CComObject.cpp:34
ULONG SomeLong[10]
Definition: ObType.c:36
USHORT Close
Definition: ObType.c:54
_In_ HANDLE Handle
Definition: extypes.h:390
USHORT Delete
Definition: ObType.c:55
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
static COUNTS Counts
Definition: ObType.c:60
#define MAX_PATH
Definition: compat.h:26
OB_PARSE_METHOD ParseProcedure
Definition: obtypes.h:370
#define CheckObject(Handle, Pointers, Handles)
Definition: ObType.c:16
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
static IUnknown Object
Definition: main.c:512
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE AccessState
Definition: sefuncs.h:414
static NTSTATUS NTAPI OpenProc(IN OB_OPEN_REASON OpenReason, IN PEPROCESS Process, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG HandleCount)
Definition: ObType.c:76
USHORT QueryName
Definition: ObType.c:58
OB_OPEN_METHOD OpenProcedure
Definition: obtypes.h:367
START_TEST(ObType)
Definition: ObType.c:433
static const WCHAR L[]
Definition: oid.c:1250
USHORT OkayToClose
Definition: ObType.c:57
USHORT Open
Definition: ObType.c:53
static __inline NTSTATUS RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1120
static VOID TestObjectType(IN BOOLEAN Clean)
Definition: ObType.c:415
OBJECT_TYPE_INITIALIZER TypeInfo
Definition: obtypes.h:390
#define OBJECT_TYPE_ALL_ACCESS
Definition: nt_native.h:1248
Status
Definition: gdiplustypes.h:24
enum _OB_OPEN_REASON OB_OPEN_REASON
#define ok_eq_longptr(value, expected)
Definition: kmt_test.h:248
static OBJECT_ATTRIBUTES ObAttributes[NUM_OBTYPES]
Definition: ObType.c:45
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
Definition: obhandle.c:2932
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
#define STANDARD_RIGHTS_ALL
Definition: nt_native.h:69
unsigned short USHORT
Definition: pedump.c:61
#define skip(...)
Definition: CString.cpp:57
#define SaveCounts(Save)
Definition: ObType.c:273
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int * PULONG
Definition: retypes.h:1
static VOID NTAPI DeleteProc(IN PVOID Object)
Definition: ObType.c:107
static POBJECT_TYPE ObTypes[NUM_OBTYPES]
Definition: ObType.c:39
USHORT Dump
Definition: ObType.c:52
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
struct _MY_OBJECT1 MY_OBJECT1
static VOID NTAPI DumpProc(IN PVOID Object, IN POB_DUMP_CONTROL DumpControl)
Definition: ObType.c:65
#define OUT
Definition: typedefs.h:39
#define ObReferenceObject
Definition: obfuncs.h:204
ULONG Something1
Definition: ObType.c:35
unsigned int ULONG
Definition: retypes.h:1
OB_QUERYNAME_METHOD QueryNameProcedure
Definition: obtypes.h:372
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define ok_eq_hex(value, expected)
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET _In_ PGENERIC_MAPPING _In_ KPROCESSOR_MODE _Out_ PACCESS_MASK GrantedAccess
Definition: sefuncs.h:13
return STATUS_SUCCESS
Definition: btrfs.c:2725
OB_DELETE_METHOD DeleteProcedure
Definition: obtypes.h:369
NTSTATUS NTAPI ObReferenceObjectByName(IN PUNICODE_STRING ObjectPath, IN ULONG Attributes, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext, OUT PVOID *ObjectPtr)
Definition: obref.c:411
NTSYSAPI NTSTATUS NTAPI ZwMakeTemporaryObject(_In_ HANDLE Handle)
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
ULONG Something1
Definition: ObType.c:30
ULONG ACCESS_MASK
Definition: nt_native.h:40
USHORT Parse
Definition: ObType.c:56
Definition: ObType.c:50
#define DELETE
Definition: nt_native.h:57
static VOID ObtCreateObjectTypes(VOID)
Definition: ObType.c:173
static BOOLEAN NTAPI OkayToCloseProc(IN PEPROCESS Process OPTIONAL, IN PVOID Object, IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
Definition: ObType.c:139
_Inout_ PFCB _Inout_ PUNICODE_STRING RemainingName
Definition: cdprocs.h:806
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68