Kill warnings.\n Use DbgPrint for debugging registry.

svn path=/trunk/; revision=3046
This commit is contained in:
Casper Hornstrup 2002-06-11 16:23:20 +00:00
parent 8bab1a8f2d
commit 65ae3074e9
12 changed files with 142 additions and 120 deletions

View file

@ -136,7 +136,7 @@ EXTERN(_GetConventionalMemorySize)
/* /*
* ULONG GetBiosMemoryMap(BIOS_MEMORY_MAP BiosMemoryMap[32]); * ULONG GetBiosMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap);
*/ */
_gbmm_mem_map_length: _gbmm_mem_map_length:
.long 0 .long 0

View file

@ -24,12 +24,33 @@
#ifdef DEBUG #ifdef DEBUG
//ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | DPRINT_FILESYSTEM | //#define DEBUG_ULTRA
// DPRINT_UI | DPRINT_DISK | DPRINT_CACHE | DPRINT_REACTOS | //#define DEBUG_INIFILE
// DPRINT_LINUX; //#define DEBUG_REACTOS
ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_UI | DPRINT_MEMORY | //#define DEBUG_CUSTOM
/*DPRINT_CACHE |*/ DPRINT_LINUX; #define DEBUG_NONE
//ULONG DebugPrintMask = DPRINT_INIFILE;
#ifdef DEBUG_ULTRA
ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | DPRINT_FILESYSTEM |
DPRINT_UI | DPRINT_DISK | DPRINT_CACHE | DPRINT_REACTOS |
DPRINT_LINUX;
#endif
#ifdef DEBUG_INIFILE
ULONG DebugPrintMask = DPRINT_INIFILE;
#endif
#ifdef DEBUG_REACTOS
ULONG DebugPrintMask = DPRINT_REACTOS | DPRINT_REGISTRY;
#endif
#ifdef DEBUG_CUSTOM
ULONG DebugPrintMask = 0;
#endif
#ifdef DEBUG_NONE
ULONG DebugPrintMask = 0;
#endif
#define SCREEN 0 #define SCREEN 0
#define RS232 1 #define RS232 1
@ -86,6 +107,10 @@ VOID DebugPrintChar(UCHAR Character)
VOID DebugPrintHeader(ULONG Mask) VOID DebugPrintHeader(ULONG Mask)
{ {
/* No header */
if (Mask == 0)
return;
switch (Mask) switch (Mask)
{ {
case DPRINT_WARNING: case DPRINT_WARNING:
@ -154,6 +179,18 @@ VOID DebugPrintHeader(ULONG Mask)
DebugPrintChar(':'); DebugPrintChar(':');
DebugPrintChar(' '); DebugPrintChar(' ');
break; break;
case DPRINT_REGISTRY:
DebugPrintChar('R');
DebugPrintChar('E');
DebugPrintChar('G');
DebugPrintChar('I');
DebugPrintChar('S');
DebugPrintChar('T');
DebugPrintChar('R');
DebugPrintChar('Y');
DebugPrintChar(':');
DebugPrintChar(' ');
break;
case DPRINT_REACTOS: case DPRINT_REACTOS:
DebugPrintChar('R'); DebugPrintChar('R');
DebugPrintChar('E'); DebugPrintChar('E');

View file

@ -34,7 +34,7 @@ VOID DiskError(PUCHAR ErrorString)
{ {
UCHAR ErrorCodeString[80]; UCHAR ErrorCodeString[80];
sprintf(ErrorCodeString, "%s\nError Code: 0x%x", ErrorString, BiosInt13GetLastErrorCode()); sprintf(ErrorCodeString, "%s\nError Code: 0x%lx", ErrorString, BiosInt13GetLastErrorCode());
DbgPrint((DPRINT_DISK, "%s\n", ErrorCodeString)); DbgPrint((DPRINT_DISK, "%s\n", ErrorCodeString));

View file

@ -23,22 +23,24 @@
#ifdef DEBUG #ifdef DEBUG
#define DPRINT_WARNING 0x00000001 // OR this with DebugPrintMask to enable debugger messages and other misc stuff #define DPRINT_NONE 0x00000000 // Simple debug print
#define DPRINT_MEMORY 0x00000002 // OR this with DebugPrintMask to enable memory management messages #define DPRINT_WARNING 0x00000001 // OR this with DebugPrintMask to enable debugger messages and other misc stuff
#define DPRINT_FILESYSTEM 0x00000004 // OR this with DebugPrintMask to enable file system messages #define DPRINT_MEMORY 0x00000002 // OR this with DebugPrintMask to enable memory management messages
#define DPRINT_INIFILE 0x00000008 // OR this with DebugPrintMask to enable .ini file messages #define DPRINT_FILESYSTEM 0x00000004 // OR this with DebugPrintMask to enable file system messages
#define DPRINT_UI 0x00000010 // OR this with DebugPrintMask to enable user interface messages #define DPRINT_INIFILE 0x00000008 // OR this with DebugPrintMask to enable .ini file messages
#define DPRINT_DISK 0x00000020 // OR this with DebugPrintMask to enable disk messages #define DPRINT_UI 0x00000010 // OR this with DebugPrintMask to enable user interface messages
#define DPRINT_CACHE 0x00000040 // OR this with DebugPrintMask to enable cache messages #define DPRINT_DISK 0x00000020 // OR this with DebugPrintMask to enable disk messages
#define DPRINT_REACTOS 0x00000080 // OR this with DebugPrintMask to enable ReactOS messages #define DPRINT_CACHE 0x00000040 // OR this with DebugPrintMask to enable cache messages
#define DPRINT_LINUX 0x00000100 // OR this with DebugPrintMask to enable Linux messages #define DPRINT_REGISTRY 0x00000080 // OR this with DebugPrintMask to enable registry messages
#define DPRINT_REACTOS 0x00000100 // OR this with DebugPrintMask to enable ReactOS messages
#define DPRINT_LINUX 0x00000200 // OR this with DebugPrintMask to enable Linux messages
VOID DebugInit(VOID); VOID DebugInit(VOID);
VOID DebugPrint(ULONG Mask, char *format, ...); VOID DebugPrint(ULONG Mask, char *format, ...);
VOID DebugDumpBuffer(ULONG Mask, PVOID Buffer, ULONG Length); VOID DebugDumpBuffer(ULONG Mask, PVOID Buffer, ULONG Length);
#define DbgPrint(_x_) DebugPrint _x_ #define DbgPrint(_x_) { DebugPrint(DPRINT_NONE, "%s:%d(%s)\n", __FILE__, __LINE__, __FUNCTION__); DebugPrint _x_ ; }
#define BugCheck(_x_) { DebugPrint(DPRINT_WARNING, "Fatal Error: %s:%d\n", __FILE__, __LINE__); DebugPrint _x_ ; for (;;); } #define BugCheck(_x_) { DebugPrint(DPRINT_WARNING, "Fatal Error: %s:%d(%s)\n", __FILE__, __LINE__, __FUNCTION__); DebugPrint _x_ ; for (;;); }
#define DbgDumpBuffer(_x_, _y_, _z_) DebugDumpBuffer(_x_, _y_, _z_) #define DbgDumpBuffer(_x_, _y_, _z_) DebugDumpBuffer(_x_, _y_, _z_)
#else #else
@ -49,4 +51,6 @@
#endif // defined DEBUG #endif // defined DEBUG
#define UNIMPLEMENTED BugCheck((DPRINT_WARNING, "Unimplemented\n"));
#endif // defined __DEBUG_H #endif // defined __DEBUG_H

View file

@ -43,7 +43,7 @@ ULONG GetSystemMemorySize(VOID); // Returns the amount of total memory in
// These functions are implemented in mem.S // These functions are implemented in mem.S
ULONG GetExtendedMemorySize(VOID); // Returns extended memory size in KB ULONG GetExtendedMemorySize(VOID); // Returns extended memory size in KB
ULONG GetConventionalMemorySize(VOID); // Returns conventional memory size in KB ULONG GetConventionalMemorySize(VOID); // Returns conventional memory size in KB
ULONG GetBiosMemoryMap(BIOS_MEMORY_MAP BiosMemoryMap[32]); // Fills mem_map structure with BIOS memory map and returns length of memory map ULONG GetBiosMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap); // Fills mem_map structure with BIOS memory map and returns length of memory map

View file

@ -123,7 +123,7 @@ BOOL IniParseFile(PUCHAR IniFileData, ULONG IniFileSize)
// First check to make sure we're inside a [section] // First check to make sure we're inside a [section]
if (CurrentSection == NULL) if (CurrentSection == NULL)
{ {
printf("Error: freeldr.ini:%d: Setting \'%s\' found outside of a [section].\n", CurrentLineNumber, IniFileLine); printf("Error: freeldr.ini:%ld: Setting '%s' found outside of a [section].\n", CurrentLineNumber, IniFileLine);
CurrentLineNumber++; CurrentLineNumber++;
continue; continue;
} }

View file

@ -61,7 +61,7 @@ BOOL MmInitializeMemoryManager(VOID)
RtlZeroMemory(BiosMemoryMap, sizeof(BIOS_MEMORY_MAP) * 32); RtlZeroMemory(BiosMemoryMap, sizeof(BIOS_MEMORY_MAP) * 32);
BiosMemoryMapEntryCount = GetBiosMemoryMap(BiosMemoryMap); BiosMemoryMapEntryCount = GetBiosMemoryMap((PBIOS_MEMORY_MAP)&BiosMemoryMap);
ExtendedMemorySize = GetExtendedMemorySize(); ExtendedMemorySize = GetExtendedMemorySize();
ConventionalMemorySize = GetConventionalMemorySize(); ConventionalMemorySize = GetConventionalMemorySize();

View file

@ -391,7 +391,7 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName)
mb_info.cmdline = (unsigned long)multiboot_kernel_cmdline; mb_info.cmdline = (unsigned long)multiboot_kernel_cmdline;
mb_info.mods_count = 0; mb_info.mods_count = 0;
mb_info.mods_addr = (unsigned long)multiboot_modules; mb_info.mods_addr = (unsigned long)multiboot_modules;
mb_info.mmap_length = GetBiosMemoryMap(&multiboot_memory_map); mb_info.mmap_length = (unsigned long)GetBiosMemoryMap((PBIOS_MEMORY_MAP)&multiboot_memory_map);
if (mb_info.mmap_length) if (mb_info.mmap_length)
{ {
mb_info.mmap_addr = (unsigned long)&multiboot_memory_map; mb_info.mmap_addr = (unsigned long)&multiboot_memory_map;

View file

@ -22,17 +22,13 @@
#include <freeldr.h> #include <freeldr.h>
#include <rtl.h> #include <rtl.h>
#include <mm.h> #include <mm.h>
#include <debug.h>
#include "registry.h" #include "registry.h"
#define NDEBUG
#define REGISTRY_FILE_MAGIC "REGEDIT4" #define REGISTRY_FILE_MAGIC "REGEDIT4"
#define INVALID_HANDLE_VALUE NULL
static PCHAR static PCHAR
checkAndSkipMagic (PCHAR regChunk) checkAndSkipMagic (PCHAR regChunk)
{ {
@ -40,20 +36,16 @@ checkAndSkipMagic (PCHAR regChunk)
REGISTRY_FILE_MAGIC, REGISTRY_FILE_MAGIC,
strlen (REGISTRY_FILE_MAGIC)) != 0) strlen (REGISTRY_FILE_MAGIC)) != 0)
{ {
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "Incorrect magic number in registry chunk. Expected: '%s' Got: '%.*s'\n",
printf("incorrect magic number in registry chunk. expected: %s got:%.*s\n", REGISTRY_FILE_MAGIC, strlen(REGISTRY_FILE_MAGIC), regChunk));
REGISTRY_FILE_MAGIC,
strlen (REGISTRY_FILE_MAGIC),
regChunk);
#endif
return 0; return 0;
} }
regChunk += strlen (REGISTRY_FILE_MAGIC); regChunk += strlen (REGISTRY_FILE_MAGIC);
#ifndef NDEBUG
printf("Found registry chunk magic value\n");
#endif
return regChunk; DbgPrint((DPRINT_REGISTRY, "Found registry chunk magic value\n"));
return regChunk;
} }
static PCHAR static PCHAR
@ -128,17 +120,13 @@ createNewKey (PCHAR newKeyName)
{ {
HKEY handleToReturn = NULL; HKEY handleToReturn = NULL;
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "Adding new key '%s'\n", newKeyName));
printf("Adding new key '%s'\n", newKeyName);
#endif
RegCreateKey(NULL, RegCreateKey(NULL,
newKeyName, newKeyName,
&handleToReturn); &handleToReturn);
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "Returned handle: 0x%x\n", handleToReturn));
printf(" returned handle: 0x%x\n", handleToReturn);
#endif
return handleToReturn; return handleToReturn;
} }
@ -360,12 +348,9 @@ setKeyValue (HKEY currentKey,
{ {
LONG status; LONG status;
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "Adding value (%s) to current key, with data type %d and size %d\n",
printf("Adding value (%s) to current key, with data type %d size %d\n", newValueName, (int)keyValueType, (int)dataSize));
newValueName,
(int)keyValueType,
(int)dataSize);
#endif
status = RegSetValue(currentKey, status = RegSetValue(currentKey,
newValueName, newValueName,
keyValueType, keyValueType,
@ -373,9 +358,7 @@ setKeyValue (HKEY currentKey,
dataSize); dataSize);
if (status != ERROR_SUCCESS) if (status != ERROR_SUCCESS)
{ {
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "Could not set key value. status: %d\n", status));
printf("could not set key value, rc:%d\n", status);
#endif
return FALSE; return FALSE;
} }
@ -397,9 +380,7 @@ RegImportHive(PCHAR ChunkBase,
PVOID data = 0; PVOID data = 0;
PCHAR regChunk; PCHAR regChunk;
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "ChunkBase 0x%x ChunkSize %d\n", ChunkBase, ChunkSize));
printf("ChunkBase 0x%x ChunkSize %x\n", ChunkBase, ChunkSize);
#endif
regChunk = checkAndSkipMagic (ChunkBase); regChunk = checkAndSkipMagic (ChunkBase);
if (regChunk == 0) if (regChunk == 0)
@ -413,14 +394,12 @@ RegImportHive(PCHAR ChunkBase,
if (*regChunk == '[') if (*regChunk == '[')
{ {
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "Line: %s\n", regChunk));
printf("Line: %s\n", regChunk);
#endif
if (currentKey != NULL) if (currentKey != NULL)
{ {
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "Closing current key: 0x%lx\n", currentKey));
printf("Closing current key: 0x%lx\n", currentKey);
#endif
currentKey = NULL; currentKey = NULL;
} }
@ -507,9 +486,7 @@ RegImportHive(PCHAR ChunkBase,
return; return;
} }
#if 0
static PCHAR static PCHAR
bprintf(char *buffer, char *format, ... ) bprintf(char *buffer, char *format, ... )
{ {
@ -559,7 +536,7 @@ bprintf(char *buffer, char *format, ... )
} }
return(p); return(p);
} }
#endif
BOOL BOOL
RegExportHive(PCHAR ChunkBase, PULONG ChunkSize) RegExportHive(PCHAR ChunkBase, PULONG ChunkSize)

View file

@ -28,11 +28,9 @@
#include <freeldr.h> #include <freeldr.h>
#include <mm.h> #include <mm.h>
#include <rtl.h> #include <rtl.h>
#include <debug.h>
#include "registry.h" #include "registry.h"
#define NDEBUG
static HKEY RootKey; static HKEY RootKey;
@ -61,7 +59,7 @@ RegCreateKey(HKEY ParentKey,
PHKEY Key) PHKEY Key)
{ {
PLIST_ENTRY Ptr; PLIST_ENTRY Ptr;
HKEY SearchKey; HKEY SearchKey = INVALID_HANDLE_VALUE;
HKEY CurrentKey; HKEY CurrentKey;
HKEY NewKey; HKEY NewKey;
PCHAR p; PCHAR p;
@ -69,9 +67,7 @@ RegCreateKey(HKEY ParentKey,
int subkeyLength; int subkeyLength;
int stringLength; int stringLength;
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "KeyName '%s'\n", KeyName));
printf("RegCreateKey(%s) called\n", KeyName);
#endif
if (*KeyName == '\\') if (*KeyName == '\\')
{ {
@ -90,9 +86,8 @@ RegCreateKey(HKEY ParentKey,
while (*KeyName != 0) while (*KeyName != 0)
{ {
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "KeyName '%s'\n", KeyName));
printf("RegCreateKey(): KeyName '%s'\n", KeyName);
#endif
if (*KeyName == '\\') if (*KeyName == '\\')
KeyName++; KeyName++;
p = strchr(KeyName, '\\'); p = strchr(KeyName, '\\');
@ -112,16 +107,13 @@ RegCreateKey(HKEY ParentKey,
Ptr = CurrentKey->SubKeyList.Flink; Ptr = CurrentKey->SubKeyList.Flink;
while (Ptr != &CurrentKey->SubKeyList) while (Ptr != &CurrentKey->SubKeyList)
{ {
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "Ptr 0x%x\n", Ptr));
printf("RegCreateKey(): Ptr 0x%x\n", Ptr);
#endif
SearchKey = CONTAINING_RECORD(Ptr, SearchKey = CONTAINING_RECORD(Ptr,
KEY, KEY,
KeyList); KeyList);
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "SearchKey 0x%x\n", SearchKey));
printf("RegCreateKey(): SearchKey 0x%x\n", SearchKey); DbgPrint((DPRINT_REGISTRY, "Searching '%s'\n", SearchKey->Name));
printf("RegCreateKey(): searching '%s'\n", SearchKey->Name);
#endif
if (strncmp(SearchKey->Name, name, subkeyLength) == 0) if (strncmp(SearchKey->Name, name, subkeyLength) == 0)
break; break;
@ -150,10 +142,8 @@ RegCreateKey(HKEY ParentKey,
memcpy(NewKey->Name, name, subkeyLength); memcpy(NewKey->Name, name, subkeyLength);
NewKey->Name[subkeyLength] = 0; NewKey->Name[subkeyLength] = 0;
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "NewKey 0x%x\n", NewKey));
printf("RegCreateKey(): new key 0x%x\n", NewKey); DbgPrint((DPRINT_REGISTRY, "NewKey '%s' Length %d\n", NewKey->Name, NewKey->NameSize));
printf("RegCreateKey(): new key '%s' length %d\n", NewKey->Name, NewKey->NameSize);
#endif
CurrentKey = NewKey; CurrentKey = NewKey;
} }
@ -215,9 +205,7 @@ RegEnumKey(HKEY Key,
KEY, KEY,
KeyList); KeyList);
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "Name '%s' Length %d\n", SearchKey->Name, SearchKey->NameSize));
printf("RegEnumKey(): name '%s' length %d\n", SearchKey->Name, SearchKey->NameSize);
#endif
Size = min(SearchKey->NameSize, *NameSize); Size = min(SearchKey->NameSize, *NameSize);
*NameSize = Size; *NameSize = Size;
@ -233,16 +221,14 @@ RegOpenKey(HKEY ParentKey,
PHKEY Key) PHKEY Key)
{ {
PLIST_ENTRY Ptr; PLIST_ENTRY Ptr;
HKEY SearchKey; HKEY SearchKey = INVALID_HANDLE_VALUE;
HKEY CurrentKey; HKEY CurrentKey;
PCHAR p; PCHAR p;
PCHAR name; PCHAR name;
int subkeyLength; int subkeyLength;
int stringLength; int stringLength;
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "KeyName '%s'\n", KeyName));
printf("RegOpenKey(%s) called\n", KeyName);
#endif
*Key = NULL; *Key = NULL;
@ -263,9 +249,8 @@ RegOpenKey(HKEY ParentKey,
while (*KeyName != 0) while (*KeyName != 0)
{ {
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "KeyName '%s'\n", KeyName));
printf("RegOpenKey(): KeyName '%s'\n", KeyName);
#endif
if (*KeyName == '\\') if (*KeyName == '\\')
KeyName++; KeyName++;
p = strchr(KeyName, '\\'); p = strchr(KeyName, '\\');
@ -285,16 +270,15 @@ RegOpenKey(HKEY ParentKey,
Ptr = CurrentKey->SubKeyList.Flink; Ptr = CurrentKey->SubKeyList.Flink;
while (Ptr != &CurrentKey->SubKeyList) while (Ptr != &CurrentKey->SubKeyList)
{ {
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "Ptr 0x%x\n", Ptr));
printf("RegCreateKey(): Ptr 0x%x\n", Ptr);
#endif
SearchKey = CONTAINING_RECORD(Ptr, SearchKey = CONTAINING_RECORD(Ptr,
KEY, KEY,
KeyList); KeyList);
#ifndef NDEBUG
printf("RegOpenKey(): SearchKey 0x%x\n", SearchKey); DbgPrint((DPRINT_REGISTRY, "SearchKey 0x%x\n", SearchKey));
printf("RegOpenKey(): searching '%s'\n", SearchKey->Name); DbgPrint((DPRINT_REGISTRY, "Searching '%s'\n", SearchKey->Name));
#endif
if (strncmp(SearchKey->Name, name, subkeyLength) == 0) if (strncmp(SearchKey->Name, name, subkeyLength) == 0)
break; break;
@ -328,11 +312,11 @@ RegSetValue(HKEY Key,
ULONG DataSize) ULONG DataSize)
{ {
PLIST_ENTRY Ptr; PLIST_ENTRY Ptr;
PVALUE Value; PVALUE Value = NULL;
DbgPrint((DPRINT_REGISTRY, "Key 0x%x, ValueName '%s', Type %d, Data 0x%x, DataSize %d\n",
(int)Key, ValueName, (int)Type, (int)Data, (int)DataSize));
#ifndef NDEBUG
printf("RegSetValue(%x, '%s', %d, %x, %d)\n", (int)Key, ValueName, (int)Type, (int)Data, (int)DataSize);
#endif
if ((ValueName == NULL) || (*ValueName == 0)) if ((ValueName == NULL) || (*ValueName == 0))
{ {
/* set default value */ /* set default value */
@ -352,9 +336,9 @@ RegSetValue(HKEY Key,
Value = CONTAINING_RECORD(Ptr, Value = CONTAINING_RECORD(Ptr,
VALUE, VALUE,
ValueList); ValueList);
#ifndef NDEBUG
printf("Value->Name: '%s'\n", Value->Name); DbgPrint((DPRINT_REGISTRY, "Value->Name '%s'\n", Value->Name));
#endif
if (stricmp(Value->Name, ValueName) == 0) if (stricmp(Value->Name, ValueName) == 0)
break; break;
@ -364,9 +348,8 @@ RegSetValue(HKEY Key,
if (Ptr == &Key->ValueList) if (Ptr == &Key->ValueList)
{ {
/* add new value */ /* add new value */
#ifndef NDEBUG DbgPrint((DPRINT_REGISTRY, "No value found - adding new value\n"));
printf("No value found - adding new value\n");
#endif
Value = (PVALUE)MmAllocateMemory(sizeof(VALUE)); Value = (PVALUE)MmAllocateMemory(sizeof(VALUE));
if (Value == NULL) if (Value == NULL)
return(ERROR_OUTOFMEMORY); return(ERROR_OUTOFMEMORY);
@ -411,7 +394,7 @@ RegQueryValue(HKEY Key,
{ {
ULONG Size; ULONG Size;
PLIST_ENTRY Ptr; PLIST_ENTRY Ptr;
PVALUE Value; PVALUE Value = NULL;
if ((ValueName == NULL) || (*ValueName == 0)) if ((ValueName == NULL) || (*ValueName == 0))
{ {
@ -437,9 +420,9 @@ RegQueryValue(HKEY Key,
Value = CONTAINING_RECORD(Ptr, Value = CONTAINING_RECORD(Ptr,
VALUE, VALUE,
ValueList); ValueList);
#ifndef NDEBUG
printf("Name: %s\n", Value->Name); DbgPrint((DPRINT_REGISTRY, "Value name '%s'\n", Value->Name));
#endif
if (stricmp(Value->Name, ValueName) == 0) if (stricmp(Value->Name, ValueName) == 0)
break; break;
@ -477,7 +460,7 @@ RegDeleteValue(HKEY Key,
PCHAR ValueName) PCHAR ValueName)
{ {
PLIST_ENTRY Ptr; PLIST_ENTRY Ptr;
PVALUE Value; PVALUE Value = NULL;
if ((ValueName == NULL) || (*ValueName == 0)) if ((ValueName == NULL) || (*ValueName == 0))
{ {

View file

@ -21,6 +21,8 @@
#ifndef __REGISTRY_H #ifndef __REGISTRY_H
#define __REGISTRY_H #define __REGISTRY_H
#define INVALID_HANDLE_VALUE NULL
typedef struct _LIST_ENTRY typedef struct _LIST_ENTRY
{ {
struct _LIST_ENTRY *Flink; struct _LIST_ENTRY *Flink;

View file

@ -111,7 +111,7 @@ BOOL UiInitialize(VOID)
if (!VideoSetMode(VideoMode)) if (!VideoSetMode(VideoMode))
{ {
printf("Error: unable to set video display mode 0x%x\n", VideoMode); printf("Error: unable to set video display mode 0x%lx\n", VideoMode);
printf("Press any key to continue.\n"); printf("Press any key to continue.\n");
getch(); getch();
} }
@ -202,6 +202,7 @@ VOID UiDrawBackdrop(VOID)
} }
else else
{ {
UNIMPLEMENTED
//GuiDrawBackdrop(); //GuiDrawBackdrop();
} }
} }
@ -214,6 +215,7 @@ VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR FillChar
} }
else else
{ {
UNIMPLEMENTED
//GuiFillArea(Left, Top, Right, Bottom, FillChar, Attr); //GuiFillArea(Left, Top, Right, Bottom, FillChar, Attr);
} }
} }
@ -226,6 +228,7 @@ VOID UiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
} }
else else
{ {
UNIMPLEMENTED
//GuiDrawShadow(Left, Top, Right, Bottom); //GuiDrawShadow(Left, Top, Right, Bottom);
} }
} }
@ -238,6 +241,7 @@ VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle
} }
else else
{ {
UNIMPLEMENTED
//GuiDrawBox(Left, Top, Right, Bottom, VertStyle, HorzStyle, Fill, Shadow, Attr); //GuiDrawBox(Left, Top, Right, Bottom, VertStyle, HorzStyle, Fill, Shadow, Attr);
} }
} }
@ -250,6 +254,7 @@ VOID UiDrawText(ULONG X, ULONG Y, PUCHAR Text, UCHAR Attr)
} }
else else
{ {
UNIMPLEMENTED
//GuiDrawText(X, Y, Text, Attr); //GuiDrawText(X, Y, Text, Attr);
} }
} }
@ -262,6 +267,7 @@ VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PUCHAR
} }
else else
{ {
UNIMPLEMENTED
//GuiDrawCenteredText(Left, Top, Right, Bottom, TextString, Attr); //GuiDrawCenteredText(Left, Top, Right, Bottom, TextString, Attr);
} }
} }
@ -274,6 +280,7 @@ VOID UiDrawStatusText(PUCHAR StatusText)
} }
else else
{ {
UNIMPLEMENTED
//GuiDrawStatusText(StatusText); //GuiDrawStatusText(StatusText);
} }
} }
@ -286,6 +293,7 @@ VOID UiUpdateDateTime(VOID)
} }
else else
{ {
UNIMPLEMENTED
//TuiUpdateDateTime(); //TuiUpdateDateTime();
} }
} }
@ -313,6 +321,7 @@ VOID UiMessageBox(PUCHAR MessageText)
} }
else else
{ {
UNIMPLEMENTED
//GuiMessageBox(UiMessageBoxLineText); //GuiMessageBox(UiMessageBoxLineText);
} }
@ -339,6 +348,7 @@ VOID UiMessageBoxCritical(PUCHAR MessageText)
} }
else else
{ {
UNIMPLEMENTED
//GuiMessageBoxCritical(MessageText); //GuiMessageBoxCritical(MessageText);
} }
} }
@ -357,6 +367,8 @@ UCHAR UiTextToColor(PUCHAR ColorText)
} }
else else
{ {
UNIMPLEMENTED
return 0;
//return GuiTextToColor(ColorText); //return GuiTextToColor(ColorText);
} }
} }
@ -369,6 +381,8 @@ UCHAR UiTextToFillStyle(PUCHAR FillStyleText)
} }
else else
{ {
UNIMPLEMENTED
return 0;
//return GuiTextToFillStyle(FillStyleText); //return GuiTextToFillStyle(FillStyleText);
} }
} }
@ -381,6 +395,7 @@ VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range)
} }
else else
{ {
UNIMPLEMENTED
//GuiDrawProgressBarCenter(Position, Range); //GuiDrawProgressBarCenter(Position, Range);
} }
} }
@ -393,6 +408,7 @@ VOID UiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG P
} }
else else
{ {
UNIMPLEMENTED
//GuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range); //GuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range);
} }
} }
@ -441,6 +457,7 @@ VOID UiShowMessageBoxesInSection(PUCHAR SectionName)
VOID UiTruncateStringEllipsis(PUCHAR StringText, ULONG MaxChars) VOID UiTruncateStringEllipsis(PUCHAR StringText, ULONG MaxChars)
{ {
UNIMPLEMENTED
} }
BOOL UiDisplayMenu(PUCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, PULONG SelectedMenuItem) BOOL UiDisplayMenu(PUCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, PULONG SelectedMenuItem)
@ -451,6 +468,8 @@ BOOL UiDisplayMenu(PUCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenu
} }
else else
{ {
UNIMPLEMENTED
return FALSE;
//return GuiDisplayMenu(MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem); //return GuiDisplayMenu(MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem);
} }
} }