Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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.

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 | UWP apps]

Minimum supported server

Windows Server 2012 [desktop apps | UWP apps]

Minimum supported phone

Windows Phone 8.1

Header

Mfidl.h

Library

Mf.lib

DLL

Mf.dll

See also

Media Foundation Functions
IMFProtectedEnvironmentAccess
Call

 

 

Show:
© 2017 Microsoft