如何用c++调用wmi的方法,获得vista的启动项

怎么用c++调用wmi的方法,获得vista的启动项
怎么用c++ 调用wmi的方法?获取win7和vista的启动项。已知:wmi的bcdobject类,用getelement
谢谢
相关c#代码如下
 public void LoadAllOS()
        {
            List<string> lstOsName = new List<string>();
            ConnectionOptions connectionOptions = new ConnectionOptions();
            connectionOptions.Impersonation = ImpersonationLevel.Impersonate;
            connectionOptions.EnablePrivileges = true;

            ManagementScope managementScope = new ManagementScope(@"root\WMI", connectionOptions);

            // SYSTEM STORE GUID = {9dea862c-5cdd-4e70-acc1-f32b344d4795}
            systemObject = new BcdObject(managementScope, "{9dea862c-5cdd-4e70-acc1-f32b344d4795}", "");

            ManagementBaseObject mboOut;
            bool success = systemObject.GetElement((uint)BCDConstants.BcdBootMgrElementTypes.BcdBootMgrObjectList_DisplayOrder, out mboOut);

            if (success)
            {
                string[] osIdList = (string[])mboOut.GetPropertyValue("Ids");
                foreach (string osGuid in osIdList)
                {
                    BcdObject osObj = new BcdObject(managementScope, osGuid, "");
                    success = osObj.GetElement((uint)BCDConstants.BcdLibraryElementTypes.BcdLibraryString_Description, out mboOut);

                    if (success)
                    {
                        OS myOS = new OS();
                        myOS.Name = mboOut.GetPropertyValue("String").ToString();
                        myOS.GUID = osGuid;
                        myOS.osObj = osObj;
//                         lstOS.Items.Add(myOS);
                        lstOsName.Add(myOS.Name.ToString());