IWDFDevice::CreateWdfFile method

The CreateWdfFile method creates a file object for a driver to use.

Syntax


HRESULT CreateWdfFile(
  [in, optional]  LPCWSTR pcwszFileName,
  [out]           IWDFDriverCreatedFile **ppFile
);

Parameters

pcwszFileName [in, optional]

A pointer to a NULL-terminated string that contains the name of the file to create a file object from. This parameter is optional. The driver can pass NULL if the driver does not have to create the file object from a file name. If the driver must supply a name, the string that the driver passes must not contain any path separator characters ("/" or "\").

ppFile [out]

A pointer to a buffer that receives a pointer to the IWDFDriverCreatedFile interface for the driver-created file object.

Return value

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

Remarks

For information about when a UMDF driver uses CreateWdfFile to handle I/O, see Creating a File Object to Handle I/O.

For information about when a UMDF driver might use CreateWdfFile to prevent an imbalance of create and close notifications to a driver, see Preventing an Imbalance of Create and Close Notifications to a Driver.

Requirements

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.5

Header

Wudfddi.h (include Wudfddi.h)

DLL

WUDFx.dll

See also

IWDFDevice
IWDFDriverCreatedFile

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft