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

rtqkey.c File Reference

#include "cmp.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Defines

#define WORK_SIZE   1024

Functions

void __cdecl main (int, char *)
void processargs ()
void __cdecl main (int argc, char *argv[])
void processargs (int argc, char *argv[])

Variables

UNICODE_STRING WorkName
WCHAR workbuffer [WORK_SIZE]
UCHAR Buffer [1024 *64]
ULONG InfoType = KeyFullInformation
ULONG BufferSize = -1


Define Documentation

#define WORK_SIZE   1024
 

Definition at line 34 of file rtqkey.c.


Function Documentation

void __cdecl main int  argc,
char *  argv[]
 

Definition at line 48 of file rtqkey.c.

References Buffer, BufferSize, exit, InfoType, L, NT_SUCCESS, NtClose(), NtOpenKey(), NtQueryKey(), NTSTATUS(), NULL, ObjectAttributes, processargs(), WORK_SIZE, workbuffer, and WorkName.

00052 { 00053 NTSTATUS status; 00054 OBJECT_ATTRIBUTES ObjectAttributes; 00055 HANDLE BaseHandle; 00056 ULONG Sizes[] = { sizeof(KEY_BASIC_INFORMATION), 00057 sizeof(KEY_NODE_INFORMATION), 00058 sizeof(KEY_FULL_INFORMATION) }; 00059 ULONG ResultLength; 00060 PKEY_BASIC_INFORMATION pbasic; 00061 PKEY_NODE_INFORMATION pnode; 00062 PKEY_FULL_INFORMATION pfull; 00063 00064 // 00065 // Process args 00066 // 00067 00068 WorkName.MaximumLength = WORK_SIZE; 00069 WorkName.Length = 0L; 00070 WorkName.Buffer = &(workbuffer[0]); 00071 00072 processargs(argc, argv); 00073 00074 00075 // 00076 // Set up and open KeyPath 00077 // 00078 00079 printf("rtqkey: starting\n"); 00080 00081 InitializeObjectAttributes( 00082 &ObjectAttributes, 00083 &WorkName, 00084 0, 00085 (HANDLE)NULL, 00086 NULL 00087 ); 00088 ObjectAttributes.Attributes |= OBJ_CASE_INSENSITIVE; 00089 00090 status = NtOpenKey( 00091 &BaseHandle, 00092 KEY_QUERY_VALUE, 00093 &ObjectAttributes 00094 ); 00095 if (!NT_SUCCESS(status)) { 00096 printf("rtqkey: t0: %08lx\n", status); 00097 exit(1); 00098 } 00099 00100 // 00101 // make test call 00102 // 00103 RtlFillMemory((PVOID)&(Buffer[0]), 1024*64, 0xaa); 00104 00105 if (BufferSize == -1) { 00106 BufferSize = Sizes[InfoType]; 00107 } 00108 00109 status = NtQueryKey( 00110 BaseHandle, 00111 InfoType, 00112 (PVOID)&(Buffer[0]), 00113 BufferSize, 00114 &ResultLength 00115 ); 00116 00117 printf("status = %08lx ResultLength = %08lx\n", status, ResultLength); 00118 switch (InfoType) { 00119 case KeyBasicInformation: 00120 pbasic = (PKEY_BASIC_INFORMATION)Buffer; 00121 printf("LastWriteTime: %08lx:%08lx\n", pbasic->LastWriteTime.HighPart, 00122 pbasic->LastWriteTime.LowPart); 00123 printf("TitleIndex: %08lx\n", pbasic->TitleIndex); 00124 printf("NameLength: %08lx\n", pbasic->NameLength); 00125 printf("Name: '%.*ws'\n", pbasic->NameLength/2, &(pbasic->Name)); 00126 break; 00127 00128 case KeyNodeInformation: 00129 pnode = (PKEY_NODE_INFORMATION)Buffer; 00130 printf("LastWriteTime: %08lx:%08lx\n", pnode->LastWriteTime.HighPart, 00131 pnode->LastWriteTime.LowPart); 00132 printf("TitleIndex: %08lx\n", pnode->TitleIndex); 00133 printf("ClassOffset: %08lx\n", pnode->ClassOffset); 00134 printf("ClassLength: %08lx\n", pnode->ClassLength); 00135 printf("NameLength: %08lx\n", pnode->NameLength); 00136 printf("Name: '%.*ws'\n", pnode->NameLength/2, &(pnode->Name)); 00137 printf("Class: '%.*ws'\n", pnode->ClassLength/2, 00138 (PWSTR)((PUCHAR)pnode + pnode->ClassOffset)); 00139 break; 00140 00141 case KeyFullInformation: 00142 pfull = (PKEY_FULL_INFORMATION)Buffer; 00143 printf("LastWriteTime: %08lx:%08lx\n", pfull->LastWriteTime.HighPart, 00144 pfull->LastWriteTime.LowPart); 00145 printf("TitleIndex: %08lx\n", pfull->TitleIndex); 00146 printf("ClassOffset: %08lx\n", pfull->ClassOffset); 00147 printf("ClassLength: %08lx\n", pfull->ClassLength); 00148 00149 printf("SubKeys: %08lx MaxNameLen: %08lx MaxClassLen: %08lx\n", 00150 pfull->SubKeys, pfull->MaxNameLen, pfull->MaxClassLen); 00151 00152 printf(" Values: %08lx MaxValueNameLen: %08lx MaxValueDataLen: %08lx\n", 00153 pfull->Values, pfull->MaxValueNameLen, pfull->MaxValueDataLen); 00154 00155 printf("Class: '%.*ws'\n", pfull->ClassLength/2, pfull->Class); 00156 00157 break; 00158 } 00159 00160 NtClose(BaseHandle); 00161 exit(0); 00162 }

void __cdecl main int  ,
char * 
 

void processargs int  argc,
char *  argv[]
 

Definition at line 165 of file rtqkey.c.

References BufferSize, exit, InfoType, RtlAnsiStringToUnicodeString(), RtlInitAnsiString(), TRUE, and WorkName.

00169 { 00170 ANSI_STRING temp; 00171 00172 if ( (argc < 2) ) 00173 { 00174 printf("Usage: %s <KeyPath> [infotype] [bufferlen]\n", 00175 argv[0]); 00176 exit(1); 00177 } 00178 00179 RtlInitAnsiString( 00180 &temp, 00181 argv[1] 00182 ); 00183 00184 RtlAnsiStringToUnicodeString( 00185 &WorkName, 00186 &temp, 00187 TRUE 00188 ); 00189 00190 if (argc > 2) { 00191 InfoType = atoi(argv[2]); 00192 } 00193 00194 if (argc > 3) { 00195 BufferSize = atoi(argv[3]); 00196 } 00197 00198 return; 00199 }

void processargs  ) 
 


Variable Documentation

UCHAR Buffer[1024 *64]
 

Definition at line 42 of file rtqkey.c.

Referenced by AlGetString(), AlPrint(), AnotherPrefix(), bCheckIfDualBootingWithWin31(), CallConsoleApi(), CcCopyRead(), CcCopyWrite(), CcFastCopyRead(), CcFastCopyWrite(), CcMapData(), CcPinMappedData(), CcPinRead(), CcPreparePinWrite(), CcSetValidData(), CheckRestricted(), CmpAddToHiveFileList(), CmpFindPattern(), CmpGetBinaryField(), CmpGetBiosVersion(), CmpGetInfData(), CmpInitializeMachineDependentConfiguration(), CmpInitializeRegistryNode(), CmpInterlockedFunction(), CmpParseInfBuffer(), CmpSaveBootControlSet(), CopyRestrictedFile(), CopyStream(), CsrCaptureMessageBuffer(), DbgPrint(), DbgPrintReturnControlC(), DirectReadWaitRoutine(), DisplayAccountSid(), DisplaySecurityContext(), Dump(), ExLockUserBuffer(), ExpGetLookasideInformation(), ExRaiseHardError(), FastGetProfileKeysW(), FindNodeOrParent(), FmtIsFatPartition(), FsRecReadBlock(), FsRtlCopyRead(), FsRtlCopyWrite(), FsRtlGetCompatibilityModeValue(), FsRtlGetTunnelParameterValue(), FsRtlpIsDfsEnabled(), FsRtlSetFileSize(), FtReturnValue(), GetAvailableFonts(), GetCurrentExeName(), GetTaskName(), InitializeRestrictedStuff(), IoBuildAsynchronousFsdRequest(), IoBuildSynchronousFsdRequest(), IoepExtractErrData(), IoFastQueryNetworkAttributes(), IopAppendLegacyVeto(), IopCaptureObjectName(), IopCreateDefaultDeviceSecurityDescriptor(), IopExecuteHardwareProfileChange(), IopFreeUnicodeStringList(), IopGetDumpStack(), IopGetSetObjectId(), IopLookupBusStringFromID(), IopQueryConflictFillString(), IopRealloc(), IopRegMultiSzToUnicodeStrings(), IopSetEaOrQuotaInformationFile(), IopTCPQueryInformationEx(), IopTCPSetInformationEx(), IopWriteToDisk(), IopWriteTriageDump(), IovBuildAsynchronousFsdRequest(), IsFatVolume(), IsInterestingPath(), kcbWorker(), KdpComputeChecksum(), KdpReadControlSpace(), KdpTrap(), KdpWriteControlSpace(), KeBugCheckEx(), KeContextFromKframes(), KeDumpMachineState(), KeGetBugMessageText(), KeRegisterBugCheckCallback(), KeStartProfile(), KiDisplayString(), KiDumpParameterImages(), KiGetCpuVendor(), LdrLoadAlternateResourceModule(), LdrQueryImageFileExecutionOptions(), LfsCopyReadLogRecord(), LfsFindLogRecord(), LfsFreeSpanningBuffer(), LfsPinOrMapData(), LfsReadLogFileInformation(), LfsReadLogRecord(), LfsReadNextLogRecord(), LfsReadRestartArea(), LfsWriteRestartArea(), LowGetDriveGeometry(), LowReadSectors(), LowWriteSectors(), LpcpCopyRequestData(), main(), MatchandCopyAlias(), MiInitMachineDependent(), MiValidateUserTransfer(), MmCopyToCachedPage(), NtCreateProfile(), NtdllpFreeStringRoutine(), NtNotifyChangeDirectoryFile(), NtNotifyChangeKey(), NtNotifyChangeMultipleKeys(), NtQueryDirectoryObject(), NtQueryEaFile(), NtQueryQuotaInformationFile(), NtReadFile(), NtReadFileScatter(), NtReadRequestData(), NtReadVirtualMemory(), NtSetEaFile(), NtSetQuotaInformationFile(), NtSetSystemInformation(), NtWriteFile(), NtWriteFileGather(), NtWriteRequestData(), NtWriteVirtualMemory(), ObpAllocateObjectNameBuffer(), ObpFreeObjectNameBuffer(), ObpHashBuffer(), ObpLookupDirectoryEntry(), ReadBuffer(), ReadLEB128(), ReadOutputString(), ReadScreenBuffer(), RetrieveCommand(), RetrieveNthCommand(), RetrieveNumberOfSpaces(), RetrieveTotalNumberOfSpaces(), RtlCreateQueryDebugBuffer(), RtlDeleteElementGenericTable(), RtlDestroyQueryDebugBuffer(), RtlFormatMessage(), RtlInsertElementGenericTable(), RtlInsertElementGenericTableFull(), RtlIsTextUnicode(), RtlLookupElementGenericTable(), RtlLookupElementGenericTableFull(), RtlpAllocateHeapUsageEntry(), RtlpChangeQueryDebugBufferTarget(), RtlpCommitQueryDebugInfo(), RtlpDebugPageHeapProtectionText(), RtlpDeCommitQueryDebugInfo(), RtlpFreeHeapUsageEntry(), RtlpQueryProcessDebugInformationRemote(), RtlpQueryProcessEnumHeapsRoutine(), RtlQueryProcessBackTraceInformation(), RtlQueryProcessDebugInformation(), RtlQueryProcessHeapInformation(), RtlQueryProcessLockInformation(), RtlQueryProcessModuleInformation(), RtlUsageHeap(), RtlVirtualUnwind(), ScanHexFormat(), SeMakeAnonymousLogonToken(), SeMakeSystemToken(), SepAdtCopyToLsaSharedMemory(), SepClientOpenPipe(), SepPrintSid(), SepReadPipe(), SepTransceivePipe(), SetHandleFlag(), SmbTraceStart(), SrvGetConsoleInput(), SrvReadConsole(), SrvReadConsoleOutput(), SrvReadConsoleOutputString(), SrvWriteConsoleInput(), SrvWriteConsoleOutput(), SrvWriteConsoleOutputString(), TestCreateAcl(), TestDefaultObjectMethod(), TestDeleteAce(), TestGetAce(), TestQueryInformationAcl(), TestSetInformationAcl(), UdfCommonQueryInfo(), UdfCommonSetInfo(), UdfComputeCrc16(), UdfComputeCrc16Uni(), UdfDeallocateTable(), UdfFastQueryBasicInfo(), UdfFastQueryNetworkInfo(), UdfFastQueryStdInfo(), UdfQueryAlternateNameInfo(), UdfQueryBasicInfo(), UdfQueryEaInfo(), UdfQueryFsAttributeInfo(), UdfQueryFsDeviceInfo(), UdfQueryFsSizeInfo(), UdfQueryFsVolumeInfo(), UdfQueryInternalInfo(), UdfQueryNameInfo(), UdfQueryNetworkInfo(), UdfQueryPositionInfo(), UdfQueryStandardInfo(), UdfReadSectors(), UdfSerial32(), WriteBuffer(), WriteScreenBuffer(), WWSB_WriteOutputString(), xHalExamineMBR(), and xxxLbDir().

ULONG BufferSize = -1
 

Definition at line 45 of file rtqkey.c.

Referenced by CallConsoleApi(), CmpGetBinaryField(), CmpGetInfData(), CmpSetValueKeyExisting(), CopyRestrictedFile(), CopyStream(), CreateInputBuffer(), FlushAllButKeys(), InitializeRestrictedStuff(), IopTCPQueryInformationEx(), IopTCPSetInformationEx(), IopWriteTriageDump(), LdrQueryImageFileExecutionOptions(), LpcpCopyRequestData(), main(), MiDoMappedCopy(), MiDoPoolCopy(), MiValidateUserTransfer(), MmCopyVirtualMemory(), NtCreateProfile(), NtNotifyChangeKey(), NtNotifyChangeMultipleKeys(), NtReadRequestData(), NtReadVirtualMemory(), NtWriteRequestData(), NtWriteVirtualMemory(), processargs(), ReadChars(), RegLoadAsciiFileAsUnicode(), RetrieveCommand(), RetrieveNthCommand(), RtlInsertElementGenericTable(), RtlInsertElementGenericTableFull(), Scroll1(), Scroll2(), Scroll3(), Scroll4(), SetInputBufferSize(), SetRAMFont(), SetRAMFontCodePage(), SrvReadConsoleOutput(), SrvWriteConsoleOutput(), and WWSB_WriteChars().

ULONG InfoType = KeyFullInformation
 

Definition at line 44 of file rtqkey.c.

Referenced by main(), and processargs().

WCHAR workbuffer[WORK_SIZE]
 

Definition at line 40 of file rtqkey.c.

UNICODE_STRING WorkName
 

Definition at line 39 of file rtqkey.c.


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