Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

uob.c File Reference

#include <nt.h>
#include <ntrtl.h>
#include <string.h>

Go to the source code of this file.

Functions

VOID TestParent (VOID)
VOID TestChild (VOID)
VOID DumpObjectDirs (IN PCH DirName, IN ULONG Level)
 main (int argc, char **argv, char **envp, int DebugFlag)

Variables

STRING DirTypeName
STRING LinkTypeName
char ParameterBuffer [4096]


Function Documentation

VOID DumpObjectDirs IN PCH  DirName,
IN ULONG  Level
 

Definition at line 39 of file uob.c.

References CHAR, DbgPrint, DirTypeName, FALSE, Handle, LinkTypeName, Name, NT_SUCCESS, NtClose(), NtCreateDirectoryObject(), NtOpenSymbolicLinkObject(), NtQueryDirectoryObject(), NtQuerySymbolicLinkObject(), NTSTATUS(), NULL, ObjectAttributes, RtlEqualString(), RtlInitString(), Status, and TRUE.

Referenced by TestParent().

00043 { 00044 OBJECT_ATTRIBUTES ObjectAttributes; 00045 STRING Name; 00046 HANDLE Handle; 00047 ULONG Context, Length; 00048 NTSTATUS Status; 00049 BOOLEAN RestartScan; 00050 POBJECT_DIRECTORY_INFORMATION DirInfo; 00051 CHAR DirInfoBuffer[ 256 ]; 00052 CHAR SubDirName[ 128 ]; 00053 STRING LinkName; 00054 STRING LinkTarget; 00055 HANDLE LinkHandle; 00056 00057 RtlInitString( &Name, DirName ); 00058 InitializeObjectAttributes( &ObjectAttributes, 00059 &Name, 00060 OBJ_OPENIF | OBJ_CASE_INSENSITIVE, 00061 NULL, 00062 NULL 00063 ); 00064 NtCreateDirectoryObject( &Handle, 00065 DIRECTORY_ALL_ACCESS, 00066 &ObjectAttributes 00067 ); 00068 00069 DirInfo = (POBJECT_DIRECTORY_INFORMATION)&DirInfoBuffer; 00070 RestartScan = TRUE; 00071 while (TRUE) { 00072 Status = NtQueryDirectoryObject( Handle, 00073 (PVOID)DirInfo, 00074 sizeof( DirInfoBuffer ), 00075 TRUE, 00076 RestartScan, 00077 &Context, 00078 &Length 00079 ); 00080 if (!NT_SUCCESS( Status )) { 00081 break; 00082 } 00083 00084 DbgPrint( "%s%s%Z - %Z", 00085 DirName, 00086 Level ? "\\" : "", 00087 &DirInfo->Name, 00088 &DirInfo->TypeName 00089 ); 00090 if (RtlEqualString( &DirInfo->TypeName, &DirTypeName, TRUE )) { 00091 DbgPrint( "\n" ); 00092 strcpy( SubDirName, DirName ); 00093 if (Level) { 00094 strcat( SubDirName, "\\" ); 00095 } 00096 strcat( SubDirName, DirInfo->Name.Buffer ); 00097 DumpObjectDirs( SubDirName, Level+1 ); 00098 } 00099 else 00100 if (RtlEqualString( &DirInfo->TypeName, &LinkTypeName, TRUE )) { 00101 strcpy( SubDirName, DirName ); 00102 if (Level) { 00103 strcat( SubDirName, "\\" ); 00104 } 00105 strcat( SubDirName, DirInfo->Name.Buffer ); 00106 RtlInitString( &LinkName, SubDirName ); 00107 InitializeObjectAttributes( &ObjectAttributes, 00108 &LinkName, 00109 0, 00110 NULL, 00111 NULL 00112 ); 00113 Status = NtOpenSymbolicLinkObject( &LinkHandle, 00114 SYMBOLIC_LINK_ALL_ACCESS, 00115 &ObjectAttributes 00116 ); 00117 if (!NT_SUCCESS( Status )) { 00118 DbgPrint( " - unable to open symbolic link (%X)\n", Status ); 00119 } 00120 else { 00121 LinkTarget.MaximumLength = sizeof( SubDirName ); 00122 LinkTarget.Length = 0; 00123 LinkTarget.Buffer = SubDirName; 00124 Status = NtQuerySymbolicLinkObject( LinkHandle, 00125 &LinkTarget 00126 ); 00127 if (!NT_SUCCESS( Status )) { 00128 DbgPrint( " - unable to query symbolic link target (%X)\n", Status ); 00129 } 00130 else { 00131 DbgPrint( " => %Z\n", &LinkTarget ); 00132 } 00133 00134 NtClose( LinkHandle ); 00135 } 00136 } 00137 else { 00138 DbgPrint( "\n" ); 00139 } 00140 00141 RestartScan = FALSE; 00142 } 00143 00144 NtClose( Handle ); 00145 }

main int  argc,
char **  argv,
char **  envp,
int  DebugFlag
 

Definition at line 149 of file uob.c.

References DbgPrint, FALSE, NT_SUCCESS, NtResumeThread(), NTSTATUS(), NtTerminateProcess(), NtWaitForSingleObject(), NULL, ParameterBuffer, RtlCreateUserProcess(), RtlInitString(), Status, TestChild(), TestParent(), and TRUE.

00155 { 00156 NTSTATUS Status; 00157 STRING ImageName; 00158 PRTL_USER_PROCESS_PARAMETERS ProcessParameters; 00159 RTL_USER_PROCESS_INFORMATION ProcessInformation; 00160 00161 if (argc == 1) { 00162 TestParent(); 00163 00164 Parameters[ RTL_USER_PROC_PARAMS_IMAGEFILE ] = argv[ 0 ]; 00165 00166 Parameters[ RTL_USER_PROC_PARAMS_CMDLINE ] = " CHILD"; 00167 00168 Parameters[ RTL_USER_PROC_PARAMS_DEBUGFLAG ] = 00169 DebugFlag ? "1" : "0"; 00170 00171 Parameters[ RTL_USER_PROC_PARAMS_DEBUGFLAG+1 ] = NULL; 00172 00173 Arguments[ 0 ] = argv[ 0 ]; 00174 Arguments[ 1 ] = "CHILD"; 00175 Arguments[ 2 ] = NULL; 00176 00177 ProcessParameters = (PRTL_USER_PROCESS_PARAMETERS)ParameterBuffer; 00178 ProcessParameters->Length = 0; 00179 ProcessParameters->MaximumLength = sizeof( ParameterBuffer ); 00180 00181 Status = RtlVectorsToProcessParameters( Arguments, 00182 envp, 00183 Parameters, 00184 ProcessParameters 00185 ); 00186 if (!NT_SUCCESS( Status )) { 00187 DbgPrint( "RtlVectorToProcessParameters failed - Status = %X\n", 00188 Status 00189 ); 00190 } 00191 else { 00192 RtlInitString( &ImageName, "\\C:\\TMP\\UOB.EXE" ); 00193 Status = RtlCreateUserProcess( &ImageName, 00194 NULL, 00195 NULL, 00196 NULL, 00197 TRUE, 00198 NULL, 00199 NULL, 00200 ProcessParameters, 00201 &ProcessInformation, 00202 NULL 00203 ); 00204 if (!NT_SUCCESS( Status )) { 00205 DbgPrint( "RtlCreateUserProcess( %Z ) failed - Status = %X\n", 00206 &ImageName, Status 00207 ); 00208 } 00209 else { 00210 Status = NtResumeThread( ProcessInformation.Thread, NULL ); 00211 Status = NtWaitForSingleObject( ProcessInformation.Process, 00212 FALSE, 00213 (PLARGE_INTEGER)NULL 00214 ); 00215 if (!NT_SUCCESS( Status )) { 00216 DbgPrint( "NtWaitForSingleObject failed - Status = %X\n", 00217 Status 00218 ); 00219 } 00220 } 00221 } 00222 } 00223 else { 00224 TestChild(); 00225 } 00226 00227 NtTerminateProcess( NtCurrentProcess(), Status ); 00228 }

VOID TestChild VOID   ) 
 

Definition at line 624 of file uob.c.

References DbgPrint, DirectoryHandle, DirectoryName, NT_SUCCESS, NtOpenDirectoryObject(), NTSTATUS(), NULL, ObjectAttributes, RtlInitString(), and Status.

Referenced by main().

00625 { 00626 NTSTATUS Status; 00627 STRING DirectoryName; 00628 HANDLE DirectoryHandle; 00629 OBJECT_ATTRIBUTES ObjectAttributes; 00630 00631 Status = STATUS_SUCCESS; 00632 00633 DbgPrint( "Entering Object Manager User Mode Child Test Program\n" ); 00634 00635 RtlInitString( &DirectoryName, "\\ExclusiveDir" ); 00636 InitializeObjectAttributes( &ObjectAttributes, 00637 &DirectoryName, 00638 OBJ_CASE_INSENSITIVE, 00639 NULL, 00640 NULL 00641 ); 00642 Status = NtOpenDirectoryObject( &DirectoryHandle, 00643 DIRECTORY_ALL_ACCESS, 00644 &ObjectAttributes 00645 ); 00646 if (!NT_SUCCESS( Status )) { 00647 DbgPrint( "Unable to open %Z directory object (%X) [OK]\n", 00648 &DirectoryName, Status ); 00649 } 00650 00651 InitializeObjectAttributes( &ObjectAttributes, 00652 &DirectoryName, 00653 OBJ_CASE_INSENSITIVE | OBJ_EXCLUSIVE, 00654 NULL, 00655 NULL 00656 ); 00657 Status = NtOpenDirectoryObject( &DirectoryHandle, 00658 DIRECTORY_ALL_ACCESS, 00659 &ObjectAttributes 00660 ); 00661 if (!NT_SUCCESS( Status )) { 00662 DbgPrint( "Unable to open %Z directory object (%X) [OK]\n", 00663 &DirectoryName, Status ); 00664 } 00665 00666 DbgPrint( "Exiting Object Manager User Mode Child Test Program with Status = %X\n", Status ); 00667 }

VOID TestParent VOID   ) 
 

Definition at line 232 of file uob.c.

References CHAR, DbgPrint, DirectoryHandle, DirectoryName, DirTypeName, DumpObjectDirs(), LinkTypeName, NT_SUCCESS, NtClose(), NtCreateDirectoryObject(), NtCreateSection(), NtCreateSymbolicLinkObject(), NtMakeTemporaryObject(), NtOpenDirectoryObject(), NtQueryObject(), NTSTATUS(), NtTerminateProcess(), NULL, ObjectAttributes, RtlInitString(), and Status.

Referenced by main().

00233 { 00234 NTSTATUS Status; 00235 STRING DirectoryName; 00236 STRING LinkName; 00237 STRING LinkTarget; 00238 STRING SectionName; 00239 OBJECT_ATTRIBUTES ObjectAttributes; 00240 HANDLE DirectoryHandle, LinkHandle, SectionHandle; 00241 ULONG ReturnedLength; 00242 CHAR ObjectInfoBuffer[ 512 ]; 00243 OBJECT_BASIC_INFORMATION ObjectBasicInfo; 00244 POBJECT_NAME_INFORMATION ObjectNameInfo; 00245 POBJECT_TYPE_INFORMATION ObjectTypeInfo; 00246 LARGE_INTEGER SectionSize; 00247 00248 Status = STATUS_SUCCESS; 00249 00250 DbgPrint( "Entering Object Manager User Mode Test Program\n" ); 00251 00252 RtlInitString( &SectionName, "\\A:\\OSO001.MSG" ); 00253 InitializeObjectAttributes( &ObjectAttributes, 00254 &SectionName, 00255 OBJ_OPENIF | OBJ_CASE_INSENSITIVE, 00256 NULL, 00257 NULL 00258 ); 00259 00260 SectionSize.LowPart = 0x1000; 00261 SectiinSize.HighPart = 0; 00262 Status = NtCreateSection( &SectionHandle, 00263 GENERIC_READ, 00264 &ObjectAttributes, 00265 &SectionSize, 00266 PAGE_READONLY, 00267 SEC_RESERVE, 00268 NULL 00269 ); 00270 if (!NT_SUCCESS( Status )) { 00271 DbgPrint( "Unable to create %Z section object (%X) [OK]\n", &SectionName, Status ); 00272 } 00273 00274 RtlInitString( &DirectoryName, "\\Drives" ); 00275 InitializeObjectAttributes( &ObjectAttributes, 00276 &DirectoryName, 00277 OBJ_CASE_INSENSITIVE | OBJ_PERMANENT, 00278 NULL, 00279 (PSECURITY_DESCRIPTOR)1 00280 00281 ); 00282 ObjectAttributes.Length = 0; 00283 Status = NtCreateDirectoryObject( &DirectoryHandle, 00284 -1, 00285 &ObjectAttributes 00286 ); 00287 if (!NT_SUCCESS( Status )) { 00288 DbgPrint( "Unable to create %Z directory object (%X) [OK]\n", 00289 &DirectoryName, Status ); 00290 } 00291 00292 RtlInitString( &DirectoryName, "\\Drives" ); 00293 InitializeObjectAttributes( &ObjectAttributes, 00294 &DirectoryName, 00295 OBJ_CASE_INSENSITIVE | OBJ_PERMANENT, 00296 NULL, 00297 (PSECURITY_DESCRIPTOR)1 00298 00299 ); 00300 ObjectAttributes.Length = 0; 00301 Status = NtCreateDirectoryObject( &DirectoryHandle, 00302 DIRECTORY_ALL_ACCESS, 00303 &ObjectAttributes 00304 ); 00305 if (!NT_SUCCESS( Status )) { 00306 DbgPrint( "Unable to create %Z directory object (%X) [OK]\n", 00307 &DirectoryName, Status ); 00308 } 00309 00310 InitializeObjectAttributes( &ObjectAttributes, 00311 &DirectoryName, 00312 -1, 00313 NULL, 00314 (PSECURITY_DESCRIPTOR)1 00315 00316 ); 00317 Status = NtCreateDirectoryObject( &DirectoryHandle, 00318 DIRECTORY_ALL_ACCESS, 00319 &ObjectAttributes 00320 ); 00321 if (!NT_SUCCESS( Status )) { 00322 DbgPrint( "Unable to create %Z directory object (%X) [OK]\n", 00323 &DirectoryName, Status ); 00324 } 00325 00326 InitializeObjectAttributes( &ObjectAttributes, 00327 &DirectoryName, 00328 OBJ_CASE_INSENSITIVE | OBJ_PERMANENT, 00329 NULL, 00330 (PSECURITY_DESCRIPTOR)1 00331 00332 ); 00333 Status = NtCreateDirectoryObject( &DirectoryHandle, 00334 DIRECTORY_ALL_ACCESS, 00335 &ObjectAttributes 00336 ); 00337 if (!NT_SUCCESS( Status )) { 00338 DbgPrint( "Unable to create %Z directory object (%X) [OK]\n", 00339 &DirectoryName, Status ); 00340 } 00341 00342 InitializeObjectAttributes( &ObjectAttributes, 00343 &DirectoryName, 00344 OBJ_CASE_INSENSITIVE | OBJ_PERMANENT, 00345 NULL, 00346 NULL 00347 00348 ); 00349 Status = NtCreateDirectoryObject( &DirectoryHandle, 00350 DIRECTORY_ALL_ACCESS, 00351 &ObjectAttributes 00352 ); 00353 if (!NT_SUCCESS( Status )) { 00354 DbgPrint( "Unable to create %Z directory object (%X)\n", 00355 &DirectoryName, Status ); 00356 NtTerminateProcess( NtCurrentProcess(), Status ); 00357 } 00358 00359 Status = NtClose( DirectoryHandle ); 00360 if (!NT_SUCCESS( Status )) { 00361 DbgPrint( "Unable to close %Z directory object handle - %lx (%X)\n", 00362 &DirectoryName, 00363 DirectoryHandle, 00364 Status 00365 ); 00366 NtTerminateProcess( NtCurrentProcess(), Status ); 00367 } 00368 00369 InitializeObjectAttributes( &ObjectAttributes, 00370 &DirectoryName, 00371 OBJ_CASE_INSENSITIVE, 00372 NULL, 00373 NULL 00374 ); 00375 Status = NtOpenDirectoryObject( &DirectoryHandle, 00376 DIRECTORY_ALL_ACCESS, 00377 &ObjectAttributes 00378 ); 00379 if (!NT_SUCCESS( Status )) { 00380 DbgPrint( "Unable to open %Z directory object (%X)\n", 00381 &DirectoryName, Status ); 00382 NtTerminateProcess( NtCurrentProcess(), Status ); 00383 } 00384 00385 Status = NtQueryObject( DirectoryHandle, 00386 ObjectBasicInformation, 00387 &ObjectBasicInfo, 00388 sizeof( ObjectBasicInfo ), 00389 &ReturnedLength 00390 ); 00391 if (!NT_SUCCESS( Status )) { 00392 DbgPrint( "NtQueryObject( %lx, ObjectBasicInfo ) failed - Status == %X\n", 00393 DirectoryHandle, 00394 Status 00395 ); 00396 NtTerminateProcess( NtCurrentProcess(), Status ); 00397 } 00398 DbgPrint( "NtQueryObject( %lx, ObjectBasicInfo ) returned %lx bytes\n", 00399 DirectoryHandle, 00400 ReturnedLength 00401 ); 00402 DbgPrint( " Attributes = %lx\n", ObjectBasicInfo.Attributes ); 00403 DbgPrint( " GrantedAccess = %lx\n", ObjectBasicInfo.GrantedAccess ); 00404 DbgPrint( " HandleCount = %lx\n", ObjectBasicInfo.HandleCount ); 00405 DbgPrint( " PointerCount = %lx\n", ObjectBasicInfo.PointerCount ); 00406 DbgPrint( " PagedPoolCharge = %lx\n", ObjectBasicInfo.PagedPoolCharge ); 00407 DbgPrint( " NonPagedPoolCharge = %lx\n", ObjectBasicInfo.NonPagedPoolCharge ); 00408 DbgPrint( " NameInfoSize = %lx\n", ObjectBasicInfo.NameInfoSize ); 00409 DbgPrint( " TypeInfoSize = %lx\n", ObjectBasicInfo.TypeInfoSize ); 00410 DbgPrint( " SecurityDescriptorSize = %lx\n", ObjectBasicInfo.SecurityDescriptorSize ); 00411 00412 ObjectNameInfo = (POBJECT_NAME_INFORMATION)ObjectInfoBuffer; 00413 Status = NtQueryObject( DirectoryHandle, 00414 ObjectNameInformation, 00415 ObjectNameInfo, 00416 sizeof( ObjectInfoBuffer ), 00417 &ReturnedLength 00418 ); 00419 if (!NT_SUCCESS( Status )) { 00420 DbgPrint( "NtQueryObject( %lx, ObjectNameInfo ) failed - Status == %X\n", 00421 DirectoryHandle, 00422 Status 00423 ); 00424 NtTerminateProcess( NtCurrentProcess(), Status ); 00425 } 00426 DbgPrint( "NtQueryObject( %lx, ObjectNameInfo ) returned %lx bytes\n", 00427 DirectoryHandle, 00428 ReturnedLength 00429 ); 00430 DbgPrint( " Name = (%ld,%ld) '%Z'\n", 00431 ObjectNameInfo->Name.MaximumLength, 00432 ObjectNameInfo->Name.Length, 00433 &ObjectNameInfo->Name 00434 ); 00435 00436 00437 ObjectTypeInfo = (POBJECT_TYPE_INFORMATION)ObjectInfoBuffer; 00438 Status = NtQueryObject( DirectoryHandle, 00439 ObjectTypeInformation, 00440 ObjectTypeInfo, 00441 sizeof( ObjectInfoBuffer ), 00442 &ReturnedLength 00443 ); 00444 if (!NT_SUCCESS( Status )) { 00445 DbgPrint( "NtQueryObject( %lx, ObjectTypeInfo ) failed - Status == %X\n", 00446 DirectoryHandle, 00447 Status 00448 ); 00449 NtTerminateProcess( NtCurrentProcess(), Status ); 00450 } 00451 DbgPrint( "NtQueryObject( %lx, ObjectTypeInfo ) returned %lx bytes\n", 00452 DirectoryHandle, 00453 ReturnedLength 00454 ); 00455 DbgPrint( " TypeName = (%ld,%ld) '%Z'\n", 00456 ObjectTypeInfo->TypeName.MaximumLength, 00457 ObjectTypeInfo->TypeName.Length, 00458 &ObjectTypeInfo->TypeName 00459 ); 00460 00461 RtlInitString( &LinkName, "TestSymbolicLink" ); 00462 InitializeObjectAttributes( &ObjectAttributes, 00463 &LinkName, 00464 OBJ_CASE_INSENSITIVE, 00465 NULL, 00466 NULL 00467 ); 00468 ObjectAttributes.RootDirectory = DirectoryHandle; 00469 RtlInitString( &LinkTarget, "\\Device\\FileSystem" ); 00470 Status = NtCreateSymbolicLinkObject( &LinkHandle, 00471 SYMBOLIC_LINK_ALL_ACCESS, 00472 &ObjectAttributes, 00473 &LinkTarget 00474 ); 00475 00476 if (!NT_SUCCESS( Status )) { 00477 DbgPrint( "Unable to create %Z => %Z symbolic link object (%X)\n", 00478 &LinkName, &LinkTarget, Status ); 00479 NtTerminateProcess( NtCurrentProcess(), Status ); 00480 } 00481 00482 Status = NtClose( DirectoryHandle ); 00483 if (!NT_SUCCESS( Status )) { 00484 DbgPrint( "Unable to close %Z directory object handle - %lx (%X)\n", 00485 &DirectoryName, 00486 DirectoryHandle, 00487 Status 00488 ); 00489 NtTerminateProcess( NtCurrentProcess(), Status ); 00490 } 00491 00492 RtlInitString( &DirTypeName, "Directory" ); 00493 RtlInitString( &LinkTypeName, "SymbolicLink" ); 00494 DumpObjectDirs( "\\", 0 ); 00495 00496 RtlInitString( &LinkName, "TestSymbolicLink" ); 00497 InitializeObjectAttributes( &ObjectAttributes, 00498 &LinkName, 00499 OBJ_CASE_INSENSITIVE, 00500 NULL, 00501 NULL 00502 ); 00503 ObjectAttributes.RootDirectory = LinkHandle; 00504 Status = NtOpenDirectoryObject( &DirectoryHandle, 00505 DIRECTORY_ALL_ACCESS, 00506 &ObjectAttributes 00507 ); 00508 if (!NT_SUCCESS( Status )) { 00509 DbgPrint( "Unable to open %Z directory object (%X) [OK]\n", &DirectoryName, Status ); 00510 } 00511 00512 Status = NtClose( LinkHandle ); 00513 if (!NT_SUCCESS( Status )) { 00514 DbgPrint( "Unable to close %Z symbolic link handle - %lx (%X)\n", 00515 &LinkName, 00516 LinkHandle, 00517 Status 00518 ); 00519 NtTerminateProcess( NtCurrentProcess(), Status ); 00520 } 00521 00522 InitializeObjectAttributes( &ObjectAttributes, 00523 &DirectoryName, 00524 OBJ_CASE_INSENSITIVE, 00525 NULL, 00526 NULL 00527 ); 00528 Status = NtOpenDirectoryObject( &DirectoryHandle, 00529 DIRECTORY_ALL_ACCESS, 00530 &ObjectAttributes 00531 ); 00532 if (!NT_SUCCESS( Status )) { 00533 DbgPrint( "Unable to open %Z directory object (%X)\n", &DirectoryName, Status ); 00534 NtTerminateProcess( NtCurrentProcess(), Status ); 00535 } 00536 00537 Status = NtMakeTemporaryObject( DirectoryHandle ); 00538 if (!NT_SUCCESS( Status )) { 00539 DbgPrint( "NtMakeTemporaryObject( %lx ) failed - Status == %X\n", 00540 DirectoryHandle, 00541 Status 00542 ); 00543 NtTerminateProcess( NtCurrentProcess(), Status ); 00544 } 00545 00546 Status = NtClose( DirectoryHandle ); 00547 if (!NT_SUCCESS( Status )) { 00548 DbgPrint( "Unable to close %Z directory object handle - %lx (%X)\n", 00549 &DirectoryName, 00550 DirectoryHandle, 00551 Status 00552 ); 00553 NtTerminateProcess( NtCurrentProcess(), Status ); 00554 } 00555 00556 InitializeObjectAttributes( &ObjectAttributes, 00557 &DirectoryName, 00558 OBJ_CASE_INSENSITIVE, 00559 NULL, 00560 NULL 00561 ); 00562 Status = NtOpenDirectoryObject( &DirectoryHandle, 00563 DIRECTORY_ALL_ACCESS, 00564 &ObjectAttributes 00565 ); 00566 if (!NT_SUCCESS( Status )) { 00567 DbgPrint( "Unable to open %Z directory object (%X) [OK]\n", &DirectoryName, Status ); 00568 } 00569 00570 RtlInitString( &DirectoryName, "\\ExclusiveDir" ); 00571 InitializeObjectAttributes( &ObjectAttributes, 00572 &DirectoryName, 00573 OBJ_CASE_INSENSITIVE | OBJ_EXCLUSIVE, 00574 NULL, 00575 NULL 00576 00577 ); 00578 Status = NtCreateDirectoryObject( &DirectoryHandle, 00579 DIRECTORY_ALL_ACCESS, 00580 &ObjectAttributes 00581 ); 00582 if (!NT_SUCCESS( Status )) { 00583 DbgPrint( "Unable to create %Z directory object (%X)\n", 00584 &DirectoryName, Status ); 00585 NtTerminateProcess( NtCurrentProcess(), Status ); 00586 } 00587 00588 InitializeObjectAttributes( &ObjectAttributes, 00589 &DirectoryName, 00590 OBJ_CASE_INSENSITIVE | OBJ_EXCLUSIVE, 00591 NULL, 00592 NULL 00593 ); 00594 Status = NtOpenDirectoryObject( &DirectoryHandle, 00595 DIRECTORY_ALL_ACCESS, 00596 &ObjectAttributes 00597 ); 00598 if (!NT_SUCCESS( Status )) { 00599 DbgPrint( "Unable to open %Z directory object (%X)\n", 00600 &DirectoryName, Status ); 00601 NtTerminateProcess( NtCurrentProcess(), Status ); 00602 } 00603 00604 InitializeObjectAttributes( &ObjectAttributes, 00605 &DirectoryName, 00606 OBJ_CASE_INSENSITIVE, 00607 NULL, 00608 NULL 00609 ); 00610 Status = NtOpenDirectoryObject( &DirectoryHandle, 00611 DIRECTORY_ALL_ACCESS, 00612 &ObjectAttributes 00613 ); 00614 if (!NT_SUCCESS( Status )) { 00615 DbgPrint( "Unable to open %Z directory object (%X) [OK]\n", 00616 &DirectoryName, Status ); 00617 } 00618 00619 DbgPrint( "Exiting Object Manager User Mode Test Program with Status = %X\n", Status ); 00620 }


Variable Documentation

STRING DirTypeName
 

Definition at line 29 of file uob.c.

Referenced by DumpObjectDirs(), and TestParent().

STRING LinkTypeName
 

Definition at line 30 of file uob.c.

Referenced by DumpObjectDirs(), and TestParent().

char ParameterBuffer[4096]
 

Definition at line 147 of file uob.c.

Referenced by main().


Generated on Sat May 15 19:45:52 2004 for test by doxygen 1.3.7