Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Entertainment » microsoft.public.windowsmedia.sdk
Thread: IWMDRMSecurity::GetMachineCertificate error

HTVi
TV Discussion Newsgroups

IWMDRMSecurity::GetMachineCertificate error
"Sasha Nikolic" <sasha[ at ]nikolic.net> 6/22/2007 9:48:48 AM
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;
}

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen