Author: hpoussin
Date: Fri Sep 1 13:53:33 2006
New Revision: 23862
URL:
http://svn.reactos.org/svn/reactos?rev=23862&view=rev
Log:
Fix option selection in bootcd
Fix SetupOpenFileQueue, SetupCloseFileQueue and SetupCommitFileQueueW prototypes to match
setupapi.dll ones
Modified:
trunk/reactos/base/setup/usetup/console.c
trunk/reactos/base/setup/usetup/console.h
trunk/reactos/base/setup/usetup/filequeue.c
trunk/reactos/base/setup/usetup/filequeue.h
trunk/reactos/base/setup/usetup/usetup.c
Modified: trunk/reactos/base/setup/usetup/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/console.…
==============================================================================
--- trunk/reactos/base/setup/usetup/console.c (original)
+++ trunk/reactos/base/setup/usetup/console.c Fri Sep 1 13:53:33 2006
@@ -684,7 +684,7 @@
FillConsoleOutputAttribute(
StdOutput,
- FOREGROUND_BLUE | BACKGROUND_WHITE,
+ FOREGROUND_WHITE | BACKGROUND_BLUE,
col,
coPos,
&Written);
Modified: trunk/reactos/base/setup/usetup/console.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/console.…
==============================================================================
--- trunk/reactos/base/setup/usetup/console.h (original)
+++ trunk/reactos/base/setup/usetup/console.h Fri Sep 1 13:53:33 2006
@@ -64,6 +64,10 @@
ConAllocConsole(VOID);
BOOL WINAPI
+ConAttachConsole(
+ IN DWORD dwProcessId);
+
+BOOL WINAPI
ConFillConsoleOutputAttribute(
IN HANDLE hConsoleOutput,
IN WORD wAttribute,
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 Fri Sep 1 13:53:33 2006
@@ -60,7 +60,7 @@
/* FUNCTIONS ****************************************************************/
-HSPFILEQ
+HSPFILEQ WINAPI
SetupOpenFileQueue(VOID)
{
PFILEQUEUEHEADER QueueHeader;
@@ -81,14 +81,14 @@
}
-BOOL
+VOID WINAPI
SetupCloseFileQueue(HSPFILEQ QueueHandle)
{
PFILEQUEUEHEADER QueueHeader;
PQUEUEENTRY Entry;
if (QueueHandle == NULL)
- return(FALSE);
+ return;
QueueHeader = (PFILEQUEUEHEADER)QueueHandle;
@@ -133,8 +133,6 @@
RtlFreeHeap(ProcessHeap,
0,
QueueHeader);
-
- return(TRUE);
}
@@ -314,21 +312,36 @@
}
-BOOL
-SetupCommitFileQueue(HSPFILEQ QueueHandle,
- PCWSTR TargetRootPath,
- PCWSTR TargetPath,
- PSP_FILE_CALLBACK MsgHandler,
+typedef struct _COPYCONTEXT
+{
+ LPCWSTR DestinationRootPath; /* Not owned by this structure */
+ LPCWSTR InstallPath; /* Not owned by this structure */
+ ULONG TotalOperations;
+ ULONG CompletedOperations;
+ PPROGRESSBAR ProgressBar;
+} COPYCONTEXT, *PCOPYCONTEXT;
+
+BOOL WINAPI
+SetupCommitFileQueueW(HWND Owner,
+ HSPFILEQ QueueHandle,
+ PSP_FILE_CALLBACK_W MsgHandler,
PVOID Context)
{
WCHAR CabinetName[MAX_PATH];
PFILEQUEUEHEADER QueueHeader;
PQUEUEENTRY Entry;
NTSTATUS Status;
+ PCWSTR TargetRootPath, TargetPath;
WCHAR FileSrcPath[MAX_PATH];
WCHAR FileDstPath[MAX_PATH];
+ DPRINT1("Context %p\n", Context);
+ TargetRootPath = ((PCOPYCONTEXT)Context)->DestinationRootPath;
+ DPRINT1("TargetRootPath %S\n", TargetRootPath);
+ TargetPath = ((PCOPYCONTEXT)Context)->InstallPath;
+ DPRINT1("TargetPath %S\n", TargetPath);
+
if (QueueHandle == NULL)
return(FALSE);
@@ -336,13 +349,13 @@
MsgHandler(Context,
SPFILENOTIFY_STARTQUEUE,
- NULL,
- NULL);
+ 0,
+ 0);
MsgHandler(Context,
SPFILENOTIFY_STARTSUBQUEUE,
- (PVOID)FILEOP_COPY,
- (PVOID)QueueHeader->CopyCount);
+ FILEOP_COPY,
+ QueueHeader->CopyCount);
/* Commit copy queue */
Entry = QueueHeader->CopyHead;
@@ -389,8 +402,8 @@
MsgHandler(Context,
SPFILENOTIFY_STARTCOPY,
- (PVOID)Entry->SourceFilename,
- (PVOID)FILEOP_COPY);
+ (UINT_PTR)Entry->SourceFilename,
+ FILEOP_COPY);
if (Entry->SourceCabinet != NULL)
{
@@ -411,16 +424,16 @@
{
MsgHandler(Context,
SPFILENOTIFY_COPYERROR,
- (PVOID)Entry->SourceFilename,
- (PVOID)FILEOP_COPY);
+ (UINT_PTR)Entry->SourceFilename,
+ FILEOP_COPY);
}
else
{
MsgHandler(Context,
SPFILENOTIFY_ENDCOPY,
- (PVOID)Entry->SourceFilename,
- (PVOID)FILEOP_COPY);
+ (UINT_PTR)Entry->SourceFilename,
+ FILEOP_COPY);
}
Entry = Entry->Next;
@@ -428,13 +441,13 @@
MsgHandler(Context,
SPFILENOTIFY_ENDSUBQUEUE,
- (PVOID)FILEOP_COPY,
- NULL);
+ FILEOP_COPY,
+ 0);
MsgHandler(Context,
SPFILENOTIFY_ENDQUEUE,
- NULL,
- NULL);
+ 0,
+ 0);
return(TRUE);
}
Modified: trunk/reactos/base/setup/usetup/filequeue.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/filequeu…
==============================================================================
--- trunk/reactos/base/setup/usetup/filequeue.h (original)
+++ trunk/reactos/base/setup/usetup/filequeue.h Fri Sep 1 13:53:33 2006
@@ -53,19 +53,32 @@
typedef PVOID HSPFILEQ;
-typedef ULONG (*PSP_FILE_CALLBACK)(PVOID Context,
- ULONG Notification,
- PVOID Param1,
- PVOID Param2);
+typedef UINT (CALLBACK* PSP_FILE_CALLBACK_W)(PVOID Context,
+ UINT Notification,
+ UINT_PTR Param1,
+ UINT_PTR Param2);
/* FUNCTIONS ****************************************************************/
-HSPFILEQ
+HSPFILEQ WINAPI
SetupOpenFileQueue(VOID);
-BOOL
-SetupCloseFileQueue(HSPFILEQ QueueHandle);
+VOID WINAPI
+SetupCloseFileQueue(
+ IN HSPFILEQ QueueHandle);
+
+BOOL WINAPI
+SetupQueueCopyWNew(
+ IN HSPFILEQ QueueHandle,
+ IN PCWSTR SourceRootPath,
+ IN PCWSTR SourcePath,
+ IN PCWSTR SourceFileName,
+ IN PCWSTR SourceDescription,
+ IN PCWSTR SourceTagFile,
+ IN PCWSTR TargetDirectory,
+ IN PCWSTR TargetFileName,
+ IN DWORD CopyStyle);
BOOL
SetupQueueCopy(HSPFILEQ QueueHandle,
@@ -76,11 +89,10 @@
PCWSTR TargetDirectory,
PCWSTR TargetFilename);
-BOOL
-SetupCommitFileQueue(HSPFILEQ QueueHandle,
- PCWSTR TargetRootPath,
- PCWSTR TargetPath,
- PSP_FILE_CALLBACK MsgHandler,
+BOOL WINAPI
+SetupCommitFileQueueW(HWND Owner,
+ HSPFILEQ QueueHandle,
+ PSP_FILE_CALLBACK_W MsgHandler,
PVOID Context);
#endif /* __FILEQUEUE_H__ */
Modified: trunk/reactos/base/setup/usetup/usetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.c…
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.c (original)
+++ trunk/reactos/base/setup/usetup/usetup.c Fri Sep 1 13:53:33 2006
@@ -71,6 +71,8 @@
typedef struct _COPYCONTEXT
{
+ LPCWSTR DestinationRootPath; /* Not owned by this structure */
+ LPCWSTR InstallPath; /* Not owned by this structure */
ULONG TotalOperations;
ULONG CompletedOperations;
PPROGRESSBAR ProgressBar;
@@ -2920,11 +2922,11 @@
}
-static ULONG
+static UINT CALLBACK
FileCopyCallback(PVOID Context,
- ULONG Notification,
- PVOID Param1,
- PVOID Param2)
+ UINT Notification,
+ UINT_PTR Param1,
+ UINT_PTR Param2)
{
PCOPYCONTEXT CopyContext;
@@ -2967,6 +2969,8 @@
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;
CopyContext.CompletedOperations = 0;
CopyContext.ProgressBar = CreateProgressBar(13,
@@ -2975,10 +2979,9 @@
yScreen - 20,
"Setup is copying files...");
- SetupCommitFileQueue(SetupFileQueue,
- DestinationRootPath.Buffer,
- InstallPath.Buffer,
- (PSP_FILE_CALLBACK)FileCopyCallback,
+ SetupCommitFileQueueW(NULL,
+ SetupFileQueue,
+ FileCopyCallback,
&CopyContext);
SetupCloseFileQueue(SetupFileQueue);
@@ -3489,7 +3492,7 @@
SignalInitEvent();
ret = AllocConsole();
- if (ret)
+ if (!ret)
ret = AttachConsole(ATTACH_PARENT_PROCESS);
if (!ret