ReactOS  0.4.15-dev-5606-gf34e425
support.c File Reference
#include <kmt_test.h>
#include "kmtest.h"
#include <kmt_public.h>
#include <assert.h>
#include <debug.h>
Include dependency graph for support.c:

Go to the source code of this file.

Functions

KmtUserCallbackThread

Thread routine which awaits callback requests from kernel-mode

Returns
Win32 error code
DWORD WINAPI KmtUserCallbackThread (PVOID Parameter)
 
KmtLoadDriver

Load the specified special-purpose driver (create/start the service)

Parameters
ServiceNameName of the driver service (Kmtest- prefix will be added automatically)
RestartIfRunningTRUE to stop and restart the service if it is already running
DWORD KmtLoadDriver (IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning)
 
KmtUnloadDriver

Unload special-purpose driver (stop and delete the service)

VOID KmtUnloadDriver (VOID)
 
KmtOpenDriver

Load and open special-purpose driver (acquire a device handle)

DWORD KmtOpenDriver (VOID)
 
DWORD KmtLoadAndOpenDriver (IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning)
 
KmtCloseDriver

Close special-purpose driver (close device handle)

VOID KmtCloseDriver (VOID)
 
KmtSendToDriver

Send an I/O control message with no arguments to the driver opened with KmtOpenDriver

Parameters
ControlCode
Returns
Win32 error code as returned by DeviceIoControl
DWORD KmtSendToDriver (IN DWORD ControlCode)
 
KmtSendStringToDriver

Send an I/O control message with a string argument to the driver opened with KmtOpenDriver

Parameters
ControlCode
String
Returns
Win32 error code as returned by DeviceIoControl
DWORD KmtSendStringToDriver (IN DWORD ControlCode, IN PCSTR String)
 
KmtSendWStringToDriver

Send an I/O control message with a wide string argument to the driver opened with KmtOpenDriver

Parameters
ControlCode
String
Returns
Win32 error code as returned by DeviceIoControl
DWORD KmtSendWStringToDriver (IN DWORD ControlCode, IN PCWSTR String)
 
KmtSendUlongToDriver

Send an I/O control message with an integer argument to the driver opened with KmtOpenDriver

Parameters
ControlCode
Value
Returns
Win32 error code as returned by DeviceIoControl
DWORD KmtSendUlongToDriver (IN DWORD ControlCode, IN DWORD Value)
 
KmtSendBufferToDriver

Send an I/O control message with the specified arguments to the driver opened with KmtOpenDriver

Parameters
ControlCode
Buffer
InLength
OutLength
Returns
Win32 error code as returned by DeviceIoControl
DWORD KmtSendBufferToDriver (IN DWORD ControlCode, IN OUT PVOID Buffer OPTIONAL, IN DWORD InLength, IN OUT PDWORD OutLength)
 

Variables

HANDLE KmtestHandle
 

KmtRunKernelTest

Run the specified kernel-mode test part

Parameters
TestNameName of the test to run
Returns
Win32 error code as returned by DeviceIoControl
static WCHAR TestServiceName [MAX_PATH]
 
static SC_HANDLE TestServiceHandle
 
static HANDLE TestDeviceHandle
 
DWORD KmtRunKernelTest (IN PCSTR TestName)
 

Function Documentation

◆ KmtCloseDriver()

VOID KmtCloseDriver ( VOID  )

Definition at line 218 of file support.c.

219 {
221 
223  error(Error);
224 
225  if (Error)
226  {
227  DPRINT1("CloseHandle failed: 0x%lx\n", Error);
228  }
229 }
#define CloseHandle
Definition: compat.h:739
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
static HANDLE TestDeviceHandle
Definition: support.c:115
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
#define DPRINT1
Definition: precomp.h:8

Referenced by START_TEST(), and UnloadTcpIpTestDriver().

◆ KmtLoadAndOpenDriver()

DWORD KmtLoadAndOpenDriver ( IN PCWSTR  ServiceName,
IN BOOLEAN  RestartIfRunning 
)

Definition at line 195 of file support.c.

198 {
199  DWORD Error;
200 
201  Error = KmtLoadDriver(ServiceName, RestartIfRunning);
202  if (Error)
203  return Error;
204 
205  Error = KmtOpenDriver();
206  if (Error)
207  return Error;
208 
209  return ERROR_SUCCESS;
210 }
DWORD KmtLoadDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning)
Definition: support.c:128
#define ERROR_SUCCESS
Definition: deptool.c:10
LPTSTR ServiceName
Definition: ServiceMain.c:15
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
DWORD KmtOpenDriver(VOID)
Definition: support.c:174

Referenced by LoadTcpIpTestDriver(), and START_TEST().

◆ KmtLoadDriver()

DWORD KmtLoadDriver ( IN PCWSTR  ServiceName,
IN BOOLEAN  RestartIfRunning 
)

Definition at line 128 of file support.c.

131 {
132  WCHAR ServicePath[MAX_PATH];
133 
134  StringCbCopyW(ServicePath, sizeof(ServicePath), ServiceName);
135  StringCbCatW(ServicePath, sizeof(ServicePath), L"_drv.sys");
136 
137  StringCbCopyW(TestServiceName, sizeof(TestServiceName), L"Kmtest-");
139 
140  return KmtCreateAndStartService(TestServiceName, ServicePath, NULL, &TestServiceHandle, RestartIfRunning);
141 }
static WCHAR TestServiceName[MAX_PATH]
Definition: support.c:113
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
#define L(x)
Definition: ntvdm.h:50
static SC_HANDLE TestServiceHandle
Definition: support.c:114
LPTSTR ServiceName
Definition: ServiceMain.c:15
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
#define NULL
Definition: types.h:112
DWORD KmtCreateAndStartService(IN PCWSTR ServiceName, IN PCWSTR ServicePath, IN PCWSTR DisplayName OPTIONAL, OUT SC_HANDLE *ServiceHandle, IN BOOLEAN RestartIfRunning)
Definition: service.c:262
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166

Referenced by KmtLoadAndOpenDriver(), and START_TEST().

◆ KmtOpenDriver()

DWORD KmtOpenDriver ( VOID  )

Definition at line 174 of file support.c.

175 {
177  WCHAR DevicePath[MAX_PATH];
178 
179  StringCbCopyW(DevicePath, sizeof(DevicePath), L"\\\\.\\Global\\GLOBALROOT\\Device\\");
180  StringCbCatW(DevicePath, sizeof(DevicePath), TestServiceName);
181 
184  error(Error);
185 
186  return Error;
187 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
static WCHAR TestServiceName[MAX_PATH]
Definition: support.c:113
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
#define L(x)
Definition: ntvdm.h:50
#define GENERIC_WRITE
Definition: nt_native.h:90
#define OPEN_EXISTING
Definition: compat.h:775
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HANDLE TestDeviceHandle
Definition: support.c:115
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
#define GENERIC_READ
Definition: compat.h:135
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:913
#define NULL
Definition: types.h:112
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166

Referenced by KmtLoadAndOpenDriver().

◆ KmtRunKernelTest()

DWORD KmtRunKernelTest ( IN PCSTR  TestName)

Definition at line 95 of file support.c.

97 {
98  HANDLE CallbackThread;
101 
102  CallbackThread = CreateThread(NULL, 0, KmtUserCallbackThread, NULL, 0, NULL);
103 
105  error(Error);
106 
107  if (CallbackThread != NULL)
108  CloseHandle(CallbackThread);
109 
110  return Error;
111 }
#define CloseHandle
Definition: compat.h:739
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
HANDLE KmtestHandle
Definition: kmtest.c:32
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:859
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
DWORD WINAPI KmtUserCallbackThread(PVOID Parameter)
Definition: support.c:29
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112
#define IOCTL_KMTEST_RUN_TEST
Definition: kmt_public.h:16

Referenced by RunTest(), and START_TEST().

◆ KmtSendBufferToDriver()

DWORD KmtSendBufferToDriver ( IN DWORD  ControlCode,
IN OUT PVOID Buffer  OPTIONAL,
IN DWORD  InLength,
IN OUT PDWORD  OutLength 
)

Definition at line 342 of file support.c.

347 {
348  assert(OutLength);
349  assert(Buffer || (!InLength && !*OutLength));
350  assert(ControlCode < 0x400);
351 
352  if (!DeviceIoControl(TestDeviceHandle, KMT_MAKE_CODE(ControlCode), Buffer, InLength, Buffer, *OutLength, OutLength, NULL))
353  return GetLastError();
354 
355  return ERROR_SUCCESS;
356 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define assert(x)
Definition: debug.h:53
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
Definition: bufpool.h:45
#define KMT_MAKE_CODE(ControlCode)
Definition: kmt_test.h:266
static HANDLE TestDeviceHandle
Definition: support.c:115
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112

Referenced by START_TEST().

◆ KmtSendStringToDriver()

DWORD KmtSendStringToDriver ( IN DWORD  ControlCode,
IN PCSTR  String 
)

Definition at line 265 of file support.c.

268 {
270 
271  assert(ControlCode < 0x400);
272 
274  return GetLastError();
275 
276  return ERROR_SUCCESS;
277 }
#define ERROR_SUCCESS
Definition: deptool.c:10
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define assert(x)
Definition: debug.h:53
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:859
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
#define KMT_MAKE_CODE(ControlCode)
Definition: kmt_test.h:266
static HANDLE TestDeviceHandle
Definition: support.c:115
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112

Referenced by START_TEST().

◆ KmtSendToDriver()

DWORD KmtSendToDriver ( IN DWORD  ControlCode)

Definition at line 241 of file support.c.

243 {
245 
246  assert(ControlCode < 0x400);
247 
249  return GetLastError();
250 
251  return ERROR_SUCCESS;
252 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define assert(x)
Definition: debug.h:53
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:859
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
#define KMT_MAKE_CODE(ControlCode)
Definition: kmt_test.h:266
static HANDLE TestDeviceHandle
Definition: support.c:115
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112

Referenced by START_TEST().

◆ KmtSendUlongToDriver()

DWORD KmtSendUlongToDriver ( IN DWORD  ControlCode,
IN DWORD  Value 
)

Definition at line 315 of file support.c.

318 {
320 
321  assert(ControlCode < 0x400);
322 
324  return GetLastError();
325 
326  return ERROR_SUCCESS;
327 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define assert(x)
Definition: debug.h:53
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:859
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
#define KMT_MAKE_CODE(ControlCode)
Definition: kmt_test.h:266
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
static HANDLE TestDeviceHandle
Definition: support.c:115
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112

Referenced by START_TEST().

◆ KmtSendWStringToDriver()

DWORD KmtSendWStringToDriver ( IN DWORD  ControlCode,
IN PCWSTR  String 
)

Definition at line 290 of file support.c.

293 {
295 
296  assert(ControlCode < 0x400);
297 
299  return GetLastError();
300 
301  return ERROR_SUCCESS;
302 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define assert(x)
Definition: debug.h:53
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:859
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
#define KMT_MAKE_CODE(ControlCode)
Definition: kmt_test.h:266
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HANDLE TestDeviceHandle
Definition: support.c:115
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by START_TEST().

◆ KmtUnloadDriver()

VOID KmtUnloadDriver ( VOID  )

Definition at line 149 of file support.c.

150 {
151  DWORD Error;
152 
154 
155  if (Error)
156  {
157  fprintf(stderr, "Failed to stop %ls service with error 0x%lx\n", TestServiceName, Error);
158  }
159 
161 
162  if (Error)
163  {
164  fprintf(stderr, "Failed to delete %ls service with error 0x%lx\n", TestServiceName, Error);
165  }
166 }
DWORD KmtStopService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
Definition: service.c:315
static WCHAR TestServiceName[MAX_PATH]
Definition: support.c:113
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
static SC_HANDLE TestServiceHandle
Definition: support.c:114
DWORD KmtDeleteService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
Definition: service.c:356
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
FILE * stderr

Referenced by START_TEST(), and UnloadTcpIpTestDriver().

◆ KmtUserCallbackThread()

DWORD WINAPI KmtUserCallbackThread ( PVOID  Parameter)

Definition at line 29 of file support.c.

31 {
33  /* TODO: RequestPacket? */
34  KMT_CALLBACK_REQUEST_PACKET RequestPacket;
37  HANDLE LocalKmtHandle;
38 
40 
41  /* concurrent IoCtls on the same (non-overlapped) handle aren't possible,
42  * so open a separate one.
43  * For more info http://www.osronline.com/showthread.cfm?link=230782 */
45  if (LocalKmtHandle == INVALID_HANDLE_VALUE)
47 
48  while (1)
49  {
50  if (!DeviceIoControl(LocalKmtHandle, IOCTL_KMTEST_USERMODE_AWAIT_REQ, NULL, 0, &RequestPacket, sizeof(RequestPacket), &BytesReturned, NULL))
52  ASSERT(BytesReturned == sizeof(RequestPacket));
53 
54  switch (RequestPacket.OperationClass)
55  {
56  case QueryVirtualMemory:
57  {
58  SIZE_T InfoBufferSize = VirtualQuery(RequestPacket.Parameters, &Response.MemInfo, sizeof(Response.MemInfo));
59  /* FIXME: an error is a valid result. That should go as a response to kernel mode instead of terminating the thread */
60  if (InfoBufferSize == 0)
62 
63  if (!DeviceIoControl(LocalKmtHandle, IOCTL_KMTEST_USERMODE_SEND_RESPONSE, &RequestPacket.RequestId, sizeof(RequestPacket.RequestId), &Response, sizeof(Response), &BytesReturned, NULL))
65  ASSERT(BytesReturned == 0);
66 
67  break;
68  }
69  default:
70  DPRINT1("Unrecognized user-mode callback request\n");
71  break;
72  }
73  }
74 
75 cleanup:
76  if (LocalKmtHandle != INVALID_HANDLE_VALUE)
77  CloseHandle(LocalKmtHandle);
78 
79  DPRINT("Callback handler dying! Error code %lu", Error);
80  return Error;
81 }
#define CloseHandle
Definition: compat.h:739
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error_goto(Error, label)
Definition: kmtest.h:21
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
KMT_CALLBACK_INFORMATION_CLASS OperationClass
Definition: kmt_test.h:64
#define KMTEST_DEVICE_PATH
Definition: kmt_public.h:35
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
_In_ PVOID Parameter
Definition: ldrtypes.h:241
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
Definition: wdfiotarget.h:1039
#define GENERIC_WRITE
Definition: nt_native.h:90
#define OPEN_EXISTING
Definition: compat.h:775
#define IOCTL_KMTEST_USERMODE_SEND_RESPONSE
Definition: kmt_public.h:22
#define ASSERT(a)
Definition: mode.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
SIZE_T NTAPI VirtualQuery(IN LPCVOID lpAddress, OUT PMEMORY_BASIC_INFORMATION lpBuffer, IN SIZE_T dwLength)
Definition: virtmem.c:220
BOOL Error
Definition: chkdsk.c:66
Definition: ncftp.h:89
#define GENERIC_READ
Definition: compat.h:135
ULONG_PTR SIZE_T
Definition: typedefs.h:80
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:913
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
struct Response Response
char * cleanup(char *str)
Definition: wpickclick.c:99
#define DPRINT
Definition: sndvol32.h:71
#define IOCTL_KMTEST_USERMODE_AWAIT_REQ
Definition: kmt_public.h:25

Referenced by KmtRunKernelTest().

Variable Documentation

◆ KmtestHandle

HANDLE KmtestHandle

Definition at line 32 of file kmtest.c.

Referenced by KmtRunKernelTest(), ListTests(), main(), and RunTest().

◆ TestDeviceHandle

◆ TestServiceHandle

SC_HANDLE TestServiceHandle
static

Definition at line 114 of file support.c.

Referenced by KmtLoadDriver(), and KmtUnloadDriver().

◆ TestServiceName

WCHAR TestServiceName[MAX_PATH]
static

Definition at line 113 of file support.c.

Referenced by KmtLoadDriver(), KmtOpenDriver(), and KmtUnloadDriver().