ReactOS 0.4.15-dev-7704-gc07eb9f
kmtest.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4 * PURPOSE: Kernel-Mode Test Suite loader application declarations
5 * COPYRIGHT: Copyright 2011-2018 Thomas Faber <thomas.faber@reactos.org>
6 * Copyright 2017 Ged Murphy <gedmurphy@reactos.org>
7 */
8
9#ifndef _KMTESTS_H_
10#define _KMTESTS_H_
11
13
14#ifndef KMT_STRINGIZE
15#define KMT_STRINGIZE(x) #x
16#endif /* !defined KMT_STRINGIZE */
17
18#define location(file, line) do { ErrorFileAndLine = file ":" KMT_STRINGIZE(line); } while (0)
19#define error_value(Error, value) do { location(__FILE__, __LINE__); Error = value; } while (0)
20#define error(Error) error_value(Error, GetLastError())
21#define error_goto(Error, label) do { error(Error); goto label; } while (0)
22#define error_value_goto(Error, value, label) do { error_value(Error, value); goto label; } while (0)
23
24/* service management functions */
27
30 BOOLEAN IgnoreErrors);
31
35 IN PCWSTR ServicePath,
36 IN PCWSTR DisplayName OPTIONAL,
37 OUT SC_HANDLE *ServiceHandle);
38
42 IN OUT SC_HANDLE *ServiceHandle);
43
47 IN PCWSTR ServicePath,
48 IN PCWSTR DisplayName OPTIONAL,
49 OUT SC_HANDLE *ServiceHandle,
50 IN BOOLEAN RestartIfRunning);
51
55 IN OUT SC_HANDLE *ServiceHandle);
56
60 IN OUT SC_HANDLE *ServiceHandle);
61
63 IN OUT SC_HANDLE *ServiceHandle);
64
65
66#ifdef KMT_FLT_USER_MODE
67
71
73KmtFltCreateAndStartService(
75 _In_z_ PCWSTR ServicePath,
76 _In_z_ PCWSTR DisplayName OPTIONAL,
77 _Out_ SC_HANDLE *ServiceHandle,
78 _In_ BOOLEAN RestartIfRunning);
79
83 _Out_ HANDLE *hPort);
84
87 _Out_ HANDLE *hPort);
88
91 _In_ HANDLE hPort,
92 _In_reads_bytes_(dwInBufferSize) LPVOID lpInBuffer,
93 _In_ DWORD dwInBufferSize,
94 _Out_writes_bytes_to_opt_(dwOutBufferSize, *lpBytesReturned) LPVOID lpOutBuffer,
95 _In_ DWORD dwOutBufferSize,
97
100 _In_ HANDLE hPort,
101 _Out_writes_bytes_(dwMessageBufferSize) PFILTER_MESSAGE_HEADER lpMessageBuffer,
102 _In_ DWORD dwMessageBufferSize,
103 _In_opt_ LPOVERLAPPED Overlapped);
104
105DWORD
107 _In_ HANDLE hPort,
108 _In_reads_bytes_(dwReplyBufferSize) PFILTER_REPLY_HEADER lpReplyBuffer,
109 _In_ DWORD dwReplyBufferSize);
110
111DWORD
113 _In_ HANDLE hPort,
114 _In_ LPOVERLAPPED Overlapped,
116
117DWORD
120
121DWORD
124 _Inout_ SC_HANDLE *ServiceHandle);
125
127 _Inout_ SC_HANDLE *ServiceHandle);
128
129#endif /* KMT_FILTER_DRIVER */
130
131#endif /* !defined _KMTESTS_H_ */
unsigned char BOOLEAN
static WCHAR ServiceName[]
Definition: browser.c:19
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD KmtFltCloseService(_Inout_ SC_HANDLE *ServiceHandle)
Definition: fltsupport.c:242
DWORD KmtFltDeleteService(_In_opt_z_ PCWSTR ServiceName, _Inout_ SC_HANDLE *ServiceHandle)
Definition: fltsupport.c:97
DWORD KmtServiceCleanup(BOOLEAN IgnoreErrors)
Definition: service.c:64
DWORD KmtServiceInit(VOID)
Definition: service.c:40
DWORD KmtCloseService(IN OUT SC_HANDLE *ServiceHandle)
Definition: service.c:392
PCSTR ErrorFileAndLine
Definition: kmtest.c:34
DWORD KmtDeleteService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
Definition: service.c:356
DWORD KmtCreateService(IN PCWSTR ServiceName, IN PCWSTR ServicePath, IN PCWSTR DisplayName OPTIONAL, OUT SC_HANDLE *ServiceHandle)
Definition: service.c:92
DWORD KmtStopService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
Definition: service.c:315
DWORD KmtStartService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
Definition: service.c:217
DWORD KmtCreateAndStartService(IN PCWSTR ServiceName, IN PCWSTR ServicePath, IN PCWSTR DisplayName OPTIONAL, OUT SC_HANDLE *ServiceHandle, IN BOOLEAN RestartIfRunning)
Definition: service.c:262
DWORD KmtFltReplyMessage(_In_ HANDLE hPort, _In_reads_bytes_(ReplyBufferSize) PFILTER_REPLY_HEADER ReplyBuffer, _In_ DWORD ReplyBufferSize)
Definition: filter.c:276
DWORD KmtFltDisconnect(_In_ HANDLE hPort)
Definition: filter.c:151
DWORD KmtFltLoad(_In_z_ PCWSTR ServiceName)
Definition: filter.c:30
DWORD KmtFltSendMessage(_In_ HANDLE hPort, _In_reads_bytes_(dwInBufferSize) LPVOID InBuffer, _In_ DWORD InBufferSize, _Out_writes_bytes_to_opt_(dutBufferSize, *BytesReturned) LPVOID OutBuffer, _In_ DWORD OutBufferSize, _Out_opt_ LPDWORD BytesReturned)
Definition: filter.c:187
DWORD KmtFltGetMessageResult(_In_ HANDLE hPort, _In_ LPOVERLAPPED Overlapped, _Out_ LPDWORD BytesTransferred)
Definition: filter.c:306
DWORD KmtFltGetMessage(_In_ HANDLE hPort, _Out_writes_bytes_(MessageBufferSize) PFILTER_MESSAGE_HEADER MessageBuffer, _In_ DWORD MessageBufferSize, _In_opt_ LPOVERLAPPED Overlapped)
Definition: filter.c:241
DWORD KmtFltUnload(_In_z_ PCWSTR ServiceName)
Definition: filter.c:336
DWORD KmtFltConnect(_In_z_ PCWSTR ServiceName, _Out_ HANDLE *hPort)
Definition: filter.c:119
#define _Out_opt_
Definition: ms_sal.h:346
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Inout_
Definition: ms_sal.h:378
#define _Out_writes_bytes_(size)
Definition: ms_sal.h:350
#define _In_z_
Definition: ms_sal.h:313
#define _Out_
Definition: ms_sal.h:345
#define _Out_writes_bytes_to_opt_(size, count)
Definition: ms_sal.h:361
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
const uint16_t * PCWSTR
Definition: typedefs.h:57
uint32_t * LPDWORD
Definition: typedefs.h:59
const char * PCSTR
Definition: typedefs.h:52
#define IN
Definition: typedefs.h:39
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET _In_opt_ PWDF_MEMORY_DESCRIPTOR _Out_opt_ PULONG BytesTransferred
Definition: wdfusb.h:1342
_In_ DWORD _In_ DWORD _In_ DWORD _Out_ LPDWORD lpBytesReturned
Definition: winddi.h:1705