/* * NTOSKRNL Ob Regressions KM-Test * ReactOS Kernel Mode Regression Testing framework * * Copyright 2006 Aleksey Bragin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; see the file COPYING.LIB. * If not, write to the Free Software Foundation, * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* INCLUDES *******************************************************************/ #include #include "kmtest.h" //#define NDEBUG #include "debug.h" #include "ndk/obtypes.h" #include "ndk/obfuncs.h" #include "ndk/ifssupp.h" #include "ndk/setypes.h" #include "ndk/sefuncs.h" // I ment to make this test scalable, but for now // we work with two object types only #define NUM_OBTYPES 2 typedef struct _MY_OBJECT1 { ULONG Something1; } MY_OBJECT1, *PMY_OBJECT1; typedef struct _MY_OBJECT2 { ULONG Something1; ULONG SomeLong[10]; } MY_OBJECT2, *PMY_OBJECT2; POBJECT_TYPE ObTypes[NUM_OBTYPES]; UNICODE_STRING ObTypeName[NUM_OBTYPES]; UNICODE_STRING ObName[NUM_OBTYPES]; OBJECT_TYPE_INITIALIZER ObTypeInitializer[NUM_OBTYPES]; UNICODE_STRING ObDirectoryName; OBJECT_ATTRIBUTES ObDirectoryAttributes; OBJECT_ATTRIBUTES ObAttributes[NUM_OBTYPES]; PVOID ObBody[NUM_OBTYPES]; PMY_OBJECT1 ObObject1; PMY_OBJECT2 ObObject2; /* PRIVATE FUNCTIONS **********************************************************/ VOID DumpProc(IN PVOID Object, IN POB_DUMP_CONTROL DumpControl) { DbgPrint("DumpProc() called\n"); } VOID OpenProc(IN OB_OPEN_REASON OpenReason, IN PEPROCESS Process, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG HandleCount) { DbgPrint("OpenProc() called\n"); } VOID CloseProc(IN PEPROCESS Process, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG ProcessHandleCount, IN ULONG SystemHandleCount) { DbgPrint("CloseProc() called\n"); } VOID DeleteProc(IN PVOID Object) { DbgPrint("DeleteProc()called\n"); } NTSTATUS 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) { DbgPrint("ParseProc() called\n"); return STATUS_SUCCESS; } VOID ObtCreateObjectTypes() { UCHAR i; NTSTATUS Status; for (i=0; i