【发布时间】:2013-10-01 06:44:19
【问题描述】:
如何在 VC++ 中使用 WMI Query 获取 VisualSVN 服务器用户访问权限。
我正在编写一个 vc++ 应用程序,通过 WMI 查询获取和设置 VisualSVN 服务器的用户访问权限。
我们可以使用
获取 Associatedobject 并获取存储库名称和路径 VARIANT vtProp;
hres = pclsObj->Get(L"AssociatedObject", 0, &vtProp, 0, 0);
wcout <<L"Values : " << vtProp.bstrVal << endl;
但没有获取到 Permission 对象的值,权限包含集合对象。
hres = pclsObj->Get(L"Permissions", 0, &vtProp, 0, 0);
SAFEARRAY *pSafeArray = vtProp.parray;
LONG uBound = -1, lBound = 0;
SafeArrayGetUBound(pSafeArray,1,&uBound);
SafeArrayGetLBound(pSafeArray,1,&lBound);
int nCount = uBound - lBound + 1;
for(int i = 0; i<nCount; ++i)
{
wcout << ((BSTR*)(pSafeArray->pvData))[i] << endl;
}
但没有获取对象值。如何从 SafeArray 中获取 Unknown 对象值。
谢谢..
【问题讨论】:
标签: visual-c++ wmi visual-c++-6 visualsvn-server wmi-query