mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:35:45 +00:00
[USETUP] Improve SetupCommitFileQueueW() to make it compatible with its Win32 counterpart.
This means, call in the correct order the user callback with the correct parameters (in particular the correct paths for file copy operations), and check also for the callback returned value to know whether or not to continue the file operations.
This commit is contained in:
parent
8f1ab791fa
commit
13998a15c9
2 changed files with 220 additions and 89 deletions
|
@ -621,12 +621,12 @@ SetupCommitFileQueueW(
|
||||||
IN PVOID Context OPTIONAL)
|
IN PVOID Context OPTIONAL)
|
||||||
{
|
{
|
||||||
BOOL Success = TRUE; // Suppose success
|
BOOL Success = TRUE; // Suppose success
|
||||||
|
UINT Result;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PFILEQUEUEHEADER QueueHeader;
|
PFILEQUEUEHEADER QueueHeader;
|
||||||
PLIST_ENTRY ListEntry;
|
PLIST_ENTRY ListEntry;
|
||||||
PQUEUEENTRY Entry;
|
PQUEUEENTRY Entry;
|
||||||
FILEPATHS_W FilePathInfo;
|
FILEPATHS_W FilePathInfo;
|
||||||
WCHAR CabinetName[MAX_PATH];
|
|
||||||
WCHAR FileSrcPath[MAX_PATH];
|
WCHAR FileSrcPath[MAX_PATH];
|
||||||
WCHAR FileDstPath[MAX_PATH];
|
WCHAR FileDstPath[MAX_PATH];
|
||||||
|
|
||||||
|
@ -635,32 +635,40 @@ SetupCommitFileQueueW(
|
||||||
|
|
||||||
QueueHeader = (PFILEQUEUEHEADER)QueueHandle;
|
QueueHeader = (PFILEQUEUEHEADER)QueueHandle;
|
||||||
|
|
||||||
MsgHandler(Context,
|
Result = MsgHandler(Context,
|
||||||
SPFILENOTIFY_STARTQUEUE,
|
SPFILENOTIFY_STARTQUEUE,
|
||||||
(UINT_PTR)Owner,
|
(UINT_PTR)Owner,
|
||||||
0);
|
0);
|
||||||
|
if (Result == FILEOP_ABORT)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Commit the delete queue
|
* Commit the delete queue
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MsgHandler(Context,
|
if (!IsListEmpty(&QueueHeader->DeleteQueue))
|
||||||
SPFILENOTIFY_STARTSUBQUEUE,
|
{
|
||||||
FILEOP_DELETE,
|
Result = MsgHandler(Context,
|
||||||
QueueHeader->DeleteCount);
|
SPFILENOTIFY_STARTSUBQUEUE,
|
||||||
|
FILEOP_DELETE,
|
||||||
|
QueueHeader->DeleteCount);
|
||||||
|
if (Result == FILEOP_ABORT)
|
||||||
|
{
|
||||||
|
Success = FALSE;
|
||||||
|
goto Quit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ListEntry = QueueHeader->DeleteQueue.Flink;
|
for (ListEntry = QueueHeader->DeleteQueue.Flink;
|
||||||
while (ListEntry != &QueueHeader->DeleteQueue)
|
ListEntry != &QueueHeader->DeleteQueue;
|
||||||
|
ListEntry = ListEntry->Flink)
|
||||||
{
|
{
|
||||||
Entry = CONTAINING_RECORD(ListEntry, QUEUEENTRY, ListEntry);
|
Entry = CONTAINING_RECORD(ListEntry, QUEUEENTRY, ListEntry);
|
||||||
ListEntry = ListEntry->Flink;
|
|
||||||
|
|
||||||
/* Build the full target path */
|
/* Build the full target path */
|
||||||
CombinePaths(FileDstPath, ARRAYSIZE(FileDstPath), 2,
|
CombinePaths(FileDstPath, ARRAYSIZE(FileDstPath), 2,
|
||||||
Entry->TargetDirectory, Entry->TargetFileName);
|
Entry->TargetDirectory, Entry->TargetFileName);
|
||||||
// RtlStringCchCopyW(FileDstPath, ARRAYSIZE(FileDstPath), Entry->TargetDirectory);
|
|
||||||
// ConcatPaths(FileDstPath, ARRAYSIZE(FileDstPath), 1, Entry->TargetFileName);
|
|
||||||
|
|
||||||
DPRINT1(" -----> " "Delete: '%S'\n", FileDstPath);
|
DPRINT1(" -----> " "Delete: '%S'\n", FileDstPath);
|
||||||
|
|
||||||
|
@ -669,52 +677,85 @@ SetupCommitFileQueueW(
|
||||||
FilePathInfo.Win32Error = STATUS_SUCCESS;
|
FilePathInfo.Win32Error = STATUS_SUCCESS;
|
||||||
FilePathInfo.Flags = 0; // FIXME: Unused yet...
|
FilePathInfo.Flags = 0; // FIXME: Unused yet...
|
||||||
|
|
||||||
MsgHandler(Context,
|
Result = MsgHandler(Context,
|
||||||
SPFILENOTIFY_STARTDELETE,
|
SPFILENOTIFY_STARTDELETE,
|
||||||
(UINT_PTR)&FilePathInfo,
|
(UINT_PTR)&FilePathInfo,
|
||||||
FILEOP_DELETE);
|
FILEOP_DELETE);
|
||||||
|
if (Result == FILEOP_ABORT)
|
||||||
|
{
|
||||||
|
Success = FALSE;
|
||||||
|
goto EndDelete;
|
||||||
|
}
|
||||||
|
else if (Result == FILEOP_SKIP)
|
||||||
|
goto EndDelete;
|
||||||
|
// else (Result == FILEOP_DOIT)
|
||||||
|
|
||||||
|
RetryDelete:
|
||||||
/* Force-delete the file */
|
/* Force-delete the file */
|
||||||
Status = SetupDeleteFile(FileDstPath, TRUE);
|
Status = SetupDeleteFile(FileDstPath, TRUE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* An error happened */
|
/* An error happened */
|
||||||
FilePathInfo.Win32Error = (UINT)Status;
|
FilePathInfo.Win32Error = (UINT)Status;
|
||||||
MsgHandler(Context,
|
Result = MsgHandler(Context,
|
||||||
SPFILENOTIFY_DELETEERROR,
|
SPFILENOTIFY_DELETEERROR,
|
||||||
(UINT_PTR)&FilePathInfo,
|
(UINT_PTR)&FilePathInfo,
|
||||||
0);
|
0);
|
||||||
|
if (Result == FILEOP_ABORT)
|
||||||
|
{
|
||||||
|
Success = FALSE;
|
||||||
|
goto EndDelete;
|
||||||
|
}
|
||||||
|
else if (Result == FILEOP_SKIP)
|
||||||
|
goto EndDelete;
|
||||||
|
else if (Result == FILEOP_RETRY)
|
||||||
|
goto RetryDelete;
|
||||||
|
|
||||||
Success = FALSE;
|
Success = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EndDelete:
|
||||||
/* This notification is always sent, even in case of error */
|
/* This notification is always sent, even in case of error */
|
||||||
FilePathInfo.Win32Error = (UINT)Status;
|
FilePathInfo.Win32Error = (UINT)Status;
|
||||||
MsgHandler(Context,
|
MsgHandler(Context,
|
||||||
SPFILENOTIFY_ENDDELETE,
|
SPFILENOTIFY_ENDDELETE,
|
||||||
(UINT_PTR)&FilePathInfo,
|
(UINT_PTR)&FilePathInfo,
|
||||||
0);
|
0);
|
||||||
|
if (Success == FALSE /* && Result == FILEOP_ABORT */)
|
||||||
|
goto Quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
MsgHandler(Context,
|
if (!IsListEmpty(&QueueHeader->DeleteQueue))
|
||||||
SPFILENOTIFY_ENDSUBQUEUE,
|
{
|
||||||
FILEOP_DELETE,
|
MsgHandler(Context,
|
||||||
0);
|
SPFILENOTIFY_ENDSUBQUEUE,
|
||||||
|
FILEOP_DELETE,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Commit the rename queue
|
* Commit the rename queue
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MsgHandler(Context,
|
if (!IsListEmpty(&QueueHeader->RenameQueue))
|
||||||
SPFILENOTIFY_STARTSUBQUEUE,
|
{
|
||||||
FILEOP_RENAME,
|
Result = MsgHandler(Context,
|
||||||
QueueHeader->RenameCount);
|
SPFILENOTIFY_STARTSUBQUEUE,
|
||||||
|
FILEOP_RENAME,
|
||||||
|
QueueHeader->RenameCount);
|
||||||
|
if (Result == FILEOP_ABORT)
|
||||||
|
{
|
||||||
|
Success = FALSE;
|
||||||
|
goto Quit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ListEntry = QueueHeader->RenameQueue.Flink;
|
for (ListEntry = QueueHeader->RenameQueue.Flink;
|
||||||
while (ListEntry != &QueueHeader->RenameQueue)
|
ListEntry != &QueueHeader->RenameQueue;
|
||||||
|
ListEntry = ListEntry->Flink)
|
||||||
{
|
{
|
||||||
Entry = CONTAINING_RECORD(ListEntry, QUEUEENTRY, ListEntry);
|
Entry = CONTAINING_RECORD(ListEntry, QUEUEENTRY, ListEntry);
|
||||||
ListEntry = ListEntry->Flink;
|
|
||||||
|
|
||||||
/* Build the full source path */
|
/* Build the full source path */
|
||||||
CombinePaths(FileSrcPath, ARRAYSIZE(FileSrcPath), 2,
|
CombinePaths(FileSrcPath, ARRAYSIZE(FileSrcPath), 2,
|
||||||
|
@ -723,8 +764,6 @@ SetupCommitFileQueueW(
|
||||||
/* Build the full target path */
|
/* Build the full target path */
|
||||||
CombinePaths(FileDstPath, ARRAYSIZE(FileDstPath), 2,
|
CombinePaths(FileDstPath, ARRAYSIZE(FileDstPath), 2,
|
||||||
Entry->TargetDirectory, Entry->TargetFileName);
|
Entry->TargetDirectory, Entry->TargetFileName);
|
||||||
// RtlStringCchCopyW(FileDstPath, ARRAYSIZE(FileDstPath), Entry->TargetDirectory);
|
|
||||||
// ConcatPaths(FileDstPath, ARRAYSIZE(FileDstPath), 1, Entry->TargetFileName);
|
|
||||||
|
|
||||||
DPRINT1(" -----> " "Rename: '%S' ==> '%S'\n", FileSrcPath, FileDstPath);
|
DPRINT1(" -----> " "Rename: '%S' ==> '%S'\n", FileSrcPath, FileDstPath);
|
||||||
|
|
||||||
|
@ -733,11 +772,20 @@ SetupCommitFileQueueW(
|
||||||
FilePathInfo.Win32Error = STATUS_SUCCESS;
|
FilePathInfo.Win32Error = STATUS_SUCCESS;
|
||||||
FilePathInfo.Flags = 0; // FIXME: Unused yet...
|
FilePathInfo.Flags = 0; // FIXME: Unused yet...
|
||||||
|
|
||||||
MsgHandler(Context,
|
Result = MsgHandler(Context,
|
||||||
SPFILENOTIFY_STARTRENAME,
|
SPFILENOTIFY_STARTRENAME,
|
||||||
(UINT_PTR)&FilePathInfo,
|
(UINT_PTR)&FilePathInfo,
|
||||||
FILEOP_RENAME);
|
FILEOP_RENAME);
|
||||||
|
if (Result == FILEOP_ABORT)
|
||||||
|
{
|
||||||
|
Success = FALSE;
|
||||||
|
goto EndRename;
|
||||||
|
}
|
||||||
|
else if (Result == FILEOP_SKIP)
|
||||||
|
goto EndRename;
|
||||||
|
// else (Result == FILEOP_DOIT)
|
||||||
|
|
||||||
|
RetryRename:
|
||||||
/* Move or rename the file */
|
/* Move or rename the file */
|
||||||
Status = SetupMoveFile(FileSrcPath, FileDstPath,
|
Status = SetupMoveFile(FileSrcPath, FileDstPath,
|
||||||
MOVEFILE_REPLACE_EXISTING
|
MOVEFILE_REPLACE_EXISTING
|
||||||
|
@ -747,61 +795,105 @@ SetupCommitFileQueueW(
|
||||||
{
|
{
|
||||||
/* An error happened */
|
/* An error happened */
|
||||||
FilePathInfo.Win32Error = (UINT)Status;
|
FilePathInfo.Win32Error = (UINT)Status;
|
||||||
MsgHandler(Context,
|
Result = MsgHandler(Context,
|
||||||
SPFILENOTIFY_RENAMEERROR,
|
SPFILENOTIFY_RENAMEERROR,
|
||||||
(UINT_PTR)&FilePathInfo,
|
(UINT_PTR)&FilePathInfo,
|
||||||
0);
|
0);
|
||||||
|
if (Result == FILEOP_ABORT)
|
||||||
|
{
|
||||||
|
Success = FALSE;
|
||||||
|
goto EndRename;
|
||||||
|
}
|
||||||
|
else if (Result == FILEOP_SKIP)
|
||||||
|
goto EndRename;
|
||||||
|
else if (Result == FILEOP_RETRY)
|
||||||
|
goto RetryRename;
|
||||||
|
|
||||||
Success = FALSE;
|
Success = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EndRename:
|
||||||
/* This notification is always sent, even in case of error */
|
/* This notification is always sent, even in case of error */
|
||||||
FilePathInfo.Win32Error = (UINT)Status;
|
FilePathInfo.Win32Error = (UINT)Status;
|
||||||
MsgHandler(Context,
|
MsgHandler(Context,
|
||||||
SPFILENOTIFY_ENDRENAME,
|
SPFILENOTIFY_ENDRENAME,
|
||||||
(UINT_PTR)&FilePathInfo,
|
(UINT_PTR)&FilePathInfo,
|
||||||
0);
|
0);
|
||||||
|
if (Success == FALSE /* && Result == FILEOP_ABORT */)
|
||||||
|
goto Quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
MsgHandler(Context,
|
if (!IsListEmpty(&QueueHeader->RenameQueue))
|
||||||
SPFILENOTIFY_ENDSUBQUEUE,
|
{
|
||||||
FILEOP_RENAME,
|
MsgHandler(Context,
|
||||||
0);
|
SPFILENOTIFY_ENDSUBQUEUE,
|
||||||
|
FILEOP_RENAME,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Commit the copy queue
|
* Commit the copy queue
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MsgHandler(Context,
|
if (!IsListEmpty(&QueueHeader->CopyQueue))
|
||||||
SPFILENOTIFY_STARTSUBQUEUE,
|
{
|
||||||
FILEOP_COPY,
|
Result = MsgHandler(Context,
|
||||||
QueueHeader->CopyCount);
|
SPFILENOTIFY_STARTSUBQUEUE,
|
||||||
|
FILEOP_COPY,
|
||||||
|
QueueHeader->CopyCount);
|
||||||
|
if (Result == FILEOP_ABORT)
|
||||||
|
{
|
||||||
|
Success = FALSE;
|
||||||
|
goto Quit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ListEntry = QueueHeader->CopyQueue.Flink;
|
for (ListEntry = QueueHeader->CopyQueue.Flink;
|
||||||
while (ListEntry != &QueueHeader->CopyQueue)
|
ListEntry != &QueueHeader->CopyQueue;
|
||||||
|
ListEntry = ListEntry->Flink)
|
||||||
{
|
{
|
||||||
Entry = CONTAINING_RECORD(ListEntry, QUEUEENTRY, ListEntry);
|
Entry = CONTAINING_RECORD(ListEntry, QUEUEENTRY, ListEntry);
|
||||||
ListEntry = ListEntry->Flink;
|
|
||||||
|
//
|
||||||
|
// TODO: Send a SPFILENOTIFY_NEEDMEDIA notification
|
||||||
|
// when we switch to a new installation media.
|
||||||
|
// Param1 = (UINT_PTR)(PSOURCE_MEDIA)SourceMediaInfo;
|
||||||
|
// Param2 = (UINT_PTR)(TCHAR[MAX_PATH])NewPathInfo;
|
||||||
|
//
|
||||||
|
|
||||||
/* Build the full source path */
|
/* Build the full source path */
|
||||||
CombinePaths(FileSrcPath, ARRAYSIZE(FileSrcPath), 3,
|
if (Entry->SourceCabinet == NULL)
|
||||||
Entry->SourceRootPath, Entry->SourcePath,
|
{
|
||||||
Entry->SourceFileName);
|
CombinePaths(FileSrcPath, ARRAYSIZE(FileSrcPath), 3,
|
||||||
|
Entry->SourceRootPath, Entry->SourcePath,
|
||||||
|
Entry->SourceFileName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* The cabinet must be in Entry->SourceRootPath only!
|
||||||
|
* (Should we ignore Entry->SourcePath?)
|
||||||
|
*/
|
||||||
|
CombinePaths(FileSrcPath, ARRAYSIZE(FileSrcPath), 3,
|
||||||
|
Entry->SourceRootPath, Entry->SourcePath,
|
||||||
|
Entry->SourceCabinet);
|
||||||
|
}
|
||||||
|
|
||||||
/* Build the full target path */
|
/* Build the full target path */
|
||||||
RtlStringCchCopyW(FileDstPath, ARRAYSIZE(FileDstPath), Entry->TargetDirectory);
|
RtlStringCchCopyW(FileDstPath, ARRAYSIZE(FileDstPath), Entry->TargetDirectory);
|
||||||
|
|
||||||
/*
|
|
||||||
* If the file is in a cabinet, use only the destination path.
|
|
||||||
* Otherwise possibly use a different target name.
|
|
||||||
*/
|
|
||||||
if (Entry->SourceCabinet == NULL)
|
if (Entry->SourceCabinet == NULL)
|
||||||
{
|
{
|
||||||
|
/* If the file is not in a cabinet, possibly use a different target name */
|
||||||
if (Entry->TargetFileName != NULL)
|
if (Entry->TargetFileName != NULL)
|
||||||
ConcatPaths(FileDstPath, ARRAYSIZE(FileDstPath), 1, Entry->TargetFileName);
|
ConcatPaths(FileDstPath, ARRAYSIZE(FileDstPath), 1, Entry->TargetFileName);
|
||||||
else
|
else
|
||||||
ConcatPaths(FileDstPath, ARRAYSIZE(FileDstPath), 1, Entry->SourceFileName);
|
ConcatPaths(FileDstPath, ARRAYSIZE(FileDstPath), 1, Entry->SourceFileName);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ConcatPaths(FileDstPath, ARRAYSIZE(FileDstPath), 1, Entry->SourceFileName);
|
||||||
|
}
|
||||||
|
|
||||||
DPRINT(" -----> " "Copy: '%S' ==> '%S'\n", FileSrcPath, FileDstPath);
|
DPRINT(" -----> " "Copy: '%S' ==> '%S'\n", FileSrcPath, FileDstPath);
|
||||||
|
|
||||||
|
@ -811,29 +903,35 @@ SetupCommitFileQueueW(
|
||||||
//
|
//
|
||||||
|
|
||||||
FilePathInfo.Target = FileDstPath;
|
FilePathInfo.Target = FileDstPath;
|
||||||
FilePathInfo.Source = FileSrcPath; // when SourceCabinet not NULL, use CabinetName ...
|
FilePathInfo.Source = FileSrcPath;
|
||||||
FilePathInfo.Win32Error = STATUS_SUCCESS;
|
FilePathInfo.Win32Error = STATUS_SUCCESS;
|
||||||
FilePathInfo.Flags = 0; // FIXME: Unused yet...
|
FilePathInfo.Flags = 0; // FIXME: Unused yet...
|
||||||
|
|
||||||
MsgHandler(Context,
|
Result = MsgHandler(Context,
|
||||||
SPFILENOTIFY_STARTCOPY,
|
SPFILENOTIFY_STARTCOPY,
|
||||||
(UINT_PTR)&FilePathInfo,
|
(UINT_PTR)&FilePathInfo,
|
||||||
FILEOP_COPY);
|
FILEOP_COPY);
|
||||||
|
if (Result == FILEOP_ABORT)
|
||||||
|
{
|
||||||
|
Success = FALSE;
|
||||||
|
goto EndCopy;
|
||||||
|
}
|
||||||
|
else if (Result == FILEOP_SKIP)
|
||||||
|
goto EndCopy;
|
||||||
|
// else (Result == FILEOP_DOIT)
|
||||||
|
|
||||||
|
RetryCopy:
|
||||||
if (Entry->SourceCabinet != NULL)
|
if (Entry->SourceCabinet != NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Extract the file from the cabinet.
|
* The file is in a cabinet, use only the destination path
|
||||||
* The cabinet must be in Entry->SourceRootPath only!
|
* and keep the source name as the target name.
|
||||||
* (ignore Entry->SourcePath).
|
|
||||||
*/
|
*/
|
||||||
CombinePaths(CabinetName, ARRAYSIZE(CabinetName), 3,
|
/* Extract the file from the cabinet */
|
||||||
Entry->SourceRootPath, Entry->SourcePath,
|
|
||||||
Entry->SourceCabinet);
|
|
||||||
Status = SetupExtractFile(QueueHeader,
|
Status = SetupExtractFile(QueueHeader,
|
||||||
CabinetName,
|
FileSrcPath, // Specifies the cabinet path
|
||||||
Entry->SourceFileName,
|
Entry->SourceFileName,
|
||||||
FileDstPath);
|
Entry->TargetDirectory);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -845,27 +943,46 @@ SetupCommitFileQueueW(
|
||||||
{
|
{
|
||||||
/* An error happened */
|
/* An error happened */
|
||||||
FilePathInfo.Win32Error = (UINT)Status;
|
FilePathInfo.Win32Error = (UINT)Status;
|
||||||
MsgHandler(Context,
|
Result = MsgHandler(Context,
|
||||||
SPFILENOTIFY_COPYERROR,
|
SPFILENOTIFY_COPYERROR,
|
||||||
(UINT_PTR)&FilePathInfo,
|
(UINT_PTR)&FilePathInfo,
|
||||||
(UINT_PTR)NULL); // FIXME: Unused yet...
|
(UINT_PTR)NULL); // FIXME: Unused yet...
|
||||||
|
if (Result == FILEOP_ABORT)
|
||||||
|
{
|
||||||
|
Success = FALSE;
|
||||||
|
goto EndCopy;
|
||||||
|
}
|
||||||
|
else if (Result == FILEOP_SKIP)
|
||||||
|
goto EndCopy;
|
||||||
|
else if (Result == FILEOP_RETRY)
|
||||||
|
goto RetryCopy;
|
||||||
|
else if (Result == FILEOP_NEWPATH)
|
||||||
|
goto RetryCopy; // TODO!
|
||||||
|
|
||||||
Success = FALSE;
|
Success = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EndCopy:
|
||||||
/* This notification is always sent, even in case of error */
|
/* This notification is always sent, even in case of error */
|
||||||
FilePathInfo.Win32Error = (UINT)Status;
|
FilePathInfo.Win32Error = (UINT)Status;
|
||||||
MsgHandler(Context,
|
MsgHandler(Context,
|
||||||
SPFILENOTIFY_ENDCOPY,
|
SPFILENOTIFY_ENDCOPY,
|
||||||
(UINT_PTR)&FilePathInfo,
|
(UINT_PTR)&FilePathInfo,
|
||||||
0);
|
0);
|
||||||
|
if (Success == FALSE /* && Result == FILEOP_ABORT */)
|
||||||
|
goto Quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
MsgHandler(Context,
|
if (!IsListEmpty(&QueueHeader->CopyQueue))
|
||||||
SPFILENOTIFY_ENDSUBQUEUE,
|
{
|
||||||
FILEOP_COPY,
|
MsgHandler(Context,
|
||||||
0);
|
SPFILENOTIFY_ENDSUBQUEUE,
|
||||||
|
FILEOP_COPY,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Quit:
|
||||||
/* All the queues have been committed */
|
/* All the queues have been committed */
|
||||||
MsgHandler(Context,
|
MsgHandler(Context,
|
||||||
SPFILENOTIFY_ENDQUEUE,
|
SPFILENOTIFY_ENDQUEUE,
|
||||||
|
|
|
@ -4103,8 +4103,12 @@ FileCopyCallback(PVOID Context,
|
||||||
if (DstFileName) ++DstFileName;
|
if (DstFileName) ++DstFileName;
|
||||||
else DstFileName = FilePathInfo->Target;
|
else DstFileName = FilePathInfo->Target;
|
||||||
|
|
||||||
// TODO: Determine whether using STRING_RENAMING or STRING_MOVING
|
if (!wcsicmp(SrcFileName, DstFileName))
|
||||||
CONSOLE_SetStatusText(MUIGetString(STRING_MOVING),
|
Param2 = STRING_MOVING;
|
||||||
|
else
|
||||||
|
Param2 = STRING_RENAMING;
|
||||||
|
|
||||||
|
CONSOLE_SetStatusText(MUIGetString(Param2),
|
||||||
SrcFileName, DstFileName);
|
SrcFileName, DstFileName);
|
||||||
}
|
}
|
||||||
else if (Notification == SPFILENOTIFY_STARTCOPY)
|
else if (Notification == SPFILENOTIFY_STARTCOPY)
|
||||||
|
@ -4112,18 +4116,28 @@ FileCopyCallback(PVOID Context,
|
||||||
/* Display copy message */
|
/* Display copy message */
|
||||||
ASSERT(Param2 == FILEOP_COPY);
|
ASSERT(Param2 == FILEOP_COPY);
|
||||||
|
|
||||||
SrcFileName = wcsrchr(FilePathInfo->Source, L'\\');
|
/* NOTE: When extracting from CABs the Source is the CAB name */
|
||||||
if (SrcFileName) ++SrcFileName;
|
DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
|
||||||
else SrcFileName = FilePathInfo->Source;
|
if (DstFileName) ++DstFileName;
|
||||||
|
else DstFileName = FilePathInfo->Target;
|
||||||
|
|
||||||
CONSOLE_SetStatusText(MUIGetString(STRING_COPYING),
|
CONSOLE_SetStatusText(MUIGetString(STRING_COPYING),
|
||||||
SrcFileName);
|
DstFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupUpdateMemoryInfo(CopyContext, FALSE);
|
SetupUpdateMemoryInfo(CopyContext, FALSE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case SPFILENOTIFY_COPYERROR:
|
||||||
|
{
|
||||||
|
FilePathInfo = (PFILEPATHS_W)Param1;
|
||||||
|
|
||||||
|
DPRINT1("An error happened while trying to copy file '%S' (error 0x%08lx), skipping it...\n",
|
||||||
|
FilePathInfo->Target, FilePathInfo->Win32Error);
|
||||||
|
return FILEOP_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
case SPFILENOTIFY_ENDDELETE:
|
case SPFILENOTIFY_ENDDELETE:
|
||||||
case SPFILENOTIFY_ENDRENAME:
|
case SPFILENOTIFY_ENDRENAME:
|
||||||
case SPFILENOTIFY_ENDCOPY:
|
case SPFILENOTIFY_ENDCOPY:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue