58 strcpy(inf,
"[Version]\nSignature=\"$Chicago$\"\n");
64 ok(!
ret,
"Expected failure\n");
66 "Expected ERROR_INVALID_CLASS, got %08x\n", (
int)
GetLastError());
70 strcat(inf,
"Class=MySampleClass\n");
76 ok(!
ret,
"Expected failure\n");
78 "Expected ERROR_INVALID_CLASS, got %08x\n", (
int)
GetLastError());
82 strcat(inf,
"ClassGuid={3b409830-5f9d-432a-abf5-7d2e4e102467}\n");
88 ok(!
ret,
"Expected failure\n");
90 "Expected ERROR_SECTION_NOT_FOUND, got %08x\n", (
int)
GetLastError());
94 strcat(inf,
"[ClassInstall32.NT]\n");
100 ok(
ret,
"Expected success\n");
112 strcat(inf,
"AddReg=SampleClassAddReg\n");
118 ok(
ret,
"Expected success\n");
130 strcat(inf,
"[SampleClassAddReg]\n");
136 ok(
ret,
"Expected success\n");
148 strcat(inf,
"HKR,,,,\"ReactOS Test SetupDiInstallClassExA\"\n");
154 ok(
ret,
"Expected success\n");
166 strcat(inf,
"[ClassInstall32.NT.Services]\n");
172 ok(
ret,
"Expected success\n");
184 strcat(inf,
"AddService=Reactostest,,Reactostest.Service\n");
189 ok(!
ret,
"Expected failure\n");
191 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", (
int)
GetLastError());
196 strcat(inf,
"[Reactostest.Service]\n");
201 ok(!
ret,
"Expected failure\n");
203 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", (
int)
GetLastError());
208 strcat(inf,
"ServiceBinary=%12%\\reactostest.sys\n");
213 ok(!
ret,
"Expected failure\n");
215 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", (
int)
GetLastError());
220 strcat(inf,
"ServiceType=1\n");
225 ok(!
ret,
"Expected failure\n");
227 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", (
int)
GetLastError());
232 strcat(inf,
"StartType=4\n");
237 ok(!
ret,
"Expected failure\n");
239 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", (
int)
GetLastError());
244 strcat(inf,
"ErrorControl=1");
251 skip(
"Not enough rights to install the service\n");
256 ok(
ret,
"Expected success\n");
258 "Expected ERROR_SUCCESS, got %08x\n", (
int)
GetLastError());
266 ok(svc_handle !=
NULL,
"Service was not created\n");
static SC_HANDLE scm_handle
static char CURR_DIR[MAX_PATH]
static void test_SetupDiInstallClassExA(void)
static const char inffile[]
char * strcat(char *DstString, const char *SrcString)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
static VOID del(LPHIST_ENTRY item)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
#define ERROR_ACCESS_DENIED
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI SetupDiInstallClassExA(IN HWND hwndParent OPTIONAL, IN PCSTR InfFileName OPTIONAL, IN DWORD Flags, IN HSPFILEQ FileQueue OPTIONAL, IN CONST GUID *InterfaceClassGuid OPTIONAL, IN PVOID Reserved1, IN PVOID Reserved2)
HINF WINAPI SetupOpenInfFileA(PCSTR name, PCSTR class, DWORD style, UINT *error)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
int WINAPI lstrlenA(LPCSTR lpString)
static void create_inf_file(void)
BOOL WINAPI DeleteService(SC_HANDLE hService)
SC_HANDLE WINAPI OpenServiceA(SC_HANDLE hSCManager, LPCSTR lpServiceName, DWORD dwDesiredAccess)
SC_HANDLE WINAPI OpenSCManagerA(LPCSTR lpMachineName, LPCSTR lpDatabaseName, DWORD dwDesiredAccess)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
#define ERROR_INVALID_CLASS
#define ERROR_BAD_SERVICE_INSTALLSECT
#define ERROR_SECTION_NOT_FOUND
STRSAFEAPI StringCbPrintfA(STRSAFE_LPSTR pszDest, size_t cbDest, STRSAFE_LPCSTR pszFormat,...)
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
DWORD WINAPI GetLastError(void)
#define HKEY_LOCAL_MACHINE
_In_opt_ PETWENABLECALLBACK _In_opt_ PVOID _Out_ PREGHANDLE RegHandle