|
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
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 }
|