test: rtdmpb.c File Reference

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

# rtdmpb.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 16384

## Functions

void __cdecl | main (int, char *)
void | processargs ()
void | print (PUNICODE_STRING)
void | DumpValues (HANDLE Handle)
void | Dump (HANDLE Handle)
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 16384

| Definition at line 55 of file rtdmpb.c.

## Function Documentation

void Dump | ( | HANDLE | Handle | ) |

void DumpValues | ( | HANDLE | Handle | ) |

void __cdecl main | ( | int | argc,
|  | char * | argv[]
| ) |

Definition at line 76 of file rtdmpb.c.

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

    00080 {
    00081     NTSTATUS status;
    00082     OBJECT_ATTRIBUTES ObjectAttributes;
    00083     HANDLE          BaseHandle;
    00084
    00085     //
    00086     // Process args
    00087     //
    00088
    00089     WorkName.MaximumLength = WORK_SIZE;
    00090     WorkName.Length = 0L;
    00091     WorkName.Buffer = &(workbuffer[0]);
    00092
    00093     processargs(argc, argv);
    00094
    00095
    00096     //
    00097     // Set up and open KeyPath
    00098     //
    00099
    00100     printf("rtdmp: starting\n");
    00101
    00102     InitializeObjectAttributes(
    00103         &ObjectAttributes,
    00104         &WorkName,
    00105         0,
    00106         (HANDLE)NULL,
    00107         NULL
    00108         );
    00109     ObjectAttributes.Attributes |= OBJ_CASE_INSENSITIVE;
    00110
    00111     status = NtOpenKey(
    00112                 &BaseHandle,
    00113                 MAXIMUM_ALLOWED,
    00114                 &ObjectAttributes
    00115                 );
    00116     if (!NT_SUCCESS(status)) {
    00117         printf("rtdmp: t0: %08lx\n", status);
    00118         exit(1);
    00119     }
    00120
    00121     Dump(BaseHandle);
    00122 }

void __cdecl main | ( | int | ,
|  | char * |
| ) |

void print | ( | PUNICODE_STRING |  | ) |

void processargs | ( | int | argc,
|  | char * | argv[]
| ) |

Definition at line 305 of file rtdmpb.c.

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

    00309 {
    00310     ANSI_STRING temp;
    00311
    00312     if ( (argc != 2) )
    00313     {
    00314         printf("Usage: %s <KeyPath>\n",
    00315                 argv[0]);
    00316         exit(1);
    00317     }
    00318
    00319     RtlInitAnsiString(
    00320         &temp,
    00321         argv[1]
    00322         );
    00323
    00324     RtlAnsiStringToUnicodeString(
    00325         &WorkName,
    00326         &temp,
    00327         FALSE
    00328         );
    00329
    00330     return;
    00331 }

void processargs | ( |  | ) |

## Variable Documentation

WCHAR workbuffer[WORK_SIZE]

| Definition at line 73 of file rtdmpb.c.

UNICODE_STRING WorkName

| Definition at line 72 of file rtdmpb.c.