ReactOS 0.4.15-dev-7918-g2a2556c
fxldr.h
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 fxldr.h
8
9Abstract:
10 This module contains private interfaces to the WDF loader. This interface
11 is used by
12 a) the stub code in the client driver
13 b) the framework
14 c) the framework loader
15--*/
16#ifndef __FXLDR_H__
17#define __FXLDR_H__
18
19#include <initguid.h>
20#include <wdfldr.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#define WDF_COMPONENT_NAME(a) L#a
27
28//
29// Bind info structures are aligned on memory allocation boundaries on 64-bit
30// platforms, pointer boundaries on 32-bit. The alignment __declspec didn't
31// fix this for Itanium builds, so we must accomodate this.
32//
33// This "marker type" allows us to declare a leading boundary that will always
34// have the proper alignment. It may "waste" 4 to 8 bytes (0-4 to align the
35// marker, and 4 more because the alignment isn't necessary, making the marker
36// bigger than needed) on 32-bit, but that's not a large price to pay.
37//
38
39typedef struct DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) _MARKER_TYPE {
42
43typedef struct _LIBRARY_MODULE *PLIBRARY_MODULE;
45
46typedef
48(*WDFFUNC)(
49 VOID
50 );
51
52typedef
56 VOID
57 );
58
59typedef
63 VOID
64 );
65
66typedef
71 __deref_out PWDF_COMPONENT_GLOBALS * ComponentGlobals,
73 );
74
75typedef
81 );
82
83typedef
87 __in PWDF_LIBRARY_INFO LibraryInfo,
88 __in PUNICODE_STRING ServicePath,
89 __in PCUNICODE_STRING LibraryDeviceName
90 ) ;
91
92typedef
100 ) ;
101
102typedef
108 );
109
110#define WDF_LIBRARY_COMMISSION LibraryCommission
111#define WDF_LIBRARY_DECOMMISSION LibraryDecommission
112#define WDF_LIBRARY_REGISTER_CLIENT LibraryRegisterClient
113#define WDF_LIBRARY_UNREGISTER_CLIENT LibraryUnregisterClient
114
115#define WDF_REGISTRY_DBGPRINT_ON L"DbgPrintOn"
116
117
118//
119// Version container
120//
121typedef struct _WDF_VERSION {
126
127//
128// WDF bind information structure.
129//
130typedef struct _WDF_BIND_INFO {
135 __field_bcount(FuncCount*sizeof(WDFFUNC)) WDFFUNC* FuncTable;
136 PLIBRARY_MODULE Module; // Mgmt and diagnostic use only
138
139typedef struct _WDF_LIBRARY_INFO {
147
148// {49215DFF-F5AC-4901-8588-AB3D540F6021}
149DEFINE_GUID(GUID_WDF_LOADER_INTERFACE_STANDARD, \
150 0x49215dff, 0xf5ac, 0x4901, 0x85, 0x88, 0xab, 0x3d, 0x54, 0xf, 0x60, 0x21);
151
152typedef struct _WDF_LOADER_INTERFACE {
159
160VOID
161__inline
164 )
165{
167 Interface->Header.InterfaceSize = sizeof(WDF_LOADER_INTERFACE);
168 Interface->Header.InterfaceType = &GUID_WDF_LOADER_INTERFACE_STANDARD;
169}
170
171//
172// Client Driver information structure. This is used by loader when
173// registering client with library to provide some additional info to
174// library that is not already present in WDF_BIND_INFO (also passed to library
175// during client registration)
176//
177typedef struct _CLIENT_INFO {
178 //
179 // Size of this structure
180 //
182
183 //
184 // registry service path of client driver
185 //
187
189
190//-----------------------------------------------------------------------------
191// WDFLDR.SYS exported function prototype definitions
192//-----------------------------------------------------------------------------
198 __inout PWDF_BIND_INFO BindInfo,
199 __out PWDF_COMPONENT_GLOBALS* ComponentGlobals
200 );
201
205 __in PWDF_BIND_INFO BindInfo,
206 __in PWDF_COMPONENT_GLOBALS ComponentGlobals
207 );
208
212 __in PWDF_LIBRARY_INFO LibraryInfo,
213 __in PUNICODE_STRING ServicePath,
214 __in PCUNICODE_STRING LibraryDeviceName
215 );
216
217#ifdef ALLOC_PRAGMA
218#pragma alloc_text (PAGE, WdfVersionBind)
219#pragma alloc_text (PAGE, WdfVersionUnbind)
220#pragma alloc_text (PAGE, WdfRegisterLibrary)
221// #pragma alloc_text (PAGE, WdfRegisterClassLibrary)
222#endif
223
224#ifdef __cplusplus
225} // extern "C"
226#endif
227
228//
229// Event name: WdfCensusEvtLinkClientToCx
230//
231// Source: WdfLdr
232// Description: Written when a client is binding to a class extension.
233// WdfVersionBindClass which is called from the client's stub,
234// will load/reference the Cx and add it to the fx library's
235// list of clients. The client driver's class extension list is
236// also updated at that time, which is when this event is written.
237//
238// Frequency: Everytime a client driver binds to a class extension.
239//
240//
241#define WDF_CENSUS_EVT_WRITE_LINK_CLIENT_TO_CX(TraceHandle, CxImageName, ClientImageName) \
242 TraceLoggingWrite(TraceHandle, \
243 "WdfCensusEvtLinkClientToCx", \
244 WDF_TELEMETRY_EVT_KEYWORDS, \
245 TraceLoggingWideString(CxImageName, "CxImageName"), \
246 TraceLoggingWideString(ClientImageName, "ClientImageName" ) \
247 );
248
249#endif // __FXLDR_H__
#define VOID
Definition: acefi.h:82
LONG NTSTATUS
Definition: precomp.h:26
char * Pad(char *Str, char PadChar, ULONG Length)
Definition: cabman.cxx:29
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
#define __in
Definition: dbghelp.h:35
#define __deref_out
Definition: dbghelp.h:26
#define __inout
Definition: dbghelp.h:50
#define __out
Definition: dbghelp.h:62
#define NTSTATUS
Definition: precomp.h:21
DriverGlobals
MARKER_TYPE
Definition: fxldr.h:41
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYREGISTERCLIENT)(__in PWDF_BIND_INFO Info, __deref_out PWDF_COMPONENT_GLOBALS *ComponentGlobals, __deref_inout PVOID *Context)
Definition: fxldr.h:69
_Must_inspect_result_ NTSTATUS(* PWDF_REGISTER_LIBRARY)(__in PWDF_LIBRARY_INFO LibraryInfo, __in PUNICODE_STRING ServicePath, __in PCUNICODE_STRING LibraryDeviceName)
Definition: fxldr.h:86
struct _WDF_LIBRARY_INFO * PWDF_LIBRARY_INFO
Definition: fxldr.h:44
_Must_inspect_result_ NTSTATUS WdfVersionBind(__in PDRIVER_OBJECT DriverObject, __in PUNICODE_STRING RegistryPath, __inout PWDF_BIND_INFO BindInfo, __out PWDF_COMPONENT_GLOBALS *ComponentGlobals)
_Must_inspect_result_ NTSTATUS WdfRegisterLibrary(__in PWDF_LIBRARY_INFO LibraryInfo, __in PUNICODE_STRING ServicePath, __in PCUNICODE_STRING LibraryDeviceName)
struct _WDF_LIBRARY_INFO WDF_LIBRARY_INFO
struct _CLIENT_INFO CLIENT_INFO
struct _WDF_LOADER_INTERFACE WDF_LOADER_INTERFACE
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYCOMMISSION)(VOID)
Definition: fxldr.h:55
struct _CLIENT_INFO * PCLIENT_INFO
struct _WDF_BIND_INFO WDF_BIND_INFO
VOID __inline WDF_LOADER_INTERFACE_INIT(PWDF_LOADER_INTERFACE Interface)
Definition: fxldr.h:162
struct _LIBRARY_MODULE * PLIBRARY_MODULE
Definition: fxldr.h:43
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYDECOMMISSION)(VOID)
Definition: fxldr.h:62
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYUNREGISTERCLIENT)(__in PWDF_BIND_INFO Info, __in PWDF_COMPONENT_GLOBALS DriverGlobals)
Definition: fxldr.h:78
struct _WDF_VERSION WDF_VERSION
_Must_inspect_result_ NTSTATUS(* PWDF_VERSION_BIND)(__in PDRIVER_OBJECT DriverObject, __in PUNICODE_STRING RegistryPath, __in PWDF_BIND_INFO Info, __out PWDF_COMPONENT_GLOBALS *Globals)
Definition: fxldr.h:95
NTSTATUS WdfVersionUnbind(__in PUNICODE_STRING RegistryPath, __in PWDF_BIND_INFO BindInfo, __in PWDF_COMPONENT_GLOBALS ComponentGlobals)
NTSTATUS(* PWDF_VERSION_UNBIND)(__in PUNICODE_STRING RegistryPath, __in PWDF_BIND_INFO Info, __in PWDF_COMPONENT_GLOBALS Globals)
Definition: fxldr.h:104
struct _WDF_LOADER_INTERFACE * PWDF_LOADER_INTERFACE
struct _WDF_BIND_INFO * PWDF_BIND_INFO
ULONG WDF_MINOR_VERSION
Definition: fxldrum.h:27
ULONG WDF_MAJOR_VERSION
Definition: fxldrum.h:26
ULONG WDF_BUILD_NUMBER
Definition: fxldrum.h:28
#define __deref_inout
Definition: ms_sal.h:2766
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define MEMORY_ALLOCATION_ALIGNMENT
Definition: ntbasedef.h:90
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
PUNICODE_STRING RegistryPath
Definition: fxldr.h:186
ULONG Size
Definition: fxldr.h:181
PLIBRARY_MODULE Module
Definition: fxldr.h:136
ULONG Size
Definition: fxldr.h:131
PWCHAR Component
Definition: fxldr.h:132
WDF_VERSION Version
Definition: fxldr.h:133
__field_bcount(FuncCount *sizeof(WDFFUNC)) WDFFUNC *FuncTable
ULONG FuncCount
Definition: fxldr.h:134
PFNLIBRARYCOMMISSION LibraryCommission
Definition: fxldr.h:141
PFNLIBRARYREGISTERCLIENT LibraryRegisterClient
Definition: fxldr.h:143
PFNLIBRARYUNREGISTERCLIENT LibraryUnregisterClient
Definition: fxldr.h:144
WDF_VERSION Version
Definition: fxldr.h:145
PFNLIBRARYDECOMMISSION LibraryDecommission
Definition: fxldr.h:142
PWDF_REGISTER_LIBRARY RegisterLibrary
Definition: fxldr.h:154
PWDF_VERSION_UNBIND VersionUnbind
Definition: fxldr.h:156
PWDF_LDR_DIAGNOSTICS_VALUE_BY_NAME_AS_ULONG DiagnosticsValueByNameAsULONG
Definition: fxldr.h:157
PWDF_VERSION_BIND VersionBind
Definition: fxldr.h:155
WDF_INTERFACE_HEADER Header
Definition: fxldr.h:153
WDF_MAJOR_VERSION Major
Definition: fxldr.h:122
WDF_BUILD_NUMBER Build
Definition: fxldr.h:124
WDF_MINOR_VERSION Minor
Definition: fxldr.h:123
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
VOID(* WDFFUNC)(VOID)
Definition: wdf.h:68
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
NTSTATUS(STDCALL * PWDF_LDR_DIAGNOSTICS_VALUE_BY_NAME_AS_ULONG)(PUNICODE_STRING, PULONG)
Definition: wdfldr.h:32
unsigned char UCHAR
Definition: xmlstorage.h:181