42 DPRINT1(
"SpInfFindFirstLine() failed\n");
48 DPRINT1(
"INF_GetData() failed\n");
52 DPRINT1(
"LookupDirectoryById(%S) - directory not found!\n", DirId);
87 if (!InfContext && !SourceFileName)
121 DPRINT1(
"INF_GetData() failed\n");
133 DPRINT1(
"SpInfFindFirstLine(\"SourceDisksNames\", \"%S\") failed\n", SourceRootDirId);
147 DPRINT1(
"INF_GetData() failed\n");
154 SourceRelativePath =
NULL;
156 else if (!*SourceRelativePath)
159 SourceRelativePath =
NULL;
161 if (!SourceRelativePath)
171 SourceRelativePath =
NULL;
173 else if (!*SourceRelativePath)
176 SourceRelativePath =
NULL;
189 DPRINT1(
"INF_GetData() failed\n");
208 TargetFileName =
NULL;
209 else if (!*TargetFileName)
210 TargetFileName =
NULL;
212 DPRINT(
"GetSourceFileAndTargetLocation(%S) = "
213 "SrcRootDir: '%S', SrcRelPath: '%S' --> TargetDir: '%S', TargetFileName: '%S'\n",
214 SourceFileName, SourceRootDir, SourceRelativePath, TargetDir, TargetFileName);
223 *pSourceRootPath = SourceRootDir;
224 *pSourcePath = SourceRelativePath;
225 *pTargetDirectory = TargetDir;
226 *pTargetFileName = TargetFileName;
244 DPRINT(
"InstallationPath: '%S'\n", RelativePath);
249 DPRINT(
"InstallationPath(2): '%S'\n", FullPath);
251 else if (RelativePath[0] ==
L'\\')
254 DPRINT(
"AbsolutePath: '%S'\n", RelativePath);
257 RootPath, RelativePath);
259 DPRINT(
"AbsolutePath(2): '%S'\n", FullPath);
264 DPRINT(
"RelativePath: '%S'\n", RelativePath);
267 RootPath, BasePath, RelativePath);
269 DPRINT(
"RelativePath(2): '%S'\n", FullPath);
306 DPRINT1(
"AddSectionToCopyQueueCab(): Unable to find section '%S' in cabinet file\n", SectionName);
316 if (!
INF_GetData(&FilesContext, &SourceFileName, &TargetDirId))
319 DPRINT1(
"INF_GetData() failed\n");
326 TargetFileName =
NULL;
328 else if (!*TargetFileName)
331 TargetFileName =
NULL;
345 DPRINT(
"GetSourceTargetFromCab(%S) = "
346 "SrcRootDir: '%S', SrcRelPath: '%S' --> TargetDir: '%S', TargetFileName: '%S'\n",
348 pSetupData->SourcePath.Buffer,
349 pSetupData->SourceRootDir.Buffer,
350 TargetDir, TargetFileName);
353 pSetupData->DestinationPath.Buffer,
356 DPRINT(
" --> FileDstPath = '%S'\n", FileDstPath);
361 pSetupData->SourcePath.Buffer,
372 DPRINT1(
"SpFileQueueCopy() failed\n");
419 DPRINT1(
"AddSectionToCopyQueue(): Unable to find section '%S' in TXTSETUP.SIF\n", SectionName);
432 DPRINT1(
"INF_GetData() failed\n");
445 DPRINT1(
"Could not find source and target location for file '%S'\n", SourceFileName);
450 if (pSetupData->ErrorRoutine)
451 pSetupData->ErrorRoutine(pSetupData, SectionName);
462 pSetupData->SourceRootPath.Buffer,
466 DPRINT(
" --> FileSrcRootPath = '%S'\n", FileSrcRootPath);
471 pSetupData->DestinationPath.Buffer,
475 DPRINT(
" --> FileDstPath = '%S'\n", FileDstPath);
491 DPRINT1(
"SpFileQueueCopy() failed\n");
516 if (SourceCabinet ==
NULL)
521 L"SourceDisksFiles." INF_ARCH,
522 &pSetupData->DestinationPath);
525 DPRINT1(
"AddSectionToCopyQueue(%S) failed!\n",
L"SourceDisksFiles." INF_ARCH);
530 &pSetupData->DestinationPath);
533 DPRINT1(
"AddSectionToCopyQueue(%S) failed!\n",
L"SourceDisksFiles");
535 if (pSetupData->ErrorRoutine)
536 pSetupData->ErrorRoutine(pSetupData,
L"SourceDisksFiles");
544 if (AdditionalSectionName &&
546 AdditionalSectionName,
547 &pSetupData->DestinationPath))
550 if (pSetupData->ErrorRoutine)
551 pSetupData->ErrorRoutine(pSetupData, AdditionalSectionName);
561 &pSetupData->DestinationPath);
564 DPRINT1(
"AddSectionToCopyQueueCab(%S) failed!\n", SourceCabinet);
566 if (pSetupData->ErrorRoutine)
567 pSetupData->ErrorRoutine(pSetupData,
L"SourceFiles");
590 pSetupData->DestinationPath.Buffer);
592 DPRINT(
"FullPath(1): '%S'\n", PathBuffer);
598 DPRINT1(
"Creating directory '%S' failed: Status = 0x%08lx\n", PathBuffer,
Status);
600 if (pSetupData->ErrorRoutine)
601 pSetupData->ErrorRoutine(pSetupData, PathBuffer);
617 if (pSetupData->ErrorRoutine)
618 pSetupData->ErrorRoutine(pSetupData,
L"Directories");
633 pSetupData->InstallPath.Buffer,
639 DPRINT1(
"Could not build the full path for '%S', skipping...\n", DirKeyValue);
658 DPRINT1(
"Creating directory '%S' failed: Status = 0x%08lx\n", PathBuffer,
Status);
660 if (pSetupData->ErrorRoutine)
661 pSetupData->ErrorRoutine(pSetupData, PathBuffer);
684#if defined(__REACTOS__) && defined(USE_CABINET_INF)
693 if (pSetupData->SetupFileQueue ==
NULL)
696 if (pSetupData->ErrorRoutine)
697 pSetupData->ErrorRoutine(pSetupData);
725 pSetupData->SourcePath.Buffer, CabinetName);
727#if defined(__REACTOS__) && defined(USE_CABINET_INF)
736 DPRINT(
"Cabinet %S\n", PathBuffer);
739 if (InfFileData ==
NULL)
744 if (pSetupData->ErrorRoutine)
745 pSetupData->ErrorRoutine(pSetupData, PathBuffer);
751 DPRINT(
"Cannot open cabinet: %S.\n", PathBuffer);
755 if (pSetupData->ErrorRoutine)
756 pSetupData->ErrorRoutine(pSetupData, PathBuffer);
764 pSetupData->LanguageId,
774 if (!
ptr)
ptr = PathBuffer;
787 pSetupData->LanguageId,
795 if (pSetupData->ErrorRoutine)
796 pSetupData->ErrorRoutine(pSetupData, PathBuffer);
802#if !(defined(__REACTOS__) && defined(USE_CABINET_INF))
809#if !(defined(__REACTOS__) && defined(USE_CABINET_INF))
826 (
HSPFILEQ)pSetupData->SetupFileQueue,
831 pSetupData->SetupFileQueue =
NULL;
static BOOL LookupDirectoryById(IN HINF InfHandle, IN OUT PINFCONTEXT InfContext, IN PCWSTR DirId, OUT PCWSTR *pDirectory)
BOOLEAN DoFileCopy(IN OUT PUSETUP_DATA pSetupData, IN PSP_FILE_CALLBACK_W MsgHandler, IN PVOID Context OPTIONAL)
static NTSTATUS BuildFullDirectoryPath(IN PCWSTR RootPath, IN PCWSTR BasePath, IN PCWSTR RelativePath, OUT PWSTR FullPath, IN SIZE_T cchFullPathSize)
BOOLEAN PrepareCopyInfFile(IN OUT PUSETUP_DATA pSetupData, IN HINF InfFile, IN PCWSTR SourceCabinet OPTIONAL)
BOOLEAN PrepareFileCopy(IN OUT PUSETUP_DATA pSetupData, IN PFILE_COPY_STATUS_ROUTINE StatusRoutine OPTIONAL)
static BOOLEAN AddSectionToCopyQueueCab(IN PUSETUP_DATA pSetupData, IN HINF InfFile, IN PCWSTR SectionName, IN PCWSTR SourceCabinet, IN PCUNICODE_STRING DestinationPath)
static BOOLEAN AddSectionToCopyQueue(IN PUSETUP_DATA pSetupData, IN HINF InfFile, IN PCWSTR SectionName, IN PCUNICODE_STRING DestinationPath)
static NTSTATUS GetSourceFileAndTargetLocation(IN HINF InfHandle, IN PINFCONTEXT InfContext OPTIONAL, IN PCWSTR SourceFileName OPTIONAL, OUT PCWSTR *pSourceRootPath, OUT PCWSTR *pSourcePath, OUT PCWSTR *pTargetDirectory, OUT PCWSTR *pTargetFileName)
VOID(__cdecl * PFILE_COPY_STATUS_ROUTINE)(IN FILE_COPY_STATUS,...)
BOOLEAN ProcessComputerFiles(IN HINF InfFile, IN PGENERIC_LIST List, OUT PWSTR *AdditionalSectionName)
#define CAB_STATUS_SUCCESS
HINF WINAPI INF_OpenBufferedFileA(IN PSTR FileBuffer, IN ULONG FileSize, IN PCSTR InfClass, IN DWORD InfStyle, IN LCID LocaleId, OUT PUINT ErrorLine)
ULONG CabinetOpen(IN OUT PCABINET_CONTEXT CabinetContext)
PVOID CabinetGetCabinetReservedArea(IN PCABINET_CONTEXT CabinetContext, OUT PULONG Size)
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)
_In_ PFCB _In_ PCD_NAME _In_ BOOLEAN _Inout_ PFILE_ENUM_CONTEXT FileContext
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT DirContext
#define NT_SUCCESS(StatCode)
#define INVALID_HANDLE_VALUE
@ ERROR_CREATE_INSTALL_DIR
@ ERROR_INVALID_CABINET_INF
pSpFileQueueClose SpFileQueueClose
UINT(CALLBACK * PSP_FILE_CALLBACK_W)(IN PVOID Context, IN UINT Notification, IN UINT_PTR Param1, IN UINT_PTR Param2)
pSpFileQueueCopy SpFileQueueCopy
pSpFileQueueOpen SpFileQueueOpen
pSpFileQueueCommit SpFileQueueCommit
NTSTATUS CombinePaths(OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN ...)
NTSTATUS SetupCreateDirectory(IN PCWSTR PathName)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
pSpInfFindNextLine SpInfFindNextLine
pSpInfFindFirstLine SpInfFindFirstLine
FORCEINLINE VOID INF_FreeData(IN PCWSTR InfData)
pSpInfOpenInfFile SpInfOpenInfFile
pSpInfCloseInfFile SpInfCloseInfFile
BOOLEAN INF_GetDataField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PCWSTR *Data)
BOOLEAN INF_GetData(IN PINFCONTEXT Context, OUT PCWSTR *Key, OUT PCWSTR *Data)
static const char const char const char PIMAGEHLP_STATUS_ROUTINE StatusRoutine
#define UNREFERENCED_PARAMETER(P)
NTSTRSAFEAPI RtlStringCchCopyW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
PULONG MinorVersion OPTIONAL
#define STATUS_INVALID_PARAMETER
#define STATUS_OBJECT_NAME_COLLISION