Author: hpoussin
Date: Sat Nov 11 00:00:24 2006
New Revision: 24718
URL:
http://svn.reactos.org/svn/reactos?rev=24718&view=rev
Log:
- Set correct flags when calling Nt* functions during file copy
- Fix reading of disks parameter in registry
- Keep FS name in unicode instead of char
- Don't hardcode more than once ReactOS directory on bootcd ('\reactos')
- Get screen dimensions only once (at startup)
- General cleanup (warnings...)
- Do some actions only if __REACTOS__ if defined. (I'm currently using them to debug
usetup)
Added:
trunk/reactos/base/setup/usetup/host.h (with props)
trunk/reactos/base/setup/usetup/native/console.c (with props)
trunk/reactos/base/setup/usetup/native/fslist.c (with props)
trunk/reactos/base/setup/usetup/native/host_native.h (with props)
Modified:
trunk/reactos/base/setup/usetup/bootsup.c
trunk/reactos/base/setup/usetup/filequeue.c
trunk/reactos/base/setup/usetup/filesup.c
trunk/reactos/base/setup/usetup/fslist.c
trunk/reactos/base/setup/usetup/fslist.h
trunk/reactos/base/setup/usetup/genlist.c
trunk/reactos/base/setup/usetup/inffile.c
trunk/reactos/base/setup/usetup/inffile.h
trunk/reactos/base/setup/usetup/interface/consup.c
trunk/reactos/base/setup/usetup/interface/consup.h
trunk/reactos/base/setup/usetup/interface/usetup.c
trunk/reactos/base/setup/usetup/native/utils/console.c
trunk/reactos/base/setup/usetup/native/utils/console.h
trunk/reactos/base/setup/usetup/native/utils/keytrans.c
trunk/reactos/base/setup/usetup/native/utils/keytrans.h
trunk/reactos/base/setup/usetup/partlist.c
trunk/reactos/base/setup/usetup/registry.c
trunk/reactos/base/setup/usetup/usetup.h
trunk/reactos/base/setup/usetup/usetup.rbuild
trunk/reactos/base/setup/usetup/usetup.rc
Modified: trunk/reactos/base/setup/usetup/bootsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/bootsup.…
==============================================================================
--- trunk/reactos/base/setup/usetup/bootsup.c (original)
+++ trunk/reactos/base/setup/usetup/bootsup.c Sat Nov 11 00:00:24 2006
@@ -1787,10 +1787,10 @@
return(Status);
}
-
BOOLEAN
CheckInstallFatBootcodeToPartition(PUNICODE_STRING SystemRootPath)
{
+#ifdef __REACTOS__
if (DoesFileExist(SystemRootPath->Buffer, L"ntldr") ||
DoesFileExist(SystemRootPath->Buffer, L"boot.ini"))
{
@@ -1801,6 +1801,7 @@
{
return TRUE;
}
+#endif
return FALSE;
}
@@ -1812,6 +1813,7 @@
PUNICODE_STRING DestinationArcPath,
UCHAR PartitionType)
{
+#ifdef __REACTOS__
WCHAR SrcPath[MAX_PATH];
WCHAR DstPath[MAX_PATH];
NTSTATUS Status;
@@ -2117,6 +2119,9 @@
}
return STATUS_SUCCESS;
+#else
+ return STATUS_NOT_IMPLEMENTED;
+#endif
}
@@ -2124,6 +2129,7 @@
InstallFatBootcodeToFloppy(PUNICODE_STRING SourceRootPath,
PUNICODE_STRING DestinationArcPath)
{
+#ifdef __REACTOS__
WCHAR SrcPath[MAX_PATH];
WCHAR DstPath[MAX_PATH];
NTSTATUS Status;
@@ -2170,6 +2176,9 @@
}
return STATUS_SUCCESS;
+#else
+ return STATUS_NOT_IMPLEMENTED;
+#endif
}
/* EOF */
Modified: trunk/reactos/base/setup/usetup/filequeue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/filequeu…
==============================================================================
--- trunk/reactos/base/setup/usetup/filequeue.c (original)
+++ trunk/reactos/base/setup/usetup/filequeue.c Sat Nov 11 00:00:24 2006
@@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- * COPYRIGHT: See COPYING in the top level directory
+/* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/filequeue.c
* PURPOSE: File queue functions
@@ -33,7 +32,6 @@
#include <debug.h>
/* INCLUDES *****************************************************************/
-
typedef struct _QUEUEENTRY
{
Modified: trunk/reactos/base/setup/usetup/filesup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/filesup.…
==============================================================================
--- trunk/reactos/base/setup/usetup/filesup.c (original)
+++ trunk/reactos/base/setup/usetup/filesup.c Sat Nov 11 00:00:24 2006
@@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- * COPYRIGHT: See COPYING in the top level directory
+/* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/filesup.c
* PURPOSE: File support functions
@@ -33,7 +32,6 @@
#include <debug.h>
/* FUNCTIONS ****************************************************************/
-
static BOOLEAN HasCurrentCabinet = FALSE;
static WCHAR CurrentCabinetName[MAX_PATH];
@@ -76,9 +74,9 @@
&IoStatusBlock,
NULL,
FILE_ATTRIBUTE_DIRECTORY,
- 0,
- FILE_CREATE,
- FILE_SYNCHRONOUS_IO_NONALERT | FILE_DIRECTORY_FILE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ FILE_OPEN_IF,
+ FILE_DIRECTORY_FILE,
NULL,
0);
if (NT_SUCCESS(Status))
@@ -108,10 +106,12 @@
NTSTATUS Status;
PVOID SourceFileMap = 0;
HANDLE SourceFileSection;
- ULONG SourceSectionSize = 0;
+ SIZE_T SourceSectionSize = 0;
+ LARGE_INTEGER ByteOffset;
Buffer = NULL;
+#ifdef __REACTOS__
RtlInitUnicodeString(&FileName,
SourceFileName);
@@ -126,12 +126,20 @@
&ObjectAttributes,
&IoStatusBlock,
FILE_SHARE_READ,
- FILE_SYNCHRONOUS_IO_NONALERT | FILE_SEQUENTIAL_ONLY);
+ FILE_SEQUENTIAL_ONLY);
if(!NT_SUCCESS(Status))
{
DPRINT1("NtOpenFile failed: %x\n", Status);
goto done;
}
+#else
+ FileHandleSource = CreateFileW(SourceFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, 0, NULL);
+ if (FileHandleSource == INVALID_HANDLE_VALUE)
+ {
+ Status = STATUS_UNSUCCESSFUL;
+ goto done;
+ }
+#endif
Status = NtQueryInformationFile(FileHandleSource,
&IoStatusBlock,
@@ -155,10 +163,10 @@
Status = NtCreateSection( &SourceFileSection,
SECTION_MAP_READ,
- 0,
- 0,
+ NULL,
+ NULL,
PAGE_READONLY,
- 0,
+ SEC_COMMIT,
FileHandleSource);
if(!NT_SUCCESS(Status))
{
@@ -171,10 +179,10 @@
&SourceFileMap,
0,
0,
+ NULL,
+ &SourceSectionSize,
+ ViewUnmap,
0,
- &SourceSectionSize,
- 0,
- SEC_COMMIT,
PAGE_READONLY );
if(!NT_SUCCESS(Status))
{
@@ -199,7 +207,7 @@
FILE_ATTRIBUTE_NORMAL,
0,
FILE_OVERWRITE_IF,
- FILE_SYNCHRONOUS_IO_NONALERT | FILE_SEQUENTIAL_ONLY,
+ FILE_NO_INTERMEDIATE_BUFFERING | FILE_SEQUENTIAL_ONLY,
NULL,
0);
if(!NT_SUCCESS(Status))
@@ -208,17 +216,18 @@
goto unmapsrcsec;
}
- RegionSize = PAGE_ROUND_UP(FileStandard.EndOfFile.u.LowPart);
+ RegionSize = (ULONG)PAGE_ROUND_UP(FileStandard.EndOfFile.u.LowPart);
IoStatusBlock.Status = 0;
+ ByteOffset.QuadPart = 0;
Status = NtWriteFile(FileHandleDest,
- 0,
- 0,
- 0,
+ NULL,
+ NULL,
+ NULL,
&IoStatusBlock,
SourceFileMap,
RegionSize,
- 0,
- 0);
+ &ByteOffset,
+ NULL);
if(!NT_SUCCESS(Status))
{
DPRINT1("NtWriteFile failed: %x:%x, iosb: %p src: %p, size: %x\n",
Status, IoStatusBlock.Status, &IoStatusBlock, SourceFileMap, RegionSize);
@@ -254,7 +263,7 @@
return(Status);
}
-
+#ifdef __REACTOS__
NTSTATUS
SetupExtractFile(PWCHAR CabinetFileName,
PWCHAR SourceFileName,
@@ -314,7 +323,7 @@
return STATUS_SUCCESS;
}
-
+#endif
BOOLEAN
DoesFileExist(PWSTR PathName,
Modified: trunk/reactos/base/setup/usetup/fslist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/fslist.c…
==============================================================================
--- trunk/reactos/base/setup/usetup/fslist.c (original)
+++ trunk/reactos/base/setup/usetup/fslist.c Sat Nov 11 00:00:24 2006
@@ -32,10 +32,10 @@
/* FUNCTIONS ****************************************************************/
-static VOID
-AddProvider(
+VOID
+FS_AddProvider(
IN OUT PFILE_SYSTEM_LIST List,
- IN LPCSTR FileSystem,
+ IN LPCWSTR FileSystem,
IN FORMATEX FormatFunc,
IN CHKDSKEX ChkdskFunc)
{
@@ -70,7 +70,7 @@
IN SHORT Left,
IN SHORT Top,
IN BOOLEAN ForceFormat,
- IN LPCSTR ForceFileSystem)
+ IN LPCWSTR ForceFileSystem)
{
PFILE_SYSTEM_LIST List;
PFILE_SYSTEM_ITEM Item;
@@ -85,11 +85,12 @@
List->Selected = NULL;
InitializeListHead(&List->ListHead);
- AddProvider(List, "FAT", VfatFormat, VfatChkdsk);
+ HOST_CreateFileSystemList(List);
+
if (!ForceFormat)
{
/* Add 'Keep' provider */
- AddProvider(List, NULL, NULL, NULL);
+ FS_AddProvider(List, NULL, NULL, NULL);
}
/* Search for ForceFileSystem in list */
@@ -97,7 +98,7 @@
while (ListEntry != &List->ListHead)
{
Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry);
- if (Item->FileSystem && strcmp(ForceFileSystem, Item->FileSystem)
== 0)
+ if (Item->FileSystem && wcscmp(ForceFileSystem, Item->FileSystem)
== 0)
{
List->Selected = Item;
break;
@@ -147,7 +148,7 @@
Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry);
coPos.X = List->Left;
- coPos.Y = List->Top + Index;
+ coPos.Y = List->Top + (SHORT)Index;
FillConsoleOutputAttribute(StdOutput,
FOREGROUND_WHITE | BACKGROUND_BLUE,
sizeof(Buffer),
@@ -162,9 +163,9 @@
if (Item->FileSystem)
{
if (Item->QuickFormat)
- sprintf(Buffer, " Format partition as %s file system (quick format)
", Item->FileSystem);
+ sprintf(Buffer, " Format partition as %S file system (quick format)
", Item->FileSystem);
else
- sprintf(Buffer, " Format partition as %s file system ",
Item->FileSystem);
+ sprintf(Buffer, " Format partition as %S file system ",
Item->FileSystem);
}
else
sprintf(Buffer, " Keep current file system (no changes) ");
Modified: trunk/reactos/base/setup/usetup/fslist.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/fslist.h…
==============================================================================
--- trunk/reactos/base/setup/usetup/fslist.h (original)
+++ trunk/reactos/base/setup/usetup/fslist.h Sat Nov 11 00:00:24 2006
@@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- * COPYRIGHT: See COPYING in the top level directory
+/* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/fslist.h
* PURPOSE: Filesystem list functions
@@ -28,30 +27,38 @@
#ifndef __FSLIST_H__
#define __FSLIST_H__
+#include <fmifs/fmifs.h>
+
typedef struct _FILE_SYSTEM_ITEM
{
- LIST_ENTRY ListEntry;
- LPCSTR FileSystem; /* Not owned by the item */
- FORMATEX FormatFunc;
- CHKDSKEX ChkdskFunc;
- BOOLEAN QuickFormat;
+ LIST_ENTRY ListEntry;
+ LPCWSTR FileSystem; /* Not owned by the item */
+ FORMATEX FormatFunc;
+ CHKDSKEX ChkdskFunc;
+ BOOLEAN QuickFormat;
} FILE_SYSTEM_ITEM, *PFILE_SYSTEM_ITEM;
typedef struct _FILE_SYSTEM_LIST
{
- SHORT Left;
- SHORT Top;
- PFILE_SYSTEM_ITEM Selected;
- LIST_ENTRY ListHead; /* List of FILE_SYSTEM_ITEM */
+ SHORT Left;
+ SHORT Top;
+ PFILE_SYSTEM_ITEM Selected;
+ LIST_ENTRY ListHead; /* List of FILE_SYSTEM_ITEM */
} FILE_SYSTEM_LIST, *PFILE_SYSTEM_LIST;
+VOID
+FS_AddProvider(
+ IN OUT PFILE_SYSTEM_LIST List,
+ IN LPCWSTR FileSystem,
+ IN FORMATEX FormatFunc,
+ IN CHKDSKEX ChkdskFunc);
PFILE_SYSTEM_LIST
CreateFileSystemList(
- IN SHORT Left,
- IN SHORT Top,
- IN BOOLEAN ForceFormat,
- IN LPCSTR ForceFileSystem);
+ IN SHORT Left,
+ IN SHORT Top,
+ IN BOOLEAN ForceFormat,
+ IN LPCWSTR ForceFileSystem);
VOID
DestroyFileSystemList(
Modified: trunk/reactos/base/setup/usetup/genlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/genlist.…
==============================================================================
--- trunk/reactos/base/setup/usetup/genlist.c (original)
+++ trunk/reactos/base/setup/usetup/genlist.c Sat Nov 11 00:00:24 2006
@@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- * COPYRIGHT: See COPYING in the top level directory
+/* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/genlist.c
* PURPOSE: Generic list functions
@@ -72,7 +71,7 @@
/* Release user data */
if (FreeUserData && ListEntry->UserData != NULL)
- RtlFreeHeap (ProcessHeap, 0, &ListEntry->UserData);
+ RtlFreeHeap (ProcessHeap, 0, ListEntry->UserData);
/* Release list entry */
RtlFreeHeap (ProcessHeap, 0, ListEntry);
Added: trunk/reactos/base/setup/usetup/host.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/host.h?r…
==============================================================================
--- trunk/reactos/base/setup/usetup/host.h (added)
+++ trunk/reactos/base/setup/usetup/host.h Sat Nov 11 00:00:24 2006
@@ -1,0 +1,33 @@
+#ifdef __REACTOS__
+
+#include "native/host_native.h"
+#define HOST_InitConsole NATIVE_InitConsole
+#define HOST_InitMemory NATIVE_InitMemory
+#define HOST_CreateFileSystemList NATIVE_CreateFileSystemList
+
+#else
+
+#include "win32/host_win32.h"
+#define HOST_InitConsole WIN32_InitConsole
+#define HOST_InitMemory WIN32_InitMemory
+#define HOST_CreateFileSystemList WIN32_CreateFileSystemList
+
+#endif
+
+BOOLEAN
+HOST_InitConsole(
+ VOID);
+
+BOOLEAN
+HOST_InitMemory(
+ VOID);
+
+BOOLEAN
+HOST_CreateFileSystemList(
+ IN PFILE_SYSTEM_LIST List);
+
+BOOLEAN
+HOST_FormatPartition(
+ IN PFILE_SYSTEM_ITEM FileSystem,
+ IN PCUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback);
Propchange: trunk/reactos/base/setup/usetup/host.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/base/setup/usetup/inffile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/inffile.…
==============================================================================
--- trunk/reactos/base/setup/usetup/inffile.c (original)
+++ trunk/reactos/base/setup/usetup/inffile.c Sat Nov 11 00:00:24 2006
@@ -27,12 +27,17 @@
/* INCLUDES ******************************************************************/
#include "usetup.h"
+
+#ifdef __REACTOS__
#include <infros.h>
+#endif
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
+
+#ifdef __REACTOS__
VOID WINAPI
InfpCloseInfFile(
@@ -141,10 +146,12 @@
&ErrorLineUL);
*ErrorLine = (UINT)ErrorLineUL;
if (!NT_SUCCESS(Status))
- return NULL;
+ return INVALID_HANDLE_VALUE;
return hInf;
}
+
+#endif /* __REACTOS__ */
BOOLEAN
INF_GetData(
@@ -152,7 +159,50 @@
OUT PWCHAR *Key,
OUT PWCHAR *Data)
{
+#ifdef __REACTOS__
return InfGetData(Context, Key, Data);
+#else
+ static PWCHAR pLastCallData[4] = { NULL, NULL, NULL, NULL };
+ static DWORD currentIndex = 0;
+ DWORD dwSize, i;
+ BOOL ret;
+
+ currentIndex ^= 2;
+
+ if (Key) *Key = NULL;
+ if (Data) *Data = NULL;
+
+ if (SetupGetFieldCount(Context) != 1)
+ return FALSE;
+
+ for (i = 0; i <= 1; i++)
+ {
+ ret = SetupGetStringFieldW(
+ Context,
+ i,
+ NULL,
+ 0,
+ &dwSize);
+ if (!ret)
+ return FALSE;
+ HeapFree(GetProcessHeap(), 0, pLastCallData[i + currentIndex]);
+ pLastCallData[i + currentIndex] = HeapAlloc(GetProcessHeap(), 0, dwSize *
sizeof(WCHAR));
+ ret = SetupGetStringFieldW(
+ Context,
+ i,
+ pLastCallData[i + currentIndex],
+ dwSize,
+ NULL);
+ if (!ret)
+ return FALSE;
+ }
+
+ if (Key)
+ *Key = pLastCallData[0 + currentIndex];
+ if (Data)
+ *Data = pLastCallData[1 + currentIndex];
+ return TRUE;
+#endif /* !__REACTOS__ */
}
BOOLEAN
@@ -161,7 +211,39 @@
IN ULONG FieldIndex,
OUT PWCHAR *Data)
{
+#ifdef __REACTOS__
return InfGetDataField(Context, FieldIndex, Data);
+#else
+ static PWCHAR pLastCallsData[] = { NULL, NULL, NULL };
+ static DWORD NextIndex = 0;
+ DWORD dwSize;
+ BOOL ret;
+
+ *Data = NULL;
+
+ ret = SetupGetStringFieldW(
+ Context,
+ FieldIndex,
+ NULL,
+ 0,
+ &dwSize);
+ if (!ret)
+ return FALSE;
+ HeapFree(GetProcessHeap(), 0, pLastCallsData[NextIndex]);
+ pLastCallsData[NextIndex] = HeapAlloc(GetProcessHeap(), 0, dwSize * sizeof(WCHAR));
+ ret = SetupGetStringFieldW(
+ Context,
+ FieldIndex,
+ pLastCallsData[NextIndex],
+ dwSize,
+ NULL);
+ if (!ret)
+ return FALSE;
+
+ *Data = pLastCallsData[NextIndex];
+ NextIndex = (NextIndex + 1) % (sizeof(pLastCallsData) / sizeof(pLastCallsData[0]));
+ return TRUE;
+#endif /* !__REACTOS__ */
}
HINF WINAPI
@@ -172,6 +254,7 @@
IN DWORD InfStyle,
OUT PUINT ErrorLine)
{
+#ifdef __REACTOS__
HINF hInf = NULL;
ULONG ErrorLineUL;
NTSTATUS Status;
@@ -183,15 +266,20 @@
&ErrorLineUL);
*ErrorLine = (UINT)ErrorLineUL;
if (!NT_SUCCESS(Status))
- return NULL;
+ return INVALID_HANDLE_VALUE;
return hInf;
+#else
+ return INVALID_HANDLE_VALUE;
+#endif /* !__REACTOS__ */
}
VOID INF_SetHeap(
IN PVOID Heap)
{
+#ifdef __REACTOS__
InfSetHeap(Heap);
+#endif
}
/* EOF */
Modified: trunk/reactos/base/setup/usetup/inffile.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/inffile.…
==============================================================================
--- trunk/reactos/base/setup/usetup/inffile.h (original)
+++ trunk/reactos/base/setup/usetup/inffile.h Sat Nov 11 00:00:24 2006
@@ -26,6 +26,12 @@
#ifndef __INFFILE_H__
#define __INFFILE_H__
+
+#ifndef __REACTOS__
+
+#include <setupapi.h>
+
+#else /* __REACTOS__ */
#include <infcommon.h>
@@ -107,6 +113,8 @@
IN DWORD InfStyle,
OUT PUINT ErrorLine);
+#endif /* __REACTOS__ */
+
BOOLEAN
INF_GetData(
IN PINFCONTEXT Context,
Modified: trunk/reactos/base/setup/usetup/interface/consup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/consup.c (original)
+++ trunk/reactos/base/setup/usetup/interface/consup.c Sat Nov 11 00:00:24 2006
@@ -31,7 +31,32 @@
#define NDEBUG
#include <debug.h>
+/* GLOBALS ******************************************************************/
+
+HANDLE StdInput = INVALID_HANDLE_VALUE;
+HANDLE StdOutput = INVALID_HANDLE_VALUE;
+
+SHORT xScreen = 0;
+SHORT yScreen = 0;
+
/* FUNCTIONS *****************************************************************/
+
+BOOLEAN
+CONSOLE_Init(
+ VOID)
+{
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+ if (!HOST_InitConsole())
+ return FALSE;
+
+ StdInput = GetStdHandle(STD_INPUT_HANDLE);
+ StdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
+ if (!GetConsoleScreenBufferInfo(StdOutput, &csbi))
+ return FALSE;
+ xScreen = csbi.dwSize.X;
+ yScreen = 50;//csbi.dwSize.Y;
+ return TRUE;
+}
VOID
CONSOLE_ConInKey(
@@ -72,7 +97,7 @@
WriteConsole(
StdOutput,
szText,
- strlen(szText),
+ (ULONG)strlen(szText),
&Written,
NULL);
WriteConsole(
@@ -88,7 +113,7 @@
IN LPCSTR szFormat, ...)
{
CHAR szOut[256];
- DWORD dwWritten;
+ ULONG dwWritten;
va_list arg_ptr;
va_start(arg_ptr, szFormat);
@@ -98,7 +123,7 @@
WriteConsole(
StdOutput,
szOut,
- strlen(szOut),
+ (ULONG)strlen(szOut),
&dwWritten,
NULL);
}
@@ -121,20 +146,6 @@
GetConsoleScreenBufferInfo(StdOutput, &csbi);
return csbi.dwCursorPosition.Y;
-}
-
-VOID
-CONSOLE_GetScreenSize(
- OUT SHORT *maxx,
- OUT SHORT *maxy)
-{
- CONSOLE_SCREEN_BUFFER_INFO csbi;
-
- GetConsoleScreenBufferInfo(StdOutput, &csbi);
-
- *maxx = csbi.dwSize.X;
-
- *maxy = csbi.dwSize.Y;
}
VOID
@@ -219,7 +230,7 @@
WriteConsoleOutputCharacterA(
StdOutput,
Buffer,
- strlen(Buffer),
+ (ULONG)strlen(Buffer),
coPos,
&Written);
}
@@ -285,7 +296,7 @@
WriteConsoleOutputCharacterA(
StdOutput,
Text,
- strlen(Text),
+ (ULONG)strlen(Text),
coPos,
&Written);
}
@@ -298,14 +309,14 @@
IN LPCWSTR Text)
{
COORD coPos;
- ULONG Length;
- ULONG Written;
-
- coPos.X = x;
- coPos.Y = y;
-
- Length = wcslen(Text);
- if (Length > (ULONG)len - 1)
+ SHORT Length;
+ ULONG Written;
+
+ coPos.X = x;
+ coPos.Y = y;
+
+ Length = (SHORT)wcslen(Text);
+ if (Length > len - 1)
Length = len - 1;
FillConsoleOutputAttribute(
@@ -318,7 +329,7 @@
WriteConsoleOutputCharacterW(
StdOutput,
Text,
- Length,
+ (ULONG)Length,
coPos,
&Written);
@@ -330,7 +341,7 @@
coPos,
&Written);
- if ((ULONG)len > Length + 1)
+ if (len > Length + 1)
{
coPos.X++;
FillConsoleOutputCharacterA(
@@ -355,7 +366,7 @@
coPos.X = x;
coPos.Y = y;
- Length = strlen(Text);
+ Length = (ULONG)strlen(Text);
WriteConsoleOutputCharacterA(
StdOutput,
@@ -386,7 +397,7 @@
coPos.X = x;
coPos.Y = y;
- Length = strlen(Text);
+ Length = (ULONG)strlen(Text);
FillConsoleOutputAttribute(
StdOutput,
@@ -416,7 +427,7 @@
coPos.X = x;
coPos.Y = y;
- Length = strlen(Text);
+ Length = (ULONG)strlen(Text);
FillConsoleOutputAttribute(
StdOutput,
@@ -454,7 +465,7 @@
WriteConsoleOutputCharacterA(
StdOutput,
buffer,
- strlen(buffer),
+ (ULONG)strlen(buffer),
coPos,
&Written);
}
@@ -469,7 +480,7 @@
CHAR buffer[512];
va_list ap;
COORD coPos;
- ULONG Length;
+ SHORT Length;
ULONG Written;
va_start(ap, fmt);
@@ -479,8 +490,8 @@
coPos.X = x;
coPos.Y = y;
- Length = strlen(buffer);
- if (Length > (ULONG)len - 1)
+ Length = (SHORT)strlen(buffer);
+ if (Length > len - 1)
Length = len - 1;
WriteConsoleOutputCharacterA(
@@ -492,7 +503,7 @@
coPos.X += Length;
- if ((ULONG)len > Length)
+ if (len > Length)
{
FillConsoleOutputCharacterA(
StdOutput,
Modified: trunk/reactos/base/setup/usetup/interface/consup.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/consup.h (original)
+++ trunk/reactos/base/setup/usetup/interface/consup.h Sat Nov 11 00:00:24 2006
@@ -34,7 +34,9 @@
extern HANDLE StdInput, StdOutput;
extern SHORT xScreen, yScreen;
-#include "../native/utils/console.h"
+BOOLEAN
+CONSOLE_Init(
+ VOID);
VOID
CONSOLE_ClearScreen(VOID);
@@ -60,11 +62,6 @@
SHORT
CONSOLE_GetCursorY(VOID);
-
-VOID
-CONSOLE_GetScreenSize(
- OUT SHORT *maxx,
- OUT SHORT *maxy);
VOID
CONSOLE_InvertTextXY(
Modified: trunk/reactos/base/setup/usetup/interface/usetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/usetup.c (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c Sat Nov 11 00:00:24 2006
@@ -23,6 +23,7 @@
* PURPOSE: Text-mode setup
* PROGRAMMER: Eric Kohl
* Casper S. Hornstrup (chorns(a)users.sourceforge.net)
+ * Hervé Poussineau (hpoussin(a)reactos.org)
*/
#include "usetup.h"
@@ -73,6 +74,7 @@
HANDLE ProcessHeap;
UNICODE_STRING SourceRootPath;
+UNICODE_STRING SourcePath;
BOOLEAN IsUnattendedSetup = FALSE;
LONG UnattendDestinationDiskNumber;
LONG UnattendDestinationPartitionNumber;
@@ -86,9 +88,6 @@
static PFILE_SYSTEM_LIST FileSystemList = NULL;
-
-static UNICODE_STRING SourcePath;
-
static UNICODE_STRING InstallPath;
/* Path to the install directory */
@@ -139,13 +138,110 @@
#define POPUP_WAIT_ENTER 2
static VOID
+DrawBox(
+ IN SHORT xLeft,
+ IN SHORT yTop,
+ IN SHORT Width,
+ IN SHORT Height)
+{
+ COORD coPos;
+ ULONG Written;
+
+ /* draw upper left corner */
+ coPos.X = xLeft;
+ coPos.Y = yTop;
+ FillConsoleOutputCharacterA(
+ StdOutput,
+ 0xDA, // '+',
+ 1,
+ coPos,
+ &Written);
+
+ /* draw upper edge */
+ coPos.X = xLeft + 1;
+ coPos.Y = yTop;
+ FillConsoleOutputCharacterA(
+ StdOutput,
+ 0xC4, // '-',
+ Width - 2,
+ coPos,
+ &Written);
+
+ /* draw upper right corner */
+ coPos.X = xLeft + Width - 1;
+ coPos.Y = yTop;
+ FillConsoleOutputCharacterA(
+ StdOutput,
+ 0xBF, // '+',
+ 1,
+ coPos,
+ &Written);
+
+ /* Draw right edge, inner space and left edge */
+ for (coPos.Y = yTop + 1; coPos.Y < yTop + Height - 1; coPos.Y++)
+ {
+ coPos.X = xLeft;
+ FillConsoleOutputCharacterA(
+ StdOutput,
+ 0xB3, // '|',
+ 1,
+ coPos,
+ &Written);
+
+ coPos.X = xLeft + 1;
+ FillConsoleOutputCharacterA(
+ StdOutput,
+ ' ',
+ Width - 2,
+ coPos,
+ &Written);
+
+ coPos.X = xLeft + Width - 1;
+ FillConsoleOutputCharacterA(
+ StdOutput,
+ 0xB3, // '|',
+ 1,
+ coPos,
+ &Written);
+ }
+
+ /* draw lower left corner */
+ coPos.X = xLeft;
+ coPos.Y = yTop + Height - 1;
+ FillConsoleOutputCharacterA(
+ StdOutput,
+ 0xC0, // '+',
+ 1,
+ coPos,
+ &Written);
+
+ /* draw lower edge */
+ coPos.X = xLeft + 1;
+ coPos.Y = yTop + Height - 1;
+ FillConsoleOutputCharacterA(
+ StdOutput,
+ 0xC4, // '-',
+ Width - 2,
+ coPos,
+ &Written);
+
+ /* draw lower right corner */
+ coPos.X = xLeft + Width - 1;
+ coPos.Y = yTop + Height - 1;
+ FillConsoleOutputCharacterA(
+ StdOutput,
+ 0xD9, // '+',
+ 1,
+ coPos,
+ &Written);
+}
+
+static VOID
PopupError(PCHAR Text,
PCHAR Status,
PINPUT_RECORD Ir,
ULONG WaitEvent)
{
- SHORT xScreen;
- SHORT yScreen;
SHORT yTop;
SHORT xLeft;
COORD coPos;
@@ -195,8 +291,6 @@
MaxLength = Length;
}
- CONSOLE_GetScreenSize(&xScreen, &yScreen);
-
Width = MaxLength + 4;
Height = Lines + 2;
if (Status != NULL)
@@ -217,84 +311,7 @@
&Written);
}
- /* draw upper left corner */
- coPos.X = xLeft;
- coPos.Y = yTop;
- FillConsoleOutputCharacterA(StdOutput,
- 0xDA, // '+',
- 1,
- coPos,
- &Written);
-
- /* draw upper edge */
- coPos.X = xLeft + 1;
- coPos.Y = yTop;
- FillConsoleOutputCharacterA(StdOutput,
- 0xC4, // '-',
- Width - 2,
- coPos,
- &Written);
-
- /* draw upper right corner */
- coPos.X = xLeft + Width - 1;
- coPos.Y = yTop;
- FillConsoleOutputCharacterA(StdOutput,
- 0xBF, // '+',
- 1,
- coPos,
- &Written);
-
- /* Draw right edge, inner space and left edge */
- for (coPos.Y = yTop + 1; coPos.Y < yTop + Height - 1; coPos.Y++)
- {
- coPos.X = xLeft;
- FillConsoleOutputCharacterA(StdOutput,
- 0xB3, // '|',
- 1,
- coPos,
- &Written);
-
- coPos.X = xLeft + 1;
- FillConsoleOutputCharacterA(StdOutput,
- ' ',
- Width - 2,
- coPos,
- &Written);
-
- coPos.X = xLeft + Width - 1;
- FillConsoleOutputCharacterA(StdOutput,
- 0xB3, // '|',
- 1,
- coPos,
- &Written);
- }
-
- /* draw lower left corner */
- coPos.X = xLeft;
- coPos.Y = yTop + Height - 1;
- FillConsoleOutputCharacterA(StdOutput,
- 0xC0, // '+',
- 1,
- coPos,
- &Written);
-
- /* draw lower edge */
- coPos.X = xLeft + 1;
- coPos.Y = yTop + Height - 1;
- FillConsoleOutputCharacterA(StdOutput,
- 0xC4, // '-',
- Width - 2,
- coPos,
- &Written);
-
- /* draw lower right corner */
- coPos.X = xLeft + Width - 1;
- coPos.Y = yTop + Height - 1;
- FillConsoleOutputCharacterA(StdOutput,
- 0xD9, // '+',
- 1,
- coPos,
- &Written);
+ DrawBox(xLeft, yTop, Width, Height);
/* Print message text */
coPos.Y = yTop + 1;
@@ -628,8 +645,8 @@
#endif
/* Load txtsetup.sif from install media. */
- wcscpy(FileNameBuffer, SourceRootPath.Buffer);
- wcscat(FileNameBuffer, L"\\reactos\\txtsetup.sif");
+ wcscpy(FileNameBuffer, SourcePath.Buffer);
+ wcscat(FileNameBuffer, L"\\txtsetup.sif");
SetupInf = SetupOpenInfFileW(FileNameBuffer,
NULL,
@@ -927,7 +944,10 @@
ComputerList = CreateComputerTypeList(SetupInf);
if (ComputerList == NULL)
{
- /* FIXME: report error */
+ PopupError("Setup failed to load the computer type list.\n",
+ "ENTER = Reboot computer",
+ Ir, POPUP_WAIT_ENTER);
+ return QUIT_PAGE;
}
}
@@ -937,7 +957,10 @@
DisplayList = CreateDisplayDriverList(SetupInf);
if (DisplayList == NULL)
{
- /* FIXME: report error */
+ PopupError("Setup failed to load the display settings list.\n",
+ "ENTER = Reboot computer",
+ Ir, POPUP_WAIT_ENTER);
+ return QUIT_PAGE;
}
}
@@ -947,7 +970,10 @@
KeyboardList = CreateKeyboardDriverList(SetupInf);
if (KeyboardList == NULL)
{
- /* FIXME: report error */
+ PopupError("Setup failed to load the keyboard type list.\n",
+ "ENTER = Reboot computer",
+ Ir, POPUP_WAIT_ENTER);
+ return QUIT_PAGE;
}
}
@@ -1049,9 +1075,6 @@
static PAGE_NUMBER
ComputerSettingsPage(PINPUT_RECORD Ir)
{
- SHORT xScreen;
- SHORT yScreen;
-
CONSOLE_SetTextXY(6, 8, "You want to change the type of computer to be
installed.");
CONSOLE_SetTextXY(8, 10, "\x07 Press the UP or DOWN key to select the desired
computer type.");
@@ -1059,8 +1082,6 @@
CONSOLE_SetTextXY(8, 13, "\x07 Press the ESC key to return to the previous page
without changing");
CONSOLE_SetTextXY(8, 14, " the computer type.");
-
- CONSOLE_GetScreenSize(&xScreen, &yScreen);
DrawGenericList(ComputerList,
2,
@@ -1112,9 +1133,6 @@
static PAGE_NUMBER
DisplaySettingsPage(PINPUT_RECORD Ir)
{
- SHORT xScreen;
- SHORT yScreen;
-
CONSOLE_SetTextXY(6, 8, "You want to change the type of display to be
installed.");
CONSOLE_SetTextXY(8, 10, "\x07 Press the UP or DOWN key to select the desired
display type.");
@@ -1122,8 +1140,6 @@
CONSOLE_SetTextXY(8, 13, "\x07 Press the ESC key to return to the previous page
without changing");
CONSOLE_SetTextXY(8, 14, " the display type.");
-
- CONSOLE_GetScreenSize(&xScreen, &yScreen);
DrawGenericList(DisplayList,
2,
@@ -1177,9 +1193,6 @@
static PAGE_NUMBER
KeyboardSettingsPage(PINPUT_RECORD Ir)
{
- SHORT xScreen;
- SHORT yScreen;
-
CONSOLE_SetTextXY(6, 8, "You want to change the type of keyboard to be
installed.");
CONSOLE_SetTextXY(8, 10, "\x07 Press the UP or DOWN key to select the desired
keyboard type.");
@@ -1187,8 +1200,6 @@
CONSOLE_SetTextXY(8, 13, "\x07 Press the ESC key to return to the previous page
without changing");
CONSOLE_SetTextXY(8, 14, " the keyboard type.");
-
- CONSOLE_GetScreenSize(&xScreen, &yScreen);
DrawGenericList(KeyboardList,
2,
@@ -1240,9 +1251,6 @@
static PAGE_NUMBER
LayoutSettingsPage(PINPUT_RECORD Ir)
{
- SHORT xScreen;
- SHORT yScreen;
-
CONSOLE_SetTextXY(6, 8, "You want to change the keyboard layout to be
installed.");
CONSOLE_SetTextXY(8, 10, "\x07 Press the UP or DOWN key to select the desired
keyboard");
@@ -1250,8 +1258,6 @@
CONSOLE_SetTextXY(8, 13, "\x07 Press the ESC key to return to the previous page
without changing");
CONSOLE_SetTextXY(8, 14, " the keyboard layout.");
-
- CONSOLE_GetScreenSize(&xScreen, &yScreen);
DrawGenericList(LayoutList,
2,
@@ -1303,9 +1309,6 @@
static PAGE_NUMBER
SelectPartitionPage(PINPUT_RECORD Ir)
{
- SHORT xScreen;
- SHORT yScreen;
-
CONSOLE_SetTextXY(6, 8, "The list below shows existing partitions and unused
disk");
CONSOLE_SetTextXY(6, 9, "space for new partitions.");
@@ -1315,8 +1318,6 @@
CONSOLE_SetTextXY(8, 17, "\x07 Press D to delete an existing partition.");
CONSOLE_SetStatusText(" Please wait...");
-
- CONSOLE_GetScreenSize(&xScreen, &yScreen);
if (PartitionList == NULL)
{
@@ -1497,7 +1498,6 @@
INPUT_RECORD Ir;
COORD coPos;
ULONG Written;
- SHORT i;
CHAR Buffer[100];
ULONG Index;
CHAR ch;
@@ -1510,78 +1510,7 @@
if (Cancel != NULL)
*Cancel = FALSE;
- /* draw upper left corner */
- coPos.X = Left;
- coPos.Y = Top;
- FillConsoleOutputCharacterA(StdOutput,
- 0xDA, // '+',
- 1,
- coPos,
- &Written);
-
- /* draw upper edge */
- coPos.X = Left + 1;
- coPos.Y = Top;
- FillConsoleOutputCharacterA(StdOutput,
- 0xC4, // '-',
- Right - Left - 1,
- coPos,
- &Written);
-
- /* draw upper right corner */
- coPos.X = Right;
- coPos.Y = Top;
- FillConsoleOutputCharacterA(StdOutput,
- 0xBF, // '+',
- 1,
- coPos,
- &Written);
-
- /* draw left and right edge */
- for (i = Top + 1; i < Bottom; i++)
- {
- coPos.X = Left;
- coPos.Y = i;
- FillConsoleOutputCharacterA(StdOutput,
- 0xB3, // '|',
- 1,
- coPos,
- &Written);
-
- coPos.X = Right;
- FillConsoleOutputCharacterA(StdOutput,
- 0xB3, //'|',
- 1,
- coPos,
- &Written);
- }
-
- /* draw lower left corner */
- coPos.X = Left;
- coPos.Y = Bottom;
- FillConsoleOutputCharacterA(StdOutput,
- 0xC0, // '+',
- 1,
- coPos,
- &Written);
-
- /* draw lower edge */
- coPos.X = Left + 1;
- coPos.Y = Bottom;
- FillConsoleOutputCharacterA(StdOutput,
- 0xC4, // '-',
- Right - Left - 1,
- coPos,
- &Written);
-
- /* draw lower right corner */
- coPos.X = Right;
- coPos.Y = Bottom;
- FillConsoleOutputCharacterA(StdOutput,
- 0xD9, // '+',
- 1,
- coPos,
- &Written);
+ DrawBox(Left, Top, Right - Left + 1, Bottom - Top + 1);
/* Print message */
coPos.X = Left + 2;
@@ -1671,8 +1600,6 @@
{
PDISKENTRY DiskEntry;
PPARTENTRY PartEntry;
- SHORT xScreen;
- SHORT yScreen;
BOOLEAN Quit;
BOOLEAN Cancel;
CHAR InputBuffer[50];
@@ -1693,8 +1620,6 @@
PartEntry = PartitionList->CurrentPartition;
CONSOLE_SetStatusText (" Please wait...");
-
- CONSOLE_GetScreenSize (&xScreen, &yScreen);
CONSOLE_SetTextXY (6, 8, "You have chosen to create a new partition on");
@@ -2121,7 +2046,7 @@
if (FileSystemList == NULL)
{
- FileSystemList = CreateFileSystemList (6, 26, PartEntry->New, "FAT");
+ FileSystemList = CreateFileSystemList (6, 26, PartEntry->New,
L"FAT");
if (FileSystemList == NULL)
{
/* FIXME: show an error dialog */
@@ -2243,7 +2168,7 @@
if (PartEntry->PartInfo[0].PartitionType == PARTITION_ENTRY_UNUSED)
{
- if (strcmp(FileSystemList->Selected->FileSystem, "FAT") ==
0)
+ if (wcscmp(FileSystemList->Selected->FileSystem, L"FAT") ==
0)
{
if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (4200LL *
1024LL))
{
@@ -2287,7 +2212,7 @@
}
break;
}
- else if (FileSystemList->Selected->FormatFunc)
+ else if (!FileSystemList->Selected->FormatFunc)
return QUIT_PAGE;
}
@@ -2382,7 +2307,7 @@
CheckActiveBootPartition(PartitionList);
}
- if (strcmp(FileSystemList->Selected->FileSystem, "FAT") ==
0)
+ if (wcscmp(FileSystemList->Selected->FileSystem, L"FAT") ==
0)
{
/* FIXME: Install boot code. This is a hack! */
if ((PartEntry->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13)
@@ -2482,7 +2407,7 @@
if (!CurrentFileSystem->ChkdskFunc)
{
sprintf(Buffer,
- "Setup is currently unable to check a partition formatted in %s.\n"
+ "Setup is currently unable to check a partition formatted in %S.\n"
"\n"
" \x07 Press ENTER to continue Setup.\n"
" \x07 Press F3 to quit Setup.",
@@ -2664,11 +2589,11 @@
return(INSTALL_DIRECTORY_PAGE);
}
-
static BOOLEAN
AddSectionToCopyQueue(HINF InfFile,
PWCHAR SectionName,
PWCHAR SourceCabinet,
+ PCUNICODE_STRING DestinationPath,
PINPUT_RECORD Ir)
{
INFCONTEXT FilesContext;
@@ -2752,7 +2677,7 @@
NTSTATUS Status;
/* Add common files */
- if (!AddSectionToCopyQueue(InfFile, L"SourceFiles", SourceCabinet, Ir))
+ if (!AddSectionToCopyQueue(InfFile, L"SourceFiles", SourceCabinet,
&DestinationPath, Ir))
return FALSE;
/* Add specific files depending of computer type */
@@ -2762,7 +2687,7 @@
return FALSE;
if (AdditionalSectionName)
{
- if (!AddSectionToCopyQueue(InfFile, AdditionalSectionName, SourceCabinet, Ir))
+ if (!AddSectionToCopyQueue(InfFile, AdditionalSectionName, SourceCabinet,
&DestinationPath, Ir))
return FALSE;
}
}
@@ -2857,7 +2782,6 @@
return(TRUE);
}
-
static PAGE_NUMBER
PrepareCopyPage(PINPUT_RECORD Ir)
{
@@ -2882,7 +2806,7 @@
Ir, POPUP_WAIT_ENTER);
return(QUIT_PAGE);
}
-
+
if (!PrepareCopyPageInfFile(SetupInf, NULL, Ir))
{
return QUIT_PAGE;
@@ -2907,6 +2831,7 @@
wcscat(PathBuffer, L"\\");
wcscat(PathBuffer, KeyValue);
+#ifdef __REACTOS__
CabinetInitialize();
CabinetSetEventHandlers(NULL, NULL, NULL);
CabinetSetCabinetName(PathBuffer);
@@ -2953,6 +2878,7 @@
{
return QUIT_PAGE;
}
+#endif
}
while (SetupFindNextLine (&CabinetsContext, &CabinetsContext));
@@ -2997,8 +2923,6 @@
FileCopyPage(PINPUT_RECORD Ir)
{
COPYCONTEXT CopyContext;
- SHORT xScreen;
- SHORT yScreen;
CONSOLE_SetStatusText("
\xB3 Please wait... ");
@@ -3006,7 +2930,6 @@
CONSOLE_SetTextXY(30, 13, "installation folder.");
CONSOLE_SetTextXY(20, 14, "This may take several minutes to complete.");
- CONSOLE_GetScreenSize(&xScreen, &yScreen);
CopyContext.DestinationRootPath = DestinationRootPath.Buffer;
CopyContext.InstallPath = InstallPath.Buffer;
CopyContext.TotalOperations = 0;
@@ -3054,6 +2977,7 @@
}
/* Create the default hives */
+#ifdef __REACTOS__
Status = NtInitializeRegistry(TRUE);
if (!NT_SUCCESS(Status))
{
@@ -3063,6 +2987,9 @@
Ir, POPUP_WAIT_ENTER);
return QUIT_PAGE;
}
+#else
+ RegInitializeRegistry();
+#endif
/* Update registry */
CONSOLE_SetStatusText(" Updating registry hives...");
@@ -3484,22 +3411,13 @@
}
-static VOID
+VOID
RunUSetup(VOID)
{
INPUT_RECORD Ir;
PAGE_NUMBER Page;
- BOOL ret;
-
- ret = AllocConsole();
- if (!ret)
- ret = AttachConsole(ATTACH_PARENT_PROCESS);
-
- if (!ret
-#ifdef WIN32_USETUP
- && GetLastError() != ERROR_ACCESS_DENIED
-#endif
- )
+
+ if (!CONSOLE_Init())
{
PrintString("Unable to open the console\n\n");
PrintString("The most common cause of this is using an USB keyboard\n");
@@ -3509,17 +3427,6 @@
NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED,
0,0,0,0,0);
}
- else
- {
- CONSOLE_SCREEN_BUFFER_INFO csbi;
-
- StdInput = GetStdHandle(STD_INPUT_HANDLE);
- StdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
- GetConsoleScreenBufferInfo(StdOutput, &csbi);
- xScreen = csbi.dwSize.X;
- yScreen = csbi.dwSize.Y;
- }
-
/* Initialize global unicode strings */
RtlInitUnicodeString(&SourcePath, NULL);
@@ -3680,16 +3587,7 @@
}
-#ifdef WIN32_USETUP
-int
-main(void)
-{
- ProcessHeap = GetProcessHeap();
- RunUSetup();
- return 0;
-}
-
-#else
+#ifdef __REACTOS__
VOID NTAPI
NtProcessStartup(PPEB Peb)
@@ -3700,6 +3598,6 @@
INF_SetHeap(ProcessHeap);
RunUSetup();
}
-#endif /* !WIN32_USETUP */
+#endif /* __REACTOS__ */
/* EOF */
Added: trunk/reactos/base/setup/usetup/native/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/native/c…
==============================================================================
--- trunk/reactos/base/setup/usetup/native/console.c (added)
+++ trunk/reactos/base/setup/usetup/native/console.c Sat Nov 11 00:00:24 2006
@@ -1,0 +1,8 @@
+#include "host_native.h"
+
+BOOLEAN
+NATIVE_InitConsole(
+ VOID)
+{
+ return (BOOLEAN)AllocConsole();
+}
Propchange: trunk/reactos/base/setup/usetup/native/console.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/setup/usetup/native/fslist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/native/f…
==============================================================================
--- trunk/reactos/base/setup/usetup/native/fslist.c (added)
+++ trunk/reactos/base/setup/usetup/native/fslist.c Sat Nov 11 00:00:24 2006
@@ -1,0 +1,32 @@
+#include "usetup.h"
+
+/* Filesystem headers */
+#include <fslib/vfatlib.h>
+#include <fslib/vfatxlib.h>
+
+BOOLEAN
+NATIVE_CreateFileSystemList(
+ IN PFILE_SYSTEM_LIST List)
+{
+ FS_AddProvider(List, L"FAT", VfatFormat, VfatChkdsk);
+ return TRUE;
+}
+
+BOOLEAN
+NATIVE_FormatPartition(
+ IN PFILE_SYSTEM_ITEM FileSystem,
+ IN PCUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback)
+{
+ NTSTATUS Status;
+
+ Status = FileSystem->FormatFunc(
+ (PUNICODE_STRING)DriveRoot,
+ FMIFS_HARDDISK, /* MediaFlag */
+ NULL, /* Label */
+ FileSystem->QuickFormat, /* QuickFormat */
+ 0, /* ClusterSize */
+ Callback); /* Callback */
+
+ return NT_SUCCESS(Status);
+}
Propchange: trunk/reactos/base/setup/usetup/native/fslist.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/setup/usetup/native/host_native.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/native/h…
==============================================================================
--- trunk/reactos/base/setup/usetup/native/host_native.h (added)
+++ trunk/reactos/base/setup/usetup/native/host_native.h Sat Nov 11 00:00:24 2006
@@ -1,0 +1,16 @@
+#ifndef _HOST_NATIVE_H_
+#define _HOST_NATIVE_H_
+
+#include "usetup.h"
+
+typedef struct
+{
+ PWCHAR Source;
+ PWCHAR Target;
+} *PFILEPATHS_W;
+
+#define SetupInitDefaultQueueCallback(a) NULL
+#define SetupDefaultQueueCallbackW(a, b, c, d) TRUE
+#define SetupTermDefaultQueueCallback(a)
+
+#endif /* _HOST_NATIVE_H_ */
Propchange: trunk/reactos/base/setup/usetup/native/host_native.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/base/setup/usetup/native/utils/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/native/u…
==============================================================================
--- trunk/reactos/base/setup/usetup/native/utils/console.c (original)
+++ trunk/reactos/base/setup/usetup/native/utils/console.c Sat Nov 11 00:00:24 2006
@@ -27,24 +27,17 @@
/* INCLUDES ******************************************************************/
#include "usetup.h"
+/* Blue Driver Header */
+#include <blue/ntddblue.h>
+#include "keytrans.h"
#define NDEBUG
#include <debug.h>
-/* GLOBALS ******************************************************************/
-
-HANDLE StdInput = INVALID_HANDLE_VALUE;
-HANDLE StdOutput = INVALID_HANDLE_VALUE;
-
-SHORT xScreen = 0;
-SHORT yScreen = 0;
-
/* FUNCTIONS *****************************************************************/
-#ifndef WIN32_USETUP
-
-BOOL WINAPI
-ConAllocConsole(VOID)
+BOOL WINAPI
+AllocConsole(VOID)
{
UNICODE_STRING ScreenName = RTL_CONSTANT_STRING(L"\\??\\BlueScreen");
UNICODE_STRING KeyboardName =
RTL_CONSTANT_STRING(L"\\Device\\KeyboardClass0");
@@ -90,14 +83,14 @@
}
BOOL WINAPI
-ConAttachConsole(
+AttachConsole(
IN DWORD dwProcessId)
{
return FALSE;
}
BOOL WINAPI
-ConFreeConsole(VOID)
+FreeConsole(VOID)
{
DPRINT("FreeConsole() called\n");
@@ -112,7 +105,7 @@
}
BOOL WINAPI
-ConWriteConsole(
+WriteConsole(
IN HANDLE hConsoleOutput,
IN const VOID* lpBuffer,
IN DWORD nNumberOfCharsToWrite,
@@ -140,7 +133,7 @@
}
HANDLE WINAPI
-ConGetStdHandle(
+GetStdHandle(
IN DWORD nStdHandle)
{
switch (nStdHandle)
@@ -155,7 +148,7 @@
}
BOOL WINAPI
-ConReadConsoleInput(
+ReadConsoleInput(
IN HANDLE hConsoleInput,
OUT PINPUT_RECORD lpBuffer,
IN DWORD nLength,
@@ -188,7 +181,7 @@
}
BOOL WINAPI
-ConWriteConsoleOutputCharacterA(
+WriteConsoleOutputCharacterA(
HANDLE hConsoleOutput,
IN LPCSTR lpCharacter,
IN DWORD nLength,
@@ -235,7 +228,7 @@
}
BOOL WINAPI
-ConWriteConsoleOutputCharacterW(
+WriteConsoleOutputCharacterW(
HANDLE hConsoleOutput,
IN LPCWSTR lpCharacter,
IN DWORD nLength,
@@ -287,7 +280,7 @@
}
BOOL WINAPI
-ConFillConsoleOutputAttribute(
+FillConsoleOutputAttribute(
IN HANDLE hConsoleOutput,
IN WORD wAttribute,
IN DWORD nLength,
@@ -322,7 +315,7 @@
}
BOOL WINAPI
-ConFillConsoleOutputCharacterA(
+FillConsoleOutputCharacterA(
IN HANDLE hConsoleOutput,
IN CHAR cCharacter,
IN DWORD nLength,
@@ -356,7 +349,7 @@
}
BOOL WINAPI
-ConGetConsoleScreenBufferInfo(
+GetConsoleScreenBufferInfo(
IN HANDLE hConsoleOutput,
OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
{
@@ -378,7 +371,7 @@
}
BOOL WINAPI
-ConSetConsoleCursorInfo(
+SetConsoleCursorInfo(
IN HANDLE hConsoleOutput,
IN const CONSOLE_CURSOR_INFO* lpConsoleCursorInfo)
{
@@ -400,7 +393,7 @@
}
BOOL WINAPI
-ConSetConsoleCursorPosition(
+SetConsoleCursorPosition(
IN HANDLE hConsoleOutput,
IN COORD dwCursorPosition)
{
@@ -431,7 +424,7 @@
}
BOOL WINAPI
-ConSetConsoleTextAttribute(
+SetConsoleTextAttribute(
IN HANDLE hConsoleOutput,
IN WORD wAttributes)
{
@@ -452,6 +445,4 @@
return NT_SUCCESS(Status);
}
-#endif /* !WIN32_USETUP */
-
/* EOF */
Modified: trunk/reactos/base/setup/usetup/native/utils/console.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/native/u…
==============================================================================
--- trunk/reactos/base/setup/usetup/native/utils/console.h (original)
+++ trunk/reactos/base/setup/usetup/native/utils/console.h Sat Nov 11 00:00:24 2006
@@ -24,51 +24,18 @@
* PROGRAMMER: Eric Kohl
*/
-#ifndef __CONSOLE_H__
-#define __CONSOLE_H__
-
-#define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE)
-#define FOREGROUND_YELLOW (FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN)
-#define BACKGROUND_WHITE (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE)
-
-extern HANDLE StdInput, StdOutput;
-extern SHORT xScreen, yScreen;
-
-#ifdef WIN32_USETUP
-
-#define NtDisplayString(str) printf("%S", (str)->Buffer)
-#define NtRaiseHardError(status, a, b, c, d, e) exit(1)
-
-#else /* WIN32_USETUP */
-
-#undef WriteConsole
-#undef ReadConsoleInput
-#undef FillConsoleOutputCharacter
-
-#define AllocConsole ConAllocConsole
-#define AttachConsole ConAttachConsole
-#define FillConsoleOutputAttribute ConFillConsoleOutputAttribute
-#define FillConsoleOutputCharacterA ConFillConsoleOutputCharacterA
-#define FreeConsole ConFreeConsole
-#define GetConsoleScreenBufferInfo ConGetConsoleScreenBufferInfo
-#define GetStdHandle ConGetStdHandle
-#define ReadConsoleInput ConReadConsoleInput
-#define SetConsoleCursorInfo ConSetConsoleCursorInfo
-#define SetConsoleCursorPosition ConSetConsoleCursorPosition
-#define SetConsoleTextAttribute ConSetConsoleTextAttribute
-#define WriteConsole ConWriteConsole
-#define WriteConsoleOutputCharacterA ConWriteConsoleOutputCharacterA
-#define WriteConsoleOutputCharacterW ConWriteConsoleOutputCharacterW
+#ifndef _UTILS_CONSOLE_H_
+#define _UTILS_CONSOLE_H_
BOOL WINAPI
-ConAllocConsole(VOID);
+AllocConsole(VOID);
BOOL WINAPI
-ConAttachConsole(
+AttachConsole(
IN DWORD dwProcessId);
BOOL WINAPI
-ConFillConsoleOutputAttribute(
+FillConsoleOutputAttribute(
IN HANDLE hConsoleOutput,
IN WORD wAttribute,
IN DWORD nLength,
@@ -76,7 +43,7 @@
OUT LPDWORD lpNumberOfAttrsWritten);
BOOL WINAPI
-ConFillConsoleOutputCharacterA(
+FillConsoleOutputCharacterA(
IN HANDLE hConsoleOutput,
IN CHAR cCharacter,
IN DWORD nLength,
@@ -84,41 +51,41 @@
OUT LPDWORD lpNumberOfCharsWritten);
BOOL WINAPI
-ConFreeConsole(VOID);
+FreeConsole(VOID);
BOOL WINAPI
-ConGetConsoleScreenBufferInfo(
+GetConsoleScreenBufferInfo(
IN HANDLE hConsoleOutput,
OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo);
HANDLE WINAPI
-ConGetStdHandle(
+GetStdHandle(
IN DWORD nStdHandle);
BOOL WINAPI
-ConReadConsoleInput(
+ReadConsoleInput(
IN HANDLE hConsoleInput,
OUT PINPUT_RECORD lpBuffer,
IN DWORD nLength,
OUT LPDWORD lpNumberOfEventsRead);
BOOL WINAPI
-ConSetConsoleCursorInfo(
+SetConsoleCursorInfo(
IN HANDLE hConsoleOutput,
IN const CONSOLE_CURSOR_INFO* lpConsoleCursorInfo);
BOOL WINAPI
-ConSetConsoleCursorPosition(
+SetConsoleCursorPosition(
IN HANDLE hConsoleOutput,
IN COORD dwCursorPosition);
BOOL WINAPI
-ConSetConsoleTextAttribute(
+SetConsoleTextAttribute(
IN HANDLE hConsoleOutput,
IN WORD wAttributes);
BOOL WINAPI
-ConWriteConsole(
+WriteConsole(
IN HANDLE hConsoleOutput,
IN const VOID* lpBuffer,
IN DWORD nNumberOfCharsToWrite,
@@ -126,7 +93,7 @@
IN LPVOID lpReserved);
BOOL WINAPI
-ConWriteConsoleOutputCharacterA(
+WriteConsoleOutputCharacterA(
HANDLE hConsoleOutput,
IN LPCSTR lpCharacter,
IN DWORD nLength,
@@ -134,23 +101,13 @@
OUT LPDWORD lpNumberOfCharsWritten);
BOOL WINAPI
-ConWriteConsoleOutputCharacterA(
+WriteConsoleOutputCharacterA(
HANDLE hConsoleOutput,
IN LPCSTR lpCharacter,
IN DWORD nLength,
IN COORD dwWriteCoord,
OUT LPDWORD lpNumberOfCharsWritten);
-BOOL WINAPI
-ConWriteConsoleOutputCharacterW(
- HANDLE hConsoleOutput,
- IN LPCWSTR lpCharacter,
- IN DWORD nLength,
- IN COORD dwWriteCoord,
- OUT LPDWORD lpNumberOfCharsWritten);
-
-#endif /* !WIN32_USETUP */
-
-#endif /* __CONSOLE_H__*/
+#endif /* _UTILS_CONSOLE_H_ */
/* EOF */
Modified: trunk/reactos/base/setup/usetup/native/utils/keytrans.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/native/u…
==============================================================================
--- trunk/reactos/base/setup/usetup/native/utils/keytrans.c (original)
+++ trunk/reactos/base/setup/usetup/native/utils/keytrans.c Sat Nov 11 00:00:24 2006
@@ -26,6 +26,7 @@
* NB: Hardcoded to US keyboard
*/
#include "usetup.h"
+#include "keytrans.h"
#define NDEBUG
#include <debug.h>
Modified: trunk/reactos/base/setup/usetup/native/utils/keytrans.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/native/u…
==============================================================================
--- trunk/reactos/base/setup/usetup/native/utils/keytrans.h (original)
+++ trunk/reactos/base/setup/usetup/native/utils/keytrans.h Sat Nov 11 00:00:24 2006
@@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- * COPYRIGHT: See COPYING in the top level directory
+/* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/keytrans.h
* PURPOSE: Keyboard translation functionality
Modified: trunk/reactos/base/setup/usetup/partlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/partlist…
==============================================================================
--- trunk/reactos/base/setup/usetup/partlist.c (original)
+++ trunk/reactos/base/setup/usetup/partlist.c Sat Nov 11 00:00:24 2006
@@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- * COPYRIGHT: See COPYING in the top level directory
+/* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/partlist.c
* PURPOSE: Partition list functions
@@ -457,31 +456,33 @@
PVOID Context,
PVOID EntryContext)
{
- PBIOSDISKENTRY BiosDiskEntry = (PBIOSDISKENTRY)Context;
- PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
- PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry;
-
- if (ValueType == REG_FULL_RESOURCE_DESCRIPTOR &&
- ValueLength == sizeof(CM_FULL_RESOURCE_DESCRIPTOR) +
sizeof(CM_DISK_GEOMETRY_DEVICE_DATA))
- {
- FullResourceDescriptor = (PCM_FULL_RESOURCE_DESCRIPTOR)ValueData;
- /* FIXME:
- * Is this 'paranoia' check correct ?
- */
- if (FullResourceDescriptor->InterfaceType != InterfaceTypeUndefined ||
- FullResourceDescriptor->BusNumber != 0 ||
- FullResourceDescriptor->PartialResourceList.Count != 1 ||
- FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].Type !=
CmResourceTypeDeviceSpecific ||
-
FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].u.DeviceSpecificData.DataSize
!= sizeof(CM_DISK_GEOMETRY_DEVICE_DATA))
- {
- return STATUS_UNSUCCESSFUL;
- }
- DiskGeometry = (PCM_DISK_GEOMETRY_DEVICE_DATA)(FullResourceDescriptor + 1);
- BiosDiskEntry->DiskGeometry = *DiskGeometry;
-
- return STATUS_SUCCESS;
- }
- return STATUS_UNSUCCESSFUL;
+ PBIOSDISKENTRY BiosDiskEntry = (PBIOSDISKENTRY)Context;
+ PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
+ PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry;
+ ULONG i;
+
+ if (ValueType != REG_FULL_RESOURCE_DESCRIPTOR ||
+ ValueLength < sizeof(CM_FULL_RESOURCE_DESCRIPTOR))
+ return STATUS_UNSUCCESSFUL;
+
+ FullResourceDescriptor = (PCM_FULL_RESOURCE_DESCRIPTOR)ValueData;
+ /* Hm. Version and Revision are not set on Microsoft Windows XP... */
+ /*if (FullResourceDescriptor->PartialResourceList.Version != 1 ||
+ FullResourceDescriptor->PartialResourceList.Revision != 1)
+ return STATUS_UNSUCCESSFUL;*/
+
+ for (i = 0; i < FullResourceDescriptor->PartialResourceList.Count; i++)
+ {
+ if (FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].Type !=
CmResourceTypeDeviceSpecific ||
+ FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].u.DeviceSpecificData.DataSize
!= sizeof(CM_DISK_GEOMETRY_DEVICE_DATA))
+ continue;
+
+ DiskGeometry =
(PCM_DISK_GEOMETRY_DEVICE_DATA)&FullResourceDescriptor->PartialResourceList.PartialDescriptors[i
+ 1];
+ BiosDiskEntry->DiskGeometry = *DiskGeometry;
+
+ return STATUS_SUCCESS;
+ }
+ return STATUS_UNSUCCESSFUL;
}
NTSTATUS
@@ -493,31 +494,36 @@
PVOID Context,
PVOID EntryContext)
{
- PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
- PCM_INT13_DRIVE_PARAMETER* Int13Drives = (PCM_INT13_DRIVE_PARAMETER*)Context;
-
- if (ValueType == REG_FULL_RESOURCE_DESCRIPTOR &&
- ValueLength >= sizeof (CM_FULL_RESOURCE_DESCRIPTOR) &&
- (ValueLength - sizeof(CM_FULL_RESOURCE_DESCRIPTOR)) %
sizeof(CM_INT13_DRIVE_PARAMETER) == 0)
- {
- FullResourceDescriptor = (PCM_FULL_RESOURCE_DESCRIPTOR)ValueData;
- if (FullResourceDescriptor->InterfaceType != InterfaceTypeUndefined ||
- FullResourceDescriptor->BusNumber != -1 ||
- FullResourceDescriptor->PartialResourceList.Count != 1 ||
- FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].Type !=
CmResourceTypeDeviceSpecific)
- {
- return STATUS_UNSUCCESSFUL;
- }
- *Int13Drives = RtlAllocateHeap(ProcessHeap, 0, ValueLength - sizeof
(CM_FULL_RESOURCE_DESCRIPTOR));
- if (*Int13Drives == NULL)
- {
- return STATUS_NO_MEMORY;
- }
- memcpy(*Int13Drives, FullResourceDescriptor + 1, ValueLength - sizeof
(CM_FULL_RESOURCE_DESCRIPTOR));
- return STATUS_SUCCESS;
- }
- return STATUS_UNSUCCESSFUL;
-
+ PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
+ PCM_INT13_DRIVE_PARAMETER* Int13Drives = (PCM_INT13_DRIVE_PARAMETER*)Context;
+ ULONG i;
+
+ if (ValueType != REG_FULL_RESOURCE_DESCRIPTOR ||
+ ValueLength < sizeof (CM_FULL_RESOURCE_DESCRIPTOR))
+ return STATUS_UNSUCCESSFUL;
+
+ FullResourceDescriptor = (PCM_FULL_RESOURCE_DESCRIPTOR)ValueData;
+ /* Hm. Version and Revision are not set on Microsoft Windows XP... */
+ /*if (FullResourceDescriptor->PartialResourceList.Version != 1 ||
+ FullResourceDescriptor->PartialResourceList.Revision != 1)
+ return STATUS_UNSUCCESSFUL;*/
+
+ for (i = 0; i < FullResourceDescriptor->PartialResourceList.Count; i++)
+ {
+ if (FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].Type !=
CmResourceTypeDeviceSpecific ||
+ FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].u.DeviceSpecificData.DataSize
!= sizeof(CM_INT13_DRIVE_PARAMETER))
+ continue;
+
+ *Int13Drives = RtlAllocateHeap(ProcessHeap, 0, sizeof(CM_INT13_DRIVE_PARAMETER));
+ if (*Int13Drives == NULL)
+ return STATUS_NO_MEMORY;
+ memcpy(
+ *Int13Drives,
+ &FullResourceDescriptor->PartialResourceList.PartialDescriptors[i + 1],
+ sizeof(CM_INT13_DRIVE_PARAMETER));
+ return STATUS_SUCCESS;
+ }
+ return STATUS_UNSUCCESSFUL;
}
#define ROOT_NAME
L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter"
@@ -948,7 +954,7 @@
&Iosb,
FILE_SHARE_READ,
FILE_SYNCHRONOUS_IO_NONALERT);
- if (NT_SUCCESS(Status))
+ if (NT_SUCCESS(Status))
{
AddDiskToList (FileHandle,
DiskNumber,
Modified: trunk/reactos/base/setup/usetup/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/registry…
==============================================================================
--- trunk/reactos/base/setup/usetup/registry.c (original)
+++ trunk/reactos/base/setup/usetup/registry.c Sat Nov 11 00:00:24 2006
@@ -31,6 +31,7 @@
#define NDEBUG
#include <debug.h>
+#ifdef __REACTOS__
#define FLG_ADDREG_BINVALUETYPE 0x00000001
#define FLG_ADDREG_NOCLOBBER 0x00000002
#define FLG_ADDREG_DELVAL 0x00000004
@@ -44,6 +45,7 @@
#define FLG_ADDREG_TYPE_DWORD (0x00010000 | FLG_ADDREG_BINVALUETYPE)
#define FLG_ADDREG_TYPE_NONE (0x00020000 | FLG_ADDREG_BINVALUETYPE)
#define FLG_ADDREG_TYPE_MASK (0xFFFF0000 | FLG_ADDREG_BINVALUETYPE)
+#endif
#include <pshpack1.h>
@@ -201,11 +203,11 @@
#if 0
if (ValueName)
{
- RegDeleteValueW( hkey, value );
+ RegDeleteValueW( KeyHandle, ValueName );
}
else
{
- RegDeleteKeyW( hkey, NULL );
+ RegDeleteKeyW( KeyHandle, NULL );
}
#endif
return TRUE;
@@ -308,12 +310,16 @@
DPRINT("setting dword %wZ to %lx\n", ValueName, dw);
+#ifdef __REACTOS__
NtSetValueKey (KeyHandle,
ValueName,
0,
Type,
(PVOID)&dw,
sizeof(ULONG));
+#else
+ RegSetValueExW(KeyHandle, ValueName, 0, Type, (const UCHAR*)&dw, sizeof(ULONG));
+#endif
}
else
{
@@ -321,21 +327,29 @@
if (Str)
{
+#ifdef __REACTOS__
NtSetValueKey (KeyHandle,
ValueName,
0,
Type,
(PVOID)Str,
Size * sizeof(WCHAR));
+#else
+ RegSetValueExW(KeyHandle, ValueName, 0, Type, (const UCHAR*)Str, Size *
sizeof(WCHAR));
+#endif
}
else
{
+#ifdef __REACTOS__
NtSetValueKey (KeyHandle,
ValueName,
0,
Type,
(PVOID)&EmptyStr,
sizeof(WCHAR));
+#else
+ RegSetValueExW(KeyHandle, ValueName, 0, Type, (const UCHAR*)&EmptyStr,
sizeof(WCHAR));
+#endif
}
}
RtlFreeHeap (ProcessHeap, 0, Str);
@@ -357,12 +371,16 @@
SetupGetBinaryField (Context, 5, Data, Size, NULL);
}
+#ifdef __REACTOS__
NtSetValueKey (KeyHandle,
ValueName,
0,
Type,
(PVOID)Data,
Size);
+#else
+ RegSetValueExW(KeyHandle, ValueName, 0, Type, (const UCHAR*)Data, Size);
+#endif
RtlFreeHeap (ProcessHeap, 0, Data);
}
@@ -370,7 +388,7 @@
return TRUE;
}
-
+#ifdef __REACTOS__
NTSTATUS
CreateNestedKey (PHANDLE KeyHandle,
ACCESS_MASK DesiredAccess,
@@ -465,7 +483,7 @@
return Status;
}
-
+#endif
/***********************************************************************
* registry_callback
@@ -514,6 +532,7 @@
DPRINT("Flags: %lx\n", Flags);
+#ifdef __REACTOS__
RtlInitUnicodeString (&Name,
Buffer);
@@ -545,6 +564,26 @@
continue;
}
}
+#else
+ if (Delete || (Flags & FLG_ADDREG_OVERWRITEONLY))
+ {
+ LONG rc = RegOpenKeyW(NULL, Buffer, &KeyHandle);
+ if (rc != ERROR_SUCCESS)
+ {
+ DPRINT("RegOpenKeyW(%S) failed (error %lu)\n", Buffer, rc);
+ continue; /* ignore if it doesn't exist */
+ }
+ }
+ else
+ {
+ LONG rc = RegCreateKeyW(NULL, Buffer, &KeyHandle);
+ if (rc != ERROR_SUCCESS)
+ {
+ DPRINT("RegCreateKeyW(%S) failed (error %lu)\n", Buffer, rc);
+ continue;
+ }
+ }
+#endif
/* get value name */
if (SetupGetStringFieldW (&Context, 3, Buffer, MAX_INF_STRING_LENGTH,
NULL))
@@ -565,7 +604,9 @@
return FALSE;
}
+#ifdef __REACTOS__
NtClose (KeyHandle);
+#endif
}
}
@@ -583,8 +624,8 @@
UINT ErrorLine;
/* Load inf file from install media. */
- wcscpy(FileNameBuffer, SourceRootPath.Buffer);
- wcscat(FileNameBuffer, L"\\reactos\\");
+ wcscpy(FileNameBuffer, SourcePath.Buffer);
+ wcscat(FileNameBuffer, L"\\");
wcscat(FileNameBuffer, Filename);
hInf = SetupOpenInfFileW(
Modified: trunk/reactos/base/setup/usetup/usetup.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.h…
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.h (original)
+++ trunk/reactos/base/setup/usetup/usetup.h Sat Nov 11 00:00:24 2006
@@ -45,9 +45,6 @@
/* DDK Disk Headers */
#include <ntddscsi.h>
-/* Blue Driver Header */
-#include <blue/ntddblue.h>
-
/* Helper Header */
#include <reactos/helper.h>
@@ -56,13 +53,13 @@
/* Internal Headers */
#include "interface/consup.h"
-#include "native/utils/console.h"
-#include "native/utils/keytrans.h"
#include "partlist.h"
#include "inffile.h"
#include "inicache.h"
#include "progress.h"
+#ifdef __REACTOS__
#include "filequeue.h"
+#endif
#include "bootsup.h"
#include "registry.h"
#include "fslist.h"
@@ -73,11 +70,12 @@
#include "drivesup.h"
#include "genlist.h"
#include "settings.h"
+#include "host.h"
extern HANDLE ProcessHeap;
extern UNICODE_STRING SourceRootPath;
+extern UNICODE_STRING SourcePath;
extern BOOLEAN IsUnattendedSetup;
-
#endif /* __USETUP_H__*/
Modified: trunk/reactos/base/setup/usetup/usetup.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.r…
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.rbuild (original)
+++ trunk/reactos/base/setup/usetup/usetup.rbuild Sat Nov 11 00:00:24 2006
@@ -8,38 +8,38 @@
<define name="_DISABLE_TIDENTS" />
<define name="_WIN32_WINNT">0x0502</define>
<define name="__NO_CTYPE_INLINES" />
+ <define name="__REACTOS__" />
<linkerflag>-lgcc</linkerflag>
<library>zlib</library>
<library>inflib</library>
<library>vfatlib</library>
<library>ntdll</library>
- <pch>usetup.h</pch>
- <compilationunit name="unit.c">
- <directory name="interface">
- <file>consup.c</file>
- <file>usetup.c</file>
+ <directory name="interface">
+ <file>consup.c</file>
+ <file>usetup.c</file>
+ </directory>
+ <directory name="native">
+ <directory name="utils">
+ <file>console.c</file>
+ <file>keytrans.c</file>
</directory>
- <directory name="native">
- <directory name="utils">
- <file>console.c</file>
- <file>keytrans.c</file>
- </directory>
- </directory>
- <file>bootsup.c</file>
- <file>cabinet.c</file>
- <file>chkdsk.c</file>
- <file>drivesup.c</file>
- <file>filequeue.c</file>
- <file>filesup.c</file>
- <file>format.c</file>
+ <file>console.c</file>
<file>fslist.c</file>
- <file>genlist.c</file>
- <file>inffile.c</file>
- <file>inicache.c</file>
- <file>partlist.c</file>
- <file>progress.c</file>
- <file>registry.c</file>
- <file>settings.c</file>
- </compilationunit>
+ </directory>
+ <file>bootsup.c</file>
+ <file>cabinet.c</file>
+ <file>chkdsk.c</file>
+ <file>drivesup.c</file>
+ <file>filequeue.c</file>
+ <file>filesup.c</file>
+ <file>format.c</file>
+ <file>fslist.c</file>
+ <file>genlist.c</file>
+ <file>inffile.c</file>
+ <file>inicache.c</file>
+ <file>partlist.c</file>
+ <file>progress.c</file>
+ <file>registry.c</file>
+ <file>settings.c</file>
<file>usetup.rc</file>
</module>
Modified: trunk/reactos/base/setup/usetup/usetup.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.r…
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.rc (original)
+++ trunk/reactos/base/setup/usetup/usetup.rc Sat Nov 11 00:00:24 2006
@@ -3,4 +3,6 @@
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Setup\0"
#define REACTOS_STR_INTERNAL_NAME "usetup\0"
#define REACTOS_STR_ORIGINAL_FILENAME "usetup.dll\0"
+#ifdef __REACTOS__
#include <reactos/version.rc>
+#endif