ReactOS 0.4.15-dev-7942-gd23573b
HidP_user.c File Reference
#include <kmt_test.h>
#include "HidP.h"
Include dependency graph for HidP_user.c:

Go to the source code of this file.

Functions

DWORD KmtStartService (IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
 
 START_TEST (HidPDescription)
 

Function Documentation

◆ KmtStartService()

DWORD KmtStartService ( IN PCWSTR ServiceName  OPTIONAL,
IN OUT SC_HANDLE *  ServiceHandle 
)

Definition at line 217 of file service.c.

220{
222
223 assert(ServiceHandle);
224 assert(ServiceName || *ServiceHandle);
225
226 if (!*ServiceHandle)
228
229 if (!*ServiceHandle)
231
232 if (!StartService(*ServiceHandle, 0, NULL))
234
236 if (Error)
237 goto cleanup;
238
239cleanup:
240 return Error;
241}
static WCHAR ServiceName[]
Definition: browser.c:19
BOOL Error
Definition: chkdsk.c:66
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
static void cleanup(void)
Definition: main.c:1335
#define assert(x)
Definition: debug.h:53
unsigned long DWORD
Definition: ntddk_ex.h:95
#define error_goto(Error, label)
Definition: kmtest.h:21
static SC_HANDLE ScmHandle
Definition: service.c:30
static DWORD KmtEnsureServiceState(IN PCWSTR ServiceName OPTIONAL, IN SC_HANDLE ServiceHandle, IN DWORD ExpectedServiceState)
Definition: service.c:155
#define SERVICE_ACCESS
Definition: service.c:15
#define StartService
Definition: winsvc.h:585
#define SERVICE_RUNNING
Definition: winsvc.h:24
#define OpenService
Definition: winsvc.h:576

Referenced by main(), and START_TEST().

◆ START_TEST()

START_TEST ( HidPDescription  )

Definition at line 16 of file HidP_user.c.

17{
18 SC_HANDLE ServiceHandle;
20
21 ServiceHandle = NULL;
22 KmtStartService(L"hidusb", &ServiceHandle);
23 CloseServiceHandle(ServiceHandle);
24
27 if (Error)
28 return;
29
31 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
32
35}
#define IOCTL_TEST_DESCRIPTION
Definition: HidP.h:11
DWORD KmtStartService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
Definition: service.c:217
#define ok_eq_int(value, expected)
Definition: apitest.h:60
#define ok(value,...)
Definition: atltest.h:57
#define FALSE
Definition: types.h:117
#define L(x)
Definition: ntvdm.h:50
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
DWORD KmtLoadAndOpenDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning)
Definition: support.c:213
VOID KmtCloseDriver(VOID)
Definition: support.c:236
DWORD KmtSendToDriver(IN DWORD ControlCode)
Definition: support.c:259
VOID KmtUnloadDriver(VOID)
Definition: support.c:167