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

rtdmpval.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 Delete (HANDLE Handle)
void __cdecl main (int argc, char *argv[])
void processargs (int argc, char *argv[])

Variables

UNICODE_STRING WorkName
WCHAR workbuffer [WORK_SIZE]
UNICODE_STRING ValueName
WCHAR valuebuffer [WORK_SIZE]


Define Documentation

#define WORK_SIZE   1024
 

Definition at line 35 of file rtdmpval.c.


Function Documentation

void Delete HANDLE  Handle  ) 
 

void __cdecl main int  argc,
char *  argv[]
 

Definition at line 52 of file rtdmpval.c.

References Count, exit, L, NT_SUCCESS, NtClose(), NtOpenKey(), NtQueryValueKey(), NTSTATUS(), NULL, ObjectAttributes, processargs(), valuebuffer, ValueName, WORK_SIZE, workbuffer, and WorkName.

00056 { 00057 NTSTATUS status; 00058 OBJECT_ATTRIBUTES ObjectAttributes; 00059 HANDLE BaseHandle; 00060 KEY_VALUE_PARTIAL_INFORMATION PartialInfo; 00061 PKEY_VALUE_PARTIAL_INFORMATION pInfo; 00062 ULONG i; 00063 ULONG Count; 00064 00065 00066 // 00067 // Process args 00068 // 00069 00070 WorkName.MaximumLength = WORK_SIZE; 00071 WorkName.Length = 0L; 00072 WorkName.Buffer = &(workbuffer[0]); 00073 00074 00075 ValueName.MaximumLength = WORK_SIZE; 00076 ValueName.Length = 0L; 00077 ValueName.Buffer = &(valuebuffer[0]); 00078 00079 processargs(argc, argv); 00080 00081 00082 // 00083 // Set up and open KeyPath 00084 // 00085 00086 printf("rtdmpval: starting\n"); 00087 00088 InitializeObjectAttributes( 00089 &ObjectAttributes, 00090 &WorkName, 00091 0, 00092 (HANDLE)NULL, 00093 NULL 00094 ); 00095 ObjectAttributes.Attributes |= OBJ_CASE_INSENSITIVE; 00096 00097 status = NtOpenKey( 00098 &BaseHandle, 00099 KEY_READ, 00100 &ObjectAttributes 00101 ); 00102 if (!NT_SUCCESS(status)) { 00103 printf("rtdmpval: t0: %08lx\n", status); 00104 exit(1); 00105 } 00106 00107 status = NtQueryValueKey(BaseHandle, 00108 &ValueName, 00109 KeyValuePartialInformation, 00110 &PartialInfo, 00111 sizeof(PartialInfo), 00112 &Count); 00113 00114 pInfo=malloc(PartialInfo.DataLength+sizeof(PartialInfo)); 00115 status = NtQueryValueKey(BaseHandle, 00116 &ValueName, 00117 KeyValuePartialInformation, 00118 pInfo, 00119 PartialInfo.DataLength+sizeof(PartialInfo), 00120 &Count); 00121 if (!NT_SUCCESS(status)) { 00122 printf("rtdmpval: t2: %08lx\n", status); 00123 exit(1); 00124 } 00125 00126 for (i=0; i<PartialInfo.DataLength; i++) { 00127 printf("%c",pInfo->Data[i]); 00128 } 00129 00130 free(pInfo); 00131 NtClose(BaseHandle); 00132 exit(0); 00133 }

void __cdecl main int  ,
char * 
 

void processargs int  argc,
char *  argv[]
 

Definition at line 136 of file rtdmpval.c.

References exit, RtlAnsiStringToUnicodeString(), RtlInitAnsiString(), TRUE, ValueName, and WorkName.

00140 { 00141 ANSI_STRING temp; 00142 00143 if ( (argc != 3) ) 00144 { 00145 printf("Usage: %s <KeyPath> <value entry name>\n", 00146 argv[0]); 00147 exit(1); 00148 } 00149 00150 RtlInitAnsiString( 00151 &temp, 00152 argv[1] 00153 ); 00154 00155 RtlAnsiStringToUnicodeString( 00156 &WorkName, 00157 &temp, 00158 TRUE 00159 ); 00160 00161 RtlInitAnsiString( 00162 &temp, 00163 argv[2] 00164 ); 00165 00166 RtlAnsiStringToUnicodeString( 00167 &ValueName, 00168 &temp, 00169 TRUE 00170 ); 00171 00172 return; 00173 }

void processargs  ) 
 


Variable Documentation

WCHAR valuebuffer[WORK_SIZE]
 

Definition at line 49 of file rtdmpval.c.

UNICODE_STRING ValueName
 

Definition at line 48 of file rtdmpval.c.

WCHAR workbuffer[WORK_SIZE]
 

Definition at line 46 of file rtdmpval.c.

UNICODE_STRING WorkName
 

Definition at line 45 of file rtdmpval.c.


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