ReactOS  0.4.14-dev-614-gbfd8a84
Example_user.c File Reference
#include <kmt_test.h>
#include "Example.h"
Include dependency graph for Example_user.c:

Go to the source code of this file.

Functions

 START_TEST (Example)
 

Function Documentation

◆ START_TEST()

START_TEST ( Example  )

Definition at line 12 of file Example_user.c.

13 {
14  /* do some user-mode stuff */
15  SYSTEM_INFO SystemInfo;
16  MY_STRUCT MyStruct[2] = { { 123, ":D" }, { 0 } };
17  DWORD Length = sizeof MyStruct;
18 
19  trace("Message from user-mode\n");
20 
21  GetSystemInfo(&SystemInfo);
22  ok(SystemInfo.dwActiveProcessorMask != 0, "No active processors?!\n");
23 
24  /* now run the kernel-mode part (see Example.c).
25  * If no user-mode part exists, this is what's done automatically */
26  KmtRunKernelTest("Example");
27 
28  /* now start the special-purpose driver */
29  KmtLoadDriver(L"Example", FALSE);
30  trace("After Entry\n");
31  KmtOpenDriver();
32  trace("After Create\n");
33 
36  ok(KmtSendBufferToDriver(IOCTL_SEND_MYSTRUCT, MyStruct, sizeof MyStruct[0], &Length) == ERROR_SUCCESS, "\n");
37  ok_eq_int(MyStruct[1].a, 456);
38  ok_eq_str(MyStruct[1].b, "!!!");
39 
41  trace("After Close\n");
43  trace("After Unload\n");
44 }
#define IOCTL_SEND_STRING
Definition: Example.h:18
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ok_eq_int(value, expected)
Definition: kmt_test.h:238
#define IOCTL_SEND_MYSTRUCT
Definition: Example.h:19
#define IOCTL_NOTIFY
Definition: Example.h:17
DWORD KmtSendStringToDriver(IN DWORD ControlCode, IN PCSTR String)
Definition: support.c:248
DWORD_PTR dwActiveProcessorMask
Definition: winbase.h:1136
DWORD KmtSendBufferToDriver(IN DWORD ControlCode, IN OUT PVOID Buffer OPTIONAL, IN DWORD InLength, IN OUT PDWORD OutLength)
Definition: support.c:325
VOID KmtCloseDriver(VOID)
Definition: support.c:200
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
DWORD KmtRunKernelTest(IN PCSTR TestName)
Definition: support.c:94
#define trace
Definition: atltest.h:70
#define ok_eq_str(value, expected)
Definition: kmt_test.h:261
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static const WCHAR L[]
Definition: oid.c:1250
DWORD KmtSendToDriver(IN DWORD ControlCode)
Definition: support.c:224
VOID KmtUnloadDriver(VOID)
Definition: support.c:155
#define ok(value,...)
Definition: atltest.h:57
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:142
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
VOID KmtLoadDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning)
Definition: support.c:127
VOID KmtOpenDriver(VOID)
Definition: support.c:174