/*
* Import the loaded system hive
*/
- RegImportBinaryHive((PCHAR)Base, Size);
+ if( !RegImportBinaryHive((PCHAR)Base, Size) )
+ {
+ printf("Could not load system hive\n");
+ return;
+ }
/*
* Initialize the 'CurrentControlSet' link
#undef DbgPrint
ULONG
-DbgPrint(char *Fmt, ...)
+__cdecl
+DbgPrint(PCCH Format, ...)
{
- UiMessageBox(Fmt);
- return 0;
+ va_list ap;
+ CHAR Buffer[512];
+ ULONG Length;
+
+ va_start(ap, Format);
+
+ /* Construct a string */
+ Length = _vsnprintf(Buffer, 512, Format, ap);
+
+ /* Check if we went past the buffer */
+ if (Length == -1)
+ {
+ /* Terminate it if we went over-board */
+ Buffer[sizeof(Buffer) - 1] = '\n';
+
+ /* Put maximum */
+ Length = sizeof(Buffer);
+ }
+
+ /* Show it as a message box */
+ UiMessageBox(Buffer);
+
+ /* Cleanup and exit */
+ va_end(ap);
+ return 0;
}
/* EOF */