54 DWORD dwNumberOfBytesWritten;
58 static const char data[] =
60 "Signature=\"$Chicago$\"\n"
63 "RegisterOCXs=RegisterOCXsSection\n"
64 "[RegisterOCXsSection]\n"
65 "%%11%%\\ole32.dll\n";
110 if (!pSetupQueryInfOriginalFileInformationA)
112 win_skip(
"SetupQueryInfOriginalFileInformationA is not available\n");
128 res = pSetupQueryInfOriginalFileInformationA(pspii, 0,
NULL, &spofi);
130 "SetupQueryInfOriginalFileInformationA should have failed with ERROR_INVALID_USER_BUFFER instead of %d\n",
GetLastError());
132 spofi.
cbSize =
sizeof(spofi);
133 res = pSetupQueryInfOriginalFileInformationA(pspii, 0,
NULL, &spofi);
134 ok(
res,
"SetupQueryInfOriginalFileInformationA failed with error %d\n",
GetLastError());
158 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
174 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
183 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
193 "Expected ERROR_FILE_NOT_FOUND or ERROR_FILENAME_EXCED_RANGE, got %d\n",
GetLastError());
203 "Expected FALSE, got %d\n",
res);
210 win_skip(
"Needs a different inf file on Vista+\n");
217 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
225 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
236 skip(
"SetupCopyOEMInfA() failed on insufficient permissions\n");
255 "Expected ERROR_FILE_EXISTS, got %d\n",
GetLastError());
262 ok(
strlen(
dest) != 0,
"Expected a non-zero length string\n");
279 "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n",
GetLastError());
282 ok(!
strcmp(
dest,
"aaa"),
"Expected dest to be unchanged\n");
283 ok(
size ==
strlen(dest_save) + 1,
"Expected size to be lstrlen(dest_save) + 1\n");
294 ok(
size ==
lstrlenA(dest_save) + 1,
"Expected size to be lstrlen(dest_save) + 1\n");
305 ok((inf && inf[0] != 0) ||
307 "Expected inf to point to the filename\n");
310 ok(
size ==
lstrlenA(dest_save) + 1,
"Expected size to be lstrlen(dest_save) + 1\n");
319 if (pSetupUninstallOEMInfA)
326 *(
strrchr(pnf,
'.') + 1) =
'p';
327 pnffile =
strrchr(pnf,
'\\') + 1;
330 res = pSetupUninstallOEMInfA(destfile, 0,
NULL);
332 res = pSetupUninstallOEMInfA(pnffile, 0,
NULL);
333 ok(
res,
"Failed to uninstall '%s'/'%s' : %d\n", destfile,
342 ok(!
file_exists(pnf),
"Expected pnf '%s' to not exist\n", pnf);
393 'u',
'n',
'c',
'o',
'm',
'p',
'r',
'e',
's',
's',
'e',
'd',
'\r',
'\n'
396 'l',
'a',
'u',
'r',
'e',
'n',
'c',
'e',
'\r',
'\n'
399 0x53, 0x5a, 0x44, 0x44, 0x88, 0xf0, 0x27, 0x33, 0x41, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xff, 0x00,
400 0x00, 0x75, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x3f, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64
403 0x50, 0x4b, 0x03, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xae, 0x81, 0x36, 0x75, 0x11,
404 0x2c, 0x1b, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x15, 0x00, 0x77, 0x69,
405 0x6e, 0x65, 0x55, 0x54, 0x09, 0x00, 0x03, 0xd6, 0x0d, 0x10, 0x46, 0xfd, 0x0d, 0x10, 0x46, 0x55,
406 0x78, 0x04, 0x00, 0xe8, 0x03, 0xe8, 0x03, 0x00, 0x00, 0x75, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x72,
407 0x65, 0x73, 0x73, 0x65, 0x64, 0x50, 0x4b, 0x01, 0x02, 0x17, 0x03, 0x0a, 0x00, 0x00, 0x00, 0x00,
408 0x00, 0xbd, 0xae, 0x81, 0x36, 0x75, 0x11, 0x2c, 0x1b, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
409 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x81, 0x00,
410 0x00, 0x00, 0x00, 0x77, 0x69, 0x6e, 0x65, 0x55, 0x54, 0x05, 0x00, 0x03, 0xd6, 0x0d, 0x10, 0x46,
411 0x55, 0x78, 0x00, 0x00, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
412 0x3f, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00
415 0x4d, 0x53, 0x43, 0x46, 0x00, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
416 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
417 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x0f, 0x0e, 0x00, 0x00, 0x00,
418 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x36, 0x86, 0x72, 0x20, 0x00, 0x77, 0x69, 0x6e, 0x65,
419 0x00, 0x19, 0xd0, 0x1a, 0xe3, 0x22, 0x00, 0x0e, 0x00, 0x5b, 0x80, 0x80, 0x8d, 0x00, 0x30, 0xe0,
420 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x6e, 0x63,
421 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x0d, 0x0a
424 0x4d, 0x53, 0x43, 0x46, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
425 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
426 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00,
427 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x36, 0x2f, 0xa5, 0x20, 0x00, 0x77, 0x69, 0x6e, 0x65,
428 0x00, 0x7c, 0x80, 0x26, 0x2b, 0x12, 0x00, 0x0e, 0x00, 0x43, 0x4b, 0x2b, 0xcd, 0x4b, 0xce, 0xcf,
429 0x2d, 0x28, 0x4a, 0x2d, 0x2e, 0x4e, 0x4d, 0xe1, 0xe5, 0x02, 0x00
432 0x4d, 0x53, 0x43, 0x46, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
433 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00,
434 0x00, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x00, 0x00,
435 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd1, 0x38, 0xf0, 0x48, 0x20, 0x00, 0x74, 0x72, 0x69, 0x73,
436 0x74, 0x72, 0x61, 0x6d, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd1,
437 0x38, 0xf0, 0x48, 0x20, 0x00, 0x77, 0x69, 0x6e, 0x65, 0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00,
438 0x00, 0x00, 0x00, 0x00, 0xd1, 0x38, 0xf0, 0x48, 0x20, 0x00, 0x73, 0x68, 0x61, 0x6e, 0x64, 0x79,
439 0x00, 0x67, 0x2c, 0x03, 0x85, 0x23, 0x00, 0x20, 0x00, 0x43, 0x4b, 0xcb, 0x49, 0x2c, 0x2d, 0x4a,
440 0xcd, 0x4b, 0x4e, 0xe5, 0xe5, 0x2a, 0xcd, 0x4b, 0xce, 0xcf, 0x2d, 0x28, 0x4a, 0x2d, 0x2e, 0x4e,
441 0x4d, 0xe1, 0xe5, 0x2a, 0x2e, 0x49, 0x2d, 0xca, 0x03, 0x8a, 0x02, 0x00
446 DWORD ret, source_size, target_size;
471 source_size = target_size = 0;
475 ok(!
ret,
"SetupGetFileCompressionInfo failed unexpectedly\n");
488 DWORD required_len, source_size, target_size;
496 ok(!
ret,
"SetupGetFileCompressionInfoEx succeeded unexpectedly\n");
499 ok(!
ret,
"SetupGetFileCompressionInfoEx succeeded unexpectedly\n");
502 ok(!
ret,
"SetupGetFileCompressionInfoEx succeeded unexpectedly\n");
507 ret = pSetupGetFileCompressionInfoExA(
source,
name,
sizeof(
name), &required_len, &source_size, &target_size, &
type);
508 ok(
ret,
"SetupGetFileCompressionInfoEx failed unexpectedly: %d\n",
ret);
511 ok(source_size ==
sizeof(
comp_lzx),
"got %d\n", source_size);
518 ret = pSetupGetFileCompressionInfoExA(
source,
name,
sizeof(
name), &required_len, &source_size, &target_size, &
type);
519 ok(
ret,
"SetupGetFileCompressionInfoEx failed unexpectedly: %d\n",
ret);
522 ok(source_size ==
sizeof(
comp_zip),
"got %d\n", source_size);
523 ok(target_size ==
sizeof(
comp_zip),
"got %d\n", target_size);
529 ret = pSetupGetFileCompressionInfoExA(
source,
name,
sizeof(
name), &required_len, &source_size, &target_size, &
type);
530 ok(
ret,
"SetupGetFileCompressionInfoEx failed unexpectedly: %d\n",
ret);
540 ret = pSetupGetFileCompressionInfoExA(
source,
name,
sizeof(
name), &required_len, &source_size, &target_size, &
type);
541 ok(
ret,
"SetupGetFileCompressionInfoEx failed unexpectedly: %d\n",
ret);
562 } invalid_parameters[] =
575 const BYTE *expected_buffer;
577 } zip_multi_tests[] =
602 invalid_parameters[
i].
type);
604 "[%d] Expected SetupDecompressOrCopyFileA to return ERROR_INVALID_PARAMETER, got %u\n",
611 invalid_parameters[
i].
type);
613 "[%d] Expected SetupDecompressOrCopyFileA to return ERROR_INVALID_PARAMETER, got %u\n",
626 ok(!
ret,
"SetupDecompressOrCopyFile failed unexpectedly: %d\n",
ret);
631 ok(!
ret,
"SetupDecompressOrCopyFile failed unexpectedly: %d\n",
ret);
636 ok(!
ret,
"SetupDecompressOrCopyFile failed unexpectedly: %d\n",
ret);
642 ok(!
ret,
"SetupDecompressOrCopyFile failed unexpectedly: %d\n",
ret);
651 ok(!
ret,
"SetupDecompressOrCopyFile failed unexpectedly: %d\n",
ret);
659 ok(!
ret,
"SetupDecompressOrCopyFile failed unexpectedly: %d\n",
ret);
671 ok(!
ret,
"SetupDecompressOrCopyFile failed unexpectedly: %d\n",
ret);
676 ok(!
ret,
"SetupDecompressOrCopyFile failed unexpectedly: %d\n",
ret);
681 ok(!
ret,
"SetupDecompressOrCopyFile failed unexpectedly: %d\n",
ret);
687 ok(!
ret,
"SetupDecompressOrCopyFile failed unexpectedly: %d\n",
ret);
705 ok(!
ret,
"[%d] SetupDecompressOrCopyFile failed unexpectedly: %d\n",
i,
ret);
707 "[%d] incorrect target file\n",
i);
720 ok(!
ret,
"Expected failure\n");
724 ret = pSetupUninstallOEMInfA(
"", 0,
NULL);
727 ok(!
ret,
"Expected failure\n");
732 ret = pSetupUninstallOEMInfA(
"nonexistent.inf", 0,
NULL);
735 ok(!
ret,
"Expected failure\n");
760 ok(ctxt !=
NULL,
"got %p\n", ctxt);
772 win_skip(
"Skipping tests on old systems.\n");
793 ok(!
ret,
"SetupLogError succeeded\n");
800 skip(
"SetupOpenLog() failed on insufficient permissions\n");
808 ok(!
ret,
"SetupLogError succeeded\n");
809 ok(
error == 0xdeadbeef,
"got wrong error: %d\n",
error);
811 ok(
ret,
"SetupLogError failed\n");
830 ok(
ret == 0x0400,
"got version %#x\n",
ret);
837 pSetupGetFileCompressionInfoExA = (
void*)
GetProcAddress(hsetupapi,
"SetupGetFileCompressionInfoExA");
838 pSetupCopyOEMInfA = (
void*)
GetProcAddress(hsetupapi,
"SetupCopyOEMInfA");
839 pSetupQueryInfOriginalFileInformationA = (
void*)
GetProcAddress(hsetupapi,
"SetupQueryInfOriginalFileInformationA");
840 pSetupUninstallOEMInfA = (
void*)
GetProcAddress(hsetupapi,
"SetupUninstallOEMInfA");
844 if (pSetupCopyOEMInfA)
847 win_skip(
"SetupCopyOEMInfA is not available\n");
851 if (pSetupGetFileCompressionInfoExA)
854 win_skip(
"SetupGetFileCompressionInfoExA is not available\n");
858 if (pSetupUninstallOEMInfA)
861 win_skip(
"SetupUninstallOEMInfA is not available\n");
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
WORD WINAPI CM_Get_Version(VOID)
#define ERROR_INSUFFICIENT_BUFFER
#define ERROR_INVALID_PARAMETER
#define ReadFile(a, b, c, d, e)
#define GetProcAddress(x, y)
#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)
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)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
INT WINAPI CompareStringA(LCID lcid, DWORD flags, LPCSTR str1, INT len1, LPCSTR str2, INT len2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
BOOL WINAPI SetupOpenLog(BOOL reserved)
DWORD WINAPI SetupDecompressOrCopyFileA(PCSTR source, PCSTR target, PUINT type)
VOID WINAPI MyFree(LPVOID lpMem)
DWORD WINAPI SetupGetFileCompressionInfoA(PCSTR source, PSTR *name, PDWORD source_size, PDWORD target_size, PUINT type)
void WINAPI SetupCloseLog(void)
BOOL WINAPI SetupLogErrorA(LPCSTR message, LogSeverity severity)
HINF WINAPI SetupOpenInfFileA(PCSTR name, PCSTR class, DWORD style, UINT *error)
BOOL WINAPI SetupGetInfInformationA(LPCVOID InfSpec, DWORD SearchControl, PSP_INF_INFORMATION ReturnBuffer, DWORD ReturnBufferSize, PDWORD RequiredSize)
PVOID WINAPI SetupInitDefaultQueueCallbackEx(HWND owner, HWND progress, UINT msg, DWORD reserved1, PVOID reserved2)
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
#define check(expected, result)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP FILE *__cdecl tmpfile(void)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define ERROR_FILE_NOT_FOUND
static void create_inf_file(void)
static void test_CM_Get_Version(void)
static const BYTE uncompressed[]
static CHAR CURR_DIR[MAX_PATH]
static const BYTE comp_cab_zip_multi[]
static void test_original_file_name(LPCSTR original, LPCSTR dest)
static void test_SetupCopyOEMInf(void)
static void test_SetupUninstallOEMInf(void)
static const BYTE comp_cab_lzx[]
static PSTR *static PSP_ALTPLATFORM_INFO
static PSTR *static PSP_ORIGINAL_FILE_INFO_A
static const BYTE comp_zip[]
static void test_SetupGetFileCompressionInfoEx(void)
static BOOL compare_file_data(LPSTR file, const BYTE *data, DWORD size)
static BOOL check_format(LPSTR path, LPSTR inf)
static BOOL file_exists(LPSTR path)
static const BYTE comp_lzx[]
static const BYTE laurence[]
static void get_temp_filename(LPSTR path)
static void test_SetupDecompressOrCopyFile(void)
static void test_defaultcallback(void)
static void test_SetupLogError(void)
static void test_SetupGetFileCompressionInfo(void)
static void create_source_file(LPSTR filename, const BYTE *data, DWORD size)
static const BYTE comp_cab_zip[]
#define LOCALE_SYSTEM_DEFAULT
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define SP_COPY_NOOVERWRITE
#define SP_COPY_DELETESOURCE
#define FILE_COMPRESSION_WINLZA
#define SP_COPY_REPLACEONLY
struct _SP_INF_INFORMATION * PSP_INF_INFORMATION
#define FILE_COMPRESSION_MSZIP
#define FILE_COMPRESSION_NONE
#define LogSevInformation
#define INFINFO_INF_SPEC_IS_HINF
#define ERROR_WRONG_INF_TYPE
wchar_t const *const size_t const buffer_size
CHAR OriginalCatalogName[MAX_PATH]
CHAR OriginalInfName[MAX_PATH]
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
#define INVALID_FILE_ATTRIBUTES
DWORD WINAPI GetLastError(void)
#define ERROR_INVALID_USER_BUFFER
#define ERROR_UNSUPPORTED_TYPE
#define ERROR_BAD_PATHNAME
#define ERROR_FILE_EXISTS
#define ERROR_FILE_INVALID
#define ERROR_FILENAME_EXCED_RANGE