[NTFS]
[reactos.git] / rostests / kmtests / kmtest / kmtest.h
1 /*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: GPLv2+ - See COPYING in the top level directory
4 * PURPOSE: Kernel-Mode Test Suite Loader Application
5 * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6 */
7
8 #ifndef _KMTESTS_H_
9 #define _KMTESTS_H_
10
11 extern PCSTR ErrorFileAndLine;
12
13 #ifndef KMT_STRINGIZE
14 #define KMT_STRINGIZE(x) #x
15 #endif /* !defined KMT_STRINGIZE */
16
17 #define location(file, line) do { ErrorFileAndLine = file ":" KMT_STRINGIZE(line); } while (0)
18 #define error_value(Error, value) do { location(__FILE__, __LINE__); Error = value; } while (0)
19 #define error(Error) error_value(Error, GetLastError())
20 #define error_goto(Error, label) do { error(Error); goto label; } while (0)
21 #define error_value_goto(Error, value, label) do { error_value(Error, value); goto label; } while (0)
22
23 /* service management functions */
24 DWORD
25 KmtServiceInit(VOID);
26
27 DWORD
28 KmtServiceCleanup(
29 BOOLEAN IgnoreErrors);
30
31 DWORD
32 KmtCreateService(
33 IN PCWSTR ServiceName,
34 IN PCWSTR ServicePath,
35 IN PCWSTR DisplayName OPTIONAL,
36 OUT SC_HANDLE *ServiceHandle);
37
38 DWORD
39 KmtStartService(
40 IN PCWSTR ServiceName OPTIONAL,
41 IN OUT SC_HANDLE *ServiceHandle);
42
43 DWORD
44 KmtCreateAndStartService(
45 IN PCWSTR ServiceName,
46 IN PCWSTR ServicePath,
47 IN PCWSTR DisplayName OPTIONAL,
48 OUT SC_HANDLE *ServiceHandle,
49 IN BOOLEAN RestartIfRunning);
50
51 DWORD
52 KmtStopService(
53 IN PCWSTR ServiceName OPTIONAL,
54 IN OUT SC_HANDLE *ServiceHandle);
55
56 DWORD
57 KmtDeleteService(
58 IN PCWSTR ServiceName OPTIONAL,
59 IN OUT SC_HANDLE *ServiceHandle);
60
61 DWORD KmtCloseService(
62 IN OUT SC_HANDLE *ServiceHandle);
63
64 #endif /* !defined _KMTESTS_H_ */