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

rtflush.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]


Define Documentation

#define WORK_SIZE   1024
 

Definition at line 36 of file rtflush.c.


Function Documentation

void __cdecl main int  argc,
char *  argv[]
 

Definition at line 45 of file rtflush.c.

References exit, L, NT_SUCCESS, NtClose(), NtFlushKey(), NtOpenKey(), NTSTATUS(), NULL, ObjectAttributes, processargs(), WORK_SIZE, workbuffer, and WorkName.

00049 { 00050 NTSTATUS status; 00051 OBJECT_ATTRIBUTES ObjectAttributes; 00052 HANDLE BaseHandle; 00053 00054 // 00055 // Process args 00056 // 00057 00058 WorkName.MaximumLength = WORK_SIZE; 00059 WorkName.Length = 0L; 00060 WorkName.Buffer = &(workbuffer[0]); 00061 00062 processargs(argc, argv); 00063 00064 00065 // 00066 // Set up and open KeyPath 00067 // 00068 00069 printf("rtflush: starting\n"); 00070 00071 InitializeObjectAttributes( 00072 &ObjectAttributes, 00073 &WorkName, 00074 0, 00075 (HANDLE)NULL, 00076 NULL 00077 ); 00078 ObjectAttributes.Attributes |= OBJ_CASE_INSENSITIVE; 00079 00080 status = NtOpenKey( 00081 &BaseHandle, 00082 MAXIMUM_ALLOWED, 00083 &ObjectAttributes 00084 ); 00085 if (!NT_SUCCESS(status)) { 00086 printf("rtflush: t0: %08lx\n", status); 00087 exit(1); 00088 } 00089 00090 status = NtFlushKey(BaseHandle); 00091 if (!NT_SUCCESS(status)) { 00092 printf("rtflush: t0: %08lx\n", status); 00093 exit(1); 00094 } 00095 00096 NtClose(BaseHandle); 00097 exit(0); 00098 }

void __cdecl main int  ,
char * 
 

void processargs int  argc,
char *  argv[]
 

Definition at line 102 of file rtflush.c.

References exit, FALSE, RtlAnsiStringToUnicodeString(), RtlInitAnsiString(), and WorkName.

00106 { 00107 ANSI_STRING temp; 00108 00109 if ( (argc != 2) ) 00110 { 00111 printf("Usage: %s <KeyPath>\n", 00112 argv[0]); 00113 exit(1); 00114 } 00115 00116 RtlInitAnsiString( 00117 &temp, 00118 argv[1] 00119 ); 00120 00121 RtlAnsiStringToUnicodeString( 00122 &WorkName, 00123 &temp, 00124 FALSE 00125 ); 00126 00127 return; 00128 }

void processargs  ) 
 


Variable Documentation

WCHAR workbuffer[WORK_SIZE]
 

Definition at line 42 of file rtflush.c.

UNICODE_STRING WorkName
 

Definition at line 41 of file rtflush.c.


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