WPD_COMMAND_OBJECT_RESOURCES_CREATE_RESOURCE command

Creates a new resource on an object. The driver must create a unique context ID that will be used in subsequent calls to identify this creation operation.

Only the resource attributes are given in this call. WPD_COMMAND_OBJECT_RESOURCES_WRITE is used to write the resource data to the object. The driver may create the object resource on the device immediately if needed, but the resource should not be considered valid until WPD_COMMAND_OBJECT_RESOURCES_CLOSE is called.

If the client neglects to call WPD_COMMAND_OBJECT_RESOURCES_CLOSE, then the WPD API will call WPD_COMMAND_OBJECT_RESOURCES_REVERT to cancel object resource creation.

The caller is responsible for setting all required attributes for a particular resource type. Drivers may fail resource creation requests if required resource attributes are missing. However, the driver should implement a "best effort" policy and proceed if any optional resource attributes are missing, and ignore resource attributes it doesn't understand.

Command category

WPD_CATEGORY_OBJECT_RESOURCES

Parameters

Parameters

The driver expects the following parameters.

WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_ATTRIBUTES

Return value

Result

The driver should return the following results.

WPD_PROPERTY_COMMON_HRESULT

WPD_PROPERTY_COMMON_DRIVER_ERROR_CODE

Calling methods

IPortableDeviceResources::CreateResource

Requirements

Header

PortableDevice.h

See also

Requirements for Resources

Commands

 

 

Send comments about this topic to Microsoft