28#define MEDIA_SIZE 999999999
29#define FOLDER_THRESHOLD 900000
129 res = pAddDelBackupEntry(
"one\0two\0three\0",
NULL,
"basename", 0);
144 win_skip(
"Test file could not be created\n");
179 "Expected path to exist\n");
205 BOOL fContinuation,
void *pv)
214 DWORD dwShareMode = 0;
227 dwCreateDisposition, 0,
NULL);
241 ok(
res,
"Failed to ReadFile\n");
253 ok(
res,
"Failed to WriteFile\n");
280 ok(
ret,
"Failed to DeleteFile %s\n", pszFile);
292 if (tempname && (
strlen(tempname) < (
unsigned)cbTempName))
319 ok(
res,
"Expected GetFileInformationByHandle to succeed\n");
341 ok(
res,
"Expected FCIAddFile to succeed\n");
350 pCabParams->
setID = 0xbeef;
361 static CHAR a_txt[] =
"a.txt",
363 testdir_c_txt[] =
"testdir\\c.txt",
364 testdir_d_txt[] =
"testdir\\d.txt";
373 ok(hfci !=
NULL,
"Failed to create an FCI context\n");
381 ok(
res,
"Failed to flush the cabinet\n");
384 ok(
res,
"Failed to destroy the cabinet\n");
407 hr = pExtractFiles(
"extract.cab", destFolder, 0,
NULL,
NULL, 0);
410 "Expected %08x or %08x, got %08x\n",
E_FAIL,
412 ok(!
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to not exist\n");
413 ok(!
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to not exist\n");
419 hr = pExtractFiles(
"extract.cab", destFolder, 0,
NULL,
NULL, 0);
420 ok(
hr ==
S_OK,
"Expected S_OK, got %d\n",
hr);
421 ok(
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
422 ok(
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to exist\n");
423 ok(
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to exist\n");
424 ok(
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to exist\n");
428 hr = pExtractFiles(
"extract.cab",
"dest", 0,
NULL,
NULL, 0);
429 ok(
hr ==
S_OK,
"Expected S_OK, got %d\n",
hr);
430 ok(
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
431 ok(
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to exist\n");
432 ok(
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to exist\n");
433 ok(
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to exist\n");
437 hr = pExtractFiles(
"extract.cab",
"dest", 0,
"a.txt:testdir\\c.txt",
NULL, 0);
438 ok(
hr ==
S_OK,
"Expected S_OK, got %d\n",
hr);
439 ok(
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
440 ok(
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to exist\n");
442 ok(!
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to not exist\n");
443 ok(!
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to not exist\n");
446 hr = pExtractFiles(
"extract.cab",
"dest", 0,
" :\t: a.txt:testdir\\c.txt \t:",
NULL, 0);
447 ok(
hr ==
S_OK,
"Expected S_OK, got %d\n",
hr);
448 ok(
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
449 ok(
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to exist\n");
451 ok(!
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to not exist\n");
452 ok(!
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to not exist\n");
455 hr = pExtractFiles(
"extract.cab",
"dest", 0,
" +-\\ a.txt:testdir\\c.txt a_:",
NULL, 0);
457 ok(!
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to not exist\n");
458 ok(!
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to not exist\n");
462 hr = pExtractFiles(
"extract.cab",
"dest", 0,
"",
NULL, 0);
464 ok(!
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to not exist\n");
468 hr = pExtractFiles(
"extract.cab",
"dest", 0,
"a.txt:idontexist:testdir\\c.txt",
NULL, 0);
470 ok(!
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to not exist\n");
471 ok(!
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to not exist\n");
475 static const WCHAR extract_cabW[] = {
'e',
'x',
't',
'r',
'a',
'c',
't',
'.',
'c',
'a',
'b',0};
476 static const WCHAR destW[] = {
'd',
'e',
's',
't',0};
477 static const WCHAR file_listW[] =
478 {
'a',
'.',
't',
'x',
't',
':',
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
'c',
'.',
't',
'x',
't',0};
480 hr = pExtractFilesW(extract_cabW, destW, 0, file_listW,
NULL, 0);
481 ok(
hr ==
S_OK,
"Expected S_OK, got %08x\n",
hr);
482 ok(
DeleteFileA(
"dest\\a.txt"),
"Expected dest\\a.txt to exist\n");
483 ok(
DeleteFileA(
"dest\\testdir\\c.txt"),
"Expected dest\\testdir\\c.txt to exist\n");
485 ok(!
DeleteFileA(
"dest\\b.txt"),
"Expected dest\\b.txt to not exist\n");
486 ok(!
DeleteFileA(
"dest\\testdir\\d.txt"),
"Expected dest\\testdir\\d.txt to not exist\n");
488 win_skip(
"ExtractFilesW not available\n");
501 skip(
"setupapi.dll not present\n");
514 hr = pAdvInstallFile(
NULL,
NULL,
"source.txt", destFolder,
"destination.txt", 0, 0);
516 ok(!
DeleteFileA(
"dest\\destination.txt"),
"Expected dest\\destination.txt to not exist\n");
521 ok(!
DeleteFileA(
"dest\\destination.txt"),
"Expected dest\\destination.txt to not exist\n");
526 ok(!
DeleteFileA(
"dest\\destination.txt"),
"Expected dest\\destination.txt to not exist\n");
529 hr = pAdvInstallFile(
NULL,
CURR_DIR,
"source.txt", destFolder,
"destination.txt", 0, 0);
530 ok(
hr ==
S_OK,
"Expected S_OK, got %d\n",
hr);
531 ok(
DeleteFileA(
"dest\\destination.txt"),
"Expected dest\\destination.txt to exist\n");
539 ok(
hr ==
S_OK,
"Expected S_OK, got %d\n",
hr);
540 ok(
DeleteFileA(
"dest\\destination.txt"),
"Expected dest\\destination.txt to exist\n");
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
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 GetFileAttributesA(LPCSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
DWORD WINAPI GetTempPathA(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)
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)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
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 sprintf(buf, format,...)
static PEXPLICIT_ACCESSW *static HMODULE hmod
static CHAR CURR_DIR[MAX_PATH]
static void test_ExtractFiles(void)
static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
static BOOL check_ini_file_attr(LPSTR filename)
static void createTestFile(const CHAR *name)
static void delete_test_files(void)
static void init_function_pointers(void)
static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
static void add_file(HFCI hfci, char *file)
static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
static void set_cab_parameters(PCCAB pCabParams)
static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
static void create_test_files(void)
static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime, USHORT *pattribs, int *err, void *pv)
static void test_AddDelBackupEntry(void)
static void test_AdvInstallFile(void)
static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
static void create_cab_file(void)
static int CDECL fci_delete(char *pszFile, int *err, void *pv)
static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile, BOOL fContinuation, void *pv)
static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
static HMODULE MODULEINFO DWORD cb
static char memory[1024 *256]
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_HIDDEN
char szCabPath[CB_MAX_CAB_PATH]
char szCab[CB_MAX_CABINET_NAME]
#define INVALID_FILE_ATTRIBUTES
#define ERROR_PATH_NOT_FOUND
#define HRESULT_FROM_WIN32(x)