ReactOS 0.4.15-dev-7942-gd23573b
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;
19
20 trace("Message from user-mode\n");
21
22 GetSystemInfo(&SystemInfo);
23 ok(SystemInfo.dwActiveProcessorMask != 0, "No active processors?!\n");
24
25 /* now run the kernel-mode part (see Example.c).
26 * If no user-mode part exists, this is what's done automatically */
27 KmtRunKernelTest("Example");
28
29 /* now start the special-purpose driver */
30 Error = KmtLoadAndOpenDriver(L"Example", FALSE);
32 if (Error)
33 return;
34 trace("After Create\n");
35
38 ok(KmtSendBufferToDriver(IOCTL_SEND_MYSTRUCT, MyStruct, sizeof MyStruct[0], &Length) == ERROR_SUCCESS, "\n");
39 ok_eq_int(MyStruct[1].a, 456);
40 ok_eq_str(MyStruct[1].b, "!!!");
41
43 trace("After Close\n");
45 trace("After Unload\n");
46}
#define IOCTL_NOTIFY
Definition: Example.h:17
#define IOCTL_SEND_MYSTRUCT
Definition: Example.h:19
#define IOCTL_SEND_STRING
Definition: Example.h:18
#define ok_eq_str(value, expected)
Definition: apitest.h:83
#define ok_eq_int(value, expected)
Definition: apitest.h:60
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
BOOL Error
Definition: chkdsk.c:66
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FALSE
Definition: types.h:117
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:143
unsigned long DWORD
Definition: ntddk_ex.h:95
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
DWORD_PTR dwActiveProcessorMask
Definition: winbase.h:1176
DWORD KmtRunKernelTest(IN PCSTR TestName)
Definition: support.c:95
DWORD KmtLoadAndOpenDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning)
Definition: support.c:213
VOID KmtCloseDriver(VOID)
Definition: support.c:236
DWORD KmtSendBufferToDriver(IN DWORD ControlCode, IN OUT PVOID Buffer OPTIONAL, IN DWORD InLength, IN OUT PDWORD OutLength)
Definition: support.c:360
DWORD KmtSendStringToDriver(IN DWORD ControlCode, IN PCSTR String)
Definition: support.c:283
DWORD KmtSendToDriver(IN DWORD ControlCode)
Definition: support.c:259
VOID KmtUnloadDriver(VOID)
Definition: support.c:167