ReactOS 0.4.15-dev-8093-g3285f69
version.cpp File Reference
#include <ntverp.h>
#include "mx.h"
#include "fxmin.hpp"
#include "fxldrum.h"
#include "fxifr.h"
#include <strsafe.h>
#include <driverspecs.h>
#include "fxdynamics.h"
#include "..\librarycommon\fxlibrarycommon.h"
#include "umdfstub.h"
Include dependency graph for version.cpp:

Go to the source code of this file.

Macros

#define FX_DYNAMICS_GENERATE_TABLE   1
 
#define KMDF_DEFAULT_NAME
 
#define EVTLOG_MESSAGE_SIZE   70
 
#define RAW_DATA_SIZE   4
 
#define DECLARE_TYPE(Name)   Name* _DECL_##Name
 

Functions

NTSTATUS WDF_LIBRARY_COMMISSION (VOID)
 
NTSTATUS WDF_LIBRARY_DECOMMISSION (VOID)
 
NTSTATUS WDF_LIBRARY_REGISTER_CLIENT (PWDF_BIND_INFO Info, PWDF_DRIVER_GLOBALS *WdfDriverGlobals, PVOID *Context)
 
NTSTATUS WDF_LIBRARY_UNREGISTER_CLIENT (PWDF_BIND_INFO Info, PWDF_DRIVER_GLOBALS WdfDriverGlobals)
 

Variables

const WDFFUNCWdfFunctions
 
ULONG WdfLdrDbgPrintOn = 0
 
PCHAR WdfLdrType = KMDF_DEFAULT_NAME
 
WDF_LIBRARY_INFO WdfLibraryInfo
 
union {
uAllPublicTypes
 

Macro Definition Documentation

◆ DECLARE_TYPE

#define DECLARE_TYPE (   Name)    Name* _DECL_##Name

Definition at line 287 of file version.cpp.

◆ EVTLOG_MESSAGE_SIZE

#define EVTLOG_MESSAGE_SIZE   70

Definition at line 134 of file version.cpp.

◆ FX_DYNAMICS_GENERATE_TABLE

#define FX_DYNAMICS_GENERATE_TABLE   1

Definition at line 31 of file version.cpp.

◆ KMDF_DEFAULT_NAME

#define KMDF_DEFAULT_NAME
Value:
"Wdf" ## \
LITERAL(__WDF_MAJOR_VERSION) ## \
"000"

Definition at line 52 of file version.cpp.

◆ RAW_DATA_SIZE

#define RAW_DATA_SIZE   4

Definition at line 135 of file version.cpp.

Function Documentation

◆ WDF_LIBRARY_COMMISSION()

NTSTATUS WDF_LIBRARY_COMMISSION ( VOID  )

Definition at line 115 of file version.cpp.

118{
120}
_Must_inspect_result_ NTSTATUS FxLibraryCommonCommission(VOID)

◆ WDF_LIBRARY_DECOMMISSION()

NTSTATUS WDF_LIBRARY_DECOMMISSION ( VOID  )

Definition at line 127 of file version.cpp.

130{
132}
_Must_inspect_result_ NTSTATUS FxLibraryCommonDecommission(VOID)

◆ WDF_LIBRARY_REGISTER_CLIENT()

NTSTATUS WDF_LIBRARY_REGISTER_CLIENT ( PWDF_BIND_INFO  Info,
PWDF_DRIVER_GLOBALS WdfDriverGlobals,
PVOID Context 
)

Definition at line 139 of file version.cpp.

144{
147 WCHAR insertString[EVTLOG_MESSAGE_SIZE];
149 PCLIENT_INFO clientInfo = NULL;
150
152
153 clientInfo = (PCLIENT_INFO)*Context;
154 *Context = NULL;
155
156 ASSERT(Info->Version.Major == WdfLibraryInfo.Version.Major);
157
158 //
159 // NOTE: If the currently loaded library < drivers minor version fail the load
160 // instead of binding to a lower minor version. The reason for that if there
161 // is a newer API or new contract change made the driver shouldn't be using older
162 // API than it was compiled with.
163 //
164
165 if (Info->Version.Minor > WdfLibraryInfo.Version.Minor) {
166 status = StringCchPrintfW(insertString,
167 RTL_NUMBER_OF(insertString),
168 L"Driver Version: %d.%d Umdf Lib. Version: %d.%d",
169 Info->Version.Major,
170 Info->Version.Minor,
173 if (!NT_SUCCESS(status)) {
174 __Print(("ERROR: RtlStringCchPrintfW failed with Status 0x%x\n", status));
175 return status;
176 }
177 rawData[0] = Info->Version.Major;
178 rawData[1] = Info->Version.Minor;
181
182
183
184
185
186
187
188
189
190
191
192 //
193 // this looks like the best status to return
194 //
196
197 }
198
200
201 if (NT_SUCCESS(status)) {
202 //
203 // The context will be a pointer to FX_DRIVER_GLOBALS
204 //
206
207 //
208 // Set the WDF_BIND_INFO structure pointer in FxDriverGlobals
209 //
212 }
213
214 return status;
215}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PFX_DRIVER_GLOBALS pFxDriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define WDF_LIBRARY_REGISTER_CLIENT
Definition: fxldr.h:112
struct _CLIENT_INFO * PCLIENT_INFO
_Must_inspect_result_ NTSTATUS FxLibraryCommonRegisterClient(__inout PWDF_BIND_INFO Info, __deref_out PWDF_DRIVER_GLOBALS *WdfDriverGlobals, __in_opt PCLIENT_INFO ClientInfo)
#define __Print(_x_)
#define LITERAL(a)
#define ASSERT(a)
Definition: mode.c:44
static unsigned char rawData[2356]
Definition: data.c:573
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: ntstatus.h:273
#define L(x)
Definition: ntvdm.h:50
#define RAW_DATA_SIZE
Definition: version.cpp:439
#define EVTLOG_MESSAGE_SIZE
Definition: version.cpp:438
WDF_LIBRARY_INFO WdfLibraryInfo
Definition: version.cpp:178
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
PWDF_BIND_INFO WdfBindInfo
Definition: fxglobals.h:405
WDF_VERSION Version
Definition: fxldr.h:145
WDF_MAJOR_VERSION Major
Definition: fxldr.h:122
WDF_MINOR_VERSION Minor
Definition: fxldr.h:123
Definition: ps.c:97
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
PWDF_DRIVER_GLOBALS WdfDriverGlobals
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ WDF_LIBRARY_UNREGISTER_CLIENT()

NTSTATUS WDF_LIBRARY_UNREGISTER_CLIENT ( PWDF_BIND_INFO  Info,
PWDF_DRIVER_GLOBALS  WdfDriverGlobals 
)

Definition at line 219 of file version.cpp.

223{
225}
_Must_inspect_result_ NTSTATUS FxLibraryCommonUnregisterClient(__in PWDF_BIND_INFO Info, __in PWDF_DRIVER_GLOBALS WdfDriverGlobals)

Variable Documentation

◆ 

union { ... } uAllPublicTypes

◆ WdfFunctions

const WDFFUNC* WdfFunctions
extern

◆ WdfLdrDbgPrintOn

ULONG WdfLdrDbgPrintOn = 0

Definition at line 62 of file version.cpp.

Referenced by FxLibraryCommonRegisterClient().

◆ WdfLdrType

PCHAR WdfLdrType = KMDF_DEFAULT_NAME

Definition at line 64 of file version.cpp.

Referenced by FxInitializeBugCheckDriverInfo().

◆ WdfLibraryInfo

WDF_LIBRARY_INFO WdfLibraryInfo
Initial value:
= {
{ __WUDF_MAJOR_VERSION, __WUDF_MINOR_VERSION, __WUDF_SERVICE_VERSION }
}
#define WDF_LIBRARY_COMMISSION
Definition: fxldr.h:110
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYREGISTERCLIENT)(__in PWDF_BIND_INFO Info, __deref_out PWDF_COMPONENT_GLOBALS *ComponentGlobals, __deref_inout PVOID *Context)
Definition: fxldr.h:69
struct _WDF_LIBRARY_INFO WDF_LIBRARY_INFO
#define WDF_LIBRARY_UNREGISTER_CLIENT
Definition: fxldr.h:113
#define WDF_LIBRARY_DECOMMISSION
Definition: fxldr.h:111
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYCOMMISSION)(VOID)
Definition: fxldr.h:55
_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

Definition at line 99 of file version.cpp.