00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
#include "cmp.h"
00032
#include <stdio.h>
00033
#include <stdlib.h>
00034
#include <string.h>
00035
00036 #define WORK_SIZE 1024
00037
00038
void __cdecl
main(
int,
char *);
00039
void processargs();
00040
00041 UNICODE_STRING
WorkName;
00042 WCHAR
workbuffer[
WORK_SIZE];
00043
00044
void
00045 __cdecl
main(
00046
int argc,
00047
char *argv[]
00048 )
00049 {
00050
NTSTATUS status;
00051 OBJECT_ATTRIBUTES
ObjectAttributes;
00052 HANDLE BaseHandle;
00053
00054
00055
00056
00057
00058
WorkName.MaximumLength =
WORK_SIZE;
00059
WorkName.Length = 0
L;
00060
WorkName.Buffer = &(
workbuffer[0]);
00061
00062
processargs(argc, argv);
00063
00064
00065
00066
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 }
00099
00100
00101
void
00102 processargs(
00103
int argc,
00104
char *argv[]
00105 )
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 }