ReactOS  0.4.15-dev-2153-g62b4c61
version.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  Version.cpp
8 
9 Abstract:
10 
11  This module forms a loadable library from the WDF core libs
12 
13 Revision History:
14 
15 --*/
16 
17 #include <stdarg.h>
18 #include <stddef.h>
19 #include <stdio.h>
20 #include <string.h>
21 #include <ntverp.h>
22 
23 extern "C" {
24 #include <ntddk.h>
25 #include <ntstrsafe.h>
26 }
27 
28 #define FX_DYNAMICS_GENERATE_TABLE 1
29 
30 #include "fx.hpp"
31 
32 #include <fxldr.h>
33 #include "fxbugcheck.h"
34 #include "wdfversionlog.h"
35 
36 #define DRIVER_OBJECT_EXTENSION_IDENTIFIER DriverEntry
37 #define DRIVER_PARAMETERS L"Parameters"
38 #define REGISTRY_KMDF_MAJOR_VERSION L"MajorVersion"
39 #define REGISTRY_KMDF_MINOR_VERSION L"MinorVersion"
40 #define REGISTRY_KMDF_BUILD_NUMBER L"BuildNumber"
41 
42 //-----------------------------------------------------------------------------
43 // These header files are referenced in order to make internal structures
44 // available in public symbols. Various WDFKD debug commands use these
45 // internal structures to provide information about WDF.
46 //-----------------------------------------------------------------------------
47 #include "fxifr.h"
48 
49 extern "C" {
50 
51 //
52 // This is the collection of all structure/types to be make public.
53 // This union forces the structure type-info into the PDB file.
54 //
55 union {
56 
72 
74 
75 } // extern "C" end
76 
77 //----------------------------------------- ------------------------------------
78 
79 extern "C" {
80 
81 #include "fxdynamics.h"
82 
83 #include "fxlibrarycommon.h"
84 
85 #define KMDF_DEFAULT_NAME "Wdf" ## \
86  LITERAL(__WDF_MAJOR_VERSION_STRING) ## \
87  "000" //minor version
88 
89 //-----------------------------------------------------------------------------
90 // local prototype definitions
91 //-----------------------------------------------------------------------------
92 extern "C"
93 DRIVER_UNLOAD DriverUnload;
94 
95 extern "C"
96 DRIVER_INITIALIZE DriverEntry;
97 
98 extern "C"
103 
105 
107 
109 
110 } // extern "C"
111 
112 
113 //-----------------------------------------------------------------------------
114 //
115 //-----------------------------------------------------------------------------
116 extern "C"
118 NTSTATUS
120  VOID
121  );
122 
123 extern "C"
125 NTSTATUS
127  VOID
128  );
129 
130 extern "C"
132 NTSTATUS
137  );
138 
139 extern "C"
141 NTSTATUS
145  );
146 
147 extern "C"
148 VOID
150  VOID
151  );
152 
153 VOID
155  VOID
156  );
157 
158 VOID
162  );
163 
164 VOID
167  );
168 
169 typedef struct _DRV_EXTENSION {
172 
173 //-----------------------------------------------------------------------------
174 // Library registeration information
175 //-----------------------------------------------------------------------------
176 extern "C" {
177 #pragma prefast(suppress:__WARNING_ENCODE_MEMBER_FUNCTION_POINTER, "kernel component.");
179  sizeof(WDF_LIBRARY_INFO),
184  { __WDF_MAJOR_VERSION, __WDF_MINOR_VERSION, __WDF_BUILD_NUMBER }
185 };
186 
187 } // extern "C" end
188 
189 extern "C"
190 NTSTATUS
193  __in PIRP Irp
194  )
195 {
197 
200 
202 
204  case IRP_MJ_CREATE:
205  //
206  // To limit our exposure for this device object, only allow kernel mode
207  // creates.
208  //
209  if (Irp->RequestorMode == KernelMode) {
211  }
212  break;
213 
214  case IRP_MJ_CLEANUP:
215  case IRP_MJ_CLOSE:
216  //
217  // Since we allowed a create to succeed, succeed the cleanup and close
218  //
220  break;
221  }
222 
223  Irp->IoStatus.Status = status;
224  Irp->IoStatus.Information = 0x0;
226 
227  return status;
228 }
229 
230 //-----------------------------------------------------------------------------
231 //
232 //-----------------------------------------------------------------------------
233 
234 #define KMDF_DEVICE_NAME L"\\Device\\KMDF"
235 
237 NTSTATUS
240  )
241 {
243  ULONG i;
244 
245  i = 0;
246 
247  //
248  // Repeatedly try to create a named device object until we run out of buffer
249  // space or we succeed.
250  //
251  do {
253  if (!NT_SUCCESS(status)) {
254  return status;
255  }
256 
257  //
258  // Create a device with no device extension
259  //
262  0,
263  DeviceName,
265  0,
266  FALSE,
268  );
270 
271  if (NT_SUCCESS(status)) {
272  //
273  // Clear the initializing bit now because the loader will attempt to
274  // open the device before we return from DriverEntry
275  //
278  }
279 
280  return status;
281 }
282 
283 extern "C"
284 VOID
286  VOID
287  )
288 {
290 }
291 
292 VOID
294  VOID
295  )
296 {
300  }
301 }
302 
303 extern "C"
304 NTSTATUS
308  )
309 {
313 
314  //
315  // This creates a local buffer which is big enough to hold a copy of the
316  // constant string assigned to it. It does not point to the constant
317  // string. As such, it is a writeable buffer.
318  //
319  // NOTE: KMDF_DEVICE_NAME L"XXXX" creates a concatenated string of
320  // KMDF_DEVICE_NAME + L"XXXX". This is done to give us room for
321  // appending a number up to 4 digits long after KMDF_DEVICE_NAME if
322  // you want a null terminated string, 5 digits long if the string is
323  // not null terminated (as is the case for a UNICODE_STRING)
324  //
325  WCHAR buffer[] = KMDF_DEVICE_NAME L"XXXX";
326 
327  //
328  // Initialize global to make NonPagedPool be treated as NxPool on Win8
329  // and NonPagedPool on down-level
330  //
331  ExInitializeDriverRuntime(DrvRtPoolNxOptIn);
332 
334 
335  //
336  // Determine if debug prints are on.
337  //
338  (void) WdfLdrDiagnosticsValueByNameAsULONG(&string, &WdfLdrDbgPrintOn);
339 
340  __Print(("DriverEntry\n"));
341 
342  DriverObject->DriverUnload = DriverUnload;
343 
345 
348  DriverObject->MajorFunction[IRP_MJ_CLOSE] = FxLibraryDispatch;
349 
350  RtlZeroMemory(&name, sizeof(name));
351  name.Buffer = buffer;
352  name.Length = 0x0;
353  name.MaximumLength = sizeof(buffer);
354 
355  //
356  // We use the string when we declare the buffer to get the right sized
357  // buffer. Now we want to make sure there are no contents before we
358  // use it to create a device object.
359  //
360  RtlZeroMemory(buffer, sizeof(buffer));
361 
363  if (!NT_SUCCESS(status)) {
364  __Print(("ERROR: FxLibraryCreateDevice failed with Status 0x%x\n", status));
365  return status;
366  }
367 
368  //
369  // Register this library with WdfLdr
370  //
371  // NOTE: Once WdfRegisterLibrary returns NT_SUCCESS() we must return
372  // NT_SUCCESS from DriverEntry!
373  //
375  if (!NT_SUCCESS(status)) {
376  __Print(("ERROR: WdfRegisterLibrary failed with Status 0x%x\n", status));
378  return status;
379  }
380 
381  //
382  // Write KMDF version to registry
383  //
385 
386  return STATUS_SUCCESS;
387 }
388 
389 //-----------------------------------------------------------------------------
390 //
391 //-----------------------------------------------------------------------------
392 extern "C"
393 VOID
396  )
397 {
398  __Print(("DriverUnload\n"));
399 
400  //
401  // Delete KMDF version from registry before destroying the Driver Object
402  //
404 
405  //
406  // Make sure everything is deleted. Since the driver is considered a legacy
407  // driver, it can be unloaded while there are still outstanding device objects.
408  //
410 }
411 
412 //-----------------------------------------------------------------------------
413 //
414 //-----------------------------------------------------------------------------
415 extern "C"
417 NTSTATUS
419  VOID
420  )
421 {
422  return FxLibraryCommonCommission();
423 }
424 
425 //-----------------------------------------------------------------------------
426 //
427 //-----------------------------------------------------------------------------
428 extern "C"
430 NTSTATUS
432  VOID
433  )
434 {
436 }
437 
438 #define EVTLOG_MESSAGE_SIZE 70
439 #define RAW_DATA_SIZE 4
440 
441 extern "C"
443 NTSTATUS
448  )
449 {
452  WCHAR insertString[EVTLOG_MESSAGE_SIZE];
454  PCLIENT_INFO clientInfo = NULL;
455 
457 
458  clientInfo = (PCLIENT_INFO)*Context;
459  *Context = NULL;
460 
461  ASSERT(Info->Version.Major == WdfLibraryInfo.Version.Major);
462 
463  //
464  // NOTE: If the currently loaded library < drivers minor version fail the load
465  // instead of binding to a lower minor version. The reason for that if there
466  // is a newer API or new contract change made the driver shouldn't be using older
467  // API than it was compiled with.
468  //
469 
470  if (Info->Version.Minor > WdfLibraryInfo.Version.Minor) {
471  status = RtlStringCchPrintfW(insertString,
472  RTL_NUMBER_OF(insertString),
473  L"Driver Version: %d.%d Kmdf Lib. Version: %d.%d",
474  Info->Version.Major,
475  Info->Version.Minor,
478  if (!NT_SUCCESS(status)) {
479  __Print(("ERROR: RtlStringCchPrintfW failed with Status 0x%x\n", status));
480  return status;
481  }
482  rawData[0] = Info->Version.Major;
483  rawData[1] = Info->Version.Minor;
486 
488  WDFVER_MINOR_VERSION_NOT_SUPPORTED,
490  insertString,
491  rawData,
492  sizeof(rawData) );
493  //
494  // this looks like the best status to return
495  //
497 
498  }
499 
502  clientInfo);
503 
504  if (NT_SUCCESS(status)) {
505  //
506  // The context will be a pointer to FX_DRIVER_GLOBALS
507  //
509 
510  //
511  // Set the WDF_BIND_INFO structure pointer in FxDriverGlobals
512  //
515  }
516 
517  return status;
518 }
519 
520 
521 //-----------------------------------------------------------------------------
522 //
523 //-----------------------------------------------------------------------------
524 extern "C"
526 NTSTATUS
530  )
531 {
533 }
534 
535 VOID
539  )
540 {
542  OBJECT_ATTRIBUTES objectAttributes;
543  HANDLE driverKey;
544  HANDLE parametersKey;
545  UNICODE_STRING valueName;
546  UNICODE_STRING parametersPath;
547  PDRV_EXTENSION driverExtension;
548 
549  driverKey = NULL;
550  parametersKey = NULL;
551  driverExtension = NULL;
552 
553  RtlInitUnicodeString(&parametersPath, DRIVER_PARAMETERS);
554 
555  InitializeObjectAttributes(&objectAttributes,
556  RegistryPath,
558  NULL,
559  NULL);
560 
561  status = ZwOpenKey(&driverKey, KEY_CREATE_SUB_KEY, &objectAttributes);
562  if (!NT_SUCCESS(status)) {
563  __Print(("WdfWriteKmdfVersionToRegistry: Failed to open HKLM\\%S\n",
564  RegistryPath->Buffer));
565  goto out;
566  }
567 
568  InitializeObjectAttributes(&objectAttributes,
569  &parametersPath,
571  driverKey,
572  NULL);
573 
574  //
575  // Open or create key and get a handle
576  //
577  status = ZwCreateKey(&parametersKey,
579  &objectAttributes,
580  0,
583  NULL);
584 
585  if (!NT_SUCCESS(status)) {
586  __Print(("WdfWriteKmdfVersionToRegistry: Failed to open HKLM\\%S\\%S\n",
587  RegistryPath->Buffer, parametersPath.Buffer));
588  goto out;
589  }
590 
591  //
592  // Set Major Version
593  //
595 
596  status = ZwSetValueKey(parametersKey,
597  &valueName,
598  0,
599  REG_DWORD,
601  sizeof(WdfLibraryInfo.Version.Major));
602 
603  if (!NT_SUCCESS(status)) {
604  __Print(("WdfWriteKmdfVersionToRegistry: Failed to set Major Version\n"));
605  goto out;
606  }
607 
608  //
609  // Set Minor Version
610  //
612 
613  status = ZwSetValueKey(parametersKey,
614  &valueName,
615  0,
616  REG_DWORD,
618  sizeof(WdfLibraryInfo.Version.Minor));
619 
620  if (!NT_SUCCESS(status)) {
621  __Print(("WdfWriteKmdfVersionToRegistry: Failed to set Minor Version\n"));
622  goto out;
623  }
624 
625 
626  //
627  // Set Build Number
628  //
630 
631  status = ZwSetValueKey(parametersKey,
632  &valueName,
633  0,
634  REG_DWORD,
636  sizeof(WdfLibraryInfo.Version.Build));
637 
638  if (!NT_SUCCESS(status)) {
639  __Print(("WdfWriteKmdfVersionToRegistry: Failed to set Build Number\n"));
640  goto out;
641  }
642 
643  //
644  // Create a Driver Extension to store the registry path, where we write the
645  // version of the wdf01000.sys that's loaded in memory
646  //
649  sizeof(DRV_EXTENSION),
650  (PVOID *)&driverExtension);
651 
652  if (!NT_SUCCESS(status) || driverExtension == NULL) {
653  goto out;
654  }
655 
656  driverExtension->ParametersRegistryPath.Buffer = (PWCHAR) ExAllocatePoolWithTag(
657  PagedPool,
658  RegistryPath->MaximumLength,
659  FX_TAG);
660  if (driverExtension->ParametersRegistryPath.Buffer == NULL) {
661  goto out;
662  }
663 
664  driverExtension->ParametersRegistryPath.MaximumLength = RegistryPath->MaximumLength;
665  RtlCopyUnicodeString(&(driverExtension->ParametersRegistryPath), RegistryPath);
666 
667 out:
668  if (driverKey != NULL) {
669  ZwClose(driverKey);
670  }
671 
672  if (parametersKey != NULL) {
673  ZwClose(parametersKey);
674  }
675 
676  return;
677 }
678 
679 VOID
682  )
683 {
685  OBJECT_ATTRIBUTES objectAttributes;
686  HANDLE driverKey;
687  HANDLE parametersKey;
688  UNICODE_STRING valueName;
690  UNICODE_STRING parametersPath;
691  PDRV_EXTENSION driverExtension;
692 
693  RtlInitUnicodeString(&parametersPath, DRIVER_PARAMETERS);
694 
695  driverKey = NULL;
696  parametersKey = NULL;
697 
700 
701  if (driverExtension == NULL || driverExtension->ParametersRegistryPath.Buffer == NULL) {
702  return;
703  }
704 
705  registryPath = &driverExtension->ParametersRegistryPath;
706 
707  InitializeObjectAttributes(&objectAttributes,
708  registryPath,
710  NULL,
711  NULL);
712 
713  status = ZwOpenKey(&driverKey, KEY_SET_VALUE, &objectAttributes);
714  if (!NT_SUCCESS(status)) {
715  goto out;
716  }
717 
718  InitializeObjectAttributes(&objectAttributes,
719  &parametersPath,
721  driverKey,
722  NULL);
723  //
724  // Open the key for deletion
725  //
726  status = ZwOpenKey(&parametersKey,
727  DELETE,
728  &objectAttributes);
729 
730  if (!NT_SUCCESS(status)) {
731  goto out;
732  }
733 
735  ZwDeleteValueKey(parametersKey, &valueName);
736 
738  ZwDeleteValueKey(parametersKey, &valueName);
739 
741  ZwDeleteValueKey(parametersKey, &valueName);
742 
743  ZwDeleteKey(parametersKey);
744 
745 out:
746  if (driverExtension->ParametersRegistryPath.Buffer != NULL) {
747  ExFreePool(driverExtension->ParametersRegistryPath.Buffer);
748  }
749 
750  if (driverKey != NULL) {
751  ZwClose(driverKey);
752  }
753 
754  if (parametersKey != NULL) {
755  ZwClose(parametersKey);
756  }
757 
758  return;
759 }
760 
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
#define STATUS_OBJECT_NAME_COLLISION
Definition: udferr_usr.h:150
signed char * PCHAR
Definition: retypes.h:7
WDF_LIBRARY_INFO WdfLibraryInfo
Definition: version.cpp:178
FxObject * typeFxObject
Definition: version.cpp:68
#define _Must_inspect_result_
Definition: no_sal2.h:62
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
PCHAR WdfLdrType
Definition: version.cpp:108
_Must_inspect_result_ NTSTATUS WDF_LIBRARY_DECOMMISSION(VOID)
Definition: version.cpp:431
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
_Must_inspect_result_ NTSTATUS FxLibraryCommonCommission(VOID)
PDEVICE_OBJECT LibraryDeviceObject
Definition: fxglobals.h:728
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1756
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define REGISTRY_KMDF_MAJOR_VERSION
Definition: version.cpp:38
DRIVER_UNLOAD DriverUnload
Definition: version.cpp:93
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1110
_Must_inspect_result_ NTSTATUS FxLibraryCommonRegisterClient(__inout PWDF_BIND_INFO Info, __deref_out PWDF_DRIVER_GLOBALS *WdfDriverGlobals, __in_opt PCLIENT_INFO ClientInfo)
WDF_POWER_ROUTINE_TIMED_OUT_DATA * typeWDF_POWER_ROUTINE_TIMED_OUT_DATA
Definition: version.cpp:62
LPCTSTR registryPath
Definition: butterflies.c:16
WDF_VERSION Version
Definition: fxldr.h:145
LONG NTSTATUS
Definition: precomp.h:26
WDF_BUGCHECK_CODES * typeWDF_BUGCHECK_CODES
Definition: version.cpp:63
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
ULONG WdfLdrDbgPrintOn
Definition: version.cpp:106
NTSYSAPI NTSTATUS NTAPI ZwDeleteValueKey(__in IN HANDLE Key, __in IN PUNICODE_STRING ValueName)
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYREGISTERCLIENT)(__in PWDF_BIND_INFO Info, __deref_out PWDF_COMPONENT_GLOBALS *ComponentGlobals, __deref_inout PVOID *Context)
Definition: fxldr.h:69
GLuint buffer
Definition: glext.h:5915
uint16_t * PWCHAR
Definition: typedefs.h:56
FX_POOL_HEADER * typeFX_POOL_HEADER
Definition: version.cpp:66
Definition: fxbugcheck.h:81
#define __deref_inout
Definition: sal.h:2766
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
NTSTATUS FxLibraryDispatch(__in struct _DEVICE_OBJECT *DeviceObject, __in PIRP Irp)
Definition: version.cpp:191
_Must_inspect_result_ NTSTATUS FxLibraryCreateDevice(__in PUNICODE_STRING DeviceName)
Definition: version.cpp:238
WDF_OBJECT_CONTEXT_TYPE_INFO * typeWDF_OBJECT_CONTEXT_TYPE_INFO
Definition: version.cpp:61
RTL_OSVERSIONINFOW gOsVersion
Definition: version.cpp:104
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
VOID WdfDeleteKmdfVersionFromRegistry(__in PDRIVER_OBJECT DriverObject)
Definition: version.cpp:680
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
WDF_IFR_RECORD * typeWDF_IFR_RECORD
Definition: version.cpp:58
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
VOID FxLibraryDeleteDevice(VOID)
Definition: version.cpp:285
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3272
WDF_BUILD_NUMBER Build
Definition: fxldr.h:124
VOID LibraryLogEvent(__in PDRIVER_OBJECT DriverObject, __in NTSTATUS ErrorCode, __in NTSTATUS FinalStatus, __in PWSTR ErrorInsertionString, __in_bcount(RawDataLen) PVOID RawDataBuf, __in USHORT RawDataLen)
FxContextHeader * typeFxContextHeader
Definition: version.cpp:69
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
Definition: fxpool.h:63
FX_OBJECT_INFO * typeFX_OBJECT_INFO
Definition: version.cpp:65
FX_DUMP_DRIVER_INFO_ENTRY * typeFX_DUMP_DRIVER_INFO_ENTRY
Definition: version.cpp:70
#define WDF_REGISTRY_DBGPRINT_ON
Definition: fxldr.h:115
#define FX_TAG
Definition: fxmacros.hpp:155
enum _WDF_REQUEST_FATAL_ERROR_CODES WDF_REQUEST_FATAL_ERROR_CODES
VOID WdfWriteKmdfVersionToRegistry(__in PDRIVER_OBJECT DriverObject, __in PUNICODE_STRING RegistryPath)
Definition: version.cpp:536
#define IoCompleteRequest
Definition: irp.c:1240
WDF_IFR_HEADER * typeWDF_IFR_HEADER
Definition: version.cpp:57
FxTargetSubmitSyncParams * typeFxTargetSubmitSyncParams
Definition: version.cpp:71
_Must_inspect_result_ NTSTATUS FxLibraryCommonUnregisterClient(__in PWDF_BIND_INFO Info, __in PWDF_DRIVER_GLOBALS WdfDriverGlobals)
_Must_inspect_result_ NTSTATUS WDF_LIBRARY_COMMISSION(VOID)
Definition: version.cpp:418
struct _OSVERSIONINFOW RTL_OSVERSIONINFOW
#define RAW_DATA_SIZE
Definition: version.cpp:439
union @4535 uAllPublicTypes
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
PDRIVER_OBJECT DriverObject
Definition: fxglobals.h:719
DRIVER_INITIALIZE DriverEntry
Definition: version.cpp:96
#define LITERAL(a)
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_Must_inspect_result_ NTSTATUS FxLibraryCommonDecommission(VOID)
#define DRIVER_PARAMETERS
Definition: version.cpp:37
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: ntstatus.h:273
_Must_inspect_result_ NTSTATUS WDF_LIBRARY_UNREGISTER_CLIENT(__in PWDF_BIND_INFO Info, __in PWDF_DRIVER_GLOBALS WdfDriverGlobals)
Definition: version.cpp:527
WDF_IFR_OFFSET * typeWDF_IFR_OFFSET
Definition: version.cpp:59
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define ASSERT(a)
Definition: mode.c:45
WDF_BIND_INFO * typeWDF_BIND_INFO
Definition: version.cpp:60
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYDECOMMISSION)(VOID)
Definition: fxldr.h:62
PWDF_BIND_INFO WdfBindInfo
Definition: fxglobals.h:405
NTSTATUS RtlUnicodeStringPrintf(PUNICODE_STRING DestinationString, const WCHAR *pszFormat,...)
static FILE * out
Definition: regtests2xml.c:44
struct _DRV_EXTENSION DRV_EXTENSION
WDF_MAJOR_VERSION Major
Definition: fxldr.h:122
struct _DRV_EXTENSION * PDRV_EXTENSION
WDF_REQUEST_FATAL_ERROR_CODES * typeWDF_REQUEST_FATAL_ERROR_CODES
Definition: version.cpp:64
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
static const WCHAR L[]
Definition: oid.c:1250
struct _WDF_LIBRARY_INFO WDF_LIBRARY_INFO
#define REGISTRY_KMDF_MINOR_VERSION
Definition: version.cpp:39
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
#define KMDF_DEFAULT_NAME
Definition: version.cpp:85
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1834
#define __inout
Definition: dbghelp.h:50
DRIVER_DISPATCH(nfs41_FsdDispatch)
WDF_EXTERN_C_START enum _WDF_BUGCHECK_CODES WDF_BUGCHECK_CODES
char string[160]
Definition: util.h:11
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYCOMMISSION)(VOID)
Definition: fxldr.h:55
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2789
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define DRIVER_OBJECT_EXTENSION_IDENTIFIER
Definition: version.cpp:36
#define KMDF_DEVICE_NAME
Definition: version.cpp:234
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1697
#define REGISTRY_KMDF_BUILD_NUMBER
Definition: version.cpp:40
#define EVTLOG_MESSAGE_SIZE
Definition: version.cpp:438
#define NULL
Definition: types.h:112
#define FILE_DEVICE_UNKNOWN
Definition: winioctl.h:140
UNICODE_STRING ParametersRegistryPath
Definition: version.cpp:170
FX_POOL * typeFX_POOL
Definition: version.cpp:67
_Must_inspect_result_ NTSTATUS WdfRegisterLibrary(__in PWDF_LIBRARY_INFO LibraryInfo, __in PUNICODE_STRING ServicePath, __in PCUNICODE_STRING LibraryDeviceName)
VOID FxLibraryCleanup(VOID)
Definition: version.cpp:293
#define IRP_MJ_CLEANUP
Definition: name.c:38
#define __deref_out
Definition: dbghelp.h:26
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2286
struct _CLIENT_INFO * PCLIENT_INFO
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:598
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define STATUS_SUCCESS
Definition: shellext.h:65
_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
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1060
#define __in
Definition: dbghelp.h:35
#define REG_DWORD
Definition: sdbapi.c:596
static SERVICE_STATUS status
Definition: service.c:31
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1018
WDF_MINOR_VERSION Minor
Definition: fxldr.h:123
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define __Print(_x_)
#define DELETE
Definition: nt_native.h:57
__drv_dispatchType(IRP_MJ_CREATE) __drv_dispatchType(IRP_MJ_CLEANUP) __drv_dispatchType(IRP_MJ_CLOSE) DRIVER_DISPATCH FxLibraryDispatch
_Must_inspect_result_ NTSTATUS(* PFNLIBRARYUNREGISTERCLIENT)(__in PWDF_BIND_INFO Info, __in PWDF_COMPONENT_GLOBALS DriverGlobals)
Definition: fxldr.h:78
Definition: ps.c:97
GLuint const GLchar * name
Definition: glext.h:6031