1 /*
2  * PROJECT:         ReactOS api tests
3  * LICENSE:         LGPLv2.1+ - See COPYING.LIB in the top level directory
4  * PURPOSE:         Support helpers for embedded services inside api tests.
5  * PROGRAMMERS:     Jacek Caban for CodeWeavers
6  *                  Thomas Faber <thomas.faber@reactos.org>
7  *                  Hermes Belusca-Maito
8  */
9 
10 #pragma once
11 
12 /**********  S E R V I C E   ( C L I E N T )   M O D U L E   S I D E  *********/
13 
14 void send_msg(const char *type, const char *msg);
15 void service_trace(const char *msg, ...);
16 void service_ok(int cnd, const char *msg, ...);
17 void service_process(BOOL (*start_service)(PCSTR, PCWSTR), int argc, char** argv);
18 
19 
20 /***********  T E S T E R   ( S E R V E R )   M O D U L E   S I D E  **********/
21 
22 SC_HANDLE register_service_exA(
23     SC_HANDLE scm_handle,
24     PCSTR test_name,
25     PCSTR service_name, // LPCSTR lpServiceName,
26     PCSTR extra_args OPTIONAL,
27     DWORD dwDesiredAccess,
28     DWORD dwServiceType,
29     DWORD dwStartType,
30     DWORD dwErrorControl,
31     LPCSTR lpLoadOrderGroup OPTIONAL,
32     LPDWORD lpdwTagId OPTIONAL,
33     LPCSTR lpDependencies OPTIONAL,
34     LPCSTR lpServiceStartName OPTIONAL,
35     LPCSTR lpPassword OPTIONAL);
36 
37 SC_HANDLE register_service_exW(
38     SC_HANDLE scm_handle,
39     PCWSTR test_name,
40     PCWSTR service_name, // LPCWSTR lpServiceName,
41     PCWSTR extra_args OPTIONAL,
42     DWORD dwDesiredAccess,
43     DWORD dwServiceType,
44     DWORD dwStartType,
45     DWORD dwErrorControl,
46     LPCWSTR lpLoadOrderGroup OPTIONAL,
47     LPDWORD lpdwTagId OPTIONAL,
48     LPCWSTR lpDependencies OPTIONAL,
49     LPCWSTR lpServiceStartName OPTIONAL,
50     LPCWSTR lpPassword OPTIONAL);
51 
52 SC_HANDLE register_serviceA(
53     SC_HANDLE scm_handle,
54     PCSTR test_name,
55     PCSTR service_name,
56     PCSTR extra_args OPTIONAL);
57 
58 SC_HANDLE register_serviceW(
59     SC_HANDLE scm_handle,
60     PCWSTR test_name,
61     PCWSTR service_name,
62     PCWSTR extra_args OPTIONAL);
63 
64 #ifdef UNICODE
65 #define register_service_ex register_service_exW
66 #define register_service    register_serviceW
67 #else
68 #define register_service_ex register_service_exA
69 #define register_service    register_serviceA
70 #endif
71 
72 void test_runner(void (*run_test)(PCSTR, PCWSTR, void*), void *param);
73