Export (0) Print
Expand All
Expand Minimize

MFCreateProtectedEnvironmentAccess function

Creates an IMFProtectedEnvironmentAccess object that allows content protection systems to perform a handshake with the protected environment.

Syntax


STDAPI MFCreateProtectedEnvironmentAccess(
  _Out_  IMFProtectedEnvironmentAccess **ppAccess
);

Parameters

ppAccess [out]

Receives a pointer to the IMFProtectedEnvironmentAccess interface.

Remarks

Windows Phone 8.1: This API is supported.

Examples

The following example demonstrates how use the MFCreateProtectedEnvironmentAccess function to get an authorization certificate from the protected environment.


HRESULT CallPEAuth(IMFProtectedEnvironmentAccess *access)
{
    //   Try to get an authorization certificate from the protected environment.
    PEAUTH_MSG peauth_msg;
    ZeroMemory(&peauth_msg, sizeof(peauth_msg));
    peauth_msg.Version = PEAUTHMSG_VERSION;
    peauth_msg.cbMsgSize = sizeof(PEAUTH_MSG);
    peauth_msg.Type = PEAUTH_MSG_CERTCHAIN;
    peauth_msg.SecurityLevel = PEAUTH_MSG_LOW_SECURITY;

    PEAUTH_MSG_RESPONSE peauth_msg_rsp;
    ZeroMemory(&peauth_msg_rsp, sizeof(PEAUTH_MSG_RESPONSE));

    return access->Call(sizeof(peauth_msg), (const BYTE*)&peauth_msg, sizeof(PEAUTH_MSG_RESPONSE), (BYTE*)&peauth_msg_rsp);
}

void TestPEAuth()
{
    //  Create object
    IMFProtectedEnvironmentAccess *pPEAccess;

    hr = MFCreateProtectedEnvironmentAccess(&pPEAccess);

    //  Open
    hr = spPEAccess->Open();


    hr = CallPEAuth(spPEAccess.Get());

    hr = spPEAccess->Close();
}



Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Mfidl.h

Library

Mf.lib

DLL

Mf.dll

See also

IMFProtectedEnvironmentAccess
Call

 

 

Community Additions

ADD
Show:
© 2014 Microsoft