Skip to content

Latest commit

 

History

History
168 lines (119 loc) · 5.7 KB

nf-wdfchildlist-wdfchildlistcreate.md

File metadata and controls

168 lines (119 loc) · 5.7 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:wdfchildlist.WdfChildListCreate
WdfChildListCreate function (wdfchildlist.h)
The WdfChildListCreate method creates a child list for a specified parent device.
wdf\wdfchildlistcreate.htm
wdf
02/26/2018
WdfChildListCreate function
DFDeviceObjectChildListRef_750e00c2-f0a0-4a3f-a357-09de7568e268.xml, WdfChildListCreate, WdfChildListCreate method, kmdf.wdfchildlistcreate, wdf.wdfchildlistcreate, wdfchildlist/WdfChildListCreate
wdfchildlist.h
Wdf.h
Universal
1.0
DriverCreate, KmdfIrql, KmdfIrql2
Wdf01000.sys (see Framework Library Versioning.)
PASSIVE_LEVEL
Windows
WdfChildListCreate
wdfchildlist/WdfChildListCreate
APIRef
kbSyntax
LibDef
Wdf01000.sys
Wdf01000.sys.dll
WdfChildListCreate

WdfChildListCreate function

-description

[Applies to KMDF only]

The WdfChildListCreate method creates a child list for a specified parent device.

-parameters

-param Device [in]

A handle to a framework device object that represents the parent device.

-param Config [in]

A pointer to a WDF_CHILD_LIST_CONFIG structure that contains driver-supplied configuration information for the child list.

-param ChildListAttributes [in, optional]

A pointer to a WDF_OBJECT_ATTRIBUTES structure that contains driver-supplied object attributes for the framework child-list object. (The structure's ParentObject member must be NULL.)

-param ChildList [out]

A pointer to a caller-allocated location that receives a handle to a framework child-list object.

-returns

WdfChildListCreate returns STATUS_SUCCESS, or another status value for which NT_SUCCESS(status) equals TRUE, if the operation succeeds. Otherwise, this method might return one of the following values:

Return code Description
STATUS_INVALID_PARAMETER
An input parameter was invalid.
STATUS_INSUFFICIENT_RESOURCES
An object could not be allocated.
 

This method might also return other NTSTATUS values.

A system bug check occurs if the driver supplies an invalid object handle.

-remarks

The framework creates a default child list for each framework device object that represents a functional device object (FDO). To use the default child list, the driver calls WdfFdoGetDefaultChildList. If your driver requires additional child lists, it can call WdfChildListCreate to create them.

The parent of each child-list object is the device's framework device object. The driver cannot change this parent, and the ParentObject member or the WDF_OBJECT_ATTRIBUTES structure must be NULL.

Your driver cannot delete the child-list object that WdfChildListCreate creates. The framework deletes the object at the proper time.

For more information about child lists, see Dynamic Enumeration.

Examples

The following code example initializes a WDF_CHILD_LIST_CONFIG structure and then calls WdfChildListCreate.

WDF_CHILD_LIST_CONFIG listConfig;

WDF_CHILD_LIST_CONFIG_INIT(
                           &listConfig,
                           sizeof(PDO_IDENTIFICATION_DESCRIPTION),
                           My_EvtDeviceListCreatePdo
                           );

listConfig.AddressDescriptionSize = sizeof(PDO_ADDRESS_DESCRIPTION);

listConfig.EvtChildListScanForChildren = My_EvtChildListScanForChildren;

listConfig.EvtChildListIdentificationDescriptionDuplicate = My_EvtChildListIdentificationDescriptionDuplicate;
listConfig.EvtChildListIdentificationDescriptionCompare = My_EvtChildListIdentificationDescriptionCompare;
listConfig.EvtChildListIdentificationDescriptionCleanup = My_EvtChildListIdentificationDescriptionCleanup;

status = WdfChildListCreate(
                            device,
                            &listConfig,
                            WDF_NO_OBJECT_ATTRIBUTES,
                            &ParentDeviceContext->ChildList
                            );
if (!NT_SUCCESS(status)) {
    return status;
}

-see-also

WDF_CHILD_LIST_CONFIG

WDF_CHILD_LIST_CONFIG_INIT

WdfFdoGetDefaultChildList