ReactOS 0.4.15-dev-8393-g61b7fb9
fxdriverapium.cpp File Reference
#include "coreprivshared.hpp"
#include <ntverp.h>
#include "FxDriverApiUm.tmh"
Include dependency graph for fxdriverapium.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS WDFEXPORT(WdfDriverOpenParametersRegistryKey)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxPointerNotNull (pFxDriverGlobals, Key)
 
 if (!NT_SUCCESS(status))
 
 FxObjectHandleGetPtr (pFxDriverGlobals, Driver, FX_TYPE_DRIVER,(PVOID *) &pDriver)
 
 if (pKey==NULL)
 
 if (NT_SUCCESS(status))
 
 __drv_maxIRQL (DISPATCH_LEVEL) PDRIVER_OBJECT WDFEXPORT(WdfDriverWdmGetDriverObject)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 UNREFERENCED_PARAMETER (DriverGlobals)
 
 UNREFERENCED_PARAMETER (Driver)
 
 ASSERTMSG ("Not implemented for UMDF\n", FALSE)
 
 UNREFERENCED_PARAMETER (DriverObject)
 
VOID WDFEXPORT() WdfDriverMiniportUnload (__in PWDF_DRIVER_GLOBALS DriverGlobals, __in WDFDRIVER Driver)
 
 UNREFERENCED_PARAMETER (Attributes)
 
 UNREFERENCED_PARAMETER (DeviceObject)
 
 UNREFERENCED_PARAMETER (AttachedDeviceObject)
 
 UNREFERENCED_PARAMETER (Pdo)
 
 UNREFERENCED_PARAMETER (Device)
 

Variables

_Must_inspect_result_ __in WDFDRIVER Driver
 
_Must_inspect_result_ __in WDFDRIVER __in ACCESS_MASK DesiredAccess
 
_Must_inspect_result_ __in WDFDRIVER __in ACCESS_MASK __in_opt PWDF_OBJECT_ATTRIBUTES KeyAttributes
 
_Must_inspect_result_ __in WDFDRIVER __in ACCESS_MASK __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFKEY * Key
 
LONG result
 
PFX_DRIVER_GLOBALS pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
FxDriverpDriver
 
FxRegKeypKey = new(pFxDriverGlobals, KeyAttributes) FxRegKey(pFxDriverGlobals)
 
HKEY hKey = NULL
 
WDFKEY keyHandle
 
 status = FxVerifierCheckIrqlLevel(pFxDriverGlobals, PASSIVE_LEVEL)
 
return NULL
 
__in PDRIVER_OBJECT DriverObject
 
_Must_inspect_result_ __in WDFDRIVER __in_opt PWDF_OBJECT_ATTRIBUTES Attributes
 
_Must_inspect_result_ __in WDFDRIVER __in_opt PWDF_OBJECT_ATTRIBUTES __in PDEVICE_OBJECT DeviceObject
 
_Must_inspect_result_ __in WDFDRIVER __in_opt PWDF_OBJECT_ATTRIBUTES __in PDEVICE_OBJECT __in_opt PDEVICE_OBJECT AttachedDeviceObject
 
_Must_inspect_result_ __in WDFDRIVER __in_opt PWDF_OBJECT_ATTRIBUTES __in PDEVICE_OBJECT __in_opt PDEVICE_OBJECT __in_opt PDEVICE_OBJECT Pdo
 
_Must_inspect_result_ __in WDFDRIVER __in_opt PWDF_OBJECT_ATTRIBUTES __in PDEVICE_OBJECT __in_opt PDEVICE_OBJECT __in_opt PDEVICE_OBJECT __out WDFDEVICE * Device
 
return STATUS_NOT_IMPLEMENTED
 

Function Documentation

◆ __drv_maxIRQL() [1/2]

__drv_maxIRQL ( DISPATCH_LEVEL  )

◆ __drv_maxIRQL() [2/2]

_Must_inspect_result_ __drv_maxIRQL ( PASSIVE_LEVEL  )

◆ ASSERTMSG()

ASSERTMSG ( "Not implemented for UMDF\n"  ,
FALSE   
)

◆ FxObjectHandleGetPtr()

FxObjectHandleGetPtr ( pFxDriverGlobals  ,
Driver  ,
FX_TYPE_DRIVER  ,
(PVOID *) &  pDriver 
)

◆ FxPointerNotNull()

FxPointerNotNull ( pFxDriverGlobals  ,
Key   
)

◆ if() [1/3]

if ( NT_SUCCESSstatus)

Definition at line 69 of file fxdriverapium.cpp.

69 {
70 return status;
71 }
status

◆ if() [2/3]

if ( NT_SUCCESS(status )

Definition at line 89 of file fxdriverapium.cpp.

89 {
91 //
92 // These access rights are not allowed. This restriction is
93 // imposed by the host process and the reflector driver.
94 //
95 // Even though the maximum-permissions handle is already opened,
96 // we fail so that the caller knows not to assume it has the
97 // GENERIC_WRITE, KEY_CREATE_SUB_KEY, or WRITE_DAC permissions.
98 //
102 "Could not open '%s' service parameters key "
103 "with access rights 0x%x, %!STATUS!",
104 pFxDriverGlobals->Public.DriverName,
106 } else if ((DesiredAccess & ~(KEY_READ | GENERIC_READ)) == 0) {
107 //
108 // If caller requested read-only access, open a new handle
109 // to the parameters key, no reason to give more privileges
110 // than needed.
111 //
112 result = RegOpenKeyEx(pDriver->GetDriverParametersKey(),
113 L"",
114 0,
116 &hKey);
118 if (!NT_SUCCESS(status)) {
121 "Could not open '%s' service parameters key "
122 "with access rights 0x%x, %!STATUS!",
123 pFxDriverGlobals->Public.DriverName,
125 }
126 } else {
127 //
128 // If caller requested write access, give it the pre-opened
129 // handle, since we do not have permission to open this key
130 // with write access rights from user mode.
131 //
132 hKey = pDriver->GetDriverParametersKey();
133
134 //
135 // Mark the registry key handle such that it won't be closed
136 // when this FxRegKey is deleted. We might need the handle again
137 // for future calls to WdfDriverOpenParametersRegistryKey.
138 //
140 }
141
142 if (NT_SUCCESS(status)) {
144 *Key = keyHandle;
145 }
146 }
__inline VOID SetHandle(__in HANDLE Key)
Definition: fxregkey.hpp:94
VOID __inline SetCanCloseHandle(BOOLEAN CanCloseHandle)
Definition: fxregkey.hpp:277
#define TRACINGDRIVER
Definition: dbgtrace.h:68
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define GENERIC_READ
Definition: compat.h:135
NTSTATUS WinErrorToNtStatus(__in ULONG WinError)
Definition: errtostatus.cpp:60
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxDriver * pDriver
HKEY hKey
WDFKEY keyHandle
FxRegKey * pKey
PFX_DRIVER_GLOBALS pFxDriverGlobals
GLuint64EXT * result
Definition: glext.h:11304
#define WRITE_DAC
Definition: nt_native.h:59
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1018
#define GENERIC_WRITE
Definition: nt_native.h:90
#define L(x)
Definition: ntvdm.h:50
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
#define RegOpenKeyEx
Definition: winreg.h:520

◆ if() [3/3]

if ( pKey  = NULL)

Definition at line 84 of file fxdriverapium.cpp.

84 {
86 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

◆ UNREFERENCED_PARAMETER() [1/8]

UNREFERENCED_PARAMETER ( AttachedDeviceObject  )

◆ UNREFERENCED_PARAMETER() [2/8]

UNREFERENCED_PARAMETER ( Attributes  )

◆ UNREFERENCED_PARAMETER() [3/8]

UNREFERENCED_PARAMETER ( Device  )

◆ UNREFERENCED_PARAMETER() [4/8]

UNREFERENCED_PARAMETER ( DeviceObject  )

◆ UNREFERENCED_PARAMETER() [5/8]

UNREFERENCED_PARAMETER ( Driver  )

◆ UNREFERENCED_PARAMETER() [6/8]

UNREFERENCED_PARAMETER ( DriverGlobals  )

◆ UNREFERENCED_PARAMETER() [7/8]

UNREFERENCED_PARAMETER ( DriverObject  )

◆ UNREFERENCED_PARAMETER() [8/8]

UNREFERENCED_PARAMETER ( Pdo  )

◆ WdfDriverMiniportUnload()

VOID WDFEXPORT() WdfDriverMiniportUnload ( __in PWDF_DRIVER_GLOBALS  DriverGlobals,
__in WDFDRIVER  Driver 
)

Definition at line 194 of file fxdriverapium.cpp.

200{
201 DDI_ENTRY();
202
205
206 ASSERTMSG("Not implemented for UMDF\n", FALSE);
207}
DriverGlobals
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_Must_inspect_result_ _In_ WDFDRIVER Driver
Definition: wdfcontrol.h:83

Variable Documentation

◆ AttachedDeviceObject

◆ Attributes

◆ DesiredAccess

◆ Device

◆ DeviceObject

◆ Driver

Initial value:

Definition at line 45 of file fxdriverapium.cpp.

◆ DriverObject

Initial value:

Definition at line 180 of file fxdriverapium.cpp.

◆ hKey

HKEY hKey = NULL

Definition at line 59 of file fxdriverapium.cpp.

Referenced by if().

◆ Key

* Key
Initial value:
{
LONG NTSTATUS
Definition: precomp.h:26

Definition at line 51 of file fxdriverapium.cpp.

◆ KeyAttributes

◆ keyHandle

WDFKEY keyHandle

Definition at line 60 of file fxdriverapium.cpp.

Referenced by if().

◆ NULL

return NULL

Definition at line 171 of file fxdriverapium.cpp.

◆ Pdo

◆ pDriver

FxDriver* pDriver

Definition at line 57 of file fxdriverapium.cpp.

Referenced by if().

◆ pFxDriverGlobals

pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)

Definition at line 56 of file fxdriverapium.cpp.

Referenced by if().

◆ pKey

Definition at line 58 of file fxdriverapium.cpp.

Referenced by if().

◆ result

Definition at line 55 of file fxdriverapium.cpp.

◆ status

◆ STATUS_NOT_IMPLEMENTED

return STATUS_NOT_IMPLEMENTED

Definition at line 241 of file fxdriverapium.cpp.