Merge 24208, 24236, 24242, and 24259 from trunk. LiveCD fixes.

svn path=/branches/ros-branch-0_3_1/; revision=24304
This commit is contained in:
Andrew Munger 2006-09-30 02:54:20 +00:00
parent 8f9a18cfff
commit 723627e679
8 changed files with 60 additions and 19 deletions

View file

@ -152,11 +152,15 @@ ifeq ($(word 1,$(shell gcc -dumpmachine)),mingw32)
ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys)
export OSTYPE = msys
HOST=mingw32-linux
CFLAGS+=-fshort-wchar
CPPFLAGS+=-fshort-wchar
else
HOST=mingw32-windows
endif
else
HOST=mingw32-linux
CFLAGS+=-fshort-wchar
CPPFLAGS+=-fshort-wchar
endif
endif

View file

@ -44,14 +44,14 @@
<!--
Whether to compile in the integrated kernel debugger.
-->
<property name="KDBG" value="0" />
<property name="KDBG" value="1" />
<!--
Whether to compile for debugging. No compiler optimizations will be
performed.
-->
<property name="DBG" value="0" />
<property name="DBG" value="1" />
<!--

View file

@ -38,6 +38,7 @@
static char * argv0 = "";
static char * filename = "";
static char * kernel_version_build_type = 0;
#ifdef DBG
void
@ -55,6 +56,15 @@ tm_dump (const char *tag, struct tm * t)
}
#endif
int count_wide_string( wchar_t *str )
{
int i;
for( i = 0; str[i]; i++ );
return i;
}
void
write_h (int build, char *buildstr)
{
@ -80,7 +90,7 @@ write_h (int build, char *buildstr)
{
s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL);
}
s = s + sprintf (s, "-%S\\0\"\n", KERNEL_VERSION_BUILD_TYPE);
s = s + sprintf (s, "-%s\\0\"\n", kernel_version_build_type);
s = s + sprintf (s, "#define KERNEL_RELEASE_STR\t\"%d.%d",
KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MINOR);
@ -88,7 +98,7 @@ write_h (int build, char *buildstr)
{
s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL);
}
s = s + sprintf (s, "-%S\"\n", KERNEL_VERSION_BUILD_TYPE);
s = s + sprintf (s, "-%s\"\n", kernel_version_build_type);
s = s + sprintf (s, "#define KERNEL_VERSION_RC\t\"%d.%d",
KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MINOR);
@ -96,7 +106,7 @@ write_h (int build, char *buildstr)
{
s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL);
}
s = s + sprintf (s, "-%S\\0\"\n", KERNEL_VERSION_BUILD_TYPE);
s = s + sprintf (s, "-%s\\0\"\n", kernel_version_build_type);
s = s + sprintf (s, "#define KERNEL_VERSION_STR\t\"%d.%d",
KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MINOR);
@ -104,7 +114,7 @@ write_h (int build, char *buildstr)
{
s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL);
}
s = s + sprintf (s, "-%S\"\n", KERNEL_VERSION_BUILD_TYPE);
s = s + sprintf (s, "-%s\"\n", kernel_version_build_type);
s = s + sprintf (s, "#define REACTOS_DLL_VERSION_MAJOR\t%d\n", dllversion);
s = s + sprintf (s, "#define REACTOS_DLL_RELEASE_RC\t\"%d.%d",
dllversion, KERNEL_VERSION_MINOR);
@ -112,7 +122,7 @@ write_h (int build, char *buildstr)
{
s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL);
}
s = s + sprintf (s, "-%S\\0\"\n", KERNEL_VERSION_BUILD_TYPE);
s = s + sprintf (s, "-%s\\0\"\n", kernel_version_build_type);
s = s + sprintf (s, "#define REACTOS_DLL_RELEASE_STR\t\"%d.%d",
dllversion,
KERNEL_VERSION_MINOR);
@ -120,7 +130,7 @@ write_h (int build, char *buildstr)
{
s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL);
}
s = s + sprintf (s, "-%S\"\n", KERNEL_VERSION_BUILD_TYPE);
s = s + sprintf (s, "-%s\"\n", kernel_version_build_type);
s = s + sprintf (s, "#define REACTOS_DLL_VERSION_RC\t\"%d.%d",
dllversion,
KERNEL_VERSION_MINOR);
@ -128,7 +138,7 @@ write_h (int build, char *buildstr)
{
s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL);
}
s = s + sprintf (s, "-%S\\0\"\n", KERNEL_VERSION_BUILD_TYPE);
s = s + sprintf (s, "-%s\\0\"\n", kernel_version_build_type);
s = s + sprintf (s, "#define REACTOS_DLL_VERSION_STR\t\"%d.%d",
dllversion,
KERNEL_VERSION_MINOR);
@ -136,7 +146,7 @@ write_h (int build, char *buildstr)
{
s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL);
}
s = s + sprintf (s, "-%S\"\n", KERNEL_VERSION_BUILD_TYPE);
s = s + sprintf (s, "-%s\"\n", kernel_version_build_type);
s = s + sprintf (s, "#endif\n/* EOF */\n");
h = fopen (filename, "wb");
@ -284,6 +294,7 @@ usage (void)
int
main (int argc, char * argv [])
{
int i, length;
int print_only = FALSE;
int quiet = FALSE;
@ -341,6 +352,14 @@ main (int argc, char * argv [])
printf ( "\nReactOS Build Number Generator\n\n");
}
/* Convert kernel_version_build_type to a host-friendly string */
length = count_wide_string(KERNEL_VERSION_BUILD_TYPE);
kernel_version_build_type = (char *)malloc(length+1);
for( i = 0; KERNEL_VERSION_BUILD_TYPE[i]; i++ ) {
kernel_version_build_type[i] = KERNEL_VERSION_BUILD_TYPE[i];
}
kernel_version_build_type[i] = 0;
time (& t1); /* current build time */
t1_tm = gmtime (& t1);
@ -378,7 +397,7 @@ main (int argc, char * argv [])
{
printf(".%d", KERNEL_VERSION_PATCH_LEVEL);
}
printf("-%S (Build %s)\n\n", KERNEL_VERSION_BUILD_TYPE, buildstr);
printf("-%s (Build %s)\n\n", kernel_version_build_type, buildstr);
}
/*
* (Over)write the include file, unless

View file

@ -31,7 +31,7 @@ CmpAllocate(
IN SIZE_T Size,
IN BOOLEAN Paged)
{
return malloc(Size);
return (PVOID) malloc(Size);
}
static VOID

View file

@ -30,7 +30,7 @@ MKHIVE_SOURCES = $(addprefix $(MKHIVE_BASE_), \
MKHIVE_OBJECTS = \
$(addprefix $(INTERMEDIATE_), $(MKHIVE_SOURCES:.c=.o))
MKHIVE_HOST_CFLAGS = $(xTOOLS_CFLAGS) -I$(INFLIB_BASE) -I$(CMLIB_BASE) \
MKHIVE_HOST_CFLAGS = -fshort-wchar $(xTOOLS_CFLAGS) -I$(INFLIB_BASE) -I$(CMLIB_BASE) \
-D_NTOSKRNL_ \
-Iinclude/reactos -Iinclude/ddk -Iinclude/ndk -Iinclude/psdk -Iinclude -Iinclude/crt -g3

View file

@ -122,7 +122,7 @@ RegpOpenOrCreateKey(
LocalKeyName = (PWSTR)KeyName;
for (;;)
{
End = wcschr(LocalKeyName, '\\');
End = (PWSTR) xwcschr(LocalKeyName, '\\');
if (End)
{
KeyString.Buffer = LocalKeyName;
@ -153,7 +153,7 @@ RegpOpenOrCreateKey(
ParentKey->RegistryHive,
ParentKey->KeyCell,
&KeyString,
0,
OBJ_CASE_INSENSITIVE,
&SubKeyCell,
&BlockOffset);
if (AllowCreation && Status == STATUS_OBJECT_NAME_NOT_FOUND)

View file

@ -11,6 +11,24 @@
#include <ntddk.h>
#include <bitmap.c>
SIZE_T xwcslen( PWSTR String ) {
SIZE_T i;
for( i = 0; String[i]; i++ );
return i;
}
PWSTR xwcschr( PWSTR String, WCHAR Char )
{
SIZE_T i;
for( i = 0; String[i] && String[i] != Char; i++ );
if( String[i] ) return &String[i];
else return NULL;
}
/*
* @implemented
*
@ -54,7 +72,7 @@ RtlInitUnicodeString(
if(SourceString)
{
DestSize = wcslen(SourceString) * sizeof(WCHAR);
DestSize = xwcslen(SourceString) * sizeof(WCHAR);
DestinationString->Length = (USHORT)DestSize;
DestinationString->MaximumLength = (USHORT)DestSize + sizeof(WCHAR);
}
@ -84,7 +102,7 @@ RtlAnsiStringToUnicodeString(
if (AllocateDestinationString)
{
UniDest->MaximumLength = (USHORT)Length + sizeof(WCHAR);
UniDest->Buffer = malloc(UniDest->MaximumLength);
UniDest->Buffer = (PWSTR) malloc(UniDest->MaximumLength);
if (!UniDest->Buffer)
return STATUS_NO_MEMORY;
}
@ -131,7 +149,7 @@ ExAllocatePool(
IN POOL_TYPE PoolType,
IN SIZE_T NumberOfBytes)
{
return malloc(NumberOfBytes);
return (PVOID) malloc(NumberOfBytes);
}
VOID NTAPI

View file

@ -55,7 +55,7 @@ WIDL_OBJECTS = \
$(addprefix $(INTERMEDIATE_), $(WIDL_SOURCES:.c=.o))
WIDL_HOST_CFLAGS = $(TOOLS_CFLAGS) \
-DINT16=SHORT -D__USE_W32API -DYYDEBUG=1 \
-DINT16=SHORT -D__USE_W32API -DYYDEBUG=1 -D__REACTOS__=1 \
-I$(WIDL_BASE) -I$(WPP_BASE) \
-Iinclude/reactos/wine -Iinclude/reactos -Iinclude -Iinclude/psdk