ReactOS 0.4.16-dev-1946-g52006dd
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
45
46typedef
48(NTAPI *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
80 __in PWDF_COMPONENT_GLOBALS DriverGlobals
81 );
82
83typedef
87 __in PWDF_LIBRARY_INFO LibraryInfo,
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
161VOID
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//-----------------------------------------------------------------------------
195NTAPI
200 __out PWDF_COMPONENT_GLOBALS* ComponentGlobals
201 );
202
204NTAPI
208 __in PWDF_COMPONENT_GLOBALS ComponentGlobals
209 );
210
213NTAPI
215 __in PWDF_LIBRARY_INFO LibraryInfo,
217 __in PCUNICODE_STRING LibraryDeviceName
218 );
219
220#ifdef ALLOC_PRAGMA
221#pragma alloc_text (PAGE, WdfVersionBind)
222#pragma alloc_text (PAGE, WdfVersionUnbind)
223#pragma alloc_text (PAGE, WdfRegisterLibrary)
224#pragma alloc_text (PAGE, WdfRegisterClassLibrary)
225#endif
226
227#ifdef __cplusplus
228} // extern "C"
229#endif
230
231//
232// Event name: WdfCensusEvtLinkClientToCx
233//
234// Source: WdfLdr
235// Description: Written when a client is binding to a class extension.
236// WdfVersionBindClass which is called from the client's stub,
237// will load/reference the Cx and add it to the fx library's
238// list of clients. The client driver's class extension list is
239// also updated at that time, which is when this event is written.
240//
241// Frequency: Everytime a client driver binds to a class extension.
242//
243//
244#define WDF_CENSUS_EVT_WRITE_LINK_CLIENT_TO_CX(TraceHandle, CxImageName, ClientImageName) \
245 TraceLoggingWrite(TraceHandle, \
246 "WdfCensusEvtLinkClientToCx", \
247 WDF_TELEMETRY_EVT_KEYWORDS, \
248 TraceLoggingWideString(CxImageName, "CxImageName"), \
249 TraceLoggingWideString(ClientImageName, "ClientImageName" ) \
250 );
251
252#endif // __FXLDR_H__
#define __inline
Definition: _wctype.cpp:15
#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:19
MARKER_TYPE
Definition: fxldr.h:41
_Must_inspect_result_ NTSTATUS(NTAPI * PFNLIBRARYUNREGISTERCLIENT)(__in PWDF_BIND_INFO Info, __in PWDF_COMPONENT_GLOBALS DriverGlobals)
Definition: fxldr.h:78
_Must_inspect_result_ NTSTATUS(NTAPI * 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
struct _WDF_LIBRARY_INFO WDF_LIBRARY_INFO
struct _CLIENT_INFO CLIENT_INFO
_Must_inspect_result_ NTSTATUS(NTAPI * PFNLIBRARYDECOMMISSION)(VOID)
Definition: fxldr.h:62
struct _WDF_LOADER_INTERFACE WDF_LOADER_INTERFACE
struct _CLIENT_INFO * PCLIENT_INFO
struct _WDF_BIND_INFO WDF_BIND_INFO
_Must_inspect_result_ NTSTATUS(NTAPI * PFNLIBRARYCOMMISSION)(VOID)
Definition: fxldr.h:55
_Must_inspect_result_ NTSTATUS(NTAPI * PWDF_REGISTER_LIBRARY)(__in PWDF_LIBRARY_INFO LibraryInfo, __in PUNICODE_STRING ServicePath, __in PCUNICODE_STRING LibraryDeviceName)
Definition: fxldr.h:86
struct _LIBRARY_MODULE * PLIBRARY_MODULE
Definition: fxldr.h:43
struct _WDF_VERSION WDF_VERSION
NTSTATUS(NTAPI * PWDF_VERSION_UNBIND)(__in PUNICODE_STRING RegistryPath, __in PWDF_BIND_INFO Info, __in PWDF_COMPONENT_GLOBALS Globals)
Definition: fxldr.h:104
__inline VOID WDF_LOADER_INTERFACE_INIT(PWDF_LOADER_INTERFACE Interface)
Definition: fxldr.h:162
struct _WDF_LOADER_INTERFACE * PWDF_LOADER_INTERFACE
_Must_inspect_result_ NTSTATUS(NTAPI * PFNLIBRARYREGISTERCLIENT)(__in PWDF_BIND_INFO Info, __deref_out PWDF_COMPONENT_GLOBALS *ComponentGlobals, __deref_inout PVOID *Context)
Definition: fxldr.h:69
ULONG WDF_MINOR_VERSION
Definition: fxldrum.h:27
ULONG WDF_MAJOR_VERSION
Definition: fxldrum.h:26
ULONG WDF_BUILD_NUMBER
Definition: fxldrum.h:28
_In_ PCUNICODE_STRING ServicePath
Definition: library.c:55
#define _Must_inspect_result_
Definition: no_sal2.h:62
#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
#define __deref_inout
Definition: sal_old.h:120
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 NTAPI
Definition: typedefs.h:36
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
VOID(NTAPI * 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
WDF_BIND_INFO BindInfo
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
struct _WDF_LIBRARY_INFO * PWDF_LIBRARY_INFO
Definition: wdfldr.h:23
NTSTATUS NTAPI WdfRegisterLibrary(_In_ PWDF_LIBRARY_INFO LibraryInfo, _In_ PUNICODE_STRING ServicePath, _In_ PCUNICODE_STRING LibraryDeviceName)
Register wdf01000 library.
Definition: wdfldr.c:311
NTSTATUS NTAPI WdfVersionBind(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath, _Inout_ PWDF_BIND_INFO BindInfo, _Out_ PWDF_COMPONENT_GLOBALS *ComponentGlobals)
Bind client driver with framework.
Definition: wdfldr.c:411
struct _WDF_BIND_INFO * PWDF_BIND_INFO
Definition: wdfldr.h:21
NTSTATUS NTAPI WdfVersionUnbind(_In_ PUNICODE_STRING RegistryPath, _In_ PWDF_BIND_INFO BindInfo, _In_ PWDF_COMPONENT_GLOBALS ComponentGlobals)
Unbind client driver from framework.
Definition: wdfldr.c:519
NTSTATUS(NTAPI * PWDF_LDR_DIAGNOSTICS_VALUE_BY_NAME_AS_ULONG)(_In_ PUNICODE_STRING ValueName, _Out_ PULONG Value)
Definition: wdfldr.h:28
unsigned char UCHAR
Definition: xmlstorage.h:181