ReactOS  0.4.15-dev-2153-g62b4c61
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 {
119  return FxLibraryCommonCommission();
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 }
WDF_LIBRARY_INFO WdfLibraryInfo
Definition: version.cpp:178
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ NTSTATUS FxLibraryCommonRegisterClient(__inout PWDF_BIND_INFO Info, __deref_out PWDF_DRIVER_GLOBALS *WdfDriverGlobals, __in_opt PCLIENT_INFO ClientInfo)
WDF_VERSION Version
Definition: fxldr.h:145
LONG NTSTATUS
Definition: precomp.h:26
#define RAW_DATA_SIZE
Definition: version.cpp:135
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define EVTLOG_MESSAGE_SIZE
Definition: version.cpp:134
#define LITERAL(a)
PWDF_DRIVER_GLOBALS WdfDriverGlobals
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: ntstatus.h:273
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define ASSERT(a)
Definition: mode.c:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PWDF_BIND_INFO WdfBindInfo
Definition: fxglobals.h:405
WDF_MAJOR_VERSION Major
Definition: fxldr.h:122
static const WCHAR L[]
Definition: oid.c:1250
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define NULL
Definition: types.h:112
struct _CLIENT_INFO * PCLIENT_INFO
unsigned int ULONG
Definition: retypes.h:1
_Must_inspect_result_ NTSTATUS WDF_LIBRARY_REGISTER_CLIENT(__inout PWDF_BIND_INFO Info, __deref_out PWDF_DRIVER_GLOBALS *WdfDriverGlobals, __deref_inout PVOID *Context)
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
static unsigned char rawData[2356]
Definition: data.c:573
static SERVICE_STATUS status
Definition: service.c:31
WDF_MINOR_VERSION Minor
Definition: fxldr.h:123
#define __Print(_x_)
Definition: ps.c:97

◆ 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_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
_Must_inspect_result_ NTSTATUS FxLibraryCommonUnregisterClient(__in PWDF_BIND_INFO Info, __in PWDF_DRIVER_GLOBALS WdfDriverGlobals)
PWDF_DRIVER_GLOBALS WdfDriverGlobals

Variable Documentation

◆ uAllPublicTypes

union { ... } uAllPublicTypes

◆ WdfFunctions

const WDFFUNC* WdfFunctions

◆ 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 }
}
_Must_inspect_result_ NTSTATUS WDF_LIBRARY_DECOMMISSION(VOID)
Definition: version.cpp:431
_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 WDF_LIBRARY_COMMISSION(VOID)
Definition: version.cpp:418
_Must_inspect_result_ NTSTATUS WDF_LIBRARY_UNREGISTER_CLIENT(__in PWDF_BIND_INFO Info, __in PWDF_DRIVER_GLOBALS WdfDriverGlobals)
Definition: version.cpp:527
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYDECOMMISSION)(VOID)
Definition: fxldr.h:62
struct _WDF_LIBRARY_INFO WDF_LIBRARY_INFO
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYCOMMISSION)(VOID)
Definition: fxldr.h:55
_Must_inspect_result_ NTSTATUS WDF_LIBRARY_REGISTER_CLIENT(__inout PWDF_BIND_INFO Info, __deref_out PWDF_DRIVER_GLOBALS *WdfDriverGlobals, __deref_inout PVOID *Context)
_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.