setupapi/tests: Enable compilation with -D__WINESRC__.
This commit is contained in:
parent
60f62f4d48
commit
9d03aa328f
|
@ -1,6 +1,5 @@
|
|||
TESTDLL = setupapi.dll
|
||||
IMPORTS = setupapi user32 advapi32
|
||||
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
|
||||
|
||||
C_SRCS = \
|
||||
devinst.c \
|
||||
|
|
|
@ -241,7 +241,7 @@ static void clean_devclass_key(void)
|
|||
* the keys under the DeviceClasses key after a SetupDiDestroyDeviceInfoList.
|
||||
*/
|
||||
RegOpenKeyW(HKEY_LOCAL_MACHINE, devclass, &key);
|
||||
RegQueryInfoKey(key, NULL, NULL, NULL, &subkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
RegQueryInfoKeyW(key, NULL, NULL, NULL, &subkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
if (subkeys > 0)
|
||||
{
|
||||
trace("We are most likely on Windows 2000\n");
|
||||
|
@ -342,8 +342,8 @@ static void test_SetupDiOpenClassRegKeyExA(void)
|
|||
static void create_inf_file(LPCSTR filename)
|
||||
{
|
||||
DWORD dwNumberOfBytesWritten;
|
||||
HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
HANDLE hf = CreateFileA(filename, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
static const char data[] =
|
||||
"[Version]\n"
|
||||
|
@ -410,7 +410,7 @@ static void testInstallClass(void)
|
|||
ok(!RegDeleteKeyW(HKEY_LOCAL_MACHINE, classKey),
|
||||
"Couldn't delete classkey\n");
|
||||
|
||||
DeleteFile(tmpfile);
|
||||
DeleteFileA(tmpfile);
|
||||
}
|
||||
|
||||
static void testCreateDeviceInfo(void)
|
||||
|
@ -533,7 +533,7 @@ static void testCreateDeviceInfo(void)
|
|||
DWORD subkeys;
|
||||
|
||||
/* Check if we have subkeys */
|
||||
RegQueryInfoKey(key, NULL, NULL, NULL, &subkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
RegQueryInfoKeyA(key, NULL, NULL, NULL, &subkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
if (subkeys > 0)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -63,7 +63,7 @@ static BOOL (WINAPI *pSetupGetInfFileListW)(PCWSTR, DWORD, PWSTR, DWORD, PDWORD)
|
|||
static void create_inf_file(LPCSTR filename, const char *data)
|
||||
{
|
||||
DWORD res;
|
||||
HANDLE handle = CreateFile(filename, GENERIC_WRITE, 0, NULL,
|
||||
HANDLE handle = CreateFileA(filename, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
assert(handle != INVALID_HANDLE_VALUE);
|
||||
assert(WriteFile(handle, data, strlen(data), &res, NULL));
|
||||
|
@ -107,7 +107,7 @@ static void ok_registry(BOOL expectsuccess)
|
|||
LONG ret;
|
||||
|
||||
/* Functional tests for success of install and clean up */
|
||||
ret = RegDeleteKey(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest");
|
||||
ret = RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest");
|
||||
ok((expectsuccess && ret == ERROR_SUCCESS) ||
|
||||
(!expectsuccess && ret == ERROR_FILE_NOT_FOUND),
|
||||
"Expected registry key Software\\Wine\\setupapitest to %s, RegDeleteKey returned %d\n",
|
||||
|
@ -126,7 +126,7 @@ static void test_cmdline(void)
|
|||
sprintf(path, "%s\\%s", CURR_DIR, inffile);
|
||||
run_cmdline("DefaultInstall", 128, path);
|
||||
ok_registry(TRUE);
|
||||
ret = DeleteFile(inffile);
|
||||
ret = DeleteFileA(inffile);
|
||||
ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError());
|
||||
|
||||
/* Test handling of spaces in path, unquoted and quoted */
|
||||
|
@ -140,7 +140,7 @@ static void test_cmdline(void)
|
|||
run_cmdline("DefaultInstall", 128, path);
|
||||
ok_registry(FALSE);
|
||||
|
||||
ret = DeleteFile(infwithspaces);
|
||||
ret = DeleteFileA(infwithspaces);
|
||||
ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError());
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ static void test_registry(void)
|
|||
RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest\\setupapitest");
|
||||
RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest");
|
||||
}
|
||||
ret = DeleteFile(inffile);
|
||||
ret = DeleteFileA(inffile);
|
||||
ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError());
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ static void test_install_svc_from(void)
|
|||
ok(GetLastError() == ERROR_SECTION_NOT_FOUND,
|
||||
"Expected ERROR_SECTION_NOT_FOUND, got %08x\n", GetLastError());
|
||||
SetupCloseInfFile(infhandle);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
|
||||
/* Add the section */
|
||||
strcat(inf, "[Winetest.Services]\n");
|
||||
|
@ -228,7 +228,7 @@ static void test_install_svc_from(void)
|
|||
ok(GetLastError() == ERROR_SECTION_NOT_FOUND,
|
||||
"Expected ERROR_SECTION_NOT_FOUND, got %08x\n", GetLastError());
|
||||
SetupCloseInfFile(infhandle);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
|
||||
/* Add a reference */
|
||||
strcat(inf, "AddService=Winetest,,Winetest.Service\n");
|
||||
|
@ -240,7 +240,7 @@ static void test_install_svc_from(void)
|
|||
ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
|
||||
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
|
||||
SetupCloseInfFile(infhandle);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
|
||||
/* Add the section */
|
||||
strcat(inf, "[Winetest.Service]\n");
|
||||
|
@ -252,7 +252,7 @@ static void test_install_svc_from(void)
|
|||
ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
|
||||
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
|
||||
SetupCloseInfFile(infhandle);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
|
||||
/* Just the ServiceBinary */
|
||||
strcat(inf, "ServiceBinary=%12%\\winetest.sys\n");
|
||||
|
@ -264,7 +264,7 @@ static void test_install_svc_from(void)
|
|||
ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
|
||||
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
|
||||
SetupCloseInfFile(infhandle);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
|
||||
/* Add the ServiceType */
|
||||
strcat(inf, "ServiceType=1\n");
|
||||
|
@ -276,7 +276,7 @@ static void test_install_svc_from(void)
|
|||
ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
|
||||
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
|
||||
SetupCloseInfFile(infhandle);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
|
||||
/* Add the StartType */
|
||||
strcat(inf, "StartType=4\n");
|
||||
|
@ -288,7 +288,7 @@ static void test_install_svc_from(void)
|
|||
ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
|
||||
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
|
||||
SetupCloseInfFile(infhandle);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
|
||||
/* This should be it, the minimal entries to install a service */
|
||||
strcat(inf, "ErrorControl=1");
|
||||
|
@ -300,14 +300,14 @@ static void test_install_svc_from(void)
|
|||
{
|
||||
skip("Not enough rights to install the service\n");
|
||||
SetupCloseInfFile(infhandle);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
return;
|
||||
}
|
||||
ok(ret, "Expected success\n");
|
||||
ok(GetLastError() == ERROR_SUCCESS,
|
||||
"Expected ERROR_SUCCESS, got %08x\n", GetLastError());
|
||||
SetupCloseInfFile(infhandle);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
|
||||
scm_handle = OpenSCManagerA(NULL, NULL, GENERIC_ALL);
|
||||
|
||||
|
@ -334,7 +334,7 @@ static void test_install_svc_from(void)
|
|||
ok(ret, "Expected success\n");
|
||||
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08x\n", GetLastError());
|
||||
SetupCloseInfFile(infhandle);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
|
||||
/* TODO: Test the Flags */
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ static void test_driver_install(void)
|
|||
run_cmdline("DefaultInstall", 128, path);
|
||||
|
||||
/* Driver should have been installed */
|
||||
attrs = GetFileAttributes(driver);
|
||||
attrs = GetFileAttributesA(driver);
|
||||
ok(attrs != INVALID_FILE_ATTRIBUTES, "Expected driver to exist\n");
|
||||
|
||||
scm_handle = OpenSCManagerA(NULL, NULL, GENERIC_ALL);
|
||||
|
@ -412,9 +412,9 @@ static void test_driver_install(void)
|
|||
CloseServiceHandle(scm_handle);
|
||||
|
||||
/* File cleanup */
|
||||
DeleteFile(inffile);
|
||||
DeleteFile("winetest.sys");
|
||||
DeleteFile(driver);
|
||||
DeleteFileA(inffile);
|
||||
DeleteFileA("winetest.sys");
|
||||
DeleteFileA(driver);
|
||||
}
|
||||
|
||||
static void test_profile_items(void)
|
||||
|
@ -458,34 +458,34 @@ static void test_profile_items(void)
|
|||
run_cmdline("DefaultInstall", 128, path);
|
||||
|
||||
snprintf(path, MAX_PATH, "%s\\TestItem.lnk", commonprogs);
|
||||
if (INVALID_FILE_ATTRIBUTES == GetFileAttributes(path))
|
||||
if (INVALID_FILE_ATTRIBUTES == GetFileAttributesA(path))
|
||||
{
|
||||
win_skip("ProfileItems not implemented on this system\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(path, MAX_PATH, "%s\\TestDir", commonprogs);
|
||||
ok(INVALID_FILE_ATTRIBUTES != GetFileAttributes(path), "directory not created\n");
|
||||
ok(INVALID_FILE_ATTRIBUTES != GetFileAttributesA(path), "directory not created\n");
|
||||
snprintf(path, MAX_PATH, "%s\\TestDir\\TestItem2.lnk", commonprogs);
|
||||
ok(INVALID_FILE_ATTRIBUTES != GetFileAttributes(path), "link not created\n");
|
||||
ok(INVALID_FILE_ATTRIBUTES != GetFileAttributesA(path), "link not created\n");
|
||||
snprintf(path, MAX_PATH, "%s\\TestGroup", commonprogs);
|
||||
ok(INVALID_FILE_ATTRIBUTES != GetFileAttributes(path), "group not created\n");
|
||||
ok(INVALID_FILE_ATTRIBUTES != GetFileAttributesA(path), "group not created\n");
|
||||
}
|
||||
|
||||
snprintf(path, MAX_PATH, "%s\\TestItem.lnk", commonprogs);
|
||||
DeleteFile(path);
|
||||
DeleteFileA(path);
|
||||
snprintf(path, MAX_PATH, "%s\\TestDir\\TestItem2.lnk", commonprogs);
|
||||
DeleteFile(path);
|
||||
DeleteFileA(path);
|
||||
snprintf(path, MAX_PATH, "%s\\TestItem2.lnk", commonprogs);
|
||||
DeleteFile(path);
|
||||
DeleteFileA(path);
|
||||
snprintf(path, MAX_PATH, "%s\\TestDir", commonprogs);
|
||||
RemoveDirectory(path);
|
||||
RemoveDirectoryA(path);
|
||||
snprintf(path, MAX_PATH, "%s\\TestGroup", commonprogs);
|
||||
RemoveDirectory(path);
|
||||
RemoveDirectoryA(path);
|
||||
|
||||
cleanup:
|
||||
if (hShell32) FreeLibrary(hShell32);
|
||||
DeleteFile(inffile);
|
||||
DeleteFileA(inffile);
|
||||
}
|
||||
|
||||
static void test_inffilelistA(void)
|
||||
|
@ -541,8 +541,8 @@ static void test_inffilelistA(void)
|
|||
ok(!lstrcmpA(p,inffile2) || !lstrcmpA(p,inffile),
|
||||
"unexpected filename %s\n",p);
|
||||
|
||||
DeleteFile(inffile);
|
||||
DeleteFile(inffile2);
|
||||
DeleteFileA(inffile);
|
||||
DeleteFileA(inffile2);
|
||||
SetCurrentDirectoryA(CURR_DIR);
|
||||
RemoveDirectoryA(dir);
|
||||
}
|
||||
|
@ -711,22 +711,22 @@ static void test_inffilelist(void)
|
|||
ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW) || !lstrcmpW(p,invalid_infW),
|
||||
"unexpected filename %s\n",wine_dbgstr_w(p));
|
||||
|
||||
DeleteFile(inffile);
|
||||
DeleteFile(inffile2);
|
||||
DeleteFile(invalid_inf);
|
||||
DeleteFileA(inffile);
|
||||
DeleteFileA(inffile2);
|
||||
DeleteFileA(invalid_inf);
|
||||
SetCurrentDirectoryA(CURR_DIR);
|
||||
RemoveDirectoryA(dirA);
|
||||
}
|
||||
|
||||
START_TEST(install)
|
||||
{
|
||||
HMODULE hsetupapi = GetModuleHandle("setupapi.dll");
|
||||
HMODULE hsetupapi = GetModuleHandleA("setupapi.dll");
|
||||
char temp_path[MAX_PATH], prev_path[MAX_PATH];
|
||||
DWORD len;
|
||||
|
||||
GetCurrentDirectory(MAX_PATH, prev_path);
|
||||
GetTempPath(MAX_PATH, temp_path);
|
||||
SetCurrentDirectory(temp_path);
|
||||
GetCurrentDirectoryA(MAX_PATH, prev_path);
|
||||
GetTempPathA(MAX_PATH, temp_path);
|
||||
SetCurrentDirectoryA(temp_path);
|
||||
|
||||
strcpy(CURR_DIR, temp_path);
|
||||
len = strlen(CURR_DIR);
|
||||
|
@ -753,7 +753,7 @@ START_TEST(install)
|
|||
skip("InstallHinfSectionA is broken (stub)\n");
|
||||
pInstallHinfSectionA = NULL;
|
||||
}
|
||||
ret = DeleteFile(inffile);
|
||||
ret = DeleteFileA(inffile);
|
||||
ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError());
|
||||
}
|
||||
if (!pInstallHinfSectionW && !pInstallHinfSectionA)
|
||||
|
@ -779,5 +779,5 @@ START_TEST(install)
|
|||
test_inffilelist();
|
||||
test_inffilelistA();
|
||||
|
||||
SetCurrentDirectory(prev_path);
|
||||
SetCurrentDirectoryA(prev_path);
|
||||
}
|
||||
|
|
|
@ -51,8 +51,8 @@ static BOOL (WINAPI *pSetupUninstallOEMInfA)(PCSTR, DWORD, PVOID);
|
|||
static void create_inf_file(LPCSTR filename)
|
||||
{
|
||||
DWORD dwNumberOfBytesWritten;
|
||||
HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
HANDLE hf = CreateFileA(filename, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
static const char data[] =
|
||||
"[Version]\n"
|
||||
|
@ -72,15 +72,15 @@ static void get_temp_filename(LPSTR path)
|
|||
CHAR temp[MAX_PATH];
|
||||
LPSTR ptr;
|
||||
|
||||
GetTempFileName(CURR_DIR, "set", 0, temp);
|
||||
GetTempFileNameA(CURR_DIR, "set", 0, temp);
|
||||
ptr = strrchr(temp, '\\');
|
||||
|
||||
lstrcpy(path, ptr + 1);
|
||||
strcpy(path, ptr + 1);
|
||||
}
|
||||
|
||||
static BOOL file_exists(LPSTR path)
|
||||
{
|
||||
return GetFileAttributes(path) != INVALID_FILE_ATTRIBUTES;
|
||||
return GetFileAttributesA(path) != INVALID_FILE_ATTRIBUTES;
|
||||
}
|
||||
|
||||
static BOOL check_format(LPSTR path, LPSTR inf)
|
||||
|
@ -90,19 +90,19 @@ static BOOL check_format(LPSTR path, LPSTR inf)
|
|||
|
||||
static const CHAR format[] = "\\INF\\oem";
|
||||
|
||||
GetWindowsDirectory(check, MAX_PATH);
|
||||
lstrcat(check, format);
|
||||
res = CompareString(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, check, -1, path, lstrlen(check)) == CSTR_EQUAL &&
|
||||
path[lstrlen(check)] != '\\';
|
||||
GetWindowsDirectoryA(check, MAX_PATH);
|
||||
strcat(check, format);
|
||||
res = CompareStringA(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, check, -1, path, strlen(check)) == CSTR_EQUAL &&
|
||||
path[strlen(check)] != '\\';
|
||||
|
||||
return (!inf) ? res : res && (inf == path + lstrlen(check) - 3);
|
||||
return (!inf) ? res : res && (inf == path + strlen(check) - 3);
|
||||
}
|
||||
|
||||
static void test_original_file_name(LPCSTR original, LPCSTR dest)
|
||||
{
|
||||
HINF hinf;
|
||||
PSP_INF_INFORMATION pspii;
|
||||
SP_ORIGINAL_FILE_INFO spofi;
|
||||
SP_ORIGINAL_FILE_INFO_A spofi;
|
||||
BOOL res;
|
||||
DWORD size;
|
||||
|
||||
|
@ -115,12 +115,12 @@ static void test_original_file_name(LPCSTR original, LPCSTR dest)
|
|||
hinf = SetupOpenInfFileA(dest, NULL, INF_STYLE_WIN4, NULL);
|
||||
ok(hinf != NULL, "SetupOpenInfFileA failed with error %d\n", GetLastError());
|
||||
|
||||
res = SetupGetInfInformation(hinf, INFINFO_INF_SPEC_IS_HINF, NULL, 0, &size);
|
||||
res = SetupGetInfInformationA(hinf, INFINFO_INF_SPEC_IS_HINF, NULL, 0, &size);
|
||||
ok(res, "SetupGetInfInformation failed with error %d\n", GetLastError());
|
||||
|
||||
pspii = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
|
||||
res = SetupGetInfInformation(hinf, INFINFO_INF_SPEC_IS_HINF, pspii, size, NULL);
|
||||
res = SetupGetInfInformationA(hinf, INFINFO_INF_SPEC_IS_HINF, pspii, size, NULL);
|
||||
ok(res, "SetupGetInfInformation failed with error %d\n", GetLastError());
|
||||
|
||||
spofi.cbSize = 0;
|
||||
|
@ -173,8 +173,8 @@ static void test_SetupCopyOEMInf(void)
|
|||
"Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
|
||||
|
||||
/* try an absolute nonexistent SourceInfFileName */
|
||||
lstrcpy(path, CURR_DIR);
|
||||
lstrcat(path, "\\nonexistent");
|
||||
strcpy(path, CURR_DIR);
|
||||
strcat(path, "\\nonexistent");
|
||||
SetLastError(0xdeadbeef);
|
||||
res = pSetupCopyOEMInfA(path, NULL, 0, SP_COPY_NOOVERWRITE, NULL, 0, NULL, NULL);
|
||||
ok(res == FALSE, "Expected FALSE, got %d\n", res);
|
||||
|
@ -207,7 +207,7 @@ static void test_SetupCopyOEMInf(void)
|
|||
* popups during the installation though as it also needs a catalog file (signed?).
|
||||
*/
|
||||
win_skip("Needs a different inf file on Vista+\n");
|
||||
DeleteFile(tmpfile);
|
||||
DeleteFileA(tmpfile);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -225,9 +225,9 @@ static void test_SetupCopyOEMInf(void)
|
|||
ok(file_exists(tmpfile), "Expected source inf to exist\n");
|
||||
|
||||
/* try an absolute SourceInfFileName, without DestinationInfFileName */
|
||||
lstrcpy(path, CURR_DIR);
|
||||
lstrcat(path, "\\");
|
||||
lstrcat(path, tmpfile);
|
||||
strcpy(path, CURR_DIR);
|
||||
strcat(path, "\\");
|
||||
strcat(path, tmpfile);
|
||||
SetLastError(0xdeadbeef);
|
||||
res = pSetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, NULL, 0, NULL, NULL);
|
||||
ok(res == TRUE, "Expected TRUE, got %d\n", res);
|
||||
|
@ -253,18 +253,18 @@ static void test_SetupCopyOEMInf(void)
|
|||
res = pSetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, MAX_PATH, NULL, NULL);
|
||||
ok(res == TRUE, "Expected TRUE, got %d\n", res);
|
||||
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
|
||||
ok(lstrlen(dest) != 0, "Expected a non-zero length string\n");
|
||||
ok(strlen(dest) != 0, "Expected a non-zero length string\n");
|
||||
ok(file_exists(dest), "Expected destination inf to exist\n");
|
||||
ok(check_format(dest, NULL), "Expected %%windir%%\\inf\\OEMx.inf, got %s\n", dest);
|
||||
ok(file_exists(path), "Expected source inf to exist\n");
|
||||
|
||||
lstrcpy(dest_save, dest);
|
||||
DeleteFile(dest_save);
|
||||
strcpy(dest_save, dest);
|
||||
DeleteFileA(dest_save);
|
||||
|
||||
/* get the DestinationInfFileName, DestinationInfFileNameSize is too small
|
||||
* - inf is still copied
|
||||
*/
|
||||
lstrcpy(dest, "aaa");
|
||||
strcpy(dest, "aaa");
|
||||
size = 0;
|
||||
SetLastError(0xdeadbeef);
|
||||
res = pSetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, 5, &size, NULL);
|
||||
|
@ -273,19 +273,19 @@ static void test_SetupCopyOEMInf(void)
|
|||
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
||||
ok(file_exists(path), "Expected source inf to exist\n");
|
||||
ok(file_exists(dest_save), "Expected dest inf to exist\n");
|
||||
ok(!lstrcmp(dest, "aaa"), "Expected dest to be unchanged\n");
|
||||
ok(size == lstrlen(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n");
|
||||
ok(!strcmp(dest, "aaa"), "Expected dest to be unchanged\n");
|
||||
ok(size == strlen(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n");
|
||||
|
||||
/* get the DestinationInfFileName and DestinationInfFileNameSize */
|
||||
SetLastError(0xdeadbeef);
|
||||
res = pSetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, MAX_PATH, &size, NULL);
|
||||
ok(res == TRUE, "Expected TRUE, got %d\n", res);
|
||||
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
|
||||
ok(lstrlen(dest) + 1 == size, "Expected sizes to match, got (%d, %d)\n", lstrlen(dest), size);
|
||||
ok(lstrlenA(dest) + 1 == size, "Expected sizes to match, got (%d, %d)\n", lstrlenA(dest), size);
|
||||
ok(file_exists(dest), "Expected destination inf to exist\n");
|
||||
ok(check_format(dest, NULL), "Expected %%windir%%\\inf\\OEMx.inf, got %s\n", dest);
|
||||
ok(file_exists(path), "Expected source inf to exist\n");
|
||||
ok(size == lstrlen(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n");
|
||||
ok(size == lstrlenA(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n");
|
||||
|
||||
test_original_file_name(strrchr(path, '\\') + 1, dest);
|
||||
|
||||
|
@ -294,14 +294,14 @@ static void test_SetupCopyOEMInf(void)
|
|||
res = pSetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, MAX_PATH, &size, &inf);
|
||||
ok(res == TRUE, "Expected TRUE, got %d\n", res);
|
||||
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
|
||||
ok(lstrlen(dest) + 1 == size, "Expected sizes to match, got (%d, %d)\n", lstrlen(dest), size);
|
||||
ok(lstrlenA(dest) + 1 == size, "Expected sizes to match, got (%d, %d)\n", lstrlenA(dest), size);
|
||||
ok(file_exists(dest), "Expected destination inf to exist\n");
|
||||
ok((inf && inf[0] != 0) ||
|
||||
broken(!inf), /* Win98 */
|
||||
"Expected inf to point to the filename\n");
|
||||
ok(check_format(dest, inf), "Expected %%windir%%\\inf\\OEMx.inf, got %s\n", dest);
|
||||
ok(file_exists(path), "Expected source inf to exist\n");
|
||||
ok(size == lstrlen(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n");
|
||||
ok(size == lstrlenA(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n");
|
||||
|
||||
/* try SP_COPY_DELETESOURCE */
|
||||
SetLastError(0xdeadbeef);
|
||||
|
@ -733,7 +733,7 @@ static void test_SetupUninstallOEMInf(void)
|
|||
|
||||
START_TEST(misc)
|
||||
{
|
||||
HMODULE hsetupapi = GetModuleHandle("setupapi.dll");
|
||||
HMODULE hsetupapi = GetModuleHandleA("setupapi.dll");
|
||||
|
||||
pSetupGetFileCompressionInfoExA = (void*)GetProcAddress(hsetupapi, "SetupGetFileCompressionInfoExA");
|
||||
pSetupCopyOEMInfA = (void*)GetProcAddress(hsetupapi, "SetupCopyOEMInfA");
|
||||
|
|
|
@ -290,8 +290,8 @@ static void test_enum_sections(void)
|
|||
ret = pSetupEnumInfSectionsA( hinf, index, buffer, sizeof(buffer), &len );
|
||||
ok( ret, "SetupEnumInfSectionsA failed err %u\n", GetLastError() );
|
||||
ok( len == 3 || len == 8, "wrong len %u\n", len );
|
||||
ok( !lstrcmpi( buffer, "version" ) || !lstrcmpi( buffer, "s1" ) ||
|
||||
!lstrcmpi( buffer, "s2" ) || !lstrcmpi( buffer, "s3" ) || !lstrcmpi( buffer, "strings" ),
|
||||
ok( !lstrcmpiA( buffer, "version" ) || !lstrcmpiA( buffer, "s1" ) ||
|
||||
!lstrcmpiA( buffer, "s2" ) || !lstrcmpiA( buffer, "s3" ) || !lstrcmpiA( buffer, "strings" ),
|
||||
"bad section '%s'\n", buffer );
|
||||
}
|
||||
SetupCloseInfFile( hinf );
|
||||
|
@ -542,7 +542,7 @@ static void test_pSetupGetField(void)
|
|||
hinf = test_file_contents( contents, &err );
|
||||
ok( hinf != NULL, "Expected valid INF file\n" );
|
||||
|
||||
ret = SetupFindFirstLine( hinf, "FileBranchInfo", NULL, &context );
|
||||
ret = SetupFindFirstLineA( hinf, "FileBranchInfo", NULL, &context );
|
||||
ok( ret, "Failed to find first line\n" );
|
||||
|
||||
/* native Windows crashes if a NULL context is sent in */
|
||||
|
|
|
@ -102,8 +102,8 @@ static const char inf_data6[] =
|
|||
static void create_inf_file(LPSTR filename, const char *data, DWORD size)
|
||||
{
|
||||
DWORD dwNumberOfBytesWritten;
|
||||
HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
HANDLE hf = CreateFileA(filename, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
WriteFile(hf, data, size, &dwNumberOfBytesWritten, NULL);
|
||||
CloseHandle(hf);
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ static void test_invalid_parametersA(void)
|
|||
const struct
|
||||
{
|
||||
PCSTR CabinetFile;
|
||||
PSP_FILE_CALLBACK MsgHandler;
|
||||
PSP_FILE_CALLBACK_A MsgHandler;
|
||||
DWORD expected_lasterror;
|
||||
int todo_lasterror;
|
||||
} invalid_parameters[] =
|
||||
|
@ -161,7 +161,7 @@ static void test_invalid_parametersW(void)
|
|||
const struct
|
||||
{
|
||||
PCWSTR CabinetFile;
|
||||
PSP_FILE_CALLBACK MsgHandler;
|
||||
PSP_FILE_CALLBACK_W MsgHandler;
|
||||
DWORD expected_lasterror;
|
||||
int todo_lasterror;
|
||||
} invalid_parameters[] =
|
||||
|
|
Loading…
Reference in New Issue