79 DPRINT(
"SetupExtractFile(CabinetFileName: '%S', SourceFileName: '%S', DestinationPathName: '%S')\n",
80 CabinetFileName, SourceFileName, DestinationPathName);
82 if (QueueHeader->HasCurrentCabinet)
84 DPRINT(
"CurrentCabinetName: '%S'\n", QueueHeader->CurrentCabinetName);
87 if (QueueHeader->HasCurrentCabinet &&
88 (
wcscmp(CabinetFileName, QueueHeader->CurrentCabinetName) == 0))
90 DPRINT(
"Using same cabinet as last time\n");
95 &QueueHeader->Search);
98 DPRINT(
"Sequential miss on file: %S\n", SourceFileName);
103 &QueueHeader->Search);
108 DPRINT(
"Using new cabinet\n");
110 if (QueueHeader->HasCurrentCabinet)
112 QueueHeader->HasCurrentCabinet =
FALSE;
117 ARRAYSIZE(QueueHeader->CurrentCabinetName),
125 CabStatus =
CabinetOpen(&QueueHeader->CabinetContext);
128 DPRINT(
"Opened cabinet %S\n", CabinetFileName );
129 QueueHeader->HasCurrentCabinet =
TRUE;
133 DPRINT(
"Cannot open cabinet (%d)\n", CabStatus);
140 &QueueHeader->Search);
145 DPRINT1(
"Unable to find '%S' in cabinet '%S'\n",
154 DPRINT(
"Cannot extract file %S (%d)\n", SourceFileName, CabStatus);
169 if (QueueHeader ==
NULL)
226 if (QueueHandle ==
NULL)
280 if (QueueHandle ==
NULL ||
281 SourceRootPath ==
NULL ||
282 SourceFileName ==
NULL ||
283 TargetDirectory ==
NULL)
290 DPRINT(
"SetupQueueCopy(Cab '%S', SrcRootPath '%S', SrcPath '%S', SrcFN '%S' --> DstPath '%S', DstFN '%S')\n",
291 SourceCabinet ? SourceCabinet :
L"n/a",
292 SourceRootPath, SourcePath, SourceFileName,
293 TargetDirectory, TargetFileName);
304 if (SourceCabinet !=
NULL)
335 if (SourcePath !=
NULL)
401 if (TargetFileName !=
NULL)
444 if (QueueHandle ==
NULL || PathPart1 ==
NULL)
451 DPRINT1(
"SetupQueueDeleteW(PathPart1 '%S', PathPart2 '%S')\n",
452 PathPart1, PathPart2);
481 if (PathPart2 !=
NULL)
516 if (QueueHandle ==
NULL ||
517 SourcePath ==
NULL ||
518 TargetFileName ==
NULL)
525 DPRINT1(
"SetupQueueRenameW(SrcPath '%S', SrcFN '%S' --> DstPath '%S', DstFN '%S')\n",
526 SourcePath, SourceFileName, TargetPath, TargetFileName);
554 if (SourceFileName !=
NULL)
571 if (TargetPath !=
NULL)
635 if (QueueHandle ==
NULL)
667 ListEntry = ListEntry->
Flink)
673 Entry->TargetDirectory,
Entry->TargetFileName);
675 DPRINT1(
" -----> " "Delete: '%S'\n", FileDstPath);
677 FilePathInfo.
Target = FileDstPath;
680 FilePathInfo.
Flags = 0;
758 ListEntry = ListEntry->
Flink)
768 Entry->TargetDirectory,
Entry->TargetFileName);
770 DPRINT1(
" -----> " "Rename: '%S' ==> '%S'\n", FileSrcPath, FileDstPath);
772 FilePathInfo.
Target = FileDstPath;
773 FilePathInfo.
Source = FileSrcPath;
775 FilePathInfo.
Flags = 0;
856 ListEntry = ListEntry->
Flink)
872 Entry->SourceFileName);
882 Entry->SourceCabinet);
900 DPRINT(
" -----> " "Copy: '%S' ==> '%S'\n", FileSrcPath, FileDstPath);
907 FilePathInfo.
Target = FileDstPath;
908 FilePathInfo.
Source = FileSrcPath;
910 FilePathInfo.
Flags = 0;
935 Entry->SourceFileName,
936 Entry->TargetDirectory);
#define CAB_STATUS_SUCCESS
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
ULONG CabinetOpen(IN OUT PCABINET_CONTEXT CabinetContext)
ULONG CabinetFindFirst(IN PCABINET_CONTEXT CabinetContext, IN PCWSTR FileName, IN OUT PCAB_SEARCH Search)
PCWSTR CabinetGetCabinetName(IN PCABINET_CONTEXT CabinetContext)
ULONG CabinetExtractFile(IN PCABINET_CONTEXT CabinetContext, IN PCAB_SEARCH Search)
VOID CabinetSetEventHandlers(IN PCABINET_CONTEXT CabinetContext, IN PCABINET_OVERWRITE Overwrite, IN PCABINET_EXTRACT Extract, IN PCABINET_DISK_CHANGE DiskChange, IN PCABINET_CREATE_FILE CreateFile)
VOID CabinetInitialize(IN OUT PCABINET_CONTEXT CabinetContext)
VOID CabinetCleanup(IN OUT PCABINET_CONTEXT CabinetContext)
VOID CabinetSetCabinetName(IN PCABINET_CONTEXT CabinetContext, IN PCWSTR FileName)
VOID CabinetSetDestinationPath(IN PCABINET_CONTEXT CabinetContext, IN PCWSTR DestinationPath)
ULONG CabinetFindNextFileSequential(IN PCABINET_CONTEXT CabinetContext, IN PCWSTR FileName, IN OUT PCAB_SEARCH Search)
#define NT_SUCCESS(StatCode)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
#define SPFILENOTIFY_ENDDELETE
#define SPFILENOTIFY_RENAMEERROR
BOOL(WINAPI * pSpFileQueueCommit)(IN HWND Owner, IN HSPFILEQ QueueHandle, IN PSP_FILE_CALLBACK_W MsgHandler, IN PVOID Context OPTIONAL)
pSpFileQueueDelete SpFileQueueDelete
#define SPFILENOTIFY_STARTDELETE
BOOL(WINAPI * pSpFileQueueClose)(IN HSPFILEQ QueueHandle)
BOOL(WINAPI * pSpFileQueueDelete)(IN HSPFILEQ QueueHandle, IN PCWSTR PathPart1, IN PCWSTR PathPart2 OPTIONAL)
pSpFileQueueClose SpFileQueueClose
UINT(CALLBACK * PSP_FILE_CALLBACK_W)(IN PVOID Context, IN UINT Notification, IN UINT_PTR Param1, IN UINT_PTR Param2)
#define SPFILENOTIFY_STARTSUBQUEUE
#define SPFILENOTIFY_ENDQUEUE
pSpFileQueueCopy SpFileQueueCopy
#define SPFILENOTIFY_ENDCOPY
#define SPFILENOTIFY_DELETEERROR
#define SPFILENOTIFY_STARTCOPY
#define SPFILENOTIFY_COPYERROR
BOOL(WINAPI * pSpFileQueueCopy)(IN HSPFILEQ QueueHandle, IN PCWSTR SourceRootPath, IN PCWSTR SourcePath OPTIONAL, IN PCWSTR SourceFileName, IN PCWSTR SourceDescription OPTIONAL, IN PCWSTR SourceCabinet OPTIONAL, IN PCWSTR SourceTagFile OPTIONAL, IN PCWSTR TargetDirectory, IN PCWSTR TargetFileName OPTIONAL, IN ULONG CopyStyle)
HSPFILEQ(WINAPI * pSpFileQueueOpen)(VOID)
#define SPFILENOTIFY_ENDSUBQUEUE
#define SPFILENOTIFY_STARTRENAME
#define SPFILENOTIFY_ENDRENAME
pSpFileQueueOpen SpFileQueueOpen
pSpFileQueueCommit SpFileQueueCommit
pSpFileQueueRename SpFileQueueRename
#define SPFILENOTIFY_STARTQUEUE
BOOL(WINAPI * pSpFileQueueRename)(IN HSPFILEQ QueueHandle, IN PCWSTR SourcePath, IN PCWSTR SourceFileName OPTIONAL, IN PCWSTR TargetPath OPTIONAL, IN PCWSTR TargetFileName)
NTSTATUS CombinePaths(OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN ...)
NTSTATUS SetupMoveFile(IN PCWSTR ExistingFileName, IN PCWSTR NewFileName, IN ULONG Flags)
NTSTATUS ConcatPaths(IN OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN ...)
NTSTATUS SetupCopyFile(IN PCWSTR SourceFileName, IN PCWSTR DestinationFileName, IN BOOLEAN FailIfExists)
NTSTATUS SetupDeleteFile(IN PCWSTR FileName, IN BOOLEAN ForceDelete)
#define MOVEFILE_WRITE_THROUGH
#define MOVEFILE_REPLACE_EXISTING
#define MOVEFILE_COPY_ALLOWED
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
unsigned __int3264 UINT_PTR
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSTRSAFEAPI RtlStringCchCopyW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
#define SetupQueueDeleteW
#define SetupOpenFileQueue
#define SetupQueueRenameW
#define SetupCommitFileQueueW
#define SetupCloseFileQueue
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
PULONG MinorVersion OPTIONAL
base of all file and directory entries
struct _LIST_ENTRY * Flink
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_UNSUCCESSFUL
struct _FILEQUEUEHEADER * PFILEQUEUEHEADER
static VOID SetupDeleteQueueEntry(IN PQUEUEENTRY Entry)
struct _FILEQUEUEHEADER FILEQUEUEHEADER
struct _QUEUEENTRY * PQUEUEENTRY
struct _QUEUEENTRY QUEUEENTRY
BOOL WINAPI SetupQueueCopyWithCab(IN HSPFILEQ QueueHandle, IN PCWSTR SourceRootPath, IN PCWSTR SourcePath OPTIONAL, IN PCWSTR SourceFileName, IN PCWSTR SourceDescription OPTIONAL, IN PCWSTR SourceCabinet OPTIONAL, IN PCWSTR SourceTagFile OPTIONAL, IN PCWSTR TargetDirectory, IN PCWSTR TargetFileName OPTIONAL, IN ULONG CopyStyle)
static NTSTATUS SetupExtractFile(IN OUT PFILEQUEUEHEADER QueueHeader, IN PCWSTR CabinetFileName, IN PCWSTR SourceFileName, IN PCWSTR DestinationPathName)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO