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

rtsave.c File Reference

#include <nt.h>
#include <ntrtl.h>
#include <nturtl.h>
#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 processargs (int argc, char *argv[])

Variables

UNICODE_STRING KeyPath
WCHAR KeyPathBuffer [WORK_SIZE]
UNICODE_STRING FileName
WCHAR FileNameBuffer [WORK_SIZE]


Define Documentation

#define WORK_SIZE   1024
 

Definition at line 37 of file rtsave.c.


Function Documentation

void __cdecl main int  ,
char *  []
 

Definition at line 425 of file chkreg.c.

References DWORD, ExamineKey(), L, MSG_ERROR_REG_CONNECT_REGISTRY, and Status.

00426 { 00427 DWORD i; 00428 HKEY RemoteUsers; 00429 HKEY RemoteLocalMachine; 00430 LONG Status; 00431 00432 if( argc <= 1 ) { 00433 printf( "\n******* Examining HKEY_LOCAL_MACHINE on local machine\n\n" ); 00434 ExamineKey( HKEY_LOCAL_MACHINE, 00435 L"", 00436 L"", 00437 L"HKEY_LOCAL_MACHINE" ); 00438 00439 printf( "\n******* Examining HKEY_USERS on local machine\n\n" ); 00440 ExamineKey( HKEY_USERS, 00441 L"", 00442 L"", 00443 L"HKEY_USERS" ); 00444 00445 printf( "\n******* Examining HKEY_CLASSES_ROOT on local machine\n\n" ); 00446 ExamineKey( HKEY_CLASSES_ROOT, 00447 L"", 00448 L"", 00449 L"HKEY_CLASSES_ROOT" ); 00450 00451 printf( "\n******* Examining HKEY_CURRENT_USER on local machine\n\n" ); 00452 ExamineKey( HKEY_CURRENT_USER, 00453 L"", 00454 L"", 00455 L"HKEY_CURRENT_USER" ); 00456 } else { 00457 for( i = 1; i < argc; i++ ) { 00458 // 00459 // printf( "Machine name = %s \n", argv[ i ] ); 00460 // 00461 00462 Status = RegConnectRegistry( argv[ i ], 00463 HKEY_LOCAL_MACHINE, 00464 &RemoteLocalMachine ); 00465 00466 if( Status != ERROR_SUCCESS ) { 00467 printf( MSG_ERROR_REG_CONNECT_REGISTRY, argv[i], Status ); 00468 continue; 00469 } 00470 00471 Status = RegConnectRegistry( argv[ i ], 00472 HKEY_USERS, 00473 &RemoteUsers ); 00474 00475 if( Status != ERROR_SUCCESS ) { 00476 RegCloseKey( RemoteLocalMachine ); 00477 printf( MSG_ERROR_REG_CONNECT_REGISTRY, argv[i], Status ); 00478 continue; 00479 } 00480 00481 printf( "\n******* Examining HKEY_LOCAL_MACHINE on %s \n\n", argv[i] ); 00482 ExamineKey( RemoteLocalMachine, 00483 L"", 00484 L"", 00485 L"HKEY_LOCAL_MACHINE" ); 00486 00487 printf( "\n******* Examining HKEY_USERS on %s \n\n", argv[i] ); 00488 ExamineKey( RemoteUsers, 00489 L"", 00490 L"", 00491 L"HKEY_USERS" ); 00492 00493 RegCloseKey( RemoteLocalMachine ); 00494 RegCloseKey( RemoteUsers ); 00495 } 00496 } 00497 }

void processargs int  argc,
char *  argv[]
 

Definition at line 153 of file rtsave.c.

References exit, FileName, KeyPath, NULL, RtlAnsiStringToUnicodeString(), RtlDosPathNameToNtPathName_U(), RtlInitAnsiString(), and TRUE.

00157 { 00158 ANSI_STRING temp; 00159 UNICODE_STRING DosFileName; 00160 00161 if ( (argc != 3) ) 00162 { 00163 printf("Usage: %s <KeyName> <FileName>\nWhere <FileName> does NOT already exist\n", 00164 argv[0]); 00165 printf("Example: %s \\registry\\machine\\security d:\\backups\\security\n", 00166 argv[0]); 00167 exit(1); 00168 } 00169 00170 RtlInitAnsiString( 00171 &temp, 00172 argv[1] 00173 ); 00174 00175 RtlAnsiStringToUnicodeString( 00176 &KeyPath, 00177 &temp, 00178 TRUE 00179 ); 00180 00181 RtlInitAnsiString( 00182 &temp, 00183 argv[2] 00184 ); 00185 00186 RtlAnsiStringToUnicodeString( 00187 &DosFileName, 00188 &temp, 00189 TRUE 00190 ); 00191 00192 RtlDosPathNameToNtPathName_U( DosFileName.Buffer, 00193 &FileName, 00194 NULL, 00195 NULL ); 00196 00197 return; 00198 }

void processargs  ) 
 


Variable Documentation

UNICODE_STRING FileName
 

Definition at line 45 of file rtsave.c.

WCHAR FileNameBuffer[WORK_SIZE]
 

Definition at line 46 of file rtsave.c.

UNICODE_STRING KeyPath
 

Definition at line 42 of file rtsave.c.

WCHAR KeyPathBuffer[WORK_SIZE]
 

Definition at line 43 of file rtsave.c.


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