80 "Signature=\"$Chicago$\"\n" 82 "AddReg=Add.Settings\n" 84 "HKCU,Software\\Wine\\setupapitest,,\n";
104 "Expected registry key Software\\Wine\\setupapitest to %s, RegDeleteKey returned %d\n",
105 expectsuccess ?
"exist" :
"not exist",
112 static const char infwithspaces[] =
"test file.inf";
139 "Signature=\"$Chicago$\"\n" 141 "DelReg=Del.Settings\n" 143 "HKCU,Software\\Wine\\setupapitest\n";
154 "Expected RegCreateKeyA to succeed\n");
158 "Expected registry key to exist\n");
187 "Expected RegCreateKeyA to succeed\n");
191 "Expected registry key to exist\n");
199 ok(
ret,
"Unexpected failure\n");
225 strcpy(inf,
"[Version]\nSignature=\"$Chicago$\"\n");
233 ok(!
ret,
"Expected failure\n");
235 "Expected ERROR_SECTION_NOT_FOUND, got %08x\n",
GetLastError());
240 strcat(inf,
"[Winetest.Services]\n");
245 ok(!
ret,
"Expected failure\n");
247 "Expected ERROR_SECTION_NOT_FOUND, got %08x\n",
GetLastError());
252 strcat(inf,
"AddService=Winetest,,Winetest.Service\n");
257 ok(!
ret,
"Expected failure\n");
259 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n",
GetLastError());
264 strcat(inf,
"[Winetest.Service]\n");
269 ok(!
ret,
"Expected failure\n");
271 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n",
GetLastError());
276 strcat(inf,
"ServiceBinary=%12%\\winetest.sys\n");
281 ok(!
ret,
"Expected failure\n");
283 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n",
GetLastError());
288 strcat(inf,
"ServiceType=1\n");
293 ok(!
ret,
"Expected failure\n");
295 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n",
GetLastError());
300 strcat(inf,
"StartType=4\n");
305 ok(!
ret,
"Expected failure\n");
307 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n",
GetLastError());
312 strcat(inf,
"ErrorControl=1");
319 skip(
"Not enough rights to install the service\n");
324 ok(
ret,
"Expected success\n");
334 ok(svc_handle !=
NULL,
"Service was not created\n");
343 strcpy(inf,
"[Version]\nSignature=\"$Chicago$\"\n");
344 strcat(inf,
"[XSP.InstallPerVer]\n");
345 strcat(inf,
"AddReg=AspEventlogMsg.Reg,Perf.Reg,AspVersions.Reg,FreeADO.Reg,IndexServer.Reg\n");
352 ok(
ret,
"Expected success\n");
368 static const char *inf =
370 "Signature=\"$Chicago$\"\n" 371 "[DestinationDirs]\n" 372 "Winetest.DriverFiles=12\n" 374 "CopyFiles=Winetest.DriverFiles\n" 375 "[DefaultInstall.Services]\n" 376 "AddService=Winetest,,Winetest.Service\n" 377 "[Winetest.Service]\n" 378 "ServiceBinary=%12%\\winetest.sys\n" 382 "[Winetest.DriverFiles]\n" 390 skip(
"Not enough rights to install the service\n");
417 ok(svc_handle !=
NULL,
"Service was not created\n");
436 static const char *inf =
438 "Signature=\"$Chicago$\"\n" 440 "ProfileItems=TestItem,TestItem2,TestGroup\n" 443 "CmdLine=11,,notepad.exe\n" 446 "CmdLine=11,,notepad.exe\n" 454 skip(
"No common program files directory exists\n");
461 skip(
"need admin rights\n");
495 static const char inffile2[] =
"test2.inf";
496 static const char *inf =
498 "Signature=\"$Chicago$\"";
533 ok(
ret,
"expected SetupGetInfFileListA to succeed!\n");
538 "unexpected filename %s\n",
p);
548 static const char inffile2[] =
"test2.inf";
549 static const WCHAR inffile2W[] = {
't',
'e',
's',
't',
'2',
'.',
'i',
'n',
'f',0};
550 static const char invalid_inf[] =
"invalid.inf";
551 static const WCHAR invalid_infW[] = {
'i',
'n',
'v',
'a',
'l',
'i',
'd',
'.',
'i',
'n',
'f',0};
552 static const char *inf =
554 "Signature=\"$Chicago$\"";
555 static const char *inf2 =
557 "Signature=\"$CHICAGO$\"";
558 static const char *infNT =
560 "Signature=\"$WINDOWS NT$\"";
575 ok(
ret,
"expected SetupGetInfFileListW to succeed! Error: %d\n",
GetLastError());
576 ok(
expected > 0,
"expected required buffersize to be at least 1\n");
582 ok(!
ret,
"expected SetupGetInfFileListW to fail!\n");
612 ok(
ret,
"expected SetupGetInfFileListW to succeed!\n");
613 ok(
outsize == 1,
"expected required buffersize to be 1, got %d\n",
outsize);
615 "expected error ERROR_PATH_NOT_FOUND, got %d\n",
GetLastError());
619 create_inf_file(invalid_inf,
"This content does not match the inf file format");
628 ok(!
ret,
"expected SetupGetInfFileListW to fail!\n");
630 "expected error ERROR_DIRECTORY, got %d\n",
GetLastError());
638 ok(!
ret,
"expected SetupGetInfFileListW to fail!\n");
640 "expected error ERROR_DIRECTORY, got %d\n",
GetLastError());
647 ok(
ret,
"expected SetupGetInfFileListW to succeed!\n");
658 ok(
ret,
"expected SetupGetInfFileListW to succeed!\n");
670 ok(
ret,
"expected SetupGetInfFileListW to succeed!\n");
681 ok(
ret,
"expected SetupGetInfFileListW to succeed!\n");
692 ok(
ret,
"expected SetupGetInfFileListW to succeed!\n");
707 "Signature=\"$Chicago$\"\n" 709 "AddReg=Add.Settings\n" 711 "HKCU,Software\\Wine\\setupapitest,dirid,,%%%i%%\n";
728 size =
sizeof(actual);
static const char * cmdline_inf_reg
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
#define ERROR_SECTION_NOT_FOUND
char * strcat(char *DstString, const char *SrcString)
ACPI_SIZE strlen(const char *String)
static SC_HANDLE scm_handle
char * wine_dbgstr_w(const wchar_t *wstr)
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
#define HKEY_CURRENT_USER
static void test_cmdline(void)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
#define INVALID_HANDLE_VALUE
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
DWORD WINAPI GetLastError(VOID)
static void run_cmdline(LPCSTR section, int mode, LPCSTR path)
static void test_profile_items(void)
BOOL WINAPI DeleteService(SC_HANDLE hService)
BOOL WINAPI SetupInstallServicesFromInfSectionA(HINF Inf, PCSTR SectionName, DWORD Flags)
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
#define CSIDL_COMMON_PROGRAMS
static void ok_registry(BOOL expectsuccess)
#define sprintf(buf, format,...)
HHOOK WINAPI SetWindowsHookExA(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
BOOL WINAPI SetupGetInfFileListW(IN PCWSTR DirectoryPath OPTIONAL, IN DWORD InfStyle, IN OUT PWSTR ReturnBuffer OPTIONAL, IN DWORD ReturnBufferSize OPTIONAL, OUT PDWORD RequiredSize OPTIONAL)
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
SC_HANDLE WINAPI OpenSCManagerA(LPCSTR lpMachineName, LPCSTR lpDatabaseName, DWORD dwDesiredAccess)
#define ERROR_ACCESS_DENIED
void WINAPI InstallHinfSectionW(HWND hwnd, HINSTANCE handle, LPCWSTR cmdline, INT show)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI SetupInstallFromInfSectionA(HWND owner, HINF hinf, PCSTR section, UINT flags, HKEY key_root, PCSTR src_root, UINT copy_flags, PSP_FILE_CALLBACK_A callback, PVOID context, HDEVINFO devinfo, PSP_DEVINFO_DATA devinfo_data)
#define ERROR_FILE_NOT_FOUND
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
DWORD WINAPI GetCurrentThreadId(VOID)
static const char inffile[]
static const char dirid_inf[]
static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
#define ERROR_BAD_SERVICE_INSTALLSECT
struct @1628::@1629 driver
unsigned char size_t * outsize
static void check_dirid(int dirid, LPCSTR expected)
#define INVALID_FILE_ATTRIBUTES
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
static void test_registry(void)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
static void create_inf_file(LPCSTR filename, const char *data)
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
HINF WINAPI SetupOpenInfFileA(PCSTR name, PCSTR class, DWORD style, UINT *error)
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
static void test_dirid(void)
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
int WINAPI lstrlenA(LPCSTR lpString)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
static void test_inffilelist(void)
HRESULT WINAPI SHGetFolderPathA(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPSTR pszPath)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
static void test_install_svc_from(void)
static const char * cmdline_inf
#define MultiByteToWideChar
SC_HANDLE WINAPI OpenServiceA(SC_HANDLE hSCManager, LPCSTR lpServiceName, DWORD dwDesiredAccess)
BOOL WINAPI SetupGetInfFileListA(IN PCSTR DirectoryPath OPTIONAL, IN DWORD InfStyle, IN OUT PSTR ReturnBuffer OPTIONAL, IN DWORD ReturnBufferSize OPTIONAL, OUT PDWORD RequiredSize OPTIONAL)
static const WCHAR inffileW[]
char * strcpy(char *DstString, const char *SrcString)
static void test_driver_install(void)
int strcmp(const char *String1, const char *String2)
char * cleanup(char *str)
#define ERROR_PATH_NOT_FOUND
GLuint GLuint GLsizei GLenum type
#define CreateFileA(a, b, c, d, e, f, g)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
#define RegCloseKey(hKey)
static void test_install_from(void)
static void test_inffilelistA(void)