Closed maddyblue closed 8 years ago
ItemIndex doesn't exist either on Windows 2003. I'd really like to see this sorted.
This is pending https://github.com/go-ole/go-ole/issues/64 to be sorted as we want to call _NewEnum on the SWbemObjectSet to get the enumerator and then iterate over it. Means we shouldn't need to call the Count method to get the number of items as I've had issues with that on XP.
The issue go-ole/go-ole#64 has now been sorted so this should be fairly easy to implement now.
Hi, is there anything I can do to help? I know next to nothing about WMI internals but I can help test
Need to merge SokoloffA pull request, it solves this issue.
Should be ok to close this.
SWbemObjectSet does not have ItemIndex on my system (windows xp).
// // Dispatch ISWbemObjectSet 0.0: // A collection of Classes or Instances // {76A6415F-CB41-11D1-8B02-00600806D9B6} // 0: QueryInterface(riid _GUID /in/, ppvObj _VT_VOID /out/) VT_VOID 1: AddRef() VT_UI4 2: Release() VT_UI4 3: GetTypeInfoCount(pctinfo _VT_UINT /out/) VT_VOID 4: GetTypeInfo(itinfo VT_UINT /in/, lcid VT_UI4 /in/, pptinfo _VT_VOID /out/) VT_VOID 5: GetIDsOfNames(riid _GUID /in/, rgszNames _VT_I1 /in/, cNames VT_UINT /in/, lcid VT_UI4 /in/, rgdispid _VT_I4 /out/) VT_VOID 6: Invoke(dispidMember VT_I4 /in/, riid GUID /in/, lcid VT_UI4 /in/, wFlags VT_UI2 /in/, pdispparams DISPPARAMS /in/, pvarResult VT_VARIANT /out/, pexcepinfo EXCEPINFO /out/, puArgErr VT_UINT /out/) VT_VOID 7: get _NewEnum() VT_UNKNOWN // Get an Object with a specific path from this collection 8: Item(strObjectPath VT_BSTR /in/, iFlags VT_I4 /_in,opt,def/) ISWbemObject // The number of items in this collection 9: get Count() VTI4 // The Security Configurator for this Object 10: get Security() *ISWbemSecurity
I think you should use _NewEnum instead. But I am not expert.
Above from: https://code.google.com/p/go/issues/detail?id=8293#c8