ReactOS 0.4.15-dev-7693-gd0e2924
fxdeviceinitapi.cpp File Reference
#include "coreprivshared.hpp"
Include dependency graph for fxdeviceinitapi.cpp:

Go to the source code of this file.

Classes

struct  _WDF_PNPPOWER_EVENT_CALLBACKS_V1_9
 
struct  _WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5
 
struct  _WDF_PDO_EVENT_CALLBACKS_V1_9
 

Typedefs

typedef struct _WDF_PNPPOWER_EVENT_CALLBACKS_V1_9 WDF_PNPPOWER_EVENT_CALLBACKS_V1_9
 
typedef struct _WDF_PNPPOWER_EVENT_CALLBACKS_V1_9PWDF_PNPPOWER_EVENT_CALLBACKS_V1_9
 
typedef struct _WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5 WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5
 
typedef struct _WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5PWDF_POWER_POLICY_EVENT_CALLBACKS_V1_5
 
typedef struct _WDF_PDO_EVENT_CALLBACKS_V1_9 WDF_PDO_EVENT_CALLBACKS_V1_9
 
typedef struct _WDF_PDO_EVENT_CALLBACKS_V1_9PWDF_PDO_EVENT_CALLBACKS_V1_9
 

Functions

 __drv_maxIRQL (DISPATCH_LEVEL) VOID STDCALL WDFEXPORT(WdfDeviceInitFree)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxPointerNotNull (GetFxDriverGlobals(DriverGlobals), DeviceInit)
 
 if (DeviceInit->CreatedOnStack==FALSE)
 
 _IRQL_requires_max_ (PASSIVE_LEVEL) WDFAPI VOID STDCALL WDFEXPORT(WdfDeviceInitSetIoTypeEx)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
 Queries information details about a security descriptor.
 
 FxPointerNotNull (pFxDriverGlobals, DeviceInit)
 
 if (IoTypeConfig->Size !=sizeof(WDF_IO_TYPE_CONFIG))
 
DeviceInit AssignIoType (IoTypeConfig)
 
_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfDeviceInitAssignName)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 if (!NT_SUCCESS(status))
 
 if (DeviceName !=NULL)
 
 if (DeviceName==NULL)
 
return DeviceInit AssignName (DeviceInit->DriverGlobals, DeviceName)
 
 if (OrInValues)
 
 if ((DeviceCharacteristics &FILE_AUTOGENERATED_DEVICE_NAME) &&DeviceInit->DeviceName !=NULL)
 
 FxPointerNotNull (pFxDriverGlobals, FileObjectConfig)
 
 if (FileObjectConfig->Size !=sizeof(WDF_FILEOBJECT_CONFIG))
 
 switch (FileObjectConfig->AutoForwardCleanupClose)
 
 if (normalizedFileClass==WdfFileObjectInvalid||normalizedFileClass > WdfFileObjectWdfCannotUseFsContexts)
 
 if (pFxDriverGlobals->IsUserModeDriver &&(normalizedFileClass==WdfFileObjectWdfCanUseFsContext||normalizedFileClass==WdfFileObjectWdfCanUseFsContext2))
 
 if (FxIsFileObjectOptional(fileClass))
 
RtlCopyMemoryDeviceInit (DeviceInit->FileObject.Callbacks)
 
 if (FileObjectAttributes !=NULL)
 
 FxPointerNotNull (pFxDriverGlobals, RequestAttributes)
 
RtlCopyMemoryDeviceInit (WDF_OBJECT_ATTRIBUTES)
 
 if (SDDLString==NULL)
 
 if (DeviceInit->Security.Sddl==NULL)
 
return DeviceInit Security Sddl Assign (SDDLString)
 
 FxPointerNotNull (pFxDriverGlobals, DeviceClassGuid)
 
RtlCopyMemoryDeviceInit (GUID)
 
 FxPointerNotNull (pFxDriverGlobals, PnpPowerEventCallbacks)
 
 if (PnpPowerEventCallbacks->Size !=sizeof(WDF_PNPPOWER_EVENT_CALLBACKS) &&PnpPowerEventCallbacks->Size !=sizeof(_WDF_PNPPOWER_EVENT_CALLBACKS_V1_9))
 
 if (PnpPowerEventCallbacks->Size > sizeof(WDF_PNPPOWER_EVENT_CALLBACKS_V1_9) &&PnpPowerEventCallbacks->EvtDeviceUsageNotification !=NULL &&PnpPowerEventCallbacks->EvtDeviceUsageNotificationEx !=NULL)
 
 FxPointerNotNull (pFxDriverGlobals, PowerPolicyEventCallbacks)
 
 if (PowerPolicyEventCallbacks->Size !=sizeof(WDF_POWER_POLICY_EVENT_CALLBACKS) &&PowerPolicyEventCallbacks->Size !=sizeof(WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5))
 
 if (PowerPolicyEventCallbacks->Size > sizeof(WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5) &&PowerPolicyEventCallbacks->EvtDeviceArmWakeFromSx !=NULL &&PowerPolicyEventCallbacks->EvtDeviceArmWakeFromSxWithReason !=NULL)
 
 FxPointerNotNull (pFxDriverGlobals, EvtDevicePnpStateChange)
 
 if (normalizedState< WdfDevStatePnpObjectCreated||normalizedState > WdfDevStatePnpNull)
 
 if ((CallbackTypes &~StateNotificationAllStates) !=0||CallbackTypes==0x0)
 
 if (DeviceInit->PnpPower.PnpStateCallbacks==NULL)
 
 FxPointerNotNull (pFxDriverGlobals, EvtDevicePowerStateChange)
 
 if (normalizedState< WdfDevStatePowerObjectCreated||normalizedState >=WdfDevStatePowerNull)
 
 FxPointerNotNull (pFxDriverGlobals, EvtDevicePowerPolicyStateChange)
 
 if (normalizedState< WdfDevStatePwrPolObjectCreated||normalizedState >=WdfDevStatePwrPolNull)
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PFN_WDFDEVICE_WDM_IRP_PREPROCESS __in UCHAR __drv_when (NumMinorFunctions > 0, __in_bcount(NumMinorFunctions)) __drv_when(NumMinorFunctions
 
 FxPointerNotNull (pFxDriverGlobals, EvtDeviceWdmIrpPreprocess)
 
 if (NumMinorFunctions > 0)
 
 if (MajorFunction >=ARRAY_SIZE(DeviceInit->PreprocessInfo->Dispatch))
 
 FxPointerNotNull (GetFxDriverGlobals(DriverGlobals), EvtIoInCallerContext)
 
 FxPointerNotNull (fxDriverGlobals, DeviceInit)
 
 FxPointerNotNull (fxDriverGlobals, RemoveLockOptions)
 
 if (RemoveLockOptions->Size !=sizeof(WDF_REMOVE_LOCK_OPTIONS))
 
 if ((RemoveLockOptions->Flags &~validFlags) !=0)
 
 if (FxDeviceInitTypeControlDevice==DeviceInit->InitType)
 
 if ((ReleaseHardwareOrderOnFailure==WdfReleaseHardwareOrderOnFailureInvalid)||(ReleaseHardwareOrderOnFailure > WdfReleaseHardwareOrderOnFailureAfterDescendants))
 
 _IRQL_requires_max_ (DISPATCH_LEVEL) VOID STDCALL WDFEXPORT(WdfDeviceInitAllowSelfIoTarget)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
 
 if (DeviceInit->IsNotFdoInit())
 
return reinterpret_cast< PDEVICE_OBJECT > (DeviceInit->Fdo.PhysicalDevice)
 
 FxPointerNotNull (pFxDriverGlobals, Key)
 
 if (!NT_SUCCESS(FxVerifierCheckIrqlLevel(pFxDriverGlobals, PASSIVE_LEVEL)))
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in ULONG __out_bcount_full_opt (BufferLength) PVOID PropertyBuffer
 
 FxPointerNotNull (pFxDriverGlobals, ResultLength)
 
 if (BufferLength > 0)
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in __drv_strictTypeMatch (__drv_typeExpr) POOL_TYPE PoolType
 
 FxPointerNotNull (pFxDriverGlobals, PropertyMemory)
 
 FxVerifierCheckNxPoolType (pFxDriverGlobals, PoolType, pFxDriverGlobals->Tag)
 
 FxPointerNotNull (pFxDriverGlobals, FdoEventCallbacks)
 
 if (FdoEventCallbacks->Size !=sizeof(WDF_FDO_EVENT_CALLBACKS))
 
 if (FdoEventCallbacks->EvtDeviceFilterAddResourceRequirements !=NULL &&FdoEventCallbacks->EvtDeviceRemoveAddedResources==NULL)
 
RtlCopyMemoryDeviceInit (DeviceInit->Fdo.EventCallbacks)
 
 FxPointerNotNull (pFxDriverGlobals, Config)
 
 if (DefaultDeviceListAttributes !=NULL)
 
RtlCopyMemoryDeviceInit (WDF_CHILD_LIST_CONFIG)
 
 FxPointerNotNull (pFxDriverGlobals, DeviceProperty)
 
 if (DeviceProperty->Size !=sizeof(WDF_DEVICE_PROPERTY_DATA))
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), ParentDevice, FX_TYPE_DEVICE,(PVOID *) &pDevice, &pFxDriverGlobals)
 
 if (pDevice->IsFdo()==FALSE)
 
 if (pInit==NULL)
 
pInit SetPdo (pDevice)
 
 FxPointerNotNull (pFxDriverGlobals, DispatchTable)
 
 if (DispatchTable->Size !=sizeof(WDF_PDO_EVENT_CALLBACKS) &&DispatchTable->Size !=sizeof(WDF_PDO_EVENT_CALLBACKS_V1_9))
 
RtlCopyMemoryDeviceInit (WDF_PDO_EVENT_CALLBACKS)
 
 FxPointerNotNull (pFxDriverGlobals, DeviceID)
 
 if (DeviceInit->Pdo.DeviceID==NULL)
 
 if (pID==NULL)
 
 if (NT_SUCCESS(status))
 
pID Release ()
 
 FxPointerNotNull (pFxDriverGlobals, DeviceLocation)
 
 if (pDeviceText==NULL)
 
 if (pDeviceText->m_Description==NULL)
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), Driver, FX_TYPE_DRIVER,(PVOID *) &pDriver, &pFxDriverGlobals)
 
 FxPointerNotNull (pFxDriverGlobals, SDDLString)
 
 FxPointerNotNull (pFxDriverGlobals, Notification)
 
 if ((Flags &~(WdfDeviceShutdown|WdfDeviceLastChanceShutdown)) !=0)
 

Variables

__in PWDFDEVICE_INIT DeviceInit
 
__in PWDFDEVICE_INIT __in WDF_DEVICE_IO_TYPE IoType
 
WDF_IO_TYPE_CONFIG ioTypeConfig
 
ioTypeConfig ReadWriteIoType = IoType
 
_In_ PWDFDEVICE_INIT _In_ PWDF_IO_TYPE_CONFIG IoTypeConfig
 
NTSTATUS status
 
PFX_DRIVER_GLOBALS pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
 
__in PWDFDEVICE_INIT __in DEVICE_TYPE DeviceType
 
DeviceInit PowerPageable = FALSE
 
DeviceInit Inrush = TRUE
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in_opt PCUNICODE_STRING DeviceName
 
__in PWDFDEVICE_INIT __in ULONG DeviceCharacteristics
 
__in PWDFDEVICE_INIT __in ULONG __in BOOLEAN OrInValues
 
 else
 
__in PWDFDEVICE_INIT __in PWDF_FILEOBJECT_CONFIG FileObjectConfig
 
__in PWDFDEVICE_INIT __in PWDF_FILEOBJECT_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES FileObjectAttributes
 
WDF_FILEOBJECT_CLASS normalizedFileClass = FxFileObjectClassNormalize(fileClass)
 
WDF_FILEOBJECT_CLASS fileClass = FileObjectConfig->FileObjectClass
 
DeviceInit FileObject Set = TRUE
 
DeviceInit FileObject AutoForwardCleanupClose
 
DeviceInit FileObject Class = fileClass
 
__in PWDFDEVICE_INIT __in PWDF_OBJECT_ATTRIBUTES RequestAttributes
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in_opt PCUNICODE_STRING SDDLString
 
__in PWDFDEVICE_INIT __in CONST GUIDDeviceClassGuid
 
DeviceInit Security DeviceClassSet = TRUE
 
__in PWDFDEVICE_INIT __in PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks
 
__in PWDFDEVICE_INIT __in PWDF_POWER_POLICY_EVENT_CALLBACKS PowerPolicyEventCallbacks
 
__in PWDFDEVICE_INIT __in BOOLEAN IsPowerPolicyOwner
 
DeviceInit PnpPower PowerPolicyOwner = IsPowerPolicyOwner ? WdfTrue : WdfFalse
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_PNP_STATE PnpState
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_PNP_STATE __in PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION EvtDevicePnpStateChange
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_PNP_STATE __in PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION __in ULONG CallbackTypes
 
FxPnpStateCallbackInfopCallback
 
ULONG normalizedState = WdfDevStateNormalize(PnpState)
 
pCallback Callback = EvtDevicePnpStateChange
 
pCallback Types = CallbackTypes
 
return STATUS_SUCCESS
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_POWER_STATE PowerState
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_POWER_STATE __in PFN_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION EvtDevicePowerStateChange
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_POWER_POLICY_STATE PowerPolicyState
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_POWER_POLICY_STATE __in PFN_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION EvtDevicePowerPolicyStateChange
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PFN_WDFDEVICE_WDM_IRP_PREPROCESS EvtDeviceWdmIrpPreprocess
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PFN_WDFDEVICE_WDM_IRP_PREPROCESS __in UCHAR MajorFunction
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PFN_WDFDEVICE_WDM_IRP_PREPROCESS __in UCHAR __in_opt PUCHAR MinorFunctions
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PFN_WDFDEVICE_WDM_IRP_PREPROCESS __in UCHAR __in_opt PUCHAR __in ULONG NumMinorFunctions
 
DeviceInit PreprocessInfo Dispatch[MajorFunctionEvtDevicePreprocess
 
__in PWDFDEVICE_INIT __in PFN_WDF_IO_IN_CALLER_CONTEXT EvtIoInCallerContext
 
DeviceInit IoInCallerContextCallback = EvtIoInCallerContext
 
 return
 
__in PWDFDEVICE_INIT __in PWDF_REMOVE_LOCK_OPTIONS RemoveLockOptions
 
PFX_DRIVER_GLOBALS fxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
ULONG validFlags = WDF_REMOVE_LOCK_OPTION_ACQUIRE_FOR_IO
 
DeviceInit RemoveLockOptionFlags = RemoveLockOptions->Flags
 
Done __pad0__
 
__in PWDFDEVICE_INIT __in WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE ReleaseHardwareOrderOnFailure
 
DeviceInit RequiresSelfIoTarget = TRUE
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in ULONG DeviceInstanceKeyType
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in ULONG __in ACCESS_MASK DesiredAccess
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in ULONG __in ACCESS_MASK __in_opt PWDF_OBJECT_ATTRIBUTES KeyAttributes
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in ULONG __in ACCESS_MASK __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFKEY * Key
 
DeviceInit Fdo Filter = TRUE
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY DeviceProperty
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in ULONG BufferLength
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in ULONG __out PULONG ResultLength
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in __in_opt PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFMEMORY * PropertyMemory
 
__in PWDFDEVICE_INIT __in PWDF_FDO_EVENT_CALLBACKS FdoEventCallbacks
 
__inout PWDFDEVICE_INIT __in PWDF_CHILD_LIST_CONFIG Config
 
__inout PWDFDEVICE_INIT __in PWDF_CHILD_LIST_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES DefaultDeviceListAttributes
 
size_t totalDescriptionSize = 0
 
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID PropertyBuffer
 
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG _Out_ PDEVPROPTYPE Type
 
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PWDF_DEVICE_PROPERTY_DATA _In_ _Strict_type_match_ POOL_TYPE PoolType
 
_Must_inspect_result_ __in WDFDEVICE ParentDevice
 
PWDFDEVICE_INIT pInit = new(pFxDriverGlobals) WDFDEVICE_INIT(pDevice->GetDriver())
 
FxDevicepDevice
 
pInit Pdo Static = TRUE
 
__in PWDFDEVICE_INIT __in PWDF_PDO_EVENT_CALLBACKS DispatchTable
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING DeviceID
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING InstanceID
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING HardwareID
 
FxStringpID = new(pFxDriverGlobals, WDF_NO_OBJECT_ATTRIBUTES) FxString(pFxDriverGlobals)
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING CompatibleID
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING ContainerID
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING DeviceDescription
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING __in PCUNICODE_STRING DeviceLocation
 
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING __in PCUNICODE_STRING __in LCID LocaleId
 
FxDeviceTextpDeviceText = new(pFxDriverGlobals, PagedPool) FxDeviceText()
 
pDeviceText m_LocaleId = LocaleId
 
pDeviceText m_Description
 
pDeviceText m_LocationInformation
 
*DeviceInit Pdo LastDeviceTextEntry = &pDeviceText->m_Entry
 
Done __pad1__
 
DeviceInit Pdo DefaultLocale = LocaleId
 
DeviceInit Pdo Raw = TRUE
 
DeviceInit Pdo ForwardRequestToParent = TRUE
 
_Must_inspect_result_ __in WDFDRIVER Driver
 
FxDriverpDriver
 
__in PWDFDEVICE_INIT __in PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
 
__in PWDFDEVICE_INIT __in PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION __in UCHAR Flags
 
DeviceInit Control ShutdownNotification = Notification
 

Typedef Documentation

◆ PWDF_PDO_EVENT_CALLBACKS_V1_9

◆ PWDF_PNPPOWER_EVENT_CALLBACKS_V1_9

◆ PWDF_POWER_POLICY_EVENT_CALLBACKS_V1_5

◆ WDF_PDO_EVENT_CALLBACKS_V1_9

◆ WDF_PNPPOWER_EVENT_CALLBACKS_V1_9

◆ WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5

Function Documentation

◆ __drv_maxIRQL() [1/2]

__drv_maxIRQL ( DISPATCH_LEVEL  )

◆ __drv_maxIRQL() [2/2]

_Must_inspect_result_ __drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_strictTypeMatch()

_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in __drv_strictTypeMatch ( __drv_typeExpr  )

◆ __drv_when()

◆ __out_bcount_full_opt()

◆ _IRQL_requires_max_() [1/2]

_IRQL_requires_max_ ( DISPATCH_LEVEL  )

Definition at line 347 of file hardware.c.

1709{
1710 SendKey();
1712}
static VOID SendKey(VOID)
Definition: hardware.c:332
static VOID Wake(_In_ UCHAR Csn)
Definition: hardware.c:149
_In_ PISAPNP_LOGICAL_DEVICE LogicalDevice
Definition: isapnp.h:399

◆ _IRQL_requires_max_() [2/2]

_IRQL_requires_max_ ( PASSIVE_LEVEL  )

Queries information details about a security descriptor.

Computes the quota size of a security descriptor.

Assigns a security descriptor for a new object.

An extended function that assigns a security descriptor for a new object.

Frees a security descriptor.

An extended function that sets new information data to a security descriptor.

Modifies some information data about a security descriptor.

Parameters
[in]SecurityInformationSecurity information details to be queried from a security descriptor.
[out]SecurityDescriptorThe returned security descriptor with security information data.
[in,out]LengthThe returned length of a security descriptor.
[in,out]ObjectsSecurityDescriptorThe returned object security descriptor.
Returns
Returns STATUS_SUCCESS if the operations have been completed successfully and that the specific information about the security descriptor has been queried. STATUS_BUFFER_TOO_SMALL is returned if the buffer size is too small to contain the queried info about the security descriptor.
Parameters
[in]ObjectIf specified, the function will use this arbitrary object that points to an object security descriptor.
[in]SecurityInformationSecurity information details to be set.
[in]SecurityDescriptorA security descriptor where its info is to be changed.
[in,out]ObjectsSecurityDescriptorThe returned pointer to security descriptor objects.
[in]PoolTypePool type for the new security descriptor to allocate.
[in]GenericMappingThe generic mapping of access rights masks.
Returns
See SeSetSecurityDescriptorInfoEx.
Parameters
[in]ObjectIf specified, the function will use this arbitrary object that points to an object security descriptor.
[in]SecurityInformationSecurity information details to be set.
[in]SecurityDescriptorA security descriptor where its info is to be changed.
[in,out]ObjectsSecurityDescriptorThe returned pointer to security descriptor objects.
[in]AutoInheritFlagsFlags bitmask inheritation, influencing how the security descriptor can be inherited and if it can be in the first place.
[in]PoolTypePool type for the new security descriptor to allocate.
[in]GenericMappingThe generic mapping of access rights masks.
Returns
Returns STATUS_SUCCESS if the operations have been completed without problems and that new info has been set to the security descriptor. STATUS_NO_SECURITY_ON_OBJECT is returned if the object does not have a security descriptor. STATUS_INSUFFICIENT_RESOURCES is returned if memory pool allocation for the new security descriptor with new info set has failed.
Parameters
[in]SecurityDescriptorA security descriptor to be freed from memory.
Returns
Returns STATUS_SUCCESS.
Parameters
[in]_ParentDescriptorA security descriptor of the parent object that is being created.
[in]_ExplicitDescriptorAn explicit security descriptor that is applied to a new object.
[out]NewDescriptorThe new allocated security descriptor.
[in]ObjectTypeThe type of the new object.
[in]IsDirectoryObjectSet this to TRUE if the newly created object is a directory object, otherwise set this to FALSE.
[in]AutoInheritFlagsAutomatic inheritance flags that influence how access control entries within ACLs from security descriptors are inherited.
[in]SubjectContextSecurity subject context of the new object.
[in]GenericMappingGeneric mapping of access mask rights.
[in]PoolTypeThis parameter is unused.
Returns
Returns STATUS_SUCCESS if the operations have been completed successfully and that the security descriptor has been assigned to the new object. STATUS_NO_TOKEN is returned if the caller hasn't supplied a valid argument to a security subject context. STATUS_INVALID_OWNER is returned if the caller hasn't supplied a parent descriptor that belongs to the main user (owner). STATUS_INVALID_PRIMARY_GROUP is returned by the same reason as with the previous NTSTATUS code. The two NTSTATUS codes are returned if the calling thread stated that the owner and/or group is defaulted to the parent descriptor (SEF_DEFAULT_OWNER_FROM_PARENT and/or SEF_DEFAULT_GROUP_FROM_PARENT respectively). STATUS_INSUFFICIENT_RESOURCES is returned if memory pool allocation for the descriptor buffer has failed. A failure NTSTATUS is returned otherwise.
Parameters
[in]ParentDescriptorA security descriptor of the parent object that is being created.
[in]ExplicitDescriptorAn explicit security descriptor that is applied to a new object.
[out]NewDescriptorThe new allocated security descriptor.
[in]IsDirectoryObjectSet this to TRUE if the newly created object is a directory object, otherwise set this to FALSE.
[in]SubjectContextSecurity subject context of the new object.
[in]GenericMappingGeneric mapping of access mask rights.
[in]PoolTypeThis parameter is unused.
Returns
See SeAssignSecurityEx.
Parameters
[in]SecurityDescriptorA security descriptor.
[out]QuotaInfoSizeThe returned quota size of the given security descriptor to the caller. The function may return 0 to this parameter if the descriptor doesn't have a group or a discretionary access control list (DACL) even.
Returns
Returns STATUS_SUCCESS if the quota size of a security descriptor has been computed successfully. STATUS_UNKNOWN_REVISION is returned if the security descriptor has an invalid revision.

Definition at line 923 of file Messaging.c.

75{
76 PFLT_SERVER_PORT_OBJECT PortObject;
78
79 /* The caller must allow at least one connection */
80 if (MaxConnections == 0)
81 {
83 }
84
85 /* The request must be for a kernel handle */
86 if (!(ObjectAttributes->Attributes & OBJ_KERNEL_HANDLE))
87 {
89 }
90
91 /*
92 * Get rundown protection on the target to stop the owner
93 * from unloading whilst this port object is open. It gets
94 * removed in the FltpServerPortClose callback
95 */
97 if (!NT_SUCCESS(Status))
98 {
99 return Status;
100 }
101
102 /* Create the server port object for this filter */
107 NULL,
109 0,
110 0,
111 (PVOID *)&PortObject);
112 if (NT_SUCCESS(Status))
113 {
114 /* Zero out the struct */
115 RtlZeroMemory(PortObject, sizeof(FLT_SERVER_PORT_OBJECT));
116
117 /* Increment the ref count on the target filter */
119
120 /* Setup the filter port object */
121 PortObject->Filter = Filter;
125 PortObject->Cookie = ServerPortCookie;
126 PortObject->MaxConnections = MaxConnections;
127
128 /* Insert the object */
129 Status = ObInsertObject(PortObject,
130 NULL,
132 0,
133 NULL,
135 if (NT_SUCCESS(Status))
136 {
137 /* Lock the connection list */
139
140 /* Add the new port object to the connection list and increment the count */
143
144 /* Unlock the connection list*/
146 }
147 }
148
149 if (!NT_SUCCESS(Status))
150 {
151 /* Allow the filter to be cleaned up */
153 }
154
155 return Status;
156}
static const INTERNET_PORT ServerPort
Definition: CWebService.cpp:11
POBJECT_TYPE ServerPortObjectType
Definition: Messaging.c:24
VOID FLTAPI FltObjectDereference(_Inout_ PVOID Object)
Definition: Object.c:53
NTSTATUS FLTAPI FltObjectReference(_Inout_ PVOID Object)
Definition: Object.c:41
LONG NTSTATUS
Definition: precomp.h:26
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define InsertTailList(ListHead, Entry)
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY _In_opt_ PFLT_MESSAGE_NOTIFY MessageNotifyCallback
Definition: fltkernel.h:1877
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback
Definition: fltkernel.h:1875
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID ServerPortCookie
Definition: fltkernel.h:1874
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback
Definition: fltkernel.h:1876
ULONG FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
Definition: Object.c:322
Status
Definition: gdiplustypes.h:25
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:23
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:31
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
static LONG MaxConnections
#define KernelMode
Definition: asm.h:34
#define FILE_READ_DATA
Definition: nt_native.h:628
#define STANDARD_RIGHTS_ALL
Definition: nt_native.h:69
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
Definition: obhandle.c:2935
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
Definition: oblife.c:1039
FLT_MUTEX_LIST_HEAD ConnectionList
Definition: fltmgrint.h:121
LIST_ENTRY mList
Definition: fltmgrint.h:56
FAST_MUTEX mLock
Definition: fltmgrint.h:55
PFLT_DISCONNECT_NOTIFY DisconnectNotify
Definition: fltmgrint.h:192
PFLT_MESSAGE_NOTIFY MessageNotify
Definition: fltmgrint.h:193
PFLT_CONNECT_NOTIFY ConnectNotify
Definition: fltmgrint.h:191
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

◆ Assign()

return DeviceInit Security Sddl Assign ( SDDLString  )

◆ AssignIoType()

DeviceInit AssignIoType ( IoTypeConfig  )

◆ AssignName()

return DeviceInit AssignName ( DeviceInit->  DriverGlobals,
DeviceName   
)

◆ DeviceInit() [1/6]

RtlCopyMemory & DeviceInit ( DeviceInit->Fdo.  EventCallbacks)

◆ DeviceInit() [2/6]

RtlCopyMemory & DeviceInit ( DeviceInit->FileObject.  Callbacks)

◆ DeviceInit() [3/6]

◆ DeviceInit() [4/6]

◆ DeviceInit() [5/6]

◆ DeviceInit() [6/6]

◆ FxObjectHandleGetPtrAndGlobals() [1/2]

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
Driver  ,
FX_TYPE_DRIVER  ,
(PVOID *) &  pDriver,
pFxDriverGlobals 
)

◆ FxObjectHandleGetPtrAndGlobals() [2/2]

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
ParentDevice  ,
FX_TYPE_DEVICE  ,
(PVOID *) &  pDevice,
pFxDriverGlobals 
)

◆ FxPointerNotNull() [1/25]

FxPointerNotNull ( fxDriverGlobals  ,
DeviceInit   
)

◆ FxPointerNotNull() [2/25]

FxPointerNotNull ( fxDriverGlobals  ,
RemoveLockOptions   
)

◆ FxPointerNotNull() [3/25]

FxPointerNotNull ( GetFxDriverGlobals(DriverGlobals ,
DeviceInit   
)

◆ FxPointerNotNull() [4/25]

FxPointerNotNull ( GetFxDriverGlobals(DriverGlobals ,
EvtIoInCallerContext   
)

◆ FxPointerNotNull() [5/25]

FxPointerNotNull ( pFxDriverGlobals  ,
Config   
)

◆ FxPointerNotNull() [6/25]

FxPointerNotNull ( pFxDriverGlobals  ,
DeviceClassGuid   
)

◆ FxPointerNotNull() [7/25]

FxPointerNotNull ( pFxDriverGlobals  ,
DeviceID   
)

◆ FxPointerNotNull() [8/25]

FxPointerNotNull ( pFxDriverGlobals  ,
DeviceInit   
)

◆ FxPointerNotNull() [9/25]

FxPointerNotNull ( pFxDriverGlobals  ,
DeviceLocation   
)

◆ FxPointerNotNull() [10/25]

FxPointerNotNull ( pFxDriverGlobals  ,
DeviceProperty   
)

◆ FxPointerNotNull() [11/25]

FxPointerNotNull ( pFxDriverGlobals  ,
DispatchTable   
)

◆ FxPointerNotNull() [12/25]

FxPointerNotNull ( pFxDriverGlobals  ,
EvtDevicePnpStateChange   
)

◆ FxPointerNotNull() [13/25]

FxPointerNotNull ( pFxDriverGlobals  ,
EvtDevicePowerPolicyStateChange   
)

◆ FxPointerNotNull() [14/25]

FxPointerNotNull ( pFxDriverGlobals  ,
EvtDevicePowerStateChange   
)

◆ FxPointerNotNull() [15/25]

FxPointerNotNull ( pFxDriverGlobals  ,
EvtDeviceWdmIrpPreprocess   
)

◆ FxPointerNotNull() [16/25]

FxPointerNotNull ( pFxDriverGlobals  ,
FdoEventCallbacks   
)

◆ FxPointerNotNull() [17/25]

FxPointerNotNull ( pFxDriverGlobals  ,
FileObjectConfig   
)

◆ FxPointerNotNull() [18/25]

FxPointerNotNull ( pFxDriverGlobals  ,
Key   
)

◆ FxPointerNotNull() [19/25]

FxPointerNotNull ( pFxDriverGlobals  ,
Notification   
)

◆ FxPointerNotNull() [20/25]

FxPointerNotNull ( pFxDriverGlobals  ,
PnpPowerEventCallbacks   
)

◆ FxPointerNotNull() [21/25]

FxPointerNotNull ( pFxDriverGlobals  ,
PowerPolicyEventCallbacks   
)

◆ FxPointerNotNull() [22/25]

FxPointerNotNull ( pFxDriverGlobals  ,
PropertyMemory   
)

◆ FxPointerNotNull() [23/25]

FxPointerNotNull ( pFxDriverGlobals  ,
RequestAttributes   
)

◆ FxPointerNotNull() [24/25]

FxPointerNotNull ( pFxDriverGlobals  ,
ResultLength   
)

◆ FxPointerNotNull() [25/25]

FxPointerNotNull ( pFxDriverGlobals  ,
SDDLString   
)

◆ FxVerifierCheckNxPoolType()

FxVerifierCheckNxPoolType ( pFxDriverGlobals  ,
PoolType  ,
pFxDriverGlobals->  Tag 
)

◆ if() [1/45]

if ( NT_SUCCESSFxVerifierCheckIrqlLevel(pFxDriverGlobals, PASSIVE_LEVEL))

Definition at line 1480 of file fxdeviceinitapi.cpp.

1481 {
1482 return;
1483 }

◆ if() [2/45]

if ( NT_SUCCESSstatus)

Definition at line 329 of file fxdeviceinitapi.cpp.

329 {
330 return status;
331 }
NTSTATUS status

◆ if() [3/45]

if ( (CallbackTypes &~StateNotificationAllStates) !  = 0 || CallbackTypes == 0x0)

Definition at line 890 of file fxdeviceinitapi.cpp.

891 {
893
895 "CallbackTypes is invalid %!STATUS!", status);
896
897 return status;
898 }
#define TRACINGDEVICE
Definition: dbgtrace.h:58
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97

◆ if() [4/45]

Definition at line 389 of file fxdeviceinitapi.cpp.

390 {
391 DeviceInit->DeviceName->RELEASE(NULL);
392 DeviceInit->DeviceName = NULL;
393 }
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113

◆ if() [5/45]

Definition at line 2743 of file fxdeviceinitapi.cpp.

2743 {
2745 "WdfDeviceShutdown Flags 0x%x are invalid", Flags);
2747 return;
2748 }
FxVerifierDbgBreakPoint(pFxDriverGlobals)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

◆ if() [6/45]

Definition at line 1327 of file fxdeviceinitapi.cpp.

1330 {
1333 "Out of range WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE %d",
1335 FxVerifierDbgBreakPoint(DeviceInit->DriverGlobals);
1336 return;
1337 }
_In_ PWDFDEVICE_INIT _In_ WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE ReleaseHardwareOrderOnFailure
Definition: wdfdevice.h:4365

◆ if() [7/45]

if ( (RemoveLockOptions->Flags &~validFlags) !  = 0)

Definition at line 1280 of file fxdeviceinitapi.cpp.

1280 {
1281 //
1282 // Invalid flag
1283 //
1285 "RemoveLockOptions %p Flags 0x%x invalid, "
1286 "valid mask is 0x%x",
1288 validFlags);
1289
1291 goto Done;
1292 }
#define TRACINGAPIERROR
Definition: dbgtrace.h:60
ULONG validFlags
__in PWDFDEVICE_INIT __in PWDF_REMOVE_LOCK_OPTIONS RemoveLockOptions
PFX_DRIVER_GLOBALS fxDriverGlobals

◆ if() [8/45]

if ( BufferLength  ,
 
)

Definition at line 1545 of file fxdeviceinitapi.cpp.

1545 {
1547 }
#define FxPointerNotNull(FxDriverGlobals, Ptr)
Definition: fxmacros.hpp:253
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID PropertyBuffer
Definition: wdfdevice.h:4437

◆ if() [9/45]

Definition at line 1766 of file fxdeviceinitapi.cpp.

1766 {
1770 if (!NT_SUCCESS(status)) {
1772 return;
1773 }
1774
1775 RtlCopyMemory(&DeviceInit->Fdo.ListConfigAttributes,
1777 sizeof(DeviceInit->Fdo.ListConfigAttributes));
1778 }
__inout PWDFDEVICE_INIT __in PWDF_CHILD_LIST_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES DefaultDeviceListAttributes
@ FX_VALIDATE_OPTION_PARENT_NOT_ALLOWED
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

◆ if() [10/45]

if ( DeviceInit->  CreatedOnStack = FALSE)

Definition at line 152 of file fxdeviceinitapi.cpp.

152 {
153 delete DeviceInit;
154 }
__in PWDFDEVICE_INIT DeviceInit

◆ if() [11/45]

if ( DeviceInit->  IsNotFdoInit())

Definition at line 1398 of file fxdeviceinitapi.cpp.

1398 {
1401 "Not a PWDFDEVICE_INIT for an FDO"
1402 );
1403
1404 return NULL;
1405 }

◆ if() [12/45]

if ( DeviceInit->Pdo.  DeviceID = NULL)

Definition at line 2173 of file fxdeviceinitapi.cpp.

2173 {
2176
2177 if (DeviceInit->Pdo.DeviceID == NULL) {
2180 "Couldn't allocate DeviceID object, %!STATUS!",
2181 status);
2182 return status;
2183 }
2184 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define WDF_NO_OBJECT_ATTRIBUTES
Definition: wdftypes.h:105

◆ if() [13/45]

if ( DeviceInit->PnpPower.  PnpStateCallbacks = NULL)

Definition at line 900 of file fxdeviceinitapi.cpp.

900 {
901
902 DeviceInit->PnpPower.PnpStateCallbacks =
904
905 if (DeviceInit->PnpPower.PnpStateCallbacks == NULL) {
907
910 "Couldn't create object PnpStateCallbacks %!STATUS!", status);
911
912 return status;
913 }
914 }

◆ if() [14/45]

if ( DeviceInit->Security.  Sddl = NULL)

Definition at line 655 of file fxdeviceinitapi.cpp.

655 {
656 DeviceInit->Security.Sddl = new(pFxDriverGlobals,
659
660 if (DeviceInit->Security.Sddl == NULL) {
663 "Couldn't create Security descriptor"
664 " STATUS_INSUFFICIENT_RESOURCES ");
665
667 }
668 }

◆ if() [15/45]

if ( DeviceName = NULL)

Definition at line 333 of file fxdeviceinitapi.cpp.

333 {
335 DeviceName);
336 if (!NT_SUCCESS(status)) {
337 return status;
338 }
339 }
_Must_inspect_result_ NTSTATUS __inline FxValidateUnicodeString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING String)
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275

◆ if() [16/45]

if ( DeviceName  = NULL)

Definition at line 341 of file fxdeviceinitapi.cpp.

341 {
342 if (DeviceInit->DeviceName != NULL) {
343 DeviceInit->DeviceName->RELEASE(NULL);
344 DeviceInit->DeviceName = NULL;
345 }
346
347 if (DeviceInit->IsPdoInit()) {
348 //
349 // Make sure a PDO has a name
350 //
351 DeviceInit->Characteristics |= FILE_AUTOGENERATED_DEVICE_NAME;
352 }
353
354 return STATUS_SUCCESS;
355 }
return STATUS_SUCCESS
#define FILE_AUTOGENERATED_DEVICE_NAME
Definition: iotypes.h:138

◆ if() [17/45]

Definition at line 1864 of file fxdeviceinitapi.cpp.

1864 {
1867 "PropertyData size (%d) incorrect, expected %d, %!STATUS!",
1868 DeviceProperty->Size,
1870 return status;
1871 }
#define TRACINGPNP
Definition: dbgtrace.h:67
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty
Definition: wdfdevice.h:3769

◆ if() [18/45]

Definition at line 2118 of file fxdeviceinitapi.cpp.

2119 {
2121 "DispatchTable size %d is invalid, expected %d",
2122 DispatchTable->Size, sizeof(WDF_PDO_EVENT_CALLBACKS));
2124 return; // STATUS_INFO_LENGTH_MISMATCH;
2125 }
_In_ PWDFDEVICE_INIT _In_ PWDF_PDO_EVENT_CALLBACKS DispatchTable
Definition: wdfpdo.h:248

◆ if() [19/45]

if ( FdoEventCallbacks->EvtDeviceFilterAddResourceRequirements !  = NULL && FdoEventCallbacks->EvtDeviceRemoveAddedResources == NULL)

Definition at line 1700 of file fxdeviceinitapi.cpp.

1701 {
1702 //
1703 // Not allowed to add resources without filtering them out later
1704 //
1707 "Must set EvtDeviceRemoveAddedResources if "
1708 "EvtDeviceFilterAddResourceRequirements (%p) is set",
1709 FdoEventCallbacks->EvtDeviceFilterAddResourceRequirements);
1710
1712 return;
1713 }
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
_In_ PWDFDEVICE_INIT _In_ PWDF_FDO_EVENT_CALLBACKS FdoEventCallbacks
Definition: wdffdo.h:376

◆ if() [20/45]

Definition at line 1690 of file fxdeviceinitapi.cpp.

1690 {
1693 "FdoEventCallbacks size %d is invalid, expected %d",
1695 );
1697 return;
1698 }

◆ if() [21/45]

Definition at line 560 of file fxdeviceinitapi.cpp.

560 {
561 RtlCopyMemory(&DeviceInit->FileObject.Attributes,
563 sizeof(DeviceInit->FileObject.Attributes));
564 }
_In_ PWDFDEVICE_INIT _In_ PWDF_FILEOBJECT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES FileObjectAttributes
Definition: wdfdevice.h:3400

◆ if() [22/45]

Definition at line 437 of file fxdeviceinitapi.cpp.

437 {
440 "Invalid FileObjectConfig Size %d, expected %d",
442
444 return;
445 }
_In_ PWDFDEVICE_INIT _In_ PWDF_FILEOBJECT_CONFIG FileObjectConfig
Definition: wdfdevice.h:3397

◆ if() [23/45]

if ( FxDeviceInitTypeControlDevice  = DeviceInit->InitType)

Definition at line 1294 of file fxdeviceinitapi.cpp.

1294 {
1295 //
1296 // At this time this feature is not supported on control-devices.
1297 //
1299 "WdfDeviceInitSetRemoveLockOptions is not "
1300 "supported on control devices");
1301
1303 goto Done;
1304 }

◆ if() [24/45]

Definition at line 536 of file fxdeviceinitapi.cpp.

536 {
537 switch(normalizedFileClass) {
541 break;
542
543 default:
546 "Invalid FileObjectConfig->FileObjectClass %d",
547 fileClass);
549 return;
550 break; // just in case static verification tools complain.
551 }
552 }
WDF_FILEOBJECT_CLASS fileClass
WDF_FILEOBJECT_CLASS normalizedFileClass
@ WdfFileObjectWdfCanUseFsContext
Definition: wdfdevice.h:461
@ WdfFileObjectWdfCanUseFsContext2
Definition: wdfdevice.h:462
@ WdfFileObjectWdfCannotUseFsContexts
Definition: wdfdevice.h:463

◆ if() [25/45]

Definition at line 203 of file fxdeviceinitapi.cpp.

203 {
206 "IoTypeConfig size (%d) incorrect, expected %d, %!STATUS!",
207 IoTypeConfig->Size,
208 sizeof(WDF_IO_TYPE_CONFIG), status);
209 return;
210 }
_In_ PWDFDEVICE_INIT _In_ PWDF_IO_TYPE_CONFIG IoTypeConfig
Definition: wdfdevice.h:4394

◆ if() [26/45]

if ( MajorFunction >=  ARRAY_SIZEDeviceInit->PreprocessInfo->Dispatch)

Definition at line 1125 of file fxdeviceinitapi.cpp.

1125 {
1127 "MajorFunction is invalid"
1128 "STATUS_INVALID_PARAMETER"
1129 );
1130
1132 }

◆ if() [27/45]

Definition at line 491 of file fxdeviceinitapi.cpp.

492 {
495 "Out of range FileObjectConfig->FileObjectClass %d",
496 fileClass);
498 return;
499 }

◆ if() [28/45]

Definition at line 881 of file fxdeviceinitapi.cpp.

881 {
883
885 "Pnp State is invalid %!STATUS!", status);
886
887 return status;
888 }

◆ if() [29/45]

Definition at line 961 of file fxdeviceinitapi.cpp.

962 {
964
966 "PowerState State is invalid %!STATUS!", status);
967
968 return status;
969 }

◆ if() [30/45]

Definition at line 1042 of file fxdeviceinitapi.cpp.

1043 {
1045
1048 "PowerPolicyState State is invalid %!STATUS!", status);
1049
1050 return status;
1051 }

◆ if() [31/45]

if ( NT_SUCCESS(status )

Definition at line 2302 of file fxdeviceinitapi.cpp.

2302 {
2303 status = (DeviceInit->Pdo.HardwareIDs.Add(pFxDriverGlobals, pID)) ?
2305 }
FxString * pID
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132

◆ if() [32/45]

if ( NumMinorFunctions  ,
 
)

Definition at line 1117 of file fxdeviceinitapi.cpp.

1117 {
1119 }
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PFN_WDFDEVICE_WDM_IRP_PREPROCESS _In_ UCHAR _In_opt_ PUCHAR MinorFunctions
Definition: wdfdevice.h:3465

◆ if() [33/45]

if ( OrInValues  )

Definition at line 379 of file fxdeviceinitapi.cpp.

379 {
381 }
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
_In_ WDFDEVICE _In_ ULONG DeviceCharacteristics
Definition: wdfdevice.h:2775

◆ if() [34/45]

if ( pDevice->  IsFdo() = FALSE)

Definition at line 2058 of file fxdeviceinitapi.cpp.

2058 {
2061 "Parent device is not a FDO (must use WDFCHILDLIST to use a PDO as a parent)"
2062 );
2063
2064 return NULL;
2065 }

◆ if() [35/45]

if ( pDeviceText->  m_Description = NULL)

Definition at line 2511 of file fxdeviceinitapi.cpp.

2511 {
2513
2516 "Couldn't allocate DeviceDescription string, %!STATUS!", status);
2517
2518 goto Done;
2519 }

◆ if() [36/45]

if ( pDeviceText  = NULL)

Definition at line 2496 of file fxdeviceinitapi.cpp.

2496 {
2498
2501 "Couldn't allocate DeviceText object, %!STATUS!", status);
2502
2503 return status;
2504 }

◆ if() [37/45]

if ( pFxDriverGlobals->IsUserModeDriver &&  normalizedFileClass==WdfFileObjectWdfCanUseFsContext|| normalizedFileClass==WdfFileObjectWdfCanUseFsContext2)

Definition at line 505 of file fxdeviceinitapi.cpp.

507 {
508
509 //
510 // update the FileObjectClass value
511 //
512 BOOLEAN canBeOptional =
514
516 if (canBeOptional) {
519 }
520
523 "FileObjectConfig->FileObjectClass value (%d) has been updated"
524 " to a UMDF-supported value %d", normalizedFileClass,
526
527 //
528 // re-obtain the normalized class
529 //
531 }
unsigned char BOOLEAN
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
WDF_FILEOBJECT_CLASS __inline FxFileObjectClassNormalize(__in WDF_FILEOBJECT_CLASS FileObjectClass)
Definition: fxdevice.hpp:103
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
enum _WDF_FILEOBJECT_CLASS WDF_FILEOBJECT_CLASS
@ WdfFileObjectCanBeOptional
Definition: wdfdevice.h:464

◆ if() [38/45]

if ( pID  = NULL)

Definition at line 2293 of file fxdeviceinitapi.cpp.

2293 {
2297 "Couldn't allocate String object %!STATUS!", status);
2298 return status;
2299 }

◆ if() [39/45]

if ( pInit  = NULL)

Definition at line 2068 of file fxdeviceinitapi.cpp.

2068 {
2070 "Couldn't create WDFDEVICE_INIT object");
2071
2072 return NULL;
2073 }

◆ if() [40/45]

Definition at line 721 of file fxdeviceinitapi.cpp.

722 {
723
726 "PnpPowerEventCallbacks size %d is invalid, exptected %d",
728 );
729
731
732 return;
733 }
_In_ PWDFDEVICE_INIT _In_ PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks
Definition: wdfdevice.h:2908

◆ if() [41/45]

if ( PnpPowerEventCallbacks->  Size,
sizeof(WDF_PNPPOWER_EVENT_CALLBACKS_V1_9) &&PnpPowerEventCallbacks->EvtDeviceUsageNotification !  = NULL && PnpPowerEventCallbacks->EvtDeviceUsageNotificationEx != NULL 
)

Definition at line 739 of file fxdeviceinitapi.cpp.

741 {
742
745 "Driver can provide either EvtDeviceUsageNotification or "
746 "EvtDeviceUsageNotificationEx callback but not both");
747
749
750 return;
751 }

◆ if() [42/45]

Definition at line 791 of file fxdeviceinitapi.cpp.

792 {
795 "PowerPolicyEventCallbacks size %d is invalid, expected %d",
797 );
798
800 return;
801 }
_In_ PWDFDEVICE_INIT _In_ PWDF_POWER_POLICY_EVENT_CALLBACKS PowerPolicyEventCallbacks
Definition: wdfdevice.h:2937

◆ if() [43/45]

if ( PowerPolicyEventCallbacks->  Size,
sizeof(WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5) &&PowerPolicyEventCallbacks->EvtDeviceArmWakeFromSx !  = NULL && PowerPolicyEventCallbacks->EvtDeviceArmWakeFromSxWithReason != NULL 
)

Definition at line 808 of file fxdeviceinitapi.cpp.

810 {
813 "PowerPolicyEventCallbacks can have either EvtDeviceArmWakeFromSx "
814 "or EvtDeviceArmWakeFromSxWithReason callback pointer, but not both"
815 );
816
818 return;
819 }

◆ if() [44/45]

Definition at line 1266 of file fxdeviceinitapi.cpp.

1266 {
1267 //
1268 // Size is wrong, bail out
1269 //
1271 "RemoveLockOptions %p Size incorrect, expected %d, "
1272 "got %d",
1274 RemoveLockOptions->Size);
1275
1277 goto Done;
1278 }

◆ if() [45/45]

if ( SDDLString  = NULL)

Definition at line 633 of file fxdeviceinitapi.cpp.

633 {
634 //
635 // Since we require the SDDL on control device creation, you can't
636 // clear it!
637 //
638 if (DeviceInit->IsControlDeviceInit()) {
640 }
641
642 if (DeviceInit->Security.Sddl != NULL) {
643 DeviceInit->Security.Sddl->RELEASE(NULL);
644 DeviceInit->Security.Sddl = NULL;
645 }
646
647 return STATUS_SUCCESS;
648 }
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138

◆ reinterpret_cast< PDEVICE_OBJECT >()

return reinterpret_cast< PDEVICE_OBJECT > ( DeviceInit->Fdo.  PhysicalDevice)

◆ Release()

pID Release ( )

Definition at line 919 of file cdrom.h.

◆ SetPdo()

pInit SetPdo ( pDevice  )

◆ switch()

switch ( FileObjectConfig->  AutoForwardCleanupClose)

Definition at line 463 of file fxdeviceinitapi.cpp.

463 {
464 case WdfTrue:
465 case WdfFalse:
466 case WdfUseDefault:
467 break;
468
469 default:
472 "Invalid FileObjectConfig->AutoForwardCleanupClose value 0x%x, "
473 "expected WDF_TRI_STATE value", FileObjectConfig->AutoForwardCleanupClose);
474
476 return;
477 }
@ WdfTrue
Definition: wdftypes.h:88
@ WdfUseDefault
Definition: wdftypes.h:89
@ WdfFalse
Definition: wdftypes.h:87

Variable Documentation

◆ __pad0__

Done __pad0__

Definition at line 1307 of file fxdeviceinitapi.cpp.

◆ __pad1__

Done __pad1__

Definition at line 2540 of file fxdeviceinitapi.cpp.

◆ AutoForwardCleanupClose

DeviceInit FileObject AutoForwardCleanupClose
Initial value:
=
FileObjectConfig->AutoForwardCleanupClose

Definition at line 481 of file fxdeviceinitapi.cpp.

◆ BufferLength

◆ Callback

◆ CallbackTypes

◆ Class

◆ CompatibleID

◆ Config

◆ ContainerID

◆ DefaultDeviceListAttributes

Initial value:

Definition at line 1731 of file fxdeviceinitapi.cpp.

Referenced by if().

◆ DefaultLocale

DeviceInit Pdo DefaultLocale = LocaleId

Definition at line 2580 of file fxdeviceinitapi.cpp.

◆ DesiredAccess

◆ DeviceCharacteristics

◆ DeviceClassGuid

◆ DeviceClassSet

DeviceInit Security DeviceClassSet = TRUE

Definition at line 694 of file fxdeviceinitapi.cpp.

◆ DeviceDescription

◆ DeviceID

◆ DeviceInit

Initial value:

Definition at line 145 of file fxdeviceinitapi.cpp.

Referenced by if().

◆ DeviceInstanceKeyType

◆ DeviceLocation

◆ DeviceName

◆ DeviceProperty

◆ DeviceType

Initial value:

Definition at line 243 of file fxdeviceinitapi.cpp.

◆ DispatchTable

◆ Driver

Definition at line 2681 of file fxdeviceinitapi.cpp.

◆ else

else
Initial value:

Definition at line 382 of file fxdeviceinitapi.cpp.

◆ EvtDevicePnpStateChange

◆ EvtDevicePowerPolicyStateChange

◆ EvtDevicePowerStateChange

◆ EvtDevicePreprocess

DeviceInit PreprocessInfo Dispatch [MajorFunction] EvtDevicePreprocess
Initial value:
=
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PFN_WDFDEVICE_WDM_IRP_PREPROCESS EvtDeviceWdmIrpPreprocess
Definition: wdfdevice.h:3460

Definition at line 1183 of file fxdeviceinitapi.cpp.

◆ EvtDeviceWdmIrpPreprocess

◆ EvtIoInCallerContext

◆ Exclusive

◆ FdoEventCallbacks

◆ fileClass

fileClass = FileObjectConfig->FileObjectClass

Definition at line 430 of file fxdeviceinitapi.cpp.

Referenced by if().

◆ FileObjectAttributes

◆ FileObjectConfig

◆ Filter

DeviceInit Fdo Filter = TRUE

Definition at line 1493 of file fxdeviceinitapi.cpp.

◆ Flags

Initial value:

Definition at line 2724 of file fxdeviceinitapi.cpp.

◆ ForwardRequestToParent

DeviceInit Pdo ForwardRequestToParent = TRUE

Definition at line 2659 of file fxdeviceinitapi.cpp.

◆ fxDriverGlobals

Definition at line 1259 of file fxdeviceinitapi.cpp.

Referenced by if().

◆ HardwareID

◆ Inrush

DeviceInit Inrush = TRUE

Definition at line 304 of file fxdeviceinitapi.cpp.

◆ InstanceID

◆ IoInCallerContextCallback

DeviceInit IoInCallerContextCallback = EvtIoInCallerContext

Definition at line 1240 of file fxdeviceinitapi.cpp.

◆ IoType

Initial value:

Definition at line 166 of file fxdeviceinitapi.cpp.

◆ ioTypeConfig

DeviceInit AssignIoType & ioTypeConfig

Definition at line 171 of file fxdeviceinitapi.cpp.

◆ IoTypeConfig

◆ IsPowerPolicyOwner

Initial value:

Definition at line 835 of file fxdeviceinitapi.cpp.

◆ Key

* Key
Initial value:

Definition at line 1426 of file fxdeviceinitapi.cpp.

◆ KeyAttributes

◆ LastDeviceTextEntry

DeviceInit Pdo LastDeviceTextEntry = &pDeviceText->m_Entry

Definition at line 2537 of file fxdeviceinitapi.cpp.

◆ LocaleId

Initial value:

Definition at line 2457 of file fxdeviceinitapi.cpp.

◆ m_Description

pDeviceText m_Description
Initial value:
_Must_inspect_result_ PWCHAR FxDuplicateUnicodeStringToString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in const UNICODE_STRING *Source)
Definition: stringutil.cpp:287
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:432

Definition at line 2508 of file fxdeviceinitapi.cpp.

◆ m_LocaleId

pDeviceText m_LocaleId = LocaleId

Definition at line 2506 of file fxdeviceinitapi.cpp.

◆ m_LocationInformation

pDeviceText m_LocationInformation
Initial value:
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING DeviceLocation
Definition: wdfpdo.h:434

Definition at line 2521 of file fxdeviceinitapi.cpp.

◆ MajorFunction

◆ MinorFunctions

◆ normalizedFileClass

normalizedFileClass = FxFileObjectClassNormalize(fileClass)

Definition at line 429 of file fxdeviceinitapi.cpp.

Referenced by if().

◆ normalizedState

ULONG normalizedState = WdfDevStateNormalize(PnpState)

Definition at line 866 of file fxdeviceinitapi.cpp.

◆ Notification

◆ NumMinorFunctions

◆ OrInValues

Initial value:

Definition at line 372 of file fxdeviceinitapi.cpp.

◆ ParentDevice

Initial value:

Definition at line 2037 of file fxdeviceinitapi.cpp.

◆ pCallback

◆ pDevice

FxDevice* pDevice

Definition at line 2044 of file fxdeviceinitapi.cpp.

◆ pDeviceText

Definition at line 2463 of file fxdeviceinitapi.cpp.

Referenced by FindObjectForGivenLocale().

◆ pDriver

◆ pFxDriverGlobals

pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)

Definition at line 197 of file fxdeviceinitapi.cpp.

Referenced by if(), and switch().

◆ pID

◆ pInit

◆ PnpPowerEventCallbacks

◆ PnpState

◆ PoolType

◆ PowerPageable

DeviceInit PowerPageable = FALSE

Definition at line 267 of file fxdeviceinitapi.cpp.

◆ PowerPolicyEventCallbacks

◆ PowerPolicyOwner

DeviceInit PnpPower PowerPolicyOwner = IsPowerPolicyOwner ? WdfTrue : WdfFalse

Definition at line 842 of file fxdeviceinitapi.cpp.

◆ PowerPolicyState

◆ PowerState

◆ PropertyBuffer

◆ PropertyMemory

Initial value:

Definition at line 1590 of file fxdeviceinitapi.cpp.

◆ PropertyMemoryAttributes

◆ Raw

Definition at line 2619 of file fxdeviceinitapi.cpp.

◆ ReadWriteIoType

ioTypeConfig ReadWriteIoType = IoType

Definition at line 176 of file fxdeviceinitapi.cpp.

Referenced by FxDevice::GetDeviceStackIoType().

◆ ReleaseHardwareOrderOnFailure

Initial value:

Definition at line 1320 of file fxdeviceinitapi.cpp.

◆ RemoveLockOptionFlags

DeviceInit RemoveLockOptionFlags = RemoveLockOptions->Flags

Definition at line 1306 of file fxdeviceinitapi.cpp.

◆ RemoveLockOptions

Initial value:

Definition at line 1254 of file fxdeviceinitapi.cpp.

Referenced by if(), and WDF_REMOVE_LOCK_OPTIONS_INIT().

◆ RequestAttributes

◆ RequiresSelfIoTarget

DeviceInit RequiresSelfIoTarget = TRUE

Definition at line 1375 of file fxdeviceinitapi.cpp.

◆ ResultLength

◆ return

return

Definition at line 1242 of file fxdeviceinitapi.cpp.

◆ SDDLString

Initial value:

Definition at line 617 of file fxdeviceinitapi.cpp.

◆ Set

Definition at line 479 of file fxdeviceinitapi.cpp.

◆ ShutdownNotification

DeviceInit Control ShutdownNotification = Notification

Definition at line 2750 of file fxdeviceinitapi.cpp.

◆ Static

Definition at line 2081 of file fxdeviceinitapi.cpp.

◆ status

Initial value:
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158

Definition at line 196 of file fxdeviceinitapi.cpp.

Referenced by if().

◆ STATUS_SUCCESS

return STATUS_SUCCESS

Definition at line 922 of file fxdeviceinitapi.cpp.

Referenced by if().

◆ totalDescriptionSize

totalDescriptionSize = 0

Definition at line 1738 of file fxdeviceinitapi.cpp.

◆ Type

◆ Types

Definition at line 920 of file fxdeviceinitapi.cpp.

◆ validFlags

Definition at line 1260 of file fxdeviceinitapi.cpp.

Referenced by if().