From 65ceb1766e9d3c1800ec03e8dc5ec4a7bfaa04b7 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 23 May 2026 09:44:39 -0400 Subject: [PATCH 1/2] Remove vendored Windows-Driver-Frameworks Remove vendored Windows Driver Frameworks files that provided a small UMDF 2.15 header subset for CI. This deletes the LICENSE, README and the UMDF 2.15 headers under ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15 (e.g. wdf.h, wdfdevice.h, wudfwdm.h and many related headers). Builds should now rely on system/Windows Kits headers instead of the vendored copies. --- ThirdParty/Windows-Driver-Frameworks/LICENSE | 22 - .../Windows-Driver-Frameworks/README.md | 12 - .../src/publicinc/wdf/umdf/2.15/wdf.h | 134 - .../src/publicinc/wdf/umdf/2.15/wdfassert.h | 93 - .../src/publicinc/wdf/umdf/2.15/wdfbugcodes.h | 123 - .../publicinc/wdf/umdf/2.15/wdfchildlist.h | 436 -- .../publicinc/wdf/umdf/2.15/wdfcollection.h | 268 -- .../src/publicinc/wdf/umdf/2.15/wdfcontrol.h | 55 - .../src/publicinc/wdf/umdf/2.15/wdfcore.h | 152 - .../src/publicinc/wdf/umdf/2.15/wdfdevice.h | 3692 ----------------- .../src/publicinc/wdf/umdf/2.15/wdfdriver.h | 357 -- .../src/publicinc/wdf/umdf/2.15/wdffdo.h | 349 -- .../publicinc/wdf/umdf/2.15/wdffileobject.h | 197 - .../src/publicinc/wdf/umdf/2.15/wdffuncenum.h | 286 -- .../src/publicinc/wdf/umdf/2.15/wdfglobals.h | 67 - .../src/publicinc/wdf/umdf/2.15/wdfhwaccess.h | 612 --- .../publicinc/wdf/umdf/2.15/wdfinterrupt.h | 732 ---- .../src/publicinc/wdf/umdf/2.15/wdfio.h | 1139 ----- .../src/publicinc/wdf/umdf/2.15/wdfiotarget.h | 927 ----- .../src/publicinc/wdf/umdf/2.15/wdfmemory.h | 362 -- .../src/publicinc/wdf/umdf/2.15/wdfobject.h | 826 ---- .../src/publicinc/wdf/umdf/2.15/wdfpdo.h | 184 - .../wdf/umdf/2.15/wdfqueryinterface.h | 112 - .../src/publicinc/wdf/umdf/2.15/wdfregistry.h | 729 ---- .../src/publicinc/wdf/umdf/2.15/wdfrequest.h | 1608 ------- .../src/publicinc/wdf/umdf/2.15/wdfresource.h | 94 - .../publicinc/wdf/umdf/2.15/wdfroletypes.h | 43 - .../src/publicinc/wdf/umdf/2.15/wdfstatus.h | 254 -- .../src/publicinc/wdf/umdf/2.15/wdfstring.h | 102 - .../src/publicinc/wdf/umdf/2.15/wdfsync.h | 300 -- .../src/publicinc/wdf/umdf/2.15/wdftimer.h | 246 -- .../src/publicinc/wdf/umdf/2.15/wdftriage.h | 135 - .../src/publicinc/wdf/umdf/2.15/wdftypes.h | 156 - .../src/publicinc/wdf/umdf/2.15/wdfusb.h | 2205 ---------- .../src/publicinc/wdf/umdf/2.15/wdfverifier.h | 116 - .../src/publicinc/wdf/umdf/2.15/wdfwmi.h | 252 -- .../src/publicinc/wdf/umdf/2.15/wdfworkitem.h | 198 - .../src/publicinc/wdf/umdf/2.15/wudfwdm.h | 1648 -------- 38 files changed, 19223 deletions(-) delete mode 100644 ThirdParty/Windows-Driver-Frameworks/LICENSE delete mode 100644 ThirdParty/Windows-Driver-Frameworks/README.md delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdf.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfassert.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfbugcodes.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfchildlist.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcollection.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcontrol.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcore.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfdevice.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfdriver.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffdo.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffileobject.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffuncenum.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfglobals.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfhwaccess.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfinterrupt.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfio.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfiotarget.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfmemory.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfobject.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfpdo.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfqueryinterface.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfregistry.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfrequest.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfresource.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfroletypes.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfstatus.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfstring.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfsync.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftimer.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftriage.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftypes.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfusb.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfverifier.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfwmi.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfworkitem.h delete mode 100644 ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wudfwdm.h diff --git a/ThirdParty/Windows-Driver-Frameworks/LICENSE b/ThirdParty/Windows-Driver-Frameworks/LICENSE deleted file mode 100644 index b8b569d..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/ThirdParty/Windows-Driver-Frameworks/README.md b/ThirdParty/Windows-Driver-Frameworks/README.md deleted file mode 100644 index a92c954..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/README.md +++ /dev/null @@ -1,12 +0,0 @@ -## Windows Driver Frameworks (WDF) vendored headers - -This folder vendors a small subset of headers from Microsoft’s **Windows Driver Frameworks** repository, to keep CI builds working on runners where the Windows Kits / WDK installation is incomplete. - -- **Upstream repo**: `https://github.com/microsoft/Windows-Driver-Frameworks` -- **License**: MIT (see `LICENSE` in this folder) - -### Included files - -- `src/publicinc/wdf/umdf/2.15/wudfwdm.h` - - Used to satisfy `#include ` in the UMDF driver build when the header is not present in the runner’s Windows Kits install. - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdf.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdf.h deleted file mode 100644 index 9788c53..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdf.h +++ /dev/null @@ -1,134 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdf.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -#ifndef _Dispatch_type_ -#include -#endif - -__user_code - -// -// Fix for value-less UMDF_DRIVER identifier in UMDF 1.x. -// -#if defined(UMDF_DRIVER) -#undef UMDF_DRIVER -#endif -#define UMDF_DRIVER (2) - -#include -#include - -#pragma warning( disable: 4201 ) // nonstandard extension used : nameless struct/union -#pragma warning( disable: 4214 ) // nonstandard extension used : bit field types other than int - -#include "WudfWdm.h" - -#ifdef WDF_UMDF2_DRIVER_INTERNAL -#include -#endif - -// -// Rename WdfFunctions to match version number. Build issues relating to -// unresolved externals of WdfFunctions or WdfFunctions_XXXXX indicate -// multiple WDF versions are being included. Ensure WDF version of all input -// binaries match to resolve. -// - -#define WdfFunctions WdfFunctions_02015 - -typedef VOID (*WDFFUNC) (VOID); -extern const WDFFUNC *WdfFunctions; - -// Basic definitions -#include "wdftypes.h" -#include "wdfglobals.h" -#include "wdffuncenum.h" -#include "wdfstatus.h" -#include "wdfassert.h" -#include "wdfverifier.h" - -// generic object -#include "wdfobject.h" - -// Synchronization -#include "wdfsync.h" - -#include "wdfcore.h" - -#include "wdfdriver.h" - -// Objects -#include "WdfQueryInterface.h" -#include "wdfmemory.h" -#include "wdfchildlist.h" -#include "wdffileobject.h" -#include "wdfdevice.h" -#include "wdfcollection.h" - -#include "wdftimer.h" -#include "wdfworkitem.h" -#include "wdfinterrupt.h" -#include "wdfresource.h" - -// I/O -#include "wdfrequest.h" -#include "wdfiotarget.h" -#include "wdfio.h" - -// particular device types -#include "wdffdo.h" -#include "wdfpdo.h" -#include "wdfcontrol.h" - -#include "WdfWMI.h" - -#include "wdfstring.h" -#include "wdfregistry.h" - -#include "wdfbugcodes.h" -#include "wdfroletypes.h" -#include "wdfhwaccess.h" - -__declspec(dllexport) -__control_entrypoint(DllExport) -NTSTATUS -FxDriverEntryUm( - _In_ PVOID LoaderInterface, - _In_ PVOID Context, - _In_ PVOID DriverObject, - _In_ PUNICODE_STRING RegistryPath - ); -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfassert.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfassert.h deleted file mode 100644 index 9ce1bb5..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfassert.h +++ /dev/null @@ -1,93 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfassert.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -// -// Including here because RtlAssert is not declared in XP and Win2K headers for -// free builds -// -NTSYSAPI -VOID -NTAPI -RtlAssert( - _In_ PVOID FailedAssertion, - _In_ PVOID FileName, - _In_ ULONG LineNumber, - _In_opt_ PSTR Message - ); - -// -// WDFVERIFY is active both on checked and free build only if -// the wdf verifier is tuned on -// -#define WDFVERIFY(exp) { \ - if ((WdfDriverGlobals->DriverFlags & WdfVerifyOn) && !(exp)) { \ - RtlAssert( #exp, __FILE__, __LINE__, NULL ); \ - } \ -} - -#define VERIFY_IS_IRQL_PASSIVE_LEVEL() WDFVERIFY(KeGetCurrentIrql() == PASSIVE_LEVEL) - -// -// Following macro is obsolete and it will be phased out in due course -// -#define IS_AT_PASSIVE() WDFVERIFY(KeGetCurrentIrql() == PASSIVE_LEVEL) - -// -// Compile time active "assert". File will not compile if this assert is FALSE. -// -// This compile time assert is designed to catch mismatch in the values of the -// declared constants. So suppress the OACR warning #6326 generated about the -// potential comparison of constants. -// -#define WDFCASSERT(c) { \ - __pragma(warning(suppress: 6326)) \ - switch(0) case (c): case 0: ; \ - } - -#define DbgPrint(_fmt_, ...) DbgPrintEx(DPFLTR_DEFAULT_ID, DPFLTR_INFO_LEVEL, _fmt_, __VA_ARGS__) -#ifndef KdPrint -#if DBG -#define KdPrint(_x_) DbgPrint _x_ -#else -#define KdPrint(_x_) -#endif -#endif - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfbugcodes.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfbugcodes.h deleted file mode 100644 index 2a597a9..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfbugcodes.h +++ /dev/null @@ -1,123 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfbugcodes.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -// -// These values are used in Parameter 1 in the bugcheck data -// -// NOTE: Do not change these codes, only add to the end. -// The OCA analysis and debugger tools will look at -// these codes to perform fault analysis. -// -typedef enum _WDF_BUGCHECK_CODES { - WDF_POWER_ROUTINE_TIMED_OUT = 0x1, - WDF_RECURSIVE_LOCK = 0x2, - WDF_VERIFIER_FATAL_ERROR = 0x3, - WDF_REQUIRED_PARAMETER_IS_NULL = 0x4, - WDF_INVALID_HANDLE = 0x5, - WDF_REQUEST_FATAL_ERROR = 0x6, - WDF_OBJECT_ERROR = 0x7, - WDF_DMA_FATAL_ERROR = 0x8, - WDF_INVALID_INTERRUPT = 0x9, - WDF_QUEUE_FATAL_ERROR = 0xA, - WDF_INVALID_LOCK_OPERATION = 0xB, - WDF_PNP_FATAL_ERROR = 0xC, - WDF_POWER_MULTIPLE_PPO = 0xD, - WDF_VERIFIER_IRQL_MISMATCH = 0xE, - WDF_VERIFIER_CRITICAL_REGION_MISMATCH = 0xF, -} WDF_BUGCHECK_CODES; - - -typedef enum _WDF_REQUEST_FATAL_ERROR_CODES { - WDF_REQUEST_FATAL_ERROR_NO_MORE_STACK_LOCATIONS = 0x1, - WDF_REQUEST_FATAL_ERROR_NULL_IRP = 0x2, - WDF_REQUEST_FATAL_ERROR_REQUEST_ALREADY_SENT = 0x3, - WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH = 0x4, - WDF_REQUEST_FATAL_ERROR_REQUEST_NOT_IN_QUEUE = 05, -} WDF_REQUEST_FATAL_ERROR_CODES; - - -typedef struct _WDF_POWER_ROUTINE_TIMED_OUT_DATA { - // - // Current power state associated with the timed out device - // - WDF_DEVICE_POWER_STATE PowerState; - - // - // Current power policy state associated with the timed out device - // - WDF_DEVICE_POWER_POLICY_STATE PowerPolicyState; - - // - // The device object for the timed out device - // - PDEVICE_OBJECT DeviceObject; - - // - // The handle for the timed out device - // - WDFDEVICE Device; - - // - // The thread which is stuck - // - PKTHREAD TimedOutThread; - -} WDF_POWER_ROUTINE_TIMED_OUT_DATA; - -typedef struct _WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA { - WDFREQUEST Request; - - PIRP Irp; - - ULONG OutputBufferLength; - - ULONG_PTR Information; - - UCHAR MajorFunction; - -} WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA, - *PWDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA; - -typedef struct _WDF_QUEUE_FATAL_ERROR_DATA { - WDFQUEUE Queue; - - WDFREQUEST Request; - - NTSTATUS Status; - -} WDF_QUEUE_FATAL_ERROR_DATA, *PWDF_QUEUE_FATAL_ERROR_DATA; - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfchildlist.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfchildlist.h deleted file mode 100644 index f861005..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfchildlist.h +++ /dev/null @@ -1,436 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfchildlist.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef enum _WDF_CHILD_LIST_RETRIEVE_DEVICE_STATUS { - WdfChildListRetrieveDeviceUndefined = 0, - WdfChildListRetrieveDeviceSuccess, - WdfChildListRetrieveDeviceNotYetCreated, - WdfChildListRetrieveDeviceNoSuchDevice, -} WDF_CHILD_LIST_RETRIEVE_DEVICE_STATUS, *PWDF_CHILD_LIST_RETRIEVE_DEVICE_STATUS; - - -typedef enum _WDF_RETRIEVE_CHILD_FLAGS { - WdfRetrieveUnspecified = 0x0000, - WdfRetrievePresentChildren = 0x0001, - WdfRetrieveMissingChildren = 0x0002, - WdfRetrievePendingChildren = 0x0004, - WdfRetrieveAddedChildren = (WdfRetrievePresentChildren | WdfRetrievePendingChildren), - WdfRetrieveAllChildren = (WdfRetrievePresentChildren | WdfRetrievePendingChildren | WdfRetrieveMissingChildren), -} WDF_RETRIEVE_CHILD_FLAGS; - - -typedef struct _WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER { - // - // Size in bytes of the entire description, including this header. - // - // Same value as WDF_CHILD_LIST_CONFIG::IdentificationDescriptionSize - // Used as a sanity check. - // - ULONG IdentificationDescriptionSize; -} WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER, - *PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER; - -VOID -FORCEINLINE -WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_INIT( - _Out_ PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER Header, - _In_ ULONG IdentificationDescriptionSize - ) -{ - RtlZeroMemory(Header, IdentificationDescriptionSize); - Header->IdentificationDescriptionSize = IdentificationDescriptionSize; -} - -typedef struct _WDF_CHILD_ADDRESS_DESCRIPTION_HEADER { - // - // Size in bytes of the entire description, including this header. - // - // Same value as WDF_CHILD_LIST_CONFIG::AddressDescriptionSize - // Used as a sanity check. - // - ULONG AddressDescriptionSize; -} WDF_CHILD_ADDRESS_DESCRIPTION_HEADER, - *PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER; - -VOID -FORCEINLINE -WDF_CHILD_ADDRESS_DESCRIPTION_HEADER_INIT( - _Out_ PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER Header, - _In_ ULONG AddressDescriptionSize - ) -{ - RtlZeroMemory(Header, AddressDescriptionSize); - Header->AddressDescriptionSize = AddressDescriptionSize; -} - -typedef -_Function_class_(EVT_WDF_CHILD_LIST_CREATE_DEVICE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_CHILD_LIST_CREATE_DEVICE( - _In_ - WDFCHILDLIST ChildList, - _In_ - PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER IdentificationDescription, - _In_ - PWDFDEVICE_INIT ChildInit - ); - -typedef EVT_WDF_CHILD_LIST_CREATE_DEVICE *PFN_WDF_CHILD_LIST_CREATE_DEVICE; - -typedef -_Function_class_(EVT_WDF_CHILD_LIST_SCAN_FOR_CHILDREN) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_CHILD_LIST_SCAN_FOR_CHILDREN( - _In_ - WDFCHILDLIST ChildList - ); - -typedef EVT_WDF_CHILD_LIST_SCAN_FOR_CHILDREN *PFN_WDF_CHILD_LIST_SCAN_FOR_CHILDREN; - -typedef -_Function_class_(EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COPY) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COPY( - _In_ - WDFCHILDLIST ChildList, - _In_ - PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER SourceIdentificationDescription, - _Out_ - PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER DestinationIdentificationDescription - ); - -typedef EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COPY *PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COPY; - -typedef -_Function_class_(EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_DUPLICATE) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_DUPLICATE( - _In_ - WDFCHILDLIST ChildList, - _In_ - PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER SourceIdentificationDescription, - _Out_ - PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER DestinationIdentificationDescription - ); - -typedef EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_DUPLICATE *PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_DUPLICATE; - -typedef -_Function_class_(EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COMPARE) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -BOOLEAN -EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COMPARE( - _In_ - WDFCHILDLIST ChildList, - _In_ - PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER FirstIdentificationDescription, - _In_ - PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER SecondIdentificationDescription - ); - -typedef EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COMPARE *PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COMPARE; - -typedef -_Function_class_(EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_CLEANUP) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_CLEANUP( - _In_ - WDFCHILDLIST ChildList, - _Inout_ - PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER IdentificationDescription - ); - -typedef EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_CLEANUP *PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_CLEANUP; - -typedef -_Function_class_(EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_COPY) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_COPY( - _In_ - WDFCHILDLIST ChildList, - _In_ - PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER SourceAddressDescription, - _Out_ - PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER DestinationAddressDescription - ); - -typedef EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_COPY *PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_COPY; - -typedef -_Function_class_(EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_DUPLICATE) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_DUPLICATE( - _In_ - WDFCHILDLIST ChildList, - _In_ - PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER SourceAddressDescription, - _Out_ - PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER DestinationAddressDescription - ); - -typedef EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_DUPLICATE *PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_DUPLICATE; - -typedef -_Function_class_(EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_CLEANUP) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_CLEANUP( - _In_ - WDFCHILDLIST ChildList, - _Inout_ - PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER AddressDescription - ); - -typedef EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_CLEANUP *PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_CLEANUP; - -typedef -_Function_class_(EVT_WDF_CHILD_LIST_DEVICE_REENUMERATED) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -BOOLEAN -EVT_WDF_CHILD_LIST_DEVICE_REENUMERATED( - _In_ - WDFCHILDLIST ChildList, - _In_ - WDFDEVICE OldDevice, - _In_ - PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER OldAddressDescription, - _Out_ - PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER NewAddressDescription - ); - -typedef EVT_WDF_CHILD_LIST_DEVICE_REENUMERATED *PFN_WDF_CHILD_LIST_DEVICE_REENUMERATED; - -typedef struct _WDF_CHILD_RETRIEVE_INFO { - // - // Size of the structure in bytes - // - ULONG Size; - - // - // Must be a valid pointer when passed in, copied into upon success - // - PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER IdentificationDescription; - - // - // Optional pointer when passed in, copied into upon success - // - PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER AddressDescription; - - // - // Status of the returned device - // - WDF_CHILD_LIST_RETRIEVE_DEVICE_STATUS Status; - - // - // If provided, will be used for searching through the list of devices - // instead of the default list ID compare function - // - PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COMPARE EvtChildListIdentificationDescriptionCompare; - -} WDF_CHILD_RETRIEVE_INFO, *PWDF_CHILD_RETRIEVE_INFO; - -VOID -FORCEINLINE -WDF_CHILD_RETRIEVE_INFO_INIT( - _Out_ PWDF_CHILD_RETRIEVE_INFO Info, - _In_ PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER IdentificationDescription - ) -{ - RtlZeroMemory(Info, sizeof(WDF_CHILD_RETRIEVE_INFO)); - - Info->Size = sizeof(WDF_CHILD_RETRIEVE_INFO); - Info->IdentificationDescription = IdentificationDescription; -} - -typedef struct _WDF_CHILD_LIST_CONFIG { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // The size in bytes of an identificaiton description to be used with the - // created WDFCHILDLIST handle - // - ULONG IdentificationDescriptionSize; - - // - // Optional size in bytes of an address description to be used with the - // created WDFCHILDLIST handle. - // - ULONG AddressDescriptionSize; - - // - // Required callback to be invoked when a description on the device list - // needs to be converted into a real WDFDEVICE handle. - // - PFN_WDF_CHILD_LIST_CREATE_DEVICE EvtChildListCreateDevice; - - // - // Optional callback to be invoked when the device list needs to be - // rescanned. This function will be called after the device has entered D0 - // and been fully initialized but before I/O has started. - // - PFN_WDF_CHILD_LIST_SCAN_FOR_CHILDREN EvtChildListScanForChildren; - - // - // Optional callback to be invoked when an identification description needs - // to be copied from one location to another. - // - // If left NULL, RtlCopyMemory will be used to copy the description. - // - PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COPY EvtChildListIdentificationDescriptionCopy; - - // - // Optional callback to be invoked when an identification description needs - // to be duplicated. As opposed to EvtChildListIdentificationDescriptionCopy, - // EvtChildListIdentificationDescriptionDuplicate can fail. - // - PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_DUPLICATE EvtChildListIdentificationDescriptionDuplicate; - - // - // Optional callback to be invoked when an identification description needs - // to be cleaned up. This function should *NOT* free the description passed - // to it, just free any associated resources. - // - PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_CLEANUP EvtChildListIdentificationDescriptionCleanup; - - // - // Optional callback to be invoked when an identification description needs - // to be compared with another identificaiton description. - // - // If left NULL, RtlCompareMemory will be used to compare the two - // descriptions. - // - PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COMPARE EvtChildListIdentificationDescriptionCompare; - - // - // Optional callback to be invoked when an address description needs - // to be copied from one location to another. - // - // If left NULL, RtlCopyMemory will be used to copy the description. - // - PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_COPY EvtChildListAddressDescriptionCopy; - - // - // Optional callback to be invoked when an address description needs to be - // duplicated. As opposed to EvtChildListAddressDescriptionCopy, - // EvtChildListAddressDescriptionDuplicate can fail. - // - PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_DUPLICATE EvtChildListAddressDescriptionDuplicate; - - // - // Optional callback to be invoked when an address description needs to be - // cleaned up. This function should *NOT* free the description passed to - // it, just free any associated resources. - // - PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_CLEANUP EvtChildListAddressDescriptionCleanup; - - // - // If provided, will be called when the child's stack requests that the - // child be reenumerated. Returning TRUE allows for the reenumeration to - // proceed. FALSE will no reenumerate the stack. - // - PFN_WDF_CHILD_LIST_DEVICE_REENUMERATED EvtChildListDeviceReenumerated; - -} WDF_CHILD_LIST_CONFIG, *PWDF_CHILD_LIST_CONFIG; - -VOID -FORCEINLINE -WDF_CHILD_LIST_CONFIG_INIT( - _Out_ PWDF_CHILD_LIST_CONFIG Config, - _In_ ULONG IdentificationDescriptionSize, - _In_ PFN_WDF_CHILD_LIST_CREATE_DEVICE EvtChildListCreateDevice - ) -{ - RtlZeroMemory(Config, sizeof(WDF_CHILD_LIST_CONFIG)); - - Config->Size = sizeof(WDF_CHILD_LIST_CONFIG); - Config->IdentificationDescriptionSize = IdentificationDescriptionSize; - Config->EvtChildListCreateDevice = EvtChildListCreateDevice; -} - -typedef struct _WDF_CHILD_LIST_ITERATOR { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // What type of devices to return, see WDF_RETRIEVE_CHILD_FLAGS for - // flag values - // - // - ULONG Flags; - - // - // For internal use, treat this field as opaque - // - PVOID Reserved[4]; - -} WDF_CHILD_LIST_ITERATOR, *PWDF_CHILD_LIST_ITERATOR; - -VOID -FORCEINLINE -WDF_CHILD_LIST_ITERATOR_INIT( - _Out_ PWDF_CHILD_LIST_ITERATOR Iterator, - _In_ ULONG Flags - ) -{ - RtlZeroMemory(Iterator, sizeof(WDF_CHILD_LIST_ITERATOR)); - - Iterator->Size = sizeof(WDF_CHILD_LIST_ITERATOR); - Iterator->Flags = Flags; -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcollection.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcollection.h deleted file mode 100644 index 1acac65..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcollection.h +++ /dev/null @@ -1,268 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfcollection.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -// -// WDF Function: WdfCollectionCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFCOLLECTIONCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES CollectionAttributes, - _Out_ - WDFCOLLECTION* Collection - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfCollectionCreate( - _In_opt_ - PWDF_OBJECT_ATTRIBUTES CollectionAttributes, - _Out_ - WDFCOLLECTION* Collection - ) -{ - return ((PFN_WDFCOLLECTIONCREATE) WdfFunctions[WdfCollectionCreateTableIndex])(WdfDriverGlobals, CollectionAttributes, Collection); -} - - -// -// WDF Function: WdfCollectionGetCount -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -ULONG -(*PFN_WDFCOLLECTIONGETCOUNT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFCOLLECTION Collection - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -ULONG -FORCEINLINE -WdfCollectionGetCount( - _In_ - WDFCOLLECTION Collection - ) -{ - return ((PFN_WDFCOLLECTIONGETCOUNT) WdfFunctions[WdfCollectionGetCountTableIndex])(WdfDriverGlobals, Collection); -} - - -// -// WDF Function: WdfCollectionAdd -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFCOLLECTIONADD)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFCOLLECTION Collection, - _In_ - WDFOBJECT Object - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfCollectionAdd( - _In_ - WDFCOLLECTION Collection, - _In_ - WDFOBJECT Object - ) -{ - return ((PFN_WDFCOLLECTIONADD) WdfFunctions[WdfCollectionAddTableIndex])(WdfDriverGlobals, Collection, Object); -} - - -// -// WDF Function: WdfCollectionRemove -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFCOLLECTIONREMOVE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFCOLLECTION Collection, - _In_ - WDFOBJECT Item - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfCollectionRemove( - _In_ - WDFCOLLECTION Collection, - _In_ - WDFOBJECT Item - ) -{ - ((PFN_WDFCOLLECTIONREMOVE) WdfFunctions[WdfCollectionRemoveTableIndex])(WdfDriverGlobals, Collection, Item); -} - - -// -// WDF Function: WdfCollectionRemoveItem -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFCOLLECTIONREMOVEITEM)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFCOLLECTION Collection, - _In_ - ULONG Index - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfCollectionRemoveItem( - _In_ - WDFCOLLECTION Collection, - _In_ - ULONG Index - ) -{ - ((PFN_WDFCOLLECTIONREMOVEITEM) WdfFunctions[WdfCollectionRemoveItemTableIndex])(WdfDriverGlobals, Collection, Index); -} - - -// -// WDF Function: WdfCollectionGetItem -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFOBJECT -(*PFN_WDFCOLLECTIONGETITEM)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFCOLLECTION Collection, - _In_ - ULONG Index - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFOBJECT -FORCEINLINE -WdfCollectionGetItem( - _In_ - WDFCOLLECTION Collection, - _In_ - ULONG Index - ) -{ - return ((PFN_WDFCOLLECTIONGETITEM) WdfFunctions[WdfCollectionGetItemTableIndex])(WdfDriverGlobals, Collection, Index); -} - - -// -// WDF Function: WdfCollectionGetFirstItem -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFOBJECT -(*PFN_WDFCOLLECTIONGETFIRSTITEM)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFCOLLECTION Collection - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFOBJECT -FORCEINLINE -WdfCollectionGetFirstItem( - _In_ - WDFCOLLECTION Collection - ) -{ - return ((PFN_WDFCOLLECTIONGETFIRSTITEM) WdfFunctions[WdfCollectionGetFirstItemTableIndex])(WdfDriverGlobals, Collection); -} - - -// -// WDF Function: WdfCollectionGetLastItem -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFOBJECT -(*PFN_WDFCOLLECTIONGETLASTITEM)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFCOLLECTION Collection - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFOBJECT -FORCEINLINE -WdfCollectionGetLastItem( - _In_ - WDFCOLLECTION Collection - ) -{ - return ((PFN_WDFCOLLECTIONGETLASTITEM) WdfFunctions[WdfCollectionGetLastItemTableIndex])(WdfDriverGlobals, Collection); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcontrol.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcontrol.h deleted file mode 100644 index 4bdc9cb..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcontrol.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfcontrol.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - - -typedef -_Function_class_(EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION *PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION; - -typedef enum _WDF_DEVICE_SHUTDOWN_FLAGS { - WdfDeviceShutdown = 0x01, - WdfDeviceLastChanceShutdown = 0x02, -} WDF_DEVICE_SHUTDOWN_FLAGS; - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcore.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcore.h deleted file mode 100644 index b0a08ff..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfcore.h +++ /dev/null @@ -1,152 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfcore.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -// -// Time conversion related macros -// -// to to to -// us ms sec -#define WDF_TIMEOUT_TO_SEC ((LONGLONG) 1 * 10 * 1000 * 1000) -#define WDF_TIMEOUT_TO_MS ((LONGLONG) 1 * 10 * 1000) -#define WDF_TIMEOUT_TO_US ((LONGLONG) 1 * 10) -LONGLONG -FORCEINLINE -WDF_REL_TIMEOUT_IN_SEC( - _In_ ULONGLONG Time - ) -{ - return Time * -1 * WDF_TIMEOUT_TO_SEC; -} - -LONGLONG -FORCEINLINE -WDF_ABS_TIMEOUT_IN_SEC( - _In_ ULONGLONG Time - ) -{ - return Time * 1 * WDF_TIMEOUT_TO_SEC; -} - -LONGLONG -FORCEINLINE -WDF_REL_TIMEOUT_IN_MS( - _In_ ULONGLONG Time - ) -{ - return Time * -1 * WDF_TIMEOUT_TO_MS; -} - -LONGLONG -FORCEINLINE -WDF_ABS_TIMEOUT_IN_MS( - _In_ ULONGLONG Time - ) -{ - return Time * 1 * WDF_TIMEOUT_TO_MS; -} - -LONGLONG -FORCEINLINE -WDF_REL_TIMEOUT_IN_US( - _In_ ULONGLONG Time - ) -{ - return Time * -1 * WDF_TIMEOUT_TO_US; -} - -LONGLONG -FORCEINLINE -WDF_ABS_TIMEOUT_IN_US( - _In_ ULONGLONG Time - ) -{ - return Time * 1 * WDF_TIMEOUT_TO_US; -} - -// -// Rounding functions -// -size_t -FORCEINLINE -WDF_ALIGN_SIZE_DOWN( - _In_ size_t Length, - _In_ size_t AlignTo - ) -{ - return Length & ~(AlignTo - 1); -} - -size_t -FORCEINLINE -WDF_ALIGN_SIZE_UP( - _In_ size_t Length, - _In_ size_t AlignTo - ) -{ - return WDF_ALIGN_SIZE_DOWN(Length + AlignTo - 1, AlignTo); -} - - -// -// Pointer math -// -#define WDF_PTR_ADD_OFFSET_TYPE(_ptr, _offset, _type) \ - ((_type) (((PUCHAR) (_ptr)) + (_offset))) - -#define WDF_PTR_ADD_OFFSET(_ptr, _offset) \ - WDF_PTR_ADD_OFFSET_TYPE(_ptr, _offset, PVOID) - -#define WDF_PTR_GET_OFFSET(_base, _addr) \ - (size_t) (((PUCHAR) _addr) - ((PUCHAR) _base)) - -#if (OSVER(NTDDI_VERSION) == NTDDI_WIN2K) -// -// These definitions are necessary for building under a Win2K Environment. -// -#ifndef DECLARE_UNICODE_STRING_SIZE -#define DECLARE_UNICODE_STRING_SIZE(_var, _size) \ -WCHAR _var ## _buffer[_size]; \ -UNICODE_STRING _var = { 0, _size * sizeof(WCHAR) , _var ## _buffer } -#endif - -#undef DECLARE_CONST_UNICODE_STRING -#define DECLARE_CONST_UNICODE_STRING(_variablename, _string) \ -const WCHAR _variablename ## _buffer[] = _string; \ -__pragma(warning(suppress:4204)) __pragma(warning(suppress:4221)) \ -const UNICODE_STRING _variablename = { sizeof(_string) - sizeof(WCHAR), sizeof(_string), (PWSTR) _variablename ## _buffer } - -#endif // (OSVER(NTDDI_VERSION) == NTDDI_WIN2K) -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfdevice.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfdevice.h deleted file mode 100644 index 1ea02df..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfdevice.h +++ /dev/null @@ -1,3692 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - WdfDevice.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - - -#include - - -// begin_wpp enum -typedef enum _WDF_DEVICE_STATE_FLAGS { - WdfDevStateNP = 0x8000, -} WDF_DEVICE_STATE_FLAGS; - - -// end_wpp - -// begin_wpp enum -typedef enum _WDF_DEVICE_PNP_STATE { - WdfDevStatePnpInvalid = 0x00, - WdfDevStatePnpObjectCreated = 0x100, - WdfDevStatePnpCheckForDevicePresence = 0x101, - WdfDevStatePnpEjectFailed = 0x102, - WdfDevStatePnpEjectHardware = 0x103, - WdfDevStatePnpEjectedWaitingForRemove = 0x104, - WdfDevStatePnpInit = 0x105, - WdfDevStatePnpInitStarting = 0x106, - WdfDevStatePnpInitSurpriseRemoved = 0x107, - WdfDevStatePnpHardwareAvailable = 0x108, - WdfDevStatePnpEnableInterfaces = 0x109, - WdfDevStatePnpHardwareAvailablePowerPolicyFailed = 0x10A, - WdfDevStatePnpQueryRemoveAskDriver = 0x10B, - WdfDevStatePnpQueryRemovePending = 0x10C, - WdfDevStatePnpQueryRemoveStaticCheck = 0x10D, - WdfDevStatePnpQueriedRemoving = 0x10E, - WdfDevStatePnpQueryStopAskDriver = 0x10F, - WdfDevStatePnpQueryStopPending = 0x110, - WdfDevStatePnpQueryStopStaticCheck = 0x111, - WdfDevStatePnpQueryCanceled = 0x112, - WdfDevStatePnpRemoved = 0x113, - WdfDevStatePnpPdoRemoved = 0x114, - WdfDevStatePnpRemovedPdoWait = 0x115, - WdfDevStatePnpRemovedPdoSurpriseRemoved = 0x116, - WdfDevStatePnpRemovingDisableInterfaces = 0x117, - WdfDevStatePnpRestarting = 0x118, - WdfDevStatePnpStarted = 0x119, - WdfDevStatePnpStartedCancelStop = 0x11A, - WdfDevStatePnpStartedCancelRemove = 0x11B, - WdfDevStatePnpStartedRemoving = 0x11C, - WdfDevStatePnpStartingFromStopped = 0x11D, - WdfDevStatePnpStopped = 0x11E, - WdfDevStatePnpStoppedWaitForStartCompletion = 0x11F, - WdfDevStatePnpStartedStopping = 0x120, - WdfDevStatePnpSurpriseRemove = 0x121, - WdfDevStatePnpInitQueryRemove = 0x122, - WdfDevStatePnpInitQueryRemoveCanceled = 0x123, - WdfDevStatePnpFdoRemoved = 0x124, - WdfDevStatePnpRemovedWaitForChildren = 0x125, - WdfDevStatePnpQueriedSurpriseRemove = 0x126, - WdfDevStatePnpSurpriseRemoveIoStarted = 0x127, - WdfDevStatePnpFailedPowerDown = 0x128, - WdfDevStatePnpFailedIoStarting = 0x129, - WdfDevStatePnpFailedOwnHardware = 0x12A, - WdfDevStatePnpFailed = 0x12B, - WdfDevStatePnpFailedSurpriseRemoved = 0x12C, - WdfDevStatePnpFailedStarted = 0x12D, - WdfDevStatePnpFailedWaitForRemove = 0x12E, - WdfDevStatePnpFailedInit = 0x12F, - WdfDevStatePnpPdoInitFailed = 0x130, - WdfDevStatePnpRestart = 0x131, - WdfDevStatePnpRestartReleaseHardware = 0x132, - WdfDevStatePnpRestartHardwareAvailable = 0x133, - WdfDevStatePnpPdoRestart = 0x134, - WdfDevStatePnpFinal = 0x135, - WdfDevStatePnpRemovedChildrenRemoved = 0x136, - WdfDevStatePnpQueryRemoveEnsureDeviceAwake = 0x137, - WdfDevStatePnpQueryStopEnsureDeviceAwake = 0x138, - WdfDevStatePnpFailedPowerPolicyRemoved = 0x139, - WdfDevStatePnpNull = 0x13A, -} WDF_DEVICE_PNP_STATE, *PWDF_DEVICE_PNP_STATE; - - -// end_wpp - -// begin_wpp enum -typedef enum _WDF_DEVICE_POWER_STATE { - WdfDevStatePowerInvalid = 0x00, - WdfDevStatePowerObjectCreated = 0x300, - WdfDevStatePowerCheckDeviceType = 0x301, - WdfDevStatePowerCheckDeviceTypeNP = 0x302 | WdfDevStateNP, - WdfDevStatePowerCheckParentState = 0x303, - WdfDevStatePowerCheckParentStateNP = 0x304 | WdfDevStateNP, - WdfDevStatePowerEnablingWakeAtBus = 0x305, - WdfDevStatePowerEnablingWakeAtBusNP = 0x306 | WdfDevStateNP, - WdfDevStatePowerD0 = 0x307, - WdfDevStatePowerD0NP = 0x308 | WdfDevStateNP, - WdfDevStatePowerD0BusWakeOwner = 0x309, - WdfDevStatePowerD0BusWakeOwnerNP = 0x30A | WdfDevStateNP, - WdfDevStatePowerD0ArmedForWake = 0x30B, - WdfDevStatePowerD0ArmedForWakeNP = 0x30C | WdfDevStateNP, - WdfDevStatePowerD0DisarmingWakeAtBus = 0x30D, - WdfDevStatePowerD0DisarmingWakeAtBusNP = 0x30E | WdfDevStateNP, - WdfDevStatePowerD0Starting = 0x30F, - WdfDevStatePowerD0StartingConnectInterrupt = 0x310, - WdfDevStatePowerD0StartingDmaEnable = 0x311, - WdfDevStatePowerD0StartingStartSelfManagedIo = 0x312, - WdfDevStatePowerDecideD0State = 0x313, - WdfDevStatePowerGotoD3Stopped = 0x314, - WdfDevStatePowerStopped = 0x315, - WdfDevStatePowerStartingCheckDeviceType = 0x316, - WdfDevStatePowerStartingChild = 0x317, - WdfDevStatePowerDxDisablingWakeAtBus = 0x318, - WdfDevStatePowerDxDisablingWakeAtBusNP = 0x319 | WdfDevStateNP, - WdfDevStatePowerGotoDx = 0x31A, - WdfDevStatePowerGotoDxNP = 0x31B | WdfDevStateNP, - WdfDevStatePowerGotoDxIoStopped = 0x31C, - WdfDevStatePowerGotoDxIoStoppedNP = 0x31D | WdfDevStateNP, - WdfDevStatePowerGotoDxNPFailed = 0x31E | WdfDevStateNP, - WdfDevStatePowerDx = 0x31F, - WdfDevStatePowerDxNP = 0x320 | WdfDevStateNP, - WdfDevStatePowerGotoDxArmedForWake = 0x321, - WdfDevStatePowerGotoDxArmedForWakeNP = 0x322 | WdfDevStateNP, - WdfDevStatePowerGotoDxIoStoppedArmedForWake = 0x323, - WdfDevStatePowerGotoDxIoStoppedArmedForWakeNP = 0x324 | WdfDevStateNP, - WdfDevStatePowerDxArmedForWake = 0x325, - WdfDevStatePowerDxArmedForWakeNP = 0x326 | WdfDevStateNP, - WdfDevStatePowerCheckParentStateArmedForWake = 0x327, - WdfDevStatePowerCheckParentStateArmedForWakeNP = 0x328 | WdfDevStateNP, - WdfDevStatePowerWaitForParentArmedForWake = 0x329, - WdfDevStatePowerWaitForParentArmedForWakeNP = 0x32A | WdfDevStateNP, - WdfDevStatePowerStartSelfManagedIo = 0x32B, - WdfDevStatePowerStartSelfManagedIoNP = 0x32C | WdfDevStateNP, - WdfDevStatePowerStartSelfManagedIoFailed = 0x32D, - WdfDevStatePowerStartSelfManagedIoFailedNP = 0x32E | WdfDevStateNP, - WdfDevStatePowerWaitForParent = 0x32F, - WdfDevStatePowerWaitForParentNP = 0x330 | WdfDevStateNP, - WdfDevStatePowerWakePending = 0x331, - WdfDevStatePowerWakePendingNP = 0x332 | WdfDevStateNP, - WdfDevStatePowerWaking = 0x333, - WdfDevStatePowerWakingNP = 0x334 | WdfDevStateNP, - WdfDevStatePowerWakingConnectInterrupt = 0x335, - WdfDevStatePowerWakingConnectInterruptNP = 0x336 | WdfDevStateNP, - WdfDevStatePowerWakingConnectInterruptFailed = 0x337, - WdfDevStatePowerWakingConnectInterruptFailedNP = 0x338 | WdfDevStateNP, - WdfDevStatePowerWakingDmaEnable = 0x339, - WdfDevStatePowerWakingDmaEnableNP = 0x33A | WdfDevStateNP, - WdfDevStatePowerWakingDmaEnableFailed = 0x33B, - WdfDevStatePowerWakingDmaEnableFailedNP = 0x33C | WdfDevStateNP, - WdfDevStatePowerReportPowerUpFailedDerefParent = 0x33D, - WdfDevStatePowerReportPowerUpFailed = 0x33E, - WdfDevStatePowerPowerFailedPowerDown = 0x33F, - WdfDevStatePowerReportPowerDownFailed = 0x340, - WdfDevStatePowerInitialConnectInterruptFailed = 0x341, - WdfDevStatePowerInitialDmaEnableFailed = 0x342, - WdfDevStatePowerInitialSelfManagedIoFailed = 0x343, - WdfDevStatePowerInitialPowerUpFailedDerefParent = 0x344, - WdfDevStatePowerInitialPowerUpFailed = 0x345, - WdfDevStatePowerDxStoppedDisarmWake = 0x346, - WdfDevStatePowerDxStoppedDisarmWakeNP = 0x347 | WdfDevStateNP, - WdfDevStatePowerGotoDxStoppedDisableInterruptNP = 0x348 | WdfDevStateNP, - WdfDevStatePowerGotoDxStopped = 0x349, - WdfDevStatePowerDxStopped = 0x34A, - WdfDevStatePowerGotoStopped = 0x34B, - WdfDevStatePowerStoppedCompleteDx = 0x34C, - WdfDevStatePowerDxStoppedDecideDxState = 0x34D, - WdfDevStatePowerDxStoppedArmForWake = 0x34E, - WdfDevStatePowerDxStoppedArmForWakeNP = 0x34F | WdfDevStateNP, - WdfDevStatePowerFinalPowerDownFailed = 0x350, - WdfDevStatePowerFinal = 0x351, - WdfDevStatePowerGotoImplicitD3DisarmWakeAtBus = 0x352, - WdfDevStatePowerUpFailed = 0x353, - WdfDevStatePowerUpFailedDerefParent = 0x354, - WdfDevStatePowerGotoDxFailed = 0x355, - WdfDevStatePowerGotoDxStoppedDisableInterrupt = 0x356, - WdfDevStatePowerUpFailedNP = 0x357 | WdfDevStateNP, - WdfDevStatePowerUpFailedDerefParentNP = 0x358 | WdfDevStateNP, - WdfDevStatePowerNotifyingD0ExitToWakeInterrupts = 0x359, - WdfDevStatePowerNotifyingD0EntryToWakeInterrupts = 0x35A, - WdfDevStatePowerNotifyingD0ExitToWakeInterruptsNP = 0x35B | WdfDevStateNP, - WdfDevStatePowerNotifyingD0EntryToWakeInterruptsNP = 0x35C | WdfDevStateNP, - WdfDevStatePowerNull = 0x35D, -} WDF_DEVICE_POWER_STATE, *PWDF_DEVICE_POWER_STATE; - - -// end_wpp - - -// begin_wpp enum -typedef enum _WDF_DEVICE_POWER_POLICY_STATE { - WdfDevStatePwrPolInvalid = 0x00, - WdfDevStatePwrPolObjectCreated = 0x500, - WdfDevStatePwrPolStarting = 0x501, - WdfDevStatePwrPolStartingSucceeded = 0x502, - WdfDevStatePwrPolStartingFailed = 0x503, - WdfDevStatePwrPolStartingDecideS0Wake = 0x504, - WdfDevStatePwrPolStartedIdleCapable = 0x505, - WdfDevStatePwrPolTimerExpiredNoWake = 0x506, - WdfDevStatePwrPolTimerExpiredNoWakeCompletePowerDown = 0x507, - WdfDevStatePwrPolWaitingUnarmed = 0x508, - WdfDevStatePwrPolWaitingUnarmedQueryIdle = 0x509, - WdfDevStatePwrPolS0NoWakePowerUp = 0x50A, - WdfDevStatePwrPolS0NoWakeCompletePowerUp = 0x50B, - WdfDevStatePwrPolSystemSleepFromDeviceWaitingUnarmed = 0x50C, - WdfDevStatePwrPolSystemSleepNeedWake = 0x50D, - WdfDevStatePwrPolSystemSleepNeedWakeCompletePowerUp = 0x50E, - WdfDevStatePwrPolSystemSleepPowerRequestFailed = 0x50F, - WdfDevStatePwrPolCheckPowerPageable = 0x510, - WdfDevStatePwrPolSleepingWakeWakeArrived = 0x511, - WdfDevStatePwrPolSleepingWakeRevertArmWake = 0x512, - WdfDevStatePwrPolSystemAsleepWakeArmed = 0x513, - WdfDevStatePwrPolSystemWakeDeviceWakeEnabled = 0x514, - WdfDevStatePwrPolSystemWakeDeviceWakeEnabledWakeCanceled = 0x515, - WdfDevStatePwrPolSystemWakeDeviceWakeDisarm = 0x516, - WdfDevStatePwrPolSystemWakeDeviceWakeTriggered = 0x517, - WdfDevStatePwrPolSystemWakeDeviceWakeTriggeredS0 = 0x518, - WdfDevStatePwrPolSystemWakeDeviceWokeDisarm = 0x519, - WdfDevStatePwrPolSleepingWakeWakeArrivedNP = 0x51A | WdfDevStateNP, - WdfDevStatePwrPolSleepingWakeRevertArmWakeNP = 0x51B | WdfDevStateNP, - WdfDevStatePwrPolSleepingWakePowerDownFailed = 0x51C, - WdfDevStatePwrPolSleepingWakePowerDownFailedWakeCanceled = 0x51D, - WdfDevStatePwrPolSystemAsleepWakeArmedNP = 0x51E | WdfDevStateNP, - WdfDevStatePwrPolSystemWakeDeviceWakeEnabledNP = 0x51F | WdfDevStateNP, - WdfDevStatePwrPolSystemWakeDeviceWakeEnabledWakeCanceledNP = 0x520 | WdfDevStateNP, - WdfDevStatePwrPolSystemWakeDeviceWakeDisarmNP = 0x521 | WdfDevStateNP, - WdfDevStatePwrPolSystemWakeDeviceWakeTriggeredNP = 0x522 | WdfDevStateNP, - WdfDevStatePwrPolSystemWakeDeviceWakeTriggeredS0NP = 0x523 | WdfDevStateNP, - WdfDevStatePwrPolSystemWakeDeviceWokeDisarmNP = 0x524 | WdfDevStateNP, - WdfDevStatePwrPolSystemWakeDeviceWakeCompletePowerUp = 0x525, - WdfDevStatePwrPolSleeping = 0x526, - WdfDevStatePwrPolSleepingNoWakePowerDown = 0x527, - WdfDevStatePwrPolSleepingNoWakeCompletePowerDown = 0x528, - WdfDevStatePwrPolSleepingNoWakeDxRequestFailed = 0x529, - WdfDevStatePwrPolSleepingWakePowerDown = 0x52A, - WdfDevStatePwrPolSleepingSendWake = 0x52B, - WdfDevStatePwrPolSystemAsleepNoWake = 0x52C, - WdfDevStatePwrPolSystemWakeDeviceWakeDisabled = 0x52D, - WdfDevStatePwrPolSystemWakeDeviceToD0 = 0x52E, - WdfDevStatePwrPolSystemWakeDeviceToD0CompletePowerUp = 0x52F, - WdfDevStatePwrPolSystemWakeQueryIdle = 0x530, - WdfDevStatePwrPolStartedWakeCapable = 0x531, - WdfDevStatePwrPolTimerExpiredDecideUsbSS = 0x532, - WdfDevStatePwrPolTimerExpiredWakeCapablePowerDown = 0x533, - WdfDevStatePwrPolTimerExpiredWakeCapableSendWake = 0x534, - WdfDevStatePwrPolTimerExpiredWakeCapableUsbSS = 0x535, - WdfDevStatePwrPolTimerExpiredWakeCapableWakeArrived = 0x536, - WdfDevStatePwrPolTimerExpiredWakeCapableCancelWake = 0x537, - WdfDevStatePwrPolTimerExpiredWakeCapableWakeCanceled = 0x538, - WdfDevStatePwrPolTimerExpiredWakeCapableCleanup = 0x539, - WdfDevStatePwrPolTimerExpiredWakeCapableDxAllocFailed = 0x53A, - WdfDevStatePwrPolTimerExpiredWakeCompletedPowerDown = 0x53B, - WdfDevStatePwrPolTimerExpiredWakeCompletedPowerUp = 0x53C, - WdfDevStatePwrPolWaitingArmedUsbSS = 0x53D, - WdfDevStatePwrPolWaitingArmed = 0x53E, - WdfDevStatePwrPolWaitingArmedQueryIdle = 0x53F, - WdfDevStatePwrPolIoPresentArmed = 0x540, - WdfDevStatePwrPolIoPresentArmedWakeCanceled = 0x541, - WdfDevStatePwrPolS0WakeDisarm = 0x542, - WdfDevStatePwrPolS0WakeCompletePowerUp = 0x543, - WdfDevStatePwrPolTimerExpiredWakeSucceeded = 0x544, - WdfDevStatePwrPolTimerExpiredWakeCompletedDisarm = 0x545, - WdfDevStatePwrPolTimerExpiredWakeCapableWakeSucceeded = 0x546, - WdfDevStatePwrPolTimerExpiredWakeCapableWakeFailed = 0x547, - WdfDevStatePwrPolWakeFailedUsbSS = 0x548, - WdfDevStatePwrPolTimerExpiredWakeCapablePowerDownFailedCancelWake = 0x549, - WdfDevStatePwrPolTimerExpiredWakeCapablePowerDownFailedWakeCanceled = 0x54A, - WdfDevStatePwrPolTimerExpiredWakeCapablePowerDownFailedUsbSS = 0x54B, - WdfDevStatePwrPolCancelingWakeForSystemSleep = 0x54C, - WdfDevStatePwrPolCancelingWakeForSystemSleepWakeCanceled = 0x54D, - WdfDevStatePwrPolDisarmingWakeForSystemSleepCompletePowerUp = 0x54E, - WdfDevStatePwrPolPowerUpForSystemSleepFailed = 0x54F, - WdfDevStatePwrPolWokeFromS0UsbSS = 0x550, - WdfDevStatePwrPolWokeFromS0 = 0x551, - WdfDevStatePwrPolWokeFromS0NotifyDriver = 0x552, - WdfDevStatePwrPolStoppingResetDevice = 0x553, - WdfDevStatePwrPolStoppingResetDeviceCompletePowerUp = 0x554, - WdfDevStatePwrPolStoppingResetDeviceFailed = 0x555, - WdfDevStatePwrPolStoppingD0 = 0x556, - WdfDevStatePwrPolStoppingD0Failed = 0x557, - WdfDevStatePwrPolStoppingDisarmWake = 0x558, - WdfDevStatePwrPolStoppingDisarmWakeCancelWake = 0x559, - WdfDevStatePwrPolStoppingDisarmWakeWakeCanceled = 0x55A, - WdfDevStatePwrPolStopping = 0x55B, - WdfDevStatePwrPolStoppingFailed = 0x55C, - WdfDevStatePwrPolStoppingSendStatus = 0x55D, - WdfDevStatePwrPolStoppingCancelTimer = 0x55E, - WdfDevStatePwrPolStoppingWaitForIdleTimeout = 0x55F, - WdfDevStatePwrPolStoppingCancelUsbSS = 0x560, - WdfDevStatePwrPolStoppingWaitForUsbSSCompletion = 0x561, - WdfDevStatePwrPolStoppingCancelWake = 0x562, - WdfDevStatePwrPolStopped = 0x563, - WdfDevStatePwrPolCancelUsbSS = 0x564, - WdfDevStatePwrPolStarted = 0x565, - WdfDevStatePwrPolStartedCancelTimer = 0x566, - WdfDevStatePwrPolStartedWaitForIdleTimeout = 0x567, - WdfDevStatePwrPolStartedWakeCapableCancelTimerForSleep = 0x568, - WdfDevStatePwrPolStartedWakeCapableWaitForIdleTimeout = 0x569, - WdfDevStatePwrPolStartedWakeCapableSleepingUsbSS = 0x56A, - WdfDevStatePwrPolStartedIdleCapableCancelTimerForSleep = 0x56B, - WdfDevStatePwrPolStartedIdleCapableWaitForIdleTimeout = 0x56C, - WdfDevStatePwrPolDeviceD0PowerRequestFailed = 0x56D, - WdfDevStatePwrPolDevicePowerRequestFailed = 0x56E, - WdfDevStatePwrPolGotoDx = 0x56F, - WdfDevStatePwrPolGotoDxInDx = 0x570, - WdfDevStatePwrPolDx = 0x571, - WdfDevStatePwrPolGotoD0 = 0x572, - WdfDevStatePwrPolGotoD0InD0 = 0x573, - WdfDevStatePwrPolFinal = 0x574, - WdfDevStatePwrPolSleepingPowerDownNotProcessed = 0x575, - WdfDevStatePwrPolTimerExpiredWakeCapablePowerDownNotProcessed = 0x576, - WdfDevStatePwrPolTimerExpiredNoWakePowerDownNotProcessed = 0x577, - WdfDevStatePwrPolTimerExpiredNoWakePoweredDownDisableIdleTimer = 0x578, - WdfDevStatePwrPolStoppingWaitingForImplicitPowerDown = 0x579, - WdfDevStatePwrPolStoppingPoweringUp = 0x57A, - WdfDevStatePwrPolStoppingPoweringDown = 0x57B, - WdfDevStatePwrPolPowerUpForSystemSleepNotSeen = 0x57C, - WdfDevStatePwrPolWaitingArmedStoppingCancelUsbSS = 0x57D, - WdfDevStatePwrPolWaitingArmedWakeFailedCancelUsbSS = 0x57E, - WdfDevStatePwrPolWaitingArmedIoPresentCancelUsbSS = 0x57F, - WdfDevStatePwrPolWaitingArmedWakeSucceededCancelUsbSS = 0x580, - WdfDevStatePwrPolCancelingUsbSSForSystemSleep = 0x581, - WdfDevStatePwrPolStoppingD0CancelUsbSS = 0x582, - WdfDevStatePwrPolStartingPoweredUp = 0x583, - WdfDevStatePwrPolIdleCapableDeviceIdle = 0x584, - WdfDevStatePwrPolDeviceIdleReturnToActive = 0x585, - WdfDevStatePwrPolDeviceIdleSleeping = 0x586, - WdfDevStatePwrPolDeviceIdleStopping = 0x587, - WdfDevStatePwrPolTimerExpiredNoWakeUndoPowerDown = 0x588, - WdfDevStatePwrPolWakeCapableDeviceIdle = 0x589, - WdfDevStatePwrPolWakeCapableUsbSSCompleted = 0x58A, - WdfDevStatePwrPolTimerExpiredWakeCapableUndoPowerDown = 0x58B, - WdfDevStatePwrPolTimerExpiredWakeCompletedHardwareStarted = 0x58C, - WdfDevStatePwrPolStoppedRemoving = 0x58D, - WdfDevStatePwrPolRemoved = 0x58E, - WdfDevStatePwrPolRestarting = 0x58F, - WdfDevStatePwrPolRestartingFailed = 0x590, - WdfDevStatePwrPolStartingPoweredUpFailed = 0x591, - WdfDevStatePwrPolTimerExpiredNoWakeReturnToActive = 0x592, - WdfDevStatePwrPolWaitingArmedWakeInterruptFired = 0x593, - WdfDevStatePwrPolSystemWakeDeviceWakeInterruptFired = 0x594, - WdfDevStatePwrPolSystemWakeDeviceWakeInterruptFiredNP = 0x595 | WdfDevStateNP, - WdfDevStatePwrPolTimerExpiredWakeCapableWakeInterruptArrived = 0x596, - WdfDevStatePwrPolTimerExpiredWakeCapablePowerDownFailedWakeInterruptArrived = 0x597, - WdfDevStatePwrPolWaitingArmedWakeInterruptFiredDuringPowerDown = 0x598, - WdfDevStatePwrPolNull = 0x599, -} WDF_DEVICE_POWER_POLICY_STATE, *PWDF_DEVICE_POWER_POLICY_STATE; - - -// end_wpp - -typedef enum _WDF_STATE_NOTIFICATION_TYPE { - StateNotificationInvalid = 0x0000, - StateNotificationEnterState = 0x0001, - StateNotificationPostProcessState = 0x0002, - StateNotificationLeaveState = 0x0004, - StateNotificationAllStates = StateNotificationEnterState | StateNotificationPostProcessState | StateNotificationLeaveState, -} WDF_STATE_NOTIFICATION_TYPE; - - -typedef enum _WDF_POWER_POLICY_S0_IDLE_CAPABILITIES { - IdleCapsInvalid = 0, - IdleCannotWakeFromS0, - IdleCanWakeFromS0, - IdleUsbSelectiveSuspend, -} WDF_POWER_POLICY_S0_IDLE_CAPABILITIES; - - -typedef enum _WDF_POWER_POLICY_S0_IDLE_USER_CONTROL { - IdleUserControlInvalid = 0, - IdleDoNotAllowUserControl, - IdleAllowUserControl, -} WDF_POWER_POLICY_S0_IDLE_USER_CONTROL; - - -typedef enum _WDF_POWER_POLICY_IDLE_TIMEOUT_CONSTANTS { - IdleTimeoutDefaultConstant = 0, -} WDF_POWER_POLICY_IDLE_TIMEOUT_CONSTANTS; - - -typedef enum _WDF_POWER_POLICY_SX_WAKE_USER_CONTROL { - WakeUserControlInvalid = 0, - WakeDoNotAllowUserControl, - WakeAllowUserControl, -} WDF_POWER_POLICY_SX_WAKE_USER_CONTROL; - - -typedef enum _WDF_POWER_DEVICE_STATE { - WdfPowerDeviceInvalid = 0, - WdfPowerDeviceD0, - WdfPowerDeviceD1, - WdfPowerDeviceD2, - WdfPowerDeviceD3, - WdfPowerDeviceD3Final, - WdfPowerDevicePrepareForHibernation, - WdfPowerDeviceMaximum, -} WDF_POWER_DEVICE_STATE, *PWDF_POWER_DEVICE_STATE; - - -typedef enum _WDF_DEVICE_HWACCESS_TARGET_TYPE { - WdfDeviceHwAccessTargetTypeInvalid = 0, - WdfDeviceHwAccessTargetTypeRegister, - WdfDeviceHwAccessTargetTypeRegisterBuffer, - WdfDeviceHwAccessTargetTypePort, - WdfDeviceHwAccessTargetTypePortBuffer, - WdfDeviceHwAccessTargetTypeMaximum, -} WDF_DEVICE_HWACCESS_TARGET_TYPE, *PWDF_DEVICE_HWACCESS_TARGET_TYPE; - - -typedef enum _WDF_DEVICE_HWACCESS_TARGET_SIZE { - WdfDeviceHwAccessTargetSizeInvalid = 0, - WdfDeviceHwAccessTargetSizeUchar, - WdfDeviceHwAccessTargetSizeUshort, - WdfDeviceHwAccessTargetSizeUlong, - WdfDeviceHwAccessTargetSizeUlong64, - WdfDeviceHwAccessTargetSizeMaximum, -} WDF_DEVICE_HWACCESS_TARGET_SIZE, *PWDF_DEVICE_HWACCESS_TARGET_SIZE; - - -typedef enum _WDF_DISPATCH_IRP_TO_IO_QUEUE_FLAGS { - WDF_DISPATCH_IRP_TO_IO_QUEUE_NO_FLAGS = 0x00000000, - WDF_DISPATCH_IRP_TO_IO_QUEUE_INVOKE_INCALLERCTX_CALLBACK = 0x00000001, - WDF_DISPATCH_IRP_TO_IO_QUEUE_PREPROCESSED_IRP = 0x00000002, -} WDF_DISPATCH_IRP_TO_IO_QUEUE_FLAGS; - - -typedef enum _WDF_SPECIAL_FILE_TYPE { - WdfSpecialFileUndefined = 0, - WdfSpecialFilePaging = 1, - WdfSpecialFileHibernation, - WdfSpecialFileDump, - WdfSpecialFileBoot, - WdfSpecialFileMax, -} WDF_SPECIAL_FILE_TYPE, *PWDF_SPECIAL_FILE_TYPE; - - -typedef enum _WDF_DEVICE_IO_TYPE { - WdfDeviceIoUndefined = 0, - WdfDeviceIoNeither, - WdfDeviceIoBuffered, - WdfDeviceIoDirect, - WdfDeviceIoBufferedOrDirect = 4, -} WDF_DEVICE_IO_TYPE, *PWDF_DEVICE_IO_TYPE; - - -typedef enum _WDF_FILEOBJECT_CLASS { - WdfFileObjectInvalid = 0, - WdfFileObjectNotRequired = 1, - WdfFileObjectWdfCanUseFsContext = 2, - WdfFileObjectWdfCanUseFsContext2 = 3, - WdfFileObjectWdfCannotUseFsContexts = 4, - WdfFileObjectCanBeOptional = 0x80000000, -} WDF_FILEOBJECT_CLASS, *PWDF_FILEOBJECT_CLASS; - - -typedef enum _WDF_DEVICE_FAILED_ACTION { - WdfDeviceFailedUndefined = 0, - WdfDeviceFailedAttemptRestart, - WdfDeviceFailedNoRestart, -} WDF_DEVICE_FAILED_ACTION; - - -typedef enum _WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE { - WdfReleaseHardwareOrderOnFailureInvalid = 0, - WdfReleaseHardwareOrderOnFailureEarly, - WdfReleaseHardwareOrderOnFailureAfterDescendants, -} WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE, *PWDF_RELEASE_HARDWARE_ORDER_ON_FAILURE; - - -typedef enum _WDF_EVENT_TYPE { - WdfEventReserved = 0, - WdfEventBroadcast = 1, - WdfEventMaximum, -} WDF_EVENT_TYPE; - - - -#define WDF_S0_IDLE_ENABLED_VALUE_NAME L"IdleInWorkingState" -#define WDF_SX_WAKE_ENABLED_VALUE_NAME L"WakeFromSleepState" -#define WDF_S0_IDLE_DEFAULT_VALUE_NAME L"WdfDefaultIdleInWorkingState" -#define WDF_SX_WAKE_DEFAULT_VALUE_NAME L"WdfDefaultWakeFromSleepState" -// -// Declare empty definitions so that they may be referenced by -// routines before they are defined. -// -typedef enum _WDF_REQUEST_TYPE WDF_REQUEST_TYPE; - - -typedef -_Function_class_(EVT_WDF_DEVICE_FILE_CREATE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_FILE_CREATE( - _In_ - WDFDEVICE Device, - _In_ - WDFREQUEST Request, - _In_ - WDFFILEOBJECT FileObject - ); - -typedef EVT_WDF_DEVICE_FILE_CREATE *PFN_WDF_DEVICE_FILE_CREATE; - -typedef -_Function_class_(EVT_WDF_FILE_CLOSE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_FILE_CLOSE( - _In_ - WDFFILEOBJECT FileObject - ); - -typedef EVT_WDF_FILE_CLOSE *PFN_WDF_FILE_CLOSE; - -typedef -_Function_class_(EVT_WDF_FILE_CLEANUP) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_FILE_CLEANUP( - _In_ - WDFFILEOBJECT FileObject - ); - -typedef EVT_WDF_FILE_CLEANUP *PFN_WDF_FILE_CLEANUP; - -typedef struct _WDF_FILEOBJECT_CONFIG { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // Event callback for create requests - // - PFN_WDF_DEVICE_FILE_CREATE EvtDeviceFileCreate; - - // - // Event callback for close requests - // - PFN_WDF_FILE_CLOSE EvtFileClose; - - // - // Event callback for cleanup requests - // - PFN_WDF_FILE_CLEANUP EvtFileCleanup; - - // - // If WdfTrue, create/cleanup/close file object related requests will be - // sent down the stack. - // - // If WdfFalse, create/cleanup/close will be completed at this location in - // the device stack. - // - // If WdfDefault, behavior depends on device type - // FDO, PDO, Control: use the WdfFalse behavior - // Filter: use the WdfTrue behavior - // - WDF_TRI_STATE AutoForwardCleanupClose; - - // - // Specify whether framework should create WDFFILEOBJECT and also - // whether it can FsContexts fields in the WDM fileobject to store - // WDFFILEOBJECT so that it can avoid table look up and improve perf. - // - WDF_FILEOBJECT_CLASS FileObjectClass; - -} WDF_FILEOBJECT_CONFIG, *PWDF_FILEOBJECT_CONFIG; - -VOID -FORCEINLINE -WDF_FILEOBJECT_CONFIG_INIT( - _Out_ PWDF_FILEOBJECT_CONFIG FileEventCallbacks, - _In_opt_ PFN_WDF_DEVICE_FILE_CREATE EvtDeviceFileCreate, - _In_opt_ PFN_WDF_FILE_CLOSE EvtFileClose, - _In_opt_ PFN_WDF_FILE_CLEANUP EvtFileCleanup - ) -{ - FileEventCallbacks->Size = sizeof(WDF_FILEOBJECT_CONFIG); - - FileEventCallbacks->EvtDeviceFileCreate = EvtDeviceFileCreate; - FileEventCallbacks->EvtFileClose = EvtFileClose; - FileEventCallbacks->EvtFileCleanup = EvtFileCleanup; - - FileEventCallbacks->FileObjectClass = WdfFileObjectWdfCannotUseFsContexts; - FileEventCallbacks->AutoForwardCleanupClose = WdfUseDefault; -} - -typedef struct _WDF_DEVICE_PNP_NOTIFICATION_DATA { - // - // Type of data - // - WDF_STATE_NOTIFICATION_TYPE Type; - - union { - struct { - // - // The current state that is about to be exited - // - WDF_DEVICE_PNP_STATE CurrentState; - - // - // The new state that is about to be entered - // - WDF_DEVICE_PNP_STATE NewState; - } EnterState; - - struct { - // - // The current state - // - WDF_DEVICE_PNP_STATE CurrentState; - } PostProcessState; - - - struct { - // - // The current state that is about to be exitted - // - WDF_DEVICE_PNP_STATE CurrentState; - - // - // The state that is about to be entered - // - WDF_DEVICE_PNP_STATE NewState; - } LeaveState; - } Data; -} WDF_DEVICE_PNP_NOTIFICATION_DATA; - -typedef const WDF_DEVICE_PNP_NOTIFICATION_DATA* PCWDF_DEVICE_PNP_NOTIFICATION_DATA; - -typedef struct _WDF_DEVICE_POWER_NOTIFICATION_DATA { - // - // Type of data - // - WDF_STATE_NOTIFICATION_TYPE Type; - - union { - struct { - // - // The current state that is about to be exitted - // - WDF_DEVICE_POWER_STATE CurrentState; - - // - // The new state that is about to be entered - // - WDF_DEVICE_POWER_STATE NewState; - } EnterState; - - struct { - // - // The current state - // - WDF_DEVICE_POWER_STATE CurrentState; - } PostProcessState; - - - struct { - // - // The current state that is about to be exitted - // - WDF_DEVICE_POWER_STATE CurrentState; - - // - // The state that is about to be entered - // - WDF_DEVICE_POWER_STATE NewState; - } LeaveState; - } Data; -} WDF_DEVICE_POWER_NOTIFICATION_DATA; - -typedef const WDF_DEVICE_POWER_NOTIFICATION_DATA* PCWDF_DEVICE_POWER_NOTIFICATION_DATA; - -typedef struct _WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA { - // - // Type of data - // - WDF_STATE_NOTIFICATION_TYPE Type; - - union { - struct { - // - // The current state that is about to be exitted - // - WDF_DEVICE_POWER_POLICY_STATE CurrentState; - - // - // The new state that is about to be entered - // - WDF_DEVICE_POWER_POLICY_STATE NewState; - } EnterState; - - struct { - // - // The current state - // - WDF_DEVICE_POWER_POLICY_STATE CurrentState; - } PostProcessState; - - - struct { - // - // The current state that is about to be exitted - // - WDF_DEVICE_POWER_POLICY_STATE CurrentState; - - // - // The state that is about to be entered - // - WDF_DEVICE_POWER_POLICY_STATE NewState; - } LeaveState; - } Data; -} WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA; - -typedef const WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA* PCWDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA; - -typedef -_Function_class_(EVT_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION( - _In_ - WDFDEVICE Device, - _In_ - PCWDF_DEVICE_PNP_NOTIFICATION_DATA NotificationData - ); - -typedef EVT_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION *PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION; - -typedef -_Function_class_(EVT_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION( - _In_ - WDFDEVICE Device, - _In_ - PCWDF_DEVICE_POWER_NOTIFICATION_DATA NotificationData - ); - -typedef EVT_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION *PFN_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION; - -typedef -_Function_class_(EVT_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION( - _In_ - WDFDEVICE Device, - _In_ - PCWDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA NotificationData - ); - -typedef EVT_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION *PFN_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION; - -#define IdleTimeoutDefaultValue ((ULONG) IdleTimeoutDefaultConstant) - -typedef -_Function_class_(EVT_WDF_DEVICE_D0_ENTRY) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_D0_ENTRY( - _In_ - WDFDEVICE Device, - _In_ - WDF_POWER_DEVICE_STATE PreviousState - ); - -typedef EVT_WDF_DEVICE_D0_ENTRY *PFN_WDF_DEVICE_D0_ENTRY; - -typedef -_Function_class_(EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED( - _In_ - WDFDEVICE Device, - _In_ - WDF_POWER_DEVICE_STATE PreviousState - ); - -typedef EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED *PFN_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED; - -typedef -_Function_class_(EVT_WDF_DEVICE_D0_EXIT) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_D0_EXIT( - _In_ - WDFDEVICE Device, - _In_ - WDF_POWER_DEVICE_STATE TargetState - ); - -typedef EVT_WDF_DEVICE_D0_EXIT *PFN_WDF_DEVICE_D0_EXIT; - -typedef -_Function_class_(EVT_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED( - _In_ - WDFDEVICE Device, - _In_ - WDF_POWER_DEVICE_STATE TargetState - ); - -typedef EVT_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED *PFN_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED; - -typedef -_Function_class_(EVT_WDF_DEVICE_PREPARE_HARDWARE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_PREPARE_HARDWARE( - _In_ - WDFDEVICE Device, - _In_ - WDFCMRESLIST ResourcesRaw, - _In_ - WDFCMRESLIST ResourcesTranslated - ); - -typedef EVT_WDF_DEVICE_PREPARE_HARDWARE *PFN_WDF_DEVICE_PREPARE_HARDWARE; - -typedef -_Function_class_(EVT_WDF_DEVICE_RELEASE_HARDWARE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_RELEASE_HARDWARE( - _In_ - WDFDEVICE Device, - _In_ - WDFCMRESLIST ResourcesTranslated - ); - -typedef EVT_WDF_DEVICE_RELEASE_HARDWARE *PFN_WDF_DEVICE_RELEASE_HARDWARE; - -typedef -_Function_class_(EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP *PFN_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP; - -typedef -_Function_class_(EVT_WDF_DEVICE_SELF_MANAGED_IO_FLUSH) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_SELF_MANAGED_IO_FLUSH( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_SELF_MANAGED_IO_FLUSH *PFN_WDF_DEVICE_SELF_MANAGED_IO_FLUSH; - -typedef -_Function_class_(EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT *PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT; - -typedef -_Function_class_(EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND *PFN_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND; - -typedef -_Function_class_(EVT_WDF_DEVICE_SELF_MANAGED_IO_RESTART) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_SELF_MANAGED_IO_RESTART( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_SELF_MANAGED_IO_RESTART *PFN_WDF_DEVICE_SELF_MANAGED_IO_RESTART; - -typedef -_Function_class_(EVT_WDF_DEVICE_QUERY_STOP) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_QUERY_STOP( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_QUERY_STOP *PFN_WDF_DEVICE_QUERY_STOP; - -typedef -_Function_class_(EVT_WDF_DEVICE_QUERY_REMOVE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_QUERY_REMOVE( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_QUERY_REMOVE *PFN_WDF_DEVICE_QUERY_REMOVE; - -typedef -_Function_class_(EVT_WDF_DEVICE_SURPRISE_REMOVAL) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_SURPRISE_REMOVAL( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_SURPRISE_REMOVAL *PFN_WDF_DEVICE_SURPRISE_REMOVAL; - -typedef -_Function_class_(EVT_WDF_DEVICE_USAGE_NOTIFICATION) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_USAGE_NOTIFICATION( - _In_ - WDFDEVICE Device, - _In_ - WDF_SPECIAL_FILE_TYPE NotificationType, - _In_ - BOOLEAN IsInNotificationPath - ); - -typedef EVT_WDF_DEVICE_USAGE_NOTIFICATION *PFN_WDF_DEVICE_USAGE_NOTIFICATION; - -typedef -_Function_class_(EVT_WDF_DEVICE_USAGE_NOTIFICATION_EX) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_USAGE_NOTIFICATION_EX( - _In_ - WDFDEVICE Device, - _In_ - WDF_SPECIAL_FILE_TYPE NotificationType, - _In_ - BOOLEAN IsInNotificationPath - ); - -typedef EVT_WDF_DEVICE_USAGE_NOTIFICATION_EX *PFN_WDF_DEVICE_USAGE_NOTIFICATION_EX; - -typedef -_Function_class_(EVT_WDF_DEVICE_RELATIONS_QUERY) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_RELATIONS_QUERY( - _In_ - WDFDEVICE Device, - _In_ - DEVICE_RELATION_TYPE RelationType - ); - -typedef EVT_WDF_DEVICE_RELATIONS_QUERY *PFN_WDF_DEVICE_RELATIONS_QUERY; - -typedef -_Function_class_(EVT_WDF_DEVICE_ARM_WAKE_FROM_S0) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_ARM_WAKE_FROM_S0( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_ARM_WAKE_FROM_S0 *PFN_WDF_DEVICE_ARM_WAKE_FROM_S0; - -typedef -_Function_class_(EVT_WDF_DEVICE_ARM_WAKE_FROM_SX) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_ARM_WAKE_FROM_SX( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_ARM_WAKE_FROM_SX *PFN_WDF_DEVICE_ARM_WAKE_FROM_SX; - -typedef -_Function_class_(EVT_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON( - _In_ - WDFDEVICE Device, - _In_ - BOOLEAN DeviceWakeEnabled, - _In_ - BOOLEAN ChildrenArmedForWake - ); - -typedef EVT_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON *PFN_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON; - -typedef -_Function_class_(EVT_WDF_DEVICE_DISARM_WAKE_FROM_S0) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_DISARM_WAKE_FROM_S0( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_DISARM_WAKE_FROM_S0 *PFN_WDF_DEVICE_DISARM_WAKE_FROM_S0; - -typedef -_Function_class_(EVT_WDF_DEVICE_DISARM_WAKE_FROM_SX) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_DISARM_WAKE_FROM_SX( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_DISARM_WAKE_FROM_SX *PFN_WDF_DEVICE_DISARM_WAKE_FROM_SX; - -typedef -_Function_class_(EVT_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED *PFN_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED; - -typedef -_Function_class_(EVT_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED *PFN_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED; - -typedef struct _WDF_PNPPOWER_EVENT_CALLBACKS { - // - // Size of this structure in bytes - // - ULONG Size; - - PFN_WDF_DEVICE_D0_ENTRY EvtDeviceD0Entry; - PFN_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED EvtDeviceD0EntryPostInterruptsEnabled; - PFN_WDF_DEVICE_D0_EXIT EvtDeviceD0Exit; - PFN_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED EvtDeviceD0ExitPreInterruptsDisabled; - PFN_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware; - PFN_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware; - PFN_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP EvtDeviceSelfManagedIoCleanup; - PFN_WDF_DEVICE_SELF_MANAGED_IO_FLUSH EvtDeviceSelfManagedIoFlush; - PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT EvtDeviceSelfManagedIoInit; - PFN_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND EvtDeviceSelfManagedIoSuspend; - PFN_WDF_DEVICE_SELF_MANAGED_IO_RESTART EvtDeviceSelfManagedIoRestart; - PFN_WDF_DEVICE_SURPRISE_REMOVAL EvtDeviceSurpriseRemoval; - PFN_WDF_DEVICE_QUERY_REMOVE EvtDeviceQueryRemove; - PFN_WDF_DEVICE_QUERY_STOP EvtDeviceQueryStop; - PFN_WDF_DEVICE_USAGE_NOTIFICATION EvtDeviceUsageNotification; - PFN_WDF_DEVICE_RELATIONS_QUERY EvtDeviceRelationsQuery; - PFN_WDF_DEVICE_USAGE_NOTIFICATION_EX EvtDeviceUsageNotificationEx; -} WDF_PNPPOWER_EVENT_CALLBACKS, *PWDF_PNPPOWER_EVENT_CALLBACKS; - -typedef struct _WDF_POWER_POLICY_EVENT_CALLBACKS { - // - // Size of this structure in bytes - // - ULONG Size; - - PFN_WDF_DEVICE_ARM_WAKE_FROM_S0 EvtDeviceArmWakeFromS0; - PFN_WDF_DEVICE_DISARM_WAKE_FROM_S0 EvtDeviceDisarmWakeFromS0; - PFN_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED EvtDeviceWakeFromS0Triggered; - - PFN_WDF_DEVICE_ARM_WAKE_FROM_SX EvtDeviceArmWakeFromSx; - PFN_WDF_DEVICE_DISARM_WAKE_FROM_SX EvtDeviceDisarmWakeFromSx; - PFN_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED EvtDeviceWakeFromSxTriggered; - - PFN_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON EvtDeviceArmWakeFromSxWithReason; - -} WDF_POWER_POLICY_EVENT_CALLBACKS, *PWDF_POWER_POLICY_EVENT_CALLBACKS; - -VOID -FORCEINLINE -WDF_POWER_POLICY_EVENT_CALLBACKS_INIT( - _Out_ PWDF_POWER_POLICY_EVENT_CALLBACKS Callbacks - ) -{ - RtlZeroMemory(Callbacks, sizeof(WDF_POWER_POLICY_EVENT_CALLBACKS)); - - Callbacks->Size = sizeof(WDF_POWER_POLICY_EVENT_CALLBACKS); -} - -VOID -FORCEINLINE -WDF_PNPPOWER_EVENT_CALLBACKS_INIT( - _Out_ PWDF_PNPPOWER_EVENT_CALLBACKS Callbacks - ) -{ - RtlZeroMemory(Callbacks, sizeof(WDF_PNPPOWER_EVENT_CALLBACKS)); - Callbacks->Size = sizeof(WDF_PNPPOWER_EVENT_CALLBACKS); -} - - -ULONG -FORCEINLINE -WdfDevStateNormalize( - _In_ ULONG State - ) -{ - return State & ~WdfDevStateNP; -} - - -BOOLEAN -FORCEINLINE -WdfDevStateIsNP( - _In_ ULONG State - ) -{ - return (State & WdfDevStateNP) ? TRUE : FALSE; -} - -typedef enum _WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE { - DriverManagedIdleTimeout = 0, - SystemManagedIdleTimeout = 1, - SystemManagedIdleTimeoutWithHint = 2 -} WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE, *PWDF_POWER_POLICY_IDLE_TIMEOUT_TYPE; - -typedef struct _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // Indicates whether the device can wake itself up while the machine is in - // S0. - // - WDF_POWER_POLICY_S0_IDLE_CAPABILITIES IdleCaps; - - // - // The low power state in which the device will be placed when it is idled - // out while the machine is in S0. - // - DEVICE_POWER_STATE DxState; - - // - // Amount of time the device must be idle before idling out. Timeout is in - // milliseconds. - // - ULONG IdleTimeout; - - // - // Inidcates whether a user can control the idle policy of the device. - // By default, a user is allowed to change the policy. - // - WDF_POWER_POLICY_S0_IDLE_USER_CONTROL UserControlOfIdleSettings; - - // - // If WdfTrue, idling out while the machine is in S0 will be enabled. - // - // If WdfFalse, idling out will be disabled. - // - // If WdfUseDefault, the idling out will be enabled. If - // UserControlOfIdleSettings is set to IdleAllowUserControl, the user's - // settings will override the default. - // - WDF_TRI_STATE Enabled; - - // - // This field is applicable only when IdleCaps == IdleCannotWakeFromS0 - // If WdfTrue,device is powered up on System Wake even if device is idle - // If WdfFalse, device is not powered up on system wake if it is idle - // If WdfUseDefault, the behavior is same as WdfFalse - // - WDF_TRI_STATE PowerUpIdleDeviceOnSystemWake; - - // - // This field determines how the IdleTimeout field is used. - // - // If the value is DriverManagedIdleTimeout, then the idle timeout value - // is determined by the IdleTimeout field of this structure. - // - // If the value is SystemManagedIdleTimeout, then the timeout value is - // determined by the power framework (PoFx) on operating systems where - // the PoFx is available (i.e. Windows 8 and later). The IdleTimeout field - // is ignored on these operating systems. On operating systems where the - // PoFx is not available, the behavior is same as DriverManagedIdleTimeout. - // - // If the value is SystemManagedIdleTimeoutWithHint, then the timeout value - // is determined by the power framework (PoFx) on operating systems where - // the PoFx is available (i.e. Windows 8 and later). In addition, the value - // specified in the IdleTimeout field is provided as a hint to the PoFx in - // determining when the device should be allowed to enter a low-power state. - // Since it is only a hint, the actual duration after which the PoFx allows - // the device to enter a low-power state might be greater than or less than - // the IdleTimeout value. On operating systems where the PoFx is not - // available, the behavior is same as DriverManagedIdleTimeout. - // - WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE IdleTimeoutType; - - // - // This field forces the device to avoid idling in the D3cold power state. - // WDF will ensure, with help from the bus drivers, that the device will - // idle in a D-state that can successfully generate a wake signal, if - // necessary. If the client specifies that DxState == PowerDeviceD3, this - // setting allows the client to distinguish betwen D3hot and D3cold. If - // the client sets DxState == PowerDeviceMaximum, then WDF will pick the - // deepest idle state identified by the bus driver. If that deepest state - // is D3cold, this field allows the client to override that and choose - // D3hot. - // - // If WdfTrue, device will not use D3cold in S0. - // If WdfFalse, device will use D3cold in S0 if the ACPI firmware indicates - // that the device can enter that state, if DxState above does not - // specify some other D-state and, if the device is armed for - // wake, that it can generate its wake signal from D3cold. - // If WdfUseDefault, this setting will be derived from the driver's INF, - // specifically the presence or absence of the following two lines in - // the DDInstall.HW section: - // Include=machine.inf - // Needs=PciD3ColdSupported - // - WDF_TRI_STATE ExcludeD3Cold; - -} WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS, *PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS; - -VOID -FORCEINLINE -WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT( - _Out_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings, - _In_ WDF_POWER_POLICY_S0_IDLE_CAPABILITIES IdleCaps - ) -{ - RtlZeroMemory(Settings, sizeof(WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS)); - - Settings->Size = sizeof(WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS); - - Settings->IdleTimeout = IdleTimeoutDefaultValue; - Settings->UserControlOfIdleSettings = IdleAllowUserControl; - Settings->Enabled = WdfUseDefault; - Settings->PowerUpIdleDeviceOnSystemWake = WdfUseDefault; - Settings->IdleTimeoutType = DriverManagedIdleTimeout; - Settings->ExcludeD3Cold = WdfUseDefault; - - Settings->IdleCaps = IdleCaps; - - switch (IdleCaps) { - case IdleUsbSelectiveSuspend: - case IdleCanWakeFromS0: - Settings->DxState = PowerDeviceMaximum; - break; - - case IdleCannotWakeFromS0: - Settings->DxState = PowerDeviceD3; - break; - } -} - -typedef struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // The low power state in which the device will be placed when it is armed - // for wake from Sx. - // - DEVICE_POWER_STATE DxState; - - // - // Inidcates whether a user can control the idle policy of the device. - // By default, a user is allowed to change the policy. - // - WDF_POWER_POLICY_SX_WAKE_USER_CONTROL UserControlOfWakeSettings; - - // - // If WdfTrue, arming the device for wake while the machine is in Sx is - // enabled. - // - // If WdfFalse, arming the device for wake while the machine is in Sx is - // disabled. - // - // If WdfUseDefault, arming will be enabled. If UserControlOfWakeSettings - // is set to WakeAllowUserControl, the user's settings will override the - // default. - // - WDF_TRI_STATE Enabled; - - // - // If set to TRUE, arming the parent device can depend on whether there - // is atleast one child device armed for wake. - // - // If set to FALSE, arming of the parent device will be independent of - // whether any of the child devices are armed for wake. - // - BOOLEAN ArmForWakeIfChildrenAreArmedForWake; - - // - // Indicates that whenever the parent device completes the wake irp - // successfully, the status needs to be also propagated to the child - // devices. This helps in tracking which devices were responsible for - // waking the system. - // - BOOLEAN IndicateChildWakeOnParentWake; - -} WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS, *PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS; - -VOID -FORCEINLINE -WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT( - _Out_ PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings - ) -{ - RtlZeroMemory(Settings, sizeof(WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS)); - - Settings->Size = sizeof(WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS); - - Settings->Enabled = WdfUseDefault; - Settings->DxState = PowerDeviceMaximum; - Settings->UserControlOfWakeSettings = WakeAllowUserControl; -} - -typedef struct _WDF_DEVICE_STATE { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // If set to WdfTrue, the device will be disabled - // - WDF_TRI_STATE Disabled; - - // - // If set to WdfTrue, the device will not be displayed in device manager. - // Once hidden, the device cannot be unhidden. - // - WDF_TRI_STATE DontDisplayInUI; - - // - // If set to WdfTrue, the device is reporting itself as failed. If set - // in conjuction with ResourcesChanged to WdfTrue, the device will receive - // a PnP stop and then a new PnP start device. - // - WDF_TRI_STATE Failed; - - // - // If set to WdfTrue, the device cannot be subsequently disabled. - // - WDF_TRI_STATE NotDisableable; - - - // - // If set to WdfTrue, the device stack will be torn down. - // - WDF_TRI_STATE Removed; - - // - // If set to WdfTrue, the device will be sent another PnP start. If the - // Failed field is set to WdfTrue as well, a PnP stop will be sent before - // the start. - // - WDF_TRI_STATE ResourcesChanged; - -} WDF_DEVICE_STATE, *PWDF_DEVICE_STATE; - -VOID -FORCEINLINE -WDF_DEVICE_STATE_INIT( - _Out_ PWDF_DEVICE_STATE PnpDeviceState - ) -{ - RtlZeroMemory(PnpDeviceState, sizeof(WDF_DEVICE_STATE)); - - PnpDeviceState->Size = sizeof(WDF_DEVICE_STATE); - - // - // Initializes all of the fields to the WdfUseDefault enum value - // - PnpDeviceState->Disabled = WdfUseDefault; - PnpDeviceState->DontDisplayInUI = WdfUseDefault; - PnpDeviceState->Failed = WdfUseDefault; - PnpDeviceState->NotDisableable = WdfUseDefault; - PnpDeviceState->Removed = WdfUseDefault; - PnpDeviceState->ResourcesChanged = WdfUseDefault; -} - -typedef struct _WDF_DEVICE_PNP_CAPABILITIES { - // - // Size of the structure in bytes - // - ULONG Size; - - // - // NOTE: To mark a PDO as raw, call WdfPdoInitAssignRawDevice - // - - WDF_TRI_STATE LockSupported; - WDF_TRI_STATE EjectSupported; - WDF_TRI_STATE Removable; - WDF_TRI_STATE DockDevice; - WDF_TRI_STATE UniqueID; - WDF_TRI_STATE SilentInstall; - WDF_TRI_STATE SurpriseRemovalOK; - WDF_TRI_STATE HardwareDisabled; - WDF_TRI_STATE NoDisplayInUI; - - // - // Default values of -1 indicate not to set this value - // - ULONG Address; - ULONG UINumber; - -} WDF_DEVICE_PNP_CAPABILITIES, *PWDF_DEVICE_PNP_CAPABILITIES; - -VOID -FORCEINLINE -WDF_DEVICE_PNP_CAPABILITIES_INIT( - _Out_ PWDF_DEVICE_PNP_CAPABILITIES Caps - ) -{ - RtlZeroMemory(Caps, sizeof(WDF_DEVICE_PNP_CAPABILITIES)); - - Caps->Size = sizeof(WDF_DEVICE_PNP_CAPABILITIES); - - Caps->LockSupported = WdfUseDefault; - Caps->EjectSupported = WdfUseDefault; - Caps->Removable = WdfUseDefault; - Caps->DockDevice = WdfUseDefault; - Caps->UniqueID = WdfUseDefault; - Caps->SilentInstall = WdfUseDefault; - Caps->SurpriseRemovalOK = WdfUseDefault; - Caps->HardwareDisabled = WdfUseDefault; - Caps->NoDisplayInUI = WdfUseDefault; - - Caps->Address = (ULONG) -1; - Caps->UINumber = (ULONG) -1; -} - -typedef struct _WDF_DEVICE_POWER_CAPABILITIES { - // - // Size of the structure in bytes - // - ULONG Size; - - WDF_TRI_STATE DeviceD1; - WDF_TRI_STATE DeviceD2; - - WDF_TRI_STATE WakeFromD0; - WDF_TRI_STATE WakeFromD1; - WDF_TRI_STATE WakeFromD2; - WDF_TRI_STATE WakeFromD3; - - // - // Default value PowerDeviceMaximum indicates not to set this value - // - DEVICE_POWER_STATE DeviceState[PowerSystemMaximum]; - - // - // Default value PowerDeviceMaximum, PowerSystemMaximum indicates not to - // set this value. - // - DEVICE_POWER_STATE DeviceWake; - SYSTEM_POWER_STATE SystemWake; - - // - // Default values of -1 indicate not to set this value - // - ULONG D1Latency; - ULONG D2Latency; - ULONG D3Latency; - - // - // Ideal Dx state for the device to be put into when the machine moves into - // Sx and the device is not armed for wake. By default, the default will be - // placed into D3. If IdealDxStateForSx is lighter then - // DeviceState[Sx], then DeviceState[Sx] will be used as the Dx state. - // - DEVICE_POWER_STATE IdealDxStateForSx; - -} WDF_DEVICE_POWER_CAPABILITIES, *PWDF_DEVICE_POWER_CAPABILITIES; - -VOID -FORCEINLINE -WDF_DEVICE_POWER_CAPABILITIES_INIT( - _Out_ PWDF_DEVICE_POWER_CAPABILITIES Caps - ) -{ - ULONG i; - - RtlZeroMemory(Caps, sizeof(WDF_DEVICE_POWER_CAPABILITIES)); - - Caps->Size = sizeof(WDF_DEVICE_POWER_CAPABILITIES); - - Caps->DeviceD1 = WdfUseDefault; - Caps->DeviceD2 = WdfUseDefault; - - Caps->WakeFromD0 = WdfUseDefault; - Caps->WakeFromD1 = WdfUseDefault; - Caps->WakeFromD2 = WdfUseDefault; - Caps->WakeFromD3 = WdfUseDefault; - - for (i = 0; i < sizeof(Caps->DeviceState)/sizeof(Caps->DeviceState[1]); i++) { - Caps->DeviceState[i] = PowerDeviceMaximum; - } - - Caps->DeviceWake = PowerDeviceMaximum; - Caps->SystemWake = PowerSystemMaximum; - - Caps->D1Latency = (ULONG) -1; - Caps->D2Latency = (ULONG) -1; - Caps->D3Latency = (ULONG) -1; - - Caps->IdealDxStateForSx = PowerDeviceMaximum; -} - -typedef enum _WDF_REMOVE_LOCK_OPTIONS_FLAGS { - WDF_REMOVE_LOCK_OPTION_ACQUIRE_FOR_IO = 0x00000001 -} WDF_REMOVE_LOCK_OPTIONS_FLAGS; - -typedef struct _WDF_REMOVE_LOCK_OPTIONS { - // - // Size of the structure in bytes - // - ULONG Size; - - // - // Bit field combination of values from the WDF_REMOVE_LOCK_OPTIONS_FLAGS - // enumeration - // - ULONG Flags; -} WDF_REMOVE_LOCK_OPTIONS, *PWDF_REMOVE_LOCK_OPTIONS; - - -// -// Default remove lock options initialization macro -// -VOID -FORCEINLINE -WDF_REMOVE_LOCK_OPTIONS_INIT( - _Out_ PWDF_REMOVE_LOCK_OPTIONS RemoveLockOptions, - _In_ ULONG Flags - ) -{ - RtlZeroMemory(RemoveLockOptions, sizeof(WDF_REMOVE_LOCK_OPTIONS)); - - RemoveLockOptions->Size = sizeof(WDF_REMOVE_LOCK_OPTIONS); - RemoveLockOptions->Flags = Flags; -} - -typedef -_Function_class_(EVT_WDFDEVICE_WDM_IRP_PREPROCESS) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -EVT_WDFDEVICE_WDM_IRP_PREPROCESS( - _In_ - WDFDEVICE Device, - _Inout_ - PIRP Irp - ); - -typedef EVT_WDFDEVICE_WDM_IRP_PREPROCESS *PFN_WDFDEVICE_WDM_IRP_PREPROCESS; - -typedef -_Function_class_(EVT_WDFDEVICE_WDM_IRP_DISPATCH) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -EVT_WDFDEVICE_WDM_IRP_DISPATCH( - _In_ - WDFDEVICE Device, - _In_ - UCHAR MajorFunction, - _In_ - UCHAR MinorFunction, - _In_ - ULONG Code, - _In_ - WDFCONTEXT DriverContext, - _Inout_ - PIRP Irp, - _In_ - WDFCONTEXT DispatchContext - ); - -typedef EVT_WDFDEVICE_WDM_IRP_DISPATCH *PFN_WDFDEVICE_WDM_IRP_DISPATCH; - -// -// This is called to pre-process a request using METHOD_NEITHER -// -typedef -_Function_class_(EVT_WDF_IO_IN_CALLER_CONTEXT) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_IO_IN_CALLER_CONTEXT( - _In_ - WDFDEVICE Device, - _In_ - WDFREQUEST Request - ); - -typedef EVT_WDF_IO_IN_CALLER_CONTEXT *PFN_WDF_IO_IN_CALLER_CONTEXT; - -typedef -_Function_class_(EVT_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE( - _In_ - WDFDEVICE Device, - _In_ - POHANDLE PoHandle - ); - -typedef EVT_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE *PFN_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE; - -typedef -_Function_class_(EVT_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE( - _In_ - WDFDEVICE Device, - _In_ - POHANDLE PoHandle - ); - -typedef EVT_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE *PFN_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE; - -typedef struct _WDF_POWER_FRAMEWORK_SETTINGS { - // - // Size of the structure, in bytes. - // - ULONG Size; - - // - // Client driver's callback function that is invoked after KMDF has - // registered with the power framework. This field can be NULL if the - // client driver does not wish to specify this callback. - // - PFN_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE EvtDeviceWdmPostPoFxRegisterDevice; - - // - // Client driver's callback function that is invoked before KMDF - // unregisters with the power framework. This field can be NULL if the - // client driver does not wish to specify this callback. - // - PFN_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE EvtDeviceWdmPrePoFxUnregisterDevice; - - // - // Pointer to a PO_FX_COMPONENT structure that describes the only component - // in the single-component device. This field can be NULL if the client - // driver wants KMDF to use the default specification for this component - // (i.e. support for F0 only). - // - PPO_FX_COMPONENT Component; - - // - // Client driver's PO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK callback - // function. This field can be NULL if the client driver does not wish to - // specify this callback. - // - PPO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK ComponentActiveConditionCallback; - - // - // Client driver's PO_FX_COMPONENT_IDLE_CONDITION_CALLBACK callback - // function. This field can be NULL if the client driver does not wish to - // specify this callback. - // - PPO_FX_COMPONENT_IDLE_CONDITION_CALLBACK ComponentIdleConditionCallback; - - // - // Client driver's PO_FX_COMPONENT_IDLE_STATE_CALLBACK callback function. - // This field can be NULL if the client driver does not wish to specify - // this callback. - // - PPO_FX_COMPONENT_IDLE_STATE_CALLBACK ComponentIdleStateCallback; - - // - // Client driver's PO_FX_POWER_CONTROL_CALLBACK callback function. This - // field can be NULL if the client driver does not wish to specify this - // callback. - // - PPO_FX_POWER_CONTROL_CALLBACK PowerControlCallback; - - // - // Context value that is passed in to the ComponentIdleStateCallback and - // PowerControlCallback callback functions. - // - PVOID PoFxDeviceContext; -} WDF_POWER_FRAMEWORK_SETTINGS, *PWDF_POWER_FRAMEWORK_SETTINGS; - -VOID -FORCEINLINE -WDF_POWER_FRAMEWORK_SETTINGS_INIT( - _Out_ PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings - ) -{ - RtlZeroMemory(PowerFrameworkSettings, - sizeof(WDF_POWER_FRAMEWORK_SETTINGS)); - PowerFrameworkSettings->Size = sizeof(WDF_POWER_FRAMEWORK_SETTINGS); -} - - -typedef struct _WDF_IO_TYPE_CONFIG { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // - // Identifies the method that the driver will use to access data buffers - // that it receives for read and write requests. - // - // - // Identifies the method that the driver will "prefer" to use to access data - // buffers that it receives for read and write requests. Note that UMDF - // driver provides just a preference, and not a guarantee.Therefore, - // even if a driver specified direct access method, UMDF might use the - // buffered access method for one or more of the device's requests to - // improve performance. For example, UMDF uses buffered access for small - // buffers, if it can copy the data to the driver's buffer faster than it - // can map the buffers for direct access. - // - WDF_DEVICE_IO_TYPE ReadWriteIoType; - - // - // - // Identifies the method that the driver will "prefer" to use to access data - // buffers that it receives for IOCTL requests. Note that UMDF - // driver provides just a preference, and not a guarantee. Therefore, - // even if a driver specified direct access method, UMDF might use the - // buffered access method for one or more of the device's requests to - // improve performance. For example, UMDF uses buffered access for small - // buffers, if it can copy the data to the driver's buffer faster than it - // can map the buffers for direct access. - // - WDF_DEVICE_IO_TYPE DeviceControlIoType; - - // - // - // Optional, Provides the smallest buffer size (in bytes) for which - // UMDF will use direct access for the buffers. For example, set - // DirectTransferThreshold to "12288" to indicate that UMDF should use buffered - // access for all buffers that are smaller than 12 kilobytes, and direct - // access for buffers equal to or greater than that. Typically, you - // do not need to provide this value because UMDF uses a value that provides - // the best performance. Note that there are other requirements that must be - // met in order to get direct access of buffers. See Docs for details. - // - ULONG DirectTransferThreshold; - -} WDF_IO_TYPE_CONFIG, *PWDF_IO_TYPE_CONFIG; - -VOID -FORCEINLINE -WDF_IO_TYPE_CONFIG_INIT( - _Out_ PWDF_IO_TYPE_CONFIG IoTypeConfig - ) -{ - RtlZeroMemory(IoTypeConfig, sizeof(WDF_IO_TYPE_CONFIG)); - IoTypeConfig->Size = sizeof(WDF_IO_TYPE_CONFIG); - IoTypeConfig->ReadWriteIoType = WdfDeviceIoBuffered; - IoTypeConfig->DeviceControlIoType = WdfDeviceIoBuffered; -} - - - -typedef struct _WDF_DEVICE_INTERFACE_PROPERTY_DATA { - _In_ ULONG Size; - - // - // A pointer to a GUID that identifies the device interface class. - // - _In_ const GUID * InterfaceClassGUID; - - // - // A pointer to a UNICODE_STRING structure that describes a reference - // string for the device interface. This parameter is optional and can - // be NULL. - _In_opt_ PCUNICODE_STRING ReferenceString; - - // - // A pointer to a DEVPROPKEY structure that specifies the device - // property key. - // - _In_ const DEVPROPKEY * PropertyKey; - - // - // A locale identifier. Set this parameter either to a language-specific - // LCID value or to LOCALE_NEUTRAL. The LOCALE_NEUTRAL LCID specifies - // that the property is language-neutral (that is, not specific to any - // language). Do not set this parameter to LOCALE_SYSTEM_DEFAULT or - // LOCALE_USER_DEFAULT. For more information about language-specific - // LCID values, see LCID Structure. - // - _In_ LCID Lcid; - - // - // Set this parameter to PLUGPLAY_PROPERTY_PERSISTENT if the property - // value set by this routine should persist across computer restarts. - // Otherwise, set Flags to zero. Ignored for Query DDIs. - // - _In_ ULONG Flags; - -} WDF_DEVICE_INTERFACE_PROPERTY_DATA, *PWDF_DEVICE_INTERFACE_PROPERTY_DATA; - -FORCEINLINE -VOID -WDF_DEVICE_INTERFACE_PROPERTY_DATA_INIT ( - _In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData, - _In_ const GUID* InterfaceClassGUID, - _In_ const DEVPROPKEY* PropertyKey - ) -{ - RtlZeroMemory(PropertyData, sizeof(* PropertyData)); - - PropertyData->Size = sizeof(*PropertyData); - PropertyData->InterfaceClassGUID = InterfaceClassGUID; - PropertyData->PropertyKey = PropertyKey; -} - - - -typedef struct _WDF_DEVICE_PROPERTY_DATA { - // - // Size of this structure - // - _In_ ULONG Size; - - // - // A pointer to a DEVPROPKEY structure that specifies the device - // property key. - // - _In_ const DEVPROPKEY * PropertyKey; - - // - // A locale identifier. Set this parameter either to a language-specific - // LCID value or to LOCALE_NEUTRAL. The LOCALE_NEUTRAL LCID specifies - // that the property is language-neutral (that is, not specific to any - // language). Do not set this parameter to LOCALE_SYSTEM_DEFAULT or - // LOCALE_USER_DEFAULT. For more information about language-specific - // LCID values, see LCID Structure. - // - _In_ LCID Lcid; - - // - // Set this parameter to PLUGPLAY_PROPERTY_PERSISTENT if the property - // value set by this routine should persist across computer restarts. - // Otherwise, set Flags to zero. Ignored for Query DDIs. - // - _In_ ULONG Flags; - -} WDF_DEVICE_PROPERTY_DATA, *PWDF_DEVICE_PROPERTY_DATA; - -FORCEINLINE -VOID -WDF_DEVICE_PROPERTY_DATA_INIT ( - _Out_ PWDF_DEVICE_PROPERTY_DATA PropertyData, - _In_ const DEVPROPKEY* PropertyKey - ) -{ - RtlZeroMemory(PropertyData, sizeof(* PropertyData)); - - PropertyData->Size = sizeof(*PropertyData); - PropertyData->PropertyKey = PropertyKey; -} - -// -// VOID -// WdfDeviceStopIdle( -// _In_ WDFDEVICE Device, -// _In_ BOOLEAN WaitForD0 -// ); -// -// VOID -// WdfDeviceStopIdleWithTag( -// _In_ WDFDEVICE Device, -// _In_ BOOLEAN WaitForD0, -// _In_ PVOID Tag -// ); -// -// VOID -// WdfDeviceResumeIdle( -// _In_ WDFDEVICE Device -// ); -// -// VOID -// WdfDeviceResumeIdleWithTag( -// _In_ WDFDEVICE Device -// _In_ PVOID Tag -// ); -// -#define WdfDeviceStopIdle(Device, WaitForD0) \ - WdfDeviceStopIdleWithTag(Device, WaitForD0, NULL) - -#define WdfDeviceStopIdleWithTag(Device, WaitForD0, Tag) \ - WdfDeviceStopIdleActual(Device, WaitForD0, Tag, __LINE__, __FILE__) - -#define WdfDeviceResumeIdle(Device) \ - WdfDeviceResumeIdleWithTag(Device, NULL) - -#define WdfDeviceResumeIdleWithTag(Device, Tag) \ - WdfDeviceResumeIdleActual(Device, Tag, __LINE__, __FILE__) - - -// -// WDF Function: WdfDeviceGetDeviceState -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEGETDEVICESTATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _Out_ - PWDF_DEVICE_STATE DeviceState - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceGetDeviceState( - _In_ - WDFDEVICE Device, - _Out_ - PWDF_DEVICE_STATE DeviceState - ) -{ - ((PFN_WDFDEVICEGETDEVICESTATE) WdfFunctions[WdfDeviceGetDeviceStateTableIndex])(WdfDriverGlobals, Device, DeviceState); -} - - -// -// WDF Function: WdfDeviceSetDeviceState -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICESETDEVICESTATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_STATE DeviceState - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceSetDeviceState( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_STATE DeviceState - ) -{ - ((PFN_WDFDEVICESETDEVICESTATE) WdfFunctions[WdfDeviceSetDeviceStateTableIndex])(WdfDriverGlobals, Device, DeviceState); -} - - -// -// WDF Function: WdfDeviceGetDriver -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFDRIVER -(*PFN_WDFDEVICEGETDRIVER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFDRIVER -FORCEINLINE -WdfDeviceGetDriver( - _In_ - WDFDEVICE Device - ) -{ - return ((PFN_WDFDEVICEGETDRIVER) WdfFunctions[WdfDeviceGetDriverTableIndex])(WdfDriverGlobals, Device); -} - - -// -// WDF Function: WdfDeviceGetIoTarget -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFIOTARGET -(*PFN_WDFDEVICEGETIOTARGET)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFIOTARGET -FORCEINLINE -WdfDeviceGetIoTarget( - _In_ - WDFDEVICE Device - ) -{ - return ((PFN_WDFDEVICEGETIOTARGET) WdfFunctions[WdfDeviceGetIoTargetTableIndex])(WdfDriverGlobals, Device); -} - - -// -// WDF Function: WdfDeviceAssignS0IdleSettings -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEASSIGNS0IDLESETTINGS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceAssignS0IdleSettings( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings - ) -{ - return ((PFN_WDFDEVICEASSIGNS0IDLESETTINGS) WdfFunctions[WdfDeviceAssignS0IdleSettingsTableIndex])(WdfDriverGlobals, Device, Settings); -} - - -// -// WDF Function: WdfDeviceAssignSxWakeSettings -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEASSIGNSXWAKESETTINGS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceAssignSxWakeSettings( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings - ) -{ - return ((PFN_WDFDEVICEASSIGNSXWAKESETTINGS) WdfFunctions[WdfDeviceAssignSxWakeSettingsTableIndex])(WdfDriverGlobals, Device, Settings); -} - - -// -// WDF Function: WdfDeviceOpenRegistryKey -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEOPENREGISTRYKEY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - ULONG DeviceInstanceKeyType, - _In_ - ACCESS_MASK DesiredAccess, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceOpenRegistryKey( - _In_ - WDFDEVICE Device, - _In_ - ULONG DeviceInstanceKeyType, - _In_ - ACCESS_MASK DesiredAccess, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ) -{ - return ((PFN_WDFDEVICEOPENREGISTRYKEY) WdfFunctions[WdfDeviceOpenRegistryKeyTableIndex])(WdfDriverGlobals, Device, DeviceInstanceKeyType, DesiredAccess, KeyAttributes, Key); -} - - -// -// WDF Function: WdfDeviceOpenDevicemapKey -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEOPENDEVICEMAPKEY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PCUNICODE_STRING KeyName, - _In_ - ACCESS_MASK DesiredAccess, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceOpenDevicemapKey( - _In_ - WDFDEVICE Device, - _In_ - PCUNICODE_STRING KeyName, - _In_ - ACCESS_MASK DesiredAccess, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ) -{ - return ((PFN_WDFDEVICEOPENDEVICEMAPKEY) WdfFunctions[WdfDeviceOpenDevicemapKeyTableIndex])(WdfDriverGlobals, Device, KeyName, DesiredAccess, KeyAttributes, Key); -} - - -// -// WDF Function: WdfDeviceInitSetPnpPowerEventCallbacks -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEINITSETPNPPOWEREVENTCALLBACKS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceInitSetPnpPowerEventCallbacks( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks - ) -{ - ((PFN_WDFDEVICEINITSETPNPPOWEREVENTCALLBACKS) WdfFunctions[WdfDeviceInitSetPnpPowerEventCallbacksTableIndex])(WdfDriverGlobals, DeviceInit, PnpPowerEventCallbacks); -} - - -// -// WDF Function: WdfDeviceInitSetPowerPolicyEventCallbacks -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEINITSETPOWERPOLICYEVENTCALLBACKS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_POWER_POLICY_EVENT_CALLBACKS PowerPolicyEventCallbacks - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceInitSetPowerPolicyEventCallbacks( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_POWER_POLICY_EVENT_CALLBACKS PowerPolicyEventCallbacks - ) -{ - ((PFN_WDFDEVICEINITSETPOWERPOLICYEVENTCALLBACKS) WdfFunctions[WdfDeviceInitSetPowerPolicyEventCallbacksTableIndex])(WdfDriverGlobals, DeviceInit, PowerPolicyEventCallbacks); -} - - -// -// WDF Function: WdfDeviceInitSetPowerPolicyOwnership -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEINITSETPOWERPOLICYOWNERSHIP)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - BOOLEAN IsPowerPolicyOwner - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceInitSetPowerPolicyOwnership( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - BOOLEAN IsPowerPolicyOwner - ) -{ - ((PFN_WDFDEVICEINITSETPOWERPOLICYOWNERSHIP) WdfFunctions[WdfDeviceInitSetPowerPolicyOwnershipTableIndex])(WdfDriverGlobals, DeviceInit, IsPowerPolicyOwner); -} - - -// -// WDF Function: WdfDeviceInitSetIoType -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEINITSETIOTYPE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - WDF_DEVICE_IO_TYPE IoType - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceInitSetIoType( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - WDF_DEVICE_IO_TYPE IoType - ) -{ - ((PFN_WDFDEVICEINITSETIOTYPE) WdfFunctions[WdfDeviceInitSetIoTypeTableIndex])(WdfDriverGlobals, DeviceInit, IoType); -} - - -// -// WDF Function: WdfDeviceInitSetFileObjectConfig -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEINITSETFILEOBJECTCONFIG)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_FILEOBJECT_CONFIG FileObjectConfig, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES FileObjectAttributes - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceInitSetFileObjectConfig( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_FILEOBJECT_CONFIG FileObjectConfig, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES FileObjectAttributes - ) -{ - ((PFN_WDFDEVICEINITSETFILEOBJECTCONFIG) WdfFunctions[WdfDeviceInitSetFileObjectConfigTableIndex])(WdfDriverGlobals, DeviceInit, FileObjectConfig, FileObjectAttributes); -} - - -// -// WDF Function: WdfDeviceInitSetRequestAttributes -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEINITSETREQUESTATTRIBUTES)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_OBJECT_ATTRIBUTES RequestAttributes - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceInitSetRequestAttributes( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_OBJECT_ATTRIBUTES RequestAttributes - ) -{ - ((PFN_WDFDEVICEINITSETREQUESTATTRIBUTES) WdfFunctions[WdfDeviceInitSetRequestAttributesTableIndex])(WdfDriverGlobals, DeviceInit, RequestAttributes); -} - - -// -// WDF Function: WdfDeviceCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICECREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _Inout_ - PWDFDEVICE_INIT* DeviceInit, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES DeviceAttributes, - _Out_ - WDFDEVICE* Device - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceCreate( - _Inout_ - PWDFDEVICE_INIT* DeviceInit, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES DeviceAttributes, - _Out_ - WDFDEVICE* Device - ) -{ - return ((PFN_WDFDEVICECREATE) WdfFunctions[WdfDeviceCreateTableIndex])(WdfDriverGlobals, DeviceInit, DeviceAttributes, Device); -} - - -// -// WDF Function: WdfDeviceSetStaticStopRemove -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICESETSTATICSTOPREMOVE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - BOOLEAN Stoppable - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceSetStaticStopRemove( - _In_ - WDFDEVICE Device, - _In_ - BOOLEAN Stoppable - ) -{ - ((PFN_WDFDEVICESETSTATICSTOPREMOVE) WdfFunctions[WdfDeviceSetStaticStopRemoveTableIndex])(WdfDriverGlobals, Device, Stoppable); -} - - -// -// WDF Function: WdfDeviceCreateDeviceInterface -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICECREATEDEVICEINTERFACE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - CONST GUID* InterfaceClassGUID, - _In_opt_ - PCUNICODE_STRING ReferenceString - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceCreateDeviceInterface( - _In_ - WDFDEVICE Device, - _In_ - CONST GUID* InterfaceClassGUID, - _In_opt_ - PCUNICODE_STRING ReferenceString - ) -{ - return ((PFN_WDFDEVICECREATEDEVICEINTERFACE) WdfFunctions[WdfDeviceCreateDeviceInterfaceTableIndex])(WdfDriverGlobals, Device, InterfaceClassGUID, ReferenceString); -} - - -// -// WDF Function: WdfDeviceSetDeviceInterfaceState -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICESETDEVICEINTERFACESTATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - CONST GUID* InterfaceClassGUID, - _In_opt_ - PCUNICODE_STRING ReferenceString, - _In_ - BOOLEAN IsInterfaceEnabled - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfDeviceSetDeviceInterfaceState( - _In_ - WDFDEVICE Device, - _In_ - CONST GUID* InterfaceClassGUID, - _In_opt_ - PCUNICODE_STRING ReferenceString, - _In_ - BOOLEAN IsInterfaceEnabled - ) -{ - ((PFN_WDFDEVICESETDEVICEINTERFACESTATE) WdfFunctions[WdfDeviceSetDeviceInterfaceStateTableIndex])(WdfDriverGlobals, Device, InterfaceClassGUID, ReferenceString, IsInterfaceEnabled); -} - - -// -// WDF Function: WdfDeviceRetrieveDeviceInterfaceString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICERETRIEVEDEVICEINTERFACESTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - CONST GUID* InterfaceClassGUID, - _In_opt_ - PCUNICODE_STRING ReferenceString, - _In_ - WDFSTRING String - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceRetrieveDeviceInterfaceString( - _In_ - WDFDEVICE Device, - _In_ - CONST GUID* InterfaceClassGUID, - _In_opt_ - PCUNICODE_STRING ReferenceString, - _In_ - WDFSTRING String - ) -{ - return ((PFN_WDFDEVICERETRIEVEDEVICEINTERFACESTRING) WdfFunctions[WdfDeviceRetrieveDeviceInterfaceStringTableIndex])(WdfDriverGlobals, Device, InterfaceClassGUID, ReferenceString, String); -} - - -// -// WDF Function: WdfDeviceCreateSymbolicLink -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICECREATESYMBOLICLINK)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PCUNICODE_STRING SymbolicLinkName - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceCreateSymbolicLink( - _In_ - WDFDEVICE Device, - _In_ - PCUNICODE_STRING SymbolicLinkName - ) -{ - return ((PFN_WDFDEVICECREATESYMBOLICLINK) WdfFunctions[WdfDeviceCreateSymbolicLinkTableIndex])(WdfDriverGlobals, Device, SymbolicLinkName); -} - - -// -// WDF Function: WdfDeviceQueryProperty -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEQUERYPROPERTY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - DEVICE_REGISTRY_PROPERTY DeviceProperty, - _In_ - ULONG BufferLength, - _Out_writes_bytes_all_(BufferLength) - PVOID PropertyBuffer, - _Out_ - PULONG ResultLength - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceQueryProperty( - _In_ - WDFDEVICE Device, - _In_ - DEVICE_REGISTRY_PROPERTY DeviceProperty, - _In_ - ULONG BufferLength, - _Out_writes_bytes_all_(BufferLength) - PVOID PropertyBuffer, - _Out_ - PULONG ResultLength - ) -{ - return ((PFN_WDFDEVICEQUERYPROPERTY) WdfFunctions[WdfDeviceQueryPropertyTableIndex])(WdfDriverGlobals, Device, DeviceProperty, BufferLength, PropertyBuffer, ResultLength); -} - - -// -// WDF Function: WdfDeviceAllocAndQueryProperty -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEALLOCANDQUERYPROPERTY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - DEVICE_REGISTRY_PROPERTY DeviceProperty, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, - _Out_ - WDFMEMORY* PropertyMemory - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceAllocAndQueryProperty( - _In_ - WDFDEVICE Device, - _In_ - DEVICE_REGISTRY_PROPERTY DeviceProperty, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, - _Out_ - WDFMEMORY* PropertyMemory - ) -{ - return ((PFN_WDFDEVICEALLOCANDQUERYPROPERTY) WdfFunctions[WdfDeviceAllocAndQueryPropertyTableIndex])(WdfDriverGlobals, Device, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory); -} - - -// -// WDF Function: WdfDeviceSetPnpCapabilities -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICESETPNPCAPABILITIES)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_PNP_CAPABILITIES PnpCapabilities - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceSetPnpCapabilities( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_PNP_CAPABILITIES PnpCapabilities - ) -{ - ((PFN_WDFDEVICESETPNPCAPABILITIES) WdfFunctions[WdfDeviceSetPnpCapabilitiesTableIndex])(WdfDriverGlobals, Device, PnpCapabilities); -} - - -// -// WDF Function: WdfDeviceSetPowerCapabilities -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICESETPOWERCAPABILITIES)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_POWER_CAPABILITIES PowerCapabilities - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceSetPowerCapabilities( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_POWER_CAPABILITIES PowerCapabilities - ) -{ - ((PFN_WDFDEVICESETPOWERCAPABILITIES) WdfFunctions[WdfDeviceSetPowerCapabilitiesTableIndex])(WdfDriverGlobals, Device, PowerCapabilities); -} - - -// -// WDF Function: WdfDeviceSetFailed -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICESETFAILED)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - WDF_DEVICE_FAILED_ACTION FailedAction - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceSetFailed( - _In_ - WDFDEVICE Device, - _In_ - WDF_DEVICE_FAILED_ACTION FailedAction - ) -{ - ((PFN_WDFDEVICESETFAILED) WdfFunctions[WdfDeviceSetFailedTableIndex])(WdfDriverGlobals, Device, FailedAction); -} - - -// -// WDF Function: WdfDeviceStopIdleNoTrack -// -typedef -_Must_inspect_result_ -_When_(WaitForD0 == 0, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(WaitForD0 != 0, _IRQL_requires_max_(PASSIVE_LEVEL)) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICESTOPIDLENOTRACK)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - BOOLEAN WaitForD0 - ); - -_Must_inspect_result_ -_When_(WaitForD0 == 0, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(WaitForD0 != 0, _IRQL_requires_max_(PASSIVE_LEVEL)) -NTSTATUS -FORCEINLINE -WdfDeviceStopIdleNoTrack( - _In_ - WDFDEVICE Device, - _In_ - BOOLEAN WaitForD0 - ) -{ - return ((PFN_WDFDEVICESTOPIDLENOTRACK) WdfFunctions[WdfDeviceStopIdleNoTrackTableIndex])(WdfDriverGlobals, Device, WaitForD0); -} - - -// -// WDF Function: WdfDeviceResumeIdleNoTrack -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICERESUMEIDLENOTRACK)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceResumeIdleNoTrack( - _In_ - WDFDEVICE Device - ) -{ - ((PFN_WDFDEVICERESUMEIDLENOTRACK) WdfFunctions[WdfDeviceResumeIdleNoTrackTableIndex])(WdfDriverGlobals, Device); -} - - -// -// WDF Function: WdfDeviceStopIdleActual -// -typedef -_Must_inspect_result_ -_When_(WaitForD0 == 0, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(WaitForD0 != 0, _IRQL_requires_max_(PASSIVE_LEVEL)) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICESTOPIDLEACTUAL)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - BOOLEAN WaitForD0, - _In_opt_ - PVOID Tag, - _In_ - LONG Line, - _In_z_ - PCHAR File - ); - -_Must_inspect_result_ -_When_(WaitForD0 == 0, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(WaitForD0 != 0, _IRQL_requires_max_(PASSIVE_LEVEL)) -NTSTATUS -FORCEINLINE -WdfDeviceStopIdleActual( - _In_ - WDFDEVICE Device, - _In_ - BOOLEAN WaitForD0, - _In_opt_ - PVOID Tag, - _In_ - LONG Line, - _In_z_ - PCHAR File - ) -{ - return ((PFN_WDFDEVICESTOPIDLEACTUAL) WdfFunctions[WdfDeviceStopIdleActualTableIndex])(WdfDriverGlobals, Device, WaitForD0, Tag, Line, File); -} - - -// -// WDF Function: WdfDeviceResumeIdleActual -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICERESUMEIDLEACTUAL)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_opt_ - PVOID Tag, - _In_ - LONG Line, - _In_z_ - PCHAR File - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceResumeIdleActual( - _In_ - WDFDEVICE Device, - _In_opt_ - PVOID Tag, - _In_ - LONG Line, - _In_z_ - PCHAR File - ) -{ - ((PFN_WDFDEVICERESUMEIDLEACTUAL) WdfFunctions[WdfDeviceResumeIdleActualTableIndex])(WdfDriverGlobals, Device, Tag, Line, File); -} - - -// -// WDF Function: WdfDeviceGetFileObject -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFFILEOBJECT -(*PFN_WDFDEVICEGETFILEOBJECT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PFILE_OBJECT FileObject - ); - - - -// -// WDF Function: WdfDeviceGetDefaultQueue -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFQUEUE -(*PFN_WDFDEVICEGETDEFAULTQUEUE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFQUEUE -FORCEINLINE -WdfDeviceGetDefaultQueue( - _In_ - WDFDEVICE Device - ) -{ - return ((PFN_WDFDEVICEGETDEFAULTQUEUE) WdfFunctions[WdfDeviceGetDefaultQueueTableIndex])(WdfDriverGlobals, Device); -} - - -// -// WDF Function: WdfDeviceConfigureRequestDispatching -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICECONFIGUREREQUESTDISPATCHING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - WDFQUEUE Queue, - _In_ - _Strict_type_match_ - WDF_REQUEST_TYPE RequestType - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceConfigureRequestDispatching( - _In_ - WDFDEVICE Device, - _In_ - WDFQUEUE Queue, - _In_ - _Strict_type_match_ - WDF_REQUEST_TYPE RequestType - ) -{ - return ((PFN_WDFDEVICECONFIGUREREQUESTDISPATCHING) WdfFunctions[WdfDeviceConfigureRequestDispatchingTableIndex])(WdfDriverGlobals, Device, Queue, RequestType); -} - - -// -// WDF Function: WdfDeviceGetSystemPowerAction -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -POWER_ACTION -(*PFN_WDFDEVICEGETSYSTEMPOWERACTION)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -POWER_ACTION -FORCEINLINE -WdfDeviceGetSystemPowerAction( - _In_ - WDFDEVICE Device - ) -{ - return ((PFN_WDFDEVICEGETSYSTEMPOWERACTION) WdfFunctions[WdfDeviceGetSystemPowerActionTableIndex])(WdfDriverGlobals, Device); -} - - -// -// WDF Function: WdfDeviceInitSetReleaseHardwareOrderOnFailure -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEINITSETRELEASEHARDWAREORDERONFAILURE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE ReleaseHardwareOrderOnFailure - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfDeviceInitSetReleaseHardwareOrderOnFailure( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE ReleaseHardwareOrderOnFailure - ) -{ - ((PFN_WDFDEVICEINITSETRELEASEHARDWAREORDERONFAILURE) WdfFunctions[WdfDeviceInitSetReleaseHardwareOrderOnFailureTableIndex])(WdfDriverGlobals, DeviceInit, ReleaseHardwareOrderOnFailure); -} - - -// -// WDF Function: WdfDeviceInitSetIoTypeEx -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEINITSETIOTYPEEX)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_IO_TYPE_CONFIG IoTypeConfig - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfDeviceInitSetIoTypeEx( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_IO_TYPE_CONFIG IoTypeConfig - ) -{ - ((PFN_WDFDEVICEINITSETIOTYPEEX) WdfFunctions[WdfDeviceInitSetIoTypeExTableIndex])(WdfDriverGlobals, DeviceInit, IoTypeConfig); -} - - -// -// WDF Function: WdfDevicePostEvent -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEPOSTEVENT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - REFGUID EventGuid, - _In_ - WDF_EVENT_TYPE WdfEventType, - _In_reads_bytes_(DataSizeCb) - BYTE* Data, - _In_ - ULONG DataSizeCb - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDevicePostEvent( - _In_ - WDFDEVICE Device, - _In_ - REFGUID EventGuid, - _In_ - WDF_EVENT_TYPE WdfEventType, - _In_reads_bytes_(DataSizeCb) - BYTE* Data, - _In_ - ULONG DataSizeCb - ) -{ - return ((PFN_WDFDEVICEPOSTEVENT) WdfFunctions[WdfDevicePostEventTableIndex])(WdfDriverGlobals, Device, EventGuid, WdfEventType, Data, DataSizeCb); -} - - -// -// WDF Function: WdfDeviceMapIoSpace -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEMAPIOSPACE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PHYSICAL_ADDRESS PhysicalAddress, - _In_ - SIZE_T NumberOfBytes, - _In_ - MEMORY_CACHING_TYPE CacheType, - _Out_ - PVOID* PseudoBaseAddress - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceMapIoSpace( - _In_ - WDFDEVICE Device, - _In_ - PHYSICAL_ADDRESS PhysicalAddress, - _In_ - SIZE_T NumberOfBytes, - _In_ - MEMORY_CACHING_TYPE CacheType, - _Out_ - PVOID* PseudoBaseAddress - ) -{ - return ((PFN_WDFDEVICEMAPIOSPACE) WdfFunctions[WdfDeviceMapIoSpaceTableIndex])(WdfDriverGlobals, Device, PhysicalAddress, NumberOfBytes, CacheType, PseudoBaseAddress); -} - - -// -// WDF Function: WdfDeviceUnmapIoSpace -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEUNMAPIOSPACE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PVOID PseudoBaseAddress, - _In_ - SIZE_T NumberOfBytes - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfDeviceUnmapIoSpace( - _In_ - WDFDEVICE Device, - _In_ - PVOID PseudoBaseAddress, - _In_ - SIZE_T NumberOfBytes - ) -{ - ((PFN_WDFDEVICEUNMAPIOSPACE) WdfFunctions[WdfDeviceUnmapIoSpaceTableIndex])(WdfDriverGlobals, Device, PseudoBaseAddress, NumberOfBytes); -} - - -// -// WDF Function: WdfDeviceGetHardwareRegisterMappedAddress -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -PVOID -(*PFN_WDFDEVICEGETHARDWAREREGISTERMAPPEDADDRESS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PVOID PseudoBaseAddress - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -PVOID -FORCEINLINE -WdfDeviceGetHardwareRegisterMappedAddress( - _In_ - WDFDEVICE Device, - _In_ - PVOID PseudoBaseAddress - ) -{ - return ((PFN_WDFDEVICEGETHARDWAREREGISTERMAPPEDADDRESS) WdfFunctions[WdfDeviceGetHardwareRegisterMappedAddressTableIndex])(WdfDriverGlobals, Device, PseudoBaseAddress); -} - - -// -// WDF Function: WdfDeviceReadFromHardware -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -SIZE_T -(*PFN_WDFDEVICEREADFROMHARDWARE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - WDF_DEVICE_HWACCESS_TARGET_TYPE Type, - _In_ - WDF_DEVICE_HWACCESS_TARGET_SIZE Size, - _In_ - PVOID TargetAddress, - _Out_writes_all_opt_(Count) - PVOID Buffer, - _In_opt_ - ULONG Count - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -SIZE_T -FORCEINLINE -WdfDeviceReadFromHardware( - _In_ - WDFDEVICE Device, - _In_ - WDF_DEVICE_HWACCESS_TARGET_TYPE Type, - _In_ - WDF_DEVICE_HWACCESS_TARGET_SIZE Size, - _In_ - PVOID TargetAddress, - _Out_writes_all_opt_(Count) - PVOID Buffer, - _In_opt_ - ULONG Count - ) -{ - return ((PFN_WDFDEVICEREADFROMHARDWARE) WdfFunctions[WdfDeviceReadFromHardwareTableIndex])(WdfDriverGlobals, Device, Type, Size, TargetAddress, Buffer, Count); -} - - -// -// WDF Function: WdfDeviceWriteToHardware -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEWRITETOHARDWARE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - WDF_DEVICE_HWACCESS_TARGET_TYPE Type, - _In_ - WDF_DEVICE_HWACCESS_TARGET_SIZE Size, - _In_ - PVOID TargetAddress, - _In_ - SIZE_T Value, - _In_reads_opt_(Count) - PVOID Buffer, - _In_opt_ - ULONG Count - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfDeviceWriteToHardware( - _In_ - WDFDEVICE Device, - _In_ - WDF_DEVICE_HWACCESS_TARGET_TYPE Type, - _In_ - WDF_DEVICE_HWACCESS_TARGET_SIZE Size, - _In_ - PVOID TargetAddress, - _In_ - SIZE_T Value, - _In_reads_opt_(Count) - PVOID Buffer, - _In_opt_ - ULONG Count - ) -{ - ((PFN_WDFDEVICEWRITETOHARDWARE) WdfFunctions[WdfDeviceWriteToHardwareTableIndex])(WdfDriverGlobals, Device, Type, Size, TargetAddress, Value, Buffer, Count); -} - - -// -// WDF Function: WdfDeviceAssignInterfaceProperty -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEASSIGNINTERFACEPROPERTY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData, - _In_ - DEVPROPTYPE Type, - _In_ - ULONG BufferLength, - _In_reads_bytes_opt_(BufferLength) - PVOID PropertyBuffer - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceAssignInterfaceProperty( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData, - _In_ - DEVPROPTYPE Type, - _In_ - ULONG BufferLength, - _In_reads_bytes_opt_(BufferLength) - PVOID PropertyBuffer - ) -{ - return ((PFN_WDFDEVICEASSIGNINTERFACEPROPERTY) WdfFunctions[WdfDeviceAssignInterfacePropertyTableIndex])(WdfDriverGlobals, Device, PropertyData, Type, BufferLength, PropertyBuffer); -} - - -// -// WDF Function: WdfDeviceAllocAndQueryInterfaceProperty -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEALLOCANDQUERYINTERFACEPROPERTY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData, - _In_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, - _Out_ - WDFMEMORY* PropertyMemory, - _Out_ - PDEVPROPTYPE Type - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceAllocAndQueryInterfaceProperty( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData, - _In_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, - _Out_ - WDFMEMORY* PropertyMemory, - _Out_ - PDEVPROPTYPE Type - ) -{ - return ((PFN_WDFDEVICEALLOCANDQUERYINTERFACEPROPERTY) WdfFunctions[WdfDeviceAllocAndQueryInterfacePropertyTableIndex])(WdfDriverGlobals, Device, PropertyData, PoolType, PropertyMemoryAttributes, PropertyMemory, Type); -} - - -// -// WDF Function: WdfDeviceQueryInterfaceProperty -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEQUERYINTERFACEPROPERTY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData, - _In_ - ULONG BufferLength, - _Out_writes_bytes_opt_(BufferLength) - PVOID PropertyBuffer, - _Out_ - PULONG ResultLength, - _Out_ - PDEVPROPTYPE Type - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceQueryInterfaceProperty( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData, - _In_ - ULONG BufferLength, - _Out_writes_bytes_opt_(BufferLength) - PVOID PropertyBuffer, - _Out_ - PULONG ResultLength, - _Out_ - PDEVPROPTYPE Type - ) -{ - return ((PFN_WDFDEVICEQUERYINTERFACEPROPERTY) WdfFunctions[WdfDeviceQueryInterfacePropertyTableIndex])(WdfDriverGlobals, Device, PropertyData, BufferLength, PropertyBuffer, ResultLength, Type); -} - - -// -// WDF Function: WdfDeviceGetDeviceStackIoType -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFDEVICEGETDEVICESTACKIOTYPE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _Out_ - WDF_DEVICE_IO_TYPE* ReadWriteIoType, - _Out_ - WDF_DEVICE_IO_TYPE* IoControlIoType - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfDeviceGetDeviceStackIoType( - _In_ - WDFDEVICE Device, - _Out_ - WDF_DEVICE_IO_TYPE* ReadWriteIoType, - _Out_ - WDF_DEVICE_IO_TYPE* IoControlIoType - ) -{ - ((PFN_WDFDEVICEGETDEVICESTACKIOTYPE) WdfFunctions[WdfDeviceGetDeviceStackIoTypeTableIndex])(WdfDriverGlobals, Device, ReadWriteIoType, IoControlIoType); -} - - -// -// WDF Function: WdfDeviceQueryPropertyEx -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(APC_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEQUERYPROPERTYEX)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_PROPERTY_DATA DeviceProperty, - _In_ - ULONG BufferLength, - _Out_ - PVOID PropertyBuffer, - _Out_ - PULONG RequiredSize, - _Out_ - PDEVPROPTYPE Type - ); - -_Must_inspect_result_ -_IRQL_requires_max_(APC_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceQueryPropertyEx( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_PROPERTY_DATA DeviceProperty, - _In_ - ULONG BufferLength, - _Out_ - PVOID PropertyBuffer, - _Out_ - PULONG RequiredSize, - _Out_ - PDEVPROPTYPE Type - ) -{ - return ((PFN_WDFDEVICEQUERYPROPERTYEX) WdfFunctions[WdfDeviceQueryPropertyExTableIndex])(WdfDriverGlobals, Device, DeviceProperty, BufferLength, PropertyBuffer, RequiredSize, Type); -} - - -// -// WDF Function: WdfDeviceAllocAndQueryPropertyEx -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(APC_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEALLOCANDQUERYPROPERTYEX)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_PROPERTY_DATA DeviceProperty, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, - _Out_ - WDFMEMORY* PropertyMemory, - _Out_ - PDEVPROPTYPE Type - ); - -_Must_inspect_result_ -_IRQL_requires_max_(APC_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceAllocAndQueryPropertyEx( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_PROPERTY_DATA DeviceProperty, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, - _Out_ - WDFMEMORY* PropertyMemory, - _Out_ - PDEVPROPTYPE Type - ) -{ - return ((PFN_WDFDEVICEALLOCANDQUERYPROPERTYEX) WdfFunctions[WdfDeviceAllocAndQueryPropertyExTableIndex])(WdfDriverGlobals, Device, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory, Type); -} - - -// -// WDF Function: WdfDeviceAssignProperty -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(APC_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDEVICEASSIGNPROPERTY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_PROPERTY_DATA DeviceProperty, - _In_ - DEVPROPTYPE Type, - _In_ - ULONG Size, - _In_opt_ - PVOID Data - ); - -_Must_inspect_result_ -_IRQL_requires_max_(APC_LEVEL) -NTSTATUS -FORCEINLINE -WdfDeviceAssignProperty( - _In_ - WDFDEVICE Device, - _In_ - PWDF_DEVICE_PROPERTY_DATA DeviceProperty, - _In_ - DEVPROPTYPE Type, - _In_ - ULONG Size, - _In_opt_ - PVOID Data - ) -{ - return ((PFN_WDFDEVICEASSIGNPROPERTY) WdfFunctions[WdfDeviceAssignPropertyTableIndex])(WdfDriverGlobals, Device, DeviceProperty, Type, Size, Data); -} - -WDF_EXTERN_C_END - - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfdriver.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfdriver.h deleted file mode 100644 index dd97b30..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfdriver.h +++ /dev/null @@ -1,357 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfdriver.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef enum _WDF_DRIVER_INIT_FLAGS { - WdfDriverInitNonPnpDriver = 0x00000001, // If set, no Add Device routine is assigned. - WdfDriverInitNoDispatchOverride = 0x00000002, // Useful for miniports. - WdfVerifyOn = 0x00000004, // Controls whether WDFVERIFY macros are live. - WdfVerifierOn = 0x00000008, // Top level verififer flag. -} WDF_DRIVER_INIT_FLAGS; - - -#define WDF_TRACE_ID ('TRAC') - -// -// Callbacks for FxDriver -// - -typedef -_Function_class_(EVT_WDF_DRIVER_DEVICE_ADD) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DRIVER_DEVICE_ADD( - _In_ - WDFDRIVER Driver, - _Inout_ - PWDFDEVICE_INIT DeviceInit - ); - -typedef EVT_WDF_DRIVER_DEVICE_ADD *PFN_WDF_DRIVER_DEVICE_ADD; - -typedef -_Function_class_(EVT_WDF_DRIVER_UNLOAD) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DRIVER_UNLOAD( - _In_ - WDFDRIVER Driver - ); - -typedef EVT_WDF_DRIVER_UNLOAD *PFN_WDF_DRIVER_UNLOAD; - - -// -// Used by WPP Tracing (modeled after WPP's WppTraceCallback (in km-init.tpl)) -// -typedef -_Function_class_(EVT_WDF_TRACE_CALLBACK) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_TRACE_CALLBACK( - _In_ - UCHAR minorFunction, - _In_opt_ - PVOID dataPath, - _In_ - ULONG bufferLength, - _Inout_updates_bytes_(bufferLength) - PVOID buffer, - _In_ - PVOID context, - _Out_ - PULONG size - ); - -typedef EVT_WDF_TRACE_CALLBACK *PFN_WDF_TRACE_CALLBACK; - -typedef struct _WDF_DRIVER_CONFIG { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // Event callbacks - // - PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd; - - PFN_WDF_DRIVER_UNLOAD EvtDriverUnload; - - // - // Combination of WDF_DRIVER_INIT_FLAGS values - // - ULONG DriverInitFlags; - - // - // Pool tag to use for all allocations made by the framework on behalf of - // the client driver. - // - ULONG DriverPoolTag; - -} WDF_DRIVER_CONFIG, *PWDF_DRIVER_CONFIG; - -VOID -FORCEINLINE -WDF_DRIVER_CONFIG_INIT( - _Out_ PWDF_DRIVER_CONFIG Config, - _In_opt_ PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd - ) -{ - RtlZeroMemory(Config, sizeof(WDF_DRIVER_CONFIG)); - - Config->Size = sizeof(WDF_DRIVER_CONFIG); - Config->EvtDriverDeviceAdd = EvtDriverDeviceAdd; -} - -typedef struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS { - // - // Size of the structure in bytes - // - ULONG Size; - - // - // Major Version requested - // - ULONG MajorVersion; - - // - // Minor Version requested - // - ULONG MinorVersion; - -} WDF_DRIVER_VERSION_AVAILABLE_PARAMS, *PWDF_DRIVER_VERSION_AVAILABLE_PARAMS; - -VOID -FORCEINLINE -WDF_DRIVER_VERSION_AVAILABLE_PARAMS_INIT( - _Out_ PWDF_DRIVER_VERSION_AVAILABLE_PARAMS Params, - _In_ ULONG MajorVersion, - _In_ ULONG MinorVersion - ) -{ - RtlZeroMemory(Params, sizeof(WDF_DRIVER_VERSION_AVAILABLE_PARAMS)); - - Params->Size = sizeof(WDF_DRIVER_VERSION_AVAILABLE_PARAMS); - Params->MajorVersion = MajorVersion; - Params->MinorVersion = MinorVersion; -} - -WDFDRIVER -FORCEINLINE -WdfGetDriver( - VOID - ) -{ - return WdfDriverGlobals->Driver; -} - -// -// WDF Function: WdfDriverCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDRIVERCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PDRIVER_OBJECT DriverObject, - _In_ - PCUNICODE_STRING RegistryPath, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES DriverAttributes, - _In_ - PWDF_DRIVER_CONFIG DriverConfig, - _Out_opt_ - WDFDRIVER* Driver - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDriverCreate( - _In_ - PDRIVER_OBJECT DriverObject, - _In_ - PCUNICODE_STRING RegistryPath, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES DriverAttributes, - _In_ - PWDF_DRIVER_CONFIG DriverConfig, - _Out_opt_ - WDFDRIVER* Driver - ) -{ - return ((PFN_WDFDRIVERCREATE) WdfFunctions[WdfDriverCreateTableIndex])(WdfDriverGlobals, DriverObject, RegistryPath, DriverAttributes, DriverConfig, Driver); -} - - -// -// WDF Function: WdfDriverGetRegistryPath -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -PWSTR -(*PFN_WDFDRIVERGETREGISTRYPATH)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDRIVER Driver - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -PWSTR -FORCEINLINE -WdfDriverGetRegistryPath( - _In_ - WDFDRIVER Driver - ) -{ - return ((PFN_WDFDRIVERGETREGISTRYPATH) WdfFunctions[WdfDriverGetRegistryPathTableIndex])(WdfDriverGlobals, Driver); -} - - -// -// WDF Function: WdfDriverOpenParametersRegistryKey -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDRIVEROPENPARAMETERSREGISTRYKEY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDRIVER Driver, - _In_ - ACCESS_MASK DesiredAccess, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDriverOpenParametersRegistryKey( - _In_ - WDFDRIVER Driver, - _In_ - ACCESS_MASK DesiredAccess, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ) -{ - return ((PFN_WDFDRIVEROPENPARAMETERSREGISTRYKEY) WdfFunctions[WdfDriverOpenParametersRegistryKeyTableIndex])(WdfDriverGlobals, Driver, DesiredAccess, KeyAttributes, Key); -} - - -// -// WDF Function: WdfDriverRetrieveVersionString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFDRIVERRETRIEVEVERSIONSTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDRIVER Driver, - _In_ - WDFSTRING String - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfDriverRetrieveVersionString( - _In_ - WDFDRIVER Driver, - _In_ - WDFSTRING String - ) -{ - return ((PFN_WDFDRIVERRETRIEVEVERSIONSTRING) WdfFunctions[WdfDriverRetrieveVersionStringTableIndex])(WdfDriverGlobals, Driver, String); -} - - -// -// WDF Function: WdfDriverIsVersionAvailable -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFDRIVERISVERSIONAVAILABLE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDRIVER Driver, - _In_ - PWDF_DRIVER_VERSION_AVAILABLE_PARAMS VersionAvailableParams - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -BOOLEAN -FORCEINLINE -WdfDriverIsVersionAvailable( - _In_ - WDFDRIVER Driver, - _In_ - PWDF_DRIVER_VERSION_AVAILABLE_PARAMS VersionAvailableParams - ) -{ - return ((PFN_WDFDRIVERISVERSIONAVAILABLE) WdfFunctions[WdfDriverIsVersionAvailableTableIndex])(WdfDriverGlobals, Driver, VersionAvailableParams); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffdo.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffdo.h deleted file mode 100644 index 22596f5..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffdo.h +++ /dev/null @@ -1,349 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdffdo.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef -_Function_class_(EVT_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS( - _In_ - WDFDEVICE Device, - _In_ - WDFIORESREQLIST IoResourceRequirementsList - ); - -typedef EVT_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS *PFN_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS; - -typedef -_Function_class_(EVT_WDF_DEVICE_REMOVE_ADDED_RESOURCES) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_REMOVE_ADDED_RESOURCES( - _In_ - WDFDEVICE Device, - _In_ - WDFCMRESLIST ResourcesRaw, - _In_ - WDFCMRESLIST ResourcesTranslated - ); - -typedef EVT_WDF_DEVICE_REMOVE_ADDED_RESOURCES *PFN_WDF_DEVICE_REMOVE_ADDED_RESOURCES; - -typedef struct _WDF_FDO_EVENT_CALLBACKS { - // - // Size of this structure in bytes - // - ULONG Size; - - PFN_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS EvtDeviceFilterAddResourceRequirements; - - PFN_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS EvtDeviceFilterRemoveResourceRequirements; - - PFN_WDF_DEVICE_REMOVE_ADDED_RESOURCES EvtDeviceRemoveAddedResources; - -} WDF_FDO_EVENT_CALLBACKS, *PWDF_FDO_EVENT_CALLBACKS; - -VOID -FORCEINLINE -WDF_FDO_EVENT_CALLBACKS_INIT( - _Out_ PWDF_FDO_EVENT_CALLBACKS Callbacks - ) -{ - RtlZeroMemory(Callbacks, sizeof(WDF_FDO_EVENT_CALLBACKS)); - Callbacks->Size = sizeof(WDF_FDO_EVENT_CALLBACKS); -} - - -// -// WDF Function: WdfFdoInitOpenRegistryKey -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFFDOINITOPENREGISTRYKEY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - ULONG DeviceInstanceKeyType, - _In_ - ACCESS_MASK DesiredAccess, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfFdoInitOpenRegistryKey( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - ULONG DeviceInstanceKeyType, - _In_ - ACCESS_MASK DesiredAccess, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ) -{ - return ((PFN_WDFFDOINITOPENREGISTRYKEY) WdfFunctions[WdfFdoInitOpenRegistryKeyTableIndex])(WdfDriverGlobals, DeviceInit, DeviceInstanceKeyType, DesiredAccess, KeyAttributes, Key); -} - - -// -// WDF Function: WdfFdoInitQueryProperty -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFFDOINITQUERYPROPERTY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - DEVICE_REGISTRY_PROPERTY DeviceProperty, - _In_ - ULONG BufferLength, - _Out_writes_bytes_all_opt_(BufferLength) - PVOID PropertyBuffer, - _Out_ - PULONG ResultLength - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfFdoInitQueryProperty( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - DEVICE_REGISTRY_PROPERTY DeviceProperty, - _In_ - ULONG BufferLength, - _Out_writes_bytes_all_opt_(BufferLength) - PVOID PropertyBuffer, - _Out_ - PULONG ResultLength - ) -{ - return ((PFN_WDFFDOINITQUERYPROPERTY) WdfFunctions[WdfFdoInitQueryPropertyTableIndex])(WdfDriverGlobals, DeviceInit, DeviceProperty, BufferLength, PropertyBuffer, ResultLength); -} - - -// -// WDF Function: WdfFdoInitAllocAndQueryProperty -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFFDOINITALLOCANDQUERYPROPERTY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - DEVICE_REGISTRY_PROPERTY DeviceProperty, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, - _Out_ - WDFMEMORY* PropertyMemory - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfFdoInitAllocAndQueryProperty( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - DEVICE_REGISTRY_PROPERTY DeviceProperty, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, - _Out_ - WDFMEMORY* PropertyMemory - ) -{ - return ((PFN_WDFFDOINITALLOCANDQUERYPROPERTY) WdfFunctions[WdfFdoInitAllocAndQueryPropertyTableIndex])(WdfDriverGlobals, DeviceInit, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory); -} - - -// -// WDF Function: WdfFdoInitQueryPropertyEx -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFFDOINITQUERYPROPERTYEX)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_DEVICE_PROPERTY_DATA DeviceProperty, - _In_ - ULONG BufferLength, - _Out_ - PVOID PropertyBuffer, - _Out_ - PULONG ResultLength, - _Out_ - PDEVPROPTYPE Type - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfFdoInitQueryPropertyEx( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_DEVICE_PROPERTY_DATA DeviceProperty, - _In_ - ULONG BufferLength, - _Out_ - PVOID PropertyBuffer, - _Out_ - PULONG ResultLength, - _Out_ - PDEVPROPTYPE Type - ) -{ - return ((PFN_WDFFDOINITQUERYPROPERTYEX) WdfFunctions[WdfFdoInitQueryPropertyExTableIndex])(WdfDriverGlobals, DeviceInit, DeviceProperty, BufferLength, PropertyBuffer, ResultLength, Type); -} - - -// -// WDF Function: WdfFdoInitAllocAndQueryPropertyEx -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFFDOINITALLOCANDQUERYPROPERTYEX)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_DEVICE_PROPERTY_DATA DeviceProperty, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, - _Out_ - WDFMEMORY* PropertyMemory, - _Out_ - PDEVPROPTYPE Type - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfFdoInitAllocAndQueryPropertyEx( - _In_ - PWDFDEVICE_INIT DeviceInit, - _In_ - PWDF_DEVICE_PROPERTY_DATA DeviceProperty, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, - _Out_ - WDFMEMORY* PropertyMemory, - _Out_ - PDEVPROPTYPE Type - ) -{ - return ((PFN_WDFFDOINITALLOCANDQUERYPROPERTYEX) WdfFunctions[WdfFdoInitAllocAndQueryPropertyExTableIndex])(WdfDriverGlobals, DeviceInit, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory, Type); -} - - -// -// WDF Function: WdfFdoInitSetFilter -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFFDOINITSETFILTER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDFDEVICE_INIT DeviceInit - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfFdoInitSetFilter( - _In_ - PWDFDEVICE_INIT DeviceInit - ) -{ - ((PFN_WDFFDOINITSETFILTER) WdfFunctions[WdfFdoInitSetFilterTableIndex])(WdfDriverGlobals, DeviceInit); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffileobject.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffileobject.h deleted file mode 100644 index 63dcaa8..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffileobject.h +++ /dev/null @@ -1,197 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdffileobject.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef enum _WDF_FILE_INFORMATION_CLASS { - WdfFileInformationDirectory = 1, - WdfFileInformationFullDirectory, // 2 - WdfFileInformationBothDirectory, // 3 - WdfFileInformationBasic, // 4 - WdfFileInformationStandard, // 5 - WdfFileInformationInternal, // 6 - WdfFileInformationEa, // 7 - WdfFileInformationAccess, // 8 - WdfFileInformationName, // 9 - WdfFileInformationRename, // 10 - WdfFileInformationLink, // 11 - WdfFileInformationNames, // 12 - WdfFileInformationDisposition, // 13 - WdfFileInformationPosition, // 14 - WdfFileInformationFullEa, // 15 - WdfFileInformationMode, // 16 - WdfFileInformationAlignment, // 17 - WdfFileInformationAll, // 18 - WdfFileInformationAllocation, // 19 - WdfFileInformationEndOfFile, // 20 - WdfFileInformationAlternateName, // 21 - WdfFileInformationStream, // 22 - WdfFileInformationPipe, // 23 - WdfFileInformationPipeLocal, // 24 - WdfFileInformationPipeRemote, // 25 - WdfFileInformationMailslotQuery, // 26 - WdfFileInformationMailslotSet, // 27 - WdfFileInformationCompression, // 28 - WdfFileInformationObjectId, // 29 - WdfFileInformationCompletion, // 30 - WdfFileInformationMoveCluster, // 31 - WdfFileInformationQuota, // 32 - WdfFileInformationReparsePoint, // 33 - WdfFileInformationNetworkOpen, // 34 - WdfFileInformationAttributeTag, // 35 - WdfFileInformationTracking, // 36 - WdfFileInformationIdBothDirectory, // 37 - WdfFileInformationIdFullDirectory, // 38 - WdfFileInformationValidDataLength, // 39 - WdfFileInformationShortName, // 40 - WdfFileInformationIoCompletionNotification, // 41 - WdfFileInformationIoStatusBlockRange, // 42 - WdfFileInformationIoPriorityHint, // 43 - WdfFileInformationSfioReserve, // 44 - WdfFileInformationSfioVolume, // 45 - WdfFileInformationHardLink, // 46 - WdfFileInformationProcessIdsUsingFile, // 47 - WdfFileInformationNormalizedName, // 48 - WdfFileInformationNetworkPhysicalName, // 49 - WdfFileInformationIdGlobalTxDirectory, // 50 - WdfFileInformationIsRemoteDevice, // 51 - WdfFileInformationAttributeCache, // 52 - WdfFileInformationMaximum, -} WDF_FILE_INFORMATION_CLASS, *PWDF_FILE_INFORMATION_CLASS; - - -// -// WDF Function: WdfFileObjectGetFileName -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -PUNICODE_STRING -(*PFN_WDFFILEOBJECTGETFILENAME)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFFILEOBJECT FileObject - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -PUNICODE_STRING -FORCEINLINE -WdfFileObjectGetFileName( - _In_ - WDFFILEOBJECT FileObject - ) -{ - return ((PFN_WDFFILEOBJECTGETFILENAME) WdfFunctions[WdfFileObjectGetFileNameTableIndex])(WdfDriverGlobals, FileObject); -} - - -// -// WDF Function: WdfFileObjectGetDevice -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFDEVICE -(*PFN_WDFFILEOBJECTGETDEVICE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFFILEOBJECT FileObject - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFDEVICE -FORCEINLINE -WdfFileObjectGetDevice( - _In_ - WDFFILEOBJECT FileObject - ) -{ - return ((PFN_WDFFILEOBJECTGETDEVICE) WdfFunctions[WdfFileObjectGetDeviceTableIndex])(WdfDriverGlobals, FileObject); -} - - -// -// WDF Function: WdfFileObjectGetInitiatorProcessId -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -ULONG -(*PFN_WDFFILEOBJECTGETINITIATORPROCESSID)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFFILEOBJECT FileObject - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -ULONG -FORCEINLINE -WdfFileObjectGetInitiatorProcessId( - _In_ - WDFFILEOBJECT FileObject - ) -{ - return ((PFN_WDFFILEOBJECTGETINITIATORPROCESSID) WdfFunctions[WdfFileObjectGetInitiatorProcessIdTableIndex])(WdfDriverGlobals, FileObject); -} - - -// -// WDF Function: WdfFileObjectGetRelatedFileObject -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -WDFFILEOBJECT -(*PFN_WDFFILEOBJECTGETRELATEDFILEOBJECT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFFILEOBJECT FileObject - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFFILEOBJECT -FORCEINLINE -WdfFileObjectGetRelatedFileObject( - _In_ - WDFFILEOBJECT FileObject - ) -{ - return ((PFN_WDFFILEOBJECTGETRELATEDFILEOBJECT) WdfFunctions[WdfFileObjectGetRelatedFileObjectTableIndex])(WdfDriverGlobals, FileObject); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffuncenum.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffuncenum.h deleted file mode 100644 index 969e85d..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdffuncenum.h +++ /dev/null @@ -1,286 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -_WdfVersionBuild_ - -Module Name: WdfFuncEnum.h - -Abstract: - Generated an enum of all WDF API functions - -Environment: - kernel mode only - - Warning: manual changes to this file will be lost. ---*/ - -#ifndef _WDFFUNCENUM_H_ -#define _WDFFUNCENUM_H_ - -extern PWDF_DRIVER_GLOBALS WdfDriverGlobals; - -typedef enum _WDFFUNCENUM { - - WdfCollectionCreateTableIndex = 0, - WdfCollectionGetCountTableIndex = 1, - WdfCollectionAddTableIndex = 2, - WdfCollectionRemoveTableIndex = 3, - WdfCollectionRemoveItemTableIndex = 4, - WdfCollectionGetItemTableIndex = 5, - WdfCollectionGetFirstItemTableIndex = 6, - WdfCollectionGetLastItemTableIndex = 7, - WdfCxDeviceInitAllocateTableIndex = 8, - WdfCxDeviceInitSetRequestAttributesTableIndex = 9, - WdfCxDeviceInitSetFileObjectConfigTableIndex = 10, - WdfCxVerifierKeBugCheckTableIndex = 11, - WdfDeviceGetDeviceStateTableIndex = 12, - WdfDeviceSetDeviceStateTableIndex = 13, - WdfDeviceGetDriverTableIndex = 14, - WdfDeviceGetIoTargetTableIndex = 15, - WdfDeviceAssignS0IdleSettingsTableIndex = 16, - WdfDeviceAssignSxWakeSettingsTableIndex = 17, - WdfDeviceOpenRegistryKeyTableIndex = 18, - WdfDeviceInitSetPnpPowerEventCallbacksTableIndex = 19, - WdfDeviceInitSetPowerPolicyEventCallbacksTableIndex = 20, - WdfDeviceInitSetPowerPolicyOwnershipTableIndex = 21, - WdfDeviceInitSetIoTypeTableIndex = 22, - WdfDeviceInitSetFileObjectConfigTableIndex = 23, - WdfDeviceInitSetRequestAttributesTableIndex = 24, - WdfDeviceCreateTableIndex = 25, - WdfDeviceSetStaticStopRemoveTableIndex = 26, - WdfDeviceCreateDeviceInterfaceTableIndex = 27, - WdfDeviceSetDeviceInterfaceStateTableIndex = 28, - WdfDeviceRetrieveDeviceInterfaceStringTableIndex = 29, - WdfDeviceCreateSymbolicLinkTableIndex = 30, - WdfDeviceQueryPropertyTableIndex = 31, - WdfDeviceAllocAndQueryPropertyTableIndex = 32, - WdfDeviceSetPnpCapabilitiesTableIndex = 33, - WdfDeviceSetPowerCapabilitiesTableIndex = 34, - WdfDeviceSetFailedTableIndex = 35, - WdfDeviceStopIdleNoTrackTableIndex = 36, - WdfDeviceResumeIdleNoTrackTableIndex = 37, - WdfDeviceGetFileObjectTableIndex = 38, - WdfDeviceGetDefaultQueueTableIndex = 39, - WdfDeviceConfigureRequestDispatchingTableIndex = 40, - WdfDeviceGetSystemPowerActionTableIndex = 41, - WdfDeviceInitSetReleaseHardwareOrderOnFailureTableIndex = 42, - WdfDeviceInitSetIoTypeExTableIndex = 43, - WdfDevicePostEventTableIndex = 44, - WdfDeviceMapIoSpaceTableIndex = 45, - WdfDeviceUnmapIoSpaceTableIndex = 46, - WdfDeviceGetHardwareRegisterMappedAddressTableIndex = 47, - WdfDeviceReadFromHardwareTableIndex = 48, - WdfDeviceWriteToHardwareTableIndex = 49, - WdfDeviceAssignInterfacePropertyTableIndex = 50, - WdfDeviceAllocAndQueryInterfacePropertyTableIndex = 51, - WdfDeviceQueryInterfacePropertyTableIndex = 52, - WdfDeviceGetDeviceStackIoTypeTableIndex = 53, - WdfDeviceQueryPropertyExTableIndex = 54, - WdfDeviceAllocAndQueryPropertyExTableIndex = 55, - WdfDeviceAssignPropertyTableIndex = 56, - WdfDriverCreateTableIndex = 57, - WdfDriverGetRegistryPathTableIndex = 58, - WdfDriverOpenParametersRegistryKeyTableIndex = 59, - WdfDriverRetrieveVersionStringTableIndex = 60, - WdfDriverIsVersionAvailableTableIndex = 61, - WdfFdoInitOpenRegistryKeyTableIndex = 62, - WdfFdoInitQueryPropertyTableIndex = 63, - WdfFdoInitAllocAndQueryPropertyTableIndex = 64, - WdfFdoInitQueryPropertyExTableIndex = 65, - WdfFdoInitAllocAndQueryPropertyExTableIndex = 66, - WdfFdoInitSetFilterTableIndex = 67, - WdfFileObjectGetFileNameTableIndex = 68, - WdfFileObjectGetDeviceTableIndex = 69, - WdfFileObjectGetInitiatorProcessIdTableIndex = 70, - WdfFileObjectGetRelatedFileObjectTableIndex = 71, - WdfInterruptCreateTableIndex = 72, - WdfInterruptQueueDpcForIsrTableIndex = 73, - WdfInterruptQueueWorkItemForIsrTableIndex = 74, - WdfInterruptSynchronizeTableIndex = 75, - WdfInterruptAcquireLockTableIndex = 76, - WdfInterruptReleaseLockTableIndex = 77, - WdfInterruptEnableTableIndex = 78, - WdfInterruptDisableTableIndex = 79, - WdfInterruptGetInfoTableIndex = 80, - WdfInterruptSetPolicyTableIndex = 81, - WdfInterruptSetExtendedPolicyTableIndex = 82, - WdfInterruptGetDeviceTableIndex = 83, - WdfInterruptTryToAcquireLockTableIndex = 84, - WdfIoQueueCreateTableIndex = 85, - WdfIoQueueGetStateTableIndex = 86, - WdfIoQueueStartTableIndex = 87, - WdfIoQueueStopTableIndex = 88, - WdfIoQueueStopSynchronouslyTableIndex = 89, - WdfIoQueueGetDeviceTableIndex = 90, - WdfIoQueueRetrieveNextRequestTableIndex = 91, - WdfIoQueueRetrieveRequestByFileObjectTableIndex = 92, - WdfIoQueueFindRequestTableIndex = 93, - WdfIoQueueRetrieveFoundRequestTableIndex = 94, - WdfIoQueueDrainSynchronouslyTableIndex = 95, - WdfIoQueueDrainTableIndex = 96, - WdfIoQueuePurgeSynchronouslyTableIndex = 97, - WdfIoQueuePurgeTableIndex = 98, - WdfIoQueueReadyNotifyTableIndex = 99, - WdfIoQueueStopAndPurgeTableIndex = 100, - WdfIoQueueStopAndPurgeSynchronouslyTableIndex = 101, - WdfIoTargetCreateTableIndex = 102, - WdfIoTargetOpenTableIndex = 103, - WdfIoTargetCloseForQueryRemoveTableIndex = 104, - WdfIoTargetCloseTableIndex = 105, - WdfIoTargetStartTableIndex = 106, - WdfIoTargetStopTableIndex = 107, - WdfIoTargetPurgeTableIndex = 108, - WdfIoTargetGetStateTableIndex = 109, - WdfIoTargetGetDeviceTableIndex = 110, - WdfIoTargetSendReadSynchronouslyTableIndex = 111, - WdfIoTargetFormatRequestForReadTableIndex = 112, - WdfIoTargetSendWriteSynchronouslyTableIndex = 113, - WdfIoTargetFormatRequestForWriteTableIndex = 114, - WdfIoTargetSendIoctlSynchronouslyTableIndex = 115, - WdfIoTargetFormatRequestForIoctlTableIndex = 116, - WdfMemoryCreateTableIndex = 117, - WdfMemoryCreatePreallocatedTableIndex = 118, - WdfMemoryGetBufferTableIndex = 119, - WdfMemoryAssignBufferTableIndex = 120, - WdfMemoryCopyToBufferTableIndex = 121, - WdfMemoryCopyFromBufferTableIndex = 122, - WdfObjectGetTypedContextWorkerTableIndex = 123, - WdfObjectAllocateContextTableIndex = 124, - WdfObjectContextGetObjectTableIndex = 125, - WdfObjectReferenceActualTableIndex = 126, - WdfObjectDereferenceActualTableIndex = 127, - WdfObjectCreateTableIndex = 128, - WdfObjectDeleteTableIndex = 129, - WdfObjectQueryTableIndex = 130, - WdfRegistryOpenKeyTableIndex = 131, - WdfRegistryCreateKeyTableIndex = 132, - WdfRegistryCloseTableIndex = 133, - WdfRegistryRemoveKeyTableIndex = 134, - WdfRegistryRemoveValueTableIndex = 135, - WdfRegistryQueryValueTableIndex = 136, - WdfRegistryQueryMemoryTableIndex = 137, - WdfRegistryQueryMultiStringTableIndex = 138, - WdfRegistryQueryUnicodeStringTableIndex = 139, - WdfRegistryQueryStringTableIndex = 140, - WdfRegistryQueryULongTableIndex = 141, - WdfRegistryAssignValueTableIndex = 142, - WdfRegistryAssignMemoryTableIndex = 143, - WdfRegistryAssignMultiStringTableIndex = 144, - WdfRegistryAssignUnicodeStringTableIndex = 145, - WdfRegistryAssignStringTableIndex = 146, - WdfRegistryAssignULongTableIndex = 147, - WdfRequestCreateTableIndex = 148, - WdfRequestReuseTableIndex = 149, - WdfRequestChangeTargetTableIndex = 150, - WdfRequestFormatRequestUsingCurrentTypeTableIndex = 151, - WdfRequestSendTableIndex = 152, - WdfRequestGetStatusTableIndex = 153, - WdfRequestMarkCancelableTableIndex = 154, - WdfRequestMarkCancelableExTableIndex = 155, - WdfRequestUnmarkCancelableTableIndex = 156, - WdfRequestIsCanceledTableIndex = 157, - WdfRequestCancelSentRequestTableIndex = 158, - WdfRequestIsFrom32BitProcessTableIndex = 159, - WdfRequestSetCompletionRoutineTableIndex = 160, - WdfRequestGetCompletionParamsTableIndex = 161, - WdfRequestAllocateTimerTableIndex = 162, - WdfRequestCompleteTableIndex = 163, - WdfRequestCompleteWithInformationTableIndex = 164, - WdfRequestGetParametersTableIndex = 165, - WdfRequestRetrieveInputMemoryTableIndex = 166, - WdfRequestRetrieveOutputMemoryTableIndex = 167, - WdfRequestRetrieveInputBufferTableIndex = 168, - WdfRequestRetrieveOutputBufferTableIndex = 169, - WdfRequestSetInformationTableIndex = 170, - WdfRequestGetInformationTableIndex = 171, - WdfRequestGetFileObjectTableIndex = 172, - WdfRequestGetRequestorModeTableIndex = 173, - WdfRequestForwardToIoQueueTableIndex = 174, - WdfRequestGetIoQueueTableIndex = 175, - WdfRequestRequeueTableIndex = 176, - WdfRequestStopAcknowledgeTableIndex = 177, - WdfRequestImpersonateTableIndex = 178, - WdfRequestGetRequestorProcessIdTableIndex = 179, - WdfRequestIsFromUserModeDriverTableIndex = 180, - WdfRequestSetUserModeDriverInitiatedIoTableIndex = 181, - WdfRequestGetUserModeDriverInitiatedIoTableIndex = 182, - WdfRequestSetActivityIdTableIndex = 183, - WdfRequestRetrieveActivityIdTableIndex = 184, - WdfRequestGetEffectiveIoTypeTableIndex = 185, - WdfCmResourceListGetCountTableIndex = 186, - WdfCmResourceListGetDescriptorTableIndex = 187, - WdfStringCreateTableIndex = 188, - WdfStringGetUnicodeStringTableIndex = 189, - WdfObjectAcquireLockTableIndex = 190, - WdfObjectReleaseLockTableIndex = 191, - WdfWaitLockCreateTableIndex = 192, - WdfWaitLockAcquireTableIndex = 193, - WdfWaitLockReleaseTableIndex = 194, - WdfSpinLockCreateTableIndex = 195, - WdfSpinLockAcquireTableIndex = 196, - WdfSpinLockReleaseTableIndex = 197, - WdfTimerCreateTableIndex = 198, - WdfTimerStartTableIndex = 199, - WdfTimerStopTableIndex = 200, - WdfTimerGetParentObjectTableIndex = 201, - WdfUsbTargetDeviceCreateTableIndex = 202, - WdfUsbTargetDeviceCreateWithParametersTableIndex = 203, - WdfUsbTargetDeviceRetrieveInformationTableIndex = 204, - WdfUsbTargetDeviceGetDeviceDescriptorTableIndex = 205, - WdfUsbTargetDeviceRetrieveConfigDescriptorTableIndex = 206, - WdfUsbTargetDeviceQueryStringTableIndex = 207, - WdfUsbTargetDeviceAllocAndQueryStringTableIndex = 208, - WdfUsbTargetDeviceFormatRequestForStringTableIndex = 209, - WdfUsbTargetDeviceGetNumInterfacesTableIndex = 210, - WdfUsbTargetDeviceSelectConfigTableIndex = 211, - WdfUsbTargetDeviceSendControlTransferSynchronouslyTableIndex = 212, - WdfUsbTargetDeviceFormatRequestForControlTransferTableIndex = 213, - WdfUsbTargetDeviceResetPortSynchronouslyTableIndex = 214, - WdfUsbTargetDeviceQueryUsbCapabilityTableIndex = 215, - WdfUsbTargetPipeGetInformationTableIndex = 216, - WdfUsbTargetPipeIsInEndpointTableIndex = 217, - WdfUsbTargetPipeIsOutEndpointTableIndex = 218, - WdfUsbTargetPipeGetTypeTableIndex = 219, - WdfUsbTargetPipeSetNoMaximumPacketSizeCheckTableIndex = 220, - WdfUsbTargetPipeWriteSynchronouslyTableIndex = 221, - WdfUsbTargetPipeFormatRequestForWriteTableIndex = 222, - WdfUsbTargetPipeReadSynchronouslyTableIndex = 223, - WdfUsbTargetPipeFormatRequestForReadTableIndex = 224, - WdfUsbTargetPipeConfigContinuousReaderTableIndex = 225, - WdfUsbTargetPipeAbortSynchronouslyTableIndex = 226, - WdfUsbTargetPipeFormatRequestForAbortTableIndex = 227, - WdfUsbTargetPipeResetSynchronouslyTableIndex = 228, - WdfUsbTargetPipeFormatRequestForResetTableIndex = 229, - WdfUsbInterfaceGetInterfaceNumberTableIndex = 230, - WdfUsbInterfaceGetNumEndpointsTableIndex = 231, - WdfUsbInterfaceGetDescriptorTableIndex = 232, - WdfUsbInterfaceGetNumSettingsTableIndex = 233, - WdfUsbInterfaceSelectSettingTableIndex = 234, - WdfUsbInterfaceGetEndpointInformationTableIndex = 235, - WdfUsbTargetDeviceGetInterfaceTableIndex = 236, - WdfUsbInterfaceGetConfiguredSettingIndexTableIndex = 237, - WdfUsbInterfaceGetNumConfiguredPipesTableIndex = 238, - WdfUsbInterfaceGetConfiguredPipeTableIndex = 239, - WdfVerifierDbgBreakPointTableIndex = 240, - WdfVerifierKeBugCheckTableIndex = 241, - WdfGetTriageInfoTableIndex = 242, - WdfWorkItemCreateTableIndex = 243, - WdfWorkItemEnqueueTableIndex = 244, - WdfWorkItemGetParentObjectTableIndex = 245, - WdfWorkItemFlushTableIndex = 246, - WdfRegistryWdmGetHandleTableIndex = 247, - WdfDeviceStopIdleActualTableIndex = 248, - WdfDeviceResumeIdleActualTableIndex = 249, - WdfDeviceInitEnableHidInterfaceTableIndex = 250, - WdfDeviceHidNotifyPresenceTableIndex = 251, - WdfDeviceGetSelfIoTargetTableIndex = 252, - WdfDeviceInitAllowSelfIoTargetTableIndex = 253, - WdfIoTargetSelfAssignDefaultIoQueueTableIndex = 254, - WdfDeviceOpenDevicemapKeyTableIndex = 255, - WdfIoTargetWdmGetTargetFileHandleTableIndex = 256, - WdfFunctionTableNumEntries = 257, -} WDFFUNCENUM; - -#endif // _WDFFUNCENUM_H_ - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfglobals.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfglobals.h deleted file mode 100644 index 592bf36..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfglobals.h +++ /dev/null @@ -1,67 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - WdfGlobals.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -#ifdef __cplusplus -extern "C" { -#endif - -#define WDF_DRIVER_GLOBALS_NAME_LEN (32) - -typedef struct _WDF_DRIVER_GLOBALS { - - // backpointer to the handle for this driver - WDFDRIVER Driver; - - // Flags indicated by the driver during create - ULONG DriverFlags; - - // Tag generated by WDF for the driver. Tag used by allocations made on - // behalf of the driver by WDF. - ULONG DriverTag; - - CHAR DriverName[WDF_DRIVER_GLOBALS_NAME_LEN]; - - // If TRUE, the stub code will capture DriverObject->DriverUnload and insert - // itself first in the unload chain. If FALSE, DriverUnload is left alone - // (but WDF will not be notified of unload and there will be no auto cleanup). - BOOLEAN DisplaceDriverUnload; - -} WDF_DRIVER_GLOBALS, *PWDF_DRIVER_GLOBALS; - -#ifdef __cplusplus -} -#endif -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfhwaccess.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfhwaccess.h deleted file mode 100644 index f8c5737..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfhwaccess.h +++ /dev/null @@ -1,612 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfhwaccess.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#define WDF_NO_BUFFER (NULL) -#define WDF_ZERO_BUFFER_COUNT (0) -#define WDF_UNUSED_VALUE (0) - -// -// Types -// - - -// -// Functions for HwAccess -// - -// -// Read Register functions -// -UCHAR -FORCEINLINE -WDF_READ_REGISTER_UCHAR( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUCHAR Register - ) -{ - return (UCHAR) WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypeRegister, - WdfDeviceHwAccessTargetSizeUchar, - Register, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -USHORT -FORCEINLINE -WDF_READ_REGISTER_USHORT( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUSHORT Register - ) -{ - return (USHORT) WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypeRegister, - WdfDeviceHwAccessTargetSizeUshort, - Register, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -ULONG -FORCEINLINE -WDF_READ_REGISTER_ULONG( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG Register - ) -{ - return (ULONG) WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypeRegister, - WdfDeviceHwAccessTargetSizeUlong, - Register, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -#if defined(_WIN64) - -ULONG64 -FORCEINLINE -WDF_READ_REGISTER_ULONG64( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG64 Register - ) -{ - return (ULONG64) WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypeRegister, - WdfDeviceHwAccessTargetSizeUlong64, - Register, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -#endif - -VOID -FORCEINLINE -WDF_READ_REGISTER_BUFFER_UCHAR( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUCHAR Register, - _Out_writes_all_(Count) PUCHAR Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypeRegisterBuffer, - WdfDeviceHwAccessTargetSizeUchar, - Register, - Buffer, - Count - ); -} - -VOID -FORCEINLINE -WDF_READ_REGISTER_BUFFER_USHORT( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUSHORT Register, - _Out_writes_all_(Count) PUSHORT Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypeRegisterBuffer, - WdfDeviceHwAccessTargetSizeUshort, - Register, - Buffer, - Count - ); -} - -VOID -FORCEINLINE -WDF_READ_REGISTER_BUFFER_ULONG( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG Register, - _Out_writes_all_(Count) PULONG Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypeRegisterBuffer, - WdfDeviceHwAccessTargetSizeUlong, - Register, - Buffer, - Count - ); -} - -#if defined(_WIN64) - -VOID -FORCEINLINE -WDF_READ_REGISTER_BUFFER_ULONG64( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG64 Register, - _Out_writes_all_(Count) PULONG64 Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypeRegisterBuffer, - WdfDeviceHwAccessTargetSizeUlong64, - Register, - Buffer, - Count - ); -} - -#endif - -// -// Write register functions -// -VOID -FORCEINLINE -WDF_WRITE_REGISTER_UCHAR( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUCHAR Register, - _In_ UCHAR Value - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypeRegister, - WdfDeviceHwAccessTargetSizeUchar, - Register, - Value, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -VOID -FORCEINLINE -WDF_WRITE_REGISTER_USHORT( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUSHORT Register, - _In_ USHORT Value - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypeRegister, - WdfDeviceHwAccessTargetSizeUshort, - Register, - Value, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -VOID -FORCEINLINE -WDF_WRITE_REGISTER_ULONG( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG Register, - _In_ ULONG Value - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypeRegister, - WdfDeviceHwAccessTargetSizeUlong, - Register, - Value, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -#if defined(_WIN64) - -VOID -FORCEINLINE -WDF_WRITE_REGISTER_ULONG64( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG64 Register, - _In_ ULONG64 Value - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypeRegister, - WdfDeviceHwAccessTargetSizeUlong64, - Register, - Value, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -#endif - -VOID -FORCEINLINE -WDF_WRITE_REGISTER_BUFFER_UCHAR( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUCHAR Register, - _In_reads_(Count) PUCHAR Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypeRegisterBuffer, - WdfDeviceHwAccessTargetSizeUchar, - Register, - WDF_UNUSED_VALUE, - Buffer, - Count - ); -} - -VOID -FORCEINLINE -WDF_WRITE_REGISTER_BUFFER_USHORT( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUSHORT Register, - _In_reads_(Count) PUSHORT Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypeRegisterBuffer, - WdfDeviceHwAccessTargetSizeUshort, - Register, - WDF_UNUSED_VALUE, - Buffer, - Count - ); -} - -VOID -FORCEINLINE -WDF_WRITE_REGISTER_BUFFER_ULONG( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG Register, - _In_reads_(Count) PULONG Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypeRegisterBuffer, - WdfDeviceHwAccessTargetSizeUlong, - Register, - WDF_UNUSED_VALUE, - Buffer, - Count - ); -} - -#if defined(_WIN64) - -VOID -FORCEINLINE -WDF_WRITE_REGISTER_BUFFER_ULONG64( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG64 Register, - _In_reads_(Count) PULONG64 Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypeRegisterBuffer, - WdfDeviceHwAccessTargetSizeUlong64, - Register, - WDF_UNUSED_VALUE, - Buffer, - Count - ); -} - -#endif - -// -// -// Read Port functions -// -UCHAR -FORCEINLINE -WDF_READ_PORT_UCHAR( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUCHAR Port - ) -{ - return (UCHAR) WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypePort, - WdfDeviceHwAccessTargetSizeUchar, - Port, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -USHORT -FORCEINLINE -WDF_READ_PORT_USHORT( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUSHORT Port - ) -{ - return (USHORT) WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypePort, - WdfDeviceHwAccessTargetSizeUshort, - Port, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -ULONG -FORCEINLINE -WDF_READ_PORT_ULONG( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG Port - ) -{ - return (ULONG) WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypePort, - WdfDeviceHwAccessTargetSizeUlong, - Port, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -VOID -FORCEINLINE -WDF_READ_PORT_BUFFER_UCHAR( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUCHAR Port, - _Out_writes_all_(Count) PUCHAR Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypePortBuffer, - WdfDeviceHwAccessTargetSizeUchar, - Port, - Buffer, - Count - ); -} - -VOID -FORCEINLINE -WDF_READ_PORT_BUFFER_USHORT( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUSHORT Port, - _Out_writes_all_(Count) PUSHORT Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypePortBuffer, - WdfDeviceHwAccessTargetSizeUshort, - Port, - Buffer, - Count - ); -} - -VOID -FORCEINLINE -WDF_READ_PORT_BUFFER_ULONG( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG Port, - _Out_writes_all_(Count) PULONG Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceReadFromHardware( - Device, - WdfDeviceHwAccessTargetTypePortBuffer, - WdfDeviceHwAccessTargetSizeUlong, - Port, - Buffer, - Count - ); -} - -// -// Write port functions -// -VOID -FORCEINLINE -WDF_WRITE_PORT_UCHAR( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUCHAR Port, - _In_ UCHAR Value - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypePort, - WdfDeviceHwAccessTargetSizeUchar, - Port, - Value, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -VOID -FORCEINLINE -WDF_WRITE_PORT_USHORT( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUSHORT Port, - _In_ USHORT Value - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypePort, - WdfDeviceHwAccessTargetSizeUshort, - Port, - Value, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -VOID -FORCEINLINE -WDF_WRITE_PORT_ULONG( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG Port, - _In_ ULONG Value - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypePort, - WdfDeviceHwAccessTargetSizeUlong, - Port, - Value, - WDF_NO_BUFFER, - WDF_ZERO_BUFFER_COUNT - ); -} - -VOID -FORCEINLINE -WDF_WRITE_PORT_BUFFER_UCHAR( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUCHAR Port, - _In_reads_(Count) PUCHAR Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypePortBuffer, - WdfDeviceHwAccessTargetSizeUchar, - Port, - WDF_UNUSED_VALUE, - Buffer, - Count - ); -} - -VOID -FORCEINLINE -WDF_WRITE_PORT_BUFFER_USHORT( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PUSHORT Port, - _In_reads_(Count) PUSHORT Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypePortBuffer, - WdfDeviceHwAccessTargetSizeUshort, - Port, - WDF_UNUSED_VALUE, - Buffer, - Count - ); -} - -VOID -FORCEINLINE -WDF_WRITE_PORT_BUFFER_ULONG( - _In_ WDFDEVICE Device, - _In_ _Notliteral_ PULONG Port, - _In_reads_(Count) PULONG Buffer, - _In_ ULONG Count - ) -{ - WdfDeviceWriteToHardware( - Device, - WdfDeviceHwAccessTargetTypePortBuffer, - WdfDeviceHwAccessTargetSizeUlong, - Port, - WDF_UNUSED_VALUE, - Buffer, - Count - ); -} - - - - - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfinterrupt.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfinterrupt.h deleted file mode 100644 index dbb0170..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfinterrupt.h +++ /dev/null @@ -1,732 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfinterrupt.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -// -// Message Signaled Interrupts (MSI) information structure -// -typedef enum _WDF_INTERRUPT_POLARITY { - WdfInterruptPolarityUnknown = 0, - WdfInterruptActiveHigh, - WdfInterruptActiveLow, -} WDF_INTERRUPT_POLARITY, *PWDF_INTERRUPT_POLARITY; - - -typedef enum _WDF_INTERRUPT_POLICY { - WdfIrqPolicyMachineDefault = 0, - WdfIrqPolicyAllCloseProcessors, - WdfIrqPolicyOneCloseProcessor, - WdfIrqPolicyAllProcessorsInMachine, - WdfIrqPolicySpecifiedProcessors, - WdfIrqPolicySpreadMessagesAcrossAllProcessors, -} WDF_INTERRUPT_POLICY, *PWDF_INTERRUPT_POLICY; - - -typedef enum _WDF_INTERRUPT_PRIORITY { - WdfIrqPriorityUndefined = 0, - WdfIrqPriorityLow, - WdfIrqPriorityNormal, - WdfIrqPriorityHigh, -} WDF_INTERRUPT_PRIORITY, *PWDF_INTERRUPT_PRIORITY; - - - -// -// This is the function that gets invoked when the hardware ISR occurs. -// This function is called at the IRQL at which the interrupt is serviced: -// - DIRQL for DIRQL interrupt handling. -// - PASSIVE_LEVEL for passive-level interrupt handling. -// -typedef -_Function_class_(EVT_WDF_INTERRUPT_ISR) -_IRQL_requires_same_ -_IRQL_requires_min_(PASSIVE_LEVEL) -BOOLEAN -EVT_WDF_INTERRUPT_ISR( - _In_ - WDFINTERRUPT Interrupt, - _In_ - ULONG MessageID - ); - -typedef EVT_WDF_INTERRUPT_ISR *PFN_WDF_INTERRUPT_ISR; - -// -// This is the function that gets invoked when a Synchronize execution occurs. -// This function is called at the IRQL at which the interrupt is serviced: -// - DIRQL for DIRQL interrupt handling. -// - PASSIVE_LEVEL for passive-level interrupt handling. -// -typedef -_Function_class_(EVT_WDF_INTERRUPT_SYNCHRONIZE) -_IRQL_requires_same_ -_IRQL_requires_min_(PASSIVE_LEVEL) -BOOLEAN -EVT_WDF_INTERRUPT_SYNCHRONIZE( - _In_ - WDFINTERRUPT Interrupt, - _In_ - WDFCONTEXT Context - ); - -typedef EVT_WDF_INTERRUPT_SYNCHRONIZE *PFN_WDF_INTERRUPT_SYNCHRONIZE; - -// -// This is the function that gets called back into the driver -// when the DpcForIsr fires. It will be called at DISPATCH_LEVEL. -// -typedef -_Function_class_(EVT_WDF_INTERRUPT_DPC) -_IRQL_requires_same_ -_IRQL_requires_(DISPATCH_LEVEL) -VOID -EVT_WDF_INTERRUPT_DPC( - _In_ - WDFINTERRUPT Interrupt, - _In_ - WDFOBJECT AssociatedObject - ); - -typedef EVT_WDF_INTERRUPT_DPC *PFN_WDF_INTERRUPT_DPC; - -// -// This is the function that gets called back into the driver -// when the WorkItemForIsr fires. It will be called at PASSIVE_LEVEL. -// -typedef -_Function_class_(EVT_WDF_INTERRUPT_WORKITEM) -_IRQL_requires_same_ -_IRQL_requires_(PASSIVE_LEVEL) -VOID -EVT_WDF_INTERRUPT_WORKITEM( - _In_ - WDFINTERRUPT Interrupt, - _In_ - WDFOBJECT AssociatedObject - ); - -typedef EVT_WDF_INTERRUPT_WORKITEM *PFN_WDF_INTERRUPT_WORKITEM; - -// -// This is the function that gets called back into the driver -// to enable the interrupt in the hardware. It will be called -// at the same IRQL at which the interrupt will be serviced: -// - DIRQL for DIRQL interrupt handling. -// - PASSIVE_LEVEL for passive-level interrupt handling. -// -typedef -_Function_class_(EVT_WDF_INTERRUPT_ENABLE) -_IRQL_requires_same_ -_IRQL_requires_min_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_INTERRUPT_ENABLE( - _In_ - WDFINTERRUPT Interrupt, - _In_ - WDFDEVICE AssociatedDevice - ); - -typedef EVT_WDF_INTERRUPT_ENABLE *PFN_WDF_INTERRUPT_ENABLE; - -// -// This is the function that gets called back into the driver -// to disable the interrupt in the hardware. It will be called -// at the same IRQL at which the interrupt is serviced: -// - DIRQL for DIRQL interrupt handling. -// - PASSIVE_LEVEL for passive-level interrupt handling. -// -typedef -_Function_class_(EVT_WDF_INTERRUPT_DISABLE) -_IRQL_requires_same_ -_IRQL_requires_min_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_INTERRUPT_DISABLE( - _In_ - WDFINTERRUPT Interrupt, - _In_ - WDFDEVICE AssociatedDevice - ); - -typedef EVT_WDF_INTERRUPT_DISABLE *PFN_WDF_INTERRUPT_DISABLE; - -// -// Interrupt Configuration Structure -// -typedef struct _WDF_INTERRUPT_CONFIG { - ULONG Size; - - // - // If this interrupt is to be synchronized with other interrupt(s) assigned - // to the same WDFDEVICE, create a WDFSPINLOCK and assign it to each of the - // WDFINTERRUPTs config. - // - WDFSPINLOCK SpinLock; - - WDF_TRI_STATE ShareVector; - - BOOLEAN FloatingSave; - - // - // DIRQL handling: automatic serialization of the DpcForIsr/WaitItemForIsr. - // Passive-level handling: automatic serialization of all callbacks. - // - BOOLEAN AutomaticSerialization; - - // - // Event Callbacks - // - PFN_WDF_INTERRUPT_ISR EvtInterruptIsr; - PFN_WDF_INTERRUPT_DPC EvtInterruptDpc; - PFN_WDF_INTERRUPT_ENABLE EvtInterruptEnable; - PFN_WDF_INTERRUPT_DISABLE EvtInterruptDisable; - PFN_WDF_INTERRUPT_WORKITEM EvtInterruptWorkItem; - - // - // These fields are only used when interrupt is created in - // EvtDevicePrepareHardware callback. - // - PCM_PARTIAL_RESOURCE_DESCRIPTOR InterruptRaw; - PCM_PARTIAL_RESOURCE_DESCRIPTOR InterruptTranslated; - - // - // Optional passive lock for handling interrupts at passive-level. - // - WDFWAITLOCK WaitLock; - - // - // TRUE: handle interrupt at passive-level. - // FALSE: handle interrupt at DIRQL level. This is the default. - // - BOOLEAN PassiveHandling; - - // - // TRUE: Interrupt is reported inactive on explicit power down - // instead of disconnecting it. - // FALSE: Interrupt is disconnected instead of reporting inactive - // on explicit power down. - // DEFAULT: Framework decides the right value. - // - WDF_TRI_STATE ReportInactiveOnPowerDown; - - // - // TRUE: Interrupt is used to wake the device from low-power states - // and when the device is armed for wake this interrupt should - // remain connected. - // FALSE: Interrupt is not used to wake the device from low-power states. - // This is the default. - // - BOOLEAN CanWakeDevice; -} WDF_INTERRUPT_CONFIG, *PWDF_INTERRUPT_CONFIG; - - - -VOID -FORCEINLINE -WDF_INTERRUPT_CONFIG_INIT( - _Out_ PWDF_INTERRUPT_CONFIG Configuration, - _In_ PFN_WDF_INTERRUPT_ISR EvtInterruptIsr, - _In_opt_ PFN_WDF_INTERRUPT_DPC EvtInterruptDpc - ) -{ - RtlZeroMemory(Configuration, sizeof(WDF_INTERRUPT_CONFIG)); - - Configuration->Size = sizeof(WDF_INTERRUPT_CONFIG); - - Configuration->ShareVector = WdfUseDefault; - - Configuration->EvtInterruptIsr = EvtInterruptIsr; - Configuration->EvtInterruptDpc = EvtInterruptDpc; - - Configuration->ReportInactiveOnPowerDown = WdfUseDefault; - - Configuration->PassiveHandling = TRUE; -} - - - -// -// Disable warning C4324: structure was padded due to DECLSPEC_ALIGN -// This padding is intentional and necessary. -#pragma warning(push) -#pragma warning(disable: 4324) - -typedef struct _WDF_INTERRUPT_INFO { - // - // Size of this structure in bytes - // - ULONG Size; - ULONG64 Reserved1; - KAFFINITY TargetProcessorSet; - ULONG Reserved2; - ULONG MessageNumber; - ULONG Vector; - KIRQL Irql; - KINTERRUPT_MODE Mode; - WDF_INTERRUPT_POLARITY Polarity; - BOOLEAN MessageSignaled; - UCHAR ShareDisposition; //CM_SHARE_DISPOSITION - DECLSPEC_ALIGN(8) USHORT Group; - -} WDF_INTERRUPT_INFO, *PWDF_INTERRUPT_INFO; - -#pragma warning(pop) - -VOID -FORCEINLINE -WDF_INTERRUPT_INFO_INIT( - _Out_ PWDF_INTERRUPT_INFO Info - ) -{ - RtlZeroMemory(Info, sizeof(WDF_INTERRUPT_INFO)); - Info->Size = sizeof(WDF_INTERRUPT_INFO); -} - -// -// Interrupt Extended Policy Configuration Structure -// -typedef struct _WDF_INTERRUPT_EXTENDED_POLICY { - // - // Size of this structure in bytes - // - ULONG Size; - WDF_INTERRUPT_POLICY Policy; - WDF_INTERRUPT_PRIORITY Priority; - GROUP_AFFINITY TargetProcessorSetAndGroup; - -} WDF_INTERRUPT_EXTENDED_POLICY, *PWDF_INTERRUPT_EXTENDED_POLICY; - -VOID -FORCEINLINE -WDF_INTERRUPT_EXTENDED_POLICY_INIT( - _Out_ PWDF_INTERRUPT_EXTENDED_POLICY ExtendedPolicy - ) -{ - RtlZeroMemory(ExtendedPolicy, sizeof(WDF_INTERRUPT_EXTENDED_POLICY)); - ExtendedPolicy->Size = sizeof(WDF_INTERRUPT_EXTENDED_POLICY); - ExtendedPolicy->Policy = WdfIrqPolicyMachineDefault; - ExtendedPolicy->Priority = WdfIrqPriorityUndefined; -} - - -// -// WDF Function: WdfInterruptCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFINTERRUPTCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_INTERRUPT_CONFIG Configuration, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFINTERRUPT* Interrupt - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfInterruptCreate( - _In_ - WDFDEVICE Device, - _In_ - PWDF_INTERRUPT_CONFIG Configuration, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFINTERRUPT* Interrupt - ) -{ - return ((PFN_WDFINTERRUPTCREATE) WdfFunctions[WdfInterruptCreateTableIndex])(WdfDriverGlobals, Device, Configuration, Attributes, Interrupt); -} - - -// -// WDF Function: WdfInterruptQueueDpcForIsr -// -typedef -WDFAPI -BOOLEAN -(*PFN_WDFINTERRUPTQUEUEDPCFORISR)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFINTERRUPT Interrupt - ); - -BOOLEAN -FORCEINLINE -WdfInterruptQueueDpcForIsr( - _In_ - WDFINTERRUPT Interrupt - ) -{ - return ((PFN_WDFINTERRUPTQUEUEDPCFORISR) WdfFunctions[WdfInterruptQueueDpcForIsrTableIndex])(WdfDriverGlobals, Interrupt); -} - - -// -// WDF Function: WdfInterruptQueueWorkItemForIsr -// -typedef -WDFAPI -BOOLEAN -(*PFN_WDFINTERRUPTQUEUEWORKITEMFORISR)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFINTERRUPT Interrupt - ); - -BOOLEAN -FORCEINLINE -WdfInterruptQueueWorkItemForIsr( - _In_ - WDFINTERRUPT Interrupt - ) -{ - return ((PFN_WDFINTERRUPTQUEUEWORKITEMFORISR) WdfFunctions[WdfInterruptQueueWorkItemForIsrTableIndex])(WdfDriverGlobals, Interrupt); -} - - -// -// WDF Function: WdfInterruptSynchronize -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFINTERRUPTSYNCHRONIZE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFINTERRUPT Interrupt, - _In_ - PFN_WDF_INTERRUPT_SYNCHRONIZE Callback, - _In_ - WDFCONTEXT Context - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -BOOLEAN -FORCEINLINE -WdfInterruptSynchronize( - _In_ - WDFINTERRUPT Interrupt, - _In_ - PFN_WDF_INTERRUPT_SYNCHRONIZE Callback, - _In_ - WDFCONTEXT Context - ) -{ - return ((PFN_WDFINTERRUPTSYNCHRONIZE) WdfFunctions[WdfInterruptSynchronizeTableIndex])(WdfDriverGlobals, Interrupt, Callback, Context); -} - - -// -// WDF Function: WdfInterruptAcquireLock -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL + 1) -WDFAPI -VOID -(*PFN_WDFINTERRUPTACQUIRELOCK)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - _Requires_lock_not_held_(_Curr_) - _Acquires_lock_(_Curr_) - WDFINTERRUPT Interrupt - ); - -_IRQL_requires_max_(DISPATCH_LEVEL + 1) -VOID -FORCEINLINE -WdfInterruptAcquireLock( - _In_ - _Requires_lock_not_held_(_Curr_) - _Acquires_lock_(_Curr_) - WDFINTERRUPT Interrupt - ) -{ - ((PFN_WDFINTERRUPTACQUIRELOCK) WdfFunctions[WdfInterruptAcquireLockTableIndex])(WdfDriverGlobals, Interrupt); -} - - -// -// WDF Function: WdfInterruptReleaseLock -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL + 1) -WDFAPI -VOID -(*PFN_WDFINTERRUPTRELEASELOCK)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - _Requires_lock_held_(_Curr_) - _Releases_lock_(_Curr_) - WDFINTERRUPT Interrupt - ); - -_IRQL_requires_max_(DISPATCH_LEVEL + 1) -VOID -FORCEINLINE -WdfInterruptReleaseLock( - _In_ - _Requires_lock_held_(_Curr_) - _Releases_lock_(_Curr_) - WDFINTERRUPT Interrupt - ) -{ - ((PFN_WDFINTERRUPTRELEASELOCK) WdfFunctions[WdfInterruptReleaseLockTableIndex])(WdfDriverGlobals, Interrupt); -} - - -// -// WDF Function: WdfInterruptEnable -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFINTERRUPTENABLE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFINTERRUPT Interrupt - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfInterruptEnable( - _In_ - WDFINTERRUPT Interrupt - ) -{ - ((PFN_WDFINTERRUPTENABLE) WdfFunctions[WdfInterruptEnableTableIndex])(WdfDriverGlobals, Interrupt); -} - - -// -// WDF Function: WdfInterruptDisable -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFINTERRUPTDISABLE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFINTERRUPT Interrupt - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfInterruptDisable( - _In_ - WDFINTERRUPT Interrupt - ) -{ - ((PFN_WDFINTERRUPTDISABLE) WdfFunctions[WdfInterruptDisableTableIndex])(WdfDriverGlobals, Interrupt); -} - - -// -// WDF Function: WdfInterruptGetInfo -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFINTERRUPTGETINFO)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFINTERRUPT Interrupt, - _Out_ - PWDF_INTERRUPT_INFO Info - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfInterruptGetInfo( - _In_ - WDFINTERRUPT Interrupt, - _Out_ - PWDF_INTERRUPT_INFO Info - ) -{ - ((PFN_WDFINTERRUPTGETINFO) WdfFunctions[WdfInterruptGetInfoTableIndex])(WdfDriverGlobals, Interrupt, Info); -} - - -// -// WDF Function: WdfInterruptSetPolicy -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFINTERRUPTSETPOLICY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFINTERRUPT Interrupt, - _In_ - WDF_INTERRUPT_POLICY Policy, - _In_ - WDF_INTERRUPT_PRIORITY Priority, - _In_ - KAFFINITY TargetProcessorSet - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfInterruptSetPolicy( - _In_ - WDFINTERRUPT Interrupt, - _In_ - WDF_INTERRUPT_POLICY Policy, - _In_ - WDF_INTERRUPT_PRIORITY Priority, - _In_ - KAFFINITY TargetProcessorSet - ) -{ - ((PFN_WDFINTERRUPTSETPOLICY) WdfFunctions[WdfInterruptSetPolicyTableIndex])(WdfDriverGlobals, Interrupt, Policy, Priority, TargetProcessorSet); -} - - -// -// WDF Function: WdfInterruptSetExtendedPolicy -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFINTERRUPTSETEXTENDEDPOLICY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFINTERRUPT Interrupt, - _In_ - PWDF_INTERRUPT_EXTENDED_POLICY PolicyAndGroup - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfInterruptSetExtendedPolicy( - _In_ - WDFINTERRUPT Interrupt, - _In_ - PWDF_INTERRUPT_EXTENDED_POLICY PolicyAndGroup - ) -{ - ((PFN_WDFINTERRUPTSETEXTENDEDPOLICY) WdfFunctions[WdfInterruptSetExtendedPolicyTableIndex])(WdfDriverGlobals, Interrupt, PolicyAndGroup); -} - - -// -// WDF Function: WdfInterruptGetDevice -// -typedef -WDFAPI -WDFDEVICE -(*PFN_WDFINTERRUPTGETDEVICE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFINTERRUPT Interrupt - ); - -WDFDEVICE -FORCEINLINE -WdfInterruptGetDevice( - _In_ - WDFINTERRUPT Interrupt - ) -{ - return ((PFN_WDFINTERRUPTGETDEVICE) WdfFunctions[WdfInterruptGetDeviceTableIndex])(WdfDriverGlobals, Interrupt); -} - - -// -// WDF Function: WdfInterruptTryToAcquireLock -// -typedef -_Must_inspect_result_ -_Post_satisfies_(return == 1 || return == 0) -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFINTERRUPTTRYTOACQUIRELOCK)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - _Requires_lock_not_held_(_Curr_) - _When_(return!=0, _Acquires_lock_(_Curr_)) - WDFINTERRUPT Interrupt - ); - -_Must_inspect_result_ -_Post_satisfies_(return == 1 || return == 0) -_IRQL_requires_max_(PASSIVE_LEVEL) -BOOLEAN -FORCEINLINE -WdfInterruptTryToAcquireLock( - _In_ - _Requires_lock_not_held_(_Curr_) - _When_(return!=0, _Acquires_lock_(_Curr_)) - WDFINTERRUPT Interrupt - ) -{ - return ((PFN_WDFINTERRUPTTRYTOACQUIRELOCK) WdfFunctions[WdfInterruptTryToAcquireLockTableIndex])(WdfDriverGlobals, Interrupt); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfio.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfio.h deleted file mode 100644 index b202c82..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfio.h +++ /dev/null @@ -1,1139 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfio.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -// -// Types -// - -// -// This defines the dispatch type of the queue. This controls how -// the queue raises I/O events to the driver through the registered -// callbacks. -// -// Sequential allows the driver to have the queue automatically dispatch -// one request at a time, and will hold requests until a current request -// is completed. -// -// Parallel has the queue dispatch requests to the driver as they arrive -// at the queue, and the queue is in a processing state. The driver can -// look at the requests in real time, and decide to service them, forward them -// to another queue, pend them, or return a status to have the queue held -// due to a hardware or other resource limit. -// -// Manual allows the driver to create multiple queues for requests, and control -// when it wants to retrieve requests from the queue by calling the queues -// WdfIoQueueRetrieveNextRequest() API. -// - -typedef enum _WDF_IO_QUEUE_DISPATCH_TYPE { - WdfIoQueueDispatchInvalid = 0, - WdfIoQueueDispatchSequential, - WdfIoQueueDispatchParallel, - WdfIoQueueDispatchManual, - WdfIoQueueDispatchMax, -} WDF_IO_QUEUE_DISPATCH_TYPE; - - -// -// This defines the status of the queue. -// -// WdfIoQueueAcceptRequests - If TRUE, Queue will accept requests from WDM -// dispatch through WdfDeviceConfigureRequestDispatching, -// or from WdfRequestForwardToIoQueue. -// -// If FALSE, Queue will complete requests with -// STATUS_CANCELLED from WdfDeviceConfigureRequestDispatching, -// and fail WdfRequestForwardToIoQueue with -// STATUS_WDF_BUSY. -// -// -// WdfIoQueueDispatchRequests - If TRUE, and the Queue is configured for -// automatic dispatch as either -// WdfIoQueueDispatchSequential, -// or WdfIoQueueDispatchParallel, the Queue will -// present the requests to the driver according -// to the drivers configuration. -// -// If FALSE, requests are not automatically -// presented to the device driver. -// -// This has no effect on the drivers ability to -// retrieve requests with WdfIoQueueRetrieveNextRequest. -// -// WdfIoQueueNoRequests - If TRUE, the Queue has no requests to present -// or return to the device driver. -// -// WdfIoQueueDriverNoRequests - If TRUE, the device driver is not operating -// on any requests retrieved from or presented -// by this Queue. -// -// WdfIoQueuePnpHeld - The Framework PnP stage has requested that -// the device driver stop receiving new requests. -// -// Automatic request dispatch stops, and -// WdfIoQueueRetrieveNextRequest returns STATUS_WDF_BUSY. -// - -typedef enum _WDF_IO_QUEUE_STATE { - WdfIoQueueAcceptRequests = 0x01, - WdfIoQueueDispatchRequests = 0x02, - WdfIoQueueNoRequests = 0x04, - WdfIoQueueDriverNoRequests = 0x08, - WdfIoQueuePnpHeld = 0x10, -} WDF_IO_QUEUE_STATE; - - - -// -// These macros represent some common Queue states -// - -// -// A Queue is idle if it has no requests, and the driver -// is not operating on any. -// - -BOOLEAN -FORCEINLINE -WDF_IO_QUEUE_IDLE( - _In_ WDF_IO_QUEUE_STATE State - ) -{ - return ((State & WdfIoQueueNoRequests) && - (State & WdfIoQueueDriverNoRequests)) ? TRUE: FALSE; -} - -// -// A Queue is ready if it can accept and dispatch requests and -// queue is not held by PNP -// -BOOLEAN -FORCEINLINE -WDF_IO_QUEUE_READY( - _In_ WDF_IO_QUEUE_STATE State - ) -{ - return ((State & WdfIoQueueDispatchRequests) && - (State & WdfIoQueueAcceptRequests) && - ((State & WdfIoQueuePnpHeld)==0)) ? TRUE: FALSE; -} - -// -// A Queue is stopped if it can accept new requests, but -// is not automatically delivering them to the device driver, -// and the queue is idle. -// -BOOLEAN -FORCEINLINE -WDF_IO_QUEUE_STOPPED( - _In_ WDF_IO_QUEUE_STATE State - ) -{ - return (((State & WdfIoQueueDispatchRequests) == 0) && - (State & WdfIoQueueAcceptRequests) && - (State & WdfIoQueueDriverNoRequests)) ? TRUE: FALSE; - -} - -// -// A Queue is drained if it can not accept new requests but -// can dispatch existing requests, and there are no requests -// either in the Queue or the device driver. -// - -BOOLEAN -FORCEINLINE -WDF_IO_QUEUE_DRAINED( - _In_ WDF_IO_QUEUE_STATE State - ) -{ - return ( ((State & WdfIoQueueAcceptRequests)==0) && - (State & WdfIoQueueDispatchRequests) && - (State & WdfIoQueueNoRequests) && - (State & WdfIoQueueDriverNoRequests) ) ? TRUE: FALSE; - -} - -// -// A Queue is purged if it can not accept new requests -// and there are no requests either in the Queue or -// the device driver. -// -BOOLEAN -FORCEINLINE -WDF_IO_QUEUE_PURGED( - _In_ WDF_IO_QUEUE_STATE State - ) -{ - return ( ((State & WdfIoQueueAcceptRequests)==0) && - (State & WdfIoQueueNoRequests) && - (State & WdfIoQueueDriverNoRequests) ) ? TRUE: FALSE; - -} - -// -// Event callback definitions -// - -typedef -_Function_class_(EVT_WDF_IO_QUEUE_IO_DEFAULT) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_IO_QUEUE_IO_DEFAULT( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST Request - ); - -typedef EVT_WDF_IO_QUEUE_IO_DEFAULT *PFN_WDF_IO_QUEUE_IO_DEFAULT; - - -typedef -_Function_class_(EVT_WDF_IO_QUEUE_IO_STOP) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_IO_QUEUE_IO_STOP( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST Request, - _In_ - ULONG ActionFlags - ); - -typedef EVT_WDF_IO_QUEUE_IO_STOP *PFN_WDF_IO_QUEUE_IO_STOP; - -typedef -_Function_class_(EVT_WDF_IO_QUEUE_IO_RESUME) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_IO_QUEUE_IO_RESUME( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST Request - ); - -typedef EVT_WDF_IO_QUEUE_IO_RESUME *PFN_WDF_IO_QUEUE_IO_RESUME; - -typedef -_Function_class_(EVT_WDF_IO_QUEUE_IO_READ) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_IO_QUEUE_IO_READ( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST Request, - _In_ - size_t Length - ); - -typedef EVT_WDF_IO_QUEUE_IO_READ *PFN_WDF_IO_QUEUE_IO_READ; - -typedef -_Function_class_(EVT_WDF_IO_QUEUE_IO_WRITE) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_IO_QUEUE_IO_WRITE( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST Request, - _In_ - size_t Length - ); - -typedef EVT_WDF_IO_QUEUE_IO_WRITE *PFN_WDF_IO_QUEUE_IO_WRITE; - -typedef -_Function_class_(EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST Request, - _In_ - size_t OutputBufferLength, - _In_ - size_t InputBufferLength, - _In_ - ULONG IoControlCode - ); - -typedef EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL *PFN_WDF_IO_QUEUE_IO_DEVICE_CONTROL; - -typedef -_Function_class_(EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST Request, - _In_ - size_t OutputBufferLength, - _In_ - size_t InputBufferLength, - _In_ - ULONG IoControlCode - ); - -typedef EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL *PFN_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL; - - -typedef -_Function_class_(EVT_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST Request - ); - -typedef EVT_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE *PFN_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE; - - -typedef -_Function_class_(EVT_WDF_IO_QUEUE_STATE) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_IO_QUEUE_STATE( - _In_ - WDFQUEUE Queue, - _In_ - WDFCONTEXT Context - ); - -typedef EVT_WDF_IO_QUEUE_STATE *PFN_WDF_IO_QUEUE_STATE; - -// -// This is the structure used to configure an IoQueue and -// register callback events to it. -// - -typedef struct _WDF_IO_QUEUE_CONFIG { - - ULONG Size; - - WDF_IO_QUEUE_DISPATCH_TYPE DispatchType; - - WDF_TRI_STATE PowerManaged; - - BOOLEAN AllowZeroLengthRequests; - - BOOLEAN DefaultQueue; - - PFN_WDF_IO_QUEUE_IO_DEFAULT EvtIoDefault; - - PFN_WDF_IO_QUEUE_IO_READ EvtIoRead; - - PFN_WDF_IO_QUEUE_IO_WRITE EvtIoWrite; - - PFN_WDF_IO_QUEUE_IO_DEVICE_CONTROL EvtIoDeviceControl; - - PFN_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL EvtIoInternalDeviceControl; - - PFN_WDF_IO_QUEUE_IO_STOP EvtIoStop; - - PFN_WDF_IO_QUEUE_IO_RESUME EvtIoResume; - - PFN_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE EvtIoCanceledOnQueue; - - union { - struct { - ULONG NumberOfPresentedRequests; - } Parallel; - } Settings; - - WDFDRIVER Driver; -} WDF_IO_QUEUE_CONFIG, *PWDF_IO_QUEUE_CONFIG; - -VOID -FORCEINLINE -WDF_IO_QUEUE_CONFIG_INIT( - _Out_ PWDF_IO_QUEUE_CONFIG Config, - _In_ WDF_IO_QUEUE_DISPATCH_TYPE DispatchType - ) -{ - RtlZeroMemory(Config, sizeof(WDF_IO_QUEUE_CONFIG)); - - Config->Size = sizeof(WDF_IO_QUEUE_CONFIG); - Config->PowerManaged = WdfUseDefault; - Config->DispatchType = DispatchType; - if (Config->DispatchType == WdfIoQueueDispatchParallel) { - Config->Settings.Parallel.NumberOfPresentedRequests = (ULONG)-1; - } -} - -VOID -FORCEINLINE -WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE( - _Out_ PWDF_IO_QUEUE_CONFIG Config, - _In_ WDF_IO_QUEUE_DISPATCH_TYPE DispatchType - ) -{ - RtlZeroMemory(Config, sizeof(WDF_IO_QUEUE_CONFIG)); - - Config->Size = sizeof(WDF_IO_QUEUE_CONFIG); - Config->PowerManaged = WdfUseDefault; - Config->DefaultQueue = TRUE; - Config->DispatchType = DispatchType; - if (Config->DispatchType == WdfIoQueueDispatchParallel) { - Config->Settings.Parallel.NumberOfPresentedRequests = (ULONG)-1; - } -} - -typedef enum _WDF_IO_FORWARD_PROGRESS_ACTION { - WdfIoForwardProgressActionInvalid = 0x0, - WdfIoForwardProgressActionFailRequest, - WdfIoForwardProgressActionUseReservedRequest -} WDF_IO_FORWARD_PROGRESS_ACTION; - -typedef enum _WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY { - WdfIoForwardProgressInvalidPolicy =0x0, - WdfIoForwardProgressReservedPolicyAlwaysUseReservedRequest, - WdfIoForwardProgressReservedPolicyUseExamine, - WdfIoForwardProgressReservedPolicyPagingIO -} WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY; - -typedef -_Function_class_(EVT_WDF_IO_ALLOCATE_RESOURCES_FOR_RESERVED_REQUEST) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -EVT_WDF_IO_ALLOCATE_RESOURCES_FOR_RESERVED_REQUEST( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST Request - ); - -typedef EVT_WDF_IO_ALLOCATE_RESOURCES_FOR_RESERVED_REQUEST *PFN_WDF_IO_ALLOCATE_RESOURCES_FOR_RESERVED_REQUEST; - -typedef -_Function_class_(EVT_WDF_IO_ALLOCATE_REQUEST_RESOURCES) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -EVT_WDF_IO_ALLOCATE_REQUEST_RESOURCES( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST Request - ); - -typedef EVT_WDF_IO_ALLOCATE_REQUEST_RESOURCES *PFN_WDF_IO_ALLOCATE_REQUEST_RESOURCES; - -typedef -_Function_class_(EVT_WDF_IO_WDM_IRP_FOR_FORWARD_PROGRESS) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDF_IO_FORWARD_PROGRESS_ACTION -EVT_WDF_IO_WDM_IRP_FOR_FORWARD_PROGRESS( - _In_ - WDFQUEUE Queue, - _In_ - PIRP Irp - ); - -typedef EVT_WDF_IO_WDM_IRP_FOR_FORWARD_PROGRESS *PFN_WDF_IO_WDM_IRP_FOR_FORWARD_PROGRESS; - -typedef struct _WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY_SETTINGS { - union { - - struct { - PFN_WDF_IO_WDM_IRP_FOR_FORWARD_PROGRESS EvtIoWdmIrpForForwardProgress; - } ExaminePolicy; - - } Policy; -} WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY_SETTINGS; - -typedef struct _WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY { - ULONG Size; - - ULONG TotalForwardProgressRequests; - - // - // Specify the type of the policy here. - // - WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY ForwardProgressReservedPolicy; - - // - // Structure which contains the policy specific fields - // - WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY_SETTINGS ForwardProgressReservePolicySettings; - - // - // Callback for reserved request given at initialization time - // - PFN_WDF_IO_ALLOCATE_RESOURCES_FOR_RESERVED_REQUEST EvtIoAllocateResourcesForReservedRequest; - - // - // Callback for reserved request given at run time - // - PFN_WDF_IO_ALLOCATE_REQUEST_RESOURCES EvtIoAllocateRequestResources; - -} WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY, *PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY; - -VOID -FORCEINLINE -WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_DEFAULT_INIT( - _Out_ PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY Policy, - _In_ ULONG TotalForwardProgressRequests - ) -{ - RtlZeroMemory(Policy, sizeof(WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY)); - - Policy->Size = sizeof(WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY); - Policy->TotalForwardProgressRequests = TotalForwardProgressRequests; - Policy->ForwardProgressReservedPolicy = WdfIoForwardProgressReservedPolicyAlwaysUseReservedRequest; -} - - -VOID -FORCEINLINE -WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_EXAMINE_INIT( - _Out_ PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY Policy, - _In_ ULONG TotalForwardProgressRequests, - _In_ PFN_WDF_IO_WDM_IRP_FOR_FORWARD_PROGRESS EvtIoWdmIrpForForwardProgress - ) -{ - RtlZeroMemory(Policy, sizeof(WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY)); - - Policy->Size = sizeof(WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY); - Policy->TotalForwardProgressRequests = TotalForwardProgressRequests; - Policy->ForwardProgressReservedPolicy = WdfIoForwardProgressReservedPolicyUseExamine; - Policy->ForwardProgressReservePolicySettings.Policy.ExaminePolicy.EvtIoWdmIrpForForwardProgress = - EvtIoWdmIrpForForwardProgress; -} - -VOID -FORCEINLINE -WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_PAGINGIO_INIT( - _Out_ PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY Policy, - _In_ ULONG TotalForwardProgressRequests - ) -{ - RtlZeroMemory(Policy, sizeof(WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY)); - - Policy->Size = sizeof(WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY); - Policy->TotalForwardProgressRequests = TotalForwardProgressRequests; - Policy->ForwardProgressReservedPolicy = WdfIoForwardProgressReservedPolicyPagingIO; -} - - -// -// WDF Function: WdfIoQueueCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOQUEUECREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_IO_QUEUE_CONFIG Config, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES QueueAttributes, - _Out_opt_ - WDFQUEUE* Queue - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoQueueCreate( - _In_ - WDFDEVICE Device, - _In_ - PWDF_IO_QUEUE_CONFIG Config, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES QueueAttributes, - _Out_opt_ - WDFQUEUE* Queue - ) -{ - return ((PFN_WDFIOQUEUECREATE) WdfFunctions[WdfIoQueueCreateTableIndex])(WdfDriverGlobals, Device, Config, QueueAttributes, Queue); -} - - -// -// WDF Function: WdfIoQueueGetState -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDF_IO_QUEUE_STATE -(*PFN_WDFIOQUEUEGETSTATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue, - _Out_opt_ - PULONG QueueRequests, - _Out_opt_ - PULONG DriverRequests - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDF_IO_QUEUE_STATE -FORCEINLINE -WdfIoQueueGetState( - _In_ - WDFQUEUE Queue, - _Out_opt_ - PULONG QueueRequests, - _Out_opt_ - PULONG DriverRequests - ) -{ - return ((PFN_WDFIOQUEUEGETSTATE) WdfFunctions[WdfIoQueueGetStateTableIndex])(WdfDriverGlobals, Queue, QueueRequests, DriverRequests); -} - - -// -// WDF Function: WdfIoQueueStart -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOQUEUESTART)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfIoQueueStart( - _In_ - WDFQUEUE Queue - ) -{ - ((PFN_WDFIOQUEUESTART) WdfFunctions[WdfIoQueueStartTableIndex])(WdfDriverGlobals, Queue); -} - - -// -// WDF Function: WdfIoQueueStop -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOQUEUESTOP)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue, - _When_(Context != 0, _In_) - _When_(Context == 0, _In_opt_) - PFN_WDF_IO_QUEUE_STATE StopComplete, - _When_(StopComplete != 0, _In_) - _When_(StopComplete == 0, _In_opt_) - WDFCONTEXT Context - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfIoQueueStop( - _In_ - WDFQUEUE Queue, - _When_(Context != 0, _In_) - _When_(Context == 0, _In_opt_) - PFN_WDF_IO_QUEUE_STATE StopComplete, - _When_(StopComplete != 0, _In_) - _When_(StopComplete == 0, _In_opt_) - WDFCONTEXT Context - ) -{ - ((PFN_WDFIOQUEUESTOP) WdfFunctions[WdfIoQueueStopTableIndex])(WdfDriverGlobals, Queue, StopComplete, Context); -} - - -// -// WDF Function: WdfIoQueueStopSynchronously -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOQUEUESTOPSYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfIoQueueStopSynchronously( - _In_ - WDFQUEUE Queue - ) -{ - ((PFN_WDFIOQUEUESTOPSYNCHRONOUSLY) WdfFunctions[WdfIoQueueStopSynchronouslyTableIndex])(WdfDriverGlobals, Queue); -} - - -// -// WDF Function: WdfIoQueueGetDevice -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFDEVICE -(*PFN_WDFIOQUEUEGETDEVICE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFDEVICE -FORCEINLINE -WdfIoQueueGetDevice( - _In_ - WDFQUEUE Queue - ) -{ - return ((PFN_WDFIOQUEUEGETDEVICE) WdfFunctions[WdfIoQueueGetDeviceTableIndex])(WdfDriverGlobals, Queue); -} - - -// -// WDF Function: WdfIoQueueRetrieveNextRequest -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOQUEUERETRIEVENEXTREQUEST)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue, - _Out_ - WDFREQUEST* OutRequest - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoQueueRetrieveNextRequest( - _In_ - WDFQUEUE Queue, - _Out_ - WDFREQUEST* OutRequest - ) -{ - return ((PFN_WDFIOQUEUERETRIEVENEXTREQUEST) WdfFunctions[WdfIoQueueRetrieveNextRequestTableIndex])(WdfDriverGlobals, Queue, OutRequest); -} - - -// -// WDF Function: WdfIoQueueRetrieveRequestByFileObject -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOQUEUERETRIEVEREQUESTBYFILEOBJECT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue, - _In_ - WDFFILEOBJECT FileObject, - _Out_ - WDFREQUEST* OutRequest - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoQueueRetrieveRequestByFileObject( - _In_ - WDFQUEUE Queue, - _In_ - WDFFILEOBJECT FileObject, - _Out_ - WDFREQUEST* OutRequest - ) -{ - return ((PFN_WDFIOQUEUERETRIEVEREQUESTBYFILEOBJECT) WdfFunctions[WdfIoQueueRetrieveRequestByFileObjectTableIndex])(WdfDriverGlobals, Queue, FileObject, OutRequest); -} - - -// -// WDF Function: WdfIoQueueFindRequest -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOQUEUEFINDREQUEST)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue, - _In_opt_ - WDFREQUEST FoundRequest, - _In_opt_ - WDFFILEOBJECT FileObject, - _Inout_opt_ - PWDF_REQUEST_PARAMETERS Parameters, - _Out_ - WDFREQUEST* OutRequest - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoQueueFindRequest( - _In_ - WDFQUEUE Queue, - _In_opt_ - WDFREQUEST FoundRequest, - _In_opt_ - WDFFILEOBJECT FileObject, - _Inout_opt_ - PWDF_REQUEST_PARAMETERS Parameters, - _Out_ - WDFREQUEST* OutRequest - ) -{ - return ((PFN_WDFIOQUEUEFINDREQUEST) WdfFunctions[WdfIoQueueFindRequestTableIndex])(WdfDriverGlobals, Queue, FoundRequest, FileObject, Parameters, OutRequest); -} - - -// -// WDF Function: WdfIoQueueRetrieveFoundRequest -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOQUEUERETRIEVEFOUNDREQUEST)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST FoundRequest, - _Out_ - WDFREQUEST* OutRequest - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoQueueRetrieveFoundRequest( - _In_ - WDFQUEUE Queue, - _In_ - WDFREQUEST FoundRequest, - _Out_ - WDFREQUEST* OutRequest - ) -{ - return ((PFN_WDFIOQUEUERETRIEVEFOUNDREQUEST) WdfFunctions[WdfIoQueueRetrieveFoundRequestTableIndex])(WdfDriverGlobals, Queue, FoundRequest, OutRequest); -} - - -// -// WDF Function: WdfIoQueueDrainSynchronously -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOQUEUEDRAINSYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfIoQueueDrainSynchronously( - _In_ - WDFQUEUE Queue - ) -{ - ((PFN_WDFIOQUEUEDRAINSYNCHRONOUSLY) WdfFunctions[WdfIoQueueDrainSynchronouslyTableIndex])(WdfDriverGlobals, Queue); -} - - -// -// WDF Function: WdfIoQueueDrain -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOQUEUEDRAIN)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue, - _When_(Context != 0, _In_) - _When_(Context == 0, _In_opt_) - PFN_WDF_IO_QUEUE_STATE DrainComplete, - _When_(DrainComplete != 0, _In_) - _When_(DrainComplete == 0, _In_opt_) - WDFCONTEXT Context - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfIoQueueDrain( - _In_ - WDFQUEUE Queue, - _When_(Context != 0, _In_) - _When_(Context == 0, _In_opt_) - PFN_WDF_IO_QUEUE_STATE DrainComplete, - _When_(DrainComplete != 0, _In_) - _When_(DrainComplete == 0, _In_opt_) - WDFCONTEXT Context - ) -{ - ((PFN_WDFIOQUEUEDRAIN) WdfFunctions[WdfIoQueueDrainTableIndex])(WdfDriverGlobals, Queue, DrainComplete, Context); -} - - -// -// WDF Function: WdfIoQueuePurgeSynchronously -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOQUEUEPURGESYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfIoQueuePurgeSynchronously( - _In_ - WDFQUEUE Queue - ) -{ - ((PFN_WDFIOQUEUEPURGESYNCHRONOUSLY) WdfFunctions[WdfIoQueuePurgeSynchronouslyTableIndex])(WdfDriverGlobals, Queue); -} - - -// -// WDF Function: WdfIoQueuePurge -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOQUEUEPURGE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue, - _When_(Context != 0, _In_) - _When_(Context == 0, _In_opt_) - PFN_WDF_IO_QUEUE_STATE PurgeComplete, - _When_(PurgeComplete != 0, _In_) - _When_(PurgeComplete == 0, _In_opt_) - WDFCONTEXT Context - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfIoQueuePurge( - _In_ - WDFQUEUE Queue, - _When_(Context != 0, _In_) - _When_(Context == 0, _In_opt_) - PFN_WDF_IO_QUEUE_STATE PurgeComplete, - _When_(PurgeComplete != 0, _In_) - _When_(PurgeComplete == 0, _In_opt_) - WDFCONTEXT Context - ) -{ - ((PFN_WDFIOQUEUEPURGE) WdfFunctions[WdfIoQueuePurgeTableIndex])(WdfDriverGlobals, Queue, PurgeComplete, Context); -} - - -// -// WDF Function: WdfIoQueueReadyNotify -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOQUEUEREADYNOTIFY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue, - _In_opt_ - PFN_WDF_IO_QUEUE_STATE QueueReady, - _In_opt_ - WDFCONTEXT Context - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoQueueReadyNotify( - _In_ - WDFQUEUE Queue, - _In_opt_ - PFN_WDF_IO_QUEUE_STATE QueueReady, - _In_opt_ - WDFCONTEXT Context - ) -{ - return ((PFN_WDFIOQUEUEREADYNOTIFY) WdfFunctions[WdfIoQueueReadyNotifyTableIndex])(WdfDriverGlobals, Queue, QueueReady, Context); -} - - -// -// WDF Function: WdfIoQueueStopAndPurge -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOQUEUESTOPANDPURGE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue, - _When_(Context != 0, _In_) - _When_(Context == 0, _In_opt_) - PFN_WDF_IO_QUEUE_STATE StopAndPurgeComplete, - _When_(StopAndPurgeComplete != 0, _In_) - _When_(StopAndPurgeComplete == 0, _In_opt_) - WDFCONTEXT Context - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfIoQueueStopAndPurge( - _In_ - WDFQUEUE Queue, - _When_(Context != 0, _In_) - _When_(Context == 0, _In_opt_) - PFN_WDF_IO_QUEUE_STATE StopAndPurgeComplete, - _When_(StopAndPurgeComplete != 0, _In_) - _When_(StopAndPurgeComplete == 0, _In_opt_) - WDFCONTEXT Context - ) -{ - ((PFN_WDFIOQUEUESTOPANDPURGE) WdfFunctions[WdfIoQueueStopAndPurgeTableIndex])(WdfDriverGlobals, Queue, StopAndPurgeComplete, Context); -} - - -// -// WDF Function: WdfIoQueueStopAndPurgeSynchronously -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOQUEUESTOPANDPURGESYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFQUEUE Queue - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfIoQueueStopAndPurgeSynchronously( - _In_ - WDFQUEUE Queue - ) -{ - ((PFN_WDFIOQUEUESTOPANDPURGESYNCHRONOUSLY) WdfFunctions[WdfIoQueueStopAndPurgeSynchronouslyTableIndex])(WdfDriverGlobals, Queue); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfiotarget.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfiotarget.h deleted file mode 100644 index 6e0d9a6..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfiotarget.h +++ /dev/null @@ -1,927 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - WdfIoTarget.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef enum _WDF_IO_TARGET_STATE { - WdfIoTargetStateUndefined = 0, - WdfIoTargetStarted, - WdfIoTargetStopped, - WdfIoTargetClosedForQueryRemove, - WdfIoTargetClosed, - WdfIoTargetDeleted, - WdfIoTargetPurged, -} WDF_IO_TARGET_STATE, *PWDF_IO_TARGET_STATE; - - -typedef enum _WDF_IO_TARGET_OPEN_TYPE { - WdfIoTargetOpenUndefined = 0, - WdfIoTargetOpenUseExistingDevice = 1, - WdfIoTargetOpenByName = 2, - WdfIoTargetOpenReopen = 3, - WdfIoTargetOpenLocalTargetByFile = 4, -} WDF_IO_TARGET_OPEN_TYPE; - - -typedef enum _WDF_IO_TARGET_SENT_IO_ACTION { - WdfIoTargetSentIoUndefined = 0, - WdfIoTargetCancelSentIo, - WdfIoTargetWaitForSentIoToComplete, - WdfIoTargetLeaveSentIoPending, -} WDF_IO_TARGET_SENT_IO_ACTION; - - -typedef enum _WDF_IO_TARGET_PURGE_IO_ACTION { - WdfIoTargetPurgeIoUndefined = 0, - WdfIoTargetPurgeIoAndWait = 1, - WdfIoTargetPurgeIo = 2, -} WDF_IO_TARGET_PURGE_IO_ACTION; - - -typedef -_Function_class_(EVT_WDF_IO_TARGET_QUERY_REMOVE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_IO_TARGET_QUERY_REMOVE( - _In_ - WDFIOTARGET IoTarget - ); - -typedef EVT_WDF_IO_TARGET_QUERY_REMOVE *PFN_WDF_IO_TARGET_QUERY_REMOVE; - -typedef -_Function_class_(EVT_WDF_IO_TARGET_REMOVE_CANCELED) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_IO_TARGET_REMOVE_CANCELED( - _In_ - WDFIOTARGET IoTarget - ); - -typedef EVT_WDF_IO_TARGET_REMOVE_CANCELED *PFN_WDF_IO_TARGET_REMOVE_CANCELED; - -typedef -_Function_class_(EVT_WDF_IO_TARGET_REMOVE_COMPLETE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_IO_TARGET_REMOVE_COMPLETE( - _In_ - WDFIOTARGET IoTarget - ); - -typedef EVT_WDF_IO_TARGET_REMOVE_COMPLETE *PFN_WDF_IO_TARGET_REMOVE_COMPLETE; - -typedef struct _WDF_IO_TARGET_OPEN_PARAMS { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // Indicates which fields of this structure are going to be used in - // creating the WDFIOTARGET. - // - WDF_IO_TARGET_OPEN_TYPE Type; - - // - // Notification when the target is being queried for removal. - // If !NT_SUCCESS is returned, the query will fail and the target will - // remain opened. - // - PFN_WDF_IO_TARGET_QUERY_REMOVE EvtIoTargetQueryRemove; - - // - // The previous query remove has been canceled and the target can now be - // reopened. - // - PFN_WDF_IO_TARGET_REMOVE_CANCELED EvtIoTargetRemoveCanceled; - - // - // The query remove has succeeded and the target is now removed from the - // system. - // - PFN_WDF_IO_TARGET_REMOVE_COMPLETE EvtIoTargetRemoveComplete; - - - // - // ========== WdfIoTargetOpenUseExistingDevice begin ========== - // - // The device object to send requests to - // - PDEVICE_OBJECT TargetDeviceObject; - - // - // File object representing the TargetDeviceObject. The PFILE_OBJECT will - // be passed as a parameter in all requests sent to the resulting - // WDFIOTARGET. - // - PFILE_OBJECT TargetFileObject; - - // ========== WdfIoTargetOpenUseExistingDevice end ========== - - // ========== WdfIoTargetOpenByName begin ========== - // - // Name of the device to open. - // - UNICODE_STRING TargetDeviceName; - - // - // The access desired on the device being opened up, ie WDM FILE_XXX_ACCESS - // such as FILE_ANY_ACCESS, FILE_SPECIAL_ACCESS, FILE_READ_ACCESS, or - // FILE_WRITE_ACCESS or you can use values such as GENERIC_READ, - // GENERIC_WRITE, or GENERIC_ALL. - // - // - // The requested access to the file or device, which can be summarized as - // read, write, both or neither zero). For more information about - // this member, see the dwDesiredAccess parameter of CreateFile in the - // Windows SDK. Note that ACCESS_MASK data type is a DWORD value. - // - // - ACCESS_MASK DesiredAccess; - - // - // - // Share access desired on the target being opened, ie WDM FILE_SHARE_XXX - // values such as FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_DELETE. - // A zero value means exclusive access to the target. - // - // - // - // The type of sharing to allow for the file. For more information about - // this member, see the dwShareMode parameter of CreateFile in the - // Windows SDK. A value of 0 means exclusive access. - // - // - ULONG ShareAccess; - - // - // - // File attributes, see ZwCreateFile in the DDK for a list of valid - // values and their meaning. - // - // - // Additional flags and attributes for the file. For more information about - // this member, see the dwFlagsAndAttributes parameter of CreateFile - // in the Windows SDK. - // - // - ULONG FileAttributes; - - // - // - // Create disposition, see ZwCreateFile in the DDK for a list of valid - // values and their meaning. - // - // - // The action to take if the file already exists. For more information - // about this member, see the dwCreationDisposition parameter of - // CreateFile in the Windows SDK. - // - // - ULONG CreateDisposition; - - // - // - // Options for opening the device, see CreateOptions for ZwCreateFile in the - // DDK for a list of valid values and their meaning. - // - ULONG CreateOptions; - - // - // - // - PVOID EaBuffer; - - // - // - // - ULONG EaBufferLength; - - // - // - // - PLONGLONG AllocationSize; - - // ========== WdfIoTargetOpenByName end ========== - - // - // - // - // On return for a create by name, this will contain one of the following - // values: FILE_CREATED, FILE_OPENED, FILE_OVERWRITTEN, FILE_SUPERSEDED, - // FILE_EXISTS, FILE_DOES_NOT_EXIST - // - ULONG FileInformation; - - // ========== WdfIoTargetOpenLocalTargetByFile begin ========== - - // - // A UNICODE_STRING-formatted string that contains the - // name of the file to create a file object from. This parameter is - // optional, and is applicable only when Type parameter is - // WdfIoTargetOpenLocalTargetByFile. The driver can leave this member - // unchanged if the driver does not have to create the file object - // from a file name. If the driver must supply a name, the string that - // the driver passes must not contain any path separator characters - // ("/" or "\"). - // - UNICODE_STRING FileName; - - // ========== WdfIoTargetOpenLocalTargetByFile end ========== - -} WDF_IO_TARGET_OPEN_PARAMS, *PWDF_IO_TARGET_OPEN_PARAMS; - - - -VOID -FORCEINLINE -WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_FILE( - _Out_ PWDF_IO_TARGET_OPEN_PARAMS Params, - _In_opt_ PCUNICODE_STRING FileName - ) -{ - RtlZeroMemory(Params, sizeof(WDF_IO_TARGET_OPEN_PARAMS)); - - Params->Size = sizeof(WDF_IO_TARGET_OPEN_PARAMS); - Params->Type = WdfIoTargetOpenLocalTargetByFile; - - if (FileName != NULL) { - RtlCopyMemory(&Params->FileName, - FileName, - sizeof(UNICODE_STRING)); - } -} - -VOID -FORCEINLINE -WDF_IO_TARGET_OPEN_PARAMS_INIT_CREATE_BY_NAME( - _Out_ PWDF_IO_TARGET_OPEN_PARAMS Params, - _In_ PCUNICODE_STRING TargetDeviceName, - _In_ ACCESS_MASK DesiredAccess - ) -{ - RtlZeroMemory(Params, sizeof(WDF_IO_TARGET_OPEN_PARAMS)); - - Params->Size = sizeof(WDF_IO_TARGET_OPEN_PARAMS); - Params->Type = WdfIoTargetOpenByName; - - RtlCopyMemory(&Params->TargetDeviceName, - TargetDeviceName, - sizeof(UNICODE_STRING)); - - Params->DesiredAccess = DesiredAccess; - - // - // Exclusive Access - // - Params->ShareAccess = 0; - - Params->FileAttributes = FILE_ATTRIBUTE_NORMAL; -} - -VOID -FORCEINLINE -WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME( - _Out_ PWDF_IO_TARGET_OPEN_PARAMS Params, - _In_ PCUNICODE_STRING TargetDeviceName, - _In_ ACCESS_MASK DesiredAccess - ) -{ - WDF_IO_TARGET_OPEN_PARAMS_INIT_CREATE_BY_NAME(Params, - TargetDeviceName, - DesiredAccess); - Params->CreateDisposition = OPEN_EXISTING; -} - - - -VOID -FORCEINLINE -WDF_IO_TARGET_OPEN_PARAMS_INIT_REOPEN( - _Out_ PWDF_IO_TARGET_OPEN_PARAMS Params - ) -{ - RtlZeroMemory(Params, sizeof(WDF_IO_TARGET_OPEN_PARAMS)); - - Params->Size = sizeof(WDF_IO_TARGET_OPEN_PARAMS); - Params->Type = WdfIoTargetOpenReopen; -} - - -// -// WDF Function: WdfIoTargetCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOTARGETCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES IoTargetAttributes, - _Out_ - WDFIOTARGET* IoTarget - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoTargetCreate( - _In_ - WDFDEVICE Device, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES IoTargetAttributes, - _Out_ - WDFIOTARGET* IoTarget - ) -{ - return ((PFN_WDFIOTARGETCREATE) WdfFunctions[WdfIoTargetCreateTableIndex])(WdfDriverGlobals, Device, IoTargetAttributes, IoTarget); -} - - -// -// WDF Function: WdfIoTargetOpen -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOTARGETOPEN)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget, - _In_ - PWDF_IO_TARGET_OPEN_PARAMS OpenParams - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoTargetOpen( - _In_ - WDFIOTARGET IoTarget, - _In_ - PWDF_IO_TARGET_OPEN_PARAMS OpenParams - ) -{ - return ((PFN_WDFIOTARGETOPEN) WdfFunctions[WdfIoTargetOpenTableIndex])(WdfDriverGlobals, IoTarget, OpenParams); -} - - -// -// WDF Function: WdfIoTargetCloseForQueryRemove -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOTARGETCLOSEFORQUERYREMOVE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfIoTargetCloseForQueryRemove( - _In_ - WDFIOTARGET IoTarget - ) -{ - ((PFN_WDFIOTARGETCLOSEFORQUERYREMOVE) WdfFunctions[WdfIoTargetCloseForQueryRemoveTableIndex])(WdfDriverGlobals, IoTarget); -} - - -// -// WDF Function: WdfIoTargetClose -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFIOTARGETCLOSE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfIoTargetClose( - _In_ - WDFIOTARGET IoTarget - ) -{ - ((PFN_WDFIOTARGETCLOSE) WdfFunctions[WdfIoTargetCloseTableIndex])(WdfDriverGlobals, IoTarget); -} - - -// -// WDF Function: WdfIoTargetStart -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOTARGETSTART)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoTargetStart( - _In_ - WDFIOTARGET IoTarget - ) -{ - return ((PFN_WDFIOTARGETSTART) WdfFunctions[WdfIoTargetStartTableIndex])(WdfDriverGlobals, IoTarget); -} - - -// -// WDF Function: WdfIoTargetStop -// -typedef -_When_(Action == 3, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(Action == 0 || Action == 1 || Action == 2, _IRQL_requires_max_(PASSIVE_LEVEL)) -WDFAPI -VOID -(*PFN_WDFIOTARGETSTOP)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget, - _In_ - _Strict_type_match_ - WDF_IO_TARGET_SENT_IO_ACTION Action - ); - -_When_(Action == 3, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(Action == 0 || Action == 1 || Action == 2, _IRQL_requires_max_(PASSIVE_LEVEL)) -VOID -FORCEINLINE -WdfIoTargetStop( - _In_ - WDFIOTARGET IoTarget, - _In_ - _Strict_type_match_ - WDF_IO_TARGET_SENT_IO_ACTION Action - ) -{ - ((PFN_WDFIOTARGETSTOP) WdfFunctions[WdfIoTargetStopTableIndex])(WdfDriverGlobals, IoTarget, Action); -} - - -// -// WDF Function: WdfIoTargetPurge -// -typedef -_When_(Action == 2, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(Action == 0 || Action == 1, _IRQL_requires_max_(PASSIVE_LEVEL)) -WDFAPI -VOID -(*PFN_WDFIOTARGETPURGE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget, - _In_ - _Strict_type_match_ - WDF_IO_TARGET_PURGE_IO_ACTION Action - ); - -_When_(Action == 2, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(Action == 0 || Action == 1, _IRQL_requires_max_(PASSIVE_LEVEL)) -VOID -FORCEINLINE -WdfIoTargetPurge( - _In_ - WDFIOTARGET IoTarget, - _In_ - _Strict_type_match_ - WDF_IO_TARGET_PURGE_IO_ACTION Action - ) -{ - ((PFN_WDFIOTARGETPURGE) WdfFunctions[WdfIoTargetPurgeTableIndex])(WdfDriverGlobals, IoTarget, Action); -} - - -// -// WDF Function: WdfIoTargetGetState -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDF_IO_TARGET_STATE -(*PFN_WDFIOTARGETGETSTATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDF_IO_TARGET_STATE -FORCEINLINE -WdfIoTargetGetState( - _In_ - WDFIOTARGET IoTarget - ) -{ - return ((PFN_WDFIOTARGETGETSTATE) WdfFunctions[WdfIoTargetGetStateTableIndex])(WdfDriverGlobals, IoTarget); -} - - -// -// WDF Function: WdfIoTargetGetDevice -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFDEVICE -(*PFN_WDFIOTARGETGETDEVICE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFDEVICE -FORCEINLINE -WdfIoTargetGetDevice( - _In_ - WDFIOTARGET IoTarget - ) -{ - return ((PFN_WDFIOTARGETGETDEVICE) WdfFunctions[WdfIoTargetGetDeviceTableIndex])(WdfDriverGlobals, IoTarget); -} - - -// -// WDF Function: WdfIoTargetWdmGetTargetFileHandle -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -HANDLE -(*PFN_WDFIOTARGETWDMGETTARGETFILEHANDLE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -HANDLE -FORCEINLINE -WdfIoTargetWdmGetTargetFileHandle( - _In_ - WDFIOTARGET IoTarget - ) -{ - return ((PFN_WDFIOTARGETWDMGETTARGETFILEHANDLE) WdfFunctions[WdfIoTargetWdmGetTargetFileHandleTableIndex])(WdfDriverGlobals, IoTarget); -} - - -// -// WDF Function: WdfIoTargetSendReadSynchronously -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOTARGETSENDREADSYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR OutputBuffer, - _In_opt_ - PLONGLONG DeviceOffset, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _Out_opt_ - PULONG_PTR BytesRead - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoTargetSendReadSynchronously( - _In_ - WDFIOTARGET IoTarget, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR OutputBuffer, - _In_opt_ - PLONGLONG DeviceOffset, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _Out_opt_ - PULONG_PTR BytesRead - ) -{ - return ((PFN_WDFIOTARGETSENDREADSYNCHRONOUSLY) WdfFunctions[WdfIoTargetSendReadSynchronouslyTableIndex])(WdfDriverGlobals, IoTarget, Request, OutputBuffer, DeviceOffset, RequestOptions, BytesRead); -} - - -// -// WDF Function: WdfIoTargetFormatRequestForRead -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOTARGETFORMATREQUESTFORREAD)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget, - _In_ - WDFREQUEST Request, - _In_opt_ - WDFMEMORY OutputBuffer, - _In_opt_ - PWDFMEMORY_OFFSET OutputBufferOffset, - _In_opt_ - PLONGLONG DeviceOffset - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoTargetFormatRequestForRead( - _In_ - WDFIOTARGET IoTarget, - _In_ - WDFREQUEST Request, - _In_opt_ - WDFMEMORY OutputBuffer, - _In_opt_ - PWDFMEMORY_OFFSET OutputBufferOffset, - _In_opt_ - PLONGLONG DeviceOffset - ) -{ - return ((PFN_WDFIOTARGETFORMATREQUESTFORREAD) WdfFunctions[WdfIoTargetFormatRequestForReadTableIndex])(WdfDriverGlobals, IoTarget, Request, OutputBuffer, OutputBufferOffset, DeviceOffset); -} - - -// -// WDF Function: WdfIoTargetSendWriteSynchronously -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOTARGETSENDWRITESYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR InputBuffer, - _In_opt_ - PLONGLONG DeviceOffset, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _Out_opt_ - PULONG_PTR BytesWritten - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoTargetSendWriteSynchronously( - _In_ - WDFIOTARGET IoTarget, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR InputBuffer, - _In_opt_ - PLONGLONG DeviceOffset, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _Out_opt_ - PULONG_PTR BytesWritten - ) -{ - return ((PFN_WDFIOTARGETSENDWRITESYNCHRONOUSLY) WdfFunctions[WdfIoTargetSendWriteSynchronouslyTableIndex])(WdfDriverGlobals, IoTarget, Request, InputBuffer, DeviceOffset, RequestOptions, BytesWritten); -} - - -// -// WDF Function: WdfIoTargetFormatRequestForWrite -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOTARGETFORMATREQUESTFORWRITE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget, - _In_ - WDFREQUEST Request, - _In_opt_ - WDFMEMORY InputBuffer, - _In_opt_ - PWDFMEMORY_OFFSET InputBufferOffset, - _In_opt_ - PLONGLONG DeviceOffset - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoTargetFormatRequestForWrite( - _In_ - WDFIOTARGET IoTarget, - _In_ - WDFREQUEST Request, - _In_opt_ - WDFMEMORY InputBuffer, - _In_opt_ - PWDFMEMORY_OFFSET InputBufferOffset, - _In_opt_ - PLONGLONG DeviceOffset - ) -{ - return ((PFN_WDFIOTARGETFORMATREQUESTFORWRITE) WdfFunctions[WdfIoTargetFormatRequestForWriteTableIndex])(WdfDriverGlobals, IoTarget, Request, InputBuffer, InputBufferOffset, DeviceOffset); -} - - -// -// WDF Function: WdfIoTargetSendIoctlSynchronously -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOTARGETSENDIOCTLSYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget, - _In_opt_ - WDFREQUEST Request, - _In_ - ULONG IoctlCode, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR InputBuffer, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR OutputBuffer, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _Out_opt_ - PULONG_PTR BytesReturned - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoTargetSendIoctlSynchronously( - _In_ - WDFIOTARGET IoTarget, - _In_opt_ - WDFREQUEST Request, - _In_ - ULONG IoctlCode, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR InputBuffer, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR OutputBuffer, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _Out_opt_ - PULONG_PTR BytesReturned - ) -{ - return ((PFN_WDFIOTARGETSENDIOCTLSYNCHRONOUSLY) WdfFunctions[WdfIoTargetSendIoctlSynchronouslyTableIndex])(WdfDriverGlobals, IoTarget, Request, IoctlCode, InputBuffer, OutputBuffer, RequestOptions, BytesReturned); -} - - -// -// WDF Function: WdfIoTargetFormatRequestForIoctl -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFIOTARGETFORMATREQUESTFORIOCTL)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFIOTARGET IoTarget, - _In_ - WDFREQUEST Request, - _In_ - ULONG IoctlCode, - _In_opt_ - WDFMEMORY InputBuffer, - _In_opt_ - PWDFMEMORY_OFFSET InputBufferOffset, - _In_opt_ - WDFMEMORY OutputBuffer, - _In_opt_ - PWDFMEMORY_OFFSET OutputBufferOffset - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfIoTargetFormatRequestForIoctl( - _In_ - WDFIOTARGET IoTarget, - _In_ - WDFREQUEST Request, - _In_ - ULONG IoctlCode, - _In_opt_ - WDFMEMORY InputBuffer, - _In_opt_ - PWDFMEMORY_OFFSET InputBufferOffset, - _In_opt_ - WDFMEMORY OutputBuffer, - _In_opt_ - PWDFMEMORY_OFFSET OutputBufferOffset - ) -{ - return ((PFN_WDFIOTARGETFORMATREQUESTFORIOCTL) WdfFunctions[WdfIoTargetFormatRequestForIoctlTableIndex])(WdfDriverGlobals, IoTarget, Request, IoctlCode, InputBuffer, InputBufferOffset, OutputBuffer, OutputBufferOffset); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfmemory.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfmemory.h deleted file mode 100644 index 46e23fd..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfmemory.h +++ /dev/null @@ -1,362 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - WdfMemory.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef enum _WDF_MEMORY_DESCRIPTOR_TYPE { - WdfMemoryDescriptorTypeInvalid = 0, - WdfMemoryDescriptorTypeBuffer, - WdfMemoryDescriptorTypeMdl, - WdfMemoryDescriptorTypeHandle, -} WDF_MEMORY_DESCRIPTOR_TYPE; - - -typedef struct _WDFMEMORY_OFFSET { - // - // Offset into the WDFMEMORY that the operation should start at. - // - size_t BufferOffset; - - // - // Number of bytes that the operation should access. If 0, the entire - // length of the WDFMEMORY buffer will be used in the operation or ignored - // depending on the API. - // - size_t BufferLength; - -} WDFMEMORY_OFFSET, *PWDFMEMORY_OFFSET; - -typedef struct _WDF_MEMORY_DESCRIPTOR { - WDF_MEMORY_DESCRIPTOR_TYPE Type; - - union { - struct { - PVOID Buffer; - - ULONG Length; - } BufferType; - - struct { - PMDL Mdl; - - ULONG BufferLength; - } MdlType; - - struct { - WDFMEMORY Memory; - PWDFMEMORY_OFFSET Offsets; - } HandleType; - } u; - -} WDF_MEMORY_DESCRIPTOR, *PWDF_MEMORY_DESCRIPTOR; - -VOID -FORCEINLINE -WDF_MEMORY_DESCRIPTOR_INIT_BUFFER( - _Out_ PWDF_MEMORY_DESCRIPTOR Descriptor, - _In_ PVOID Buffer, - _In_ ULONG BufferLength - ) -{ - RtlZeroMemory(Descriptor, sizeof(WDF_MEMORY_DESCRIPTOR)); - - Descriptor->Type = WdfMemoryDescriptorTypeBuffer; - Descriptor->u.BufferType.Buffer = Buffer; - Descriptor->u.BufferType.Length = BufferLength; -} - -VOID -FORCEINLINE -WDF_MEMORY_DESCRIPTOR_INIT_HANDLE( - _Out_ PWDF_MEMORY_DESCRIPTOR Descriptor, - _In_ WDFMEMORY Memory, - _In_opt_ PWDFMEMORY_OFFSET Offsets - ) -{ - RtlZeroMemory(Descriptor, sizeof(WDF_MEMORY_DESCRIPTOR)); - - Descriptor->Type = WdfMemoryDescriptorTypeHandle; - Descriptor->u.HandleType.Memory = Memory; - Descriptor->u.HandleType.Offsets = Offsets; -} - - -// -// WDF Function: WdfMemoryCreate -// -typedef -_Must_inspect_result_ -_When_(PoolType == 1 || PoolType == 257, _IRQL_requires_max_(APC_LEVEL)) -_When_(PoolType == 0 || PoolType == 256, _IRQL_requires_max_(DISPATCH_LEVEL)) -WDFAPI -NTSTATUS -(*PFN_WDFMEMORYCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - ULONG PoolTag, - _In_ - _When_(BufferSize == 0, __drv_reportError(BufferSize cannot be zero)) - size_t BufferSize, - _Out_ - WDFMEMORY* Memory, - _Outptr_opt_result_bytebuffer_(BufferSize) - PVOID* Buffer - ); - -_Must_inspect_result_ -_When_(PoolType == 1 || PoolType == 257, _IRQL_requires_max_(APC_LEVEL)) -_When_(PoolType == 0 || PoolType == 256, _IRQL_requires_max_(DISPATCH_LEVEL)) -NTSTATUS -FORCEINLINE -WdfMemoryCreate( - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - ULONG PoolTag, - _In_ - _When_(BufferSize == 0, __drv_reportError(BufferSize cannot be zero)) - size_t BufferSize, - _Out_ - WDFMEMORY* Memory, - _Outptr_opt_result_bytebuffer_(BufferSize) - PVOID* Buffer - ) -{ - return ((PFN_WDFMEMORYCREATE) WdfFunctions[WdfMemoryCreateTableIndex])(WdfDriverGlobals, Attributes, PoolType, PoolTag, BufferSize, Memory, Buffer); -} - - -// -// WDF Function: WdfMemoryCreatePreallocated -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFMEMORYCREATEPREALLOCATED)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _In_ __drv_aliasesMem - PVOID Buffer, - _In_ - _When_(BufferSize == 0, __drv_reportError(BufferSize cannot be zero)) - size_t BufferSize, - _Out_ - WDFMEMORY* Memory - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfMemoryCreatePreallocated( - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _In_ __drv_aliasesMem - PVOID Buffer, - _In_ - _When_(BufferSize == 0, __drv_reportError(BufferSize cannot be zero)) - size_t BufferSize, - _Out_ - WDFMEMORY* Memory - ) -{ - return ((PFN_WDFMEMORYCREATEPREALLOCATED) WdfFunctions[WdfMemoryCreatePreallocatedTableIndex])(WdfDriverGlobals, Attributes, Buffer, BufferSize, Memory); -} - - -// -// WDF Function: WdfMemoryGetBuffer -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -PVOID -(*PFN_WDFMEMORYGETBUFFER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFMEMORY Memory, - _Out_opt_ - size_t* BufferSize - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -PVOID -FORCEINLINE -WdfMemoryGetBuffer( - _In_ - WDFMEMORY Memory, - _Out_opt_ - size_t* BufferSize - ) -{ - return ((PFN_WDFMEMORYGETBUFFER) WdfFunctions[WdfMemoryGetBufferTableIndex])(WdfDriverGlobals, Memory, BufferSize); -} - - -// -// WDF Function: WdfMemoryAssignBuffer -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFMEMORYASSIGNBUFFER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFMEMORY Memory, - _Pre_notnull_ _Pre_writable_byte_size_(BufferSize) - PVOID Buffer, - _In_ - _When_(BufferSize == 0, __drv_reportError(BufferSize cannot be zero)) - size_t BufferSize - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfMemoryAssignBuffer( - _In_ - WDFMEMORY Memory, - _Pre_notnull_ _Pre_writable_byte_size_(BufferSize) - PVOID Buffer, - _In_ - _When_(BufferSize == 0, __drv_reportError(BufferSize cannot be zero)) - size_t BufferSize - ) -{ - return ((PFN_WDFMEMORYASSIGNBUFFER) WdfFunctions[WdfMemoryAssignBufferTableIndex])(WdfDriverGlobals, Memory, Buffer, BufferSize); -} - - -// -// WDF Function: WdfMemoryCopyToBuffer -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFMEMORYCOPYTOBUFFER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFMEMORY SourceMemory, - _In_ - size_t SourceOffset, - _Out_writes_bytes_( NumBytesToCopyTo ) - PVOID Buffer, - _In_ - _When_(NumBytesToCopyTo == 0, __drv_reportError(NumBytesToCopyTo cannot be zero)) - size_t NumBytesToCopyTo - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfMemoryCopyToBuffer( - _In_ - WDFMEMORY SourceMemory, - _In_ - size_t SourceOffset, - _Out_writes_bytes_( NumBytesToCopyTo ) - PVOID Buffer, - _In_ - _When_(NumBytesToCopyTo == 0, __drv_reportError(NumBytesToCopyTo cannot be zero)) - size_t NumBytesToCopyTo - ) -{ - return ((PFN_WDFMEMORYCOPYTOBUFFER) WdfFunctions[WdfMemoryCopyToBufferTableIndex])(WdfDriverGlobals, SourceMemory, SourceOffset, Buffer, NumBytesToCopyTo); -} - - -// -// WDF Function: WdfMemoryCopyFromBuffer -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFMEMORYCOPYFROMBUFFER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFMEMORY DestinationMemory, - _In_ - size_t DestinationOffset, - _In_ - PVOID Buffer, - _In_ - _When_(NumBytesToCopyFrom == 0, __drv_reportError(NumBytesToCopyFrom cannot be zero)) - size_t NumBytesToCopyFrom - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfMemoryCopyFromBuffer( - _In_ - WDFMEMORY DestinationMemory, - _In_ - size_t DestinationOffset, - _In_ - PVOID Buffer, - _In_ - _When_(NumBytesToCopyFrom == 0, __drv_reportError(NumBytesToCopyFrom cannot be zero)) - size_t NumBytesToCopyFrom - ) -{ - return ((PFN_WDFMEMORYCOPYFROMBUFFER) WdfFunctions[WdfMemoryCopyFromBufferTableIndex])(WdfDriverGlobals, DestinationMemory, DestinationOffset, Buffer, NumBytesToCopyFrom); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfobject.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfobject.h deleted file mode 100644 index 4b6d67f..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfobject.h +++ /dev/null @@ -1,826 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - WdfObject.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -// -// Specifies the highest IRQL level allowed on callbacks -// to the device driver. -// -typedef enum _WDF_EXECUTION_LEVEL { - WdfExecutionLevelInvalid = 0x00, - WdfExecutionLevelInheritFromParent, - WdfExecutionLevelPassive, - WdfExecutionLevelDispatch, -} WDF_EXECUTION_LEVEL; - - -// -// Specifies the concurrency of callbacks to the device driver -// -typedef enum _WDF_SYNCHRONIZATION_SCOPE { - WdfSynchronizationScopeInvalid = 0x00, - WdfSynchronizationScopeInheritFromParent, - WdfSynchronizationScopeDevice, - WdfSynchronizationScopeQueue, - WdfSynchronizationScopeNone, -} WDF_SYNCHRONIZATION_SCOPE; - - -typedef -_Function_class_(EVT_WDF_OBJECT_CONTEXT_CLEANUP) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_OBJECT_CONTEXT_CLEANUP( - _In_ - WDFOBJECT Object - ); - -typedef EVT_WDF_OBJECT_CONTEXT_CLEANUP *PFN_WDF_OBJECT_CONTEXT_CLEANUP; - -typedef -_Function_class_(EVT_WDF_OBJECT_CONTEXT_DESTROY) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_OBJECT_CONTEXT_DESTROY( - _In_ - WDFOBJECT Object - ); - -typedef EVT_WDF_OBJECT_CONTEXT_DESTROY *PFN_WDF_OBJECT_CONTEXT_DESTROY; - - -typedef const struct _WDF_OBJECT_CONTEXT_TYPE_INFO *PCWDF_OBJECT_CONTEXT_TYPE_INFO; - -typedef struct _WDF_OBJECT_ATTRIBUTES { - // - // Size in bytes of this structure - // - ULONG Size; - - // - // Function to call when the object is deleted - // - PFN_WDF_OBJECT_CONTEXT_CLEANUP EvtCleanupCallback; - - // - // Function to call when the objects memory is destroyed when the - // the last reference count goes to zero - // - PFN_WDF_OBJECT_CONTEXT_DESTROY EvtDestroyCallback; - - // - // Execution level constraints for Object - // - WDF_EXECUTION_LEVEL ExecutionLevel; - - // - // Synchronization level constraint for Object - // - WDF_SYNCHRONIZATION_SCOPE SynchronizationScope; - - // - // Optional Parent Object - // - WDFOBJECT ParentObject; - - // - // Overrides the size of the context allocated as specified by - // ContextTypeInfo->ContextSize - // - size_t ContextSizeOverride; - - // - // Pointer to the type information to be associated with the object - // - PCWDF_OBJECT_CONTEXT_TYPE_INFO ContextTypeInfo; - -} WDF_OBJECT_ATTRIBUTES, *PWDF_OBJECT_ATTRIBUTES; - -VOID -FORCEINLINE -WDF_OBJECT_ATTRIBUTES_INIT( - _Out_ PWDF_OBJECT_ATTRIBUTES Attributes - ) -{ - RtlZeroMemory(Attributes, sizeof(WDF_OBJECT_ATTRIBUTES)); - Attributes->Size = sizeof(WDF_OBJECT_ATTRIBUTES); - Attributes->ExecutionLevel = WdfExecutionLevelInheritFromParent; - Attributes->SynchronizationScope = WdfSynchronizationScopeInheritFromParent; -} - -#define WDF_OBJECT_ATTRIBUTES_SET_CONTEXT_TYPE(_attributes, _contexttype) \ - (_attributes)->ContextTypeInfo = WDF_GET_CONTEXT_TYPE_INFO(_contexttype)->UniqueType -// -// VOID -// FORCEINLINE -// WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE( -// PWDF_OBJECT_ATTRIBUTES Attributes, -// -// ) -// -// NOTE: Do not put a ; at the end of the last line. This will require the -// caller to specify a ; after the call. -// -#define WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(_attributes, _contexttype) \ - WDF_OBJECT_ATTRIBUTES_INIT(_attributes); \ - WDF_OBJECT_ATTRIBUTES_SET_CONTEXT_TYPE(_attributes, _contexttype) - -typedef -PCWDF_OBJECT_CONTEXT_TYPE_INFO -(__cdecl *PFN_GET_UNIQUE_CONTEXT_TYPE)( - VOID - ); - -// -// Since C does not have strong type checking we must invent our own -// -typedef struct _WDF_OBJECT_CONTEXT_TYPE_INFO { - // - // The size of this structure in bytes - // - ULONG Size; - - // - // String representation of the context's type name, i.e. "DEVICE_CONTEXT" - // - PCHAR ContextName; - - // - // The size of the context in bytes. This will be the size of the context - // associated with the handle unless - // WDF_OBJECT_ATTRIBUTES::ContextSizeOverride is specified. - // - size_t ContextSize; - - // - // If NULL, this structure is the unique type identifier for the context - // type. If != NULL, the UniqueType pointer value is the unique type id - // for the context type. - // - PCWDF_OBJECT_CONTEXT_TYPE_INFO UniqueType; - - // - // Function pointer to retrieve the context type information structure - // pointer from the provider of the context type. This function is invoked - // by the client driver's entry point by the KMDF stub after all class - // drivers are loaded and before DriverEntry is invoked. - // - PFN_GET_UNIQUE_CONTEXT_TYPE EvtDriverGetUniqueContextType; - -} WDF_OBJECT_CONTEXT_TYPE_INFO, *PWDF_OBJECT_CONTEXT_TYPE_INFO; - -// -// Converts a type name a unique name in which we can retrieve type specific -// information. -// -#define WDF_TYPE_NAME_TO_TYPE_INFO(_contexttype) \ - _WDF_ ## _contexttype ## _TYPE_INFO - -// -// Converts a type name a unique name to the structure which will initialize -// it through an external component. -// -#define WDF_TYPE_NAME_TO_EXTERNAL_INIT(_contexttype) \ - _WDF_ ## _contexttype ## _EXTERNAL_INIT - -#define WDF_TYPE_NAME_TO_EXTERNAL_INIT_FUNCTION(_contexttype) \ - _contexttype ## _EXTERNAL_INIT_FUNCTION - -// -// Returns an address to the type information representing this typename -// -#define WDF_GET_CONTEXT_TYPE_INFO(_contexttype) \ - (&WDF_TYPE_NAME_TO_TYPE_INFO(_contexttype)) - -// -// Used to help generate our own usable pointer to the type typedef. For instance, -// a call as WDF_TYPE_NAME_POINTER_TYPE(DEVICE_CONTEXT) would generate: -// -// WDF_POINTER_TYPE_DEVICE_CONTEXT -// -// which would be the equivalent of DEVICE_CONTEXT* -// -#define WDF_TYPE_NAME_POINTER_TYPE(_contexttype) \ - WDF_POINTER_TYPE_ ## _contexttype - -// -// Declares a typename so that in can be associated with a handle. This will -// use the type's name with a _ prepended as the "friendly name" (which results -// in the autogenerated casting function being named WdfObjectGet_, ie -// WdfObjectGet_DEVICE_CONTEXT. See WDF_DECLARE_CONTEXT_TYPE_WITH_NAME for -// more details on what is generated. -// -#define WDF_DECLARE_CONTEXT_TYPE(_contexttype) \ - WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(_contexttype, WdfObjectGet_ ## _contexttype) - -// -// WDF_DECLARE_CONTEXT_TYPE_WITH_NAME performs the following 3 tasks -// -// 1) declare a typedef for the context type so that its pointer type can be -// referred to later -// 2) declare and initialize global structure that represents the type -// information for this -// context type -// 3) declare and implement a function named _castingfunction -// which does the proper type conversion. -// -// WDF_DECLARE_TYPE_AND_GLOBALS implements 1 & 2 -// WDF_DECLARE_CASTING_FUNCTION implements 3 -// -// For instance, the invocation of -// WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(DEVICE_CONTEXT, WdfDeviceGetContext) -// would result in the following being generated: -// -// typedef DEVICE_CONTEXT* WDF_POINTER_TYPE_DEVICE_CONTEXT; -// -// extern const __declspec(selectany) WDF_OBJECT_CONTEXT_TYPE_INFO _WDF_DEVICE_CONTEXT_TYPE_INFO = -// { -// sizeof(WDF_OBJECT_CONTEXT_TYPE_INFO), -// "DEVICE_CONTEXT", -// sizeof(DEVICE_CONTEXT), -// }; -// -// WDF_POINTER_TYPE_DEVICE_CONTEXT -// WdfDeviceGetContext( -// WDFOBJECT Handle -// ) -// { -// return (WDF_POINTER_TYPE_DEVICE_CONTEXT) -// WdfObjectGetTypedContextWorker( -// Handle, -// (&_WDF_DEVICE_CONTEXT_TYPE_INFO)->UniqueType -// ); -// } -// -#define WDF_TYPE_INIT_BASE_SECTION_NAME ".kmdftypeinit" -#define WDF_TYPE_INIT_SECTION_NAME ".kmdftypeinit$b" - -// -// .data is the default section that global data would be placed into. We -// cannot just use ".data" in __declspec(allocate()) without first declaring -// it in a #pragma section() even though it is a default section name. -// -#ifndef WDF_TYPE_DEFAULT_SECTION_NAME -#define WDF_TYPE_DEFAULT_SECTION_NAME ".data" -#endif // WDF_TYPE_DEFAULT_SECTION_NAME - -#pragma section(WDF_TYPE_INIT_SECTION_NAME, read, write) -#pragma section(WDF_TYPE_DEFAULT_SECTION_NAME) - -#define WDF_DECLARE_TYPE_AND_GLOBALS(_contexttype, _UniqueType, _GetUniqueType, _section)\ - \ -typedef _contexttype* WDF_TYPE_NAME_POINTER_TYPE(_contexttype); \ - \ -WDF_EXTERN_C \ -__declspec(allocate( _section )) \ -__declspec(selectany) \ -extern const WDF_OBJECT_CONTEXT_TYPE_INFO \ -WDF_TYPE_NAME_TO_TYPE_INFO(_contexttype) = \ -{ \ - sizeof(WDF_OBJECT_CONTEXT_TYPE_INFO), \ - #_contexttype, \ - sizeof(_contexttype), \ - _UniqueType, \ - _GetUniqueType, \ -}; \ - -#define WDF_DECLARE_CASTING_FUNCTION(_contexttype, _castingfunction) \ - \ -WDF_EXTERN_C \ -__drv_aliasesMem \ -WDF_TYPE_NAME_POINTER_TYPE(_contexttype) \ -FORCEINLINE \ -_castingfunction( \ - _In_ WDFOBJECT Handle \ - ) \ -{ \ - return (WDF_TYPE_NAME_POINTER_TYPE(_contexttype)) \ - WdfObjectGetTypedContextWorker( \ - Handle, \ - WDF_GET_CONTEXT_TYPE_INFO(_contexttype)->UniqueType \ - ); \ -} - -#define WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(_contexttype, _castingfunction) \ - \ -WDF_DECLARE_TYPE_AND_GLOBALS( \ - _contexttype, \ - WDF_GET_CONTEXT_TYPE_INFO(_contexttype), \ - NULL, \ - WDF_TYPE_DEFAULT_SECTION_NAME) \ - \ -WDF_DECLARE_CASTING_FUNCTION(_contexttype, _castingfunction) - -// -// WDF_DECLARE_SHARED_CONTEXT_TYPE_WITH_NAME is the same as -// WDF_DECLARE_CONTEXT_TYPE_WITH_NAME with respect to the types and structures -// that are created and initialized. The casting function is different in that -// it passes the UniqueType to WdfObjectGetTypedContextWorker() instead of the -// global type structure created. It also creates a structure which will contain -// an initialization function which will be invoked before DriverEntry() is -// called. -// -// It is the responsibilty of the component exporting the unique type to define -// and implement the function which will return the unique type. The format of -// the define is: -// -// #define _contexttype ## _EXTERNAL_INIT_FUNCTION -// -// (e.g. #define DEVICE_CONTEXT_EXTERNALINIT_FUNCTION DeviceContextInit() -// for a type of DEVICE_CONTEXT) -// -#define WDF_DECLARE_SHARED_CONTEXT_TYPE_WITH_NAME(_contexttype, _castingfunction) \ - \ -WDF_DECLARE_TYPE_AND_GLOBALS( \ - _contexttype, \ - NULL, \ - WDF_TYPE_NAME_TO_EXTERNAL_INIT_FUNCTION(_contexttype), \ - WDF_TYPE_INIT_SECTION_NAME) \ - \ -WDF_DECLARE_CASTING_FUNCTION(_contexttype, _castingfunction) - - -// -// Generic conversion macro from handle to type. This should be used if the -// autogenerated conversion function does not suite the programmers calling style. -// -// The type parameter should be name of the type (e.g. DEVICE_CONTEXT), not the -// name of the pointer to the type (PDEVICE_CONTEXT). -// -// Example call: -// -// WDFDEVICE device; -// PDEVICE_CONTEXT pContext; -// -// pContext = WdfObjectGetTypedContext(device, DEVICE_CONTEXT); -// -// -#define WdfObjectGetTypedContext(handle, type) \ -(type*) \ -WdfObjectGetTypedContextWorker( \ - (WDFOBJECT) handle, \ - WDF_GET_CONTEXT_TYPE_INFO(type)->UniqueType \ - ) - -// -// Converts a type name to a unique context name. -// -#define WDF_CUSTOM_TYPE_CONTEXT_NAME(_type) \ - WdfCustomType_ ## _type - -// -// Converts a type name to a unique function name to retrieve the type info context. -// -#define WDF_GET_CUSTOM_TYPE_FUNCTION_NAME(_type) \ - WdfObjectGetCustomType_ ## _type - -// -// Converts a type name to a unique function name to add the type info context. -// -#define WDF_ADD_CUSTOM_TYPE_FUNCTION_NAME(_type) \ - WdfObjectAddCustomType_ ## _type - -// -// Core structure for supporting custom types, see macros below. -// -typedef struct _WDF_CUSTOM_TYPE_CONTEXT { - ULONG Size; - ULONG_PTR Data; -} WDF_CUSTOM_TYPE_CONTEXT, *PWDF_CUSTOM_TYPE_CONTEXT; - -// -// Declares a context and a function to handle the specified type. -// -// NOTE: Do not put a ; at the end of the last line. This will require the -// caller to specify a ; after the call. -// -#define WDF_DECLARE_CUSTOM_TYPE(_type) \ - \ -typedef WDF_CUSTOM_TYPE_CONTEXT WDF_CUSTOM_TYPE_CONTEXT_NAME(_type); \ - \ -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME( \ - WDF_CUSTOM_TYPE_CONTEXT_NAME(_type), \ - WDF_GET_CUSTOM_TYPE_FUNCTION_NAME(_type) \ - ); \ - \ -WDF_EXTERN_C \ -NTSTATUS \ -FORCEINLINE \ -WDF_ADD_CUSTOM_TYPE_FUNCTION_NAME(_type)( \ - _In_ WDFOBJECT Handle, \ - _In_opt_ ULONG_PTR Data, \ - _In_opt_ PFN_WDF_OBJECT_CONTEXT_CLEANUP EvtCleanupCallback, \ - _In_opt_ PFN_WDF_OBJECT_CONTEXT_DESTROY EvtDestroyCallback \ - ) \ -{ \ - NTSTATUS status; \ - WDF_OBJECT_ATTRIBUTES attributes; \ - WDF_CUSTOM_TYPE_CONTEXT_NAME(_type)* typeInfo; \ - \ - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE( \ - &attributes, \ - WDF_CUSTOM_TYPE_CONTEXT_NAME(_type)); \ - \ - attributes.EvtCleanupCallback = EvtCleanupCallback; \ - attributes.EvtDestroyCallback = EvtDestroyCallback; \ - \ - status = WdfObjectAllocateContext(Handle, \ - &attributes, \ - (PVOID*)&typeInfo); \ - if (NT_SUCCESS(status)) { \ - typeInfo->Size = sizeof(WDF_CUSTOM_TYPE_CONTEXT_NAME(_type)); \ - typeInfo->Data = Data; \ - } \ - \ - return status; \ -} - -// -// BOOLEAN -// WdfObjectIsCustomType( -// _In_ _handle, // WDFOBJECT handle. -// _In_ _type // Type. -// ) -// -// NOTE: Do not put a ; at the end of the last line. This will require the -// caller to specify a ; after the call. -// -#define WdfObjectIsCustomType(_handle, _type) \ - (WdfObjectGetTypedContext(_handle, WDF_CUSTOM_TYPE_CONTEXT_NAME(_type)) \ - == NULL ? FALSE : TRUE) - -// -// NTSTATUS -// WdfObjectAddCustomTypeWithData( -// _In_ _handle, // WDFOBJECT handle. -// _In_ _type, // Type. -// _In_opt_ _data, // Type's data. -// _In_opt_ _cleanup, // EvtCleanupCallback -// _In_opt_ _destroy // EvtDestroyCallback -// ) -// -// NOTE: Do not put a ; at the end of the last line. This will require the -// caller to specify a ; after the call. -// -#define WdfObjectAddCustomTypeWithData(_handle, _type, _data, _cleanup, _destroy) \ - WDF_ADD_CUSTOM_TYPE_FUNCTION_NAME(_type)(_handle, _data, _cleanup, _destroy) - -// -// NTSTATUS -// WdfObjectAddCustomType( -// _In_ _handle, // WDFOBJECT handle. -// _In_ _type // Type. -// ) -// -// NOTE: Do not put a ; at the end of the last line. This will require the -// caller to specify a ; after the call. -// -#define WdfObjectAddCustomType(_handle, _type) \ - WdfObjectAddCustomTypeWithData(_handle, _type, 0, NULL, NULL) - -// -// ULONG_PTR -// WdfObjectGetCustomTypeData( -// _In_ _handle, // WDFOBJECT handle. -// _In_ _type // Type. -// ) -// -// NOTE: Do not put a ; at the end of the last line. This will require the -// caller to specify a ; after the call. -// -#define WdfObjectGetCustomTypeData(_handle, _type) \ - (WDF_GET_CUSTOM_TYPE_FUNCTION_NAME(_type)(_handle)->Data) - - -// -// WDF Function: WdfObjectGetTypedContextWorker -// -typedef -WDFAPI -PVOID -(FASTCALL *PFN_WDFOBJECTGETTYPEDCONTEXTWORKER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFOBJECT Handle, - _In_ - PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo - ); - -PVOID -FORCEINLINE -WdfObjectGetTypedContextWorker( - _In_ - WDFOBJECT Handle, - _In_ - PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo - ) -{ - return ((PFN_WDFOBJECTGETTYPEDCONTEXTWORKER) WdfFunctions[WdfObjectGetTypedContextWorkerTableIndex])(WdfDriverGlobals, Handle, TypeInfo); -} - - -// -// WDF Function: WdfObjectAllocateContext -// -typedef -WDFAPI -NTSTATUS -(*PFN_WDFOBJECTALLOCATECONTEXT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFOBJECT Handle, - _In_ - PWDF_OBJECT_ATTRIBUTES ContextAttributes, - _Outptr_opt_ - PVOID* Context - ); - -NTSTATUS -FORCEINLINE -WdfObjectAllocateContext( - _In_ - WDFOBJECT Handle, - _In_ - PWDF_OBJECT_ATTRIBUTES ContextAttributes, - _Outptr_opt_ - PVOID* Context - ) -{ - return ((PFN_WDFOBJECTALLOCATECONTEXT) WdfFunctions[WdfObjectAllocateContextTableIndex])(WdfDriverGlobals, Handle, ContextAttributes, Context); -} - - -// -// WDF Function: WdfObjectContextGetObject -// -typedef -WDFAPI -WDFOBJECT -(FASTCALL *PFN_WDFOBJECTCONTEXTGETOBJECT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PVOID ContextPointer - ); - -WDFOBJECT -FORCEINLINE -WdfObjectContextGetObject( - _In_ - PVOID ContextPointer - ) -{ - return ((PFN_WDFOBJECTCONTEXTGETOBJECT) WdfFunctions[WdfObjectContextGetObjectTableIndex])(WdfDriverGlobals, ContextPointer); -} - - -// -// WDF Function: WdfObjectReferenceActual -// -typedef -WDFAPI -VOID -(*PFN_WDFOBJECTREFERENCEACTUAL)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFOBJECT Handle, - _In_opt_ - PVOID Tag, - _In_ - LONG Line, - _In_z_ - PCHAR File - ); - -VOID -FORCEINLINE -WdfObjectReferenceActual( - _In_ - WDFOBJECT Handle, - _In_opt_ - PVOID Tag, - _In_ - LONG Line, - _In_z_ - PCHAR File - ) -{ - ((PFN_WDFOBJECTREFERENCEACTUAL) WdfFunctions[WdfObjectReferenceActualTableIndex])(WdfDriverGlobals, Handle, Tag, Line, File); -} - - -// -// WDF Function: WdfObjectDereferenceActual -// -typedef -WDFAPI -VOID -(*PFN_WDFOBJECTDEREFERENCEACTUAL)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFOBJECT Handle, - _In_opt_ - PVOID Tag, - _In_ - LONG Line, - _In_z_ - PCHAR File - ); - -VOID -FORCEINLINE -WdfObjectDereferenceActual( - _In_ - WDFOBJECT Handle, - _In_opt_ - PVOID Tag, - _In_ - LONG Line, - _In_z_ - PCHAR File - ) -{ - ((PFN_WDFOBJECTDEREFERENCEACTUAL) WdfFunctions[WdfObjectDereferenceActualTableIndex])(WdfDriverGlobals, Handle, Tag, Line, File); -} - - -// -// WDF Function: WdfObjectCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFOBJECTCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFOBJECT* Object - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfObjectCreate( - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFOBJECT* Object - ) -{ - return ((PFN_WDFOBJECTCREATE) WdfFunctions[WdfObjectCreateTableIndex])(WdfDriverGlobals, Attributes, Object); -} - - -// -// WDF Function: WdfObjectDelete -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFOBJECTDELETE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFOBJECT Object - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfObjectDelete( - _In_ - WDFOBJECT Object - ) -{ - ((PFN_WDFOBJECTDELETE) WdfFunctions[WdfObjectDeleteTableIndex])(WdfDriverGlobals, Object); -} - - -// -// WDF Function: WdfObjectQuery -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFOBJECTQUERY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFOBJECT Object, - _In_ - CONST GUID* Guid, - _In_ - ULONG QueryBufferLength, - _Out_writes_bytes_(QueryBufferLength) - PVOID QueryBuffer - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfObjectQuery( - _In_ - WDFOBJECT Object, - _In_ - CONST GUID* Guid, - _In_ - ULONG QueryBufferLength, - _Out_writes_bytes_(QueryBufferLength) - PVOID QueryBuffer - ) -{ - return ((PFN_WDFOBJECTQUERY) WdfFunctions[WdfObjectQueryTableIndex])(WdfDriverGlobals, Object, Guid, QueryBufferLength, QueryBuffer); -} - - -// -// Reference an object -// -// VOID -// WdfObjectReference( -// _In_ WDFOBJECT Handle -// ); -// -// VOID -// WdfObjectReferenceWithTag( -// _In_ WDFOBJECT Handle, -// _In_ PVOID Tag -// ); -// -#define WdfObjectReference(Handle) \ - WdfObjectReferenceWithTag(Handle, NULL) - -#define WdfObjectReferenceWithTag(Handle, Tag) \ - WdfObjectReferenceActual(Handle, Tag, __LINE__, __FILE__) - - -// -// Dereference an object. If an object allows for a client explicitly deleting -// it, call WdfObjectDelete. Do not use WdfObjectDereferenceXxx to delete an -// object. -// -// VOID -// WdfObjectDereference( -// _In_ WDFOBJECT Handle -// ); -// -// VOID -// WdfObjectDereferenceWithTag( -// _In_ WDFOBJECT Handle -// _In_ PVOID Tag -// ); -// -#define WdfObjectDereference(Handle) \ - WdfObjectDereferenceWithTag(Handle, NULL) - -#define WdfObjectDereferenceWithTag(Handle, Tag) \ - WdfObjectDereferenceActual(Handle, Tag, __LINE__, __FILE__) - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfpdo.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfpdo.h deleted file mode 100644 index 0144a22..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfpdo.h +++ /dev/null @@ -1,184 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfpdo.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef -_Function_class_(EVT_WDF_DEVICE_RESOURCES_QUERY) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_RESOURCES_QUERY( - _In_ - WDFDEVICE Device, - _In_ - WDFCMRESLIST Resources - ); - -typedef EVT_WDF_DEVICE_RESOURCES_QUERY *PFN_WDF_DEVICE_RESOURCES_QUERY; - -typedef -_Function_class_(EVT_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY( - _In_ - WDFDEVICE Device, - _In_ - WDFIORESREQLIST IoResourceRequirementsList - ); - -typedef EVT_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY *PFN_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY; - -typedef -_Function_class_(EVT_WDF_DEVICE_EJECT) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_EJECT( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_EJECT *PFN_WDF_DEVICE_EJECT; - -typedef -_Function_class_(EVT_WDF_DEVICE_SET_LOCK) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_SET_LOCK( - _In_ - WDFDEVICE Device, - _In_ - BOOLEAN IsLocked - ); - -typedef EVT_WDF_DEVICE_SET_LOCK *PFN_WDF_DEVICE_SET_LOCK; - -typedef -_Function_class_(EVT_WDF_DEVICE_ENABLE_WAKE_AT_BUS) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_ENABLE_WAKE_AT_BUS( - _In_ - WDFDEVICE Device, - _In_ - SYSTEM_POWER_STATE PowerState - ); - -typedef EVT_WDF_DEVICE_ENABLE_WAKE_AT_BUS *PFN_WDF_DEVICE_ENABLE_WAKE_AT_BUS; - -typedef -_Function_class_(EVT_WDF_DEVICE_DISABLE_WAKE_AT_BUS) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_DISABLE_WAKE_AT_BUS( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_DISABLE_WAKE_AT_BUS *PFN_WDF_DEVICE_DISABLE_WAKE_AT_BUS; - -typedef -_Function_class_(EVT_WDF_DEVICE_REPORTED_MISSING) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_DEVICE_REPORTED_MISSING( - _In_ - WDFDEVICE Device - ); - -typedef EVT_WDF_DEVICE_REPORTED_MISSING *PFN_WDF_DEVICE_REPORTED_MISSING; - -typedef struct _WDF_PDO_EVENT_CALLBACKS { - // - // The size of this structure in bytes - // - ULONG Size; - - // - // Called in response to IRP_MN_QUERY_RESOURCES - // - PFN_WDF_DEVICE_RESOURCES_QUERY EvtDeviceResourcesQuery; - - // - // Called in response to IRP_MN_QUERY_RESOURCE_REQUIREMENTS - // - PFN_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY EvtDeviceResourceRequirementsQuery; - - // - // Called in response to IRP_MN_EJECT - // - PFN_WDF_DEVICE_EJECT EvtDeviceEject; - - // - // Called in response to IRP_MN_SET_LOCK - // - PFN_WDF_DEVICE_SET_LOCK EvtDeviceSetLock; - - // - // Called in response to the power policy owner sending a wait wake to the - // PDO. Bus generic arming shoulding occur here. - // - PFN_WDF_DEVICE_ENABLE_WAKE_AT_BUS EvtDeviceEnableWakeAtBus; - - // - // Called in response to the power policy owner sending a wait wake to the - // PDO. Bus generic disarming shoulding occur here. - // - PFN_WDF_DEVICE_DISABLE_WAKE_AT_BUS EvtDeviceDisableWakeAtBus; - - // - // Called when reporting the PDO missing to PnP manager in response to - // IRP_MN_QUERY_DEVICE_RELATIONS for Bus Relations. - // - PFN_WDF_DEVICE_REPORTED_MISSING EvtDeviceReportedMissing; - -} WDF_PDO_EVENT_CALLBACKS, *PWDF_PDO_EVENT_CALLBACKS; - -VOID -FORCEINLINE -WDF_PDO_EVENT_CALLBACKS_INIT( - _Out_ PWDF_PDO_EVENT_CALLBACKS Callbacks - ) -{ - RtlZeroMemory(Callbacks, sizeof(WDF_PDO_EVENT_CALLBACKS)); - Callbacks->Size = sizeof(WDF_PDO_EVENT_CALLBACKS); -} -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfqueryinterface.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfqueryinterface.h deleted file mode 100644 index fd1fff6..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfqueryinterface.h +++ /dev/null @@ -1,112 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfqueryinterface.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef -_Function_class_(EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST( - _In_ - WDFDEVICE Device, - _In_ - LPGUID InterfaceType, - _Inout_ - PINTERFACE ExposedInterface, - _Inout_opt_ - PVOID ExposedInterfaceSpecificData - ); - -typedef EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST *PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST; - -typedef struct _WDF_QUERY_INTERFACE_CONFIG { - // - // Size of this structure in bytes. - // - ULONG Size; - - // - // Interface to be returned to the caller. Optional if BehaviorType is set - // to WdfQueryInterfaceTypePassThrough or ImportInterface is set to TRUE. - // - PINTERFACE Interface; - - // - // The GUID identifying the interface - // - CONST GUID * InterfaceType; - - // - // Valid only for PDOs. The framework will allocate a new request and - // forward it down the parent's device stack. - // - BOOLEAN SendQueryToParentStack; - - // - // Driver supplied callback which is called after some basic interface - // validation has been performed (size, version, and guid checking). This - // is an optional parameter and may be NULL unless ImportInterface is - // specified. - // - // If the callback returns !NT_SUCCESS, this error will be returned to the - // caller and the query interface will fail. - // - // In this callback, the caller is free to modify the ExposedInterface in - // any manner of its choosing. For instance, the callback may change any - // field in the interface. The callback may also alloate a dynamic context - // to be associated with the interface; the InterfaceReference and - // InterfaceDereference functions may also be overridden. - // - // If ImportInterface is set to TRUE, then this is a required field and the - // callback must initialize the interface (the framework will leave the - // ExposedInterface buffer exactly as it received it) since the framework - // has no way of knowing which fields to fill in and which to leave alone. - // - PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST EvtDeviceProcessQueryInterfaceRequest; - - // - // If TRUE, the interface provided by the caller contains data that the - // driver is interested in. By setting to this field to TRUE, the - // EvtDeviceProcessQueryInterfaceRequest callback must initialize the - // ExposedInterface. - // - // If FALSE, the entire ExposedInterface is initialized through a memory - // copy before the EvtDeviceProcessQueryInterfaceRequest is called. - // - BOOLEAN ImportInterface; - -} WDF_QUERY_INTERFACE_CONFIG, *PWDF_QUERY_INTERFACE_CONFIG; -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfregistry.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfregistry.h deleted file mode 100644 index 6e21a00..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfregistry.h +++ /dev/null @@ -1,729 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfregistry.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -#define WDF_REGKEY_DEVICE_SUBKEY 256 -#define WDF_REGKEY_DRIVER_SUBKEY 256 - -// -// WDF Function: WdfRegistryOpenKey -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYOPENKEY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_opt_ - WDFKEY ParentKey, - _In_ - PCUNICODE_STRING KeyName, - _In_ - ACCESS_MASK DesiredAccess, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryOpenKey( - _In_opt_ - WDFKEY ParentKey, - _In_ - PCUNICODE_STRING KeyName, - _In_ - ACCESS_MASK DesiredAccess, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ) -{ - return ((PFN_WDFREGISTRYOPENKEY) WdfFunctions[WdfRegistryOpenKeyTableIndex])(WdfDriverGlobals, ParentKey, KeyName, DesiredAccess, KeyAttributes, Key); -} - - -// -// WDF Function: WdfRegistryCreateKey -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYCREATEKEY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_opt_ - WDFKEY ParentKey, - _In_ - PCUNICODE_STRING KeyName, - _In_ - ACCESS_MASK DesiredAccess, - _In_ - ULONG CreateOptions, - _Out_opt_ - PULONG CreateDisposition, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryCreateKey( - _In_opt_ - WDFKEY ParentKey, - _In_ - PCUNICODE_STRING KeyName, - _In_ - ACCESS_MASK DesiredAccess, - _In_ - ULONG CreateOptions, - _Out_opt_ - PULONG CreateDisposition, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES KeyAttributes, - _Out_ - WDFKEY* Key - ) -{ - return ((PFN_WDFREGISTRYCREATEKEY) WdfFunctions[WdfRegistryCreateKeyTableIndex])(WdfDriverGlobals, ParentKey, KeyName, DesiredAccess, CreateOptions, CreateDisposition, KeyAttributes, Key); -} - - -// -// WDF Function: WdfRegistryClose -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFREGISTRYCLOSE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfRegistryClose( - _In_ - WDFKEY Key - ) -{ - ((PFN_WDFREGISTRYCLOSE) WdfFunctions[WdfRegistryCloseTableIndex])(WdfDriverGlobals, Key); -} - - -// -// WDF Function: WdfRegistryWdmGetHandle -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -HANDLE -(*PFN_WDFREGISTRYWDMGETHANDLE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -HANDLE -FORCEINLINE -WdfRegistryWdmGetHandle( - _In_ - WDFKEY Key - ) -{ - return ((PFN_WDFREGISTRYWDMGETHANDLE) WdfFunctions[WdfRegistryWdmGetHandleTableIndex])(WdfDriverGlobals, Key); -} - - -// -// WDF Function: WdfRegistryRemoveKey -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYREMOVEKEY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryRemoveKey( - _In_ - WDFKEY Key - ) -{ - return ((PFN_WDFREGISTRYREMOVEKEY) WdfFunctions[WdfRegistryRemoveKeyTableIndex])(WdfDriverGlobals, Key); -} - - -// -// WDF Function: WdfRegistryRemoveValue -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYREMOVEVALUE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryRemoveValue( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName - ) -{ - return ((PFN_WDFREGISTRYREMOVEVALUE) WdfFunctions[WdfRegistryRemoveValueTableIndex])(WdfDriverGlobals, Key, ValueName); -} - - -// -// WDF Function: WdfRegistryQueryValue -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYQUERYVALUE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - ULONG ValueLength, - _Out_writes_bytes_opt_( ValueLength) - PVOID Value, - _Out_opt_ - PULONG ValueLengthQueried, - _Out_opt_ - PULONG ValueType - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryQueryValue( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - ULONG ValueLength, - _Out_writes_bytes_opt_( ValueLength) - PVOID Value, - _Out_opt_ - PULONG ValueLengthQueried, - _Out_opt_ - PULONG ValueType - ) -{ - return ((PFN_WDFREGISTRYQUERYVALUE) WdfFunctions[WdfRegistryQueryValueTableIndex])(WdfDriverGlobals, Key, ValueName, ValueLength, Value, ValueLengthQueried, ValueType); -} - - -// -// WDF Function: WdfRegistryQueryMemory -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYQUERYMEMORY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES MemoryAttributes, - _Out_ - WDFMEMORY* Memory, - _Out_opt_ - PULONG ValueType - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryQueryMemory( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - _Strict_type_match_ - POOL_TYPE PoolType, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES MemoryAttributes, - _Out_ - WDFMEMORY* Memory, - _Out_opt_ - PULONG ValueType - ) -{ - return ((PFN_WDFREGISTRYQUERYMEMORY) WdfFunctions[WdfRegistryQueryMemoryTableIndex])(WdfDriverGlobals, Key, ValueName, PoolType, MemoryAttributes, Memory, ValueType); -} - - -// -// WDF Function: WdfRegistryQueryMultiString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYQUERYMULTISTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES StringsAttributes, - _In_ - WDFCOLLECTION Collection - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryQueryMultiString( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES StringsAttributes, - _In_ - WDFCOLLECTION Collection - ) -{ - return ((PFN_WDFREGISTRYQUERYMULTISTRING) WdfFunctions[WdfRegistryQueryMultiStringTableIndex])(WdfDriverGlobals, Key, ValueName, StringsAttributes, Collection); -} - - -// -// WDF Function: WdfRegistryQueryUnicodeString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYQUERYUNICODESTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _Out_opt_ - PUSHORT ValueByteLength, - _Inout_opt_ - PUNICODE_STRING Value - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryQueryUnicodeString( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _Out_opt_ - PUSHORT ValueByteLength, - _Inout_opt_ - PUNICODE_STRING Value - ) -{ - return ((PFN_WDFREGISTRYQUERYUNICODESTRING) WdfFunctions[WdfRegistryQueryUnicodeStringTableIndex])(WdfDriverGlobals, Key, ValueName, ValueByteLength, Value); -} - - -// -// WDF Function: WdfRegistryQueryString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYQUERYSTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - WDFSTRING String - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryQueryString( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - WDFSTRING String - ) -{ - return ((PFN_WDFREGISTRYQUERYSTRING) WdfFunctions[WdfRegistryQueryStringTableIndex])(WdfDriverGlobals, Key, ValueName, String); -} - - -// -// WDF Function: WdfRegistryQueryULong -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYQUERYULONG)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _Out_ - PULONG Value - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryQueryULong( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _Out_ - PULONG Value - ) -{ - return ((PFN_WDFREGISTRYQUERYULONG) WdfFunctions[WdfRegistryQueryULongTableIndex])(WdfDriverGlobals, Key, ValueName, Value); -} - - -// -// WDF Function: WdfRegistryAssignValue -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYASSIGNVALUE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - ULONG ValueType, - _In_ - ULONG ValueLength, - _In_reads_( ValueLength) - PVOID Value - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryAssignValue( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - ULONG ValueType, - _In_ - ULONG ValueLength, - _In_reads_( ValueLength) - PVOID Value - ) -{ - return ((PFN_WDFREGISTRYASSIGNVALUE) WdfFunctions[WdfRegistryAssignValueTableIndex])(WdfDriverGlobals, Key, ValueName, ValueType, ValueLength, Value); -} - - -// -// WDF Function: WdfRegistryAssignMemory -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYASSIGNMEMORY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - ULONG ValueType, - _In_ - WDFMEMORY Memory, - _In_opt_ - PWDFMEMORY_OFFSET MemoryOffsets - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryAssignMemory( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - ULONG ValueType, - _In_ - WDFMEMORY Memory, - _In_opt_ - PWDFMEMORY_OFFSET MemoryOffsets - ) -{ - return ((PFN_WDFREGISTRYASSIGNMEMORY) WdfFunctions[WdfRegistryAssignMemoryTableIndex])(WdfDriverGlobals, Key, ValueName, ValueType, Memory, MemoryOffsets); -} - - -// -// WDF Function: WdfRegistryAssignMultiString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYASSIGNMULTISTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - WDFCOLLECTION StringsCollection - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryAssignMultiString( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - WDFCOLLECTION StringsCollection - ) -{ - return ((PFN_WDFREGISTRYASSIGNMULTISTRING) WdfFunctions[WdfRegistryAssignMultiStringTableIndex])(WdfDriverGlobals, Key, ValueName, StringsCollection); -} - - -// -// WDF Function: WdfRegistryAssignUnicodeString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYASSIGNUNICODESTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - PCUNICODE_STRING Value - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryAssignUnicodeString( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - PCUNICODE_STRING Value - ) -{ - return ((PFN_WDFREGISTRYASSIGNUNICODESTRING) WdfFunctions[WdfRegistryAssignUnicodeStringTableIndex])(WdfDriverGlobals, Key, ValueName, Value); -} - - -// -// WDF Function: WdfRegistryAssignString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYASSIGNSTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - WDFSTRING String - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryAssignString( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - WDFSTRING String - ) -{ - return ((PFN_WDFREGISTRYASSIGNSTRING) WdfFunctions[WdfRegistryAssignStringTableIndex])(WdfDriverGlobals, Key, ValueName, String); -} - - -// -// WDF Function: WdfRegistryAssignULong -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREGISTRYASSIGNULONG)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - ULONG Value - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRegistryAssignULong( - _In_ - WDFKEY Key, - _In_ - PCUNICODE_STRING ValueName, - _In_ - ULONG Value - ) -{ - return ((PFN_WDFREGISTRYASSIGNULONG) WdfFunctions[WdfRegistryAssignULongTableIndex])(WdfDriverGlobals, Key, ValueName, Value); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfrequest.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfrequest.h deleted file mode 100644 index 2b171a7..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfrequest.h +++ /dev/null @@ -1,1608 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfrequest.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef enum _WDF_REQUEST_TYPE { - WdfRequestTypeCreate = 0x0, - WdfRequestTypeCreateNamedPipe = 0x1, - WdfRequestTypeClose = 0x2, - WdfRequestTypeRead = 0x3, - WdfRequestTypeWrite = 0x4, - WdfRequestTypeQueryInformation = 0x5, - WdfRequestTypeSetInformation = 0x6, - WdfRequestTypeQueryEA = 0x7, - WdfRequestTypeSetEA = 0x8, - WdfRequestTypeFlushBuffers = 0x9, - WdfRequestTypeQueryVolumeInformation = 0xa, - WdfRequestTypeSetVolumeInformation = 0xb, - WdfRequestTypeDirectoryControl = 0xc, - WdfRequestTypeFileSystemControl = 0xd, - WdfRequestTypeDeviceControl = 0xe, - WdfRequestTypeDeviceControlInternal = 0xf, - WdfRequestTypeShutdown = 0x10, - WdfRequestTypeLockControl = 0x11, - WdfRequestTypeCleanup = 0x12, - WdfRequestTypeCreateMailSlot = 0x13, - WdfRequestTypeQuerySecurity = 0x14, - WdfRequestTypeSetSecurity = 0x15, - WdfRequestTypePower = 0x16, - WdfRequestTypeSystemControl = 0x17, - WdfRequestTypeDeviceChange = 0x18, - WdfRequestTypeQueryQuota = 0x19, - WdfRequestTypeSetQuota = 0x1A, - WdfRequestTypePnp = 0x1B, - WdfRequestTypeOther =0x1C, - WdfRequestTypeUsb = 0x40, - WdfRequestTypeNoFormat = 0xFF, - WdfRequestTypeMax, -} WDF_REQUEST_TYPE; - - -typedef enum _WDF_REQUEST_REUSE_FLAGS { - WDF_REQUEST_REUSE_NO_FLAGS = 0x00000000, - WDF_REQUEST_REUSE_SET_NEW_IRP = 0x00000001, -} WDF_REQUEST_REUSE_FLAGS; - - -// -// This defines the actions to take on a request -// in EvtIoStop. -// -typedef enum _WDF_REQUEST_STOP_ACTION_FLAGS { - WdfRequestStopActionInvalid = 0, - WdfRequestStopActionSuspend = 0x01, // Device is being suspended - WdfRequestStopActionPurge = 0x2, // Device/queue is being removed - WdfRequestStopRequestCancelable = 0x10000000, // This bit is set if the request is marked cancelable -} WDF_REQUEST_STOP_ACTION_FLAGS; - - -typedef enum _WDF_REQUEST_SEND_OPTIONS_FLAGS { - WDF_REQUEST_SEND_OPTION_TIMEOUT = 0x00000001, - WDF_REQUEST_SEND_OPTION_SYNCHRONOUS = 0x00000002, - WDF_REQUEST_SEND_OPTION_IGNORE_TARGET_STATE = 0x00000004, - WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET = 0x00000008, - WDF_REQUEST_SEND_OPTION_IMPERSONATE_CLIENT = 0x00010000, - WDF_REQUEST_SEND_OPTION_IMPERSONATION_IGNORE_FAILURE = 0x00020000, -} WDF_REQUEST_SEND_OPTIONS_FLAGS; - - -// Request cancel is called if a request that has been marked cancelable is cancelled -typedef -_Function_class_(EVT_WDF_REQUEST_CANCEL) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_REQUEST_CANCEL( - _In_ - WDFREQUEST Request - ); - -typedef EVT_WDF_REQUEST_CANCEL *PFN_WDF_REQUEST_CANCEL; - - -// -// This parameters structure allows general access to a requests parameters -// -typedef struct _WDF_REQUEST_PARAMETERS { - - USHORT Size; - - UCHAR MinorFunction; - - WDF_REQUEST_TYPE Type; - - // - // The following user parameters are based on the service that is being - // invoked. Drivers and file systems can determine which set to use based - // on the above major and minor function codes. - // - union { - - // - // System service parameters for: Create - // - - struct { - PIO_SECURITY_CONTEXT SecurityContext; - ULONG Options; - USHORT POINTER_ALIGNMENT FileAttributes; - USHORT ShareAccess; - ULONG POINTER_ALIGNMENT EaLength; - } Create; - - - // - // System service parameters for: Read - // - - struct { - size_t Length; - ULONG POINTER_ALIGNMENT Key; - LONGLONG DeviceOffset; - } Read; - - // - // System service parameters for: Write - // - - struct { - size_t Length; - ULONG POINTER_ALIGNMENT Key; - LONGLONG DeviceOffset; - } Write; - - // - // System service parameters for: Device Control - // - // Note that the user's output buffer is stored in the UserBuffer field - // and the user's input buffer is stored in the SystemBuffer field. - // - - struct { - size_t OutputBufferLength; - size_t POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT IoControlCode; - PVOID Type3InputBuffer; - } DeviceIoControl; - - struct { - PVOID Arg1; - PVOID Arg2; - ULONG POINTER_ALIGNMENT IoControlCode; - PVOID Arg4; - } Others; - - } Parameters; - -} WDF_REQUEST_PARAMETERS, *PWDF_REQUEST_PARAMETERS; - -VOID -FORCEINLINE -WDF_REQUEST_PARAMETERS_INIT( - _Out_ PWDF_REQUEST_PARAMETERS Parameters - ) -{ - RtlZeroMemory(Parameters, sizeof(WDF_REQUEST_PARAMETERS)); - - Parameters->Size = sizeof(WDF_REQUEST_PARAMETERS); -} - -typedef struct _WDF_USB_REQUEST_COMPLETION_PARAMS *PWDF_USB_REQUEST_COMPLETION_PARAMS; - -typedef struct _WDF_REQUEST_COMPLETION_PARAMS { - // - // Size of the structure in bytes - // - ULONG Size; - - WDF_REQUEST_TYPE Type; - - IO_STATUS_BLOCK IoStatus; - - union { - struct { - WDFMEMORY Buffer; - size_t Length; - size_t Offset; - } Write; - - struct { - WDFMEMORY Buffer; - size_t Length; - size_t Offset; - } Read; - - struct { - ULONG IoControlCode; - - struct { - WDFMEMORY Buffer; - size_t Offset; - } Input; - - struct { - WDFMEMORY Buffer; - size_t Offset; - size_t Length; - } Output; - } Ioctl; - - struct { - union { - PVOID Ptr; - ULONG_PTR Value; - } Argument1; - union { - PVOID Ptr; - ULONG_PTR Value; - } Argument2; - union { - PVOID Ptr; - ULONG_PTR Value; - } Argument3; - union { - PVOID Ptr; - ULONG_PTR Value; - } Argument4; - } Others; - - struct { - PWDF_USB_REQUEST_COMPLETION_PARAMS Completion; - } Usb; - } Parameters; - -} WDF_REQUEST_COMPLETION_PARAMS, *PWDF_REQUEST_COMPLETION_PARAMS; - -VOID -FORCEINLINE -WDF_REQUEST_COMPLETION_PARAMS_INIT( - _Out_ PWDF_REQUEST_COMPLETION_PARAMS Params - ) -{ - RtlZeroMemory(Params, sizeof(WDF_REQUEST_COMPLETION_PARAMS)); - Params->Size = sizeof(WDF_REQUEST_COMPLETION_PARAMS); - Params->Type = WdfRequestTypeNoFormat; -} - -typedef -_Function_class_(EVT_WDF_REQUEST_COMPLETION_ROUTINE) -_IRQL_requires_same_ -VOID -EVT_WDF_REQUEST_COMPLETION_ROUTINE( - _In_ - WDFREQUEST Request, - _In_ - WDFIOTARGET Target, - _In_ - PWDF_REQUEST_COMPLETION_PARAMS Params, - _In_ - WDFCONTEXT Context - ); - -typedef EVT_WDF_REQUEST_COMPLETION_ROUTINE *PFN_WDF_REQUEST_COMPLETION_ROUTINE; - -/*++ - -Routine Description: - Clears out the internal state of the irp, which includes, but is not limited - to: - a) Any internal allocations for the previously formatted request - b) The completion routine and its context - c) The request's intended i/o target - d) All of the internal IRP's stack locations - -Arguments: - Request - The request to be reused. - - ReuseParams - Parameters controlling the reuse of the request, see comments - for each field in the structure for usage - -Return Value: - None - - --*/ - -typedef struct _WDF_REQUEST_REUSE_PARAMS { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // Bit field combination of WDF_REQUEST_REUSE_Xxx values - // - ULONG Flags; - - // - // The new status of the request. - // - NTSTATUS Status; - - // - // New PIRP to be contained in the WDFREQUEST. Setting a new PIRP value - // is only valid for WDFREQUESTs created by WdfRequestCreateFromIrp where - // RequestFreesIrp == FALSE. No other WDFREQUESTs (presented by the - // I/O queue for instance) may have their IRPs changed. - // - PIRP NewIrp; - -} WDF_REQUEST_REUSE_PARAMS, *PWDF_REQUEST_REUSE_PARAMS; - -VOID -FORCEINLINE -WDF_REQUEST_REUSE_PARAMS_INIT( - _Out_ PWDF_REQUEST_REUSE_PARAMS Params, - _In_ ULONG Flags, - _In_ NTSTATUS Status - ) -{ - RtlZeroMemory(Params, sizeof(WDF_REQUEST_REUSE_PARAMS)); - - Params->Size = sizeof(WDF_REQUEST_REUSE_PARAMS); - Params->Flags = Flags; - Params->Status = Status; -} - -VOID -FORCEINLINE -WDF_REQUEST_REUSE_PARAMS_SET_NEW_IRP( - _Inout_ PWDF_REQUEST_REUSE_PARAMS Params, - _In_ PIRP NewIrp - ) -{ - Params->Flags |= WDF_REQUEST_REUSE_SET_NEW_IRP; - Params->NewIrp = NewIrp; -} - -typedef struct _WDF_REQUEST_SEND_OPTIONS { - // - // Size of the structure in bytes - // - ULONG Size; - - // - // Bit field combination of values from the WDF_REQUEST_SEND_OPTIONS_FLAGS - // enumeration - // - ULONG Flags; - - // - // Valid when WDF_REQUEST_SEND_OPTION_TIMEOUT is set - // - LONGLONG Timeout; - -} WDF_REQUEST_SEND_OPTIONS, *PWDF_REQUEST_SEND_OPTIONS; - -VOID -FORCEINLINE -WDF_REQUEST_SEND_OPTIONS_INIT( - _Out_ PWDF_REQUEST_SEND_OPTIONS Options, - _In_ ULONG Flags - ) -{ - RtlZeroMemory(Options, sizeof(WDF_REQUEST_SEND_OPTIONS)); - Options->Size = sizeof(WDF_REQUEST_SEND_OPTIONS); - Options->Flags = Flags; -} - -VOID -FORCEINLINE -WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT( - _Inout_ PWDF_REQUEST_SEND_OPTIONS Options, - _In_ LONGLONG Timeout - ) -{ - Options->Flags |= WDF_REQUEST_SEND_OPTION_TIMEOUT; - Options->Timeout = Timeout; -} - -typedef enum _WDF_REQUEST_FORWARD_OPTIONS_FLAGS { - WDF_REQUEST_FORWARD_OPTION_SEND_AND_FORGET = 0x00000001 -} WDF_REQUEST_FORWARD_OPTIONS_FLAGS; - -typedef struct _WDF_REQUEST_FORWARD_OPTIONS { - // - // Size of the structure in bytes - // - ULONG Size; - - // - // Bit field combination of values from the WDF_REQUEST_FORWARD_OPTIONS_FLAGS - // enumeration - // - ULONG Flags; -} WDF_REQUEST_FORWARD_OPTIONS, *PWDF_REQUEST_FORWARD_OPTIONS; - - -// -// Default REquest forward initialization macro -// -VOID -FORCEINLINE -WDF_REQUEST_FORWARD_OPTIONS_INIT( - _Out_ PWDF_REQUEST_FORWARD_OPTIONS ForwardOptions - ) -{ - RtlZeroMemory(ForwardOptions, sizeof(WDF_REQUEST_FORWARD_OPTIONS)); - - ForwardOptions->Size = sizeof(WDF_REQUEST_FORWARD_OPTIONS); - ForwardOptions->Flags |= WDF_REQUEST_FORWARD_OPTION_SEND_AND_FORGET; -} - - - -typedef -_Function_class_(EVT_WDF_REQUEST_IMPERSONATE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_REQUEST_IMPERSONATE( - _In_ - WDFREQUEST Request, - _In_opt_ - PVOID Context - ); - -typedef EVT_WDF_REQUEST_IMPERSONATE *PFN_WDF_REQUEST_IMPERSONATE; - - -// -// WDF Function: WdfRequestCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES RequestAttributes, - _In_opt_ - WDFIOTARGET IoTarget, - _Out_ - WDFREQUEST* Request - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestCreate( - _In_opt_ - PWDF_OBJECT_ATTRIBUTES RequestAttributes, - _In_opt_ - WDFIOTARGET IoTarget, - _Out_ - WDFREQUEST* Request - ) -{ - return ((PFN_WDFREQUESTCREATE) WdfFunctions[WdfRequestCreateTableIndex])(WdfDriverGlobals, RequestAttributes, IoTarget, Request); -} - - -// -// WDF Function: WdfRequestReuse -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTREUSE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - PWDF_REQUEST_REUSE_PARAMS ReuseParams - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestReuse( - _In_ - WDFREQUEST Request, - _In_ - PWDF_REQUEST_REUSE_PARAMS ReuseParams - ) -{ - return ((PFN_WDFREQUESTREUSE) WdfFunctions[WdfRequestReuseTableIndex])(WdfDriverGlobals, Request, ReuseParams); -} - - -// -// WDF Function: WdfRequestChangeTarget -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTCHANGETARGET)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - WDFIOTARGET IoTarget - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestChangeTarget( - _In_ - WDFREQUEST Request, - _In_ - WDFIOTARGET IoTarget - ) -{ - return ((PFN_WDFREQUESTCHANGETARGET) WdfFunctions[WdfRequestChangeTargetTableIndex])(WdfDriverGlobals, Request, IoTarget); -} - - -// -// WDF Function: WdfRequestFormatRequestUsingCurrentType -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTFORMATREQUESTUSINGCURRENTTYPE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfRequestFormatRequestUsingCurrentType( - _In_ - WDFREQUEST Request - ) -{ - ((PFN_WDFREQUESTFORMATREQUESTUSINGCURRENTTYPE) WdfFunctions[WdfRequestFormatRequestUsingCurrentTypeTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestSend -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -_When_(Options->Flags & WDF_REQUEST_SEND_OPTION_SYNCHRONOUS == 0, _Must_inspect_result_) -WDFAPI -BOOLEAN -(*PFN_WDFREQUESTSEND)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - WDFIOTARGET Target, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS Options - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -_When_(Options->Flags & WDF_REQUEST_SEND_OPTION_SYNCHRONOUS == 0, _Must_inspect_result_) -BOOLEAN -FORCEINLINE -WdfRequestSend( - _In_ - WDFREQUEST Request, - _In_ - WDFIOTARGET Target, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS Options - ) -{ - return ((PFN_WDFREQUESTSEND) WdfFunctions[WdfRequestSendTableIndex])(WdfDriverGlobals, Request, Target, Options); -} - - -// -// WDF Function: WdfRequestGetStatus -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTGETSTATUS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestGetStatus( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTGETSTATUS) WdfFunctions[WdfRequestGetStatusTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestMarkCancelable -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTMARKCANCELABLE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - PFN_WDF_REQUEST_CANCEL EvtRequestCancel - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfRequestMarkCancelable( - _In_ - WDFREQUEST Request, - _In_ - PFN_WDF_REQUEST_CANCEL EvtRequestCancel - ) -{ - ((PFN_WDFREQUESTMARKCANCELABLE) WdfFunctions[WdfRequestMarkCancelableTableIndex])(WdfDriverGlobals, Request, EvtRequestCancel); -} - - -// -// WDF Function: WdfRequestMarkCancelableEx -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTMARKCANCELABLEEX)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - PFN_WDF_REQUEST_CANCEL EvtRequestCancel - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestMarkCancelableEx( - _In_ - WDFREQUEST Request, - _In_ - PFN_WDF_REQUEST_CANCEL EvtRequestCancel - ) -{ - return ((PFN_WDFREQUESTMARKCANCELABLEEX) WdfFunctions[WdfRequestMarkCancelableExTableIndex])(WdfDriverGlobals, Request, EvtRequestCancel); -} - - -// -// WDF Function: WdfRequestUnmarkCancelable -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTUNMARKCANCELABLE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestUnmarkCancelable( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTUNMARKCANCELABLE) WdfFunctions[WdfRequestUnmarkCancelableTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestIsCanceled -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFREQUESTISCANCELED)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -BOOLEAN -FORCEINLINE -WdfRequestIsCanceled( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTISCANCELED) WdfFunctions[WdfRequestIsCanceledTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestCancelSentRequest -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFREQUESTCANCELSENTREQUEST)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -BOOLEAN -FORCEINLINE -WdfRequestCancelSentRequest( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTCANCELSENTREQUEST) WdfFunctions[WdfRequestCancelSentRequestTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestIsFrom32BitProcess -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(APC_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFREQUESTISFROM32BITPROCESS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_Must_inspect_result_ -_IRQL_requires_max_(APC_LEVEL) -BOOLEAN -FORCEINLINE -WdfRequestIsFrom32BitProcess( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTISFROM32BITPROCESS) WdfFunctions[WdfRequestIsFrom32BitProcessTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestSetCompletionRoutine -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTSETCOMPLETIONROUTINE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_opt_ - PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine, - _In_opt_ __drv_aliasesMem - WDFCONTEXT CompletionContext - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfRequestSetCompletionRoutine( - _In_ - WDFREQUEST Request, - _In_opt_ - PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine, - _In_opt_ __drv_aliasesMem - WDFCONTEXT CompletionContext - ) -{ - ((PFN_WDFREQUESTSETCOMPLETIONROUTINE) WdfFunctions[WdfRequestSetCompletionRoutineTableIndex])(WdfDriverGlobals, Request, CompletionRoutine, CompletionContext); -} - - -// -// WDF Function: WdfRequestGetCompletionParams -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTGETCOMPLETIONPARAMS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _Out_ - PWDF_REQUEST_COMPLETION_PARAMS Params - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfRequestGetCompletionParams( - _In_ - WDFREQUEST Request, - _Out_ - PWDF_REQUEST_COMPLETION_PARAMS Params - ) -{ - ((PFN_WDFREQUESTGETCOMPLETIONPARAMS) WdfFunctions[WdfRequestGetCompletionParamsTableIndex])(WdfDriverGlobals, Request, Params); -} - - -// -// WDF Function: WdfRequestAllocateTimer -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTALLOCATETIMER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestAllocateTimer( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTALLOCATETIMER) WdfFunctions[WdfRequestAllocateTimerTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestComplete -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTCOMPLETE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - NTSTATUS Status - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfRequestComplete( - _In_ - WDFREQUEST Request, - _In_ - NTSTATUS Status - ) -{ - ((PFN_WDFREQUESTCOMPLETE) WdfFunctions[WdfRequestCompleteTableIndex])(WdfDriverGlobals, Request, Status); -} - - -// -// WDF Function: WdfRequestCompleteWithInformation -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTCOMPLETEWITHINFORMATION)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - NTSTATUS Status, - _In_ - ULONG_PTR Information - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfRequestCompleteWithInformation( - _In_ - WDFREQUEST Request, - _In_ - NTSTATUS Status, - _In_ - ULONG_PTR Information - ) -{ - ((PFN_WDFREQUESTCOMPLETEWITHINFORMATION) WdfFunctions[WdfRequestCompleteWithInformationTableIndex])(WdfDriverGlobals, Request, Status, Information); -} - - -// -// WDF Function: WdfRequestGetParameters -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTGETPARAMETERS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _Out_ - PWDF_REQUEST_PARAMETERS Parameters - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfRequestGetParameters( - _In_ - WDFREQUEST Request, - _Out_ - PWDF_REQUEST_PARAMETERS Parameters - ) -{ - ((PFN_WDFREQUESTGETPARAMETERS) WdfFunctions[WdfRequestGetParametersTableIndex])(WdfDriverGlobals, Request, Parameters); -} - - -// -// WDF Function: WdfRequestRetrieveInputMemory -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTRETRIEVEINPUTMEMORY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _Out_ - WDFMEMORY* Memory - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestRetrieveInputMemory( - _In_ - WDFREQUEST Request, - _Out_ - WDFMEMORY* Memory - ) -{ - return ((PFN_WDFREQUESTRETRIEVEINPUTMEMORY) WdfFunctions[WdfRequestRetrieveInputMemoryTableIndex])(WdfDriverGlobals, Request, Memory); -} - - -// -// WDF Function: WdfRequestRetrieveOutputMemory -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTRETRIEVEOUTPUTMEMORY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _Out_ - WDFMEMORY* Memory - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestRetrieveOutputMemory( - _In_ - WDFREQUEST Request, - _Out_ - WDFMEMORY* Memory - ) -{ - return ((PFN_WDFREQUESTRETRIEVEOUTPUTMEMORY) WdfFunctions[WdfRequestRetrieveOutputMemoryTableIndex])(WdfDriverGlobals, Request, Memory); -} - - -// -// WDF Function: WdfRequestRetrieveInputBuffer -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTRETRIEVEINPUTBUFFER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - size_t MinimumRequiredLength, - _Outptr_result_bytebuffer_(*Length) - PVOID* Buffer, - _Out_opt_ - size_t* Length - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestRetrieveInputBuffer( - _In_ - WDFREQUEST Request, - _In_ - size_t MinimumRequiredLength, - _Outptr_result_bytebuffer_(*Length) - PVOID* Buffer, - _Out_opt_ - size_t* Length - ) -{ - return ((PFN_WDFREQUESTRETRIEVEINPUTBUFFER) WdfFunctions[WdfRequestRetrieveInputBufferTableIndex])(WdfDriverGlobals, Request, MinimumRequiredLength, Buffer, Length); -} - - -// -// WDF Function: WdfRequestRetrieveOutputBuffer -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTRETRIEVEOUTPUTBUFFER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - size_t MinimumRequiredSize, - _Outptr_result_bytebuffer_(*Length) - PVOID* Buffer, - _Out_opt_ - size_t* Length - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestRetrieveOutputBuffer( - _In_ - WDFREQUEST Request, - _In_ - size_t MinimumRequiredSize, - _Outptr_result_bytebuffer_(*Length) - PVOID* Buffer, - _Out_opt_ - size_t* Length - ) -{ - return ((PFN_WDFREQUESTRETRIEVEOUTPUTBUFFER) WdfFunctions[WdfRequestRetrieveOutputBufferTableIndex])(WdfDriverGlobals, Request, MinimumRequiredSize, Buffer, Length); -} - - -// -// WDF Function: WdfRequestSetInformation -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTSETINFORMATION)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - ULONG_PTR Information - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfRequestSetInformation( - _In_ - WDFREQUEST Request, - _In_ - ULONG_PTR Information - ) -{ - ((PFN_WDFREQUESTSETINFORMATION) WdfFunctions[WdfRequestSetInformationTableIndex])(WdfDriverGlobals, Request, Information); -} - - -// -// WDF Function: WdfRequestGetInformation -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -ULONG_PTR -(*PFN_WDFREQUESTGETINFORMATION)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -ULONG_PTR -FORCEINLINE -WdfRequestGetInformation( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTGETINFORMATION) WdfFunctions[WdfRequestGetInformationTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestGetFileObject -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFFILEOBJECT -(*PFN_WDFREQUESTGETFILEOBJECT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFFILEOBJECT -FORCEINLINE -WdfRequestGetFileObject( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTGETFILEOBJECT) WdfFunctions[WdfRequestGetFileObjectTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestGetRequestorMode -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -KPROCESSOR_MODE -(*PFN_WDFREQUESTGETREQUESTORMODE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -KPROCESSOR_MODE -FORCEINLINE -WdfRequestGetRequestorMode( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTGETREQUESTORMODE) WdfFunctions[WdfRequestGetRequestorModeTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestForwardToIoQueue -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTFORWARDTOIOQUEUE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - WDFQUEUE DestinationQueue - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestForwardToIoQueue( - _In_ - WDFREQUEST Request, - _In_ - WDFQUEUE DestinationQueue - ) -{ - return ((PFN_WDFREQUESTFORWARDTOIOQUEUE) WdfFunctions[WdfRequestForwardToIoQueueTableIndex])(WdfDriverGlobals, Request, DestinationQueue); -} - - -// -// WDF Function: WdfRequestGetIoQueue -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFQUEUE -(*PFN_WDFREQUESTGETIOQUEUE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFQUEUE -FORCEINLINE -WdfRequestGetIoQueue( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTGETIOQUEUE) WdfFunctions[WdfRequestGetIoQueueTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestRequeue -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTREQUEUE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestRequeue( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTREQUEUE) WdfFunctions[WdfRequestRequeueTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestStopAcknowledge -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTSTOPACKNOWLEDGE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - BOOLEAN Requeue - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfRequestStopAcknowledge( - _In_ - WDFREQUEST Request, - _In_ - BOOLEAN Requeue - ) -{ - ((PFN_WDFREQUESTSTOPACKNOWLEDGE) WdfFunctions[WdfRequestStopAcknowledgeTableIndex])(WdfDriverGlobals, Request, Requeue); -} - - -// -// WDF Function: WdfRequestImpersonate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTIMPERSONATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, - _In_ - PFN_WDF_REQUEST_IMPERSONATE EvtRequestImpersonate, - _In_opt_ - PVOID Context - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestImpersonate( - _In_ - WDFREQUEST Request, - _In_ - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, - _In_ - PFN_WDF_REQUEST_IMPERSONATE EvtRequestImpersonate, - _In_opt_ - PVOID Context - ) -{ - return ((PFN_WDFREQUESTIMPERSONATE) WdfFunctions[WdfRequestImpersonateTableIndex])(WdfDriverGlobals, Request, ImpersonationLevel, EvtRequestImpersonate, Context); -} - - -// -// WDF Function: WdfRequestGetRequestorProcessId -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -ULONG -(*PFN_WDFREQUESTGETREQUESTORPROCESSID)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -ULONG -FORCEINLINE -WdfRequestGetRequestorProcessId( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTGETREQUESTORPROCESSID) WdfFunctions[WdfRequestGetRequestorProcessIdTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestIsFromUserModeDriver -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFREQUESTISFROMUSERMODEDRIVER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -BOOLEAN -FORCEINLINE -WdfRequestIsFromUserModeDriver( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTISFROMUSERMODEDRIVER) WdfFunctions[WdfRequestIsFromUserModeDriverTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestSetUserModeDriverInitiatedIo -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTSETUSERMODEDRIVERINITIATEDIO)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - BOOLEAN IsUserModeDriverInitiated - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfRequestSetUserModeDriverInitiatedIo( - _In_ - WDFREQUEST Request, - _In_ - BOOLEAN IsUserModeDriverInitiated - ) -{ - ((PFN_WDFREQUESTSETUSERMODEDRIVERINITIATEDIO) WdfFunctions[WdfRequestSetUserModeDriverInitiatedIoTableIndex])(WdfDriverGlobals, Request, IsUserModeDriverInitiated); -} - - -// -// WDF Function: WdfRequestGetUserModeDriverInitiatedIo -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFREQUESTGETUSERMODEDRIVERINITIATEDIO)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -BOOLEAN -FORCEINLINE -WdfRequestGetUserModeDriverInitiatedIo( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTGETUSERMODEDRIVERINITIATEDIO) WdfFunctions[WdfRequestGetUserModeDriverInitiatedIoTableIndex])(WdfDriverGlobals, Request); -} - - -// -// WDF Function: WdfRequestSetActivityId -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFREQUESTSETACTIVITYID)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _In_ - LPGUID ActivityId - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfRequestSetActivityId( - _In_ - WDFREQUEST Request, - _In_ - LPGUID ActivityId - ) -{ - ((PFN_WDFREQUESTSETACTIVITYID) WdfFunctions[WdfRequestSetActivityIdTableIndex])(WdfDriverGlobals, Request, ActivityId); -} - - -// -// WDF Function: WdfRequestRetrieveActivityId -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFREQUESTRETRIEVEACTIVITYID)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request, - _Out_ - LPGUID ActivityId - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfRequestRetrieveActivityId( - _In_ - WDFREQUEST Request, - _Out_ - LPGUID ActivityId - ) -{ - return ((PFN_WDFREQUESTRETRIEVEACTIVITYID) WdfFunctions[WdfRequestRetrieveActivityIdTableIndex])(WdfDriverGlobals, Request, ActivityId); -} - - -// -// WDF Function: WdfRequestGetEffectiveIoType -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -WDF_DEVICE_IO_TYPE -(*PFN_WDFREQUESTGETEFFECTIVEIOTYPE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFREQUEST Request - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -WDF_DEVICE_IO_TYPE -FORCEINLINE -WdfRequestGetEffectiveIoType( - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFREQUESTGETEFFECTIVEIOTYPE) WdfFunctions[WdfRequestGetEffectiveIoTypeTableIndex])(WdfDriverGlobals, Request); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfresource.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfresource.h deleted file mode 100644 index 134d9ce..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfresource.h +++ /dev/null @@ -1,94 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfresource.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -#define WDF_INSERT_AT_END ((ULONG) -1) - -// -// WDF Function: WdfCmResourceListGetCount -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -ULONG -(*PFN_WDFCMRESOURCELISTGETCOUNT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFCMRESLIST List - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -ULONG -FORCEINLINE -WdfCmResourceListGetCount( - _In_ - WDFCMRESLIST List - ) -{ - return ((PFN_WDFCMRESOURCELISTGETCOUNT) WdfFunctions[WdfCmResourceListGetCountTableIndex])(WdfDriverGlobals, List); -} - - -// -// WDF Function: WdfCmResourceListGetDescriptor -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -PCM_PARTIAL_RESOURCE_DESCRIPTOR -(*PFN_WDFCMRESOURCELISTGETDESCRIPTOR)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFCMRESLIST List, - _In_ - ULONG Index - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -PCM_PARTIAL_RESOURCE_DESCRIPTOR -FORCEINLINE -WdfCmResourceListGetDescriptor( - _In_ - WDFCMRESLIST List, - _In_ - ULONG Index - ) -{ - return ((PFN_WDFCMRESOURCELISTGETDESCRIPTOR) WdfFunctions[WdfCmResourceListGetDescriptorTableIndex])(WdfDriverGlobals, List, Index); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfroletypes.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfroletypes.h deleted file mode 100644 index ff3d553..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfroletypes.h +++ /dev/null @@ -1,43 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfroletypes.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef EVT_WDF_OBJECT_CONTEXT_CLEANUP EVT_WDF_DEVICE_CONTEXT_CLEANUP; -typedef EVT_WDF_OBJECT_CONTEXT_DESTROY EVT_WDF_DEVICE_CONTEXT_DESTROY; -typedef EVT_WDF_OBJECT_CONTEXT_CLEANUP EVT_WDF_IO_QUEUE_CONTEXT_CLEANUP_CALLBACK; -typedef EVT_WDF_OBJECT_CONTEXT_DESTROY EVT_WDF_IO_QUEUE_CONTEXT_DESTROY_CALLBACK; -typedef EVT_WDF_OBJECT_CONTEXT_CLEANUP EVT_WDF_FILE_CONTEXT_CLEANUP_CALLBACK; -typedef EVT_WDF_OBJECT_CONTEXT_DESTROY EVT_WDF_FILE_CONTEXT_DESTROY_CALLBACK; -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfstatus.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfstatus.h deleted file mode 100644 index 02126c3..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfstatus.h +++ /dev/null @@ -1,254 +0,0 @@ -/*++ BUILD Version: 0005 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - wdfstatus.h - -Abstract: - - Constant definitions for the WDFSTATUS values. - -Revision History: - -Notes: - - This file is generated by the MC tool from the wdfstatus.mc file. - ---*/ - -#ifndef _WDFSTATUS_H_ -#define _WDFSTATUS_H_ - -///////////////////////////////////////////////////////////////////////// -// -// Standard Success values match the NTSTATUS values -// -// -///////////////////////////////////////////////////////////////////////// - - -#define FACILITY_DRIVER_FRAMEWORK 0x20 - -// -// Values are 32 bit values laid out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-+-----------------------+-------------------------------+ -// |Sev|C|R| Facility | Code | -// +---+-+-+-----------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - is the facility code -// -// Code - is the facility's status code -// -// -// Define the facility codes -// - - -// -// Define the severity codes -// -#define STATUS_SEVERITY_WARNING 0x2 -#define STATUS_SEVERITY_SUCCESS 0x0 -#define STATUS_SEVERITY_INFORMATIONAL 0x1 -#define STATUS_SEVERITY_ERROR 0x3 - - -// -// MessageId: STATUS_WDF_QUEUED -// -// MessageText: -// -// The request was queued internally and not immediately submitted to its target. -// -#define STATUS_WDF_QUEUED ((NTSTATUS)0x40200000L) - -// -// MessageId: STATUS_WDF_POSTED -// -// MessageText: -// -// The request was posted to a worker thread. -// -#define STATUS_WDF_POSTED ((NTSTATUS)0x40200002L) - -// -// MessageId: STATUS_WDF_NO_PACKAGE -// -// MessageText: -// -// No package of the selected type has been defined. -// -#define STATUS_WDF_NO_PACKAGE ((NTSTATUS)0xC0200200L) - -// -// MessageId: STATUS_WDF_INTERNAL_ERROR -// -// MessageText: -// -// An internal error has occured. -// -#define STATUS_WDF_INTERNAL_ERROR ((NTSTATUS)0xC0200201L) - -// -// MessageId: STATUS_WDF_PAUSED -// -// MessageText: -// -// The object is in a paused state. -// -#define STATUS_WDF_PAUSED ((NTSTATUS)0xC0200203L) - -// -// MessageId: STATUS_WDF_BUSY -// -// MessageText: -// -// The object is busy with previous requests. -// -#define STATUS_WDF_BUSY ((NTSTATUS)0xC0200204L) - -// -// MessageId: STATUS_WDF_IO_TIMEOUT_NOT_SENT -// -// MessageText: -// -// The request timed out and was never sent to its target. -// -#define STATUS_WDF_IO_TIMEOUT_NOT_SENT ((NTSTATUS)0xC0200205L) - -// -// MessageId: STATUS_WDF_DEVICE_REMOVED_NOT_SENT -// -// MessageText: -// -// The request was never sent to its target and is now failed because the device has been removed. -// -#define STATUS_WDF_DEVICE_REMOVED_NOT_SENT ((NTSTATUS)0xC0200206L) - -// -// MessageId: STATUS_WDF_REQUEST_ALREADY_PENDING -// -// MessageText: -// -// A request that was already pending with a IO target was submitted to a IO target. -// -#define STATUS_WDF_REQUEST_ALREADY_PENDING ((NTSTATUS)0xC0200207L) - -// -// MessageId: STATUS_WDF_REQUEST_INVALID_STATE -// -// MessageText: -// -// An invalid operation was attempted on a request based on its currents state. -// -#define STATUS_WDF_REQUEST_INVALID_STATE ((NTSTATUS)0xC0200208L) - -// -// MessageId: STATUS_WDF_OBJECT_ATTRIBUTES_INVALID -// -// MessageText: -// -// An invalid WDF_OBJECT_ATTRIBUTES parameter was passed. -// -#define STATUS_WDF_OBJECT_ATTRIBUTES_INVALID ((NTSTATUS)0xC0200209L) - -// -// MessageId: STATUS_WDF_TOO_FRAGMENTED -// -// MessageText: -// -// The DMA Request's MDL has more SCATTER_GATHER_ELEMENTS that DMA Object's MaximumFragments allows. -// -#define STATUS_WDF_TOO_FRAGMENTED ((NTSTATUS)0xC020020AL) - -// -// MessageId: STATUS_WDF_NO_CALLBACK -// -// MessageText: -// -// A required Event Callback has not been registered. -// -#define STATUS_WDF_NO_CALLBACK ((NTSTATUS)0xC020020BL) - -// -// MessageId: STATUS_WDF_INCOMPATIBLE_EXECUTION_LEVEL -// -// MessageText: -// -// The object does not support the specified WDF_EXECUTION_LEVEL. -// -#define STATUS_WDF_INCOMPATIBLE_EXECUTION_LEVEL ((NTSTATUS)0xC020020CL) - -// -// MessageId: STATUS_WDF_PARENT_ALREADY_ASSIGNED -// -// MessageText: -// -// The object already has a parent assigned. -// -#define STATUS_WDF_PARENT_ALREADY_ASSIGNED ((NTSTATUS)0xC020020DL) - -// -// MessageId: STATUS_WDF_PARENT_IS_SELF -// -// MessageText: -// -// The object can not be its own parent. -// -#define STATUS_WDF_PARENT_IS_SELF ((NTSTATUS)0xC020020EL) - -// -// MessageId: STATUS_WDF_PARENT_ASSIGNMENT_NOT_ALLOWED -// -// MessageText: -// -// The object can not have a driver specified parent assignment. -// -#define STATUS_WDF_PARENT_ASSIGNMENT_NOT_ALLOWED ((NTSTATUS)0xC020020FL) - -// -// MessageId: STATUS_WDF_SYNCHRONIZATION_SCOPE_INVALID -// -// MessageText: -// -// The object does not support the specified WDF_SYNCHRONIZATION_SCOPE. -// -#define STATUS_WDF_SYNCHRONIZATION_SCOPE_INVALID ((NTSTATUS)0xC0200210L) - -// -// MessageId: STATUS_WDF_EXECUTION_LEVEL_INVALID -// -// MessageText: -// -// The object does not support the specified WDF_EXECUTION_LEVEL. -// -#define STATUS_WDF_EXECUTION_LEVEL_INVALID ((NTSTATUS)0xC0200211L) - -// -// MessageId: STATUS_WDF_PARENT_NOT_SPECIFIED -// -// MessageText: -// -// A required parent object was not specified in WDF_OBJECT_ATTRIBUTES. -// -#define STATUS_WDF_PARENT_NOT_SPECIFIED ((NTSTATUS)0xC0200212L) - -#endif // _WDFSTATUS_H_ diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfstring.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfstring.h deleted file mode 100644 index d8389fb..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfstring.h +++ /dev/null @@ -1,102 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfstring.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -// -// WDF Function: WdfStringCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFSTRINGCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_opt_ - PCUNICODE_STRING UnicodeString, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES StringAttributes, - _Out_ - WDFSTRING* String - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfStringCreate( - _In_opt_ - PCUNICODE_STRING UnicodeString, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES StringAttributes, - _Out_ - WDFSTRING* String - ) -{ - return ((PFN_WDFSTRINGCREATE) WdfFunctions[WdfStringCreateTableIndex])(WdfDriverGlobals, UnicodeString, StringAttributes, String); -} - - -// -// WDF Function: WdfStringGetUnicodeString -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFSTRINGGETUNICODESTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFSTRING String, - _Out_ - PUNICODE_STRING UnicodeString - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfStringGetUnicodeString( - _In_ - WDFSTRING String, - _Out_ - PUNICODE_STRING UnicodeString - ) -{ - ((PFN_WDFSTRINGGETUNICODESTRING) WdfFunctions[WdfStringGetUnicodeStringTableIndex])(WdfDriverGlobals, String, UnicodeString); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfsync.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfsync.h deleted file mode 100644 index 1cc91d2..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfsync.h +++ /dev/null @@ -1,300 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfsync.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -// -// WDF Function: WdfObjectAcquireLock -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFOBJECTACQUIRELOCK)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - _Requires_lock_not_held_(_Curr_) - _Acquires_lock_(_Curr_) - WDFOBJECT Object - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfObjectAcquireLock( - _In_ - _Requires_lock_not_held_(_Curr_) - _Acquires_lock_(_Curr_) - WDFOBJECT Object - ) -{ - ((PFN_WDFOBJECTACQUIRELOCK) WdfFunctions[WdfObjectAcquireLockTableIndex])(WdfDriverGlobals, Object); -} - - -// -// WDF Function: WdfObjectReleaseLock -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFOBJECTRELEASELOCK)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - _Requires_lock_held_(_Curr_) - _Releases_lock_(_Curr_) - WDFOBJECT Object - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfObjectReleaseLock( - _In_ - _Requires_lock_held_(_Curr_) - _Releases_lock_(_Curr_) - WDFOBJECT Object - ) -{ - ((PFN_WDFOBJECTRELEASELOCK) WdfFunctions[WdfObjectReleaseLockTableIndex])(WdfDriverGlobals, Object); -} - - -// -// WDF Function: WdfWaitLockCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFWAITLOCKCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES LockAttributes, - _Out_ - WDFWAITLOCK* Lock - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfWaitLockCreate( - _In_opt_ - PWDF_OBJECT_ATTRIBUTES LockAttributes, - _Out_ - WDFWAITLOCK* Lock - ) -{ - return ((PFN_WDFWAITLOCKCREATE) WdfFunctions[WdfWaitLockCreateTableIndex])(WdfDriverGlobals, LockAttributes, Lock); -} - - -// -// WDF Function: WdfWaitLockAcquire -// -typedef -_When_(Timeout == NULL, _IRQL_requires_max_(PASSIVE_LEVEL)) -_When_(Timeout != NULL && *Timeout == 0, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(Timeout != NULL && *Timeout != 0, _IRQL_requires_max_(PASSIVE_LEVEL)) -_Always_(_When_(Timeout == NULL, _Acquires_lock_(Lock))) -_When_(Timeout != NULL && return == STATUS_SUCCESS, _Acquires_lock_(Lock)) -_When_(Timeout != NULL, _Must_inspect_result_) -WDFAPI -NTSTATUS -(*PFN_WDFWAITLOCKACQUIRE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - _Requires_lock_not_held_(_Curr_) - WDFWAITLOCK Lock, - _In_opt_ - PLONGLONG Timeout - ); - -_When_(Timeout == NULL, _IRQL_requires_max_(PASSIVE_LEVEL)) -_When_(Timeout != NULL && *Timeout == 0, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(Timeout != NULL && *Timeout != 0, _IRQL_requires_max_(PASSIVE_LEVEL)) -_Always_(_When_(Timeout == NULL, _Acquires_lock_(Lock))) -_When_(Timeout != NULL && return == STATUS_SUCCESS, _Acquires_lock_(Lock)) -_When_(Timeout != NULL, _Must_inspect_result_) -NTSTATUS -FORCEINLINE -WdfWaitLockAcquire( - _In_ - _Requires_lock_not_held_(_Curr_) - WDFWAITLOCK Lock, - _In_opt_ - PLONGLONG Timeout - ) -{ - return ((PFN_WDFWAITLOCKACQUIRE) WdfFunctions[WdfWaitLockAcquireTableIndex])(WdfDriverGlobals, Lock, Timeout); -} - - -// -// WDF Function: WdfWaitLockRelease -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFWAITLOCKRELEASE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - _Requires_lock_held_(_Curr_) - _Releases_lock_(_Curr_) - WDFWAITLOCK Lock - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfWaitLockRelease( - _In_ - _Requires_lock_held_(_Curr_) - _Releases_lock_(_Curr_) - WDFWAITLOCK Lock - ) -{ - ((PFN_WDFWAITLOCKRELEASE) WdfFunctions[WdfWaitLockReleaseTableIndex])(WdfDriverGlobals, Lock); -} - - -// -// WDF Function: WdfSpinLockCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFSPINLOCKCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES SpinLockAttributes, - _Out_ - WDFSPINLOCK* SpinLock - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfSpinLockCreate( - _In_opt_ - PWDF_OBJECT_ATTRIBUTES SpinLockAttributes, - _Out_ - WDFSPINLOCK* SpinLock - ) -{ - return ((PFN_WDFSPINLOCKCREATE) WdfFunctions[WdfSpinLockCreateTableIndex])(WdfDriverGlobals, SpinLockAttributes, SpinLock); -} - - -// -// WDF Function: WdfSpinLockAcquire -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -_IRQL_raises_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFSPINLOCKACQUIRE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - _Requires_lock_not_held_(_Curr_) - _Acquires_lock_(_Curr_) - _IRQL_saves_ - WDFSPINLOCK SpinLock - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -_IRQL_raises_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfSpinLockAcquire( - _In_ - _Requires_lock_not_held_(_Curr_) - _Acquires_lock_(_Curr_) - _IRQL_saves_ - WDFSPINLOCK SpinLock - ) -{ - ((PFN_WDFSPINLOCKACQUIRE) WdfFunctions[WdfSpinLockAcquireTableIndex])(WdfDriverGlobals, SpinLock); -} - - -// -// WDF Function: WdfSpinLockRelease -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -_IRQL_requires_min_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFSPINLOCKRELEASE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - _Requires_lock_held_(_Curr_) - _Releases_lock_(_Curr_) - _IRQL_restores_ - WDFSPINLOCK SpinLock - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -_IRQL_requires_min_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfSpinLockRelease( - _In_ - _Requires_lock_held_(_Curr_) - _Releases_lock_(_Curr_) - _IRQL_restores_ - WDFSPINLOCK SpinLock - ) -{ - ((PFN_WDFSPINLOCKRELEASE) WdfFunctions[WdfSpinLockReleaseTableIndex])(WdfDriverGlobals, SpinLock); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftimer.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftimer.h deleted file mode 100644 index 2e4a1ad..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftimer.h +++ /dev/null @@ -1,246 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdftimer.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - - -#define TolerableDelayUnlimited ((ULONG)-1) - -// -// This is the function that gets called back into the driver -// when the TIMER fires. -// -typedef -_Function_class_(EVT_WDF_TIMER) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_TIMER( - _In_ - WDFTIMER Timer - ); - -typedef EVT_WDF_TIMER *PFN_WDF_TIMER; - -// -// Disable warning C4324: structure was padded due to DECLSPEC_ALIGN -// This padding is intentional and necessary. -#pragma warning(push) -#pragma warning(disable: 4324) - -typedef struct _WDF_TIMER_CONFIG { - ULONG Size; - PFN_WDF_TIMER EvtTimerFunc; - - ULONG Period; - - // - // If this is TRUE, the Timer will automatically serialize - // with the event callback handlers of its Parent Object. - // - // Parent Object's callback constraints should be compatible - // with the Timer DPC (DISPATCH_LEVEL), or the request will fail. - // - BOOLEAN AutomaticSerialization; - - // - // Optional tolerance for the timer in milliseconds. - // - ULONG TolerableDelay; - - // - // If this is TRUE, high resolution timers will be used. The default - // value is FALSE - // - DECLSPEC_ALIGN(8) BOOLEAN UseHighResolutionTimer; - -} WDF_TIMER_CONFIG, *PWDF_TIMER_CONFIG; - -#pragma warning(pop) - -VOID -FORCEINLINE -WDF_TIMER_CONFIG_INIT( - _Out_ PWDF_TIMER_CONFIG Config, - _In_ PFN_WDF_TIMER EvtTimerFunc - ) -{ - RtlZeroMemory(Config, sizeof(WDF_TIMER_CONFIG)); - Config->Size = sizeof(WDF_TIMER_CONFIG); - Config->EvtTimerFunc = EvtTimerFunc; - Config->Period = 0; - Config->AutomaticSerialization = TRUE; - Config->TolerableDelay = 0; -} - -VOID -FORCEINLINE -WDF_TIMER_CONFIG_INIT_PERIODIC( - _Out_ PWDF_TIMER_CONFIG Config, - _In_ PFN_WDF_TIMER EvtTimerFunc, - _In_ LONG Period - ) -{ - RtlZeroMemory(Config, sizeof(WDF_TIMER_CONFIG)); - Config->Size = sizeof(WDF_TIMER_CONFIG); - Config->EvtTimerFunc = EvtTimerFunc; - Config->Period = Period; - Config->AutomaticSerialization = TRUE; - Config->TolerableDelay = 0; -} - -// -// WDF Function: WdfTimerCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFTIMERCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDF_TIMER_CONFIG Config, - _In_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFTIMER* Timer - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfTimerCreate( - _In_ - PWDF_TIMER_CONFIG Config, - _In_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFTIMER* Timer - ) -{ - return ((PFN_WDFTIMERCREATE) WdfFunctions[WdfTimerCreateTableIndex])(WdfDriverGlobals, Config, Attributes, Timer); -} - - -// -// WDF Function: WdfTimerStart -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFTIMERSTART)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFTIMER Timer, - _In_ - LONGLONG DueTime - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -BOOLEAN -FORCEINLINE -WdfTimerStart( - _In_ - WDFTIMER Timer, - _In_ - LONGLONG DueTime - ) -{ - return ((PFN_WDFTIMERSTART) WdfFunctions[WdfTimerStartTableIndex])(WdfDriverGlobals, Timer, DueTime); -} - - -// -// WDF Function: WdfTimerStop -// -typedef -_When_(Wait == __true, _IRQL_requires_max_(PASSIVE_LEVEL)) -_When_(Wait == __false, _IRQL_requires_max_(DISPATCH_LEVEL)) -WDFAPI -BOOLEAN -(*PFN_WDFTIMERSTOP)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFTIMER Timer, - _In_ - BOOLEAN Wait - ); - -_When_(Wait == __true, _IRQL_requires_max_(PASSIVE_LEVEL)) -_When_(Wait == __false, _IRQL_requires_max_(DISPATCH_LEVEL)) -BOOLEAN -FORCEINLINE -WdfTimerStop( - _In_ - WDFTIMER Timer, - _In_ - BOOLEAN Wait - ) -{ - return ((PFN_WDFTIMERSTOP) WdfFunctions[WdfTimerStopTableIndex])(WdfDriverGlobals, Timer, Wait); -} - - -// -// WDF Function: WdfTimerGetParentObject -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFOBJECT -(*PFN_WDFTIMERGETPARENTOBJECT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFTIMER Timer - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFOBJECT -FORCEINLINE -WdfTimerGetParentObject( - _In_ - WDFTIMER Timer - ) -{ - return ((PFN_WDFTIMERGETPARENTOBJECT) WdfFunctions[WdfTimerGetParentObjectTableIndex])(WdfDriverGlobals, Timer); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftriage.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftriage.h deleted file mode 100644 index 610c195..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftriage.h +++ /dev/null @@ -1,135 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdftriage.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -#define WDF_01_TRIAGE_INFO_MAJOR_VERSION 1 -#define WDF_01_TRIAGE_INFO_MINOR_VERSION 0 - -typedef struct _WDFOBJECT_TRIAGE_INFO { - ULONG RawObjectSize; // value - ULONG ObjectType; - ULONG TotalObjectSize; - ULONG ChildListHead; - ULONG ChildEntry; - ULONG Globals; - ULONG ParentObject; -} WDFOBJECT_TRIAGE_INFO, *PWDFOBJECT_TRIAGE_INFO; - -typedef struct _WDFCONTEXT_TRIAGE_INFO { - ULONG HeaderSize; // value - ULONG NextHeader; - ULONG Object; - ULONG TypeInfoPtr; - ULONG Context; -} WDFCONTEXT_TRIAGE_INFO, *PWDFCONTEXT_TRIAGE_INFO; - -typedef struct _WDFCONTEXTTYPE_TRIAGE_INFO { - ULONG TypeInfoSize; // value - ULONG ContextSize; - ULONG ContextName; -} WDFCONTEXTTYPE_TRIAGE_INFO, *PWDFCONTEXTTYPE_TRIAGE_INFO; - -typedef struct _WDFQUEUE_TRIAGE_INFO { - ULONG QueueSize; // value - ULONG IrpQueue1; - ULONG IrpQueue2; - ULONG RequestList1; - ULONG RequestList2; - ULONG FwdProgressContext; - ULONG PkgIo; -} WDFQUEUE_TRIAGE_INFO, *PWDFQUEUE_TRIAGE_INFO; - -typedef struct _WDFFWDPROGRESS_TRIAGE_INFO { - ULONG ReservedRequestList; - ULONG ReservedRequestInUseList; - ULONG PendedIrpList; -} WDFFWDPROGRESS_TRIAGE_INFO, *PWDFFWDPROGRESS_TRIAGE_INFO; - -typedef struct _WDFIRPQUEUE_TRIAGE_INFO { - ULONG IrpQueueSize; // value - ULONG IrpListHeader; - ULONG IrpListEntry; - ULONG IrpContext; -} WDFIRPQUEUE_TRIAGE_INFO, *PWDFIRPQUEUE_TRIAGE_INFO; - -typedef struct _WDFREQUEST_TRIAGE_INFO { - ULONG RequestSize; // value - ULONG CsqContext; - ULONG FxIrp; // WDF irp wrapper, see below. - ULONG ListEntryQueueOwned; - ULONG ListEntryQueueOwned2; - ULONG RequestListEntry; - ULONG FwdProgressList; -} WDFREQUEST_TRIAGE_INFO, *PWDFREQUEST_TRIAGE_INFO; - -typedef struct _WDFDEVICE_TRIAGE_INFO { - ULONG DeviceInitSize; // value - ULONG DeviceDriver; -} WDFDEVICE_TRIAGE_INFO, *PWDFDEVICE_TRIAGE_INFO; - -typedef struct _WDFIRP_TRIAGE_INFO { - ULONG FxIrpSize; // value - ULONG IrpPtr; -} WDFIRP_TRIAGE_INFO, *PWDFIRP_TRIAGE_INFO; - -typedef struct _WDF_TRIAGE_INFO { - // - // Version. - // - ULONG WdfMajorVersion; - ULONG WdfMinorVersion; - ULONG TriageInfoMajorVersion; - ULONG TriageInfoMinorVersion; - - // - // Reserved pointer. - // - PVOID Reserved; - - // - // WDF objects triage info. - // - PWDFOBJECT_TRIAGE_INFO WdfObjectTriageInfo; - PWDFCONTEXT_TRIAGE_INFO WdfContextTriageInfo; - PWDFCONTEXTTYPE_TRIAGE_INFO WdfContextTypeTriageInfo; - PWDFQUEUE_TRIAGE_INFO WdfQueueTriageInfo; - PWDFFWDPROGRESS_TRIAGE_INFO WdfFwdProgressTriageInfo; - PWDFIRPQUEUE_TRIAGE_INFO WdfIrpQueueTriageInfo; - PWDFREQUEST_TRIAGE_INFO WdfRequestTriageInfo; - PWDFDEVICE_TRIAGE_INFO WdfDeviceTriageInfo; - PWDFIRP_TRIAGE_INFO WdfIrpTriageInfo; - -} WDF_TRIAGE_INFO, *PWDF_TRIAGE_INFO; -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftypes.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftypes.h deleted file mode 100644 index af0bd5f..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdftypes.h +++ /dev/null @@ -1,156 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdftypes.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - - - -#define WDFAPI - -#ifndef __WDF_BYTE_DEFINED__ -#define __WDF_BYTE_DEFINED__ -typedef UCHAR BYTE; -#endif // __WDF_BYTE_DEFINED__ - -// -// Windows 2000 does not define FORCEINLINE, so define it if needed -// -#ifndef FORCEINLINE -#if (_MSC_VER >= 1200) -#define FORCEINLINE __forceinline -#else -#define FORCEINLINE __inline -#endif -#endif - - -// -// WDF_WPP_KMDF_DRIVER define is used by the WPP trace template file -// (km-init.tpl) to call the framework to register the KMDF provider -// if the WppInit and WppCleanup functions are executed in the -// Windows 2000 system. -// -#ifndef WDF_WPP_KMDF_DRIVER -#define WDF_WPP_KMDF_DRIVER -#endif // WDF_WPP_KMDF_DRIVER - -// -// Do not create an invalid value for this enum in case driver writers mix up -// the usage of WdfFalse/FALSE and WdfTrue/TRUE. -// -typedef enum _WDF_TRI_STATE { - WdfFalse = FALSE, - WdfTrue = TRUE, - WdfUseDefault = 2, -} WDF_TRI_STATE, *PWDF_TRI_STATE; - - -typedef PVOID WDFCONTEXT; - -// -// Forward declare structures needed later header files -// -typedef struct WDFDEVICE_INIT *PWDFDEVICE_INIT; -typedef struct WDFCXDEVICE_INIT *PWDFCXDEVICE_INIT; - -typedef struct _WDF_OBJECT_ATTRIBUTES *PWDF_OBJECT_ATTRIBUTES; - - -#define WDF_NO_OBJECT_ATTRIBUTES (NULL) -#define WDF_NO_EVENT_CALLBACK (NULL) -#define WDF_NO_HANDLE (NULL) -#define WDF_NO_CONTEXT (NULL) -#define WDF_NO_SEND_OPTIONS (NULL) - -// -// General Handle Type, should always be typeless -// -typedef HANDLE WDFOBJECT, *PWDFOBJECT; - -// -// core handles -// -DECLARE_HANDLE( WDFDRIVER ); -DECLARE_HANDLE( WDFDEVICE ); - -DECLARE_HANDLE( WDFWMIPROVIDER ); -DECLARE_HANDLE( WDFWMIINSTANCE ); - -DECLARE_HANDLE( WDFQUEUE ); -DECLARE_HANDLE( WDFREQUEST ); -DECLARE_HANDLE( WDFFILEOBJECT ); -DECLARE_HANDLE( WDFDPC ); -DECLARE_HANDLE( WDFTIMER ); -DECLARE_HANDLE( WDFWORKITEM ); -DECLARE_HANDLE( WDFINTERRUPT ); - -// -// synch and lock handles -// -DECLARE_HANDLE( WDFWAITLOCK ); -DECLARE_HANDLE( WDFSPINLOCK ); - -DECLARE_HANDLE( WDFMEMORY ); -DECLARE_HANDLE( WDFLOOKASIDE ); - -// -// i/o targets for different busses -// -DECLARE_HANDLE( WDFIOTARGET ); -DECLARE_HANDLE( WDFUSBDEVICE ); -DECLARE_HANDLE( WDFUSBINTERFACE ); -DECLARE_HANDLE( WDFUSBPIPE ); - -// dma handles -DECLARE_HANDLE( WDFDMAENABLER ); -DECLARE_HANDLE( WDFDMATRANSACTION ); -DECLARE_HANDLE( WDFCOMMONBUFFER ); - -// -// support handles -// -DECLARE_HANDLE( WDFKEY ); -DECLARE_HANDLE( WDFSTRING ); -DECLARE_HANDLE( WDFCOLLECTION ); -DECLARE_HANDLE( WDFCHILDLIST ); - -DECLARE_HANDLE( WDFIORESREQLIST ); -DECLARE_HANDLE( WDFIORESLIST ); -DECLARE_HANDLE( WDFCMRESLIST ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -WDF_EXTERN_C_END - - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfusb.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfusb.h deleted file mode 100644 index 66f8d83..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfusb.h +++ /dev/null @@ -1,2205 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - WdfUsb.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -#ifndef BMREQUEST_HOST_TO_DEVICE -#define BMREQUEST_HOST_TO_DEVICE 0 -#endif // BMREQUEST_HOST_TO_DEVICE - -#ifndef BMREQUEST_DEVICE_TO_HOST -#define BMREQUEST_DEVICE_TO_HOST 1 -#endif // BMREQUEST_DEVICE_TO_HOST - -#ifndef BMREQUEST_STANDARD -#define BMREQUEST_STANDARD 0 -#endif // BMREQUEST_STANDARD - -#ifndef BMREQUEST_CLASS -#define BMREQUEST_CLASS 1 -#endif // BMREQUEST_CLASS - -#ifndef BMREQUEST_VENDOR -#define BMREQUEST_VENDOR 2 -#endif // BMREQUEST_VENDOR - -#ifndef BMREQUEST_TO_DEVICE -#define BMREQUEST_TO_DEVICE 0 -#endif // BMREQUEST_TO_DEVICE - -#ifndef BMREQUEST_TO_INTERFACE -#define BMREQUEST_TO_INTERFACE 1 -#endif // BMREQUEST_TO_INTERFACE - -#ifndef BMREQUEST_TO_ENDPOINT -#define BMREQUEST_TO_ENDPOINT 2 -#endif // BMREQUEST_TO_ENDPOINT - -#ifndef BMREQUEST_TO_OTHER -#define BMREQUEST_TO_OTHER 3 -#endif // BMREQUEST_TO_OTHER - -typedef enum _WDF_USB_REQUEST_TYPE { - WdfUsbRequestTypeInvalid = 0, - WdfUsbRequestTypeNoFormat, - WdfUsbRequestTypeDeviceString, - WdfUsbRequestTypeDeviceControlTransfer, - WdfUsbRequestTypeDeviceUrb, - WdfUsbRequestTypePipeWrite, - WdfUsbRequestTypePipeRead, - WdfUsbRequestTypePipeAbort, - WdfUsbRequestTypePipeReset, - WdfUsbRequestTypePipeUrb, -} WDF_USB_REQUEST_TYPE, *PWDF_USB_REQUEST_TYPE; - - -typedef enum _WDF_USB_BMREQUEST_DIRECTION { - BmRequestHostToDevice = BMREQUEST_HOST_TO_DEVICE, - BmRequestDeviceToHost = BMREQUEST_DEVICE_TO_HOST, -} WDF_USB_BMREQUEST_DIRECTION; - - -typedef enum _WDF_USB_BMREQUEST_TYPE { - BmRequestStandard = BMREQUEST_STANDARD, - BmRequestClass = BMREQUEST_CLASS, - BmRequestVendor = BMREQUEST_VENDOR, -} WDF_USB_BMREQUEST_TYPE; - - -typedef enum _WDF_USB_BMREQUEST_RECIPIENT { - BmRequestToDevice = BMREQUEST_TO_DEVICE, - BmRequestToInterface = BMREQUEST_TO_INTERFACE, - BmRequestToEndpoint = BMREQUEST_TO_ENDPOINT, - BmRequestToOther = BMREQUEST_TO_OTHER, -} WDF_USB_BMREQUEST_RECIPIENT; - - -typedef enum _WDF_USB_PIPE_TYPE { - WdfUsbPipeTypeInvalid = 0, - WdfUsbPipeTypeControl, - WdfUsbPipeTypeIsochronous, - WdfUsbPipeTypeBulk, - WdfUsbPipeTypeInterrupt, -} WDF_USB_PIPE_TYPE; - - -typedef enum _WdfUsbTargetDeviceSelectConfigType { - WdfUsbTargetDeviceSelectConfigTypeInvalid = 0, - WdfUsbTargetDeviceSelectConfigTypeDeconfig = 1, - WdfUsbTargetDeviceSelectConfigTypeSingleInterface = 2, - WdfUsbTargetDeviceSelectConfigTypeMultiInterface = 3, - WdfUsbTargetDeviceSelectConfigTypeInterfacesPairs = 4, - WdfUsbTargetDeviceSelectConfigTypeInterfacesDescriptor = 5, - WdfUsbTargetDeviceSelectConfigTypeUrb = 6, -} WdfUsbTargetDeviceSelectConfigType; - - -typedef enum _WdfUsbTargetDeviceSelectSettingType { - WdfUsbInterfaceSelectSettingTypeDescriptor = 0x10, - WdfUsbInterfaceSelectSettingTypeSetting = 0x11, - WdfUsbInterfaceSelectSettingTypeUrb = 0x12, -} WdfUsbTargetDeviceSelectSettingType; - - -typedef enum _WDF_USB_DEVICE_TRAITS { - WDF_USB_DEVICE_TRAIT_SELF_POWERED = 0x00000001, - WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE = 0x00000002, - WDF_USB_DEVICE_TRAIT_AT_HIGH_SPEED = 0x00000004, -} WDF_USB_DEVICE_TRAITS; - - -typedef union _WDF_USB_CONTROL_SETUP_PACKET { - struct { - union { - #pragma warning(push) - #pragma warning(disable:4214) // bit field types other than int - struct { - // - // Valid values are BMREQUEST_TO_DEVICE, BMREQUEST_TO_INTERFACE, - // BMREQUEST_TO_ENDPOINT, BMREQUEST_TO_OTHER - // - BYTE Recipient:2; - - BYTE Reserved:3; - - // - // Valid values are BMREQUEST_STANDARD, BMREQUEST_CLASS, - // BMREQUEST_VENDOR - // - BYTE Type:2; - - // - // Valid values are BMREQUEST_HOST_TO_DEVICE, - // BMREQUEST_DEVICE_TO_HOST - // - BYTE Dir:1; - } Request; - #pragma warning(pop) // bit field types other than int - BYTE Byte; - } bm; - - BYTE bRequest; - - union { - struct { - BYTE LowByte; - BYTE HiByte; - } Bytes; - USHORT Value; - } wValue; - - union { - struct { - BYTE LowByte; - BYTE HiByte; - } Bytes; - USHORT Value; - } wIndex; - - USHORT wLength; - } Packet; - - struct { - BYTE Bytes[8]; - } Generic; -} WDF_USB_CONTROL_SETUP_PACKET, *PWDF_USB_CONTROL_SETUP_PACKET; - -VOID -FORCEINLINE -WDF_USB_CONTROL_SETUP_PACKET_INIT( - _Out_ PWDF_USB_CONTROL_SETUP_PACKET Packet, - _In_ WDF_USB_BMREQUEST_DIRECTION Direction, - _In_ WDF_USB_BMREQUEST_RECIPIENT Recipient, - _In_ BYTE Request, - _In_ USHORT Value, - _In_ USHORT Index - ) -{ - RtlZeroMemory(Packet, sizeof(WDF_USB_CONTROL_SETUP_PACKET)); - - Packet->Packet.bm.Request.Dir = (BYTE) Direction; - Packet->Packet.bm.Request.Type = (BYTE) BmRequestStandard; - Packet->Packet.bm.Request.Recipient = (BYTE) Recipient; - - Packet->Packet.bRequest = Request; - Packet->Packet.wValue.Value = Value; - Packet->Packet.wIndex.Value = Index; - - // Packet->Packet.wLength will be set by the formatting function -} - -VOID -FORCEINLINE -WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS( - _Out_ PWDF_USB_CONTROL_SETUP_PACKET Packet, - _In_ WDF_USB_BMREQUEST_DIRECTION Direction, - _In_ WDF_USB_BMREQUEST_RECIPIENT Recipient, - _In_ BYTE Request, - _In_ USHORT Value, - _In_ USHORT Index - ) -{ - RtlZeroMemory(Packet, sizeof(WDF_USB_CONTROL_SETUP_PACKET)); - - Packet->Packet.bm.Request.Dir = (BYTE) Direction; - Packet->Packet.bm.Request.Type = (BYTE) BmRequestClass; - Packet->Packet.bm.Request.Recipient = (BYTE) Recipient; - - Packet->Packet.bRequest = Request; - Packet->Packet.wValue.Value = Value; - Packet->Packet.wIndex.Value = Index; - - // Packet->Packet.wLength will be set by the formatting function -} - -VOID -FORCEINLINE -WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR( - _Out_ PWDF_USB_CONTROL_SETUP_PACKET Packet, - _In_ WDF_USB_BMREQUEST_DIRECTION Direction, - _In_ WDF_USB_BMREQUEST_RECIPIENT Recipient, - _In_ BYTE Request, - _In_ USHORT Value, - _In_ USHORT Index - ) -{ - RtlZeroMemory(Packet, sizeof(WDF_USB_CONTROL_SETUP_PACKET)); - - Packet->Packet.bm.Request.Dir = (BYTE) Direction; - Packet->Packet.bm.Request.Type = (BYTE) BmRequestVendor; - Packet->Packet.bm.Request.Recipient = (BYTE) Recipient; - - Packet->Packet.bRequest = Request; - Packet->Packet.wValue.Value = Value; - Packet->Packet.wIndex.Value = Index; - - // Packet->Packet.wLength will be set by the formatting function -} - -VOID -FORCEINLINE -WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE( - _Out_ PWDF_USB_CONTROL_SETUP_PACKET Packet, - _In_ WDF_USB_BMREQUEST_RECIPIENT BmRequestRecipient, - _In_ USHORT FeatureSelector, - _In_ USHORT Index, - _In_ BOOLEAN SetFeature - ) -{ - RtlZeroMemory(Packet, sizeof(WDF_USB_CONTROL_SETUP_PACKET)); - - Packet->Packet.bm.Request.Dir = (BYTE) BmRequestHostToDevice; - Packet->Packet.bm.Request.Type = (BYTE) BmRequestStandard; - Packet->Packet.bm.Request.Recipient = (BYTE) BmRequestRecipient; - - if (SetFeature) { - Packet->Packet.bRequest = USB_REQUEST_SET_FEATURE; - } - else { - Packet->Packet.bRequest = USB_REQUEST_CLEAR_FEATURE; - } - - Packet->Packet.wValue.Value = FeatureSelector; - Packet->Packet.wIndex.Value = Index; - - // Packet->Packet.wLength will be set by the formatting function -} - -VOID -FORCEINLINE -WDF_USB_CONTROL_SETUP_PACKET_INIT_GET_STATUS( - _Out_ PWDF_USB_CONTROL_SETUP_PACKET Packet, - _In_ WDF_USB_BMREQUEST_RECIPIENT BmRequestRecipient, - _In_ USHORT Index - ) -{ - RtlZeroMemory(Packet, sizeof(WDF_USB_CONTROL_SETUP_PACKET)); - - Packet->Packet.bm.Request.Dir = (BYTE) BmRequestDeviceToHost; - Packet->Packet.bm.Request.Type = (BYTE) BmRequestStandard; - Packet->Packet.bm.Request.Recipient = (BYTE) BmRequestRecipient; - - Packet->Packet.bRequest = USB_REQUEST_GET_STATUS; - Packet->Packet.wIndex.Value = Index; - Packet->Packet.wValue.Value = 0; - - // Packet->Packet.wLength will be set by the formatting function -} - -typedef struct _WDF_USB_REQUEST_COMPLETION_PARAMS { - USBD_STATUS UsbdStatus; - - WDF_USB_REQUEST_TYPE Type; - - union { - struct { - WDFMEMORY Buffer; - USHORT LangID; - UCHAR StringIndex; - - // - // If STATUS_BUFFER_OVERFLOW is returned, this field will contain the - // number of bytes required to retrieve the entire string. - // - UCHAR RequiredSize; - } DeviceString; - - struct { - WDFMEMORY Buffer; - WDF_USB_CONTROL_SETUP_PACKET SetupPacket; - ULONG Length; - } DeviceControlTransfer; - - struct { - WDFMEMORY Buffer; - } DeviceUrb; - - struct { - WDFMEMORY Buffer; - size_t Length; - size_t Offset; - } PipeWrite; - - struct { - WDFMEMORY Buffer; - size_t Length; - size_t Offset; - } PipeRead; - - struct { - WDFMEMORY Buffer; - } PipeUrb; - } Parameters; - -} WDF_USB_REQUEST_COMPLETION_PARAMS, *PWDF_USB_REQUEST_COMPLETION_PARAMS; - -typedef -_Function_class_(EVT_WDF_USB_READER_COMPLETION_ROUTINE) -_IRQL_requires_same_ -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -EVT_WDF_USB_READER_COMPLETION_ROUTINE( - _In_ - WDFUSBPIPE Pipe, - _In_ - WDFMEMORY Buffer, - _In_ - size_t NumBytesTransferred, - _In_ - WDFCONTEXT Context - ); - -typedef EVT_WDF_USB_READER_COMPLETION_ROUTINE *PFN_WDF_USB_READER_COMPLETION_ROUTINE; - -typedef -_Function_class_(EVT_WDF_USB_READERS_FAILED) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -BOOLEAN -EVT_WDF_USB_READERS_FAILED( - _In_ - WDFUSBPIPE Pipe, - _In_ - NTSTATUS Status, - _In_ - USBD_STATUS UsbdStatus - ); - -typedef EVT_WDF_USB_READERS_FAILED *PFN_WDF_USB_READERS_FAILED; - -typedef struct _WDF_USB_CONTINUOUS_READER_CONFIG { - // - // Size of the string in bytes - // - ULONG Size; - - // - // Number of bytes to send ask for from the usb device. - // - size_t TransferLength; - - // - // Number of bytes to allocate before the requested transfer length - // - size_t HeaderLength; - - // - // Number of bytes to allocate after the requested transfer length - // - size_t TrailerLength; - - // - // Number of reads to send to the device at once. If zero is specified, the - // default will be used. - // - UCHAR NumPendingReads; - - // - // Optional attributes to apply to each WDFMEMORY allocated for each read - // - PWDF_OBJECT_ATTRIBUTES BufferAttributes; - - // - // Event callback invoked when a read is completed - // - PFN_WDF_USB_READER_COMPLETION_ROUTINE EvtUsbTargetPipeReadComplete; - - // - // Context to be passed to EvtUsbTargetPipeReadComplete - // - WDFCONTEXT EvtUsbTargetPipeReadCompleteContext; - - // - // Event callback invoked when a reader fails. If TRUE is returned, the - // readers are restarted. - // - PFN_WDF_USB_READERS_FAILED EvtUsbTargetPipeReadersFailed; - -} WDF_USB_CONTINUOUS_READER_CONFIG, *PWDF_USB_CONTINUOUS_READER_CONFIG; - - -VOID -FORCEINLINE -WDF_USB_CONTINUOUS_READER_CONFIG_INIT( - _Out_ PWDF_USB_CONTINUOUS_READER_CONFIG Config, - _In_ PFN_WDF_USB_READER_COMPLETION_ROUTINE EvtUsbTargetPipeReadComplete, - _In_ WDFCONTEXT EvtUsbTargetPipeReadCompleteContext, - _In_ size_t TransferLength - ) - -{ - RtlZeroMemory(Config, sizeof(WDF_USB_CONTINUOUS_READER_CONFIG)); - Config->Size = sizeof(WDF_USB_CONTINUOUS_READER_CONFIG); - - Config->EvtUsbTargetPipeReadComplete = EvtUsbTargetPipeReadComplete; - Config->EvtUsbTargetPipeReadCompleteContext = EvtUsbTargetPipeReadCompleteContext; - Config->TransferLength = TransferLength; -} - -WDFIOTARGET -FORCEINLINE -WdfUsbTargetDeviceGetIoTarget( - _In_ WDFUSBDEVICE UsbDevice - ) -{ - return (WDFIOTARGET) UsbDevice; -} - -typedef struct _WDF_USB_DEVICE_INFORMATION { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // USBD version information - // - USBD_VERSION_INFORMATION UsbdVersionInformation; - - // - // Usb controller port capabilities - // - ULONG HcdPortCapabilities; - - // - // Bitfield of WDF_USB_DEVICE_TRAITS values - // - ULONG Traits; - -} WDF_USB_DEVICE_INFORMATION, *PWDF_USB_DEVICE_INFORMATION; - -VOID -FORCEINLINE -WDF_USB_DEVICE_INFORMATION_INIT( - _Out_ PWDF_USB_DEVICE_INFORMATION Udi - ) -{ - RtlZeroMemory(Udi, sizeof(WDF_USB_DEVICE_INFORMATION)); - Udi->Size = sizeof(WDF_USB_DEVICE_INFORMATION); -} - -typedef struct _WDF_USB_INTERFACE_SETTING_PAIR { - // - // Interface to select - // - WDFUSBINTERFACE UsbInterface; - - // - // Setting to select on UsbInterface - // - UCHAR SettingIndex; - -} WDF_USB_INTERFACE_SETTING_PAIR, *PWDF_USB_INTERFACE_SETTING_PAIR; - -typedef struct _WDF_USB_DEVICE_SELECT_CONFIG_PARAMS { - // - // Size of the structure in bytes - // - ULONG Size; - - // - // Type of select config, one of WdfUsbTargetDeviceSelectConfigType values - // - WdfUsbTargetDeviceSelectConfigType Type; - - - union { - struct { - // - // Configuration descriptor to use - // - PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; - - // - // Array of interface descriptors pointers. - // - PUSB_INTERFACE_DESCRIPTOR * InterfaceDescriptors; - - // - // Number of elements in the InterfaceDescrtiptors pointer array. - // - ULONG NumInterfaceDescriptors; - - } Descriptor; - - struct { - // - // Preallocated select config URB formatted by the caller. - // Will be used, as supplied without modification, as the select - // config request. - // - PURB Urb; - - } Urb; - - struct { - // - // Number of pipes configured on the single after. This value is - // returned to the caller after a succssful call. - // - UCHAR NumberConfiguredPipes; - - // - // The interface which was configred. This value is returned to the - // caller after a successful call. - // - WDFUSBINTERFACE ConfiguredUsbInterface; - - } SingleInterface; - - struct { - // - // Number of interface pairs in the Pairs array - // - UCHAR NumberInterfaces; - - // - // Array of interface + settings - // - PWDF_USB_INTERFACE_SETTING_PAIR Pairs; - - // - // Number of interfaces which were configured after a successful call - // - UCHAR NumberOfConfiguredInterfaces; - - } MultiInterface; - - } Types; - -} WDF_USB_DEVICE_SELECT_CONFIG_PARAMS, *PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS; - - -VOID -FORCEINLINE -WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_SINGLE_INTERFACE( - _Out_ PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params - ) -{ - RtlZeroMemory(Params, sizeof(WDF_USB_DEVICE_SELECT_CONFIG_PARAMS)); - - Params->Size = sizeof(WDF_USB_DEVICE_SELECT_CONFIG_PARAMS); - Params->Type = WdfUsbTargetDeviceSelectConfigTypeSingleInterface; -} - -VOID -FORCEINLINE -WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_MULTIPLE_INTERFACES( - _Out_ PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params, - _In_opt_ UCHAR NumberInterfaces, - _In_opt_ PWDF_USB_INTERFACE_SETTING_PAIR SettingPairs - ) -{ - RtlZeroMemory(Params, sizeof(WDF_USB_DEVICE_SELECT_CONFIG_PARAMS)); - - Params->Size = sizeof(WDF_USB_DEVICE_SELECT_CONFIG_PARAMS); - - if (SettingPairs != NULL && NumberInterfaces != 0) { - Params->Type = WdfUsbTargetDeviceSelectConfigTypeInterfacesPairs; - - Params->Types.MultiInterface.NumberInterfaces = NumberInterfaces; - Params->Types.MultiInterface.Pairs = SettingPairs; - } - else { - Params->Type = WdfUsbTargetDeviceSelectConfigTypeMultiInterface; - } -} - -VOID -FORCEINLINE -WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_INTERFACES_DESCRIPTORS( - _Out_ PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params, - _In_ PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptor, - _In_ PUSB_INTERFACE_DESCRIPTOR* InterfaceDescriptors, - _In_ ULONG NumInterfaceDescriptors - ) -{ - RtlZeroMemory(Params, sizeof(WDF_USB_DEVICE_SELECT_CONFIG_PARAMS)); - - Params->Size = sizeof(WDF_USB_DEVICE_SELECT_CONFIG_PARAMS); - Params->Type = WdfUsbTargetDeviceSelectConfigTypeInterfacesDescriptor; - Params->Types.Descriptor.ConfigurationDescriptor = ConfigDescriptor; - Params->Types.Descriptor.InterfaceDescriptors = InterfaceDescriptors; - Params->Types.Descriptor.NumInterfaceDescriptors = NumInterfaceDescriptors; -} - -VOID -FORCEINLINE -WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_URB( - _Out_ PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params, - _In_ PURB Urb - ) -{ - RtlZeroMemory(Params, sizeof(WDF_USB_DEVICE_SELECT_CONFIG_PARAMS)); - - Params->Size = sizeof(WDF_USB_DEVICE_SELECT_CONFIG_PARAMS); - Params->Type = WdfUsbTargetDeviceSelectConfigTypeUrb; - Params->Types.Urb.Urb = Urb; -} - - -VOID -FORCEINLINE -WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_DECONFIG( - _Out_ PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params - ) -{ - RtlZeroMemory(Params, sizeof(WDF_USB_DEVICE_SELECT_CONFIG_PARAMS)); - - Params->Size = sizeof(WDF_USB_DEVICE_SELECT_CONFIG_PARAMS); - Params->Type = WdfUsbTargetDeviceSelectConfigTypeDeconfig; -} - -typedef struct _WDF_USB_INTERFACE_SELECT_SETTING_PARAMS { - // - // Size of this data structure in bytes - // - ULONG Size; - - // - // Type of select interface as indicated by one of the - // WdfUsbTargetDeviceSelectSettingType values. - // - WdfUsbTargetDeviceSelectSettingType Type; - - union { - - struct { - // - // Interface descriptor that will be used in the interface selection - // - PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor; - - } Descriptor; - - struct { - // - // The setting index of the WDFUSBINTERFACE to use - // - UCHAR SettingIndex; - - } Interface; - - struct { - // - // Preformatted select interface URB which will be used in the - // select interface request. - // - PURB Urb; - - } Urb; - - } Types; - -} WDF_USB_INTERFACE_SELECT_SETTING_PARAMS, *PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS; - -VOID -FORCEINLINE -WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_INIT_DESCRIPTOR( - _Out_ PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS Params, - _In_ PUSB_INTERFACE_DESCRIPTOR Interface - ) -{ - RtlZeroMemory(Params, sizeof(WDF_USB_INTERFACE_SELECT_SETTING_PARAMS)); - - Params->Size = sizeof(WDF_USB_INTERFACE_SELECT_SETTING_PARAMS); - Params->Type = WdfUsbInterfaceSelectSettingTypeDescriptor; - Params->Types.Descriptor.InterfaceDescriptor = Interface; -} - -VOID -FORCEINLINE -WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_INIT_URB( - _Out_ PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS Params, - _In_ PURB Urb - ) -{ - RtlZeroMemory(Params, sizeof(WDF_USB_INTERFACE_SELECT_SETTING_PARAMS)); - - Params->Size = sizeof(WDF_USB_INTERFACE_SELECT_SETTING_PARAMS); - Params->Type = WdfUsbInterfaceSelectSettingTypeUrb; - Params->Types.Urb.Urb = Urb; -} - -VOID -FORCEINLINE -WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_INIT_SETTING( - _Out_ PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS Params, - _In_ UCHAR SettingIndex - ) -{ - RtlZeroMemory(Params, sizeof(WDF_USB_INTERFACE_SELECT_SETTING_PARAMS)); - - Params->Size = sizeof(WDF_USB_INTERFACE_SELECT_SETTING_PARAMS); - Params->Type = WdfUsbInterfaceSelectSettingTypeSetting; - Params->Types.Interface.SettingIndex = SettingIndex; -} - -WDFIOTARGET -FORCEINLINE -WdfUsbTargetPipeGetIoTarget( - _In_ WDFUSBPIPE Pipe - ) -{ - return (WDFIOTARGET) Pipe; -} - -typedef struct _WDF_USB_PIPE_INFORMATION { - // - // Size of the structure in bytes - // - ULONG Size; - - // - // Maximum packet size this device is capable of - // - ULONG MaximumPacketSize; - - // - // Raw endpoint address of the device as described by its descriptor - // - UCHAR EndpointAddress; - - // - // Polling interval - // - UCHAR Interval; - - // - // Which alternate setting this structure is relevant for - // - UCHAR SettingIndex; - - // - // The type of the pipe - WDF_USB_PIPE_TYPE PipeType; - - // - // Maximum size of one transfer which should be sent to the host controller - // - ULONG MaximumTransferSize; - -} WDF_USB_PIPE_INFORMATION, *PWDF_USB_PIPE_INFORMATION; - -VOID -FORCEINLINE -WDF_USB_PIPE_INFORMATION_INIT( - _Out_ PWDF_USB_PIPE_INFORMATION Info - ) -{ - RtlZeroMemory(Info, sizeof(WDF_USB_PIPE_INFORMATION)); - - Info->Size = sizeof(WDF_USB_PIPE_INFORMATION); -} - -BOOLEAN -FORCEINLINE -WDF_USB_PIPE_DIRECTION_IN( - _In_ UCHAR EndpointAddress - ) -{ - // - // If the high bit is set, we have an IN pipe - // - return (EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) ? TRUE : FALSE; -} - -BOOLEAN -FORCEINLINE -WDF_USB_PIPE_DIRECTION_OUT( - _In_ UCHAR EndpointAddress - ) -{ - // - // If the high bit is clear, we have an OUT pipe - // - return (EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) == 0x00 ? TRUE : FALSE; -} - -typedef struct _WDF_USB_DEVICE_CREATE_CONFIG { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // USBD Client Contraction of the Wdf Client - // - ULONG USBDClientContractVersion; - -} WDF_USB_DEVICE_CREATE_CONFIG, *PWDF_USB_DEVICE_CREATE_CONFIG; - -VOID -FORCEINLINE -WDF_USB_DEVICE_CREATE_CONFIG_INIT( - _Out_ PWDF_USB_DEVICE_CREATE_CONFIG Config, - _In_ ULONG USBDClientContractVersion - ) -{ - RtlZeroMemory(Config, sizeof(WDF_USB_DEVICE_CREATE_CONFIG)); - - Config->Size = sizeof(WDF_USB_DEVICE_CREATE_CONFIG); - Config->USBDClientContractVersion = USBDClientContractVersion; -} - -// -// WDF Function: WdfUsbTargetDeviceCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICECREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFUSBDEVICE* UsbDevice - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceCreate( - _In_ - WDFDEVICE Device, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFUSBDEVICE* UsbDevice - ) -{ - return ((PFN_WDFUSBTARGETDEVICECREATE) WdfFunctions[WdfUsbTargetDeviceCreateTableIndex])(WdfDriverGlobals, Device, Attributes, UsbDevice); -} - - -// -// WDF Function: WdfUsbTargetDeviceCreateWithParameters -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICECREATEWITHPARAMETERS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFDEVICE Device, - _In_ - PWDF_USB_DEVICE_CREATE_CONFIG Config, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFUSBDEVICE* UsbDevice - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceCreateWithParameters( - _In_ - WDFDEVICE Device, - _In_ - PWDF_USB_DEVICE_CREATE_CONFIG Config, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFUSBDEVICE* UsbDevice - ) -{ - return ((PFN_WDFUSBTARGETDEVICECREATEWITHPARAMETERS) WdfFunctions[WdfUsbTargetDeviceCreateWithParametersTableIndex])(WdfDriverGlobals, Device, Config, Attributes, UsbDevice); -} - - -// -// WDF Function: WdfUsbTargetDeviceRetrieveInformation -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICERETRIEVEINFORMATION)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _Out_ - PWDF_USB_DEVICE_INFORMATION Information - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceRetrieveInformation( - _In_ - WDFUSBDEVICE UsbDevice, - _Out_ - PWDF_USB_DEVICE_INFORMATION Information - ) -{ - return ((PFN_WDFUSBTARGETDEVICERETRIEVEINFORMATION) WdfFunctions[WdfUsbTargetDeviceRetrieveInformationTableIndex])(WdfDriverGlobals, UsbDevice, Information); -} - - -// -// WDF Function: WdfUsbTargetDeviceGetDeviceDescriptor -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFUSBTARGETDEVICEGETDEVICEDESCRIPTOR)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _Out_ - PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfUsbTargetDeviceGetDeviceDescriptor( - _In_ - WDFUSBDEVICE UsbDevice, - _Out_ - PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor - ) -{ - ((PFN_WDFUSBTARGETDEVICEGETDEVICEDESCRIPTOR) WdfFunctions[WdfUsbTargetDeviceGetDeviceDescriptorTableIndex])(WdfDriverGlobals, UsbDevice, UsbDeviceDescriptor); -} - - -// -// WDF Function: WdfUsbTargetDeviceRetrieveConfigDescriptor -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICERETRIEVECONFIGDESCRIPTOR)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _Out_writes_bytes_to_opt_(*ConfigDescriptorLength,*ConfigDescriptorLength) - PVOID ConfigDescriptor, - _Inout_ - PUSHORT ConfigDescriptorLength - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceRetrieveConfigDescriptor( - _In_ - WDFUSBDEVICE UsbDevice, - _Out_writes_bytes_to_opt_(*ConfigDescriptorLength,*ConfigDescriptorLength) - PVOID ConfigDescriptor, - _Inout_ - PUSHORT ConfigDescriptorLength - ) -{ - return ((PFN_WDFUSBTARGETDEVICERETRIEVECONFIGDESCRIPTOR) WdfFunctions[WdfUsbTargetDeviceRetrieveConfigDescriptorTableIndex])(WdfDriverGlobals, UsbDevice, ConfigDescriptor, ConfigDescriptorLength); -} - - -// -// WDF Function: WdfUsbTargetDeviceQueryString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICEQUERYSTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _Out_writes_opt_(*NumCharacters) - PUSHORT String, - _Inout_ - PUSHORT NumCharacters, - _In_ - UCHAR StringIndex, - _In_opt_ - USHORT LangID - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceQueryString( - _In_ - WDFUSBDEVICE UsbDevice, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _Out_writes_opt_(*NumCharacters) - PUSHORT String, - _Inout_ - PUSHORT NumCharacters, - _In_ - UCHAR StringIndex, - _In_opt_ - USHORT LangID - ) -{ - return ((PFN_WDFUSBTARGETDEVICEQUERYSTRING) WdfFunctions[WdfUsbTargetDeviceQueryStringTableIndex])(WdfDriverGlobals, UsbDevice, Request, RequestOptions, String, NumCharacters, StringIndex, LangID); -} - - -// -// WDF Function: WdfUsbTargetDeviceAllocAndQueryString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICEALLOCANDQUERYSTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES StringMemoryAttributes, - _Out_ - WDFMEMORY* StringMemory, - _Out_opt_ - PUSHORT NumCharacters, - _In_ - UCHAR StringIndex, - _In_opt_ - USHORT LangID - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceAllocAndQueryString( - _In_ - WDFUSBDEVICE UsbDevice, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES StringMemoryAttributes, - _Out_ - WDFMEMORY* StringMemory, - _Out_opt_ - PUSHORT NumCharacters, - _In_ - UCHAR StringIndex, - _In_opt_ - USHORT LangID - ) -{ - return ((PFN_WDFUSBTARGETDEVICEALLOCANDQUERYSTRING) WdfFunctions[WdfUsbTargetDeviceAllocAndQueryStringTableIndex])(WdfDriverGlobals, UsbDevice, StringMemoryAttributes, StringMemory, NumCharacters, StringIndex, LangID); -} - - -// -// WDF Function: WdfUsbTargetDeviceFormatRequestForString -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICEFORMATREQUESTFORSTRING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _In_ - WDFREQUEST Request, - _In_ - WDFMEMORY Memory, - _In_opt_ - PWDFMEMORY_OFFSET Offset, - _In_ - UCHAR StringIndex, - _In_opt_ - USHORT LangID - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceFormatRequestForString( - _In_ - WDFUSBDEVICE UsbDevice, - _In_ - WDFREQUEST Request, - _In_ - WDFMEMORY Memory, - _In_opt_ - PWDFMEMORY_OFFSET Offset, - _In_ - UCHAR StringIndex, - _In_opt_ - USHORT LangID - ) -{ - return ((PFN_WDFUSBTARGETDEVICEFORMATREQUESTFORSTRING) WdfFunctions[WdfUsbTargetDeviceFormatRequestForStringTableIndex])(WdfDriverGlobals, UsbDevice, Request, Memory, Offset, StringIndex, LangID); -} - - -// -// WDF Function: WdfUsbTargetDeviceGetNumInterfaces -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -UCHAR -(*PFN_WDFUSBTARGETDEVICEGETNUMINTERFACES)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -UCHAR -FORCEINLINE -WdfUsbTargetDeviceGetNumInterfaces( - _In_ - WDFUSBDEVICE UsbDevice - ) -{ - return ((PFN_WDFUSBTARGETDEVICEGETNUMINTERFACES) WdfFunctions[WdfUsbTargetDeviceGetNumInterfacesTableIndex])(WdfDriverGlobals, UsbDevice); -} - - -// -// WDF Function: WdfUsbTargetDeviceSelectConfig -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICESELECTCONFIG)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PipeAttributes, - _Inout_ - PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceSelectConfig( - _In_ - WDFUSBDEVICE UsbDevice, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PipeAttributes, - _Inout_ - PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params - ) -{ - return ((PFN_WDFUSBTARGETDEVICESELECTCONFIG) WdfFunctions[WdfUsbTargetDeviceSelectConfigTableIndex])(WdfDriverGlobals, UsbDevice, PipeAttributes, Params); -} - - -// -// WDF Function: WdfUsbTargetDeviceSendControlTransferSynchronously -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICESENDCONTROLTRANSFERSYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _In_ - PWDF_USB_CONTROL_SETUP_PACKET SetupPacket, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR MemoryDescriptor, - _Out_opt_ - PULONG BytesTransferred - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceSendControlTransferSynchronously( - _In_ - WDFUSBDEVICE UsbDevice, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _In_ - PWDF_USB_CONTROL_SETUP_PACKET SetupPacket, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR MemoryDescriptor, - _Out_opt_ - PULONG BytesTransferred - ) -{ - return ((PFN_WDFUSBTARGETDEVICESENDCONTROLTRANSFERSYNCHRONOUSLY) WdfFunctions[WdfUsbTargetDeviceSendControlTransferSynchronouslyTableIndex])(WdfDriverGlobals, UsbDevice, Request, RequestOptions, SetupPacket, MemoryDescriptor, BytesTransferred); -} - - -// -// WDF Function: WdfUsbTargetDeviceFormatRequestForControlTransfer -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICEFORMATREQUESTFORCONTROLTRANSFER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _In_ - WDFREQUEST Request, - _In_ - PWDF_USB_CONTROL_SETUP_PACKET SetupPacket, - _In_opt_ - WDFMEMORY TransferMemory, - _In_opt_ - PWDFMEMORY_OFFSET TransferOffset - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceFormatRequestForControlTransfer( - _In_ - WDFUSBDEVICE UsbDevice, - _In_ - WDFREQUEST Request, - _In_ - PWDF_USB_CONTROL_SETUP_PACKET SetupPacket, - _In_opt_ - WDFMEMORY TransferMemory, - _In_opt_ - PWDFMEMORY_OFFSET TransferOffset - ) -{ - return ((PFN_WDFUSBTARGETDEVICEFORMATREQUESTFORCONTROLTRANSFER) WdfFunctions[WdfUsbTargetDeviceFormatRequestForControlTransferTableIndex])(WdfDriverGlobals, UsbDevice, Request, SetupPacket, TransferMemory, TransferOffset); -} - - -// -// WDF Function: WdfUsbTargetDeviceResetPortSynchronously -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICERESETPORTSYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceResetPortSynchronously( - _In_ - WDFUSBDEVICE UsbDevice - ) -{ - return ((PFN_WDFUSBTARGETDEVICERESETPORTSYNCHRONOUSLY) WdfFunctions[WdfUsbTargetDeviceResetPortSynchronouslyTableIndex])(WdfDriverGlobals, UsbDevice); -} - - -// -// WDF Function: WdfUsbTargetDeviceQueryUsbCapability -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETDEVICEQUERYUSBCAPABILITY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _In_ - CONST GUID* CapabilityType, - _In_ - ULONG CapabilityBufferLength, - _When_(CapabilityBufferLength == 0, _Out_opt_) - _When_(CapabilityBufferLength != 0 && ResultLength == NULL, _Out_writes_bytes_(CapabilityBufferLength)) - _When_(CapabilityBufferLength != 0 && ResultLength != NULL, _Out_writes_bytes_to_opt_(CapabilityBufferLength, *ResultLength)) - PVOID CapabilityBuffer, - _Out_opt_ - _When_(ResultLength != NULL,_Deref_out_range_(<=,CapabilityBufferLength)) - PULONG ResultLength - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetDeviceQueryUsbCapability( - _In_ - WDFUSBDEVICE UsbDevice, - _In_ - CONST GUID* CapabilityType, - _In_ - ULONG CapabilityBufferLength, - _When_(CapabilityBufferLength == 0, _Out_opt_) - _When_(CapabilityBufferLength != 0 && ResultLength == NULL, _Out_writes_bytes_(CapabilityBufferLength)) - _When_(CapabilityBufferLength != 0 && ResultLength != NULL, _Out_writes_bytes_to_opt_(CapabilityBufferLength, *ResultLength)) - PVOID CapabilityBuffer, - _Out_opt_ - _When_(ResultLength != NULL,_Deref_out_range_(<=,CapabilityBufferLength)) - PULONG ResultLength - ) -{ - return ((PFN_WDFUSBTARGETDEVICEQUERYUSBCAPABILITY) WdfFunctions[WdfUsbTargetDeviceQueryUsbCapabilityTableIndex])(WdfDriverGlobals, UsbDevice, CapabilityType, CapabilityBufferLength, CapabilityBuffer, ResultLength); -} - - -// -// WDF Function: WdfUsbTargetPipeGetInformation -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFUSBTARGETPIPEGETINFORMATION)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe, - _Out_ - PWDF_USB_PIPE_INFORMATION PipeInformation - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfUsbTargetPipeGetInformation( - _In_ - WDFUSBPIPE Pipe, - _Out_ - PWDF_USB_PIPE_INFORMATION PipeInformation - ) -{ - ((PFN_WDFUSBTARGETPIPEGETINFORMATION) WdfFunctions[WdfUsbTargetPipeGetInformationTableIndex])(WdfDriverGlobals, Pipe, PipeInformation); -} - - -// -// WDF Function: WdfUsbTargetPipeIsInEndpoint -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFUSBTARGETPIPEISINENDPOINT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -BOOLEAN -FORCEINLINE -WdfUsbTargetPipeIsInEndpoint( - _In_ - WDFUSBPIPE Pipe - ) -{ - return ((PFN_WDFUSBTARGETPIPEISINENDPOINT) WdfFunctions[WdfUsbTargetPipeIsInEndpointTableIndex])(WdfDriverGlobals, Pipe); -} - - -// -// WDF Function: WdfUsbTargetPipeIsOutEndpoint -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BOOLEAN -(*PFN_WDFUSBTARGETPIPEISOUTENDPOINT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -BOOLEAN -FORCEINLINE -WdfUsbTargetPipeIsOutEndpoint( - _In_ - WDFUSBPIPE Pipe - ) -{ - return ((PFN_WDFUSBTARGETPIPEISOUTENDPOINT) WdfFunctions[WdfUsbTargetPipeIsOutEndpointTableIndex])(WdfDriverGlobals, Pipe); -} - - -// -// WDF Function: WdfUsbTargetPipeGetType -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDF_USB_PIPE_TYPE -(*PFN_WDFUSBTARGETPIPEGETTYPE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDF_USB_PIPE_TYPE -FORCEINLINE -WdfUsbTargetPipeGetType( - _In_ - WDFUSBPIPE Pipe - ) -{ - return ((PFN_WDFUSBTARGETPIPEGETTYPE) WdfFunctions[WdfUsbTargetPipeGetTypeTableIndex])(WdfDriverGlobals, Pipe); -} - - -// -// WDF Function: WdfUsbTargetPipeSetNoMaximumPacketSizeCheck -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFUSBTARGETPIPESETNOMAXIMUMPACKETSIZECHECK)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfUsbTargetPipeSetNoMaximumPacketSizeCheck( - _In_ - WDFUSBPIPE Pipe - ) -{ - ((PFN_WDFUSBTARGETPIPESETNOMAXIMUMPACKETSIZECHECK) WdfFunctions[WdfUsbTargetPipeSetNoMaximumPacketSizeCheckTableIndex])(WdfDriverGlobals, Pipe); -} - - -// -// WDF Function: WdfUsbTargetPipeWriteSynchronously -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETPIPEWRITESYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR MemoryDescriptor, - _Out_opt_ - PULONG BytesWritten - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetPipeWriteSynchronously( - _In_ - WDFUSBPIPE Pipe, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR MemoryDescriptor, - _Out_opt_ - PULONG BytesWritten - ) -{ - return ((PFN_WDFUSBTARGETPIPEWRITESYNCHRONOUSLY) WdfFunctions[WdfUsbTargetPipeWriteSynchronouslyTableIndex])(WdfDriverGlobals, Pipe, Request, RequestOptions, MemoryDescriptor, BytesWritten); -} - - -// -// WDF Function: WdfUsbTargetPipeFormatRequestForWrite -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETPIPEFORMATREQUESTFORWRITE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe, - _In_ - WDFREQUEST Request, - _In_opt_ - WDFMEMORY WriteMemory, - _In_opt_ - PWDFMEMORY_OFFSET WriteOffset - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetPipeFormatRequestForWrite( - _In_ - WDFUSBPIPE Pipe, - _In_ - WDFREQUEST Request, - _In_opt_ - WDFMEMORY WriteMemory, - _In_opt_ - PWDFMEMORY_OFFSET WriteOffset - ) -{ - return ((PFN_WDFUSBTARGETPIPEFORMATREQUESTFORWRITE) WdfFunctions[WdfUsbTargetPipeFormatRequestForWriteTableIndex])(WdfDriverGlobals, Pipe, Request, WriteMemory, WriteOffset); -} - - -// -// WDF Function: WdfUsbTargetPipeReadSynchronously -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETPIPEREADSYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR MemoryDescriptor, - _Out_opt_ - PULONG BytesRead - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetPipeReadSynchronously( - _In_ - WDFUSBPIPE Pipe, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions, - _In_opt_ - PWDF_MEMORY_DESCRIPTOR MemoryDescriptor, - _Out_opt_ - PULONG BytesRead - ) -{ - return ((PFN_WDFUSBTARGETPIPEREADSYNCHRONOUSLY) WdfFunctions[WdfUsbTargetPipeReadSynchronouslyTableIndex])(WdfDriverGlobals, Pipe, Request, RequestOptions, MemoryDescriptor, BytesRead); -} - - -// -// WDF Function: WdfUsbTargetPipeFormatRequestForRead -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETPIPEFORMATREQUESTFORREAD)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe, - _In_ - WDFREQUEST Request, - _In_opt_ - WDFMEMORY ReadMemory, - _In_opt_ - PWDFMEMORY_OFFSET ReadOffset - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetPipeFormatRequestForRead( - _In_ - WDFUSBPIPE Pipe, - _In_ - WDFREQUEST Request, - _In_opt_ - WDFMEMORY ReadMemory, - _In_opt_ - PWDFMEMORY_OFFSET ReadOffset - ) -{ - return ((PFN_WDFUSBTARGETPIPEFORMATREQUESTFORREAD) WdfFunctions[WdfUsbTargetPipeFormatRequestForReadTableIndex])(WdfDriverGlobals, Pipe, Request, ReadMemory, ReadOffset); -} - - -// -// WDF Function: WdfUsbTargetPipeConfigContinuousReader -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETPIPECONFIGCONTINUOUSREADER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe, - _In_ - PWDF_USB_CONTINUOUS_READER_CONFIG Config - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetPipeConfigContinuousReader( - _In_ - WDFUSBPIPE Pipe, - _In_ - PWDF_USB_CONTINUOUS_READER_CONFIG Config - ) -{ - return ((PFN_WDFUSBTARGETPIPECONFIGCONTINUOUSREADER) WdfFunctions[WdfUsbTargetPipeConfigContinuousReaderTableIndex])(WdfDriverGlobals, Pipe, Config); -} - - -// -// WDF Function: WdfUsbTargetPipeAbortSynchronously -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETPIPEABORTSYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetPipeAbortSynchronously( - _In_ - WDFUSBPIPE Pipe, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions - ) -{ - return ((PFN_WDFUSBTARGETPIPEABORTSYNCHRONOUSLY) WdfFunctions[WdfUsbTargetPipeAbortSynchronouslyTableIndex])(WdfDriverGlobals, Pipe, Request, RequestOptions); -} - - -// -// WDF Function: WdfUsbTargetPipeFormatRequestForAbort -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETPIPEFORMATREQUESTFORABORT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe, - _In_ - WDFREQUEST Request - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetPipeFormatRequestForAbort( - _In_ - WDFUSBPIPE Pipe, - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFUSBTARGETPIPEFORMATREQUESTFORABORT) WdfFunctions[WdfUsbTargetPipeFormatRequestForAbortTableIndex])(WdfDriverGlobals, Pipe, Request); -} - - -// -// WDF Function: WdfUsbTargetPipeResetSynchronously -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETPIPERESETSYNCHRONOUSLY)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetPipeResetSynchronously( - _In_ - WDFUSBPIPE Pipe, - _In_opt_ - WDFREQUEST Request, - _In_opt_ - PWDF_REQUEST_SEND_OPTIONS RequestOptions - ) -{ - return ((PFN_WDFUSBTARGETPIPERESETSYNCHRONOUSLY) WdfFunctions[WdfUsbTargetPipeResetSynchronouslyTableIndex])(WdfDriverGlobals, Pipe, Request, RequestOptions); -} - - -// -// WDF Function: WdfUsbTargetPipeFormatRequestForReset -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBTARGETPIPEFORMATREQUESTFORRESET)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBPIPE Pipe, - _In_ - WDFREQUEST Request - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbTargetPipeFormatRequestForReset( - _In_ - WDFUSBPIPE Pipe, - _In_ - WDFREQUEST Request - ) -{ - return ((PFN_WDFUSBTARGETPIPEFORMATREQUESTFORRESET) WdfFunctions[WdfUsbTargetPipeFormatRequestForResetTableIndex])(WdfDriverGlobals, Pipe, Request); -} - - -// -// WDF Function: WdfUsbInterfaceGetInterfaceNumber -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BYTE -(*PFN_WDFUSBINTERFACEGETINTERFACENUMBER)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBINTERFACE UsbInterface - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -BYTE -FORCEINLINE -WdfUsbInterfaceGetInterfaceNumber( - _In_ - WDFUSBINTERFACE UsbInterface - ) -{ - return ((PFN_WDFUSBINTERFACEGETINTERFACENUMBER) WdfFunctions[WdfUsbInterfaceGetInterfaceNumberTableIndex])(WdfDriverGlobals, UsbInterface); -} - - -// -// WDF Function: WdfUsbInterfaceGetNumEndpoints -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BYTE -(*PFN_WDFUSBINTERFACEGETNUMENDPOINTS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBINTERFACE UsbInterface, - _In_ - UCHAR SettingIndex - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -BYTE -FORCEINLINE -WdfUsbInterfaceGetNumEndpoints( - _In_ - WDFUSBINTERFACE UsbInterface, - _In_ - UCHAR SettingIndex - ) -{ - return ((PFN_WDFUSBINTERFACEGETNUMENDPOINTS) WdfFunctions[WdfUsbInterfaceGetNumEndpointsTableIndex])(WdfDriverGlobals, UsbInterface, SettingIndex); -} - - -// -// WDF Function: WdfUsbInterfaceGetDescriptor -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFUSBINTERFACEGETDESCRIPTOR)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBINTERFACE UsbInterface, - _In_ - UCHAR SettingIndex, - _Out_ - PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfUsbInterfaceGetDescriptor( - _In_ - WDFUSBINTERFACE UsbInterface, - _In_ - UCHAR SettingIndex, - _Out_ - PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor - ) -{ - ((PFN_WDFUSBINTERFACEGETDESCRIPTOR) WdfFunctions[WdfUsbInterfaceGetDescriptorTableIndex])(WdfDriverGlobals, UsbInterface, SettingIndex, InterfaceDescriptor); -} - - -// -// WDF Function: WdfUsbInterfaceGetNumSettings -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BYTE -(*PFN_WDFUSBINTERFACEGETNUMSETTINGS)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBINTERFACE UsbInterface - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -BYTE -FORCEINLINE -WdfUsbInterfaceGetNumSettings( - _In_ - WDFUSBINTERFACE UsbInterface - ) -{ - return ((PFN_WDFUSBINTERFACEGETNUMSETTINGS) WdfFunctions[WdfUsbInterfaceGetNumSettingsTableIndex])(WdfDriverGlobals, UsbInterface); -} - - -// -// WDF Function: WdfUsbInterfaceSelectSetting -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFUSBINTERFACESELECTSETTING)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBINTERFACE UsbInterface, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PipesAttributes, - _In_ - PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS Params - ); - -_Must_inspect_result_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -FORCEINLINE -WdfUsbInterfaceSelectSetting( - _In_ - WDFUSBINTERFACE UsbInterface, - _In_opt_ - PWDF_OBJECT_ATTRIBUTES PipesAttributes, - _In_ - PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS Params - ) -{ - return ((PFN_WDFUSBINTERFACESELECTSETTING) WdfFunctions[WdfUsbInterfaceSelectSettingTableIndex])(WdfDriverGlobals, UsbInterface, PipesAttributes, Params); -} - - -// -// WDF Function: WdfUsbInterfaceGetEndpointInformation -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFUSBINTERFACEGETENDPOINTINFORMATION)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBINTERFACE UsbInterface, - _In_ - UCHAR SettingIndex, - _In_ - UCHAR EndpointIndex, - _Out_ - PWDF_USB_PIPE_INFORMATION EndpointInfo - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfUsbInterfaceGetEndpointInformation( - _In_ - WDFUSBINTERFACE UsbInterface, - _In_ - UCHAR SettingIndex, - _In_ - UCHAR EndpointIndex, - _Out_ - PWDF_USB_PIPE_INFORMATION EndpointInfo - ) -{ - ((PFN_WDFUSBINTERFACEGETENDPOINTINFORMATION) WdfFunctions[WdfUsbInterfaceGetEndpointInformationTableIndex])(WdfDriverGlobals, UsbInterface, SettingIndex, EndpointIndex, EndpointInfo); -} - - -// -// WDF Function: WdfUsbTargetDeviceGetInterface -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFUSBINTERFACE -(*PFN_WDFUSBTARGETDEVICEGETINTERFACE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBDEVICE UsbDevice, - _In_ - UCHAR InterfaceIndex - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFUSBINTERFACE -FORCEINLINE -WdfUsbTargetDeviceGetInterface( - _In_ - WDFUSBDEVICE UsbDevice, - _In_ - UCHAR InterfaceIndex - ) -{ - return ((PFN_WDFUSBTARGETDEVICEGETINTERFACE) WdfFunctions[WdfUsbTargetDeviceGetInterfaceTableIndex])(WdfDriverGlobals, UsbDevice, InterfaceIndex); -} - - -// -// WDF Function: WdfUsbInterfaceGetConfiguredSettingIndex -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BYTE -(*PFN_WDFUSBINTERFACEGETCONFIGUREDSETTINGINDEX)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBINTERFACE Interface - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -BYTE -FORCEINLINE -WdfUsbInterfaceGetConfiguredSettingIndex( - _In_ - WDFUSBINTERFACE Interface - ) -{ - return ((PFN_WDFUSBINTERFACEGETCONFIGUREDSETTINGINDEX) WdfFunctions[WdfUsbInterfaceGetConfiguredSettingIndexTableIndex])(WdfDriverGlobals, Interface); -} - - -// -// WDF Function: WdfUsbInterfaceGetNumConfiguredPipes -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -BYTE -(*PFN_WDFUSBINTERFACEGETNUMCONFIGUREDPIPES)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBINTERFACE UsbInterface - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -BYTE -FORCEINLINE -WdfUsbInterfaceGetNumConfiguredPipes( - _In_ - WDFUSBINTERFACE UsbInterface - ) -{ - return ((PFN_WDFUSBINTERFACEGETNUMCONFIGUREDPIPES) WdfFunctions[WdfUsbInterfaceGetNumConfiguredPipesTableIndex])(WdfDriverGlobals, UsbInterface); -} - - -// -// WDF Function: WdfUsbInterfaceGetConfiguredPipe -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFUSBPIPE -(*PFN_WDFUSBINTERFACEGETCONFIGUREDPIPE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFUSBINTERFACE UsbInterface, - _In_ - UCHAR PipeIndex, - _Out_opt_ - PWDF_USB_PIPE_INFORMATION PipeInfo - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFUSBPIPE -FORCEINLINE -WdfUsbInterfaceGetConfiguredPipe( - _In_ - WDFUSBINTERFACE UsbInterface, - _In_ - UCHAR PipeIndex, - _Out_opt_ - PWDF_USB_PIPE_INFORMATION PipeInfo - ) -{ - return ((PFN_WDFUSBINTERFACEGETCONFIGUREDPIPE) WdfFunctions[WdfUsbInterfaceGetConfiguredPipeTableIndex])(WdfDriverGlobals, UsbInterface, PipeIndex, PipeInfo); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfverifier.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfverifier.h deleted file mode 100644 index 6ba1f81..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfverifier.h +++ /dev/null @@ -1,116 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfverifier.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -// -// WDF Function: WdfVerifierDbgBreakPoint -// -typedef -WDFAPI -VOID -(*PFN_WDFVERIFIERDBGBREAKPOINT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals - ); - -VOID -FORCEINLINE -WdfVerifierDbgBreakPoint( - ) -{ - ((PFN_WDFVERIFIERDBGBREAKPOINT) WdfFunctions[WdfVerifierDbgBreakPointTableIndex])(WdfDriverGlobals); -} - - -// -// WDF Function: WdfVerifierKeBugCheck -// -typedef -WDFAPI -VOID -(*PFN_WDFVERIFIERKEBUGCHECK)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - ULONG BugCheckCode, - _In_ - ULONG_PTR BugCheckParameter1, - _In_ - ULONG_PTR BugCheckParameter2, - _In_ - ULONG_PTR BugCheckParameter3, - _In_ - ULONG_PTR BugCheckParameter4 - ); - -VOID -FORCEINLINE -WdfVerifierKeBugCheck( - _In_ - ULONG BugCheckCode, - _In_ - ULONG_PTR BugCheckParameter1, - _In_ - ULONG_PTR BugCheckParameter2, - _In_ - ULONG_PTR BugCheckParameter3, - _In_ - ULONG_PTR BugCheckParameter4 - ) -{ - ((PFN_WDFVERIFIERKEBUGCHECK) WdfFunctions[WdfVerifierKeBugCheckTableIndex])(WdfDriverGlobals, BugCheckCode, BugCheckParameter1, BugCheckParameter2, BugCheckParameter3, BugCheckParameter4); -} - - -// -// WDF Function: WdfGetTriageInfo -// -typedef -WDFAPI -PVOID -(*PFN_WDFGETTRIAGEINFO)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals - ); - -PVOID -FORCEINLINE -WdfGetTriageInfo( - ) -{ - return ((PFN_WDFGETTRIAGEINFO) WdfFunctions[WdfGetTriageInfoTableIndex])(WdfDriverGlobals); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfwmi.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfwmi.h deleted file mode 100644 index 34c33a5..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfwmi.h +++ /dev/null @@ -1,252 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - WdfWMI.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -typedef enum _WDF_WMI_PROVIDER_CONTROL { - WdfWmiControlInvalid = 0, - WdfWmiEventControl, - WdfWmiInstanceControl, -} WDF_WMI_PROVIDER_CONTROL; - -// -// WdfWmiProviderExpensive: -// The provider's operations are expensive in terms of resources -// -// WdfWmiProviderReadOnly: -// The provider is read only. No set or set data item callbacks will be -// made on all instances of this provider. -// -// WdfWmiProviderEventOnly: -// Data item is being used to fire events only. It will not receive any -// callbacks on it to get / set / execute buffers. -// -typedef enum _WDF_WMI_PROVIDER_FLAGS { - WdfWmiProviderEventOnly = 0x0001, - WdfWmiProviderExpensive = 0x0002, - WdfWmiProviderTracing = 0x0004, - WdfWmiProviderValidFlags = WdfWmiProviderEventOnly | WdfWmiProviderExpensive | WdfWmiProviderTracing, -} WDF_WMI_PROVIDER_FLAGS; - - - -typedef -_Function_class_(EVT_WDF_WMI_INSTANCE_QUERY_INSTANCE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_WMI_INSTANCE_QUERY_INSTANCE( - _In_ - WDFWMIINSTANCE WmiInstance, - _In_ - ULONG OutBufferSize, - _Out_writes_bytes_to_(OutBufferSize, *BufferUsed) - PVOID OutBuffer, - _Out_ - PULONG BufferUsed - ); - -typedef EVT_WDF_WMI_INSTANCE_QUERY_INSTANCE *PFN_WDF_WMI_INSTANCE_QUERY_INSTANCE; - -typedef -_Function_class_(EVT_WDF_WMI_INSTANCE_SET_INSTANCE) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_WMI_INSTANCE_SET_INSTANCE( - _In_ - WDFWMIINSTANCE WmiInstance, - _In_ - ULONG InBufferSize, - _In_reads_bytes_(InBufferSize) - PVOID InBuffer - ); - -typedef EVT_WDF_WMI_INSTANCE_SET_INSTANCE *PFN_WDF_WMI_INSTANCE_SET_INSTANCE; - -typedef -_Function_class_(EVT_WDF_WMI_INSTANCE_SET_ITEM) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_WMI_INSTANCE_SET_ITEM( - _In_ - WDFWMIINSTANCE WmiInstance, - _In_ - ULONG DataItemId, - _In_ - ULONG InBufferSize, - _In_reads_bytes_(InBufferSize) - PVOID InBuffer - ); - -typedef EVT_WDF_WMI_INSTANCE_SET_ITEM *PFN_WDF_WMI_INSTANCE_SET_ITEM; - -typedef -_Function_class_(EVT_WDF_WMI_INSTANCE_EXECUTE_METHOD) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_WMI_INSTANCE_EXECUTE_METHOD( - _In_ - WDFWMIINSTANCE WmiInstance, - _In_ - ULONG MethodId, - _In_ - ULONG InBufferSize, - _In_ - ULONG OutBufferSize, - _When_(InBufferSize >= OutBufferSize, _Inout_updates_bytes_(InBufferSize)) - _When_(InBufferSize < OutBufferSize, _Inout_updates_bytes_(OutBufferSize)) - PVOID Buffer, - _Out_ - PULONG BufferUsed - ); - -typedef EVT_WDF_WMI_INSTANCE_EXECUTE_METHOD *PFN_WDF_WMI_INSTANCE_EXECUTE_METHOD; - -typedef -_Function_class_(EVT_WDF_WMI_PROVIDER_FUNCTION_CONTROL) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSTATUS -EVT_WDF_WMI_PROVIDER_FUNCTION_CONTROL( - _In_ - WDFWMIPROVIDER WmiProvider, - _In_ - WDF_WMI_PROVIDER_CONTROL Control, - _In_ - BOOLEAN Enable - ); - -typedef EVT_WDF_WMI_PROVIDER_FUNCTION_CONTROL *PFN_WDF_WMI_PROVIDER_FUNCTION_CONTROL; - -typedef struct _WDF_WMI_PROVIDER_CONFIG { - // - // Size of this structure in bytes - // - ULONG Size; - - // - // The GUID being registered - // - GUID Guid; - - // - // Combination of values from the enum WDF_WMI_PROVIDER_FLAGS - // - ULONG Flags; - - // - // Minimum expected buffer size for query and set instance requests. - // Ignored if WdfWmiProviderEventOnly is set in Flags. - // - ULONG MinInstanceBufferSize; - - // - // Callback when caller is opening a provider which ha been marked as - // expensive or when a caller is interested in events. - // - PFN_WDF_WMI_PROVIDER_FUNCTION_CONTROL EvtWmiProviderFunctionControl; - -} WDF_WMI_PROVIDER_CONFIG, *PWDF_WMI_PROVIDER_CONFIG; - -VOID -FORCEINLINE -WDF_WMI_PROVIDER_CONFIG_INIT( - _Out_ PWDF_WMI_PROVIDER_CONFIG Config, - _In_ CONST GUID* Guid - ) -{ - RtlZeroMemory(Config, sizeof(WDF_WMI_PROVIDER_CONFIG)); - - Config->Size = sizeof(WDF_WMI_PROVIDER_CONFIG); - RtlCopyMemory(&Config->Guid, Guid, sizeof(GUID)); -} - -typedef struct _WDF_WMI_INSTANCE_CONFIG { - // - // Size of the structure in bytes - // - ULONG Size; - - // - // Optional parameter. If NULL, ProviderConfig must be set to a valid pointer - // value. If specified, indicates the provider to create an instance for. - // - WDFWMIPROVIDER Provider; - - // - // Optional parameter. If NULL, Provider must be set to a valid handle - // value. If specifeid, indicates the configuration for a provider to be - // created and for this instance to be associated with. - // - PWDF_WMI_PROVIDER_CONFIG ProviderConfig; - - // - // If the Provider is configured as read only and this field is set to TRUE, - // the EvtWmiInstanceQueryInstance is ignored and WDF will blindly copy the - // context associated with this instance (using RtlCopyMemory, with no locks - // held) into the query buffer. - // - BOOLEAN UseContextForQuery; - - // - // If TRUE, the instance will be registered as well as created. - // - BOOLEAN Register; - - // - // Callback when caller wants to query the entire data item's buffer. - // - PFN_WDF_WMI_INSTANCE_QUERY_INSTANCE EvtWmiInstanceQueryInstance; - - // - // Callback when caller wants to set the entire data item's buffer. - // - PFN_WDF_WMI_INSTANCE_SET_INSTANCE EvtWmiInstanceSetInstance; - - // - // Callback when caller wants to set a single field in the data item's buffer - // - PFN_WDF_WMI_INSTANCE_SET_ITEM EvtWmiInstanceSetItem; - - // - // Callback when caller wants to execute a method on the data item. - // - PFN_WDF_WMI_INSTANCE_EXECUTE_METHOD EvtWmiInstanceExecuteMethod; - -} WDF_WMI_INSTANCE_CONFIG, *PWDF_WMI_INSTANCE_CONFIG; - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfworkitem.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfworkitem.h deleted file mode 100644 index abdf51e..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wdfworkitem.h +++ /dev/null @@ -1,198 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - Wdfworkitem.h - -Environment: - - user mode - -NOTE: This header is generated by stubwork. - - To modify contents, add or remove or - tags in the corresponding .x and .y template files. - ---*/ - -#pragma once - -#ifndef WDF_EXTERN_C - #ifdef __cplusplus - #define WDF_EXTERN_C extern "C" - #define WDF_EXTERN_C_START extern "C" { - #define WDF_EXTERN_C_END } - #else - #define WDF_EXTERN_C - #define WDF_EXTERN_C_START - #define WDF_EXTERN_C_END - #endif -#endif - -WDF_EXTERN_C_START - -// -// This is the function that gets called back into the driver -// when the WorkItem fires. -// -typedef -_Function_class_(EVT_WDF_WORKITEM) -_IRQL_requires_same_ -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -EVT_WDF_WORKITEM( - _In_ - WDFWORKITEM WorkItem - ); - -typedef EVT_WDF_WORKITEM *PFN_WDF_WORKITEM; - -typedef struct _WDF_WORKITEM_CONFIG { - - ULONG Size; - - PFN_WDF_WORKITEM EvtWorkItemFunc; - - // - // If this is TRUE, the workitem will automatically serialize - // with the event callback handlers of its Parent Object. - // - // Parent Object's callback constraints should be compatible - // with the work item (PASSIVE_LEVEL), or the request will fail. - // - BOOLEAN AutomaticSerialization; - -} WDF_WORKITEM_CONFIG, *PWDF_WORKITEM_CONFIG; - -VOID -FORCEINLINE -WDF_WORKITEM_CONFIG_INIT( - _Out_ PWDF_WORKITEM_CONFIG Config, - _In_ PFN_WDF_WORKITEM EvtWorkItemFunc - ) -{ - RtlZeroMemory(Config, sizeof(WDF_WORKITEM_CONFIG)); - Config->Size = sizeof(WDF_WORKITEM_CONFIG); - Config->EvtWorkItemFunc = EvtWorkItemFunc; - - Config->AutomaticSerialization = TRUE; -} - - -// -// WDF Function: WdfWorkItemCreate -// -typedef -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -NTSTATUS -(*PFN_WDFWORKITEMCREATE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - PWDF_WORKITEM_CONFIG Config, - _In_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFWORKITEM* WorkItem - ); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -FORCEINLINE -WdfWorkItemCreate( - _In_ - PWDF_WORKITEM_CONFIG Config, - _In_ - PWDF_OBJECT_ATTRIBUTES Attributes, - _Out_ - WDFWORKITEM* WorkItem - ) -{ - return ((PFN_WDFWORKITEMCREATE) WdfFunctions[WdfWorkItemCreateTableIndex])(WdfDriverGlobals, Config, Attributes, WorkItem); -} - - -// -// WDF Function: WdfWorkItemEnqueue -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -VOID -(*PFN_WDFWORKITEMENQUEUE)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFWORKITEM WorkItem - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -FORCEINLINE -WdfWorkItemEnqueue( - _In_ - WDFWORKITEM WorkItem - ) -{ - ((PFN_WDFWORKITEMENQUEUE) WdfFunctions[WdfWorkItemEnqueueTableIndex])(WdfDriverGlobals, WorkItem); -} - - -// -// WDF Function: WdfWorkItemGetParentObject -// -typedef -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFAPI -WDFOBJECT -(*PFN_WDFWORKITEMGETPARENTOBJECT)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFWORKITEM WorkItem - ); - -_IRQL_requires_max_(DISPATCH_LEVEL) -WDFOBJECT -FORCEINLINE -WdfWorkItemGetParentObject( - _In_ - WDFWORKITEM WorkItem - ) -{ - return ((PFN_WDFWORKITEMGETPARENTOBJECT) WdfFunctions[WdfWorkItemGetParentObjectTableIndex])(WdfDriverGlobals, WorkItem); -} - - -// -// WDF Function: WdfWorkItemFlush -// -typedef -_IRQL_requires_max_(PASSIVE_LEVEL) -WDFAPI -VOID -(*PFN_WDFWORKITEMFLUSH)( - _In_ - PWDF_DRIVER_GLOBALS DriverGlobals, - _In_ - WDFWORKITEM WorkItem - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -VOID -FORCEINLINE -WdfWorkItemFlush( - _In_ - WDFWORKITEM WorkItem - ) -{ - ((PFN_WDFWORKITEMFLUSH) WdfFunctions[WdfWorkItemFlushTableIndex])(WdfDriverGlobals, WorkItem); -} - -WDF_EXTERN_C_END - diff --git a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wudfwdm.h b/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wudfwdm.h deleted file mode 100644 index ef78173..0000000 --- a/ThirdParty/Windows-Driver-Frameworks/src/publicinc/wdf/umdf/2.15/wudfwdm.h +++ /dev/null @@ -1,1648 +0,0 @@ -/*++ BUILD Version: 0010 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - wudfwdm.h - -Abstract: - - This module defines the WDM types, constants, and functions available - to User Mode Driver Framework (UMDF) device drivers. - -Revision History: - ---*/ - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; -typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; -typedef struct _FILE_OBJECT *PFILE_OBJECT; -typedef struct _INTERFACE *PINTERFACE; -typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT; -typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK; -typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD; -#define PMDL PVOID -#define PIRP PVOID -typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE; - -#define PAGED_CODE() -#define PAGED_CODE_LOCKED() - - -#ifndef _MANAGED -#if defined(_M_IX86) -#define FASTCALL __fastcall -#else -#define FASTCALL -#endif -#else -#define FASTCALL NTAPI -#endif - -// -// NTSTATUS -// - -typedef _Return_type_success_(return >= 0) LONG NTSTATUS; -/*lint -save -e624 */ // Don't complain about different typedefs. -typedef NTSTATUS *PNTSTATUS; -/*lint -restore */ // Resume checking for different typedefs. - -#if _WIN32_WINNT >= 0x0600 -typedef CONST NTSTATUS *PCNTSTATUS; -#endif // _WIN32_WINNT >= 0x0600 - -// -// Status values are 32 bit values layed out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-------------------------+-------------------------------+ -// |Sev|C| Facility | Code | -// +---+-+-------------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// Facility - is the facility code -// -// Code - is the facility's status code -// - -// -// Generic test for success on any status value (non-negative numbers -// indicate success). -// - -#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) - -// -// Generic test for information on any status value. -// - -#ifdef _PREFAST_ -#define NT_INFORMATION(Status) (((NTSTATUS)(Status)) >= (long)0x40000000) -#else -#define NT_INFORMATION(Status) ((((ULONG)(Status)) >> 30) == 1) -#endif - -// -// Generic test for warning on any status value. -// - -#ifdef _PREFAST_ -#define NT_WARNING(Status) (((NTSTATUS)(Status) < (long)0xc0000000)) -#else -#define NT_WARNING(Status) ((((ULONG)(Status)) >> 30) == 2) -#endif - -// -// Generic test for error on any status value. -// - -#ifdef _PREFAST_ -#define NT_ERROR(Status) (((NTSTATUS)(Status)) >= (unsigned long)0xc0000000) -#else -#define NT_ERROR(Status) ((((ULONG)(Status)) >> 30) == 3) -#endif - - - -// -// Physical address. -// - -typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS; - - -// -// Event type -// - -typedef enum _EVENT_TYPE { - NotificationEvent, - SynchronizationEvent -} EVENT_TYPE; - -// -// Pointer to an Asciiz string -// - -typedef _Null_terminated_ CHAR *PSZ; -typedef _Null_terminated_ CONST char *PCSZ; - - -// -// Counted String -// - -typedef USHORT RTL_STRING_LENGTH_TYPE; - -typedef struct _STRING { - USHORT Length; - USHORT MaximumLength; -#ifdef MIDL_PASS - [size_is(MaximumLength), length_is(Length) ] -#endif // MIDL_PASS - _Field_size_bytes_part_opt_(MaximumLength, Length) PCHAR Buffer; -} STRING; -typedef STRING *PSTRING; -typedef STRING ANSI_STRING; -typedef PSTRING PANSI_STRING; - - -typedef STRING CANSI_STRING; -typedef PSTRING PCANSI_STRING; - -// -// Unicode strings are counted 16-bit character strings. If they are -// NULL terminated, Length does not include trailing NULL. -// - -typedef struct _UNICODE_STRING { - USHORT Length; - USHORT MaximumLength; -#ifdef MIDL_PASS - [size_is(MaximumLength / 2), length_is((Length) / 2) ] USHORT * Buffer; -#else // MIDL_PASS - _Field_size_bytes_part_opt_(MaximumLength, Length) PWCH Buffer; -#endif // MIDL_PASS -} UNICODE_STRING; -typedef UNICODE_STRING *PUNICODE_STRING; -typedef const UNICODE_STRING *PCUNICODE_STRING; - -#define DECLARE_CONST_UNICODE_STRING(_var, _string) \ -const WCHAR _var ## _buffer[] = _string; \ -__pragma(warning(push)) \ -__pragma(warning(disable:4221)) __pragma(warning(disable:4204)) \ -const UNICODE_STRING _var = { sizeof(_string) - sizeof(WCHAR), sizeof(_string), (PWCH) _var ## _buffer } \ -__pragma(warning(pop)) - -#define DECLARE_GLOBAL_CONST_UNICODE_STRING(_var, _str) \ -extern const __declspec(selectany) UNICODE_STRING _var = RTL_CONSTANT_STRING(_str) - -#define DECLARE_UNICODE_STRING_SIZE(_var, _size) \ -WCHAR _var ## _buffer[_size]; \ -__pragma(warning(push)) \ -__pragma(warning(disable:4221)) __pragma(warning(disable:4204)) \ -UNICODE_STRING _var = { 0, (_size) * sizeof(WCHAR) , _var ## _buffer } \ -__pragma(warning(pop)) - -// -// Valid values for the Attributes field -// - -#define OBJ_INHERIT 0x00000002L -#define OBJ_PERMANENT 0x00000010L -#define OBJ_EXCLUSIVE 0x00000020L -#define OBJ_CASE_INSENSITIVE 0x00000040L -#define OBJ_OPENIF 0x00000080L -#define OBJ_OPENLINK 0x00000100L -#define OBJ_KERNEL_HANDLE 0x00000200L -#define OBJ_FORCE_ACCESS_CHECK 0x00000400L -#define OBJ_IGNORE_IMPERSONATED_DEVICEMAP 0x00000800L -#define OBJ_VALID_ATTRIBUTES 0x00000FF2L - - -typedef struct _OBJECT_ATTRIBUTES { - ULONG Length; - HANDLE RootDirectory; - PUNICODE_STRING ObjectName; - ULONG Attributes; - PVOID SecurityDescriptor; // Points to type SECURITY_DESCRIPTOR - PVOID SecurityQualityOfService; // Points to type SECURITY_QUALITY_OF_SERVICE -} OBJECT_ATTRIBUTES; -typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; -typedef CONST OBJECT_ATTRIBUTES *PCOBJECT_ATTRIBUTES; - -//++ -// -// VOID -// InitializeObjectAttributes( -// _Out_ POBJECT_ATTRIBUTES p, -// _In_ PUNICODE_STRING n, -// _In_ ULONG a, -// _In_ HANDLE r, -// _In_ PSECURITY_DESCRIPTOR s -// ) -// -//-- - -#define InitializeObjectAttributes( p, n, a, r, s ) { \ - (p)->Length = sizeof( OBJECT_ATTRIBUTES ); \ - (p)->RootDirectory = r; \ - (p)->Attributes = a; \ - (p)->ObjectName = n; \ - (p)->SecurityDescriptor = s; \ - (p)->SecurityQualityOfService = NULL; \ - } - -// -// Determine if an argument is present by testing the value of the pointer -// to the argument value. -// - -#define ARGUMENT_PRESENT(ArgumentPointer) (\ - (CHAR *)((ULONG_PTR)(ArgumentPointer)) != (CHAR *)(NULL) ) - - - -// -// Interrupt Request Level (IRQL) -// - -typedef UCHAR KIRQL; - -typedef KIRQL *PKIRQL; - - - - - - -// -// Interrupt modes. -// - -typedef enum _KINTERRUPT_MODE { - LevelSensitive, - Latched -} KINTERRUPT_MODE; - - - -typedef enum _MEMORY_CACHING_TYPE_ORIG { - MmFrameBufferCached = 2 -} MEMORY_CACHING_TYPE_ORIG; - -typedef enum _MEMORY_CACHING_TYPE { - MmNonCached = FALSE, - MmCached = TRUE, - MmWriteCombined = MmFrameBufferCached, - MmHardwareCoherentCached, - MmNonCachedUnordered, // IA64 - MmUSWCCached, - MmMaximumCacheType, - MmNotMapped = -1 -} MEMORY_CACHING_TYPE; - - -// -// Define the major function codes for IRPs. -// - - -#define IRP_MJ_CREATE 0x00 -#define IRP_MJ_CREATE_NAMED_PIPE 0x01 -#define IRP_MJ_CLOSE 0x02 -#define IRP_MJ_READ 0x03 -#define IRP_MJ_WRITE 0x04 -#define IRP_MJ_QUERY_INFORMATION 0x05 -#define IRP_MJ_SET_INFORMATION 0x06 -#define IRP_MJ_QUERY_EA 0x07 -#define IRP_MJ_SET_EA 0x08 -#define IRP_MJ_FLUSH_BUFFERS 0x09 -#define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a -#define IRP_MJ_SET_VOLUME_INFORMATION 0x0b -#define IRP_MJ_DIRECTORY_CONTROL 0x0c -#define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d -#define IRP_MJ_DEVICE_CONTROL 0x0e -#define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f -#define IRP_MJ_SHUTDOWN 0x10 -#define IRP_MJ_LOCK_CONTROL 0x11 -#define IRP_MJ_CLEANUP 0x12 -#define IRP_MJ_CREATE_MAILSLOT 0x13 -#define IRP_MJ_QUERY_SECURITY 0x14 -#define IRP_MJ_SET_SECURITY 0x15 -#define IRP_MJ_POWER 0x16 -#define IRP_MJ_SYSTEM_CONTROL 0x17 -#define IRP_MJ_DEVICE_CHANGE 0x18 -#define IRP_MJ_QUERY_QUOTA 0x19 -#define IRP_MJ_SET_QUOTA 0x1a -#define IRP_MJ_PNP 0x1b -#define IRP_MJ_PNP_POWER IRP_MJ_PNP // Obsolete.... -#define IRP_MJ_MAXIMUM_FUNCTION 0x1b - -// -// Make the Scsi major code the same as internal device control. -// - -#define IRP_MJ_SCSI IRP_MJ_INTERNAL_DEVICE_CONTROL - -// -// Define the minor function codes for IRPs. The lower 128 codes, from 0x00 to -// 0x7f are reserved to Microsoft. The upper 128 codes, from 0x80 to 0xff, are -// reserved to customers of Microsoft. -// - - -#if defined(_WIN64) -#define POINTER_ALIGNMENT DECLSPEC_ALIGN(8) -#else -#define POINTER_ALIGNMENT -#endif - -// -// Define driver initialization routine type. -// -_Function_class_(DRIVER_INITIALIZE) -_IRQL_requires_same_ -_IRQL_requires_(PASSIVE_LEVEL) -typedef -NTSTATUS -DRIVER_INITIALIZE ( - _In_ struct _DRIVER_OBJECT *DriverObject, - _In_ PUNICODE_STRING RegistryPath - ); - -typedef DRIVER_INITIALIZE *PDRIVER_INITIALIZE; - -// -// \Callback\PowerState values -// - -#define PO_CB_SYSTEM_POWER_POLICY 0 -#define PO_CB_AC_STATUS 1 -#define PO_CB_BUTTON_COLLISION 2 // deprecated -#define PO_CB_SYSTEM_STATE_LOCK 3 -#define PO_CB_LID_SWITCH_STATE 4 -#define PO_CB_PROCESSOR_POWER_POLICY 5 // deprecated - - - - -// -// Runtime Power Management Framework -// - -#define PO_FX_VERSION_V1 0x00000001 -#define PO_FX_VERSION_V2 0x00000002 -#define PO_FX_VERSION PO_FX_VERSION_V1 - -DECLARE_HANDLE(POHANDLE); - -typedef -_Function_class_(PO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK) -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -PO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK ( - _In_ PVOID Context, - _In_ ULONG Component - ); - -typedef PO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK - *PPO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK; - -typedef -_Function_class_(PO_FX_COMPONENT_IDLE_CONDITION_CALLBACK) -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -PO_FX_COMPONENT_IDLE_CONDITION_CALLBACK ( - _In_ PVOID Context, - _In_ ULONG Component - ); - -typedef PO_FX_COMPONENT_IDLE_CONDITION_CALLBACK - *PPO_FX_COMPONENT_IDLE_CONDITION_CALLBACK; - -typedef -_Function_class_(PO_FX_COMPONENT_IDLE_STATE_CALLBACK) -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -PO_FX_COMPONENT_IDLE_STATE_CALLBACK ( - _In_ PVOID Context, - _In_ ULONG Component, - _In_ ULONG State - ); - -typedef PO_FX_COMPONENT_IDLE_STATE_CALLBACK - *PPO_FX_COMPONENT_IDLE_STATE_CALLBACK; - -typedef -_Function_class_(PO_FX_DEVICE_POWER_REQUIRED_CALLBACK) -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -PO_FX_DEVICE_POWER_REQUIRED_CALLBACK ( - _In_ PVOID Context - ); - -typedef PO_FX_DEVICE_POWER_REQUIRED_CALLBACK - *PPO_FX_DEVICE_POWER_REQUIRED_CALLBACK; - -typedef -_Function_class_(PO_FX_DEVICE_POWER_NOT_REQUIRED_CALLBACK) -_IRQL_requires_max_(DISPATCH_LEVEL) -VOID -PO_FX_DEVICE_POWER_NOT_REQUIRED_CALLBACK ( - _In_ PVOID Context - ); - -typedef PO_FX_DEVICE_POWER_NOT_REQUIRED_CALLBACK - *PPO_FX_DEVICE_POWER_NOT_REQUIRED_CALLBACK; - -typedef -_Function_class_(PO_FX_POWER_CONTROL_CALLBACK) -_IRQL_requires_max_(DISPATCH_LEVEL) -NTSTATUS -PO_FX_POWER_CONTROL_CALLBACK ( - _In_ PVOID DeviceContext, - _In_ LPCGUID PowerControlCode, - _In_reads_bytes_opt_(InBufferSize) PVOID InBuffer, - _In_ SIZE_T InBufferSize, - _Out_writes_bytes_opt_(OutBufferSize) PVOID OutBuffer, - _In_ SIZE_T OutBufferSize, - _Out_opt_ PSIZE_T BytesReturned - ); - -typedef PO_FX_POWER_CONTROL_CALLBACK *PPO_FX_POWER_CONTROL_CALLBACK; - -typedef -_Function_class_(PO_FX_COMPONENT_CRITICAL_TRANSITION_CALLBACK) -_IRQL_requires_max_(HIGH_LEVEL) -VOID -PO_FX_COMPONENT_CRITICAL_TRANSITION_CALLBACK ( - _In_ PVOID Context, - _In_ ULONG Component, - _In_ BOOLEAN Active - ); - -typedef PO_FX_COMPONENT_CRITICAL_TRANSITION_CALLBACK - *PPO_FX_COMPONENT_CRITICAL_TRANSITION_CALLBACK; - -typedef struct _PO_FX_COMPONENT_IDLE_STATE { - ULONGLONG TransitionLatency; - ULONGLONG ResidencyRequirement; - ULONG NominalPower; -} PO_FX_COMPONENT_IDLE_STATE, *PPO_FX_COMPONENT_IDLE_STATE; - -typedef struct _PO_FX_COMPONENT_V1 { - GUID Id; - ULONG IdleStateCount; - ULONG DeepestWakeableIdleState; - _Field_size_full_(IdleStateCount) PPO_FX_COMPONENT_IDLE_STATE IdleStates; -} PO_FX_COMPONENT_V1, *PPO_FX_COMPONENT_V1; - -typedef struct _PO_FX_DEVICE_V1 { - ULONG Version; - ULONG ComponentCount; - PPO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK ComponentActiveConditionCallback; - PPO_FX_COMPONENT_IDLE_CONDITION_CALLBACK ComponentIdleConditionCallback; - PPO_FX_COMPONENT_IDLE_STATE_CALLBACK ComponentIdleStateCallback; - PPO_FX_DEVICE_POWER_REQUIRED_CALLBACK DevicePowerRequiredCallback; - PPO_FX_DEVICE_POWER_NOT_REQUIRED_CALLBACK DevicePowerNotRequiredCallback; - PPO_FX_POWER_CONTROL_CALLBACK PowerControlCallback; - PVOID DeviceContext; - _Field_size_full_(ComponentCount) PO_FX_COMPONENT_V1 Components[ANYSIZE_ARRAY]; -} PO_FX_DEVICE_V1, *PPO_FX_DEVICE_V1; - -#define PO_FX_COMPONENT_FLAG_F0_ON_DX 0x0000000000000001 -#define PO_FX_COMPONENT_FLAG_NO_DEBOUNCE 0x0000000000000002 - -typedef struct _PO_FX_COMPONENT_V2 { - GUID Id; - ULONGLONG Flags; - ULONG DeepestWakeableIdleState; - ULONG IdleStateCount; - _Field_size_full_(IdleStateCount) PPO_FX_COMPONENT_IDLE_STATE IdleStates; - ULONG ProviderCount; - _Field_size_full_(ProviderCount) PULONG Providers; -} PO_FX_COMPONENT_V2, *PPO_FX_COMPONENT_V2; - -typedef struct _PO_FX_DEVICE_V2 { - ULONG Version; - ULONGLONG Flags; - PPO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK ComponentActiveConditionCallback; - PPO_FX_COMPONENT_IDLE_CONDITION_CALLBACK ComponentIdleConditionCallback; - PPO_FX_COMPONENT_IDLE_STATE_CALLBACK ComponentIdleStateCallback; - PPO_FX_DEVICE_POWER_REQUIRED_CALLBACK DevicePowerRequiredCallback; - PPO_FX_DEVICE_POWER_NOT_REQUIRED_CALLBACK DevicePowerNotRequiredCallback; - PPO_FX_POWER_CONTROL_CALLBACK PowerControlCallback; - PVOID DeviceContext; - ULONG ComponentCount; - _Field_size_full_(ComponentCount) PO_FX_COMPONENT_V2 Components[ANYSIZE_ARRAY]; -} PO_FX_DEVICE_V2, *PPO_FX_DEVICE_V2; - -#if (PO_FX_VERSION == PO_FX_VERSION_V1) -typedef PO_FX_COMPONENT_V1 PO_FX_COMPONENT, *PPO_FX_COMPONENT; -typedef PO_FX_DEVICE_V1 PO_FX_DEVICE, *PPO_FX_DEVICE; -#elif (PO_FX_VERSION == PO_FX_VERSION_V2) -typedef PO_FX_COMPONENT_V2 PO_FX_COMPONENT, *PPO_FX_COMPONENT; -typedef PO_FX_DEVICE_V2 PO_FX_DEVICE, *PPO_FX_DEVICE; -#else -#error PO_FX_VERSION undefined! -#endif - -typedef enum _PO_FX_PERF_STATE_UNIT { - PoFxPerfStateUnitOther, - PoFxPerfStateUnitFrequency, - PoFxPerfStateUnitBandwidth, - PoFxPerfStateUnitMaximum -} PO_FX_PERF_STATE_UNIT, *PPO_FX_PERF_STATE_UNIT; - -typedef enum _PO_FX_PERF_STATE_TYPE { - PoFxPerfStateTypeDiscrete, - PoFxPerfStateTypeRange, - PoFxPerfStateTypeMaximum -} PO_FX_PERF_STATE_TYPE, *PPO_FX_PERF_STATE_TYPE; - -typedef struct _PO_FX_PERF_STATE { - ULONGLONG Value; - PVOID Context; -} PO_FX_PERF_STATE, *PPO_FX_PERF_STATE; - -typedef struct _PO_FX_COMPONENT_PERF_SET { - UNICODE_STRING Name; - ULONGLONG Flags; - PO_FX_PERF_STATE_UNIT Unit; - PO_FX_PERF_STATE_TYPE Type; - union { - struct { - ULONG Count; - _Field_size_full_(Count) PPO_FX_PERF_STATE States; - } Discrete; - struct { - ULONGLONG Minimum; - ULONGLONG Maximum; - } Range; - }; -} PO_FX_COMPONENT_PERF_SET, *PPO_FX_COMPONENT_PERF_SET; - -typedef struct _PO_FX_COMPONENT_PERF_INFO { - ULONG PerfStateSetsCount; - PO_FX_COMPONENT_PERF_SET PerfStateSets[ANYSIZE_ARRAY]; -} PO_FX_COMPONENT_PERF_INFO, *PPO_FX_COMPONENT_PERF_INFO; - -typedef struct _PO_FX_PERF_STATE_CHANGE { - ULONG Set; - union { - ULONG StateIndex; - ULONGLONG StateValue; - }; -} PO_FX_PERF_STATE_CHANGE, *PPO_FX_PERF_STATE_CHANGE; - - -// -// Pool Allocation routines (in pool.c) -// -typedef _Enum_is_bitflag_ enum _POOL_TYPE { - NonPagedPool, - NonPagedPoolExecute = NonPagedPool, - PagedPool, - NonPagedPoolMustSucceed = NonPagedPool + 2, - DontUseThisType, - NonPagedPoolCacheAligned = NonPagedPool + 4, - PagedPoolCacheAligned, - NonPagedPoolCacheAlignedMustS = NonPagedPool + 6, - MaxPoolType, - - // - // Define base types for NonPaged (versus Paged) pool, for use in cracking - // the underlying pool type. - // - - NonPagedPoolBase = 0, - NonPagedPoolBaseMustSucceed = NonPagedPoolBase + 2, - NonPagedPoolBaseCacheAligned = NonPagedPoolBase + 4, - NonPagedPoolBaseCacheAlignedMustS = NonPagedPoolBase + 6, - - // - // Note these per session types are carefully chosen so that the appropriate - // masking still applies as well as MaxPoolType above. - // - - NonPagedPoolSession = 32, - PagedPoolSession = NonPagedPoolSession + 1, - NonPagedPoolMustSucceedSession = PagedPoolSession + 1, - DontUseThisTypeSession = NonPagedPoolMustSucceedSession + 1, - NonPagedPoolCacheAlignedSession = DontUseThisTypeSession + 1, - PagedPoolCacheAlignedSession = NonPagedPoolCacheAlignedSession + 1, - NonPagedPoolCacheAlignedMustSSession = PagedPoolCacheAlignedSession + 1, - - NonPagedPoolNx = 512, - NonPagedPoolNxCacheAligned = NonPagedPoolNx + 4, - NonPagedPoolSessionNx = NonPagedPoolNx + 32, - -} _Enum_is_bitflag_ POOL_TYPE; - -#define POOL_COLD_ALLOCATION 256 // Note this cannot encode into the header. - -#define POOL_NX_ALLOCATION 512 // Note this cannot encode into the header. - - -// -// Define PnP Device Property for IoGetDeviceProperty -// - -#ifdef _PREFAST_ -#define __string_type 0x1000 -#define __guid_type 0x2000 -#define __multiString_type 0x4000 -#else -#define __string_type 0 -#define __guid_type 0 -#define __multiString_type 0 -#endif - -typedef enum { - DevicePropertyDeviceDescription = 0x0 | __string_type, - DevicePropertyHardwareID = 0x1 | __multiString_type, - DevicePropertyCompatibleIDs = 0x2 | __multiString_type, - DevicePropertyBootConfiguration = 0x3, - DevicePropertyBootConfigurationTranslated = 0x4, - DevicePropertyClassName = 0x5 | __string_type, - DevicePropertyClassGuid = 0x6 | __string_type, - DevicePropertyDriverKeyName = 0x7 | __string_type, - DevicePropertyManufacturer = 0x8 | __string_type, - DevicePropertyFriendlyName = 0x9 | __string_type, - DevicePropertyLocationInformation = 0xa | __string_type, - DevicePropertyPhysicalDeviceObjectName = 0xb | __string_type, - DevicePropertyBusTypeGuid = 0xc | __guid_type, - DevicePropertyLegacyBusType = 0xd, - DevicePropertyBusNumber = 0xe, - DevicePropertyEnumeratorName = 0xf | __string_type, - DevicePropertyAddress = 0x10, - DevicePropertyUINumber = 0x11, - DevicePropertyInstallState = 0x12, - DevicePropertyRemovalPolicy = 0x13, - DevicePropertyResourceRequirements = 0x14, - DevicePropertyAllocatedResources = 0x15, - DevicePropertyContainerID = 0x16 | __string_type -} DEVICE_REGISTRY_PROPERTY; - -// -// The following definitions are used in IoOpenDeviceRegistryKey -// - -#define PLUGPLAY_REGKEY_DEVICE 1 -#define PLUGPLAY_REGKEY_DRIVER 2 -#define PLUGPLAY_REGKEY_CURRENT_HWPROFILE 4 - - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// Custom device properties... -// - -#include - -// -// Definitions of property flags. -// - -#define PLUGPLAY_PROPERTY_PERSISTENT 0x00000001 - -#endif - -// -// Processor modes. -// - -typedef CCHAR KPROCESSOR_MODE; - -typedef enum _MODE { - KernelMode, - UserMode, - MaximumMode -} MODE; - - -#if defined(_X86_) - -// -// i386 Specific portions of Mm component. -// -// Define the page size for the Intel 386 as 4096 (0x1000). -// - -#define PAGE_SIZE 0x1000 - -// -// Define the number of trailing zeroes in a page aligned virtual address. -// This is used as the shift count when shifting virtual addresses to -// virtual page numbers. -// - -#define PAGE_SHIFT 12L - -#elif defined(_AMD64_) - -// -// AMD64 Specific portions of Mm component. -// -// Define the page size for the AMD64 as 4096 (0x1000). -// - -#define PAGE_SIZE 0x1000 - -// -// Define the number of trailing zeroes in a page aligned virtual address. -// This is used as the shift count when shifting virtual addresses to -// virtual page numbers. -// - -#define PAGE_SHIFT 12L - -#elif defined(_ARM64_) - -// -// ARM Specific portions of Mm component. -// -// Define the page size for the ARM64 as 4096 (0x1000). -// - -#define PAGE_SIZE 0x1000 - -// -// Define the number of trailing zeroes in a page aligned virtual address. -// This is used as the shift count when shifting virtual addresses to -// virtual page numbers. -// - -#define PAGE_SHIFT 12L - -#elif defined(_ARM_) - -// -// ARM Specific portions of Mm component. -// -// Define the page size for the ARM as 4096 (0x1000). -// - -#define PAGE_SIZE 0x1000 - -// -// Define the number of trailing zeroes in a page aligned virtual address. -// This is used as the shift count when shifting virtual addresses to -// virtual page numbers. -// - -#define PAGE_SHIFT 12L - -#endif - - -// -// Priority increment definitions. The comment for each definition gives -// the names of the system services that use the definition when satisfying -// a wait. -// - -// -// Priority increment used when satisfying a wait on an executive event -// (NtPulseEvent and NtSetEvent) -// - -#define EVENT_INCREMENT 1 - - - -// -// Priority increment when no I/O has been done. This is used by device -// and file system drivers when completing an IRP (IoCompleteRequest). -// - -#define IO_NO_INCREMENT 0 - - -// -// Priority increment for completing CD-ROM I/O. This is used by CD-ROM device -// and file system drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_CD_ROM_INCREMENT 1 - -// -// Priority increment for completing disk I/O. This is used by disk device -// and file system drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_DISK_INCREMENT 1 - - - -// -// Priority increment for completing keyboard I/O. This is used by keyboard -// device drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_KEYBOARD_INCREMENT 6 - - -// -// Priority increment for completing mailslot I/O. This is used by the mail- -// slot file system driver when completing an IRP (IoCompleteRequest). -// - -#define IO_MAILSLOT_INCREMENT 2 - - -// -// Priority increment for completing mouse I/O. This is used by mouse device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_MOUSE_INCREMENT 6 - - -// -// Priority increment for completing named pipe I/O. This is used by the -// named pipe file system driver when completing an IRP (IoCompleteRequest). -// - -#define IO_NAMED_PIPE_INCREMENT 2 - -// -// Priority increment for completing network I/O. This is used by network -// device and network file system drivers when completing an IRP -// (IoCompleteRequest). -// - -#define IO_NETWORK_INCREMENT 2 - - -// -// Priority increment for completing parallel I/O. This is used by parallel -// device drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_PARALLEL_INCREMENT 1 - -// -// Priority increment for completing serial I/O. This is used by serial device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_SERIAL_INCREMENT 2 - -// -// Priority increment for completing sound I/O. This is used by sound device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_SOUND_INCREMENT 8 - -// -// Priority increment for completing video I/O. This is used by video device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_VIDEO_INCREMENT 1 - - - -// -// Priority increment used when satisfying a wait on an executive semaphore -// (NtReleaseSemaphore) -// - -#define SEMAPHORE_INCREMENT 1 - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -_IRQL_requires_max_(PASSIVE_LEVEL) -_At_(String->MaximumLength, _Const_) -NTSYSAPI -NTSTATUS -NTAPI -RtlIntegerToUnicodeString ( - _In_ ULONG Value, - _In_opt_ ULONG Base, - _Inout_ PUNICODE_STRING String - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -_IRQL_requires_max_(PASSIVE_LEVEL) -_At_(String->MaximumLength, _Const_) -NTSYSAPI -NTSTATUS -NTAPI -RtlInt64ToUnicodeString ( - _In_ ULONGLONG Value, - _In_opt_ ULONG Base, - _Inout_ PUNICODE_STRING String - ); -#endif - -#ifdef _WIN64 -#define RtlIntPtrToUnicodeString(Value, Base, String) RtlInt64ToUnicodeString(Value, Base, String) -#else -#define RtlIntPtrToUnicodeString(Value, Base, String) RtlIntegerToUnicodeString(Value, Base, String) -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeStringToInteger ( - _In_ PCUNICODE_STRING String, - _In_opt_ ULONG Base, - _Out_ PULONG Value - ); -#endif - -#if !defined(BLDR_KERNEL_RUNTIME) -NTSTATUS -RtlUnicodeStringToInt64 ( - _In_ PCUNICODE_STRING String, - _In_opt_ ULONG Base, - _Out_ PLONG64 Number, - _Out_opt_ PWSTR *EndPointer - ); -#endif - - -_IRQL_requires_max_(DISPATCH_LEVEL) -_At_(DestinationString->Buffer, _Post_equal_to_(SourceString)) -_At_(DestinationString->Length, _Post_equal_to_(_String_length_(SourceString) * sizeof(WCHAR))) -_At_(DestinationString->MaximumLength, _Post_equal_to_((_String_length_(SourceString)+1) * sizeof(WCHAR))) -NTSYSAPI -VOID -NTAPI -RtlInitUnicodeString( - _Out_ PUNICODE_STRING DestinationString, - _In_opt_z_ __drv_aliasesMem PCWSTR SourceString - ); - - - -_At_(UnicodeString->Buffer, _Post_equal_to_(Buffer)) -_At_(UnicodeString->Length, _Post_equal_to_(0)) -_At_(UnicodeString->MaximumLength, _Post_equal_to_(BufferSize)) -FORCEINLINE -VOID -RtlInitEmptyUnicodeString( - _Out_ PUNICODE_STRING UnicodeString, - _Writable_bytes_(BufferSize) - _When_(BufferSize != 0, _Notnull_) - __drv_aliasesMem PWCHAR Buffer, - _In_ USHORT BufferSize - ) -{ - UnicodeString->Length = 0; - UnicodeString->MaximumLength = BufferSize; - UnicodeString->Buffer = Buffer; -} - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -_IRQL_requires_max_(PASSIVE_LEVEL) -_Must_inspect_result_ -NTSYSAPI -LONG -NTAPI -RtlCompareUnicodeStrings( - _In_reads_(String1Length) PCWCH String1, - _In_ SIZE_T String1Length, - _In_reads_(String2Length) PCWCH String2, - _In_ SIZE_T String2Length, - _In_ BOOLEAN CaseInSensitive - ); - -_IRQL_requires_max_(PASSIVE_LEVEL) -_Must_inspect_result_ -NTSYSAPI -LONG -NTAPI -RtlCompareUnicodeString( - _In_ PCUNICODE_STRING String1, - _In_ PCUNICODE_STRING String2, - _In_ BOOLEAN CaseInSensitive - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -_IRQL_requires_max_(PASSIVE_LEVEL) -_Must_inspect_result_ -NTSYSAPI -BOOLEAN -NTAPI -RtlEqualUnicodeString( - _In_ PCUNICODE_STRING String1, - _In_ PCUNICODE_STRING String2, - _In_ BOOLEAN CaseInSensitive - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -_Unchanged_(DestinationString->Buffer) -_Unchanged_(DestinationString->MaximumLength) -_At_(DestinationString->Length, - _When_(SourceString->Length > DestinationString->MaximumLength, - _Post_equal_to_(DestinationString->MaximumLength)) - _When_(SourceString->Length <= DestinationString->MaximumLength, - _Post_equal_to_(SourceString->Length))) -NTSYSAPI -VOID -NTAPI -RtlCopyUnicodeString( - _Inout_ PUNICODE_STRING DestinationString, - _In_opt_ PCUNICODE_STRING SourceString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -_Success_(1) -_Unchanged_(Destination->MaximumLength) -_Unchanged_(Destination->Buffer) -_When_(_Old_(Destination->Length) + Source->Length <= Destination->MaximumLength, - _At_(Destination->Length, - _Post_equal_to_(_Old_(Destination->Length) + Source->Length)) - _At_(return, _Out_range_(==, 0))) -_When_(_Old_(Destination->Length) + Source->Length > Destination->MaximumLength, - _Unchanged_(Destination->Length) - _At_(return, _Out_range_(<, 0))) -NTSYSAPI -NTSTATUS -NTAPI -RtlAppendUnicodeStringToString ( - _Inout_ PUNICODE_STRING Destination, - _In_ PCUNICODE_STRING Source - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -_Success_(1) -_Unchanged_(Destination->MaximumLength) -_Unchanged_(Destination->Buffer) -_When_(_Old_(Destination->Length) + _String_length_(Source) * sizeof(WCHAR) <= Destination->MaximumLength, - _At_(Destination->Length, - _Post_equal_to_(_Old_(Destination->Length) + _String_length_(Source) * sizeof(WCHAR))) - _At_(return, _Out_range_(==, 0))) -_When_(_Old_(Destination->Length) + _String_length_(Source) * sizeof(WCHAR) > Destination->MaximumLength, - _Unchanged_(Destination->Length) - _At_(return, _Out_range_(<, 0))) -NTSYSAPI -NTSTATUS -NTAPI -RtlAppendUnicodeToString ( - _Inout_ PUNICODE_STRING Destination, - _In_opt_z_ PCWSTR Source - ); -#endif - - - -_IRQL_requires_max_(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlFreeUnicodeString( - _Inout_ _At_(UnicodeString->Buffer, _Frees_ptr_opt_) - PUNICODE_STRING UnicodeString - ); - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#if (_MSC_FULL_VER >= 150030729) && !defined(IMPORT_NATIVE_DBG_BREAK) - -#define DbgBreakPoint __debugbreak - -#else - -__analysis_noreturn -VOID -NTAPI -DbgBreakPoint( - VOID - ); - -#endif - -#endif - -#if DBG -#define KdPrintEx(_x_) DbgPrintEx _x_ -#define KdBreakPoint() DbgBreakPoint() -#else -#define KdPrintEx(_x_) -#define KdBreakPoint() -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -ULONG -__cdecl -DbgPrintEx ( - _In_ ULONG ComponentId, - _In_ ULONG Level, - _In_z_ _Printf_format_string_ PCSTR Format, - ... - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -#include -#endif - - -#if !defined (NT_INCLUDED) - -// -// Define the create disposition values -// - -#define FILE_SUPERSEDE 0x00000000 -#define FILE_OPEN 0x00000001 -#define FILE_CREATE 0x00000002 -#define FILE_OPEN_IF 0x00000003 -#define FILE_OVERWRITE 0x00000004 -#define FILE_OVERWRITE_IF 0x00000005 -#define FILE_MAXIMUM_DISPOSITION 0x00000005 - -// -// Define the create/open option flags -// - -#define FILE_DIRECTORY_FILE 0x00000001 -#define FILE_WRITE_THROUGH 0x00000002 -#define FILE_SEQUENTIAL_ONLY 0x00000004 -#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008 - -#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 -#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 -#define FILE_NON_DIRECTORY_FILE 0x00000040 -#define FILE_CREATE_TREE_CONNECTION 0x00000080 - -#define FILE_COMPLETE_IF_OPLOCKED 0x00000100 -#define FILE_NO_EA_KNOWLEDGE 0x00000200 -#define FILE_OPEN_REMOTE_INSTANCE 0x00000400 -#define FILE_RANDOM_ACCESS 0x00000800 - -#define FILE_DELETE_ON_CLOSE 0x00001000 -#define FILE_OPEN_BY_FILE_ID 0x00002000 -#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000 -#define FILE_NO_COMPRESSION 0x00008000 - -#if (NTDDI_VERSION >= NTDDI_WIN7) -#define FILE_OPEN_REQUIRING_OPLOCK 0x00010000 -#define FILE_DISALLOW_EXCLUSIVE 0x00020000 -#endif /* NTDDI_VERSION >= NTDDI_WIN7 */ -#if (NTDDI_VERSION >= NTDDI_WIN8) -#define FILE_SESSION_AWARE 0x00040000 -#endif /* NTDDI_VERSION >= NTDDI_WIN8 */ - -#define FILE_RESERVE_OPFILTER 0x00100000 -#define FILE_OPEN_REPARSE_POINT 0x00200000 -#define FILE_OPEN_NO_RECALL 0x00400000 -#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 - -// -// Define the base asynchronous I/O argument types -// - -typedef struct _IO_STATUS_BLOCK { - union { - NTSTATUS Status; - PVOID Pointer; - } DUMMYUNIONNAME; - - ULONG_PTR Information; -} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; - -// -// Define the I/O bus interface types. -// - -typedef enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal, - Isa, - Eisa, - MicroChannel, - TurboChannel, - PCIBus, - VMEBus, - NuBus, - PCMCIABus, - CBus, - MPIBus, - MPSABus, - ProcessorInternal, - InternalPowerBus, - PNPISABus, - PNPBus, - Vmcs, - ACPIBus, - MaximumInterfaceType -}INTERFACE_TYPE, *PINTERFACE_TYPE; - - -// -// Resource List definitions -// - - - -// -// Defines the Type in the RESOURCE_DESCRIPTOR -// -// NOTE: For all CM_RESOURCE_TYPE values, there must be a -// corresponding ResType value in the 32-bit ConfigMgr headerfile -// (cfgmgr32.h). Values in the range [0x6,0x80) use the same values -// as their ConfigMgr counterparts. CM_RESOURCE_TYPE values with -// the high bit set (i.e., in the range [0x80,0xFF]), are -// non-arbitrated resources. These correspond to the same values -// in cfgmgr32.h that have their high bit set (however, since -// cfgmgr32.h uses 16 bits for ResType values, these values are in -// the range [0x8000,0x807F). Note that ConfigMgr ResType values -// cannot be in the range [0x8080,0xFFFF), because they would not -// be able to map into CM_RESOURCE_TYPE values. (0xFFFF itself is -// a special value, because it maps to CmResourceTypeDeviceSpecific.) -// - -typedef int CM_RESOURCE_TYPE; - -// CmResourceTypeNull is reserved - -#define CmResourceTypeNull 0 // ResType_All or ResType_None (0x0000) -#define CmResourceTypePort 1 // ResType_IO (0x0002) -#define CmResourceTypeInterrupt 2 // ResType_IRQ (0x0004) -#define CmResourceTypeMemory 3 // ResType_Mem (0x0001) -#define CmResourceTypeDma 4 // ResType_DMA (0x0003) -#define CmResourceTypeDeviceSpecific 5 // ResType_ClassSpecific (0xFFFF) -#define CmResourceTypeBusNumber 6 // ResType_BusNumber (0x0006) -#define CmResourceTypeMemoryLarge 7 // ResType_MemLarge (0x0007) -#define CmResourceTypeNonArbitrated 128 // Not arbitrated if 0x80 bit set -#define CmResourceTypeConfigData 128 // ResType_Reserved (0x8000) -#define CmResourceTypeDevicePrivate 129 // ResType_DevicePrivate (0x8001) -#define CmResourceTypePcCardConfig 130 // ResType_PcCardConfig (0x8002) -#define CmResourceTypeMfCardConfig 131 // ResType_MfCardConfig (0x8003) -#define CmResourceTypeConnection 132 // ResType_Connection (0x8004) - -// -// Defines the ShareDisposition in the RESOURCE_DESCRIPTOR -// - -typedef enum _CM_SHARE_DISPOSITION { - CmResourceShareUndetermined = 0, // Reserved - CmResourceShareDeviceExclusive, - CmResourceShareDriverExclusive, - CmResourceShareShared -} CM_SHARE_DISPOSITION; - -// -// Define the bit masks for Flags when type is CmResourceTypeInterrupt -// - -#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0x00 -#define CM_RESOURCE_INTERRUPT_LATCHED 0x01 -#define CM_RESOURCE_INTERRUPT_MESSAGE 0x02 -#define CM_RESOURCE_INTERRUPT_POLICY_INCLUDED 0x04 -#define CM_RESOURCE_INTERRUPT_SECONDARY_INTERRUPT 0x10 -#define CM_RESOURCE_INTERRUPT_WAKE_HINT 0x20 - -// -// A bitmask defining the bits in a resource or requirements descriptor -// flags field that corresponds to the latch mode or a level triggered -// interrupt. -// - -#define CM_RESOURCE_INTERRUPT_LEVEL_LATCHED_BITS 0x0001 - -// -// Define the token value used for an interrupt vector to mean that the vector -// is message signaled. This value is used in the MaximumVector field. -// - -#define CM_RESOURCE_INTERRUPT_MESSAGE_TOKEN ((ULONG)-2) - -// -// Define the bit masks for Flags when type is CmResourceTypeMemory -// or CmResourceTypeMemoryLarge -// - -#define CM_RESOURCE_MEMORY_READ_WRITE 0x0000 -#define CM_RESOURCE_MEMORY_READ_ONLY 0x0001 -#define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002 -#define CM_RESOURCE_MEMORY_WRITEABILITY_MASK 0x0003 -#define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004 - -#define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008 -#define CM_RESOURCE_MEMORY_24 0x0010 -#define CM_RESOURCE_MEMORY_CACHEABLE 0x0020 -#define CM_RESOURCE_MEMORY_WINDOW_DECODE 0x0040 -#define CM_RESOURCE_MEMORY_BAR 0x0080 - -#define CM_RESOURCE_MEMORY_COMPAT_FOR_INACCESSIBLE_RANGE 0x0100 - -// -// Define the bit masks exclusive to type CmResourceTypeMemoryLarge. -// - -#define CM_RESOURCE_MEMORY_LARGE 0x0E00 -#define CM_RESOURCE_MEMORY_LARGE_40 0x0200 -#define CM_RESOURCE_MEMORY_LARGE_48 0x0400 -#define CM_RESOURCE_MEMORY_LARGE_64 0x0800 - -// -// Define limits for large memory resources -// - -#define CM_RESOURCE_MEMORY_LARGE_40_MAXLEN 0x000000FFFFFFFF00 -#define CM_RESOURCE_MEMORY_LARGE_48_MAXLEN 0x0000FFFFFFFF0000 -#define CM_RESOURCE_MEMORY_LARGE_64_MAXLEN 0xFFFFFFFF00000000 - -// -// Define the bit masks for Flags when type is CmResourceTypePort -// - -#define CM_RESOURCE_PORT_MEMORY 0x0000 -#define CM_RESOURCE_PORT_IO 0x0001 -#define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004 -#define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008 -#define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010 -#define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020 -#define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040 -#define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080 -#define CM_RESOURCE_PORT_BAR 0x0100 - -// -// Define the bit masks for Flags when type is CmResourceTypeDma -// - -#define CM_RESOURCE_DMA_8 0x0000 -#define CM_RESOURCE_DMA_16 0x0001 -#define CM_RESOURCE_DMA_32 0x0002 -#define CM_RESOURCE_DMA_8_AND_16 0x0004 -#define CM_RESOURCE_DMA_BUS_MASTER 0x0008 -#define CM_RESOURCE_DMA_TYPE_A 0x0010 -#define CM_RESOURCE_DMA_TYPE_B 0x0020 -#define CM_RESOURCE_DMA_TYPE_F 0x0040 -#define CM_RESOURCE_DMA_V3 0x0080 - -// -// Define the different types of DMA transfer width values. -// - -#define DMAV3_TRANFER_WIDTH_8 0x00 -#define DMAV3_TRANFER_WIDTH_16 0x01 -#define DMAV3_TRANFER_WIDTH_32 0x02 -#define DMAV3_TRANFER_WIDTH_64 0x03 -#define DMAV3_TRANFER_WIDTH_128 0x04 -#define DMAV3_TRANFER_WIDTH_256 0x05 - -// -// Define the Class and Type values for CmResourceTypeConnection -// - -#define CM_RESOURCE_CONNECTION_CLASS_GPIO 0x01 -#define CM_RESOURCE_CONNECTION_CLASS_SERIAL 0x02 - - -#define CM_RESOURCE_CONNECTION_TYPE_GPIO_IO 0x02 -#define CM_RESOURCE_CONNECTION_TYPE_SERIAL_I2C 0x01 -#define CM_RESOURCE_CONNECTION_TYPE_SERIAL_SPI 0x02 -#define CM_RESOURCE_CONNECTION_TYPE_SERIAL_UART 0x03 - - - -// -// This structure defines one type of resource used by a driver. -// -// There can only be *1* DeviceSpecificData block. It must be located at -// the end of all resource descriptors in a full descriptor block. -// - -// -// Make sure alignment is made properly by compiler; otherwise move -// flags back to the top of the structure (common to all members of the -// union). -// - - -#include "pshpack4.h" -typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type; - UCHAR ShareDisposition; - USHORT Flags; - union { - - // - // Range of resources, inclusive. These are physical, bus relative. - // It is known that Port and Memory below have the exact same layout - // as Generic. - // - - struct { - PHYSICAL_ADDRESS Start; - ULONG Length; - } Generic; - - // - // - - struct { - PHYSICAL_ADDRESS Start; - ULONG Length; - } Port; - - // - // - - struct { -#if defined(NT_PROCESSOR_GROUPS) - USHORT Level; - USHORT Group; -#else - ULONG Level; -#endif - ULONG Vector; - KAFFINITY Affinity; - } Interrupt; - - // - // Values for message signaled interrupts are distinct in the - // raw and translated cases. - // - - struct { - union { - struct { -#if defined(NT_PROCESSOR_GROUPS) - USHORT Group; -#else - USHORT Reserved; -#endif - USHORT MessageCount; - ULONG Vector; - KAFFINITY Affinity; - } Raw; - - struct { -#if defined(NT_PROCESSOR_GROUPS) - USHORT Level; - USHORT Group; -#else - ULONG Level; -#endif - ULONG Vector; - KAFFINITY Affinity; - } Translated; - } DUMMYUNIONNAME; - } MessageInterrupt; - - // - // Range of memory addresses, inclusive. These are physical, bus - // relative. The value should be the same as the one passed to - // HalTranslateBusAddress(). - // - - struct { - PHYSICAL_ADDRESS Start; // 64 bit physical addresses. - ULONG Length; - } Memory; - - // - // Physical DMA channel. - // - - struct { - ULONG Channel; - ULONG Port; - ULONG Reserved1; - } Dma; - - struct { - ULONG Channel; - ULONG RequestLine; - UCHAR TransferWidth; - UCHAR Reserved1; - UCHAR Reserved2; - UCHAR Reserved3; - } DmaV3; - - // - // Device driver private data, usually used to help it figure - // what the resource assignments decisions that were made. - // - - struct { - ULONG Data[3]; - } DevicePrivate; - - // - // Bus Number information. - // - - struct { - ULONG Start; - ULONG Length; - ULONG Reserved; - } BusNumber; - - // - // Device Specific information defined by the driver. - // The DataSize field indicates the size of the data in bytes. The - // data is located immediately after the DeviceSpecificData field in - // the structure. - // - - struct { - ULONG DataSize; - ULONG Reserved1; - ULONG Reserved2; - } DeviceSpecificData; - - // The following structures provide support for memory-mapped - // IO resources greater than MAXULONG - struct { - PHYSICAL_ADDRESS Start; - ULONG Length40; - } Memory40; - - struct { - PHYSICAL_ADDRESS Start; - ULONG Length48; - } Memory48; - - struct { - PHYSICAL_ADDRESS Start; - ULONG Length64; - } Memory64; - - struct { - UCHAR Class; - UCHAR Type; - UCHAR Reserved1; - UCHAR Reserved2; - ULONG IdLowPart; - ULONG IdHighPart; - } Connection; - - } u; -} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR; -#include "poppack.h" - -// -// A Partial Resource List is what can be found in the ARC firmware -// or will be generated by ntdetect.com. -// The configuration manager will transform this structure into a Full -// resource descriptor when it is about to store it in the regsitry. -// -// Note: There must a be a convention to the order of fields of same type, -// (defined on a device by device basis) so that the fields can make sense -// to a driver (i.e. when multiple memory ranges are necessary). -// - -typedef struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version; - USHORT Revision; - ULONG Count; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; -} CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST; - -// -// A Full Resource Descriptor is what can be found in the registry. -// This is what will be returned to a driver when it queries the registry -// to get device information; it will be stored under a key in the hardware -// description tree. -// -// Note: There must a be a convention to the order of fields of same type, -// (defined on a device by device basis) so that the fields can make sense -// to a driver (i.e. when multiple memory ranges are necessary). -// - -typedef struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType; // unused for WDM - ULONG BusNumber; // unused for WDM - CM_PARTIAL_RESOURCE_LIST PartialResourceList; -} CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR; - -// -// The Resource list is what will be stored by the drivers into the -// resource map via the IO API. -// - -typedef struct _CM_RESOURCE_LIST { - ULONG Count; - CM_FULL_RESOURCE_DESCRIPTOR List[1]; -} CM_RESOURCE_LIST, *PCM_RESOURCE_LIST; - - -#endif // !defined (NT_INCLUDED) - -#ifdef __cplusplus -} // extern "C" -#endif - From 03fe8d2390f5f8b91ce380e9e455dc02c384f991 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 23 May 2026 09:52:17 -0400 Subject: [PATCH 2/2] Add WDF submodule and enable submodules in CI Add Microsoft Windows Driver Frameworks as a Git submodule (ThirdParty/Windows-Driver-Frameworks) and include a .gitmodules file. Update CI workflow (.github/workflows/ci-validation.yml) to checkout submodules during actions/checkout, and add README instructions for cloning/initializing submodules (clone --recurse-submodules / git submodule update --init --recursive). Ensures WDF headers are available for local builds and CI runs. --- .github/workflows/ci-validation.yml | 2 ++ .gitmodules | 3 +++ README.md | 14 ++++++++++++++ ThirdParty/Windows-Driver-Frameworks | 1 + 4 files changed, 20 insertions(+) create mode 100644 .gitmodules create mode 160000 ThirdParty/Windows-Driver-Frameworks diff --git a/.github/workflows/ci-validation.yml b/.github/workflows/ci-validation.yml index 0be0eaf..bbc15a6 100644 --- a/.github/workflows/ci-validation.yml +++ b/.github/workflows/ci-validation.yml @@ -34,6 +34,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + submodules: true - name: Setup MSBuild uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4a8777e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "ThirdParty/Windows-Driver-Frameworks"] + path = ThirdParty/Windows-Driver-Frameworks + url = https://github.com/microsoft/Windows-Driver-Frameworks.git diff --git a/README.md b/README.md index 3378f62..83106c2 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,20 @@ Explore more games, tools, apps, and experiments from PyroSoft: **[Visit PyroSof - **EDID integration**: Added EDID integration support for custom/virtual monitor profiles. - **Performance optimization**: Driver performance improvements (various internal optimizations). +## Building from source + +This repository uses a Git submodule for Microsoft Windows Driver Frameworks headers. Clone with submodules enabled: + +```bash +git clone --recurse-submodules https://github.com/VirtualDrivers/Virtual-Display-Driver.git +``` + +For an existing checkout, initialize the submodule before building: + +```bash +git submodule update --init --recursive +``` + ## ⬇️ Download Latest Version - [Driver Installer (Windows 10/11)](https://github.com/VirtualDrivers/Virtual-Display-Driver/releases) - Check the [Releases](https://github.com/VirtualDrivers/Virtual-Display-Driver/releases) page for the latest version and release notes. diff --git a/ThirdParty/Windows-Driver-Frameworks b/ThirdParty/Windows-Driver-Frameworks new file mode 160000 index 0000000..3b9780e --- /dev/null +++ b/ThirdParty/Windows-Driver-Frameworks @@ -0,0 +1 @@ +Subproject commit 3b9780e847cf68d6199dafe0f87650cf1f9c227f