EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_DUPLICATE callback function (wdfchildlist.h)
[Applies to KMDF only]
A driver's EvtChildListIdentificationDescriptionDuplicate event callback function duplicates a child identification description.
Syntax
EVT_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_DUPLICATE EvtWdfChildListIdentificationDescriptionDuplicate;
NTSTATUS EvtWdfChildListIdentificationDescriptionDuplicate(
[in] WDFCHILDLIST ChildList,
[in] PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER SourceIdentificationDescription,
[out] PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER DestinationIdentificationDescription
)
{...}
Parameters
[in] ChildList
A handle to a framework child-list object.
[in] SourceIdentificationDescription
A pointer to a WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER structure that identifies the source location of the child identification description.
[out] DestinationIdentificationDescription
A pointer to a WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER structure that identifies the destination location of the duplicate child identification description.
Return value
The EvtChildListIdentificationDescriptionDuplicate callback function must return STATUS_SUCCESS, or another status value for which NT_SUCCESS(status) equals TRUE, if the operation succeeds. Otherwise, this callback function must return a status value for which NT_SUCCESS(status) equals FALSE.
Remarks
If a bus driver is using dynamic enumeration, it can register an EvtChildListIdentificationDescriptionDuplicate callback function by calling WdfFdoInitSetDefaultChildListConfig or WdfChildListCreate.
The framework duplicates driver-supplied identification descriptions so that it can have internal copies of the descriptions.
The EvtChildListIdentificationDescriptionDuplicate callback function must create a duplicate copy of an identification description. A driver must supply this callback function if the framework cannot call RtlCopyMemory to duplicate the identification description. (The framework cannot call RtlCopyMemory if the description contains pointers to additional memory.)
If your driver does not provide an EvtChildListIdentificationDescriptionDuplicate callback function, the framework duplicates identification descriptions by calling RtlCopyMemory.
The following steps describe a typical scenario:
- The driver determines that a child device exists.
- The driver creates an identification description by filling in a driver-defined structure that contains a WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER structure and possibly by dynamically allocating addition memory to store identification information that has a device-specific size.
- The driver calls WdfChildListAddOrUpdateChildDescriptionAsPresent to report a child device, supplying a pointer to the identification description.
- The framework calls the EvtChildListIdentificationDescriptionDuplicate callback function (if it exists) or RtlCopyMemory to duplicate the identification description so that it can have an internal copy of the description.
- Allocate additional memory, typically by calling ExAllocatePool.
- Store the allocated memory's address in the driver-defined address description structure (that is, the callback function's DestinationIdentificationDescription structure).
- Copy other structure members from the callback function's SourceIdentificationDescription structure to the callback function's DestinationIdentificationDescription structure.
The framework acquires an internal child-list object lock before calling the EvtChildListIdentificationDescriptionDuplicate callback function. This callback function must only perform operations that are related to the duplication 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 EvtChildListIdentificationDescriptionDuplicate callback function, it might also need EvtChildListIdentificationDescriptionCopy, EvtChildListIdentificationDescriptionCompare, and EvtChildListIdentificationDescriptionCleanup 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
EvtChildListIdentificationDescriptionCleanup
EvtChildListIdentificationDescriptionCompare
EvtChildListIdentificationDescriptionCopy
WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER