28#define MEDIA_SIZE 999999999
29#define FOLDER_THRESHOLD 900000
36#define EXTRACT_FILLFILELIST 0x00000001
37#define EXTRACT_EXTRACTFILES 0x00000002
147 BOOL fContinuation,
void *pv)
156 DWORD dwShareMode = 0;
169 dwCreateDisposition, 0,
NULL);
183 ok(
res,
"Failed to ReadFile\n");
195 ok(
res,
"Failed to WriteFile\n");
222 ok(
ret,
"Failed to DeleteFile %s\n", pszFile);
234 if (tempname && (
strlen(tempname) < (
unsigned)cbTempName))
261 ok(
res,
"Expected GetFileInformationByHandle to succeed\n");
283 ok(
res,
"Expected FCIAddFile to succeed\n");
292 pCabParams->
setID = 0xbeef;
303 static CHAR a_txt[] =
"a.txt",
305 testdir_c_txt[] =
"testdir\\c.txt",
306 testdir_d_txt[] =
"testdir\\d.txt";
315 ok(hfci !=
NULL,
"Failed to create an FCI context\n");
323 ok(
res,
"Failed to flush the cabinet\n");
326 ok(
res,
"Failed to destroy the cabinet\n");
337 if ((*node)->DoExtract != do_extract)
385 "Expected FDIERROR_NONE, got %d\n",
session.Error.erfOper);
386 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
390 "Expected EXTRACT_FILLFILELIST | EXTRACT_EXTRACTFILES, got %d\n",
session.Operation);
393 "Expected dest\\testdir\\d.txt, got %s\n",
session.CurrentFile);
394 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
395 ok(!
session.FilterList,
"Expected empty filter list\n");
396 ok(
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
397 ok(
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to exist\n");
398 ok(
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to exist\n");
399 ok(
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to exist\n");
416 "Expected FDIERROR_NONE, got %d\n",
session.Error.erfOper);
417 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
421 "Expected EXTRACT_FILLFILELIST, got %d\n",
session.Operation);
424 "Expected dest\\testdir\\d.txt, got %s\n",
session.CurrentFile);
425 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
426 ok(!
session.FilterList,
"Expected empty filter list\n");
427 ok(!
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to not exist\n");
428 ok(!
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to not exist\n");
441 "Expected FDIERROR_NONE, got %d\n",
session.Error.erfOper);
442 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
446 "Expected EXTRACT_EXTRACTFILES, got %d\n",
session.Operation);
449 "Expected dest\\testdir\\d.txt, got %s\n",
session.CurrentFile);
450 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
451 ok(!
session.FilterList,
"Expected empty filter list\n");
452 ok(
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
453 ok(
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to exist\n");
454 ok(
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to exist\n");
455 ok(
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to exist\n");
469 "Expected FDIERROR_NONE, got %d\n",
session.Error.erfOper);
470 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
474 "Expected EXTRACT_EXTRACTFILES, got %d\n",
session.Operation);
477 "Expected dest\\testdir\\d.txt, got %s\n",
session.CurrentFile);
478 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
479 ok(!
session.FilterList,
"Expected empty filter list\n");
480 ok(!
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to not exist\n");
481 ok(!
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to not exist\n");
482 ok(!
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to not exist\n");
483 ok(!
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to not exist\n");
502 "Expected FDIERROR_NONE, got %d\n",
session.Error.erfOper);
503 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
507 "Expected EXTRACT_EXTRACTFILES, got %d\n",
session.Operation);
510 "Expected dest\\testdir\\d.txt, got %s\n",
session.CurrentFile);
511 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
512 ok(!
session.FilterList,
"Expected empty filter list\n");
513 ok(
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
514 ok(
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to exist\n");
515 ok(!
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to not exist\n");
516 ok(!
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to not exist\n");
530 "Expected FDIERROR_NONE, got %d\n",
session.Error.erfOper);
531 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
535 "Expected EXTRACT_FILLFILELIST, got %d\n",
session.Operation);
538 "Expected dest\\testdir\\d.txt, got %s\n",
session.CurrentFile);
539 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
540 ok(!
session.FilterList,
"Expected empty filter list\n");
541 ok(!
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to not exist\n");
542 ok(!
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to not exist\n");
543 ok(!
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to not exist\n");
544 ok(!
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to not exist\n");
556 "Expected FDIERROR_NONE, got %d\n",
session.Error.erfOper);
557 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
563 "Expected dest\\testdir\\d.txt, got %s\n",
session.CurrentFile);
564 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
565 ok(!
session.FilterList,
"Expected empty filter list\n");
566 ok(!
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
567 ok(!
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to exist\n");
568 ok(!
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to exist\n");
569 ok(!
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to exist\n");
582 "Expected FDIERROR_NONE, got %d\n",
session.Error.erfOper);
583 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
589 "Expected dest\\testdir\\d.txt, got %s\n",
session.CurrentFile);
590 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
591 ok(
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
592 ok(
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to exist\n");
593 ok(
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to exist\n");
594 ok(
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to exist\n");
613 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08x\n",
res);
615 "Expected FDIERROR_CABINET_NOT_FOUND, got %d\n",
session.Error.erfOper);
617 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
621 "Expected EXTRACT_FILLFILELIST | EXTRACT_EXTRACTFILES, got %d\n",
session.Operation);
623 ok(!*
session.CurrentFile,
"Expected empty string, got %s\n",
session.CurrentFile);
624 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
625 ok(!
session.FilterList,
"Expected empty filter list\n");
626 ok(!
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to not exist\n");
627 ok(!
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to not exist\n");
628 ok(!
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to not exist\n");
629 ok(!
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to not exist\n");
639 ok(
getFileSize(
"dest\\a.txt") == 11,
"Expected dest\\a.txt to be 11 bytes\n");
646 "Expected HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED) or E_FAIL, got %08x\n",
res);
649 "Expected FDIERROR_USER_ABORT, got %d\n",
session.Error.erfOper);
653 "Expected dest\\a.txt, got %s\n",
session.CurrentFile);
654 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
656 "Expected EXTRACT_FILLFILELIST | EXTRACT_EXTRACTFILES, got %d\n",
session.Operation);
658 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
659 ok(!
session.FilterList,
"Expected empty filter list\n");
660 ok(
getFileSize(
"dest\\a.txt") == 11,
"Expected dest\\a.txt to be 11 bytes\n");
661 ok(!
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to be read-only\n");
662 ok(!
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to not exist\n");
663 ok(!
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to not exist\n");
664 ok(!
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to not exist\n");
684 "Expected HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED) or E_FAIL, got %08x\n",
res);
687 "Expected FDIERROR_USER_ABORT, got %d\n",
session.Error.erfOper);
691 "Expected dest\\c.txt, got %s\n",
session.CurrentFile);
692 ok(
session.Error.erfType == 0,
"Expected 0, got %d\n",
session.Error.erfType);
694 "Expected EXTRACT_FILLFILELIST | EXTRACT_EXTRACTFILES, got %d\n",
session.Operation);
696 ok(!*
session.Reserved,
"Expected empty string, got %s\n",
session.Reserved);
697 ok(!
session.FilterList,
"Expected empty filter list\n");
698 ok(
getFileSize(
"dest\\a.txt") == 6,
"Expected dest\\a.txt to be 6 bytes\n");
699 ok(
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
700 ok(
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to exist\n");
701 ok(!
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to be read-only\n");
702 ok(!
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to not exist\n");
vector< FileInfo > FileList
ACPI_SIZE strlen(const char *String)
#define mem_free(ptr, bsize)
#define INVALID_SET_FILE_POINTER
#define ReadFile(a, b, c, d, e)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define HeapFree(x, y, z)
#define FILE_ATTRIBUTE_NORMAL
#define ERROR_ACCESS_DENIED
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
BOOL WINAPI FileTimeToDosDateTime(IN CONST FILETIME *lpFileTime, OUT LPWORD lpFatDate, OUT LPWORD lpFatTime)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
BOOL __cdecl FCIAddFile(HFCI hfci, char *pszSourceFile, char *pszFileName, BOOL fExecute, PFNFCIGETNEXTCABINET pfnfcignc, PFNFCISTATUS pfnfcis, PFNFCIGETOPENINFO pfnfcigoi, TCOMP typeCompress)
BOOL __cdecl FCIDestroy(HFCI hfci)
HFCI __cdecl FCICreate(PERF perf, PFNFCIFILEPLACED pfnfiledest, PFNFCIALLOC pfnalloc, PFNFCIFREE pfnfree, PFNFCIOPEN pfnopen, PFNFCIREAD pfnread, PFNFCIWRITE pfnwrite, PFNFCICLOSE pfnclose, PFNFCISEEK pfnseek, PFNFCIDELETE pfndelete, PFNFCIGETTEMPFILE pfnfcigtf, PCCAB pccab, void *pv)
BOOL __cdecl FCIFlushCabinet(HFCI hfci, BOOL fGetNextCab, PFNFCIGETNEXTCABINET pfnfcignc, PFNFCISTATUS pfnfcis)
@ FDIERROR_CABINET_NOT_FOUND
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
double __cdecl erf(double)
#define FILE_FLAG_SEQUENTIAL_SCAN
#define ERROR_FILE_NOT_FOUND
static HMODULE MODULEINFO DWORD cb
static char memory[1024 *256]
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
#define FILE_ATTRIBUTE_READONLY
static unsigned __int64 next
char szCabPath[CB_MAX_CAB_PATH]
char szCab[CB_MAX_CABINET_NAME]
#define INVALID_FILE_ATTRIBUTES
_Reserved_ PVOID Reserved
#define HRESULT_FROM_WIN32(x)