ifneq ($(ROS_TEMPORARY),)
TEMPORARY := $(ROS_TEMPORARY)
else
- TEMPORARY := .
+ TEMPORARY :=
endif
TEMPORARY_ := $(TEMPORARY)$(SEP)
<directory name="reporterror">\r
<xi:include href="reporterror/reporterror.xml" />\r
</directory>\r
+<directory name="rundll32">\r
+ <xi:include href="rundll32/rundll32.xml" />\r
+</directory>\r
<directory name="services">\r
<xi:include href="services/services.xml" />\r
</directory>\r
{
FILEHANDLE SrcFile;
PCFFILE_NODE FileNode;
+ char* NewFileName;
- FileNode = NewFileNode();
- if (!FileNode) {
+ NewFileName = (char*)AllocateMemory(strlen(FileName) + 1);
+ if (!NewFileName) {
DPRINT(MIN_TRACE, ("Insufficient memory.\n"));
return CAB_STATUS_NOMEMORY;
}
-
- FileNode->FolderNode = CurrentFolderNode;
-
- FileNode->FileName = (char*)AllocateMemory(strlen(FileName) + 1);
- strcpy(FileNode->FileName, FileName);
- ConvertPath(FileNode->FileName, false);
+ strcpy(NewFileName, FileName);
+ ConvertPath(NewFileName, false);
/* Try to open file */
#if defined(WIN32)
SrcFile = CreateFile(
- FileNode->FileName, // Open this file
+ NewFileName, // Open this file
GENERIC_READ, // Open for reading
FILE_SHARE_READ, // Share for reading
NULL, // No security
FILE_ATTRIBUTE_NORMAL, // Normal file
NULL); // No attribute template
if (SrcFile == INVALID_HANDLE_VALUE) {
- DPRINT(MID_TRACE, ("File not found (%s).\n", FileNode->FileName));
+ DPRINT(MID_TRACE, ("File not found (%s).\n", NewFileName));
+ FreeMemory(NewFileName);
return CAB_STATUS_CANNOT_OPEN;
}
#else /* !WIN32 */
- SrcFile = fopen(FileNode->FileName, "rb");
+ SrcFile = fopen(NewFileName, "rb");
if (SrcFile == NULL) {
- DPRINT(MID_TRACE, ("File not found (%s).\n", FileNode->FileName));
+ DPRINT(MID_TRACE, ("File not found (%s).\n", NewFileName));
+ FreeMemory(NewFileName);
return CAB_STATUS_CANNOT_OPEN;
}
#endif
+ FileNode = NewFileNode();
+ if (!FileNode) {
+ DPRINT(MIN_TRACE, ("Insufficient memory.\n"));
+ FreeMemory(NewFileName);
+ return CAB_STATUS_NOMEMORY;
+ }
+
+ FileNode->FolderNode = CurrentFolderNode;
+ FileNode->FileName = NewFileName;
+
/* FIXME: Check for and handle large files (>= 2GB) */
FileNode->File.FileSize = GetSizeOfFile(SrcFile);
if (FileNode->File.FileSize == (unsigned long)-1) {
DPRINT(MIN_TRACE, ("Cannot read from file.\n"));
+ FreeMemory(NewFileName);
return CAB_STATUS_CANNOT_READ;
}
char SrcName[MAX_PATH];
char DstName[MAX_PATH];
char InfLine[MAX_PATH];
+ char BaseFilename[MAX_PATH];
- strcpy(SrcName, FileRelativePath);
+ strcpy(SrcName, "");
strcpy(DstName, "");
i = CurrentChar;
CurrentString[i] = '\0';
CurrentToken = TokenString;
CurrentChar = i + 1;
- strcat(SrcName, CurrentString);
+ strcpy(BaseFilename, CurrentString);
+ strcat(SrcName, BaseFilename);
SkipSpaces();
WriteInfLine(InfLine);
Status = AddFile(SrcName);
+ if (Status == CAB_STATUS_CANNOT_OPEN) {
+ strcpy(SrcName, FileRelativePath);
+ strcat(SrcName, BaseFilename);
+ Status = AddFile(SrcName);
+ }
if (Status != CAB_STATUS_SUCCESS) {
if (Status == CAB_STATUS_CANNOT_OPEN)
printf("File does not exist: %s.\n", SrcName);
const Module& m = *module.project.modules[i];\r
if ( m.bootstrap != NULL )\r
{\r
+ string sourceFilename = PassThruCacheDirectory (\r
+ NormalizeFilename ( m.GetPath () ),\r
+ backend->outputDirectory );\r
string targetFilenameNoFixup ( bootcdDirectory + SSEP + m.bootstrap->base + SSEP + m.bootstrap->nameoncd );\r
string targetFilename = MingwModuleHandler::PassThruCacheDirectory (\r
NormalizeFilename ( targetFilenameNoFixup ),\r
"\t$(ECHO_CP)\n" );\r
fprintf ( fMakefile,\r
"\t${cp} %s %s 1>$(NUL)\n",\r
- m.GetPath ().c_str (),\r
+ sourceFilename.c_str (),\r
targetFilename.c_str () );\r
}\r
}\r
MingwIsoModuleHandler::GenerateIsoModuleTarget ()\r
{\r
string bootcdDirectory = "cd";\r
+ string bootcd = PassThruCacheDirectory (\r
+ NormalizeFilename ( bootcdDirectory + SSEP ),\r
+ backend->outputDirectory );\r
string isoboot = PassThruCacheDirectory (\r
- NormalizeFilename ( "boot/freeldr/bootsect/isoboot.o" ),\r
- backend->intermediateDirectory );\r
- string bootcdReactosNoFixup = bootcdDirectory + "/reactos";\r
+ NormalizeFilename ( "boot" SSEP "freeldr" SSEP "bootsect" SSEP "isoboot.o" ),\r
+ backend->outputDirectory );\r
+ string bootcdReactosNoFixup = bootcdDirectory + SSEP "reactos";\r
string bootcdReactos = PassThruCacheDirectory (\r
NormalizeFilename ( bootcdReactosNoFixup ),\r
backend->outputDirectory );\r
CLEAN_FILE ( bootcdReactos );\r
- string reactosInf = ros_temp + NormalizeFilename ( bootcdReactosNoFixup + "/reactos.inf" );\r
- string reactosDff = NormalizeFilename ( "bootdata/packages/reactos.dff" );\r
+ string reactosInf = PassThruCacheDirectory (\r
+ NormalizeFilename ( bootcdReactosNoFixup + SSEP "reactos.inf" ),\r
+ backend->outputDirectory );\r
+ string reactosDff = NormalizeFilename ( "bootdata" SSEP "packages" SSEP "reactos.dff" );\r
string cdDirectories = GetCdDirectories ( bootcdDirectory );\r
vector<string> vCdFiles;\r
GetCdFiles ( vCdFiles );\r
cdFiles.c_str () );\r
fprintf ( fMakefile, "\t$(ECHO_CABMAN)\n" );\r
fprintf ( fMakefile,\r
- "\t$(Q)$(CABMAN_TARGET) -C %s -L %s -I\n",\r
+ "\t$(Q)$(CABMAN_TARGET) -C %s -L %s -I -P $(OUTPUT)\n",\r
reactosDff.c_str (),\r
bootcdReactos.c_str () );\r
fprintf ( fMakefile,\r
fprintf ( fMakefile,\r
"\t$(Q)$(CDMAKE_TARGET) -v -m -b %s %s REACTOS ReactOS.iso\n",\r
isoboot.c_str (),\r
- bootcdDirectory.c_str () );\r
+ bootcd.c_str () );\r
fprintf ( fMakefile,\r
"\n" );\r
}\r