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");
546 ASSERT(pSetupData->ComputerType);
552 if (AdditionalSectionName &&
554 AdditionalSectionName,
555 &pSetupData->DestinationPath))
558 if (pSetupData->ErrorRoutine)
559 pSetupData->ErrorRoutine(pSetupData, AdditionalSectionName);
569 &pSetupData->DestinationPath);
572 DPRINT1(
"AddSectionToCopyQueueCab(%S) failed!\n", SourceCabinet);
574 if (pSetupData->ErrorRoutine)
575 pSetupData->ErrorRoutine(pSetupData,
L"SourceFiles");
598 pSetupData->DestinationPath.Buffer);
600 DPRINT(
"FullPath(1): '%S'\n", PathBuffer);
606 DPRINT1(
"Creating directory '%S' failed: Status = 0x%08lx\n", PathBuffer,
Status);
608 if (pSetupData->ErrorRoutine)
609 pSetupData->ErrorRoutine(pSetupData, PathBuffer);
625 if (pSetupData->ErrorRoutine)
626 pSetupData->ErrorRoutine(pSetupData,
L"Directories");
641 pSetupData->InstallPath.Buffer,
647 DPRINT1(
"Could not build the full path for '%S', skipping...\n", DirKeyValue);
666 DPRINT1(
"Creating directory '%S' failed: Status = 0x%08lx\n", PathBuffer,
Status);
668 if (pSetupData->ErrorRoutine)
669 pSetupData->ErrorRoutine(pSetupData, PathBuffer);
692#if defined(__REACTOS__) && defined(USE_CABINET_INF)
701 if (pSetupData->SetupFileQueue ==
NULL)
704 if (pSetupData->ErrorRoutine)
705 pSetupData->ErrorRoutine(pSetupData);
733 pSetupData->SourcePath.Buffer, CabinetName);
735#if defined(__REACTOS__) && defined(USE_CABINET_INF)
744 DPRINT(
"Cabinet %S\n", PathBuffer);
747 if (InfFileData ==
NULL)
752 if (pSetupData->ErrorRoutine)
753 pSetupData->ErrorRoutine(pSetupData, PathBuffer);
759 DPRINT(
"Cannot open cabinet: %S.\n", PathBuffer);
763 if (pSetupData->ErrorRoutine)
764 pSetupData->ErrorRoutine(pSetupData, PathBuffer);
772 pSetupData->LanguageId,
782 if (!
ptr)
ptr = PathBuffer;
795 pSetupData->LanguageId,
803 if (pSetupData->ErrorRoutine)
804 pSetupData->ErrorRoutine(pSetupData, PathBuffer);
810#if !(defined(__REACTOS__) && defined(USE_CABINET_INF))
817#if !(defined(__REACTOS__) && defined(USE_CABINET_INF))
834 (
HSPFILEQ)pSetupData->SetupFileQueue,
839 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_ PCWSTR ComputerType, _Out_ PWSTR *AdditionalSectionName)
struct _GENENTRY * PGENENTRY
#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)
Create a new directory, specified by the given path. Any intermediate non-existing directory is creat...
_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)
PGENERIC_LIST_ENTRY GetCurrentListEntry(IN PGENERIC_LIST List)
PVOID GetListEntryData(IN PGENERIC_LIST_ENTRY Entry)
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
base of all file and directory entries
#define STATUS_INVALID_PARAMETER
#define STATUS_OBJECT_NAME_COLLISION