mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 16:16:42 +00:00
[ROSTESTS]
- Merge the Kernel Mode Test Suite Google Summer of Code project - Happy testing, everyone ;) svn path=/trunk/; revision=53671
This commit is contained in:
commit
454f222ade
76 changed files with 8871 additions and 2239 deletions
44
rostests/kmtests/example/Example_user.c
Normal file
44
rostests/kmtests/example/Example_user.c
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* PROJECT: ReactOS kernel-mode tests
|
||||
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
||||
* PURPOSE: Kernel-Mode Test Suite Example user-mode test part
|
||||
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
|
||||
*/
|
||||
|
||||
#include <kmt_test.h>
|
||||
|
||||
#include "Example.h"
|
||||
|
||||
START_TEST(Example)
|
||||
{
|
||||
/* do some user-mode stuff */
|
||||
SYSTEM_INFO SystemInfo;
|
||||
MY_STRUCT MyStruct[2] = { { 123, ":D" }, { 0 } };
|
||||
DWORD Length = sizeof MyStruct;
|
||||
|
||||
trace("Message from user-mode\n");
|
||||
|
||||
GetSystemInfo(&SystemInfo);
|
||||
ok(SystemInfo.dwActiveProcessorMask != 0, "No active processors?!\n");
|
||||
|
||||
/* now run the kernel-mode part (see Example.c).
|
||||
* If no user-mode part exists, this is what's done automatically */
|
||||
KmtRunKernelTest("Example");
|
||||
|
||||
/* now start the special-purpose driver */
|
||||
KmtLoadDriver(L"Example", FALSE);
|
||||
trace("After Entry\n");
|
||||
KmtOpenDriver();
|
||||
trace("After Create\n");
|
||||
|
||||
ok(KmtSendToDriver(IOCTL_NOTIFY) == ERROR_SUCCESS, "\n");
|
||||
ok(KmtSendStringToDriver(IOCTL_SEND_STRING, "yay") == ERROR_SUCCESS, "\n");
|
||||
ok(KmtSendBufferToDriver(IOCTL_SEND_MYSTRUCT, MyStruct, sizeof MyStruct[0], &Length) == ERROR_SUCCESS, "\n");
|
||||
ok_eq_int(MyStruct[1].a, 456);
|
||||
ok_eq_str(MyStruct[1].b, "!!!");
|
||||
|
||||
KmtCloseDriver();
|
||||
trace("After Close\n");
|
||||
KmtUnloadDriver();
|
||||
trace("After Unload\n");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue