ISensorClassExtension::CleanupFile method

The ISensorClassExtension::CleanupFile method notifies the class extension about a file handle that closes and cancels all pending I/O requests, for the specified application.

Syntax


HRESULT CleanupFile(
  [in] IWDFFile *pWdfFile
);

Parameters

pWdfFile [in]

Pointer to an IWDFFile interface that represents the file object for the application being closed.

Return value

This method returns an HRESULT. Possible values include, but are not limited to, one of the following values.

Return codeDescription
S_OK

The method succeeded.

E_POINTER

A required pointer argument was NULL.

HRESULT_FROM_WIN32(ERROR_CAN_NOT_COMPLETE)

The class extension is not initialized.

 

Remarks

Your driver must call this method to forward IFileCallbackCleanup::OnCleanupFile method calls from UMDF. You receive this call any time that a file handle closes. Typically, you receive this call after an application stops responding.

When finished, the sensor class extension calls the driver in ISensorDriver::OnClientDisconnect, and ISensorDriver::OnClientUnsubscribeFromEvents, if applicable.

Examples

In the following example code, m_pClassExtension is a pointer to ISensorClassExtension.


VOID CMyDevice::OnCleanupFile(
            __in IWDFFile* pWdfFile
            )
{
    if (NULL != m_pClassExtension)
    {
        m_pClassExtension->CleanupFile(pWdfFile);
    }

    return;
}

Requirements

Minimum supported client

Windows 7

Minimum supported server

None supported

Target platform

Desktop

Version

Available in Windows 7.

Header

Sensorsclassextension.h

Library

SensorsClassExtension.lib

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft