IWMDRMSecurity::GetMachineCertificate method

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The GetMachineCertificate method retrieves the machine certificate of the DRM subsystem on the client computer.

Syntax

HRESULT GetMachineCertificate(
  [in]      DWORD dwCertificateType,
  [out]     BYTE  rgbVersion[4],
  [out]     BYTE  **ppbCertificate,
  [in, out] DWORD *pcbCertificate
);

Parameters

dwCertificateType [in]

Type of certificate to retrieve. Set to one of the values in the following table.

Value Description
WMDRM_CERTIFICATE_TYPE_V1 The certificate will be retrieved in the format used by legacy components.
WMDRM_CERTIFICATE_TYPE_V2 The certificate will be retrieved in the format used by the Windows Vista components.

rgbVersion[4] [out]

Array of four bytes specifying the version of the DRM subsystem on the client computer.

ppbCertificate [out]

Address of a variable that receives a pointer to the certificate data. Set to NULL to have the method provide the buffer size required to hold the certificate in pcbCertificate.

pcbCertificate [in, out]

Size of the certificate in bytes. If ppbCertificate is NULL, this value will be set to the size of the certificate. If ppbCertificate is not NULL, this value must be set to the size of the buffer.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.

Requirements

Requirement Value
Header
Wmdrmsdk.h
Library
Wmdrmsdk.lib

See also

IWMDRMSecurity Interface