Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dmf/DmfVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// built using DMF.
//

// DMF Release: v1.1.108
// DMF Release: v1.1.109
//

// eof: DmfVersion.h
Expand Down
36 changes: 18 additions & 18 deletions Dmf/Documentation/Driver Module Framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ Function)](#section-11-public-calls-by-client-includes-module-create-function)

            [DMF_MODULE_DESCRIPTOR 111](#dmf_module_descriptor)

            [DMF_ENTRYPOINTS_DMF 113](#dmf_entrypoints_dmf)
            [DMF_CALLBACKS_DMF 113](#dmf_entrypoints_dmf)

            [DMF_ENTRYPOINTS_WDF 114](#dmf_entrypoints_wdf)
            [DMF_CALLBACKS_WDF 114](#dmf_entrypoints_wdf)

      [Module WDF Callbacks 116](#module-wdf-callbacks)

Expand Down Expand Up @@ -305,9 +305,9 @@ Function)](#section-11-public-calls-by-client-includes-module-create-function)

            [DECLARE_DMF_MODULE_NO_CONFIG](#declare_dmf_module_no_config)

            [DMF_ENTRYPOINTS_DMF_INIT 164](#dmf_entrypoints_dmf_init)
            [DMF_CALLBACKS_DMF_INIT 164](#dmf_entrypoints_dmf_init)

            [DMF_ENTRYPOINTS_WDF_INIT 165](#dmf_entrypoints_wdf_init)
            [DMF_CALLBACKS_WDF_INIT 165](#dmf_entrypoints_wdf_init)

            [DMF_MODULE_DESCRIPTOR_INIT 166](#dmf_module_descriptor_init)

Expand Down Expand Up @@ -4163,17 +4163,17 @@ specifically for the Module: DMF_MODULE_DESCRIPTOR_INIT()
**TransportMethod** | Indicates the Module's Transport Method. When this member is set, the Module may be instantiated by a Client as a Transport Module.
**InFlightRecorderSize** | Indicates the size of the Module's custom IFR buffer if set to a non-zero value. By default, IFR traces will go to a common buffer for all Modules if this value is zero.

### DMF_ENTRYPOINTS_DMF
### DMF_CALLBACKS_DMF

This structure contains all the DMF specific callbacks the Module
supports.

Always use this function to initialize the structure before updating it
specifically for the Module: DMF_ENTRYPOINTS_DMF_INIT()
specifically for the Module: DMF_CALLBACKS_DMF_INIT()

**Member** | **Description**
----------------------------------| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
**Size** | Indicates the size of this structure. It is initialized by **DMF_ENTRYPOINTS_DMF_INIT()**.
**Size** | Indicates the size of this structure. It is initialized by **DMF_CALLBACKS_DMF_INIT()**.
**ModuleInstanceDestroy** | The callback function that is called when the Module is destroyed. Generally, it is not necessary for a Module to support this callback. In some rare cases, if an allocation or some resource is acquired in the Module's Create function, then this callback can be used to release that allocation or resource.
**DeviceResourcesAssign** | DMF calls this callback to allow the Module to retrieve the Client's Driver's resources.
**DeviceNotificationRegister** | DMF calls this callback to allow the Module to register for notification of an event that will tell the Module its required dependencies are available or not available.
Expand All @@ -4182,17 +4182,17 @@ specifically for the Module: DMF_ENTRYPOINTS_DMF_INIT()
**DeviceClose** | DMF calls this callback to close the Module. Generally speaking, the Module uses this callback to do the inverse of what it did in the **DeviceOpen** callback.
**ChildModulesAdd** | DMF calls this callback so that the Module can tell DMF about the Child Module(s) it needs to create.

### DMF_ENTRYPOINTS_WDF
### DMF_CALLBACKS_WDF

This structure contains all the WDF specific callbacks the Module
supports.

Always use this function to initialize the structure before updating it
specifically for the Module: DMF_ENTRYPOINTS_WDF_INIT()
specifically for the Module: DMF_CALLBACKS_WDF_INIT()

**Member** | **Description**
----------------------------------------| -----------------------------------------------------------------------------------------------
**Size** | Indicates the size of this structure. It is initialized by **DMF_ENTRYPOINTS_WDF_INIT()**.
**Size** | Indicates the size of this structure. It is initialized by **DMF_CALLBACKS_WDF_INIT()**.
**ModulePrepareHardware** | Routes **EvtDevicePrepareHardware** to the Module. (WDFDEVICE)
**ModuleReleaseHardware** | Routes **EvtDeviceReleaseHardware** to the Module. (WDFDEVICE)
**ModuleD0Entry** | Routes **EvtDeviceD0Entry** to the Module. (WDFDEVICE)
Expand Down Expand Up @@ -6052,14 +6052,14 @@ None

- If a Module has a Config, use **DECLARE_DMF_MODULE()** instead.

### DMF_ENTRYPOINTS_DMF_INIT
### DMF_CALLBACKS_DMF_INIT
```
VOID
DMF_ENTRYPOINTS_DMF_INIT(
DMF_CALLBACKS_DMF_INIT(
_Out_ PDMF_ENTRYPOINTS_DMF EntryPointsDmf
)
```
This function initializes a **DMF_ENTRYPOINTS_DMF** structure.
This function initializes a **DMF_CALLBACKS_DMF** structure.

#### Parameters
Parameter | Description
Expand All @@ -6078,14 +6078,14 @@ None
- After initializing this structure, set the DMF callbacks the Module
supports.

### DMF_ENTRYPOINTS_WDF_INIT
### DMF_CALLBACKS_WDF_INIT
```
VOID
DMF_ENTRYPOINTS_WDF_INIT(
DMF_CALLBACKS_WDF_INIT(
_Out_ PDMF_ENTRYPOINTS_WDF EntryPointsWdf
)
```
This function initializes a **DMF_ENTRYPOINTS_WDF** structure.
This function initializes a **DMF_CALLBACKS_WDF** structure.

#### Parameters
Parameter | Description
Expand Down Expand Up @@ -7846,8 +7846,8 @@ Modules.
---------------------------------------- | -----------------------------------------------------------------------------------------------------------------------------
**[DECLARE_DMF_MODULE]** | Modules use this macro in the Module's .h file to define the name of the Module as well as functions associated with the Module. Use this macro only if the Module **has** a Module Config structure that Clients use to configure the Module.
**[DECLARE_DMF_MODULE_NO_CONFIG]** | Modules use this macro in the Module's .h file to define the name of the Module as well as functions associated with the Module. Use this macro only if the Module **does not have** a Module Config structure that Clients use to configure the Module
**DMF_ENTRYPOINTS_DMF_INIT** | Modules use this macro to declare what DMF callbacks the Module supports, if any. If the Module does not support DMF callbacks this call is not necessary.
**DMF_ENTRYPOINTS_WDF_INIT** | Modules use this macro to declare what WDF callbacks the Module supports, if any. If the Module does not support WDF callbacks this call is not necessary.
**DMF_CALLBACKS_DMF_INIT** | Modules use this macro to declare what DMF callbacks the Module supports, if any. If the Module does not support DMF callbacks this call is not necessary.
**DMF_CALLBACKS_WDF_INIT** | Modules use this macro to declare what WDF callbacks the Module supports, if any. If the Module does not support WDF callbacks this call is not necessary.
**[DMF_MODULE_DESCRIPTOR_INIT]** | Modules use this macro to initialize the Module's descriptor, **DMF_MODULE_DESCRIPTOR**. Only Modules that **have no contex**t use this call.
**[DMF_MODULE_DESCRIPTOR_INIT_CONTEXT_TYPE]** | Modules use this macro to initialize the Module's descriptor, **DMF_MODULE_DESCRIPTOR**. Only Modules that **have a context** use this call.
**DMF_CONFIG_GET** | Modules use this function to retrieve the Module's Config information set by the Client.
Expand Down
40 changes: 20 additions & 20 deletions Dmf/Framework/DmfGeneric.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Return Value:

// This is needed for cases where Module Opens, Close and Opens again.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

UNREFERENCED_PARAMETER(ResourcesRaw);
UNREFERENCED_PARAMETER(ResourcesTranslated);
Expand Down Expand Up @@ -476,7 +476,7 @@ Return Value:

// NOTE: Client Drivers have the option of closing modules at any time.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

// NOTE: This code is not totally symmetrical with DMF_Generic_ModulePrepareHardware because there is
// no corresponding DMF_Module_ResourcesAssign on the way down.
Expand Down Expand Up @@ -566,7 +566,7 @@ Return Value:

// NOTE: Modules can be closed in D0Exit.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

device = DMF_ParentDeviceGet(DmfModule);

Expand Down Expand Up @@ -697,7 +697,7 @@ Return Value:

// NOTE: Modules can be closed in D0Exit.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

ntStatus = STATUS_SUCCESS;

Expand Down Expand Up @@ -739,7 +739,7 @@ Return Value:

// NOTE: Client Drivers have the option of closing modules at any time.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

ntStatus = STATUS_SUCCESS;

Expand Down Expand Up @@ -789,7 +789,7 @@ Return Value:

// NOTE: Client Drivers have the option of closing modules at any time.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

device = DMF_ParentDeviceGet(DmfModule);

Expand Down Expand Up @@ -879,7 +879,7 @@ Return Value:
// It is possible for a Module to be created but not open if the Module uses a
// notification to open but the notification has not happened yet.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

// Tell Client Driver this dispatch is still unhandled.
//
Expand Down Expand Up @@ -932,7 +932,7 @@ Return Value:
// It is possible for a Module to be created but not open if the Module uses a
// notification to open but the notification has not happened yet.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

// Tell Client Driver this dispatch is still unhandled.
//
Expand Down Expand Up @@ -1001,7 +1001,7 @@ Return Value:
//
if (dmfDeviceContext->IsFilterDevice == FALSE)
{
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);
}

// Tell Client Driver this dispatch is still unhandled.
Expand Down Expand Up @@ -1106,7 +1106,7 @@ Return Value:
// It is possible for a Module to be created but not open if the Module uses a
// notification to open but the notification has not happened yet.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

FuncExit(DMF_TRACE, "dmfObject=0x%p [%s] returnValue=0", dmfObject, dmfObject->ClientModuleInstanceName);
}
Expand Down Expand Up @@ -1146,7 +1146,7 @@ Return Value:
// It is possible for a Module to be created but not open if the Module uses a
// notification to open but the notification has not happened yet.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

FuncExit(DMF_TRACE, "dmfObject=0x%p [%s] returnValue=0", dmfObject, dmfObject->ClientModuleInstanceName);
}
Expand Down Expand Up @@ -1190,7 +1190,7 @@ Return Value:
// It is possible for a Module to be created but not open if the Module uses a
// notification to open but the notification has not happened yet.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

FuncExit(DMF_TRACE, "dmfObject=0x%p [%s] returnValue=0", dmfObject, dmfObject->ClientModuleInstanceName);

Expand Down Expand Up @@ -1233,7 +1233,7 @@ Return Value:
// It is possible for a Module to be created but not open if the Module uses a
// notification to open but the notification has not happened yet.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

FuncExit(DMF_TRACE, "dmfObject=0x%p [%s] returnValue=0", dmfObject, dmfObject->ClientModuleInstanceName);

Expand Down Expand Up @@ -1275,7 +1275,7 @@ Return Value:
// It is possible for a Module to be created but not open if the Module uses a
// notification to open but the notification has not happened yet.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

FuncExit(DMF_TRACE, "dmfObject=0x%p [%s] returnValue=0", dmfObject, dmfObject->ClientModuleInstanceName);

Expand Down Expand Up @@ -1313,7 +1313,7 @@ Return Value:
// It is possible for a Module to be created but not open if the Module uses a
// notification to open but the notification has not happened yet.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

FuncExit(DMF_TRACE, "dmfObject=0x%p [%s] returnValue=0", dmfObject, dmfObject->ClientModuleInstanceName);
}
Expand Down Expand Up @@ -1356,7 +1356,7 @@ Return Value:
// It is possible for a Module to be created but not open if the Module uses a
// notification to open but the notification has not happened yet.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

FuncExit(DMF_TRACE, "dmfObject=0x%p [%s] returnValue=0", dmfObject, dmfObject->ClientModuleInstanceName);

Expand Down Expand Up @@ -1449,7 +1449,7 @@ Return Value:
// It is possible for a Module to be created but not open if the Module uses a
// notification to open but the notification has not happened yet.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

FuncExit(DMF_TRACE, "dmfObject=0x%p [%s] returnValue=0", dmfObject, dmfObject->ClientModuleInstanceName);
}
Expand Down Expand Up @@ -1961,7 +1961,7 @@ Return Value:

// This is needed for cases where Module Opens, Close and Opens again.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

// This is called during PrepareHardware when the flag is used.
//
Expand Down Expand Up @@ -2010,7 +2010,7 @@ Return Value:

FuncEntryArguments(DMF_TRACE, "DmfModule=0x%p dmfObject=0x%p [%s]", DmfModule, dmfObject, dmfObject->ClientModuleInstanceName);

DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

FuncExit(DMF_TRACE, "DmfModule=0x%p dmfObject=0x%p [%s] ntStatus=%!STATUS!", DmfModule, dmfObject, dmfObject->ClientModuleInstanceName, STATUS_SUCCESS);

Expand Down Expand Up @@ -2051,7 +2051,7 @@ Return Value:

FuncEntryArguments(DMF_TRACE, "DmfModule=0x%p dmfObject=0x%p [%s]", DmfModule, dmfObject, dmfObject->ClientModuleInstanceName);

DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

FuncExit(DMF_TRACE, "dmfObject=0x%p [%s]", dmfObject, dmfObject->ClientModuleInstanceName);
}
Expand Down
5 changes: 0 additions & 5 deletions Dmf/Framework/DmfIncludeInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,6 @@ DMF_HandleValidate_IsCreatedOrClosed(
_In_ DMF_OBJECT* DmfObject
);

VOID
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(
_In_ DMF_OBJECT* DmfObject
);

VOID
DMF_HandleValidate_IsAvailable(
_In_ DMF_OBJECT* DmfObject
Expand Down
1 change: 1 addition & 0 deletions Dmf/Framework/DmfIncludes_USER_MODE.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Module Name:
#include <ndisguid.h>
#include <strsafe.h>
#include <ndisguid.h>
#include <errno.h>

// Turn this on to debug asserts in UMDF.
// Normal assert() causes a crash in UMDF which causes UMDF to just disable the driver
Expand Down
12 changes: 6 additions & 6 deletions Dmf/Framework/DmfInternal.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Return Value:

FuncEntryArguments(DMF_TRACE, "DmfModule=0x%p [%s]", DmfModule, dmfObject->ClientModuleInstanceName);

DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

DmfAssert(dmfObject->ModuleDescriptor.CallbacksWdf->ModuleReleaseHardware != NULL);
ntStatus = (dmfObject->ModuleDescriptor.CallbacksWdf->ModuleReleaseHardware)(DmfModule,
Expand Down Expand Up @@ -286,7 +286,7 @@ Return Value:

FuncEntryArguments(DMF_TRACE, "DmfModule=0x%p [%s]", DmfModule, dmfObject->ClientModuleInstanceName);

DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

DmfAssert(dmfObject->ModuleDescriptor.CallbacksWdf->ModuleD0ExitPreInterruptsDisabled != NULL);
ntStatus = (dmfObject->ModuleDescriptor.CallbacksWdf->ModuleD0ExitPreInterruptsDisabled)(DmfModule,
Expand Down Expand Up @@ -329,7 +329,7 @@ Return Value:

FuncEntryArguments(DMF_TRACE, "DmfModule=0x%p [%s]", DmfModule, dmfObject->ClientModuleInstanceName);

DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

DmfAssert(dmfObject->ModuleDescriptor.CallbacksWdf->ModuleD0Exit != NULL);
ntStatus = (dmfObject->ModuleDescriptor.CallbacksWdf->ModuleD0Exit)(DmfModule,
Expand Down Expand Up @@ -1385,7 +1385,7 @@ Return Value:
// NOTE: In the case where there is no handler, allow "Opened".
// NOTE: In the cases where Modules are Opened, Closed and Opened again, allow "Closed" state.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

DmfAssert(dmfObject->ModuleDescriptor.CallbacksDmf->DeviceResourcesAssign != NULL);
ntStatus = (dmfObject->ModuleDescriptor.CallbacksDmf->DeviceResourcesAssign)(DmfModule,
Expand Down Expand Up @@ -1432,7 +1432,7 @@ Return Value:

// NOTE: In the cases where Modules are Opened, Closed and Opened again, allow "Closed" state.
//
DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

DmfAssert(dmfObject->ModuleDescriptor.CallbacksDmf->DeviceNotificationRegister != NULL);
ntStatus = (dmfObject->ModuleDescriptor.CallbacksDmf->DeviceNotificationRegister)(DmfModule);
Expand Down Expand Up @@ -1479,7 +1479,7 @@ Return Value:

FuncEntryArguments(DMF_TRACE, "DmfModule=0x%p [%s]", DmfModule, dmfObject->ClientModuleInstanceName);

DMF_HandleValidate_IsCreatedOrOpenedOrClosed(dmfObject);
DMF_HandleValidate_IsAvailable(dmfObject);

DmfAssert(dmfObject->ModuleDescriptor.CallbacksDmf->DeviceNotificationUnregister != NULL);
(dmfObject->ModuleDescriptor.CallbacksDmf->DeviceNotificationUnregister)(DmfModule);
Expand Down
4 changes: 4 additions & 0 deletions Dmf/Framework/DmfTrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ Module Name:
// USEPREFIX(TraceInformation, "%!STDPREFIX! [%!FUNC!] ");
// USEPREFIX(TraceVerbose, "%!STDPREFIX! [%!FUNC!] ");
// USEPREFIX(FuncExitNoReturn, "%!STDPREFIX! [%!FUNC!] <--");
// CUSTOM_TYPE(SMFX_MACHINE_EXCEPTION, ItemEnum(StateMachine_MachineException));
// CUSTOM_TYPE(SMFX_TRANSITION_TYPE, ItemEnum(StateMachine_TransitionType));
// CUSTOM_TYPE(COMPONENT_FIRMWARE_UPDATE_V2_EVENT, ItemEnum(ComponentFirmwareUpdateV2EventId));
// CUSTOM_TYPE(COMPONENT_FIRMWARE_UPDATE_V2_STATE, ItemEnum(ComponentFirmwareUpdateV2StateId));
// end_wpp

#if !defined(DMF_WDF_DRIVER)
Expand Down
Loading