/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
- * FILE: subsys/system/usetup/cabinet.c
+ * FILE: base/setup/usetup/cabinet.c
* PURPOSE: Cabinet routines
* PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
* REVISIONS:
#include "usetup.h"
+#define Z_SOLO
#include <zlib.h>
#define NDEBUG
if (!NT_SUCCESS(NtStatus))
{
- DPRINT("Cannot open file (%S) (%x)\n", CabinetName, NtStatus);
+ DPRINT1("Cannot open file (%S) (%x)\n", CabinetName, NtStatus);
return CAB_STATUS_CANNOT_OPEN;
}
if (!NT_SUCCESS(NtStatus))
{
- DPRINT("NtCreateSection failed: %x\n", NtStatus);
+ DPRINT1("NtCreateSection failed for %ls: %x\n", CabinetName, NtStatus);
return CAB_STATUS_NOMEMORY;
}
if (!NT_SUCCESS(NtStatus))
{
- DPRINT("NtMapViewOfSection failed: %x\n", NtStatus);
+ DPRINT1("NtMapViewOfSection failed: %x\n", NtStatus);
return CAB_STATUS_NOMEMORY;
}
PCABHeader->FileTableOffset < sizeof(CFHEADER))
{
CloseCabinet();
- DPRINT("File has invalid header\n");
+ DPRINT1("File has invalid header\n");
return CAB_STATUS_INVALID_CAB;
}
#if 0
int
-Validate()
+Validate(VOID)
{
return (int)RtlValidateHeap(ProcessHeap, 0, 0);
}
if (!NT_SUCCESS(NtStatus))
{
- DPRINT("NtCreateFile() failed (%S) (%x)\n", DestName, NtStatus);
+ DPRINT1("NtCreateFile() failed (%S) (%x)\n", DestName, NtStatus);
return CAB_STATUS_CANNOT_CREATE;
}
}
else
{
- DPRINT("File (%S) exists\n", DestName);
+ DPRINT1("File (%S) exists\n", DestName);
return CAB_STATUS_FILE_EXISTS;
}
}
if (!NT_SUCCESS(NtStatus))
{
- DPRINT("NtCreateSection failed: %x\n", NtStatus);
+ DPRINT1("NtCreateSection failed for %ls, %x\n", DestName, NtStatus);
Status = CAB_STATUS_NOMEMORY;
goto CloseDestFile;
}
if (!NT_SUCCESS(NtStatus))
{
- DPRINT("NtMapViewOfSection failed: %x\n", NtStatus);
+ DPRINT1("NtMapViewOfSection failed: %x\n", NtStatus);
Status = CAB_STATUS_NOMEMORY;
goto CloseDestFileSection;
}
Search->File->FileTime,
&FileTime))
{
- DPRINT("DosDateTimeToFileTime() failed\n");
+ DPRINT1("DosDateTimeToFileTime() failed\n");
Status = CAB_STATUS_CANNOT_WRITE;
goto UnmapDestFile;
}
Size -= OutputLength;
/* reduce remaining block size by bytes consumed */
RemainingBlock -= InputLength;
- if (RemainingBlock == 0)
+ if (Size > 0 && RemainingBlock == 0)
{
/* used up this block, move on to the next */
DPRINT("Out of block data\n");