129 if (src2)
while (*src2 ==
'\\') src2++;
137 if (src3)
while (*src3 ==
'\\') src3++;
152 unsigned int src_len = 1, dst_len = 1;
155 if (
op->src_root) src_len +=
strlenW(
op->src_root) + 1;
156 if (
op->src_path) src_len +=
strlenW(
op->src_path) + 1;
157 if (
op->src_file) src_len +=
strlenW(
op->src_file) + 1;
158 if (
op->dst_path) dst_len +=
strlenW(
op->dst_path) + 1;
159 if (
op->dst_file) dst_len +=
strlenW(
op->dst_file) + 1;
160 src_len *=
sizeof(
WCHAR);
161 dst_len *=
sizeof(
WCHAR);
176 paths->Win32Error = 0;
232 statusA.
cbSize =
sizeof(statusA);
274 static const WCHAR SourceDisksNames[] =
275 {
'S',
'o',
'u',
'r',
'c',
'e',
'D',
'i',
's',
'k',
's',
'N',
'a',
'm',
'e',
's',0};
276 static const WCHAR SourceDisksFiles[] =
277 {
'S',
'o',
'u',
'r',
'c',
'e',
'D',
'i',
's',
'k',
's',
'F',
'i',
'l',
'e',
's',0};
339 if (len2 &&
ptr >
op->src_path &&
ptr[-1] !=
'\\') *
ptr++ =
'\\';
355 static const WCHAR Dest[] = {
'D',
'e',
's',
't',
'i',
'n',
'a',
't',
'i',
'o',
'n',
'D',
'i',
'r',
's',0};
356 static const WCHAR Def[] = {
'D',
'e',
'f',
'a',
'u',
'l',
't',
'D',
'e',
's',
't',
'D',
'i',
'r',0};
420 static const WCHAR extW[] = {
'.',
'c',
'a',
'b',0};
427 TRACE(
"extract_cabinet_file(cab = '%s' ; root = '%s' ; src = '%s' ; dst = '%s')\n",
490 if (!
op->src_file)
op->src_file =
op->dst_file;
497 TRACE(
"root=%s path=%s file=%s -> dir=%s file=%s descr=%s tag=%s\n",
525 if (
params->SecurityDescriptor)
529 if (!
op->src_file)
op->src_file =
op->dst_file;
536 TRACE(
"root=%s path=%s file=%s -> dir=%s file=%s descr=%s tag=%s\n",
562 params.TargetDirectory = dst_dir;
587 params.TargetDirectory = dst_dir;
727 op->src_file =
strdupW( SourceFilename );
731 op->dst_file =
strdupW( TargetFilename );
776 LPWSTR security_key, security_descriptor =
NULL;
783 TRACE(
"hinf=%p/%p section=%s root=%s\n",
802 if (!security_descriptor)
809 MyFree( security_descriptor );
823 params.SecurityDescriptor = security_descriptor;
826 if (!hlist) hlist = hinf;
827 if (!hinf) hinf = hlist;
843 if (security_descriptor)
844 MyFree( security_descriptor );
880 if (!hlist) hlist = hinf;
928 if (!hlist) hlist = hinf;
975 while((
len =
strlenW(new_path)) && new_path[
len - 1] ==
'\\')
976 new_path[
len - 1] = 0;
992 if(!(slash =
strrchrW(new_path,
'\\')))
998 len = slash - new_path;
1005 new_path[
len] =
'\\';
1032 ERR(
"GetTempPathW error\n");
1065 ERR(
"LZOpenFileW(2) error %d %s\n", (
int)hTemp,
debugstr_w(TempFile));
1079 lRes =
LZCopy(hSource, hTemp);
1108 DWORD VersionSizeSource=0;
1109 DWORD VersionSizeTarget=0;
1129 TRACE(
"SizeTarget %i ... SizeSource %i\n",VersionSizeTarget,
1132 if (VersionSizeSource && VersionSizeTarget)
1139 WCHAR SubBlock[2]={
'\\',0};
1162 TRACE(
"Versions: Source %i.%i target %i.%i\n",
1163 SourceInfo->dwFileVersionMS, SourceInfo->dwFileVersionLS,
1164 TargetInfo->dwFileVersionMS, TargetInfo->dwFileVersionLS);
1170 filepaths.
Flags = 0;
1172 if (TargetInfo->dwFileVersionMS > SourceInfo->dwFileVersionMS)
1179 else if ((TargetInfo->dwFileVersionMS == SourceInfo->dwFileVersionMS)
1180 && (TargetInfo->dwFileVersionLS > SourceInfo->dwFileVersionLS))
1188 (TargetInfo->dwFileVersionMS ==
1189 SourceInfo->dwFileVersionMS)
1190 &&(TargetInfo->dwFileVersionLS ==
1191 SourceInfo->dwFileVersionLS))
1208 FIXME(
"Notify user target file exists\n");
1215 ERR(
"Unsupported style(s) 0x%x\n",
style);
1221 TRACE(
"Did copy... rc was %i\n",rc);
1282 static const WCHAR CopyFiles[] = {
'C',
'o',
'p',
'y',
'F',
'i',
'l',
'e',
's',0};
1333 if (
p[-1] !=
'\\') *
p++ =
'\\';
1359 if (!
queue->copy_queue.count && !
queue->delete_queue.count && !
queue->rename_queue.count)
1366 if (
queue->delete_queue.count)
1369 queue->delete_queue.count )))
goto done;
1390 if (
queue->rename_queue.count)
1393 queue->rename_queue.count )))
goto done;
1401 TRACE(
"renaming file %s -> %s\n",
1415 if (
queue->copy_queue.count)
1418 queue->copy_queue.count )))
goto done;
1429 TRACE(
"copying file %s -> %s\n",
1448 op->src_file,
paths.Target ))
break;
1471 psidOwner, psidGroup, pDacl, pSacl );
1523 if (!
queue->copy_queue.count)
return TRUE;
1530 FIXME(
"flags %x not fully implemented\n",
flags);
1674 TRACE(
"start queue\n" );
1677 TRACE(
"end queue\n" );
1680 TRACE(
"start subqueue %ld count %ld\n", param1, param2 );
1683 TRACE(
"end subqueue %ld\n", param1 );
1712 ERR(
"copy error %d %s -> %s\n",
paths->Win32Error,
1716 TRACE(
"need media\n" );
1738 TRACE(
"start queue\n" );
1741 TRACE(
"end queue\n" );
1744 TRACE(
"start subqueue %ld count %ld\n", param1, param2 );
1747 TRACE(
"end subqueue %ld\n", param1 );
1767 ERR(
"rename error %d %s -> %s\n",
paths->Win32Error,
1777 TRACE(
"copy error %d %s -> %s\n",
paths->Win32Error,
1781 TRACE(
"need media\n" );
1797 FIXME(
"stub: (Error Number %d when attempting to delete %s)\n",
1809 FIXME(
"stub: (Error Number %d when attempting to delete %s)\n",
1821 FIXME(
"stub: (Error Number %d when attempting to rename %s to %s)\n",
1833 FIXME(
"stub: (Error Number %d when attempting to rename %s to %s)\n",
1848 FIXME(
"stub: (Error Number %d when attempting to copy file %s from %s to %s)\n",
1862 FIXME(
"stub: (Error Number %d when attempting to copy file %s from %s to %s)\n",
1873 return queue->flags;
#define ERROR_NOT_ENOUGH_MEMORY
static const WCHAR backslashW[]
DWORD WINAPI SetNamedSecurityInfoW(LPWSTR pObjectName, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, PSID psidOwner, PSID psidGroup, PACL pDacl, PACL pSacl)
BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorW(LPCWSTR StringSecurityDescriptor, DWORD StringSDRevision, PSECURITY_DESCRIPTOR *SecurityDescriptor, PULONG SecurityDescriptorSize)
static const WCHAR rootW[]
static WCHAR * strdupAtoW(const char *str)
#define ERROR_INVALID_PARAMETER
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define MultiByteToWideChar
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
BOOL WINAPI MoveFileExW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
BOOL WINAPI MoveFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
UINT(* handler)(MSIPACKAGE *)
BOOL WINAPI SetupDiGetActualSectionToInstallW(HINF InfHandle, PCWSTR InfSectionName, PWSTR InfSectionWithExt, DWORD InfSectionWithExtSize, PDWORD RequiredSize, PWSTR *Extension)
static const WCHAR CopyFiles[]
LPVOID WINAPI MyMalloc(DWORD dwSize)
VOID WINAPI MyFree(LPVOID lpMem)
WCHAR * PARSER_get_src_root(HINF hinf)
WCHAR * PARSER_get_dest_dir(INFCONTEXT *context)
BOOL WINAPI SetupGetLineTextW(PINFCONTEXT context, HINF hinf, PCWSTR section_name, PCWSTR key_name, PWSTR buffer, DWORD size, PDWORD required)
BOOL WINAPI SetupQueueRenameSectionW(HSPFILEQ queue, HINF hinf, HINF hlist, PCWSTR section)
BOOL WINAPI SetupSetFileQueueFlags(HSPFILEQ handle, DWORD mask, DWORD flags)
BOOL WINAPI SetupGetFileQueueCount(HSPFILEQ handle, UINT op, PUINT result)
UINT WINAPI SetupDeleteErrorA(HWND parent, PCSTR dialogTitle, PCSTR file, UINT w32error, DWORD style)
BOOL WINAPI SetupScanFileQueueW(HSPFILEQ handle, DWORD flags, HWND window, PSP_FILE_CALLBACK_W handler, PVOID context, PDWORD result)
BOOL WINAPI SetupQueueCopyIndirectA(PSP_FILE_COPY_PARAMS_A params)
BOOL WINAPI pSetupSetQueueFlags(HSPFILEQ handle, DWORD flags)
static const WCHAR DotSecurity[]
BOOL WINAPI SetupQueueDefaultCopyW(HSPFILEQ queue, HINF hinf, PCWSTR src_root, PCWSTR src_file, PCWSTR dst_file, DWORD style)
static void get_src_file_info(HINF hinf, struct file_op *op)
BOOL WINAPI SetupSetFileQueueAlternatePlatformA(HSPFILEQ handle, PSP_ALTPLATFORM_INFO platform, PCSTR catalogfile)
static UINT WINAPI extract_cab_cb(void *arg, UINT message, UINT_PTR param1, UINT_PTR param2)
BOOL WINAPI SetupInstallFileW(HINF hinf, PINFCONTEXT inf_context, PCWSTR source, PCWSTR root, PCWSTR dest, DWORD style, PSP_FILE_CALLBACK_W handler, PVOID context)
BOOL WINAPI SetupQueueRenameA(HSPFILEQ handle, PCSTR SourcePath, PCSTR SourceFilename, PCSTR TargetPath, PCSTR TargetFilename)
static WCHAR * strdupW(const WCHAR *str)
UINT WINAPI SetupRenameErrorA(HWND parent, PCSTR dialogTitle, PCSTR source, PCSTR target, UINT w32error, DWORD style)
PVOID WINAPI SetupInitDefaultQueueCallbackEx(HWND owner, HWND progress, UINT msg, DWORD reserved1, PVOID reserved2)
DWORD WINAPI pSetupGetQueueFlags(HSPFILEQ handle)
static BOOL build_filepathsW(const struct file_op *op, FILEPATHS_W *paths)
UINT WINAPI SetupCopyErrorA(HWND parent, PCSTR dialogTitle, PCSTR diskname, PCSTR sourcepath, PCSTR sourcefile, PCSTR targetpath, UINT w32error, DWORD style, PSTR pathbuffer, DWORD buffersize, PDWORD requiredsize)
UINT CALLBACK QUEUE_callback_WtoA(void *context, UINT notification, UINT_PTR param1, UINT_PTR param2)
BOOL WINAPI SetupQueueCopyA(HSPFILEQ queue, PCSTR src_root, PCSTR src_path, PCSTR src_file, PCSTR src_descr, PCSTR src_tag, PCSTR dst_dir, PCSTR dst_file, DWORD style)
BOOL WINAPI SetupQueueDefaultCopyA(HSPFILEQ queue, HINF hinf, PCSTR src_root, PCSTR src_file, PCSTR dst_file, DWORD style)
BOOL WINAPI SetupScanFileQueueA(HSPFILEQ handle, DWORD flags, HWND window, PSP_FILE_CALLBACK_A handler, PVOID context, PDWORD result)
BOOL WINAPI SetupQueueCopySectionA(HSPFILEQ queue, PCSTR src_root, HINF hinf, HINF hlist, PCSTR section, DWORD style)
static BOOL create_full_pathW(const WCHAR *path)
UINT WINAPI SetupDefaultQueueCallbackW(PVOID context, UINT notification, UINT_PTR param1, UINT_PTR param2)
BOOL WINAPI SetupQueueDeleteA(HSPFILEQ handle, PCSTR part1, PCSTR part2)
static char * strdupWtoA(const WCHAR *str)
static void concat_W(WCHAR *buffer, const WCHAR *src1, const WCHAR *src2, const WCHAR *src3)
static BOOL do_file_copyW(LPCWSTR source, LPCWSTR target, DWORD style, PSP_FILE_CALLBACK_W handler, PVOID context)
BOOL WINAPI SetupQueueDeleteSectionA(HSPFILEQ queue, HINF hinf, HINF hlist, PCSTR section)
static BOOL extract_cabinet_file(const WCHAR *cabinet, const WCHAR *root, const WCHAR *src, const WCHAR *dst)
UINT WINAPI SetupRenameErrorW(HWND parent, PCWSTR dialogTitle, PCWSTR source, PCWSTR target, UINT w32error, DWORD style)
BOOL WINAPI SetupGetFileQueueFlags(HSPFILEQ handle, PDWORD flags)
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
static void queue_file_op(struct file_op_queue *queue, struct file_op *op)
BOOL WINAPI SetupCommitFileQueueA(HWND owner, HSPFILEQ queue, PSP_FILE_CALLBACK_A handler, PVOID context)
BOOL WINAPI SetupQueueRenameSectionA(HSPFILEQ queue, HINF hinf, HINF hlist, PCSTR section)
HSPFILEQ WINAPI SetupOpenFileQueue(void)
static void free_file_op_queue(struct file_op_queue *queue)
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
BOOL WINAPI SetupQueueCopyW(HSPFILEQ queue, PCWSTR src_root, PCWSTR src_path, PCWSTR src_file, PCWSTR src_descr, PCWSTR src_tag, PCWSTR dst_dir, PCWSTR dst_file, DWORD style)
UINT WINAPI SetupCopyErrorW(HWND parent, PCWSTR dialogTitle, PCWSTR diskname, PCWSTR sourcepath, PCWSTR sourcefile, PCWSTR targetpath, UINT w32error, DWORD style, PWSTR pathbuffer, DWORD buffersize, PDWORD requiredsize)
BOOL WINAPI SetupInstallFileA(HINF hinf, PINFCONTEXT inf_context, PCSTR source, PCSTR root, PCSTR dest, DWORD style, PSP_FILE_CALLBACK_A handler, PVOID context)
BOOL WINAPI SetupQueueDeleteSectionW(HSPFILEQ queue, HINF hinf, HINF hlist, PCWSTR section)
UINT WINAPI SetupDeleteErrorW(HWND parent, PCWSTR dialogTitle, PCWSTR file, UINT w32error, DWORD style)
BOOL WINAPI SetupQueueCopyIndirectW(PSP_FILE_COPY_PARAMS_W params)
static WCHAR * get_destination_dir(HINF hinf, const WCHAR *section)
BOOL WINAPI SetupQueueCopySectionW(HSPFILEQ queue, PCWSTR src_root, HINF hinf, HINF hlist, PCWSTR section, DWORD style)
UINT WINAPI SetupDefaultQueueCallbackA(PVOID context, UINT notification, UINT_PTR param1, UINT_PTR param2)
BOOL WINAPI SetupSetFileQueueAlternatePlatformW(HSPFILEQ handle, PSP_ALTPLATFORM_INFO platform, PCWSTR catalogfile)
BOOL WINAPI SetupIterateCabinetW(PCWSTR CabinetFile, DWORD Reserved, PSP_FILE_CALLBACK_W MsgHandler, PVOID Context)
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
#define SPFILENOTIFY_ENDDELETE
#define SPFILENOTIFY_RENAMEERROR
#define SPFILENOTIFY_STARTDELETE
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_QUEUESCAN
#define SPFILENOTIFY_ENDQUEUE
#define SPFILENOTIFY_ENDCOPY
#define SPFILENOTIFY_DELETEERROR
#define SPFILENOTIFY_STARTCOPY
#define SPFILENOTIFY_COPYERROR
#define SPFILENOTIFY_NEEDMEDIA
#define SPFILENOTIFY_ENDSUBQUEUE
#define SPFILENOTIFY_STARTRENAME
#define SPFILENOTIFY_ENDRENAME
#define SPFILENOTIFY_STARTQUEUE
#define MOVEFILE_REPLACE_EXISTING
GLenum const GLfloat * params
GLuint GLsizei GLsizei * length
GLsizei const GLuint * paths
HLOCAL NTAPI LocalFree(HLOCAL hMem)
static const WCHAR sourceW[]
HFILE WINAPI LZOpenFileW(LPWSTR fn, LPOFSTRUCT ofs, WORD mode)
LONG WINAPI LZCopy(HFILE src, HFILE dest)
void WINAPI LZClose(HFILE fd)
#define memcpy(s1, s2, n)
#define ERROR_ALREADY_EXISTS
#define ERROR_FILE_NOT_FOUND
static IHTMLWindow2 * window
DWORD SECURITY_INFORMATION
unsigned __int3264 UINT_PTR
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define SetupQueueDeleteW
#define SetupQueueRenameW
#define SetupCommitFileQueueW
#define SetupCloseFileQueue
BOOL WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID *pGroup, LPBOOL lpbGroupDefaulted)
BOOL WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbSaclPresent, PACL *pSacl, LPBOOL lpbSaclDefaulted)
BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent, PACL *pDacl, LPBOOL lpbDaclDefaulted)
BOOL WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID *pOwner, LPBOOL lpbOwnerDefaulted)
#define SP_COPY_FORCE_NOOVERWRITE
#define SP_COPY_NEWER_ONLY
#define SPQ_SCAN_USE_CALLBACK
#define SP_COPY_NOOVERWRITE
#define SP_COPY_DELETESOURCE
#define SP_COPY_REPLACEONLY
#define SPFILENOTIFY_STARTREGISTRATION
#define SP_COPY_WARNIFSKIP
#define SP_COPY_NEWER_OR_SAME
#define SP_COPY_FORCE_NEWER
#define SPQ_SCAN_USE_CALLBACKEX
#define SPFILENOTIFY_CABINETINFO
#define SPFILENOTIFY_QUEUESCAN_EX
#define SP_COPY_SOURCE_ABSOLUTE
#define SPFILENOTIFY_ENDREGISTRATION
#define SPFILENOTIFY_NEEDNEWCABINET
UINT(CALLBACK * PSP_FILE_CALLBACK_A)(PVOID, UINT, UINT_PTR, UINT_PTR)
#define SPFILENOTIFY_FILEEXTRACTED
#define SP_COPY_IN_USE_NEEDS_REBOOT
#define SP_COPY_FORCE_IN_USE
#define SPFILENOTIFY_TARGETNEWER
#define SP_COPY_SOURCEPATH_ABSOLUTE
#define SP_COPY_LANGUAGEAWARE
#define SPFILENOTIFY_FILEINCABINET
PSP_FILE_CALLBACK_A orig_handler
PSECURITY_DESCRIPTOR dst_sd
struct file_op_queue copy_queue
struct file_op_queue delete_queue
struct file_op_queue rename_queue
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
#define INVALID_FILE_ATTRIBUTES
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
DWORD WINAPI GetLastError(void)
#define ERROR_PATH_NOT_FOUND
#define DACL_SECURITY_INFORMATION
#define OWNER_SECURITY_INFORMATION
#define GROUP_SECURITY_INFORMATION