EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_COPY callback function (wdfchildlist.h)
[Applies to KMDF only]
A driver's EvtChildListAddressDescriptionCopy event callback function copies a child address description from one specified location to another.
Syntax
EVT_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_COPY EvtWdfChildListAddressDescriptionCopy;
void EvtWdfChildListAddressDescriptionCopy(
[in] WDFCHILDLIST ChildList,
[in] PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER SourceAddressDescription,
[out] PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER DestinationAddressDescription
)
{...}
Parameters
[in] ChildList
A handle to a framework child-list object.
[in] SourceAddressDescription
A pointer to a WDF_CHILD_ADDRESS_DESCRIPTION_HEADER structure that identifies the source location of the child address description.
[out] DestinationAddressDescription
A pointer to a WDF_CHILD_ADDRESS_DESCRIPTION_HEADER structure that identifies the destination location of the child address description.
Return value
None
Remarks
If a bus driver is using dynamic enumeration, it can register an EvtChildListAddressDescriptionCopy callback function by calling WdfFdoInitSetDefaultChildListConfig or WdfChildListCreate.
The framework copies information from one driver-supplied address description to another when it needs to update an existing description with new information, or when it needs to pass the contents of an address description to the driver.
The EvtChildListAddressDescriptionCopy callback function must copy the contents of a source description to a destination description. A driver must supply this callback function if its child devices require an address description, and if the framework cannot call RtlCopyMemory to copy the address description. (The framework cannot call RtlCopyMemory if the description contains pointers to additional memory.)
If your driver provides address descriptions but does not provide a EvtChildListAddressDescriptionCopy callback function, the framework copies address descriptions by calling RtlCopyMemory.
The following steps describe a typical scenario:
- The driver determines that a child device exists.
- The driver creates an address description by filling in a driver-defined structure that contains a WDF_CHILD_ADDRESS_DESCRIPTION_HEADER structure and possibly by dynamically allocating additional memory to store address information that has a device-specific size.
- The driver calls WdfChildListAddOrUpdateChildDescriptionAsPresent to report a child device, supplying a pointer to the address description.
- The framework determines that the driver had previously reported the device, so the framework can update the device's old address description with new information.
- The framework calls the EvtChildListAddressDescriptionCopy callback function (if it exists) or RtlCopyMemory to copy the new address description information into the existing address description.
- In the callback function's SourceAddressDescription and DestinationAddressDescription structures, find the pointers to dynamically allocated memory.
- Copy the dynamically allocated memory from the source to the destination, using the pointers.
- Copy other structure members from the callback function's SourceAddressDescription structure to the callback function's DestinationAddressDescription structure.
The framework acquires an internal child-list object lock before calling the EvtChildListAddressDescriptionCopy callback function. The callback function must only perform operations that are related to the described copy operation, such as calling framework memory object methods and accessing object context space. It must not call methods that access other drivers.
If your driver supplies an EvtChildListAddressDescriptionCopy callback function, it might also need EvtChildListAddressDescriptionDuplicate and EvtChildListAddressDescriptionCleanup callback functions.
For more information about dynamic enumeration, see Enumerating the Devices on a Bus.
Requirements
Requirement | Value |
---|---|
Target Platform | Universal |
Minimum KMDF version | 1.0 |
Header | wdfchildlist.h (include Wdf.h) |
IRQL | <= DISPATCH_LEVEL |
See also
EvtChildListAddressDescriptionCleanup
EvtChildListAddressDescriptionDuplicate
WDF_CHILD_ADDRESS_DESCRIPTION_HEADER