Bagikan melalui


CSecureChannelServer::fIsAuthenticated

banner art

The fIsAuthenticated method verifies that a Secure Authenticated Channel has been successfully established.

Syntax

BOOL fIsAuthenticated();

Parameters

This method takes no parameters.

Return Values

The method returns and HRESULT. All the interface methods in Windows Media Device Manager can return any of the following classes of error codes:

  • Standard COM error codes
  • Windows error codes converted to HRESULT values
  • Windows Media Device Manager error codes

For an extenstive list of possible error codes, see Error Codes.

Remarks

This method is used to ensure that a secure authenticated channel has been established between components before allowing certain operations. This includes calls by devices and storages prior to accessing and transferring data streams. You should confirm that this method returns TRUE before calling other top-level methods on the component.

Applications do not need to call the fIsAuthenticated method, but service providers do. They should call this method for all exposed APIs and return WMDM_E_NOTCERTIFIED if it returns FALSE.

Example Code

The following code shows a service provider's implementation of IMDSPDevice::GetVersion. This method verifies that a secure authenticated channel has been established before returning the version.

HRESULT CMyDevice::GetVersion(DWORD * pdwVersion)
{
    HRESULT hr = S_OK;
    
    if(g_pAppSCServer == NULL)
        return E_FAIL;

    if (!(g_pAppSCServer->fIsAuthenticated()))
    {
        return WMDM_E_NOTCERTIFIED;
    }
    *pdwVersion = 1;
    return hr;
}

Requirements

Header: Include scserver.h.

Library: mssachlp.lib

See Also