Author: cfinck
Date: Sat Aug 18 14:27:23 2007
New Revision: 28392
URL:
http://svn.reactos.org/svn/reactos?rev=28392&view=rev
Log:
Fix the mkhive bug on 64-bit systems, this time correct.
See issue #2272 for more details.
Added:
trunk/reactos/include/reactos/typedefs64.h
- copied unchanged from r28390, trunk/reactos/include/reactos/typedefs64.h
Modified:
trunk/reactos/include/psdk/basetsd.h
trunk/reactos/include/psdk/basetyps.h
trunk/reactos/include/psdk/winnt.h
trunk/reactos/lib/cmlib/cmlib.h
trunk/reactos/lib/cmlib/cmlib.mak
trunk/reactos/lib/inflib/builddep.h (contents, props changed)
trunk/reactos/lib/inflib/infhost.h (contents, props changed)
trunk/reactos/lib/inflib/infhostgen.c
trunk/reactos/lib/inflib/infhostget.c
trunk/reactos/lib/inflib/infhostglue.c (contents, props changed)
trunk/reactos/lib/inflib/infhostput.c
trunk/reactos/tools/mkhive/mkhive.h
trunk/reactos/tools/mkhive/mkhive.mak
trunk/reactos/tools/rbuild/pch.h
trunk/reactos/tools/rbuild/rbuild.mak
trunk/reactos/tools/rbuild/syssetupgenerator.cpp
Modified: trunk/reactos/include/psdk/basetsd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/basetsd.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/basetsd.h (original)
+++ trunk/reactos/include/psdk/basetsd.h Sat Aug 18 14:27:23 2007
@@ -107,11 +107,21 @@
#else /* !_WIN64 */
typedef _W64 int INT_PTR, *PINT_PTR;
typedef _W64 unsigned int UINT_PTR, *PUINT_PTR;
-typedef _W64 long LONG_PTR, *PLONG_PTR;
-typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR;
+
+#ifndef LONG_PTR_DEFINED
+#define LONG_PTR_DEFINED
+ typedef _W64 long LONG_PTR, *PLONG_PTR;
+ typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR;
+#endif
+
typedef unsigned short UHALF_PTR, *PUHALF_PTR;
typedef short HALF_PTR, *PHALF_PTR;
-typedef _W64 unsigned long HANDLE_PTR;
+
+#ifndef HANDLE_PTR_DEFINED
+#define HANDLE_PTR_DEFINED
+ typedef _W64 unsigned long HANDLE_PTR;
+#endif
+
#endif /* !_WIN64 */
typedef _W64 ULONG_PTR SIZE_T, *PSIZE_T;
Modified: trunk/reactos/include/psdk/basetyps.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/basetyps.h?re…
==============================================================================
--- trunk/reactos/include/psdk/basetyps.h (original)
+++ trunk/reactos/include/psdk/basetyps.h Sat Aug 18 14:27:23 2007
@@ -77,8 +77,8 @@
#include <guiddef.h>
#ifndef _ERROR_STATUS_T_DEFINED
-typedef unsigned long error_status_t;
#define _ERROR_STATUS_T_DEFINED
+ typedef unsigned long error_status_t;
#endif
#ifndef _WCHAR_T_DEFINED
Modified: trunk/reactos/include/psdk/winnt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=2…
==============================================================================
--- trunk/reactos/include/psdk/winnt.h (original)
+++ trunk/reactos/include/psdk/winnt.h Sat Aug 18 14:27:23 2007
@@ -102,8 +102,8 @@
typedef short SHORT;
#ifndef LONG_DEFINED
#define LONG_DEFINED
- typedef long LONG;
- typedef unsigned long ULONG,*PULONG;
+ typedef long LONG;
+ typedef unsigned long ULONG,*PULONG;
#endif//LONG_DEFINED
typedef char CCHAR, *PCCHAR;
typedef unsigned char UCHAR,*PUCHAR;
Modified: trunk/reactos/lib/cmlib/cmlib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.h?rev=2839…
==============================================================================
--- trunk/reactos/lib/cmlib/cmlib.h (original)
+++ trunk/reactos/lib/cmlib/cmlib.h Sat Aug 18 14:27:23 2007
@@ -9,6 +9,10 @@
#define CMLIB_H
//#define WIN32_NO_STATUS
+#ifdef CMLIB_HOST
+#include <typedefs64.h>
+#endif
+
#include <ntddk.h>
#include "hivedata.h"
#include "cmdata.h"
Modified: trunk/reactos/lib/cmlib/cmlib.mak
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.mak?rev=28…
==============================================================================
--- trunk/reactos/lib/cmlib/cmlib.mak (original)
+++ trunk/reactos/lib/cmlib/cmlib.mak Sat Aug 18 14:27:23 2007
@@ -33,7 +33,7 @@
CMLIB_HOST_CFLAGS = -O3 -Wall -Wwrite-strings -Wpointer-arith \
-D_X86_ -D__i386__ -D_REACTOS_ -D_NTOSKRNL_ -D_NTSYSTEM_ \
-DCMLIB_HOST -D_M_IX86 -I$(CMLIB_BASE) -Iinclude/reactos -Iinclude/psdk -Iinclude/ddk
-Iinclude/crt \
- -D__NO_CTYPE_INLINES
+ -D__NO_CTYPE_INLINES -DCMLIB_HOST
$(CMLIB_HOST_TARGET): $(CMLIB_HOST_OBJECTS) | $(CMLIB_OUT)
$(ECHO_AR)
Modified: trunk/reactos/lib/inflib/builddep.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/builddep.h?rev=…
==============================================================================
--- trunk/reactos/lib/inflib/builddep.h (original)
+++ trunk/reactos/lib/inflib/builddep.h Sat Aug 18 14:27:23 2007
@@ -30,10 +30,10 @@
typedef char CHAR, *PCHAR;
typedef unsigned char UCHAR, *PUCHAR;
-typedef long LONG, *PLONG;
-typedef unsigned long ULONG, *PULONG;
typedef void VOID, *PVOID;
typedef UCHAR BOOLEAN, *PBOOLEAN;
+#include <typedefs64.h>
+typedef LONG *PLONG;
typedef char TCHAR, *PTCHAR, *PTSTR;
#define _T(x) x
@@ -48,7 +48,7 @@
#define strcasecmp stricmp
#endif
-extern unsigned long DbgPrint(char *Fmt, ...);
+extern ULONG DbgPrint(char *Fmt, ...);
#else /* ! defined(INFLIB_HOST) */
Propchange: trunk/reactos/lib/inflib/builddep.h
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Modified: trunk/reactos/lib/inflib/infhost.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/infhost.h?rev=2…
==============================================================================
--- trunk/reactos/lib/inflib/infhost.h (original)
+++ trunk/reactos/lib/inflib/infhost.h Sat Aug 18 14:27:23 2007
@@ -17,59 +17,59 @@
extern int InfHostOpenBufferedFile(PHINF InfHandle,
void *Buffer,
- unsigned long BufferSize,
- unsigned long *ErrorLine);
+ ULONG BufferSize,
+ ULONG *ErrorLine);
extern int InfHostOpenFile(PHINF InfHandle,
- const char *FileName,
- unsigned long *ErrorLine);
+ const CHAR *FileName,
+ ULONG *ErrorLine);
extern int InfHostWriteFile(HINF InfHandle,
- const char *FileName,
- const char *HeaderComment);
+ const CHAR *FileName,
+ const CHAR *HeaderComment);
extern void InfHostCloseFile(HINF InfHandle);
extern int InfHostFindFirstLine(HINF InfHandle,
- const char *Section,
- const char *Key,
+ const CHAR *Section,
+ const CHAR *Key,
PINFCONTEXT *Context);
extern int InfHostFindNextLine(PINFCONTEXT ContextIn,
PINFCONTEXT ContextOut);
extern int InfHostFindFirstMatchLine(PINFCONTEXT ContextIn,
- const char *Key,
+ const CHAR *Key,
PINFCONTEXT ContextOut);
extern int InfHostFindNextMatchLine(PINFCONTEXT ContextIn,
- const char *Key,
+ const CHAR *Key,
PINFCONTEXT ContextOut);
-extern long InfHostGetLineCount(HINF InfHandle,
- const char *Section);
-extern long InfHostGetFieldCount(PINFCONTEXT Context);
+extern LONG InfHostGetLineCount(HINF InfHandle,
+ const CHAR *Section);
+extern LONG InfHostGetFieldCount(PINFCONTEXT Context);
extern int InfHostGetBinaryField(PINFCONTEXT Context,
- unsigned long FieldIndex,
- unsigned char *ReturnBuffer,
- unsigned long ReturnBufferSize,
- unsigned long *RequiredSize);
+ ULONG FieldIndex,
+ UCHAR *ReturnBuffer,
+ ULONG ReturnBufferSize,
+ ULONG *RequiredSize);
extern int InfHostGetIntField(PINFCONTEXT Context,
- unsigned long FieldIndex,
- unsigned long *IntegerValue);
+ ULONG FieldIndex,
+ ULONG *IntegerValue);
extern int InfHostGetMultiSzField(PINFCONTEXT Context,
- unsigned long FieldIndex,
- char *ReturnBuffer,
- unsigned long ReturnBufferSize,
- unsigned long *RequiredSize);
+ ULONG FieldIndex,
+ CHAR *ReturnBuffer,
+ ULONG ReturnBufferSize,
+ ULONG *RequiredSize);
extern int InfHostGetStringField(PINFCONTEXT Context,
- unsigned long FieldIndex,
- char *ReturnBuffer,
- unsigned long ReturnBufferSize,
- unsigned long *RequiredSize);
+ ULONG FieldIndex,
+ CHAR *ReturnBuffer,
+ ULONG ReturnBufferSize,
+ ULONG *RequiredSize);
extern int InfHostGetData(PINFCONTEXT Context,
- char **Key,
- char **Data);
+ CHAR **Key,
+ CHAR **Data);
extern int InfHostGetDataField(PINFCONTEXT Context,
- unsigned long FieldIndex,
- char **Data);
+ ULONG FieldIndex,
+ CHAR **Data);
extern int InfHostFindOrAddSection(HINF InfHandle,
- const char *Section,
+ const CHAR *Section,
PINFCONTEXT *Context);
-extern int InfHostAddLine(PINFCONTEXT Context, const char *Key);
-extern int InfHostAddField(PINFCONTEXT Context, const char *Data);
+extern int InfHostAddLine(PINFCONTEXT Context, const CHAR *Key);
+extern int InfHostAddField(PINFCONTEXT Context, const CHAR *Data);
extern void InfHostFreeContext(PINFCONTEXT Context);
#ifdef __cplusplus
Propchange: trunk/reactos/lib/inflib/infhost.h
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Modified: trunk/reactos/lib/inflib/infhostgen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/infhostgen.c?re…
==============================================================================
--- trunk/reactos/lib/inflib/infhostgen.c (original)
+++ trunk/reactos/lib/inflib/infhostgen.c Sat Aug 18 14:27:23 2007
@@ -19,15 +19,15 @@
int
InfHostOpenBufferedFile(PHINF InfHandle,
void *Buffer,
- unsigned long BufferSize,
- unsigned long *ErrorLine)
+ ULONG BufferSize,
+ ULONG *ErrorLine)
{
INFSTATUS Status;
PINFCACHE Cache;
- char *FileBuffer;
+ CHAR *FileBuffer;
*InfHandle = NULL;
- *ErrorLine = (unsigned long)-1;
+ *ErrorLine = (ULONG)-1;
/* Allocate file buffer */
FileBuffer = MALLOC(BufferSize + 1);
@@ -77,17 +77,17 @@
int
InfHostOpenFile(PHINF InfHandle,
- const char *FileName,
- unsigned long *ErrorLine)
+ const CHAR *FileName,
+ ULONG *ErrorLine)
{
FILE *File;
- char *FileBuffer;
- unsigned long FileLength;
+ CHAR *FileBuffer;
+ ULONG FileLength;
PINFCACHE Cache;
INFSTATUS Status;
*InfHandle = NULL;
- *ErrorLine = (unsigned long)-1;
+ *ErrorLine = (ULONG)-1;
/* Open the inf file */
File = fopen(FileName, "rb");
@@ -108,7 +108,7 @@
}
FileLength = ftell(File);
- if ((unsigned long) -1 == FileLength)
+ if ((ULONG) -1 == FileLength)
{
DPRINT1("ftell() failed (errno %d)\n", errno);
fclose(File);
Modified: trunk/reactos/lib/inflib/infhostget.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/infhostget.c?re…
==============================================================================
--- trunk/reactos/lib/inflib/infhostget.c (original)
+++ trunk/reactos/lib/inflib/infhostget.c Sat Aug 18 14:27:23 2007
@@ -16,8 +16,8 @@
int
InfHostFindFirstLine(HINF InfHandle,
- const char *Section,
- const char *Key,
+ const CHAR *Section,
+ const CHAR *Key,
PINFCONTEXT *Context)
{
INFSTATUS Status;
@@ -56,7 +56,7 @@
int
InfHostFindFirstMatchLine(PINFCONTEXT ContextIn,
- const char *Key,
+ const CHAR *Key,
PINFCONTEXT ContextOut)
{
INFSTATUS Status;
@@ -76,7 +76,7 @@
int
InfHostFindNextMatchLine(PINFCONTEXT ContextIn,
- const char *Key,
+ const CHAR *Key,
PINFCONTEXT ContextOut)
{
INFSTATUS Status;
@@ -94,7 +94,7 @@
}
-long
+LONG
InfHostGetLineCount(HINF InfHandle,
PCTSTR Section)
{
@@ -105,7 +105,7 @@
/* InfGetLineText */
-long
+LONG
InfHostGetFieldCount(PINFCONTEXT Context)
{
return InfpGetFieldCount(Context);
@@ -114,10 +114,10 @@
int
InfHostGetBinaryField(PINFCONTEXT Context,
- unsigned long FieldIndex,
- unsigned char *ReturnBuffer,
- unsigned long ReturnBufferSize,
- unsigned long *RequiredSize)
+ ULONG FieldIndex,
+ UCHAR *ReturnBuffer,
+ ULONG ReturnBufferSize,
+ ULONG *RequiredSize)
{
INFSTATUS Status;
@@ -137,8 +137,8 @@
int
InfHostGetIntField(PINFCONTEXT Context,
- unsigned long FieldIndex,
- unsigned long *IntegerValue)
+ ULONG FieldIndex,
+ ULONG *IntegerValue)
{
INFSTATUS Status;
@@ -157,10 +157,10 @@
int
InfHostGetMultiSzField(PINFCONTEXT Context,
- unsigned long FieldIndex,
- char * ReturnBuffer,
- unsigned long ReturnBufferSize,
- unsigned long *RequiredSize)
+ ULONG FieldIndex,
+ CHAR * ReturnBuffer,
+ ULONG ReturnBufferSize,
+ ULONG *RequiredSize)
{
INFSTATUS Status;
@@ -180,10 +180,10 @@
int
InfHostGetStringField(PINFCONTEXT Context,
- unsigned long FieldIndex,
- char *ReturnBuffer,
- unsigned long ReturnBufferSize,
- unsigned long *RequiredSize)
+ ULONG FieldIndex,
+ CHAR *ReturnBuffer,
+ ULONG ReturnBufferSize,
+ ULONG *RequiredSize)
{
INFSTATUS Status;
@@ -203,8 +203,8 @@
int
InfHostGetData(PINFCONTEXT Context,
- char **Key,
- char **Data)
+ CHAR **Key,
+ CHAR **Data)
{
INFSTATUS Status;
@@ -223,8 +223,8 @@
int
InfHostGetDataField(PINFCONTEXT Context,
- unsigned long FieldIndex,
- char **Data)
+ ULONG FieldIndex,
+ CHAR **Data)
{
INFSTATUS Status;
Modified: trunk/reactos/lib/inflib/infhostglue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/infhostglue.c?r…
==============================================================================
--- trunk/reactos/lib/inflib/infhostglue.c (original)
+++ trunk/reactos/lib/inflib/infhostglue.c Sat Aug 18 14:27:23 2007
@@ -11,7 +11,7 @@
#define NDEBUG
#include <debug.h>
-unsigned long
+ULONG
DbgPrint(char *Fmt, ...)
{
va_list Args;
Propchange: trunk/reactos/lib/inflib/infhostglue.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Modified: trunk/reactos/lib/inflib/infhostput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/infhostput.c?re…
==============================================================================
--- trunk/reactos/lib/inflib/infhostput.c (original)
+++ trunk/reactos/lib/inflib/infhostput.c Sat Aug 18 14:27:23 2007
@@ -13,11 +13,11 @@
#include <debug.h>
int
-InfHostWriteFile(HINF InfHandle, const char *FileName,
- const char *HeaderComment)
+InfHostWriteFile(HINF InfHandle, const CHAR *FileName,
+ const CHAR *HeaderComment)
{
- char *Buffer;
- unsigned long BufferSize;
+ CHAR *Buffer;
+ ULONG BufferSize;
INFSTATUS Status;
FILE *File;
@@ -60,7 +60,7 @@
int
InfHostFindOrAddSection(HINF InfHandle,
- const char *Section,
+ const CHAR *Section,
PINFCONTEXT *Context)
{
INFSTATUS Status;
@@ -78,7 +78,7 @@
}
int
-InfHostAddLine(PINFCONTEXT Context, const char *Key)
+InfHostAddLine(PINFCONTEXT Context, const CHAR *Key)
{
INFSTATUS Status;
@@ -95,7 +95,7 @@
}
int
-InfHostAddField(PINFCONTEXT Context, const char *Data)
+InfHostAddField(PINFCONTEXT Context, const CHAR *Data)
{
INFSTATUS Status;
Modified: trunk/reactos/tools/mkhive/mkhive.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/mkhive.h?rev=…
==============================================================================
--- trunk/reactos/tools/mkhive/mkhive.h (original)
+++ trunk/reactos/tools/mkhive/mkhive.h Sat Aug 18 14:27:23 2007
@@ -37,6 +37,11 @@
#define NTOS_MODE_USER
#define WIN32_NO_STATUS
+
+#ifdef MKHIVE_HOST
+#include <typedefs64.h>
+#endif
+
#include <ntddk.h>
#include <cmlib.h>
#include <infhost.h>
Modified: trunk/reactos/tools/mkhive/mkhive.mak
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/mkhive.mak?re…
==============================================================================
--- trunk/reactos/tools/mkhive/mkhive.mak (original)
+++ trunk/reactos/tools/mkhive/mkhive.mak Sat Aug 18 14:27:23 2007
@@ -31,7 +31,7 @@
$(addprefix $(INTERMEDIATE_), $(MKHIVE_SOURCES:.c=.o))
MKHIVE_HOST_CFLAGS = -fshort-wchar $(xTOOLS_CFLAGS) -I$(INFLIB_BASE) -I$(CMLIB_BASE) \
- -D_NTOSKRNL_ -D_NTSYSTEM_ \
+ -D_NTOSKRNL_ -D_NTSYSTEM_ -DMKHIVE_HOST \
-Iinclude/reactos -Iinclude/ddk -Iinclude/ndk -Iinclude/psdk -Iinclude -Iinclude/crt
-g3
MKHIVE_HOST_LFLAGS = $(xTOOLS_LFLAGS) -g3
Modified: trunk/reactos/tools/rbuild/pch.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/pch.h?rev=283…
==============================================================================
--- trunk/reactos/tools/rbuild/pch.h (original)
+++ trunk/reactos/tools/rbuild/pch.h Sat Aug 18 14:27:23 2007
@@ -34,6 +34,14 @@
#endif//MAX_PATH
#else
#include <unistd.h>
+
+typedef char CHAR, *PCHAR;
+typedef unsigned char UCHAR, *PUCHAR;
+typedef void VOID, *PVOID;
+typedef UCHAR BOOLEAN, *PBOOLEAN;
+#include <typedefs64.h>
+typedef LONG *PLONG;
+
#endif//WIN32
#include <stdarg.h>
Modified: trunk/reactos/tools/rbuild/rbuild.mak
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.mak?re…
==============================================================================
--- trunk/reactos/tools/rbuild/rbuild.mak (original)
+++ trunk/reactos/tools/rbuild/rbuild.mak Sat Aug 18 14:27:23 2007
@@ -354,7 +354,7 @@
$(RBUILD_COMMON_OBJECTS) \
$(RBUILD_TEST_SPECIAL_OBJECTS)
-RBUILD_HOST_CXXFLAGS = -I$(RBUILD_BASE) -I$(TOOLS_BASE) -I$(INFLIB_BASE)
$(TOOLS_CPPFLAGS)
+RBUILD_HOST_CXXFLAGS = -I$(RBUILD_BASE) -I$(TOOLS_BASE) -I$(INFLIB_BASE)
$(TOOLS_CPPFLAGS) -Iinclude/reactos
RBUILD_HOST_LFLAGS = $(TOOLS_LFLAGS)
Modified: trunk/reactos/tools/rbuild/syssetupgenerator.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/syssetupgener…
==============================================================================
--- trunk/reactos/tools/rbuild/syssetupgenerator.cpp (original)
+++ trunk/reactos/tools/rbuild/syssetupgenerator.cpp Sat Aug 18 14:27:23 2007
@@ -36,7 +36,7 @@
SysSetupGenerator::Generate ()
{
HINF inf;
- unsigned long errorLine;
+ ULONG errorLine;
string syssetupTemplate = "media" + sSep + "inf" + sSep +
"syssetup.inf.tpl";
string syssetup = Environment::GetOutputPath() + sSep + "media" + sSep +
"inf" + sSep + "syssetup.inf";