Skip to content

Latest commit

 

History

History
102 lines (65 loc) · 5.06 KB

nf-wudfddi-iwdfdriver-createwdfobject.md

File metadata and controls

102 lines (65 loc) · 5.06 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:wudfddi.IWDFDriver.CreateWdfObject
IWDFDriver::CreateWdfObject (wudfddi.h)
The CreateWdfObject method creates a custom (or user) WDF object from a parent WDF object.
wdf\iwdfdriver_createwdfobject.htm
wdf
02/26/2018
IWDFDriver::CreateWdfObject
CreateWdfObject, CreateWdfObject method, CreateWdfObject method,IWDFDriver interface, IWDFDriver interface,CreateWdfObject method, IWDFDriver.CreateWdfObject, IWDFDriver::CreateWdfObject, UMDFDriverObjectRef_8ab61a3d-78e3-4d92-8a9c-0eff2837f65f.xml, umdf.iwdfdriver_createwdfobject, wdf.iwdfdriver_createwdfobject, wudfddi/IWDFDriver::CreateWdfObject
wudfddi.h
Wudfddi.h
Desktop
1.5
Unavailable in UMDF 2.0 and later.
WUDFx.dll
Windows
IWDFDriver::CreateWdfObject
wudfddi/IWDFDriver::CreateWdfObject
APIRef
kbSyntax
COM
WUDFx.dll
IWDFDriver::CreateWdfObject

IWDFDriver::CreateWdfObject

-description

[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]

The CreateWdfObject method creates a custom (or user) WDF object from a parent WDF object.

-parameters

-param pCallbackInterface [in, optional]

A pointer to the IUnknown interface that the framework uses to determine the object-related event callback functions that the driver subscribes to on the newly created custom object. This parameter is optional. The driver can pass NULL if the driver does not require notification. If the driver passes a valid pointer, the framework will call QueryInterface on the IUnknown interface for the IObjectCleanup interface. If the framework obtains the driver's IObjectCleanup interface, the framework can subsequently call the driver's IObjectCleanup::OnCleanup method to notify the driver that the custom object is cleaned up.

-param pParentObject [in, optional]

A pointer to the IWDFObject interface for the parent WDF object. If NULL, the driver object becomes the default parent.

-param ppWdfObject [out]

A pointer to a buffer that receives a pointer to the IWDFObject interface for the newly created WDF object.

-returns

CreateWdfObject returns S_OK if the operation succeeds. Otherwise, this method returns one of the error codes that are defined in Winerror.h.

-remarks

The driver can call CreateWdfObject to create a general framework base object for its own use. The driver can associate context memory, assign a parent object, and register an IObjectCleanup interface. The framework subsequently calls the IObjectCleanup::OnCleanup method to clean up the child object.

If no parent object is specified at the pParentObject parameter, the driver becomes the default parent. Therefore, when the driver object is deleted, the framework cleans up the child object.

If a parent object is assigned, the child object is deleted when the parent object is deleted. In other words, the lifetime of a child object is scoped within that of the parent.

If the driver must clean up the child object before the parent object is deleted, the driver can call the IWDFObject::DeleteWdfObject method.

-see-also

IObjectCleanup

IObjectCleanup::OnCleanup

IWDFDriver

IWDFObject

IWDFObject::DeleteWdfObject