ReactOS 0.4.15-dev-7906-g1b85a5f
structs.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4 * PURPOSE: Kernel-Mode Test Suite Struct alignment tests
5 * COPYRIGHT: Copyright 2018 Mark Jansen (mark.jansen@reactos.org)
6 */
7
8#include <kmt_test.h>
9
10// When searching for the correct offset,
11// this will generate a compile-time error including the offset:
12// char (*__kaboom1)[FIELD_OFFSET(IO_STACK_LOCATION, Parameters.Create.EaLength)] = 1;
13// Taken from https://stackoverflow.com/a/35261673
14
15#if !defined(_AMD64_)
16
18
23
29
34
42
43#else
44
45C_ASSERT(sizeof(IO_STACK_LOCATION) == 72);
46
51
57
62
64C_ASSERT(FIELD_OFFSET(IO_STACK_LOCATION, Parameters.SetFile.FileInformationClass) == 16);
70
71#endif
#define C_ASSERT(e)
Definition: intsafe.h:73
struct _IO_STACK_LOCATION::@3978::@4007 ReadWriteConfig
struct _IO_STACK_LOCATION::@3978::@3988 SetFile
struct _IO_STACK_LOCATION::@3978::@3979 Create
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1697
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1699
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170