* -gmt
*/
-#include "cabinet.h"
+#include "config.h"
+#include <stdarg.h>
#include <stdio.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winerror.h"
+#include "fdi.h"
+#include "cabinet.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(cabinet);
+
THOSE_ZIP_CONSTS;
struct fdi_file {
break;
}
/* The buffer is too small for the string. Reset the file to the point
- * were we started, free the buffer and increase the size for the next try
+ * where we started, free the buffer and increase the size for the next try
*/
fdi->seek(hf, base, SEEK_SET);
fdi->free(buf);
if (!fdi) return FALSE;
- if (!hf) {
- SetLastError(ERROR_INVALID_HANDLE);
- return FALSE;
- }
-
if (!pfdici) {
SetLastError(ERROR_BAD_ARGUMENTS);
return FALSE;
fullpath[0] = '\0';
if (pathlen) {
strcpy(fullpath, userpath);
+#ifdef __REACTOS__
+ if (fullpath[pathlen - 1] == '\\')
+ fullpath[pathlen - 1] = '\0';
+#else
if (fullpath[pathlen - 1] != '\\')
strcat(fullpath, "\\");
+#endif
}
+#ifdef __REACTOS__
+ if (filenamelen) {
+ strcat(fullpath, "\\");
+#else
if (filenamelen)
+#endif
strcat(fullpath, cab->mii.nextname);
+#ifdef __REACTOS__
+ }
+#endif
TRACE("full cab path/file name: %s\n", debugstr_a(fullpath));
fdin.psz2 = (CAB(mii).nextinfo) ? CAB(mii).nextinfo : &emptystring;
fdin.psz3 = pszCabPath;
- if (((*pfnfdin)(fdintCABINET_INFO, &fdin))) {
+ if (pfnfdin(fdintCABINET_INFO, &fdin) == -1) {
set_error( fdi, FDIERROR_USER_ABORT, 0 );
goto bail_and_fail;
}
* where all the cabinet files needed for decryption are simultaneously
* available. But presumably, the API is supposed to support cabinets which
* are split across multiple CDROMS; we may need to change our implementation
- * to strictly serialize it's file usage so that it opens only one cabinet
+ * to strictly serialize its file usage so that it opens only one cabinet
* at a time. Some experimentation with Windows is needed to figure out the
* precise semantics required. The relevant code is here and in fdi_decomp().
*/
* if we imagine parallelized access to the FDICopy API.
*
* The current implementation punts -- it just returns the previous cabinet and
- * it's info from the header of this cabinet. This provides the right answer in
- * 95% of the cases; its worth checking if Microsoft cuts the same corner before
+ * its info from the header of this cabinet. This provides the right answer in
+ * 95% of the cases; it's worth checking if Microsoft cuts the same corner before
* we "fix" it.
*/
ZeroMemory(&fdin, sizeof(FDINOTIFICATION));
fdin.psz2 = (CAB(mii).prevname) ? CAB(mii).prevname : &emptystring;
fdin.psz3 = (CAB(mii).previnfo) ? CAB(mii).previnfo : &emptystring;
- if (((*pfnfdin)(fdintPARTIAL_FILE, &fdin))) {
+ if (pfnfdin(fdintPARTIAL_FILE, &fdin) == -1) {
set_error( fdi, FDIERROR_USER_ABORT, 0 );
goto bail_and_fail;
}
fdin.date = file->date;
fdin.time = file->time;
fdin.attribs = file->attribs;
+ fdin.iFolder = file->index;
if ((filehf = ((*pfnfdin)(fdintCOPY_FILE, &fdin))) == -1) {
set_error( fdi, FDIERROR_USER_ABORT, 0 );
filehf = 0;
fdin.date = file->date;
fdin.time = file->time;
fdin.attribs = file->attribs; /* FIXME: filter _A_EXEC? */
+ fdin.iFolder = file->index;
((*pfnfdin)(fdintCLOSE_FILE_INFO, &fdin));
filehf = 0;