mirror of
https://github.com/reactos/reactos.git
synced 2024-11-19 13:33:42 +00:00
216 lines
4 KiB
C
216 lines
4 KiB
C
/*++
|
|
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
_WdfVersionBuild_
|
|
|
|
Module Name:
|
|
|
|
wdfworkitem.h
|
|
|
|
Abstract:
|
|
|
|
This is the Windows Driver Framework work item DDIs
|
|
|
|
Revision History:
|
|
|
|
|
|
--*/
|
|
|
|
//
|
|
// NOTE: This header is generated by stubwork. Please make any
|
|
// modifications to the corresponding template files
|
|
// (.x or .y) and use stubwork to regenerate the header
|
|
//
|
|
|
|
#ifndef _WDFWORKITEM_H_
|
|
#define _WDFWORKITEM_H_
|
|
|
|
#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)
|
|
|
|
|
|
|
|
//
|
|
// 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
|
|
STDCALL
|
|
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;
|
|
|
|
FORCEINLINE
|
|
VOID
|
|
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
|
|
(STDCALL *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)
|
|
FORCEINLINE
|
|
NTSTATUS
|
|
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
|
|
(STDCALL *PFN_WDFWORKITEMENQUEUE)(
|
|
_In_
|
|
PWDF_DRIVER_GLOBALS DriverGlobals,
|
|
_In_
|
|
WDFWORKITEM WorkItem
|
|
);
|
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
|
FORCEINLINE
|
|
VOID
|
|
WdfWorkItemEnqueue(
|
|
_In_
|
|
WDFWORKITEM WorkItem
|
|
)
|
|
{
|
|
((PFN_WDFWORKITEMENQUEUE) WdfFunctions[WdfWorkItemEnqueueTableIndex])(WdfDriverGlobals, WorkItem);
|
|
}
|
|
|
|
//
|
|
// WDF Function: WdfWorkItemGetParentObject
|
|
//
|
|
typedef
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
|
WDFAPI
|
|
WDFOBJECT
|
|
(STDCALL *PFN_WDFWORKITEMGETPARENTOBJECT)(
|
|
_In_
|
|
PWDF_DRIVER_GLOBALS DriverGlobals,
|
|
_In_
|
|
WDFWORKITEM WorkItem
|
|
);
|
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
|
FORCEINLINE
|
|
WDFOBJECT
|
|
WdfWorkItemGetParentObject(
|
|
_In_
|
|
WDFWORKITEM WorkItem
|
|
)
|
|
{
|
|
return ((PFN_WDFWORKITEMGETPARENTOBJECT) WdfFunctions[WdfWorkItemGetParentObjectTableIndex])(WdfDriverGlobals, WorkItem);
|
|
}
|
|
|
|
//
|
|
// WDF Function: WdfWorkItemFlush
|
|
//
|
|
typedef
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
WDFAPI
|
|
VOID
|
|
(STDCALL *PFN_WDFWORKITEMFLUSH)(
|
|
_In_
|
|
PWDF_DRIVER_GLOBALS DriverGlobals,
|
|
_In_
|
|
WDFWORKITEM WorkItem
|
|
);
|
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
FORCEINLINE
|
|
VOID
|
|
WdfWorkItemFlush(
|
|
_In_
|
|
WDFWORKITEM WorkItem
|
|
)
|
|
{
|
|
((PFN_WDFWORKITEMFLUSH) WdfFunctions[WdfWorkItemFlushTableIndex])(WdfDriverGlobals, WorkItem);
|
|
}
|
|
|
|
|
|
|
|
#endif // (NTDDI_VERSION >= NTDDI_WIN2K)
|
|
|
|
|
|
WDF_EXTERN_C_END
|
|
|
|
#endif // _WDFWORKITEM_H_
|
|
|