共用方式為


CSecureChannelServer::fIsAuthenticated

banner art

The fIsAuthenticated method verifies that a Secure Authenticated Channel Interface 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 and service provider 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 a complete list of possible error codes, see Error Codes.

Remarks

This method is used to ensure that a secure authentication 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 check fIsAuthenticated for all exposed APIs and return WMDM_E_NOTCERTIFIED if the fIsAuthenticated method returns FALSE.

Example Code

#define CHECK( hResult )\
{ 
    hr = (hResult);
    if( FAILED(hr) )
    {
        _ASSERT(FALSE); 
        goto Exit;
    }
}
CSecureChannelServer *g_pSCWMDM = NULL;
// Is a secure channel set up?
if (g_pSCWMDM)
{
    if (!g_pSCWMDM->fIsAuthenticated())
    {
        CHECK(WMDM_E_NOTCERTIFIED);
    }
}
else
{
    CHECK(E_FAIL);
}

Requirements

Header: Include scserver.h.

Library: mssachlp.lib

See Also