48{
49 char inf[2048];
56
57
58 strcpy(inf,
"[Version]\nSignature=\"$Chicago$\"\n");
61
64 ok(!
ret,
"Expected failure\n");
66 "Expected ERROR_INVALID_CLASS, got %08x\n", (
int)
GetLastError());
68
69
70 strcat(inf,
"Class=MySampleClass\n");
73
76 ok(!
ret,
"Expected failure\n");
78 "Expected ERROR_INVALID_CLASS, got %08x\n", (
int)
GetLastError());
80
81
82 strcat(inf,
"ClassGuid={3b409830-5f9d-432a-abf5-7d2e4e102467}\n");
85
88 ok(!
ret,
"Expected failure\n");
90 "Expected ERROR_SECTION_NOT_FOUND, got %08x\n", (
int)
GetLastError());
92
93
94 strcat(inf,
"[ClassInstall32.NT]\n");
97
100 ok(
ret,
"Expected success\n");
105 {
109 }
110
111
112 strcat(inf,
"AddReg=SampleClassAddReg\n");
115
118 ok(
ret,
"Expected success\n");
123 {
127 }
128
129
130 strcat(inf,
"[SampleClassAddReg]\n");
133
136 ok(
ret,
"Expected success\n");
141 {
145 }
146
147
148 strcat(inf,
"HKR,,,,\"ReactOS Test SetupDiInstallClassExA\"\n");
151
154 ok(
ret,
"Expected success\n");
159 {
163 }
164
165
166 strcat(inf,
"[ClassInstall32.NT.Services]\n");
169
172 ok(
ret,
"Expected success\n");
177 {
181 }
182
183
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());
194
195
196 strcat(inf,
"[Reactostest.Service]\n");
201 ok(!
ret,
"Expected failure\n");
203 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", (
int)
GetLastError());
206
207
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());
218
219
220 strcat(inf,
"ServiceType=1\n");
225 ok(!
ret,
"Expected failure\n");
227 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", (
int)
GetLastError());
230
231
232 strcat(inf,
"StartType=4\n");
237 ok(!
ret,
"Expected failure\n");
239 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", (
int)
GetLastError());
242
243
244 strcat(inf,
"ErrorControl=1");
250 {
251 skip(
"Not enough rights to install the service\n");
254 return;
255 }
256 ok(
ret,
"Expected success\n");
258 "Expected ERROR_SUCCESS, got %08x\n", (
int)
GetLastError());
261
263
264
266 ok(svc_handle !=
NULL,
"Service was not created\n");
267
271
274}
static SC_HANDLE scm_handle
static const char inffile[]
char * strcat(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 ERROR_ACCESS_DENIED
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
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)
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