140462c92SVictor Perevertkin /*++
240462c92SVictor Perevertkin
340462c92SVictor Perevertkin Copyright (c) Microsoft Corporation. All rights reserved.
440462c92SVictor Perevertkin
540462c92SVictor Perevertkin _WdfVersionBuild_
640462c92SVictor Perevertkin
740462c92SVictor Perevertkin Module Name:
840462c92SVictor Perevertkin
940462c92SVictor Perevertkin wdfiotarget.h
1040462c92SVictor Perevertkin
1140462c92SVictor Perevertkin Abstract:
1240462c92SVictor Perevertkin
1340462c92SVictor Perevertkin Interfaces for WDF IO Targets
1440462c92SVictor Perevertkin
1540462c92SVictor Perevertkin Environment:
1640462c92SVictor Perevertkin
1740462c92SVictor Perevertkin kernel mode only
1840462c92SVictor Perevertkin
1940462c92SVictor Perevertkin Revision History:
2040462c92SVictor Perevertkin
2140462c92SVictor Perevertkin --*/
2240462c92SVictor Perevertkin
2340462c92SVictor Perevertkin //
2440462c92SVictor Perevertkin // NOTE: This header is generated by stubwork. Please make any
2540462c92SVictor Perevertkin // modifications to the corresponding template files
2640462c92SVictor Perevertkin // (.x or .y) and use stubwork to regenerate the header
2740462c92SVictor Perevertkin //
2840462c92SVictor Perevertkin
2940462c92SVictor Perevertkin #ifndef _WDFIOTARGET_H_
3040462c92SVictor Perevertkin #define _WDFIOTARGET_H_
3140462c92SVictor Perevertkin
3240462c92SVictor Perevertkin #ifndef WDF_EXTERN_C
3340462c92SVictor Perevertkin #ifdef __cplusplus
3440462c92SVictor Perevertkin #define WDF_EXTERN_C extern "C"
3540462c92SVictor Perevertkin #define WDF_EXTERN_C_START extern "C" {
3640462c92SVictor Perevertkin #define WDF_EXTERN_C_END }
3740462c92SVictor Perevertkin #else
3840462c92SVictor Perevertkin #define WDF_EXTERN_C
3940462c92SVictor Perevertkin #define WDF_EXTERN_C_START
4040462c92SVictor Perevertkin #define WDF_EXTERN_C_END
4140462c92SVictor Perevertkin #endif
4240462c92SVictor Perevertkin #endif
4340462c92SVictor Perevertkin
4440462c92SVictor Perevertkin WDF_EXTERN_C_START
4540462c92SVictor Perevertkin
4640462c92SVictor Perevertkin
4740462c92SVictor Perevertkin
4840462c92SVictor Perevertkin
4940462c92SVictor Perevertkin #if (NTDDI_VERSION >= NTDDI_WIN2K)
5040462c92SVictor Perevertkin
5140462c92SVictor Perevertkin typedef enum _WDF_IO_TARGET_STATE {
5240462c92SVictor Perevertkin WdfIoTargetStateUndefined = 0,
5340462c92SVictor Perevertkin WdfIoTargetStarted,
5440462c92SVictor Perevertkin WdfIoTargetStopped,
5540462c92SVictor Perevertkin WdfIoTargetClosedForQueryRemove,
5640462c92SVictor Perevertkin WdfIoTargetClosed,
5740462c92SVictor Perevertkin WdfIoTargetDeleted,
5840462c92SVictor Perevertkin WdfIoTargetPurged,
5940462c92SVictor Perevertkin } WDF_IO_TARGET_STATE, *PWDF_IO_TARGET_STATE;
6040462c92SVictor Perevertkin
6140462c92SVictor Perevertkin typedef enum _WDF_IO_TARGET_OPEN_TYPE {
6240462c92SVictor Perevertkin WdfIoTargetOpenUndefined = 0,
6340462c92SVictor Perevertkin WdfIoTargetOpenUseExistingDevice = 1,
6440462c92SVictor Perevertkin WdfIoTargetOpenByName = 2,
6540462c92SVictor Perevertkin WdfIoTargetOpenReopen = 3,
6640462c92SVictor Perevertkin WdfIoTargetOpenLocalTargetByFile = 4,
6740462c92SVictor Perevertkin } WDF_IO_TARGET_OPEN_TYPE;
6840462c92SVictor Perevertkin
6940462c92SVictor Perevertkin typedef enum _WDF_IO_TARGET_SENT_IO_ACTION {
7040462c92SVictor Perevertkin WdfIoTargetSentIoUndefined = 0,
7140462c92SVictor Perevertkin WdfIoTargetCancelSentIo,
7240462c92SVictor Perevertkin WdfIoTargetWaitForSentIoToComplete,
7340462c92SVictor Perevertkin WdfIoTargetLeaveSentIoPending,
7440462c92SVictor Perevertkin } WDF_IO_TARGET_SENT_IO_ACTION;
7540462c92SVictor Perevertkin
7640462c92SVictor Perevertkin typedef enum _WDF_IO_TARGET_PURGE_IO_ACTION {
7740462c92SVictor Perevertkin WdfIoTargetPurgeIoUndefined = 0,
7840462c92SVictor Perevertkin WdfIoTargetPurgeIoAndWait = 1,
7940462c92SVictor Perevertkin WdfIoTargetPurgeIo = 2,
8040462c92SVictor Perevertkin } WDF_IO_TARGET_PURGE_IO_ACTION;
8140462c92SVictor Perevertkin
8240462c92SVictor Perevertkin
8340462c92SVictor Perevertkin
8440462c92SVictor Perevertkin typedef
8540462c92SVictor Perevertkin _Function_class_(EVT_WDF_IO_TARGET_QUERY_REMOVE)
8640462c92SVictor Perevertkin _IRQL_requires_same_
8740462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
8840462c92SVictor Perevertkin NTSTATUS
89*545df815SVictor Perevertkin STDCALL
9040462c92SVictor Perevertkin EVT_WDF_IO_TARGET_QUERY_REMOVE(
9140462c92SVictor Perevertkin _In_
9240462c92SVictor Perevertkin WDFIOTARGET IoTarget
9340462c92SVictor Perevertkin );
9440462c92SVictor Perevertkin
9540462c92SVictor Perevertkin typedef EVT_WDF_IO_TARGET_QUERY_REMOVE *PFN_WDF_IO_TARGET_QUERY_REMOVE;
9640462c92SVictor Perevertkin
9740462c92SVictor Perevertkin typedef
9840462c92SVictor Perevertkin _Function_class_(EVT_WDF_IO_TARGET_REMOVE_CANCELED)
9940462c92SVictor Perevertkin _IRQL_requires_same_
10040462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
10140462c92SVictor Perevertkin VOID
102*545df815SVictor Perevertkin STDCALL
10340462c92SVictor Perevertkin EVT_WDF_IO_TARGET_REMOVE_CANCELED(
10440462c92SVictor Perevertkin _In_
10540462c92SVictor Perevertkin WDFIOTARGET IoTarget
10640462c92SVictor Perevertkin );
10740462c92SVictor Perevertkin
10840462c92SVictor Perevertkin typedef EVT_WDF_IO_TARGET_REMOVE_CANCELED *PFN_WDF_IO_TARGET_REMOVE_CANCELED;
10940462c92SVictor Perevertkin
11040462c92SVictor Perevertkin typedef
11140462c92SVictor Perevertkin _Function_class_(EVT_WDF_IO_TARGET_REMOVE_COMPLETE)
11240462c92SVictor Perevertkin _IRQL_requires_same_
11340462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
11440462c92SVictor Perevertkin VOID
115*545df815SVictor Perevertkin STDCALL
11640462c92SVictor Perevertkin EVT_WDF_IO_TARGET_REMOVE_COMPLETE(
11740462c92SVictor Perevertkin _In_
11840462c92SVictor Perevertkin WDFIOTARGET IoTarget
11940462c92SVictor Perevertkin );
12040462c92SVictor Perevertkin
12140462c92SVictor Perevertkin typedef EVT_WDF_IO_TARGET_REMOVE_COMPLETE *PFN_WDF_IO_TARGET_REMOVE_COMPLETE;
12240462c92SVictor Perevertkin
12340462c92SVictor Perevertkin typedef struct _WDF_IO_TARGET_OPEN_PARAMS {
12440462c92SVictor Perevertkin //
12540462c92SVictor Perevertkin // Size of this structure in bytes
12640462c92SVictor Perevertkin //
12740462c92SVictor Perevertkin ULONG Size;
12840462c92SVictor Perevertkin
12940462c92SVictor Perevertkin //
13040462c92SVictor Perevertkin // Indicates which fields of this structure are going to be used in
13140462c92SVictor Perevertkin // creating the WDFIOTARGET.
13240462c92SVictor Perevertkin //
13340462c92SVictor Perevertkin WDF_IO_TARGET_OPEN_TYPE Type;
13440462c92SVictor Perevertkin
13540462c92SVictor Perevertkin //
13640462c92SVictor Perevertkin // Notification when the target is being queried for removal.
13740462c92SVictor Perevertkin // If !NT_SUCCESS is returned, the query will fail and the target will
13840462c92SVictor Perevertkin // remain opened.
13940462c92SVictor Perevertkin //
14040462c92SVictor Perevertkin PFN_WDF_IO_TARGET_QUERY_REMOVE EvtIoTargetQueryRemove;
14140462c92SVictor Perevertkin
14240462c92SVictor Perevertkin //
14340462c92SVictor Perevertkin // The previous query remove has been canceled and the target can now be
14440462c92SVictor Perevertkin // reopened.
14540462c92SVictor Perevertkin //
14640462c92SVictor Perevertkin PFN_WDF_IO_TARGET_REMOVE_CANCELED EvtIoTargetRemoveCanceled;
14740462c92SVictor Perevertkin
14840462c92SVictor Perevertkin //
14940462c92SVictor Perevertkin // The query remove has succeeded and the target is now removed from the
15040462c92SVictor Perevertkin // system.
15140462c92SVictor Perevertkin //
15240462c92SVictor Perevertkin PFN_WDF_IO_TARGET_REMOVE_COMPLETE EvtIoTargetRemoveComplete;
15340462c92SVictor Perevertkin
15440462c92SVictor Perevertkin
15540462c92SVictor Perevertkin // <KMDF_ONLY/>
15640462c92SVictor Perevertkin // ========== WdfIoTargetOpenUseExistingDevice begin ==========
15740462c92SVictor Perevertkin //
15840462c92SVictor Perevertkin // The device object to send requests to
15940462c92SVictor Perevertkin //
16040462c92SVictor Perevertkin PDEVICE_OBJECT TargetDeviceObject;
16140462c92SVictor Perevertkin
16240462c92SVictor Perevertkin // <KMDF_ONLY/>
16340462c92SVictor Perevertkin // File object representing the TargetDeviceObject. The PFILE_OBJECT will
16440462c92SVictor Perevertkin // be passed as a parameter in all requests sent to the resulting
16540462c92SVictor Perevertkin // WDFIOTARGET.
16640462c92SVictor Perevertkin //
16740462c92SVictor Perevertkin PFILE_OBJECT TargetFileObject;
16840462c92SVictor Perevertkin
16940462c92SVictor Perevertkin // ========== WdfIoTargetOpenUseExistingDevice end ==========
17040462c92SVictor Perevertkin
17140462c92SVictor Perevertkin // ========== WdfIoTargetOpenByName begin ==========
17240462c92SVictor Perevertkin //
17340462c92SVictor Perevertkin // Name of the device to open.
17440462c92SVictor Perevertkin //
17540462c92SVictor Perevertkin UNICODE_STRING TargetDeviceName;
17640462c92SVictor Perevertkin
17740462c92SVictor Perevertkin // <KMDF_DOC>
17840462c92SVictor Perevertkin // The access desired on the device being opened up, ie WDM FILE_XXX_ACCESS
17940462c92SVictor Perevertkin // such as FILE_ANY_ACCESS, FILE_SPECIAL_ACCESS, FILE_READ_ACCESS, or
18040462c92SVictor Perevertkin // FILE_WRITE_ACCESS or you can use values such as GENERIC_READ,
18140462c92SVictor Perevertkin // GENERIC_WRITE, or GENERIC_ALL.
18240462c92SVictor Perevertkin // </KMDF_DOC>
18340462c92SVictor Perevertkin // <UMDF_DOC>
18440462c92SVictor Perevertkin // The requested access to the file or device, which can be summarized as
18540462c92SVictor Perevertkin // read, write, both or neither zero). For more information about
18640462c92SVictor Perevertkin // this member, see the dwDesiredAccess parameter of CreateFile in the
18740462c92SVictor Perevertkin // Windows SDK. Note that ACCESS_MASK data type is a DWORD value.
18840462c92SVictor Perevertkin // </UMDF_DOC>
18940462c92SVictor Perevertkin //
19040462c92SVictor Perevertkin ACCESS_MASK DesiredAccess;
19140462c92SVictor Perevertkin
19240462c92SVictor Perevertkin //
19340462c92SVictor Perevertkin // <KMDF_DOC>
19440462c92SVictor Perevertkin // Share access desired on the target being opened, ie WDM FILE_SHARE_XXX
19540462c92SVictor Perevertkin // values such as FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_DELETE.
19640462c92SVictor Perevertkin // A zero value means exclusive access to the target.
19740462c92SVictor Perevertkin //
19840462c92SVictor Perevertkin // </KMDF_DOC>
19940462c92SVictor Perevertkin // <UMDF_DOC>
20040462c92SVictor Perevertkin // The type of sharing to allow for the file. For more information about
20140462c92SVictor Perevertkin // this member, see the dwShareMode parameter of CreateFile in the
20240462c92SVictor Perevertkin // Windows SDK. A value of 0 means exclusive access.
20340462c92SVictor Perevertkin // </UMDF_DOC>
20440462c92SVictor Perevertkin //
20540462c92SVictor Perevertkin ULONG ShareAccess;
20640462c92SVictor Perevertkin
20740462c92SVictor Perevertkin //
20840462c92SVictor Perevertkin // <KMDF_DOC>
20940462c92SVictor Perevertkin // File attributes, see ZwCreateFile in the DDK for a list of valid
21040462c92SVictor Perevertkin // values and their meaning.
21140462c92SVictor Perevertkin // </KMDF_DOC>
21240462c92SVictor Perevertkin // <UMDF_DOC>
21340462c92SVictor Perevertkin // Additional flags and attributes for the file. For more information about
21440462c92SVictor Perevertkin // this member, see the dwFlagsAndAttributes parameter of CreateFile
21540462c92SVictor Perevertkin // in the Windows SDK.
21640462c92SVictor Perevertkin // </UMDF_DOC>
21740462c92SVictor Perevertkin //
21840462c92SVictor Perevertkin ULONG FileAttributes;
21940462c92SVictor Perevertkin
22040462c92SVictor Perevertkin //
22140462c92SVictor Perevertkin // <KMDF_DOC>
22240462c92SVictor Perevertkin // Create disposition, see ZwCreateFile in the DDK for a list of valid
22340462c92SVictor Perevertkin // values and their meaning.
22440462c92SVictor Perevertkin // </KMDF_DOC>
22540462c92SVictor Perevertkin // <UMDF_DOC>
22640462c92SVictor Perevertkin // The action to take if the file already exists. For more information
22740462c92SVictor Perevertkin // about this member, see the dwCreationDisposition parameter of
22840462c92SVictor Perevertkin // CreateFile in the Windows SDK.
22940462c92SVictor Perevertkin // </UMDF_DOC>
23040462c92SVictor Perevertkin //
23140462c92SVictor Perevertkin ULONG CreateDisposition;
23240462c92SVictor Perevertkin
23340462c92SVictor Perevertkin //
23440462c92SVictor Perevertkin // <KMDF_ONLY/>
23540462c92SVictor Perevertkin // Options for opening the device, see CreateOptions for ZwCreateFile in the
23640462c92SVictor Perevertkin // DDK for a list of valid values and their meaning.
23740462c92SVictor Perevertkin //
23840462c92SVictor Perevertkin ULONG CreateOptions;
23940462c92SVictor Perevertkin
24040462c92SVictor Perevertkin //
24140462c92SVictor Perevertkin // <KMDF_ONLY/>
24240462c92SVictor Perevertkin //
24340462c92SVictor Perevertkin PVOID EaBuffer;
24440462c92SVictor Perevertkin
24540462c92SVictor Perevertkin //
24640462c92SVictor Perevertkin // <KMDF_ONLY/>
24740462c92SVictor Perevertkin //
24840462c92SVictor Perevertkin ULONG EaBufferLength;
24940462c92SVictor Perevertkin
25040462c92SVictor Perevertkin //
25140462c92SVictor Perevertkin // <KMDF_ONLY/>
25240462c92SVictor Perevertkin //
25340462c92SVictor Perevertkin PLONGLONG AllocationSize;
25440462c92SVictor Perevertkin
25540462c92SVictor Perevertkin // ========== WdfIoTargetOpenByName end ==========
25640462c92SVictor Perevertkin
25740462c92SVictor Perevertkin //
25840462c92SVictor Perevertkin // <KMDF_ONLY/>
25940462c92SVictor Perevertkin //
26040462c92SVictor Perevertkin // On return for a create by name, this will contain one of the following
26140462c92SVictor Perevertkin // values: FILE_CREATED, FILE_OPENED, FILE_OVERWRITTEN, FILE_SUPERSEDED,
26240462c92SVictor Perevertkin // FILE_EXISTS, FILE_DOES_NOT_EXIST
26340462c92SVictor Perevertkin //
26440462c92SVictor Perevertkin ULONG FileInformation;
26540462c92SVictor Perevertkin
26640462c92SVictor Perevertkin // ========== WdfIoTargetOpenLocalTargetByFile begin ==========
26740462c92SVictor Perevertkin
26840462c92SVictor Perevertkin //
26940462c92SVictor Perevertkin // <UMDF_ONLY/> A UNICODE_STRING-formatted string that contains the
27040462c92SVictor Perevertkin // name of the file to create a file object from. This parameter is
27140462c92SVictor Perevertkin // optional, and is applicable only when Type parameter is
27240462c92SVictor Perevertkin // WdfIoTargetOpenLocalTargetByFile. The driver can leave this member
27340462c92SVictor Perevertkin // unchanged if the driver does not have to create the file object
27440462c92SVictor Perevertkin // from a file name. If the driver must supply a name, the string that
27540462c92SVictor Perevertkin // the driver passes must not contain any path separator characters
27640462c92SVictor Perevertkin // ("/" or "\").
27740462c92SVictor Perevertkin //
27840462c92SVictor Perevertkin UNICODE_STRING FileName;
27940462c92SVictor Perevertkin
28040462c92SVictor Perevertkin // ========== WdfIoTargetOpenLocalTargetByFile end ==========
28140462c92SVictor Perevertkin
28240462c92SVictor Perevertkin } WDF_IO_TARGET_OPEN_PARAMS, *PWDF_IO_TARGET_OPEN_PARAMS;
28340462c92SVictor Perevertkin
28440462c92SVictor Perevertkin
28540462c92SVictor Perevertkin FORCEINLINE
286*545df815SVictor Perevertkin VOID
WDF_IO_TARGET_OPEN_PARAMS_INIT_EXISTING_DEVICE(_Out_ PWDF_IO_TARGET_OPEN_PARAMS Params,_In_ PDEVICE_OBJECT DeviceObject)28740462c92SVictor Perevertkin WDF_IO_TARGET_OPEN_PARAMS_INIT_EXISTING_DEVICE(
28840462c92SVictor Perevertkin _Out_ PWDF_IO_TARGET_OPEN_PARAMS Params,
28940462c92SVictor Perevertkin _In_ PDEVICE_OBJECT DeviceObject
29040462c92SVictor Perevertkin )
29140462c92SVictor Perevertkin {
29240462c92SVictor Perevertkin RtlZeroMemory(Params, sizeof(WDF_IO_TARGET_OPEN_PARAMS));
29340462c92SVictor Perevertkin
29440462c92SVictor Perevertkin Params->Size = sizeof(WDF_IO_TARGET_OPEN_PARAMS);
29540462c92SVictor Perevertkin Params->Type = WdfIoTargetOpenUseExistingDevice;
29640462c92SVictor Perevertkin
29740462c92SVictor Perevertkin Params->TargetDeviceObject = DeviceObject;
29840462c92SVictor Perevertkin }
29940462c92SVictor Perevertkin
30040462c92SVictor Perevertkin
30140462c92SVictor Perevertkin FORCEINLINE
302*545df815SVictor Perevertkin VOID
WDF_IO_TARGET_OPEN_PARAMS_INIT_CREATE_BY_NAME(_Out_ PWDF_IO_TARGET_OPEN_PARAMS Params,_In_ PCUNICODE_STRING TargetDeviceName,_In_ ACCESS_MASK DesiredAccess)30340462c92SVictor Perevertkin WDF_IO_TARGET_OPEN_PARAMS_INIT_CREATE_BY_NAME(
30440462c92SVictor Perevertkin _Out_ PWDF_IO_TARGET_OPEN_PARAMS Params,
30540462c92SVictor Perevertkin _In_ PCUNICODE_STRING TargetDeviceName,
30640462c92SVictor Perevertkin _In_ ACCESS_MASK DesiredAccess
30740462c92SVictor Perevertkin )
30840462c92SVictor Perevertkin {
30940462c92SVictor Perevertkin RtlZeroMemory(Params, sizeof(WDF_IO_TARGET_OPEN_PARAMS));
31040462c92SVictor Perevertkin
31140462c92SVictor Perevertkin Params->Size = sizeof(WDF_IO_TARGET_OPEN_PARAMS);
31240462c92SVictor Perevertkin Params->Type = WdfIoTargetOpenByName;
31340462c92SVictor Perevertkin
31440462c92SVictor Perevertkin RtlCopyMemory(&Params->TargetDeviceName,
31540462c92SVictor Perevertkin TargetDeviceName,
31640462c92SVictor Perevertkin sizeof(UNICODE_STRING));
31740462c92SVictor Perevertkin Params->DesiredAccess = DesiredAccess;
31840462c92SVictor Perevertkin Params->CreateOptions = FILE_NON_DIRECTORY_FILE;
31940462c92SVictor Perevertkin }
32040462c92SVictor Perevertkin
32140462c92SVictor Perevertkin FORCEINLINE
322*545df815SVictor Perevertkin VOID
WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME(_Out_ PWDF_IO_TARGET_OPEN_PARAMS Params,_In_ PCUNICODE_STRING TargetDeviceName,_In_ ACCESS_MASK DesiredAccess)32340462c92SVictor Perevertkin WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME(
32440462c92SVictor Perevertkin _Out_ PWDF_IO_TARGET_OPEN_PARAMS Params,
32540462c92SVictor Perevertkin _In_ PCUNICODE_STRING TargetDeviceName,
32640462c92SVictor Perevertkin _In_ ACCESS_MASK DesiredAccess
32740462c92SVictor Perevertkin )
32840462c92SVictor Perevertkin {
32940462c92SVictor Perevertkin WDF_IO_TARGET_OPEN_PARAMS_INIT_CREATE_BY_NAME(Params,
33040462c92SVictor Perevertkin TargetDeviceName,
33140462c92SVictor Perevertkin DesiredAccess);
33240462c92SVictor Perevertkin Params->CreateDisposition = FILE_OPEN;
33340462c92SVictor Perevertkin }
33440462c92SVictor Perevertkin
33540462c92SVictor Perevertkin
33640462c92SVictor Perevertkin
33740462c92SVictor Perevertkin
33840462c92SVictor Perevertkin FORCEINLINE
339*545df815SVictor Perevertkin VOID
WDF_IO_TARGET_OPEN_PARAMS_INIT_REOPEN(_Out_ PWDF_IO_TARGET_OPEN_PARAMS Params)34040462c92SVictor Perevertkin WDF_IO_TARGET_OPEN_PARAMS_INIT_REOPEN(
34140462c92SVictor Perevertkin _Out_ PWDF_IO_TARGET_OPEN_PARAMS Params
34240462c92SVictor Perevertkin )
34340462c92SVictor Perevertkin {
34440462c92SVictor Perevertkin RtlZeroMemory(Params, sizeof(WDF_IO_TARGET_OPEN_PARAMS));
34540462c92SVictor Perevertkin
34640462c92SVictor Perevertkin Params->Size = sizeof(WDF_IO_TARGET_OPEN_PARAMS);
34740462c92SVictor Perevertkin Params->Type = WdfIoTargetOpenReopen;
34840462c92SVictor Perevertkin }
34940462c92SVictor Perevertkin
35040462c92SVictor Perevertkin
35140462c92SVictor Perevertkin //
35240462c92SVictor Perevertkin // WDF Function: WdfIoTargetCreate
35340462c92SVictor Perevertkin //
35440462c92SVictor Perevertkin typedef
35540462c92SVictor Perevertkin _Must_inspect_result_
35640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
35740462c92SVictor Perevertkin WDFAPI
35840462c92SVictor Perevertkin NTSTATUS
359*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETCREATE)(
36040462c92SVictor Perevertkin _In_
36140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
36240462c92SVictor Perevertkin _In_
36340462c92SVictor Perevertkin WDFDEVICE Device,
36440462c92SVictor Perevertkin _In_opt_
36540462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES IoTargetAttributes,
36640462c92SVictor Perevertkin _Out_
36740462c92SVictor Perevertkin WDFIOTARGET* IoTarget
36840462c92SVictor Perevertkin );
36940462c92SVictor Perevertkin
37040462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)37140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
37240462c92SVictor Perevertkin FORCEINLINE
373*545df815SVictor Perevertkin NTSTATUS
37440462c92SVictor Perevertkin WdfIoTargetCreate(
37540462c92SVictor Perevertkin _In_
37640462c92SVictor Perevertkin WDFDEVICE Device,
37740462c92SVictor Perevertkin _In_opt_
37840462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES IoTargetAttributes,
37940462c92SVictor Perevertkin _Out_
38040462c92SVictor Perevertkin WDFIOTARGET* IoTarget
38140462c92SVictor Perevertkin )
38240462c92SVictor Perevertkin {
38340462c92SVictor Perevertkin return ((PFN_WDFIOTARGETCREATE) WdfFunctions[WdfIoTargetCreateTableIndex])(WdfDriverGlobals, Device, IoTargetAttributes, IoTarget);
38440462c92SVictor Perevertkin }
38540462c92SVictor Perevertkin
38640462c92SVictor Perevertkin //
38740462c92SVictor Perevertkin // WDF Function: WdfIoTargetOpen
38840462c92SVictor Perevertkin //
38940462c92SVictor Perevertkin typedef
39040462c92SVictor Perevertkin _Must_inspect_result_
39140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
39240462c92SVictor Perevertkin WDFAPI
39340462c92SVictor Perevertkin NTSTATUS
394*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETOPEN)(
39540462c92SVictor Perevertkin _In_
39640462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
39740462c92SVictor Perevertkin _In_
39840462c92SVictor Perevertkin WDFIOTARGET IoTarget,
39940462c92SVictor Perevertkin _In_
40040462c92SVictor Perevertkin PWDF_IO_TARGET_OPEN_PARAMS OpenParams
40140462c92SVictor Perevertkin );
40240462c92SVictor Perevertkin
40340462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)40440462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
40540462c92SVictor Perevertkin FORCEINLINE
406*545df815SVictor Perevertkin NTSTATUS
40740462c92SVictor Perevertkin WdfIoTargetOpen(
40840462c92SVictor Perevertkin _In_
40940462c92SVictor Perevertkin WDFIOTARGET IoTarget,
41040462c92SVictor Perevertkin _In_
41140462c92SVictor Perevertkin PWDF_IO_TARGET_OPEN_PARAMS OpenParams
41240462c92SVictor Perevertkin )
41340462c92SVictor Perevertkin {
41440462c92SVictor Perevertkin return ((PFN_WDFIOTARGETOPEN) WdfFunctions[WdfIoTargetOpenTableIndex])(WdfDriverGlobals, IoTarget, OpenParams);
41540462c92SVictor Perevertkin }
41640462c92SVictor Perevertkin
41740462c92SVictor Perevertkin //
41840462c92SVictor Perevertkin // WDF Function: WdfIoTargetCloseForQueryRemove
41940462c92SVictor Perevertkin //
42040462c92SVictor Perevertkin typedef
42140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
42240462c92SVictor Perevertkin WDFAPI
42340462c92SVictor Perevertkin VOID
424*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETCLOSEFORQUERYREMOVE)(
42540462c92SVictor Perevertkin _In_
42640462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
42740462c92SVictor Perevertkin _In_
42840462c92SVictor Perevertkin WDFIOTARGET IoTarget
42940462c92SVictor Perevertkin );
43040462c92SVictor Perevertkin
_IRQL_requires_max_(PASSIVE_LEVEL)43140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
43240462c92SVictor Perevertkin FORCEINLINE
433*545df815SVictor Perevertkin VOID
43440462c92SVictor Perevertkin WdfIoTargetCloseForQueryRemove(
43540462c92SVictor Perevertkin _In_
43640462c92SVictor Perevertkin WDFIOTARGET IoTarget
43740462c92SVictor Perevertkin )
43840462c92SVictor Perevertkin {
43940462c92SVictor Perevertkin ((PFN_WDFIOTARGETCLOSEFORQUERYREMOVE) WdfFunctions[WdfIoTargetCloseForQueryRemoveTableIndex])(WdfDriverGlobals, IoTarget);
44040462c92SVictor Perevertkin }
44140462c92SVictor Perevertkin
44240462c92SVictor Perevertkin //
44340462c92SVictor Perevertkin // WDF Function: WdfIoTargetClose
44440462c92SVictor Perevertkin //
44540462c92SVictor Perevertkin typedef
44640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
44740462c92SVictor Perevertkin WDFAPI
44840462c92SVictor Perevertkin VOID
449*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETCLOSE)(
45040462c92SVictor Perevertkin _In_
45140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
45240462c92SVictor Perevertkin _In_
45340462c92SVictor Perevertkin WDFIOTARGET IoTarget
45440462c92SVictor Perevertkin );
45540462c92SVictor Perevertkin
_IRQL_requires_max_(PASSIVE_LEVEL)45640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
45740462c92SVictor Perevertkin FORCEINLINE
458*545df815SVictor Perevertkin VOID
45940462c92SVictor Perevertkin WdfIoTargetClose(
46040462c92SVictor Perevertkin _In_
46140462c92SVictor Perevertkin WDFIOTARGET IoTarget
46240462c92SVictor Perevertkin )
46340462c92SVictor Perevertkin {
46440462c92SVictor Perevertkin ((PFN_WDFIOTARGETCLOSE) WdfFunctions[WdfIoTargetCloseTableIndex])(WdfDriverGlobals, IoTarget);
46540462c92SVictor Perevertkin }
46640462c92SVictor Perevertkin
46740462c92SVictor Perevertkin //
46840462c92SVictor Perevertkin // WDF Function: WdfIoTargetStart
46940462c92SVictor Perevertkin //
47040462c92SVictor Perevertkin typedef
47140462c92SVictor Perevertkin _Must_inspect_result_
47240462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
47340462c92SVictor Perevertkin WDFAPI
47440462c92SVictor Perevertkin NTSTATUS
475*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETSTART)(
47640462c92SVictor Perevertkin _In_
47740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
47840462c92SVictor Perevertkin _In_
47940462c92SVictor Perevertkin WDFIOTARGET IoTarget
48040462c92SVictor Perevertkin );
48140462c92SVictor Perevertkin
48240462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)48340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
48440462c92SVictor Perevertkin FORCEINLINE
485*545df815SVictor Perevertkin NTSTATUS
48640462c92SVictor Perevertkin WdfIoTargetStart(
48740462c92SVictor Perevertkin _In_
48840462c92SVictor Perevertkin WDFIOTARGET IoTarget
48940462c92SVictor Perevertkin )
49040462c92SVictor Perevertkin {
49140462c92SVictor Perevertkin return ((PFN_WDFIOTARGETSTART) WdfFunctions[WdfIoTargetStartTableIndex])(WdfDriverGlobals, IoTarget);
49240462c92SVictor Perevertkin }
49340462c92SVictor Perevertkin
49440462c92SVictor Perevertkin //
49540462c92SVictor Perevertkin // WDF Function: WdfIoTargetStop
49640462c92SVictor Perevertkin //
49740462c92SVictor Perevertkin typedef
49840462c92SVictor Perevertkin _When_(Action == 3, _IRQL_requires_max_(DISPATCH_LEVEL))
49940462c92SVictor Perevertkin _When_(Action == 0 || Action == 1 || Action == 2, _IRQL_requires_max_(PASSIVE_LEVEL))
50040462c92SVictor Perevertkin WDFAPI
50140462c92SVictor Perevertkin VOID
502*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETSTOP)(
50340462c92SVictor Perevertkin _In_
50440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
50540462c92SVictor Perevertkin _In_
50640462c92SVictor Perevertkin WDFIOTARGET IoTarget,
50740462c92SVictor Perevertkin _In_
50840462c92SVictor Perevertkin _Strict_type_match_
50940462c92SVictor Perevertkin WDF_IO_TARGET_SENT_IO_ACTION Action
51040462c92SVictor Perevertkin );
51140462c92SVictor Perevertkin
51240462c92SVictor Perevertkin _When_(Action == 3, _IRQL_requires_max_(DISPATCH_LEVEL))
51340462c92SVictor Perevertkin _When_(Action == 0 || Action == 1 || Action == 2, _IRQL_requires_max_(PASSIVE_LEVEL))
51440462c92SVictor Perevertkin FORCEINLINE
515*545df815SVictor Perevertkin VOID
WdfIoTargetStop(_In_ WDFIOTARGET IoTarget,_In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action)51640462c92SVictor Perevertkin WdfIoTargetStop(
51740462c92SVictor Perevertkin _In_
51840462c92SVictor Perevertkin WDFIOTARGET IoTarget,
51940462c92SVictor Perevertkin _In_
52040462c92SVictor Perevertkin _Strict_type_match_
52140462c92SVictor Perevertkin WDF_IO_TARGET_SENT_IO_ACTION Action
52240462c92SVictor Perevertkin )
52340462c92SVictor Perevertkin {
52440462c92SVictor Perevertkin ((PFN_WDFIOTARGETSTOP) WdfFunctions[WdfIoTargetStopTableIndex])(WdfDriverGlobals, IoTarget, Action);
52540462c92SVictor Perevertkin }
52640462c92SVictor Perevertkin
52740462c92SVictor Perevertkin //
52840462c92SVictor Perevertkin // WDF Function: WdfIoTargetPurge
52940462c92SVictor Perevertkin //
53040462c92SVictor Perevertkin typedef
53140462c92SVictor Perevertkin _When_(Action == 2, _IRQL_requires_max_(DISPATCH_LEVEL))
53240462c92SVictor Perevertkin _When_(Action == 0 || Action == 1, _IRQL_requires_max_(PASSIVE_LEVEL))
53340462c92SVictor Perevertkin WDFAPI
53440462c92SVictor Perevertkin VOID
535*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETPURGE)(
53640462c92SVictor Perevertkin _In_
53740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
53840462c92SVictor Perevertkin _In_
53940462c92SVictor Perevertkin WDFIOTARGET IoTarget,
54040462c92SVictor Perevertkin _In_
54140462c92SVictor Perevertkin _Strict_type_match_
54240462c92SVictor Perevertkin WDF_IO_TARGET_PURGE_IO_ACTION Action
54340462c92SVictor Perevertkin );
54440462c92SVictor Perevertkin
54540462c92SVictor Perevertkin _When_(Action == 2, _IRQL_requires_max_(DISPATCH_LEVEL))
54640462c92SVictor Perevertkin _When_(Action == 0 || Action == 1, _IRQL_requires_max_(PASSIVE_LEVEL))
54740462c92SVictor Perevertkin FORCEINLINE
548*545df815SVictor Perevertkin VOID
WdfIoTargetPurge(_In_ WDFIOTARGET IoTarget,_In_ _Strict_type_match_ WDF_IO_TARGET_PURGE_IO_ACTION Action)54940462c92SVictor Perevertkin WdfIoTargetPurge(
55040462c92SVictor Perevertkin _In_
55140462c92SVictor Perevertkin WDFIOTARGET IoTarget,
55240462c92SVictor Perevertkin _In_
55340462c92SVictor Perevertkin _Strict_type_match_
55440462c92SVictor Perevertkin WDF_IO_TARGET_PURGE_IO_ACTION Action
55540462c92SVictor Perevertkin )
55640462c92SVictor Perevertkin {
55740462c92SVictor Perevertkin ((PFN_WDFIOTARGETPURGE) WdfFunctions[WdfIoTargetPurgeTableIndex])(WdfDriverGlobals, IoTarget, Action);
55840462c92SVictor Perevertkin }
55940462c92SVictor Perevertkin
56040462c92SVictor Perevertkin //
56140462c92SVictor Perevertkin // WDF Function: WdfIoTargetGetState
56240462c92SVictor Perevertkin //
56340462c92SVictor Perevertkin typedef
56440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
56540462c92SVictor Perevertkin WDFAPI
56640462c92SVictor Perevertkin WDF_IO_TARGET_STATE
567*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETGETSTATE)(
56840462c92SVictor Perevertkin _In_
56940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
57040462c92SVictor Perevertkin _In_
57140462c92SVictor Perevertkin WDFIOTARGET IoTarget
57240462c92SVictor Perevertkin );
57340462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)57440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
57540462c92SVictor Perevertkin FORCEINLINE
576*545df815SVictor Perevertkin WDF_IO_TARGET_STATE
57740462c92SVictor Perevertkin WdfIoTargetGetState(
57840462c92SVictor Perevertkin _In_
57940462c92SVictor Perevertkin WDFIOTARGET IoTarget
58040462c92SVictor Perevertkin )
58140462c92SVictor Perevertkin {
58240462c92SVictor Perevertkin return ((PFN_WDFIOTARGETGETSTATE) WdfFunctions[WdfIoTargetGetStateTableIndex])(WdfDriverGlobals, IoTarget);
58340462c92SVictor Perevertkin }
58440462c92SVictor Perevertkin
58540462c92SVictor Perevertkin //
58640462c92SVictor Perevertkin // WDF Function: WdfIoTargetGetDevice
58740462c92SVictor Perevertkin //
58840462c92SVictor Perevertkin typedef
58940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
59040462c92SVictor Perevertkin WDFAPI
59140462c92SVictor Perevertkin WDFDEVICE
592*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETGETDEVICE)(
59340462c92SVictor Perevertkin _In_
59440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
59540462c92SVictor Perevertkin _In_
59640462c92SVictor Perevertkin WDFIOTARGET IoTarget
59740462c92SVictor Perevertkin );
59840462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)59940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
60040462c92SVictor Perevertkin FORCEINLINE
601*545df815SVictor Perevertkin WDFDEVICE
60240462c92SVictor Perevertkin WdfIoTargetGetDevice(
60340462c92SVictor Perevertkin _In_
60440462c92SVictor Perevertkin WDFIOTARGET IoTarget
60540462c92SVictor Perevertkin )
60640462c92SVictor Perevertkin {
60740462c92SVictor Perevertkin return ((PFN_WDFIOTARGETGETDEVICE) WdfFunctions[WdfIoTargetGetDeviceTableIndex])(WdfDriverGlobals, IoTarget);
60840462c92SVictor Perevertkin }
60940462c92SVictor Perevertkin
61040462c92SVictor Perevertkin //
61140462c92SVictor Perevertkin // WDF Function: WdfIoTargetQueryTargetProperty
61240462c92SVictor Perevertkin //
61340462c92SVictor Perevertkin typedef
61440462c92SVictor Perevertkin _Must_inspect_result_
61540462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
61640462c92SVictor Perevertkin WDFAPI
61740462c92SVictor Perevertkin NTSTATUS
618*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETQUERYTARGETPROPERTY)(
61940462c92SVictor Perevertkin _In_
62040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
62140462c92SVictor Perevertkin _In_
62240462c92SVictor Perevertkin WDFIOTARGET IoTarget,
62340462c92SVictor Perevertkin _In_
62440462c92SVictor Perevertkin DEVICE_REGISTRY_PROPERTY DeviceProperty,
62540462c92SVictor Perevertkin _In_
62640462c92SVictor Perevertkin ULONG BufferLength,
62740462c92SVictor Perevertkin _When_(BufferLength != 0, _Out_writes_bytes_to_opt_(BufferLength, *ResultLength))
62840462c92SVictor Perevertkin _When_(BufferLength == 0, _Out_opt_)
62940462c92SVictor Perevertkin PVOID PropertyBuffer,
63040462c92SVictor Perevertkin _Deref_out_range_(<=,BufferLength)
63140462c92SVictor Perevertkin PULONG ResultLength
63240462c92SVictor Perevertkin );
63340462c92SVictor Perevertkin
63440462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)63540462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
63640462c92SVictor Perevertkin FORCEINLINE
637*545df815SVictor Perevertkin NTSTATUS
63840462c92SVictor Perevertkin WdfIoTargetQueryTargetProperty(
63940462c92SVictor Perevertkin _In_
64040462c92SVictor Perevertkin WDFIOTARGET IoTarget,
64140462c92SVictor Perevertkin _In_
64240462c92SVictor Perevertkin DEVICE_REGISTRY_PROPERTY DeviceProperty,
64340462c92SVictor Perevertkin _In_
64440462c92SVictor Perevertkin ULONG BufferLength,
64540462c92SVictor Perevertkin _When_(BufferLength != 0, _Out_writes_bytes_to_opt_(BufferLength, *ResultLength))
64640462c92SVictor Perevertkin _When_(BufferLength == 0, _Out_opt_)
64740462c92SVictor Perevertkin PVOID PropertyBuffer,
64840462c92SVictor Perevertkin _Deref_out_range_(<=,BufferLength)
64940462c92SVictor Perevertkin PULONG ResultLength
65040462c92SVictor Perevertkin )
65140462c92SVictor Perevertkin {
65240462c92SVictor Perevertkin return ((PFN_WDFIOTARGETQUERYTARGETPROPERTY) WdfFunctions[WdfIoTargetQueryTargetPropertyTableIndex])(WdfDriverGlobals, IoTarget, DeviceProperty, BufferLength, PropertyBuffer, ResultLength);
65340462c92SVictor Perevertkin }
65440462c92SVictor Perevertkin
65540462c92SVictor Perevertkin //
65640462c92SVictor Perevertkin // WDF Function: WdfIoTargetAllocAndQueryTargetProperty
65740462c92SVictor Perevertkin //
65840462c92SVictor Perevertkin typedef
65940462c92SVictor Perevertkin _Must_inspect_result_
66040462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
66140462c92SVictor Perevertkin WDFAPI
66240462c92SVictor Perevertkin NTSTATUS
663*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETALLOCANDQUERYTARGETPROPERTY)(
66440462c92SVictor Perevertkin _In_
66540462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
66640462c92SVictor Perevertkin _In_
66740462c92SVictor Perevertkin WDFIOTARGET IoTarget,
66840462c92SVictor Perevertkin _In_
66940462c92SVictor Perevertkin DEVICE_REGISTRY_PROPERTY DeviceProperty,
67040462c92SVictor Perevertkin _In_
67140462c92SVictor Perevertkin _Strict_type_match_
67240462c92SVictor Perevertkin POOL_TYPE PoolType,
67340462c92SVictor Perevertkin _In_opt_
67440462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes,
67540462c92SVictor Perevertkin _Out_
67640462c92SVictor Perevertkin WDFMEMORY* PropertyMemory
67740462c92SVictor Perevertkin );
67840462c92SVictor Perevertkin
67940462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)68040462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
68140462c92SVictor Perevertkin FORCEINLINE
682*545df815SVictor Perevertkin NTSTATUS
68340462c92SVictor Perevertkin WdfIoTargetAllocAndQueryTargetProperty(
68440462c92SVictor Perevertkin _In_
68540462c92SVictor Perevertkin WDFIOTARGET IoTarget,
68640462c92SVictor Perevertkin _In_
68740462c92SVictor Perevertkin DEVICE_REGISTRY_PROPERTY DeviceProperty,
68840462c92SVictor Perevertkin _In_
68940462c92SVictor Perevertkin _Strict_type_match_
69040462c92SVictor Perevertkin POOL_TYPE PoolType,
69140462c92SVictor Perevertkin _In_opt_
69240462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes,
69340462c92SVictor Perevertkin _Out_
69440462c92SVictor Perevertkin WDFMEMORY* PropertyMemory
69540462c92SVictor Perevertkin )
69640462c92SVictor Perevertkin {
69740462c92SVictor Perevertkin return ((PFN_WDFIOTARGETALLOCANDQUERYTARGETPROPERTY) WdfFunctions[WdfIoTargetAllocAndQueryTargetPropertyTableIndex])(WdfDriverGlobals, IoTarget, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory);
69840462c92SVictor Perevertkin }
69940462c92SVictor Perevertkin
70040462c92SVictor Perevertkin //
70140462c92SVictor Perevertkin // WDF Function: WdfIoTargetQueryForInterface
70240462c92SVictor Perevertkin //
70340462c92SVictor Perevertkin typedef
70440462c92SVictor Perevertkin _Must_inspect_result_
70540462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
70640462c92SVictor Perevertkin WDFAPI
70740462c92SVictor Perevertkin NTSTATUS
708*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETQUERYFORINTERFACE)(
70940462c92SVictor Perevertkin _In_
71040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
71140462c92SVictor Perevertkin _In_
71240462c92SVictor Perevertkin WDFIOTARGET IoTarget,
71340462c92SVictor Perevertkin _In_
71440462c92SVictor Perevertkin LPCGUID InterfaceType,
71540462c92SVictor Perevertkin _Out_
71640462c92SVictor Perevertkin PINTERFACE Interface,
71740462c92SVictor Perevertkin _In_
71840462c92SVictor Perevertkin USHORT Size,
71940462c92SVictor Perevertkin _In_
72040462c92SVictor Perevertkin USHORT Version,
72140462c92SVictor Perevertkin _In_opt_
72240462c92SVictor Perevertkin PVOID InterfaceSpecificData
72340462c92SVictor Perevertkin );
72440462c92SVictor Perevertkin
72540462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)72640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
72740462c92SVictor Perevertkin FORCEINLINE
728*545df815SVictor Perevertkin NTSTATUS
72940462c92SVictor Perevertkin WdfIoTargetQueryForInterface(
73040462c92SVictor Perevertkin _In_
73140462c92SVictor Perevertkin WDFIOTARGET IoTarget,
73240462c92SVictor Perevertkin _In_
73340462c92SVictor Perevertkin LPCGUID InterfaceType,
73440462c92SVictor Perevertkin _Out_
73540462c92SVictor Perevertkin PINTERFACE Interface,
73640462c92SVictor Perevertkin _In_
73740462c92SVictor Perevertkin USHORT Size,
73840462c92SVictor Perevertkin _In_
73940462c92SVictor Perevertkin USHORT Version,
74040462c92SVictor Perevertkin _In_opt_
74140462c92SVictor Perevertkin PVOID InterfaceSpecificData
74240462c92SVictor Perevertkin )
74340462c92SVictor Perevertkin {
74440462c92SVictor Perevertkin return ((PFN_WDFIOTARGETQUERYFORINTERFACE) WdfFunctions[WdfIoTargetQueryForInterfaceTableIndex])(WdfDriverGlobals, IoTarget, InterfaceType, Interface, Size, Version, InterfaceSpecificData);
74540462c92SVictor Perevertkin }
74640462c92SVictor Perevertkin
74740462c92SVictor Perevertkin //
74840462c92SVictor Perevertkin // WDF Function: WdfIoTargetWdmGetTargetDeviceObject
74940462c92SVictor Perevertkin //
75040462c92SVictor Perevertkin typedef
75140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
75240462c92SVictor Perevertkin WDFAPI
75340462c92SVictor Perevertkin PDEVICE_OBJECT
754*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETWDMGETTARGETDEVICEOBJECT)(
75540462c92SVictor Perevertkin _In_
75640462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
75740462c92SVictor Perevertkin _In_
75840462c92SVictor Perevertkin WDFIOTARGET IoTarget
75940462c92SVictor Perevertkin );
76040462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)76140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
76240462c92SVictor Perevertkin FORCEINLINE
763*545df815SVictor Perevertkin PDEVICE_OBJECT
76440462c92SVictor Perevertkin WdfIoTargetWdmGetTargetDeviceObject(
76540462c92SVictor Perevertkin _In_
76640462c92SVictor Perevertkin WDFIOTARGET IoTarget
76740462c92SVictor Perevertkin )
76840462c92SVictor Perevertkin {
76940462c92SVictor Perevertkin return ((PFN_WDFIOTARGETWDMGETTARGETDEVICEOBJECT) WdfFunctions[WdfIoTargetWdmGetTargetDeviceObjectTableIndex])(WdfDriverGlobals, IoTarget);
77040462c92SVictor Perevertkin }
77140462c92SVictor Perevertkin
77240462c92SVictor Perevertkin //
77340462c92SVictor Perevertkin // WDF Function: WdfIoTargetWdmGetTargetPhysicalDevice
77440462c92SVictor Perevertkin //
77540462c92SVictor Perevertkin typedef
77640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
77740462c92SVictor Perevertkin WDFAPI
77840462c92SVictor Perevertkin PDEVICE_OBJECT
779*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETWDMGETTARGETPHYSICALDEVICE)(
78040462c92SVictor Perevertkin _In_
78140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
78240462c92SVictor Perevertkin _In_
78340462c92SVictor Perevertkin WDFIOTARGET IoTarget
78440462c92SVictor Perevertkin );
78540462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)78640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
78740462c92SVictor Perevertkin FORCEINLINE
788*545df815SVictor Perevertkin PDEVICE_OBJECT
78940462c92SVictor Perevertkin WdfIoTargetWdmGetTargetPhysicalDevice(
79040462c92SVictor Perevertkin _In_
79140462c92SVictor Perevertkin WDFIOTARGET IoTarget
79240462c92SVictor Perevertkin )
79340462c92SVictor Perevertkin {
79440462c92SVictor Perevertkin return ((PFN_WDFIOTARGETWDMGETTARGETPHYSICALDEVICE) WdfFunctions[WdfIoTargetWdmGetTargetPhysicalDeviceTableIndex])(WdfDriverGlobals, IoTarget);
79540462c92SVictor Perevertkin }
79640462c92SVictor Perevertkin
79740462c92SVictor Perevertkin //
79840462c92SVictor Perevertkin // WDF Function: WdfIoTargetWdmGetTargetFileObject
79940462c92SVictor Perevertkin //
80040462c92SVictor Perevertkin typedef
80140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
80240462c92SVictor Perevertkin WDFAPI
80340462c92SVictor Perevertkin PFILE_OBJECT
804*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETWDMGETTARGETFILEOBJECT)(
80540462c92SVictor Perevertkin _In_
80640462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
80740462c92SVictor Perevertkin _In_
80840462c92SVictor Perevertkin WDFIOTARGET IoTarget
80940462c92SVictor Perevertkin );
81040462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)81140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
81240462c92SVictor Perevertkin FORCEINLINE
813*545df815SVictor Perevertkin PFILE_OBJECT
81440462c92SVictor Perevertkin WdfIoTargetWdmGetTargetFileObject(
81540462c92SVictor Perevertkin _In_
81640462c92SVictor Perevertkin WDFIOTARGET IoTarget
81740462c92SVictor Perevertkin )
81840462c92SVictor Perevertkin {
81940462c92SVictor Perevertkin return ((PFN_WDFIOTARGETWDMGETTARGETFILEOBJECT) WdfFunctions[WdfIoTargetWdmGetTargetFileObjectTableIndex])(WdfDriverGlobals, IoTarget);
82040462c92SVictor Perevertkin }
82140462c92SVictor Perevertkin
82240462c92SVictor Perevertkin //
82340462c92SVictor Perevertkin // WDF Function: WdfIoTargetWdmGetTargetFileHandle
82440462c92SVictor Perevertkin //
82540462c92SVictor Perevertkin typedef
82640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
82740462c92SVictor Perevertkin WDFAPI
82840462c92SVictor Perevertkin HANDLE
829*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETWDMGETTARGETFILEHANDLE)(
83040462c92SVictor Perevertkin _In_
83140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
83240462c92SVictor Perevertkin _In_
83340462c92SVictor Perevertkin WDFIOTARGET IoTarget
83440462c92SVictor Perevertkin );
83540462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)83640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
83740462c92SVictor Perevertkin FORCEINLINE
838*545df815SVictor Perevertkin HANDLE
83940462c92SVictor Perevertkin WdfIoTargetWdmGetTargetFileHandle(
84040462c92SVictor Perevertkin _In_
84140462c92SVictor Perevertkin WDFIOTARGET IoTarget
84240462c92SVictor Perevertkin )
84340462c92SVictor Perevertkin {
84440462c92SVictor Perevertkin return ((PFN_WDFIOTARGETWDMGETTARGETFILEHANDLE) WdfFunctions[WdfIoTargetWdmGetTargetFileHandleTableIndex])(WdfDriverGlobals, IoTarget);
84540462c92SVictor Perevertkin }
84640462c92SVictor Perevertkin
84740462c92SVictor Perevertkin //
84840462c92SVictor Perevertkin // WDF Function: WdfIoTargetSendReadSynchronously
84940462c92SVictor Perevertkin //
85040462c92SVictor Perevertkin typedef
85140462c92SVictor Perevertkin _Must_inspect_result_
85240462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
85340462c92SVictor Perevertkin WDFAPI
85440462c92SVictor Perevertkin NTSTATUS
855*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETSENDREADSYNCHRONOUSLY)(
85640462c92SVictor Perevertkin _In_
85740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
85840462c92SVictor Perevertkin _In_
85940462c92SVictor Perevertkin WDFIOTARGET IoTarget,
86040462c92SVictor Perevertkin _In_opt_
86140462c92SVictor Perevertkin WDFREQUEST Request,
86240462c92SVictor Perevertkin _In_opt_
86340462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OutputBuffer,
86440462c92SVictor Perevertkin _In_opt_
86540462c92SVictor Perevertkin PLONGLONG DeviceOffset,
86640462c92SVictor Perevertkin _In_opt_
86740462c92SVictor Perevertkin PWDF_REQUEST_SEND_OPTIONS RequestOptions,
86840462c92SVictor Perevertkin _Out_opt_
86940462c92SVictor Perevertkin PULONG_PTR BytesRead
87040462c92SVictor Perevertkin );
87140462c92SVictor Perevertkin
87240462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)87340462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
87440462c92SVictor Perevertkin FORCEINLINE
875*545df815SVictor Perevertkin NTSTATUS
87640462c92SVictor Perevertkin WdfIoTargetSendReadSynchronously(
87740462c92SVictor Perevertkin _In_
87840462c92SVictor Perevertkin WDFIOTARGET IoTarget,
87940462c92SVictor Perevertkin _In_opt_
88040462c92SVictor Perevertkin WDFREQUEST Request,
88140462c92SVictor Perevertkin _In_opt_
88240462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OutputBuffer,
88340462c92SVictor Perevertkin _In_opt_
88440462c92SVictor Perevertkin PLONGLONG DeviceOffset,
88540462c92SVictor Perevertkin _In_opt_
88640462c92SVictor Perevertkin PWDF_REQUEST_SEND_OPTIONS RequestOptions,
88740462c92SVictor Perevertkin _Out_opt_
88840462c92SVictor Perevertkin PULONG_PTR BytesRead
88940462c92SVictor Perevertkin )
89040462c92SVictor Perevertkin {
89140462c92SVictor Perevertkin return ((PFN_WDFIOTARGETSENDREADSYNCHRONOUSLY) WdfFunctions[WdfIoTargetSendReadSynchronouslyTableIndex])(WdfDriverGlobals, IoTarget, Request, OutputBuffer, DeviceOffset, RequestOptions, BytesRead);
89240462c92SVictor Perevertkin }
89340462c92SVictor Perevertkin
89440462c92SVictor Perevertkin //
89540462c92SVictor Perevertkin // WDF Function: WdfIoTargetFormatRequestForRead
89640462c92SVictor Perevertkin //
89740462c92SVictor Perevertkin typedef
89840462c92SVictor Perevertkin _Must_inspect_result_
89940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
90040462c92SVictor Perevertkin WDFAPI
90140462c92SVictor Perevertkin NTSTATUS
902*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETFORMATREQUESTFORREAD)(
90340462c92SVictor Perevertkin _In_
90440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
90540462c92SVictor Perevertkin _In_
90640462c92SVictor Perevertkin WDFIOTARGET IoTarget,
90740462c92SVictor Perevertkin _In_
90840462c92SVictor Perevertkin WDFREQUEST Request,
90940462c92SVictor Perevertkin _In_opt_
91040462c92SVictor Perevertkin WDFMEMORY OutputBuffer,
91140462c92SVictor Perevertkin _In_opt_
91240462c92SVictor Perevertkin PWDFMEMORY_OFFSET OutputBufferOffset,
91340462c92SVictor Perevertkin _In_opt_
91440462c92SVictor Perevertkin PLONGLONG DeviceOffset
91540462c92SVictor Perevertkin );
91640462c92SVictor Perevertkin
91740462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)91840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
91940462c92SVictor Perevertkin FORCEINLINE
920*545df815SVictor Perevertkin NTSTATUS
92140462c92SVictor Perevertkin WdfIoTargetFormatRequestForRead(
92240462c92SVictor Perevertkin _In_
92340462c92SVictor Perevertkin WDFIOTARGET IoTarget,
92440462c92SVictor Perevertkin _In_
92540462c92SVictor Perevertkin WDFREQUEST Request,
92640462c92SVictor Perevertkin _In_opt_
92740462c92SVictor Perevertkin WDFMEMORY OutputBuffer,
92840462c92SVictor Perevertkin _In_opt_
92940462c92SVictor Perevertkin PWDFMEMORY_OFFSET OutputBufferOffset,
93040462c92SVictor Perevertkin _In_opt_
93140462c92SVictor Perevertkin PLONGLONG DeviceOffset
93240462c92SVictor Perevertkin )
93340462c92SVictor Perevertkin {
93440462c92SVictor Perevertkin return ((PFN_WDFIOTARGETFORMATREQUESTFORREAD) WdfFunctions[WdfIoTargetFormatRequestForReadTableIndex])(WdfDriverGlobals, IoTarget, Request, OutputBuffer, OutputBufferOffset, DeviceOffset);
93540462c92SVictor Perevertkin }
93640462c92SVictor Perevertkin
93740462c92SVictor Perevertkin //
93840462c92SVictor Perevertkin // WDF Function: WdfIoTargetSendWriteSynchronously
93940462c92SVictor Perevertkin //
94040462c92SVictor Perevertkin typedef
94140462c92SVictor Perevertkin _Must_inspect_result_
94240462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
94340462c92SVictor Perevertkin WDFAPI
94440462c92SVictor Perevertkin NTSTATUS
945*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETSENDWRITESYNCHRONOUSLY)(
94640462c92SVictor Perevertkin _In_
94740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
94840462c92SVictor Perevertkin _In_
94940462c92SVictor Perevertkin WDFIOTARGET IoTarget,
95040462c92SVictor Perevertkin _In_opt_
95140462c92SVictor Perevertkin WDFREQUEST Request,
95240462c92SVictor Perevertkin _In_opt_
95340462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR InputBuffer,
95440462c92SVictor Perevertkin _In_opt_
95540462c92SVictor Perevertkin PLONGLONG DeviceOffset,
95640462c92SVictor Perevertkin _In_opt_
95740462c92SVictor Perevertkin PWDF_REQUEST_SEND_OPTIONS RequestOptions,
95840462c92SVictor Perevertkin _Out_opt_
95940462c92SVictor Perevertkin PULONG_PTR BytesWritten
96040462c92SVictor Perevertkin );
96140462c92SVictor Perevertkin
96240462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)96340462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
96440462c92SVictor Perevertkin FORCEINLINE
965*545df815SVictor Perevertkin NTSTATUS
96640462c92SVictor Perevertkin WdfIoTargetSendWriteSynchronously(
96740462c92SVictor Perevertkin _In_
96840462c92SVictor Perevertkin WDFIOTARGET IoTarget,
96940462c92SVictor Perevertkin _In_opt_
97040462c92SVictor Perevertkin WDFREQUEST Request,
97140462c92SVictor Perevertkin _In_opt_
97240462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR InputBuffer,
97340462c92SVictor Perevertkin _In_opt_
97440462c92SVictor Perevertkin PLONGLONG DeviceOffset,
97540462c92SVictor Perevertkin _In_opt_
97640462c92SVictor Perevertkin PWDF_REQUEST_SEND_OPTIONS RequestOptions,
97740462c92SVictor Perevertkin _Out_opt_
97840462c92SVictor Perevertkin PULONG_PTR BytesWritten
97940462c92SVictor Perevertkin )
98040462c92SVictor Perevertkin {
98140462c92SVictor Perevertkin return ((PFN_WDFIOTARGETSENDWRITESYNCHRONOUSLY) WdfFunctions[WdfIoTargetSendWriteSynchronouslyTableIndex])(WdfDriverGlobals, IoTarget, Request, InputBuffer, DeviceOffset, RequestOptions, BytesWritten);
98240462c92SVictor Perevertkin }
98340462c92SVictor Perevertkin
98440462c92SVictor Perevertkin //
98540462c92SVictor Perevertkin // WDF Function: WdfIoTargetFormatRequestForWrite
98640462c92SVictor Perevertkin //
98740462c92SVictor Perevertkin typedef
98840462c92SVictor Perevertkin _Must_inspect_result_
98940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
99040462c92SVictor Perevertkin WDFAPI
99140462c92SVictor Perevertkin NTSTATUS
992*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETFORMATREQUESTFORWRITE)(
99340462c92SVictor Perevertkin _In_
99440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
99540462c92SVictor Perevertkin _In_
99640462c92SVictor Perevertkin WDFIOTARGET IoTarget,
99740462c92SVictor Perevertkin _In_
99840462c92SVictor Perevertkin WDFREQUEST Request,
99940462c92SVictor Perevertkin _In_opt_
100040462c92SVictor Perevertkin WDFMEMORY InputBuffer,
100140462c92SVictor Perevertkin _In_opt_
100240462c92SVictor Perevertkin PWDFMEMORY_OFFSET InputBufferOffset,
100340462c92SVictor Perevertkin _In_opt_
100440462c92SVictor Perevertkin PLONGLONG DeviceOffset
100540462c92SVictor Perevertkin );
100640462c92SVictor Perevertkin
100740462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)100840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
100940462c92SVictor Perevertkin FORCEINLINE
1010*545df815SVictor Perevertkin NTSTATUS
101140462c92SVictor Perevertkin WdfIoTargetFormatRequestForWrite(
101240462c92SVictor Perevertkin _In_
101340462c92SVictor Perevertkin WDFIOTARGET IoTarget,
101440462c92SVictor Perevertkin _In_
101540462c92SVictor Perevertkin WDFREQUEST Request,
101640462c92SVictor Perevertkin _In_opt_
101740462c92SVictor Perevertkin WDFMEMORY InputBuffer,
101840462c92SVictor Perevertkin _In_opt_
101940462c92SVictor Perevertkin PWDFMEMORY_OFFSET InputBufferOffset,
102040462c92SVictor Perevertkin _In_opt_
102140462c92SVictor Perevertkin PLONGLONG DeviceOffset
102240462c92SVictor Perevertkin )
102340462c92SVictor Perevertkin {
102440462c92SVictor Perevertkin return ((PFN_WDFIOTARGETFORMATREQUESTFORWRITE) WdfFunctions[WdfIoTargetFormatRequestForWriteTableIndex])(WdfDriverGlobals, IoTarget, Request, InputBuffer, InputBufferOffset, DeviceOffset);
102540462c92SVictor Perevertkin }
102640462c92SVictor Perevertkin
102740462c92SVictor Perevertkin //
102840462c92SVictor Perevertkin // WDF Function: WdfIoTargetSendIoctlSynchronously
102940462c92SVictor Perevertkin //
103040462c92SVictor Perevertkin typedef
103140462c92SVictor Perevertkin _Must_inspect_result_
103240462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
103340462c92SVictor Perevertkin WDFAPI
103440462c92SVictor Perevertkin NTSTATUS
1035*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETSENDIOCTLSYNCHRONOUSLY)(
103640462c92SVictor Perevertkin _In_
103740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
103840462c92SVictor Perevertkin _In_
103940462c92SVictor Perevertkin WDFIOTARGET IoTarget,
104040462c92SVictor Perevertkin _In_opt_
104140462c92SVictor Perevertkin WDFREQUEST Request,
104240462c92SVictor Perevertkin _In_
104340462c92SVictor Perevertkin ULONG IoctlCode,
104440462c92SVictor Perevertkin _In_opt_
104540462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR InputBuffer,
104640462c92SVictor Perevertkin _In_opt_
104740462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OutputBuffer,
104840462c92SVictor Perevertkin _In_opt_
104940462c92SVictor Perevertkin PWDF_REQUEST_SEND_OPTIONS RequestOptions,
105040462c92SVictor Perevertkin _Out_opt_
105140462c92SVictor Perevertkin PULONG_PTR BytesReturned
105240462c92SVictor Perevertkin );
105340462c92SVictor Perevertkin
105440462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)105540462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
105640462c92SVictor Perevertkin FORCEINLINE
1057*545df815SVictor Perevertkin NTSTATUS
105840462c92SVictor Perevertkin WdfIoTargetSendIoctlSynchronously(
105940462c92SVictor Perevertkin _In_
106040462c92SVictor Perevertkin WDFIOTARGET IoTarget,
106140462c92SVictor Perevertkin _In_opt_
106240462c92SVictor Perevertkin WDFREQUEST Request,
106340462c92SVictor Perevertkin _In_
106440462c92SVictor Perevertkin ULONG IoctlCode,
106540462c92SVictor Perevertkin _In_opt_
106640462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR InputBuffer,
106740462c92SVictor Perevertkin _In_opt_
106840462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OutputBuffer,
106940462c92SVictor Perevertkin _In_opt_
107040462c92SVictor Perevertkin PWDF_REQUEST_SEND_OPTIONS RequestOptions,
107140462c92SVictor Perevertkin _Out_opt_
107240462c92SVictor Perevertkin PULONG_PTR BytesReturned
107340462c92SVictor Perevertkin )
107440462c92SVictor Perevertkin {
107540462c92SVictor Perevertkin return ((PFN_WDFIOTARGETSENDIOCTLSYNCHRONOUSLY) WdfFunctions[WdfIoTargetSendIoctlSynchronouslyTableIndex])(WdfDriverGlobals, IoTarget, Request, IoctlCode, InputBuffer, OutputBuffer, RequestOptions, BytesReturned);
107640462c92SVictor Perevertkin }
107740462c92SVictor Perevertkin
107840462c92SVictor Perevertkin //
107940462c92SVictor Perevertkin // WDF Function: WdfIoTargetFormatRequestForIoctl
108040462c92SVictor Perevertkin //
108140462c92SVictor Perevertkin typedef
108240462c92SVictor Perevertkin _Must_inspect_result_
108340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
108440462c92SVictor Perevertkin WDFAPI
108540462c92SVictor Perevertkin NTSTATUS
1086*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETFORMATREQUESTFORIOCTL)(
108740462c92SVictor Perevertkin _In_
108840462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
108940462c92SVictor Perevertkin _In_
109040462c92SVictor Perevertkin WDFIOTARGET IoTarget,
109140462c92SVictor Perevertkin _In_
109240462c92SVictor Perevertkin WDFREQUEST Request,
109340462c92SVictor Perevertkin _In_
109440462c92SVictor Perevertkin ULONG IoctlCode,
109540462c92SVictor Perevertkin _In_opt_
109640462c92SVictor Perevertkin WDFMEMORY InputBuffer,
109740462c92SVictor Perevertkin _In_opt_
109840462c92SVictor Perevertkin PWDFMEMORY_OFFSET InputBufferOffset,
109940462c92SVictor Perevertkin _In_opt_
110040462c92SVictor Perevertkin WDFMEMORY OutputBuffer,
110140462c92SVictor Perevertkin _In_opt_
110240462c92SVictor Perevertkin PWDFMEMORY_OFFSET OutputBufferOffset
110340462c92SVictor Perevertkin );
110440462c92SVictor Perevertkin
110540462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)110640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
110740462c92SVictor Perevertkin FORCEINLINE
1108*545df815SVictor Perevertkin NTSTATUS
110940462c92SVictor Perevertkin WdfIoTargetFormatRequestForIoctl(
111040462c92SVictor Perevertkin _In_
111140462c92SVictor Perevertkin WDFIOTARGET IoTarget,
111240462c92SVictor Perevertkin _In_
111340462c92SVictor Perevertkin WDFREQUEST Request,
111440462c92SVictor Perevertkin _In_
111540462c92SVictor Perevertkin ULONG IoctlCode,
111640462c92SVictor Perevertkin _In_opt_
111740462c92SVictor Perevertkin WDFMEMORY InputBuffer,
111840462c92SVictor Perevertkin _In_opt_
111940462c92SVictor Perevertkin PWDFMEMORY_OFFSET InputBufferOffset,
112040462c92SVictor Perevertkin _In_opt_
112140462c92SVictor Perevertkin WDFMEMORY OutputBuffer,
112240462c92SVictor Perevertkin _In_opt_
112340462c92SVictor Perevertkin PWDFMEMORY_OFFSET OutputBufferOffset
112440462c92SVictor Perevertkin )
112540462c92SVictor Perevertkin {
112640462c92SVictor Perevertkin return ((PFN_WDFIOTARGETFORMATREQUESTFORIOCTL) WdfFunctions[WdfIoTargetFormatRequestForIoctlTableIndex])(WdfDriverGlobals, IoTarget, Request, IoctlCode, InputBuffer, InputBufferOffset, OutputBuffer, OutputBufferOffset);
112740462c92SVictor Perevertkin }
112840462c92SVictor Perevertkin
112940462c92SVictor Perevertkin //
113040462c92SVictor Perevertkin // WDF Function: WdfIoTargetSendInternalIoctlSynchronously
113140462c92SVictor Perevertkin //
113240462c92SVictor Perevertkin typedef
113340462c92SVictor Perevertkin _Must_inspect_result_
113440462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
113540462c92SVictor Perevertkin WDFAPI
113640462c92SVictor Perevertkin NTSTATUS
1137*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETSENDINTERNALIOCTLSYNCHRONOUSLY)(
113840462c92SVictor Perevertkin _In_
113940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
114040462c92SVictor Perevertkin _In_
114140462c92SVictor Perevertkin WDFIOTARGET IoTarget,
114240462c92SVictor Perevertkin _In_opt_
114340462c92SVictor Perevertkin WDFREQUEST Request,
114440462c92SVictor Perevertkin _In_
114540462c92SVictor Perevertkin ULONG IoctlCode,
114640462c92SVictor Perevertkin _In_opt_
114740462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR InputBuffer,
114840462c92SVictor Perevertkin _In_opt_
114940462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OutputBuffer,
115040462c92SVictor Perevertkin _In_opt_
115140462c92SVictor Perevertkin PWDF_REQUEST_SEND_OPTIONS RequestOptions,
115240462c92SVictor Perevertkin _Out_opt_
115340462c92SVictor Perevertkin PULONG_PTR BytesReturned
115440462c92SVictor Perevertkin );
115540462c92SVictor Perevertkin
115640462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)115740462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
115840462c92SVictor Perevertkin FORCEINLINE
1159*545df815SVictor Perevertkin NTSTATUS
116040462c92SVictor Perevertkin WdfIoTargetSendInternalIoctlSynchronously(
116140462c92SVictor Perevertkin _In_
116240462c92SVictor Perevertkin WDFIOTARGET IoTarget,
116340462c92SVictor Perevertkin _In_opt_
116440462c92SVictor Perevertkin WDFREQUEST Request,
116540462c92SVictor Perevertkin _In_
116640462c92SVictor Perevertkin ULONG IoctlCode,
116740462c92SVictor Perevertkin _In_opt_
116840462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR InputBuffer,
116940462c92SVictor Perevertkin _In_opt_
117040462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OutputBuffer,
117140462c92SVictor Perevertkin _In_opt_
117240462c92SVictor Perevertkin PWDF_REQUEST_SEND_OPTIONS RequestOptions,
117340462c92SVictor Perevertkin _Out_opt_
117440462c92SVictor Perevertkin PULONG_PTR BytesReturned
117540462c92SVictor Perevertkin )
117640462c92SVictor Perevertkin {
117740462c92SVictor Perevertkin return ((PFN_WDFIOTARGETSENDINTERNALIOCTLSYNCHRONOUSLY) WdfFunctions[WdfIoTargetSendInternalIoctlSynchronouslyTableIndex])(WdfDriverGlobals, IoTarget, Request, IoctlCode, InputBuffer, OutputBuffer, RequestOptions, BytesReturned);
117840462c92SVictor Perevertkin }
117940462c92SVictor Perevertkin
118040462c92SVictor Perevertkin //
118140462c92SVictor Perevertkin // WDF Function: WdfIoTargetFormatRequestForInternalIoctl
118240462c92SVictor Perevertkin //
118340462c92SVictor Perevertkin typedef
118440462c92SVictor Perevertkin _Must_inspect_result_
118540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
118640462c92SVictor Perevertkin WDFAPI
118740462c92SVictor Perevertkin NTSTATUS
1188*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETFORMATREQUESTFORINTERNALIOCTL)(
118940462c92SVictor Perevertkin _In_
119040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
119140462c92SVictor Perevertkin _In_
119240462c92SVictor Perevertkin WDFIOTARGET IoTarget,
119340462c92SVictor Perevertkin _In_
119440462c92SVictor Perevertkin WDFREQUEST Request,
119540462c92SVictor Perevertkin _In_
119640462c92SVictor Perevertkin ULONG IoctlCode,
119740462c92SVictor Perevertkin _In_opt_
119840462c92SVictor Perevertkin WDFMEMORY InputBuffer,
119940462c92SVictor Perevertkin _In_opt_
120040462c92SVictor Perevertkin PWDFMEMORY_OFFSET InputBufferOffset,
120140462c92SVictor Perevertkin _In_opt_
120240462c92SVictor Perevertkin WDFMEMORY OutputBuffer,
120340462c92SVictor Perevertkin _In_opt_
120440462c92SVictor Perevertkin PWDFMEMORY_OFFSET OutputBufferOffset
120540462c92SVictor Perevertkin );
120640462c92SVictor Perevertkin
120740462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)120840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
120940462c92SVictor Perevertkin FORCEINLINE
1210*545df815SVictor Perevertkin NTSTATUS
121140462c92SVictor Perevertkin WdfIoTargetFormatRequestForInternalIoctl(
121240462c92SVictor Perevertkin _In_
121340462c92SVictor Perevertkin WDFIOTARGET IoTarget,
121440462c92SVictor Perevertkin _In_
121540462c92SVictor Perevertkin WDFREQUEST Request,
121640462c92SVictor Perevertkin _In_
121740462c92SVictor Perevertkin ULONG IoctlCode,
121840462c92SVictor Perevertkin _In_opt_
121940462c92SVictor Perevertkin WDFMEMORY InputBuffer,
122040462c92SVictor Perevertkin _In_opt_
122140462c92SVictor Perevertkin PWDFMEMORY_OFFSET InputBufferOffset,
122240462c92SVictor Perevertkin _In_opt_
122340462c92SVictor Perevertkin WDFMEMORY OutputBuffer,
122440462c92SVictor Perevertkin _In_opt_
122540462c92SVictor Perevertkin PWDFMEMORY_OFFSET OutputBufferOffset
122640462c92SVictor Perevertkin )
122740462c92SVictor Perevertkin {
122840462c92SVictor Perevertkin return ((PFN_WDFIOTARGETFORMATREQUESTFORINTERNALIOCTL) WdfFunctions[WdfIoTargetFormatRequestForInternalIoctlTableIndex])(WdfDriverGlobals, IoTarget, Request, IoctlCode, InputBuffer, InputBufferOffset, OutputBuffer, OutputBufferOffset);
122940462c92SVictor Perevertkin }
123040462c92SVictor Perevertkin
123140462c92SVictor Perevertkin //
123240462c92SVictor Perevertkin // WDF Function: WdfIoTargetSendInternalIoctlOthersSynchronously
123340462c92SVictor Perevertkin //
123440462c92SVictor Perevertkin typedef
123540462c92SVictor Perevertkin _Must_inspect_result_
123640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
123740462c92SVictor Perevertkin WDFAPI
123840462c92SVictor Perevertkin NTSTATUS
1239*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETSENDINTERNALIOCTLOTHERSSYNCHRONOUSLY)(
124040462c92SVictor Perevertkin _In_
124140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
124240462c92SVictor Perevertkin _In_
124340462c92SVictor Perevertkin WDFIOTARGET IoTarget,
124440462c92SVictor Perevertkin _In_opt_
124540462c92SVictor Perevertkin WDFREQUEST Request,
124640462c92SVictor Perevertkin _In_
124740462c92SVictor Perevertkin ULONG IoctlCode,
124840462c92SVictor Perevertkin _In_opt_
124940462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OtherArg1,
125040462c92SVictor Perevertkin _In_opt_
125140462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OtherArg2,
125240462c92SVictor Perevertkin _In_opt_
125340462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OtherArg4,
125440462c92SVictor Perevertkin _In_opt_
125540462c92SVictor Perevertkin PWDF_REQUEST_SEND_OPTIONS RequestOptions,
125640462c92SVictor Perevertkin _Out_opt_
125740462c92SVictor Perevertkin PULONG_PTR BytesReturned
125840462c92SVictor Perevertkin );
125940462c92SVictor Perevertkin
126040462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)126140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
126240462c92SVictor Perevertkin FORCEINLINE
1263*545df815SVictor Perevertkin NTSTATUS
126440462c92SVictor Perevertkin WdfIoTargetSendInternalIoctlOthersSynchronously(
126540462c92SVictor Perevertkin _In_
126640462c92SVictor Perevertkin WDFIOTARGET IoTarget,
126740462c92SVictor Perevertkin _In_opt_
126840462c92SVictor Perevertkin WDFREQUEST Request,
126940462c92SVictor Perevertkin _In_
127040462c92SVictor Perevertkin ULONG IoctlCode,
127140462c92SVictor Perevertkin _In_opt_
127240462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OtherArg1,
127340462c92SVictor Perevertkin _In_opt_
127440462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OtherArg2,
127540462c92SVictor Perevertkin _In_opt_
127640462c92SVictor Perevertkin PWDF_MEMORY_DESCRIPTOR OtherArg4,
127740462c92SVictor Perevertkin _In_opt_
127840462c92SVictor Perevertkin PWDF_REQUEST_SEND_OPTIONS RequestOptions,
127940462c92SVictor Perevertkin _Out_opt_
128040462c92SVictor Perevertkin PULONG_PTR BytesReturned
128140462c92SVictor Perevertkin )
128240462c92SVictor Perevertkin {
128340462c92SVictor Perevertkin return ((PFN_WDFIOTARGETSENDINTERNALIOCTLOTHERSSYNCHRONOUSLY) WdfFunctions[WdfIoTargetSendInternalIoctlOthersSynchronouslyTableIndex])(WdfDriverGlobals, IoTarget, Request, IoctlCode, OtherArg1, OtherArg2, OtherArg4, RequestOptions, BytesReturned);
128440462c92SVictor Perevertkin }
128540462c92SVictor Perevertkin
128640462c92SVictor Perevertkin //
128740462c92SVictor Perevertkin // WDF Function: WdfIoTargetFormatRequestForInternalIoctlOthers
128840462c92SVictor Perevertkin //
128940462c92SVictor Perevertkin typedef
129040462c92SVictor Perevertkin _Must_inspect_result_
129140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
129240462c92SVictor Perevertkin WDFAPI
129340462c92SVictor Perevertkin NTSTATUS
1294*545df815SVictor Perevertkin (STDCALL *PFN_WDFIOTARGETFORMATREQUESTFORINTERNALIOCTLOTHERS)(
129540462c92SVictor Perevertkin _In_
129640462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
129740462c92SVictor Perevertkin _In_
129840462c92SVictor Perevertkin WDFIOTARGET IoTarget,
129940462c92SVictor Perevertkin _In_
130040462c92SVictor Perevertkin WDFREQUEST Request,
130140462c92SVictor Perevertkin _In_
130240462c92SVictor Perevertkin ULONG IoctlCode,
130340462c92SVictor Perevertkin _In_opt_
130440462c92SVictor Perevertkin WDFMEMORY OtherArg1,
130540462c92SVictor Perevertkin _In_opt_
130640462c92SVictor Perevertkin PWDFMEMORY_OFFSET OtherArg1Offset,
130740462c92SVictor Perevertkin _In_opt_
130840462c92SVictor Perevertkin WDFMEMORY OtherArg2,
130940462c92SVictor Perevertkin _In_opt_
131040462c92SVictor Perevertkin PWDFMEMORY_OFFSET OtherArg2Offset,
131140462c92SVictor Perevertkin _In_opt_
131240462c92SVictor Perevertkin WDFMEMORY OtherArg4,
131340462c92SVictor Perevertkin _In_opt_
131440462c92SVictor Perevertkin PWDFMEMORY_OFFSET OtherArg4Offset
131540462c92SVictor Perevertkin );
131640462c92SVictor Perevertkin
131740462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)131840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
131940462c92SVictor Perevertkin FORCEINLINE
1320*545df815SVictor Perevertkin NTSTATUS
132140462c92SVictor Perevertkin WdfIoTargetFormatRequestForInternalIoctlOthers(
132240462c92SVictor Perevertkin _In_
132340462c92SVictor Perevertkin WDFIOTARGET IoTarget,
132440462c92SVictor Perevertkin _In_
132540462c92SVictor Perevertkin WDFREQUEST Request,
132640462c92SVictor Perevertkin _In_
132740462c92SVictor Perevertkin ULONG IoctlCode,
132840462c92SVictor Perevertkin _In_opt_
132940462c92SVictor Perevertkin WDFMEMORY OtherArg1,
133040462c92SVictor Perevertkin _In_opt_
133140462c92SVictor Perevertkin PWDFMEMORY_OFFSET OtherArg1Offset,
133240462c92SVictor Perevertkin _In_opt_
133340462c92SVictor Perevertkin WDFMEMORY OtherArg2,
133440462c92SVictor Perevertkin _In_opt_
133540462c92SVictor Perevertkin PWDFMEMORY_OFFSET OtherArg2Offset,
133640462c92SVictor Perevertkin _In_opt_
133740462c92SVictor Perevertkin WDFMEMORY OtherArg4,
133840462c92SVictor Perevertkin _In_opt_
133940462c92SVictor Perevertkin PWDFMEMORY_OFFSET OtherArg4Offset
134040462c92SVictor Perevertkin )
134140462c92SVictor Perevertkin {
134240462c92SVictor Perevertkin return ((PFN_WDFIOTARGETFORMATREQUESTFORINTERNALIOCTLOTHERS) WdfFunctions[WdfIoTargetFormatRequestForInternalIoctlOthersTableIndex])(WdfDriverGlobals, IoTarget, Request, IoctlCode, OtherArg1, OtherArg1Offset, OtherArg2, OtherArg2Offset, OtherArg4, OtherArg4Offset);
134340462c92SVictor Perevertkin }
134440462c92SVictor Perevertkin
134540462c92SVictor Perevertkin
134640462c92SVictor Perevertkin
134740462c92SVictor Perevertkin #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
134840462c92SVictor Perevertkin
134940462c92SVictor Perevertkin
135040462c92SVictor Perevertkin
135140462c92SVictor Perevertkin WDF_EXTERN_C_END
135240462c92SVictor Perevertkin
135340462c92SVictor Perevertkin #endif // _WDFIOTARGET_H_
135440462c92SVictor Perevertkin
1355