mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
Fix option selection in bootcd
Fix SetupOpenFileQueue, SetupCloseFileQueue and SetupCommitFileQueueW prototypes to match setupapi.dll ones svn path=/trunk/; revision=23862
This commit is contained in:
@@ -684,7 +684,7 @@ CONSOLE_NormalTextXY(
|
||||
|
||||
FillConsoleOutputAttribute(
|
||||
StdOutput,
|
||||
FOREGROUND_BLUE | BACKGROUND_WHITE,
|
||||
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||
col,
|
||||
coPos,
|
||||
&Written);
|
||||
|
||||
@@ -63,6 +63,10 @@ extern SHORT xScreen, yScreen;
|
||||
BOOL WINAPI
|
||||
ConAllocConsole(VOID);
|
||||
|
||||
BOOL WINAPI
|
||||
ConAttachConsole(
|
||||
IN DWORD dwProcessId);
|
||||
|
||||
BOOL WINAPI
|
||||
ConFillConsoleOutputAttribute(
|
||||
IN HANDLE hConsoleOutput,
|
||||
|
||||
@@ -60,7 +60,7 @@ typedef struct _FILEQUEUEHEADER
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
HSPFILEQ
|
||||
HSPFILEQ WINAPI
|
||||
SetupOpenFileQueue(VOID)
|
||||
{
|
||||
PFILEQUEUEHEADER QueueHeader;
|
||||
@@ -81,14 +81,14 @@ SetupOpenFileQueue(VOID)
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
VOID WINAPI
|
||||
SetupCloseFileQueue(HSPFILEQ QueueHandle)
|
||||
{
|
||||
PFILEQUEUEHEADER QueueHeader;
|
||||
PQUEUEENTRY Entry;
|
||||
|
||||
if (QueueHandle == NULL)
|
||||
return(FALSE);
|
||||
return;
|
||||
|
||||
QueueHeader = (PFILEQUEUEHEADER)QueueHandle;
|
||||
|
||||
@@ -133,8 +133,6 @@ SetupCloseFileQueue(HSPFILEQ QueueHandle)
|
||||
RtlFreeHeap(ProcessHeap,
|
||||
0,
|
||||
QueueHeader);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -314,21 +312,36 @@ SetupQueueCopy(HSPFILEQ QueueHandle,
|
||||
}
|
||||
|
||||
|
||||
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 @@ SetupCommitFileQueue(HSPFILEQ QueueHandle,
|
||||
|
||||
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 @@ SetupCommitFileQueue(HSPFILEQ QueueHandle,
|
||||
|
||||
MsgHandler(Context,
|
||||
SPFILENOTIFY_STARTCOPY,
|
||||
(PVOID)Entry->SourceFilename,
|
||||
(PVOID)FILEOP_COPY);
|
||||
(UINT_PTR)Entry->SourceFilename,
|
||||
FILEOP_COPY);
|
||||
|
||||
if (Entry->SourceCabinet != NULL)
|
||||
{
|
||||
@@ -411,16 +424,16 @@ SetupCommitFileQueue(HSPFILEQ QueueHandle,
|
||||
{
|
||||
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 @@ SetupCommitFileQueue(HSPFILEQ QueueHandle,
|
||||
|
||||
MsgHandler(Context,
|
||||
SPFILENOTIFY_ENDSUBQUEUE,
|
||||
(PVOID)FILEOP_COPY,
|
||||
NULL);
|
||||
FILEOP_COPY,
|
||||
0);
|
||||
|
||||
MsgHandler(Context,
|
||||
SPFILENOTIFY_ENDQUEUE,
|
||||
NULL,
|
||||
NULL);
|
||||
0,
|
||||
0);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
@@ -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 @@ SetupQueueCopy(HSPFILEQ QueueHandle,
|
||||
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__ */
|
||||
|
||||
@@ -71,6 +71,8 @@ typedef enum _PAGE_NUMBER
|
||||
|
||||
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 @@ PrepareCopyPage(PINPUT_RECORD Ir)
|
||||
}
|
||||
|
||||
|
||||
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 @@ FileCopyPage(PINPUT_RECORD Ir)
|
||||
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 @@ FileCopyPage(PINPUT_RECORD Ir)
|
||||
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 @@ RunUSetup(VOID)
|
||||
SignalInitEvent();
|
||||
|
||||
ret = AllocConsole();
|
||||
if (ret)
|
||||
if (!ret)
|
||||
ret = AttachConsole(ATTACH_PARENT_PROCESS);
|
||||
|
||||
if (!ret
|
||||
|
||||
Reference in New Issue
Block a user