wbemprox: Implement IWbemClassObject::GetNames.

This commit is contained in:
Hans Leidekker 2012-06-19 10:19:38 +02:00 committed by Alexandre Julliard
parent 612f380ad0
commit f18b24ad39
4 changed files with 58 additions and 2 deletions

View file

@ -314,8 +314,22 @@ static HRESULT WINAPI class_object_GetNames(
VARIANT *pQualifierVal, VARIANT *pQualifierVal,
SAFEARRAY **pNames ) SAFEARRAY **pNames )
{ {
FIXME("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszQualifierName), lFlags, pQualifierVal, pNames); struct class_object *co = impl_from_IWbemClassObject( iface );
return E_NOTIMPL; struct enum_class_object *ec = impl_from_IEnumWbemClassObject( co->iter );
TRACE("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszQualifierName), lFlags, pQualifierVal, pNames);
if (wszQualifierName || pQualifierVal)
{
FIXME("qualifier not supported\n");
return E_NOTIMPL;
}
if (lFlags != WBEM_FLAG_ALWAYS)
{
FIXME("flags %08x not supported\n", lFlags);
return E_NOTIMPL;
}
return get_properties( ec->query->view, pNames );
} }
static HRESULT WINAPI class_object_BeginEnumeration( static HRESULT WINAPI class_object_BeginEnumeration(

View file

@ -413,3 +413,25 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR
if (type) *type = view->table->columns[column].type; if (type) *type = view->table->columns[column].type;
return S_OK; return S_OK;
} }
HRESULT get_properties( const struct view *view, SAFEARRAY **props )
{
SAFEARRAY *sa;
BSTR str;
LONG i;
if (!(sa = SafeArrayCreateVector( VT_BSTR, 0, view->table->num_cols ))) return E_OUTOFMEMORY;
for (i = 0; i < view->table->num_cols; i++)
{
str = SysAllocString( view->table->columns[i].name );
if (!str || SafeArrayPutElement( sa, &i, str ) != S_OK)
{
SysFreeString( str );
SafeArrayDestroy( sa );
return E_OUTOFMEMORY;
}
}
*props = sa;
return S_OK;
}

View file

@ -114,6 +114,7 @@ void destroy_view( struct view * ) DECLSPEC_HIDDEN;
struct table *get_table( const WCHAR * ) DECLSPEC_HIDDEN; struct table *get_table( const WCHAR * ) DECLSPEC_HIDDEN;
HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *, HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *,
CIMTYPE * ) DECLSPEC_HIDDEN; CIMTYPE * ) DECLSPEC_HIDDEN;
HRESULT get_properties( const struct view *, SAFEARRAY ** ) DECLSPEC_HIDDEN;
HRESULT WbemLocator_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN; HRESULT WbemLocator_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
HRESULT WbemServices_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN; HRESULT WbemServices_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;

View file

@ -182,6 +182,25 @@ typedef [v1_enum] enum tag_WBEM_TIMEOUT_TYPE
WBEM_INFINITE = 0xffffffff WBEM_INFINITE = 0xffffffff
} WBEM_TIMEOUT_TYPE; } WBEM_TIMEOUT_TYPE;
typedef [v1_enum] enum tag_WBEM_CONDITION_FLAG_TYPE
{
WBEM_FLAG_ALWAYS = 0,
WBEM_FLAG_ONLY_IF_TRUE = 0x1,
WBEM_FLAG_ONLY_IF_FALSE = 0x2,
WBEM_FLAG_ONLY_IF_IDENTICAL = 0x3,
WBEM_MASK_PRIMARY_CONDITION = 0x3,
WBEM_FLAG_KEYS_ONLY = 0x4,
WBEM_FLAG_REFS_ONLY = 0x8,
WBEM_FLAG_LOCAL_ONLY = 0x10,
WBEM_FLAG_PROPAGATED_ONLY = 0x20,
WBEM_FLAG_SYSTEM_ONLY = 0x30,
WBEM_FLAG_NONSYSTEM_ONLY = 0x40,
WBEM_MASK_CONDITION_ORIGIN = 0x70,
WBEM_FLAG_CLASS_OVERRIDES_ONLY = 0x100,
WBEM_FLAG_CLASS_LOCAL_AND_OVERRIDES = 0x200,
WBEM_MASK_CLASS_CONDITION = 0x300
} WBEM_CONDITION_FLAG_TYPE;
typedef [v1_enum] enum tag_CIMTYPE_ENUMERATION typedef [v1_enum] enum tag_CIMTYPE_ENUMERATION
{ {
CIM_ILLEGAL = 0xfff, CIM_ILLEGAL = 0xfff,