ReactOS 0.4.17-dev-806-gffa4164
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
_In_ HANDLE _In_ CONST PDXGKMDT_OPM_GET_INFO_PARAMETERS Parameters
Definition: dispmprt.h:321
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG Flags
Definition: dispmprt.h:245
#define C_ASSERT(e)
Definition: intsafe.h:73
struct _IO_STACK_LOCATION::@4596::@4606 SetFile
struct _IO_STACK_LOCATION::@4596::@4597 Create
struct _IO_STACK_LOCATION::@4596::@4625 ReadWriteConfig
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1703
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1705
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166