检索用户 SDO
以下代码检索管理员 (SDO) 的服务器数据对象。
HRESULT hr;
_bstr_t bstrUserName = L"Administrator";
CComPtr<IUnknown> pUserUnknown;
hr = pSdoMachine->GetUserSDO(
DATA_STORE_LOCAL,
bstrUserName,
(IUnknown**) &pUserUnknown
);
if (FAILED(hr))
{
return hr;
}
CComPtr<ISdo> pUserSDO;
hr = pUserUnknown->QueryInterface(
__uuidof(ISdo),
(void**) &pUserSDO
);
if (FAILED(hr))
{
return hr;
}
相关主题