Commit in reactos/tools/mkhive on MAIN
binhive.c+33-211.12 -> 1.13
infcache.c+3-31.8 -> 1.9
mkhive.c+6-11.5 -> 1.6
mkhive.h+28-21.2 -> 1.3
reginf.c+3-31.7 -> 1.8
registry.c+3-31.10 -> 1.11
registry.h+4-41.2 -> 1.3
+80-37
7 modified files
msvc6 and gcc4 support

reactos/tools/mkhive
binhive.c 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- binhive.c	15 Nov 2004 19:20:23 -0000	1.12
+++ binhive.c	30 Dec 2004 16:02:12 -0000	1.13
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: binhive.c,v 1.12 2004/11/15 19:20:23 gdalsnes Exp $
+/* $Id: binhive.c,v 1.13 2004/12/30 16:02:12 royce Exp $
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS hive maker
  * FILE:            tools/mkhive/binhive.c
@@ -58,7 +58,15 @@
 // BLOCK_OFFSET = offset in file after header block
 typedef ULONG BLOCK_OFFSET, *PBLOCK_OFFSET;
 
+#ifdef _MSC_VER
+typedef unsigned __int64 FILETIME;
+#else
 typedef unsigned long long FILETIME;
+#endif
+
+#ifdef _MSC_VER
+#pragma pack ( push, hive_header, 1 )
+#endif//_MSC_VER
 
 /* header for registry hive file : */
 typedef struct _HIVE_HEADER
@@ -105,7 +113,7 @@
 
   /* Checksum of first 0x200 bytes */
   ULONG  Checksum;
-} __attribute__((packed)) HIVE_HEADER, *PHIVE_HEADER;
+} GCC_PACKED HIVE_HEADER, *PHIVE_HEADER;
 
 typedef struct _HBIN
 {
@@ -126,13 +134,13 @@
 
   /* ? */
   ULONG  Unused2;
-} __attribute__((packed)) HBIN, *PHBIN;
+} GCC_PACKED HBIN, *PHBIN;
 
 typedef struct _CELL_HEADER
 {
   /* <0 if used, >0 if free */
   LONG  CellSize;
-} __attribute__((packed)) CELL_HEADER, *PCELL_HEADER;
+} GCC_PACKED CELL_HEADER, *PCELL_HEADER;
 
 typedef struct _KEY_CELL
 {
@@ -189,7 +197,7 @@
 
   /* Name of key (not zero terminated) */
   UCHAR  Name[0];
-} __attribute__((packed)) KEY_CELL, *PKEY_CELL;
+} GCC_PACKED KEY_CELL, *PKEY_CELL;
 
 /* KEY_CELL.Type constants */
 #define  REG_LINK_KEY_CELL_TYPE        0x10
@@ -203,7 +211,7 @@
 {
   BLOCK_OFFSET  KeyOffset;
   ULONG  HashValue;
-} __attribute__((packed)) HASH_RECORD, *PHASH_RECORD;
+} GCC_PACKED HASH_RECORD, *PHASH_RECORD;
 
 typedef struct _HASH_TABLE_CELL
 {
@@ -211,13 +219,13 @@
   USHORT  Id;
   USHORT  HashTableSize;
   HASH_RECORD  Table[0];
-} __attribute__((packed)) HASH_TABLE_CELL, *PHASH_TABLE_CELL;
+} GCC_PACKED HASH_TABLE_CELL, *PHASH_TABLE_CELL;
 
 typedef struct _VALUE_LIST_CELL
 {
   LONG  CellSize;
   BLOCK_OFFSET  ValueOffset[0];
-} __attribute__((packed)) VALUE_LIST_CELL, *PVALUE_LIST_CELL;
+} GCC_PACKED VALUE_LIST_CELL, *PVALUE_LIST_CELL;
 
 typedef struct _VALUE_CELL
 {
@@ -230,7 +238,7 @@
   USHORT  Flags;
   USHORT  Unused1;
   UCHAR  Name[0]; /* warning : not zero terminated */
-} __attribute__((packed)) VALUE_CELL, *PVALUE_CELL;
+} GCC_PACKED VALUE_CELL, *PVALUE_CELL;
 
 /* VALUE_CELL.Flags constants */
 #define REG_VALUE_NAME_PACKED             0x0001
@@ -243,7 +251,11 @@
 {
   LONG  CellSize;
   UCHAR  Data[0];
-} __attribute__((packed)) DATA_CELL, *PDATA_CELL;
+} GCC_PACKED DATA_CELL, *PDATA_CELL;
+
+#ifdef _MSC_VER
+#pragma pack ( pop, hive_header )
+#endif//_MSC_VER
 
 typedef struct _REGISTRY_HIVE
 {
@@ -279,7 +291,7 @@
   Header->BlockId = REG_HIVE_ID;
   Header->UpdateCounter1 = 0;
   Header->UpdateCounter2 = 0;
-  Header->DateModified = 0ULL;
+  Header->DateModified = 0;
   Header->Unused3 = 1;
   Header->Unused4 = 3;
   Header->Unused5 = 0;
@@ -298,7 +310,7 @@
   assert (BinCell);
   memset (BinCell, 0, REG_BLOCK_SIZE);
   BinCell->HeaderId = REG_BIN_ID;
-  BinCell->DateModified = 0ULL;
+  BinCell->DateModified = 0;
   BinCell->BinSize = REG_BLOCK_SIZE;
 }
 
@@ -307,7 +319,7 @@
 CmiCreateDefaultRootKeyCell(PKEY_CELL RootKeyCell, PCHAR KeyName)
 {
   PCHAR BaseKeyName;
-  ULONG NameSize;
+  USHORT NameSize;
   ULONG CellSize;
 
   assert (RootKeyCell);
@@ -317,10 +329,10 @@
   CellSize = ROUND_UP(sizeof(KEY_CELL) + NameSize - 1, 16);
 
   memset (RootKeyCell, 0, CellSize);
-  RootKeyCell->CellSize = -CellSize;
+  RootKeyCell->CellSize = (ULONG)-(LONG)CellSize;
   RootKeyCell->Id = REG_KEY_CELL_ID;
   RootKeyCell->Type = REG_ROOT_KEY_CELL_TYPE;
-  RootKeyCell->LastWriteTime = 0ULL;
+  RootKeyCell->LastWriteTime = 0;
   RootKeyCell->ParentKeyOffset = 0;
   RootKeyCell->NumberOfSubKeys = 0;
   RootKeyCell->HashTableOffset = -1;
@@ -725,7 +737,7 @@
   RegistryHive->FileSize += BinSize;
   tmpBin->BinSize = BinSize;
   tmpBin->Unused1 = 0;
-  tmpBin->DateModified = 0ULL;
+  tmpBin->DateModified = 0;
   tmpBin->Unused2 = 0;
 
   /* Increase size of list of blocks */
@@ -840,7 +852,7 @@
 static BOOL
 CmiAllocateHashTableCell (PREGISTRY_HIVE Hive,
 			  PBLOCK_OFFSET HBOffset,
-			  ULONG SubKeyCount)
+			  USHORT SubKeyCount)
 {
   PHASH_TABLE_CELL HashCell;
   ULONG NewHashSize;
@@ -941,7 +953,7 @@
 		     PCHAR ValueName)
 {
   PVALUE_CELL NewValueCell;
-  ULONG NameSize;
+  USHORT NameSize;
   BOOL Status;
 
   NameSize = (ValueName == NULL) ? 0 : strlen (ValueName);
@@ -1123,7 +1135,7 @@
   BLOCK_OFFSET NKBOffset;
   PKEY_CELL NewKeyCell;
   ULONG KeyCellSize;
-  ULONG SubKeyCount;
+  USHORT SubKeyCount;
   ULONG ValueCount;
   PLIST_ENTRY Entry;
   HKEY SubKey;
@@ -1146,7 +1158,7 @@
   /* Initialize key cell */
   NewKeyCell->Id = REG_KEY_CELL_ID;
   NewKeyCell->Type = REG_KEY_CELL_TYPE;
-  NewKeyCell->LastWriteTime = 0ULL;
+  NewKeyCell->LastWriteTime = 0;
   NewKeyCell->ParentKeyOffset = ParentKeyOffset;
   NewKeyCell->NumberOfSubKeys = 0;
   NewKeyCell->HashTableOffset = -1;
@@ -1249,7 +1261,7 @@
 {
   PKEY_CELL KeyCell;
   HKEY Key;
-  ULONG SubKeyCount;
+  USHORT SubKeyCount;
   ULONG ValueCount;
   PLIST_ENTRY Entry;
   HKEY SubKey;

reactos/tools/mkhive
infcache.c 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- infcache.c	14 Nov 2003 17:13:36 -0000	1.8
+++ infcache.c	30 Dec 2004 16:02:12 -0000	1.9
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: infcache.c,v 1.8 2003/11/14 17:13:36 weiden Exp $
+/* $Id: infcache.c,v 1.9 2004/12/30 16:02:12 royce Exp $
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS hive maker
  * FILE:            tools/mkhive/infcache.c
@@ -57,7 +57,7 @@
   struct _INFCACHELINE *Next;
   struct _INFCACHELINE *Prev;
 
-  LONG FieldCount;
+  ULONG FieldCount;
 
   PCHAR Key;
 
@@ -437,7 +437,7 @@
 /* push data from current token start up to pos into the current token */
 static int push_token( struct parser *parser, const CHAR *pos )
 {
-  int len = pos - parser->start;
+  ULONG len = pos - parser->start;
   const CHAR *src = parser->start;
   CHAR *dst = parser->token + parser->token_len;
 

reactos/tools/mkhive
mkhive.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- mkhive.c	15 Nov 2004 19:20:23 -0000	1.5
+++ mkhive.c	30 Dec 2004 16:02:12 -0000	1.6
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: mkhive.c,v 1.5 2004/11/15 19:20:23 gdalsnes Exp $
+/* $Id: mkhive.c,v 1.6 2004/12/30 16:02:12 royce Exp $
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS hive maker
  * FILE:            tools/mkhive/mkhive.c
@@ -33,6 +33,11 @@
 #include "reginf.h"
 #include "binhive.h"
 
+#ifdef _MSC_VER
+#include <stdlib.h>
+#define PATH_MAX _MAX_PATH
+#endif//_MSC_VER
+
 #ifndef WIN32
 #ifndef PATH_MAX
 #define PATH_MAX 260

reactos/tools/mkhive
mkhive.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- mkhive.h	16 Apr 2003 15:06:33 -0000	1.2
+++ mkhive.h	30 Dec 2004 16:02:12 -0000	1.3
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: mkhive.h,v 1.2 2003/04/16 15:06:33 ekohl Exp $
+/* $Id: mkhive.h,v 1.3 2004/12/30 16:02:12 royce Exp $
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS hive maker
  * FILE:            tools/mkhive/mkhive.h
@@ -65,12 +65,38 @@
 
 /* Debugging macros */
 
+#ifdef _MSC_VER
+#include <stdio.h>
+#include <stdarg.h>
+static void DPRINT1(const char* fmt, ... )
+{
+	va_list args;
+	va_start ( args, fmt );
+	vprintf ( fmt, args );
+	va_end ( args );
+}
+static void DPRINT ( const char* fmt, ... )
+{
+}
+#else
 #define DPRINT1(args...) do { printf("(%s:%d) ",__FILE__,__LINE__); printf(args); } while(0);
+#define DPRINT(args...)
+#endif//_MSC_VER
 #define CHECKPOINT1 do { printf("%s:%d\n",__FILE__,__LINE__); } while(0);
 
-#define DPRINT(args...)
 #define CHECKPOINT
 
+#ifdef WIN32
+#define strncasecmp strnicmp
+#define strcasecmp stricmp
+#endif//WIN32
+
+#ifdef _MSC_VER
+#define GCC_PACKED
+#define inline
+#else//_MSC_VER
+#define GCC_PACKED __attribute__((packed))
+#endif//_MSC_VER
 
 #endif /* __MKHIVE_H__ */
 

reactos/tools/mkhive
reginf.c 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- reginf.c	4 Jun 2004 23:47:04 -0000	1.7
+++ reginf.c	30 Dec 2004 16:02:12 -0000	1.8
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: reginf.c,v 1.7 2004/06/04 23:47:04 navaraf Exp $
+/* $Id: reginf.c,v 1.8 2004/12/30 16:02:12 royce Exp $
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS hive maker
  * FILE:            tools/mkhive/reginf.h
@@ -298,7 +298,7 @@
 	{
 	  ULONG dw = Str ? strtoul (Str, NULL, 0) : 0;
 
-	  DPRINT("setting dword %s to %lx\n", ValueName, dw);
+	  DPRINT1("setting dword %s to %lx\n", ValueName, dw);
 
 	  RegSetValue (KeyHandle,
 		       ValueName,
@@ -308,7 +308,7 @@
 	}
       else
 	{
-	  DPRINT ("setting value %s to %s\n", ValueName, Str);
+	  DPRINT1 ("setting value %s to %s\n", ValueName, Str);
 
 	  if (Str)
 	    {

reactos/tools/mkhive
registry.c 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- registry.c	4 Jun 2004 23:47:04 -0000	1.10
+++ registry.c	30 Dec 2004 16:02:12 -0000	1.11
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: registry.c,v 1.10 2004/06/04 23:47:04 navaraf Exp $
+/* $Id: registry.c,v 1.11 2004/12/30 16:02:12 royce Exp $
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS hive maker
  * FILE:            tools/mkhive/registry.c
@@ -126,7 +126,7 @@
   int subkeyLength;
   int stringLength;
 
-  DPRINT ("KeyName '%s'\n", KeyName);
+  DPRINT ("RegCreateKey('%s')\n", KeyName);
 
   if (*KeyName == '\\')
     {
@@ -687,7 +687,7 @@
 }
 
 
-ULONG
+USHORT
 RegGetSubKeyCount (HKEY Key)
 {
   return Key->SubKeyCount;

reactos/tools/mkhive
registry.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- registry.h	16 Apr 2003 15:06:33 -0000	1.2
+++ registry.h	30 Dec 2004 16:02:12 -0000	1.3
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: registry.h,v 1.2 2003/04/16 15:06:33 ekohl Exp $
+/* $Id: registry.h,v 1.3 2004/12/30 16:02:12 royce Exp $
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS hive maker
  * FILE:            tools/mkhive/registry.h
@@ -43,10 +43,10 @@
   LIST_ENTRY SubKeyList;
   LIST_ENTRY ValueList;
 
-  ULONG SubKeyCount;
+  USHORT SubKeyCount;
   ULONG ValueCount;
 
-  ULONG NameSize;
+  USHORT NameSize;
   PUCHAR Name;
 
   /* default data */
@@ -283,7 +283,7 @@
 	     PUCHAR Data,
 	     PULONG DataSize);
 
-ULONG
+USHORT
 RegGetSubKeyCount (HKEY Key);
 
 ULONG
CVSspam 0.2.8