ReactOS 0.4.15-dev-7907-g95bf896
IoReadWrite.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
4 * PURPOSE: Read/Write operations test declarations
5 * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6 */
7
8#ifndef _KMTEST_IOREADFILE_H_
9#define _KMTEST_IOREADFILE_H_
10
11#define TEST_FILE_SIZE 17
12
13#define KEY_SUCCEED 0x00
14#define KEY_SUCCESS_WAIT1 0x01
15
16#define KEY_INFO_EXISTS 0x41
17
18#define KEY_FAIL_MISALIGNED 0x81
19#define KEY_FAIL_OVERFLOW 0x82
20#define KEY_FAIL_PARTIAL 0x83
21#define KEY_FAIL_BUSY 0x84
22#define KEY_FAIL_VERIFY_REQUIRED 0x85
23
24#define KEY_FAIL_UNSUCCESSFUL 0xc1
25#define KEY_FAIL_NOT_IMPLEMENTED 0xc2
26#define KEY_FAIL_ACCESS_VIOLATION 0xc3
27#define KEY_FAIL_IN_PAGE_ERROR 0xc4
28#define KEY_FAIL_EOF 0xc5
29#define KEY_FAIL_ACCESS_DENIED 0xc6
30#define KEY_FAIL_MISALIGNED_ERROR 0xc7
31#define KEY_RESULT_MASK 0xff
32
33#define KEY_NEXT(key) ( (key) == KEY_FAIL_MISALIGNED_ERROR ? 0xff : \
34 (key) == KEY_FAIL_VERIFY_REQUIRED ? KEY_FAIL_UNSUCCESSFUL : \
35 (key) == KEY_INFO_EXISTS ? KEY_FAIL_MISALIGNED : \
36 (key) == KEY_SUCCESS_WAIT1 ? KEY_INFO_EXISTS : \
37 (key) + 1 )
38#define KEY_ERROR(key) (((key) & 0xc0) == 0xc0)
39static
43{
44 switch (LockKey & KEY_RESULT_MASK)
45 {
46 case KEY_SUCCEED:
47 return STATUS_SUCCESS;
49 return STATUS_WAIT_1;
50
51 case KEY_INFO_EXISTS:
53
60 case KEY_FAIL_BUSY:
61 return STATUS_DEVICE_BUSY;
64
73 case KEY_FAIL_EOF:
74 return STATUS_END_OF_FILE;
79 default:
80 ok(0, "Key = %lx\n", LockKey);
82 }
83}
84
85#define KEY_USE_FASTIO 0x100
86#define KEY_RETURN_PENDING 0x200
87
88#define KEY_DATA(c) (((c) & 0xff) << 24)
89#define KEY_GET_DATA(key) ((key) >> 24)
90
91#endif /* !defined _KMTEST_IOREADFILE_H_ */
#define KEY_FAIL_ACCESS_VIOLATION
Definition: IoReadWrite.h:26
#define KEY_FAIL_VERIFY_REQUIRED
Definition: IoReadWrite.h:22
#define KEY_FAIL_MISALIGNED_ERROR
Definition: IoReadWrite.h:30
#define KEY_FAIL_UNSUCCESSFUL
Definition: IoReadWrite.h:24
#define KEY_SUCCEED
Definition: IoReadWrite.h:13
#define KEY_FAIL_MISALIGNED
Definition: IoReadWrite.h:18
#define KEY_FAIL_IN_PAGE_ERROR
Definition: IoReadWrite.h:27
#define KEY_SUCCESS_WAIT1
Definition: IoReadWrite.h:14
#define KEY_FAIL_OVERFLOW
Definition: IoReadWrite.h:19
#define KEY_FAIL_EOF
Definition: IoReadWrite.h:28
#define KEY_FAIL_BUSY
Definition: IoReadWrite.h:21
#define KEY_INFO_EXISTS
Definition: IoReadWrite.h:16
#define KEY_FAIL_ACCESS_DENIED
Definition: IoReadWrite.h:29
static NTSTATUS TestGetReturnStatus(_In_ ULONG LockKey)
Definition: IoReadWrite.h:41
#define KEY_FAIL_NOT_IMPLEMENTED
Definition: IoReadWrite.h:25
#define KEY_FAIL_PARTIAL
Definition: IoReadWrite.h:20
#define KEY_RESULT_MASK
Definition: IoReadWrite.h:31
#define ok(value,...)
Definition: atltest.h:57
LONG NTSTATUS
Definition: precomp.h:26
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2665
#define _In_
Definition: ms_sal.h:308
#define STATUS_WAIT_1
Definition: ntstatus.h:71
#define STATUS_OBJECT_NAME_EXISTS
Definition: ntstatus.h:114
#define STATUS_DATATYPE_MISALIGNMENT_ERROR
Definition: ntstatus.h:817
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define STATUS_IN_PAGE_ERROR
Definition: ntstatus.h:243
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:183
#define STATUS_PARTIAL_COPY
Definition: ntstatus.h:193
#define STATUS_END_OF_FILE
Definition: shellext.h:67
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_DEVICE_BUSY
Definition: udferr_usr.h:129
#define STATUS_VERIFY_REQUIRED
Definition: udferr_usr.h:130