|
|
Hi,
I was playing with DRM Import (part of Format SDK / DRM Client Extended API's) and having an issue when trying to retreive the machine certificate collection. GetMachineCertificate returns HRESULT error 0x80070057 (this happens in the first call, when trying to get the buffer size). Code is very simple and follows SDK instructions (code below). Just for fun, I used IWMDRMSecurity to call some other functions (like GetSecurityVersion) and all was ok, only GetMachineCertificate is having problems.
Any help is appreciated!
Thanks, Sasha
HRESULT hr = S_OK;
CComPtr<IWMDRMProvider> pIWMDRMProvider; hr = WMDRMCreateProvider(&pIWMDRMProvider); if(FAILED(hr)) { _tprintf(_T("Could not create IWMDRMProvider. Error: 0x%08x.\n"), hr); return hr; }
CComPtr<IWMDRMSecurity> pIWMDRMSecurity; hr = pIWMDRMProvider->CreateObject(IID_IWMDRMSecurity, (void**)&pIWMDRMSecurity); if(FAILED(hr)) { _tprintf(_T("Could not create IWMDRMSecurity. Error: 0x%08x.\n"), hr); return hr; }
BYTE rgbVersion[4]; DWORD cbCertificate; hr = pIWMDRMSecurity->GetMachineCertificate(WMDRM_CERTIFICATE_TYPE_V2, rgbVersion, NULL, &cbCertificate); if(FAILED(hr)) { _tprintf(_T("Could not get machine certificate. Error: 0x%08x.\n"), hr); return hr; }
|
|
|