wbemprox: Add support for WBEM_FLAG_NONSYSTEM_ONLY and WBEM_FLAG_SYSTEM_ONLY in IWbemClassObject::GetNames.
This commit is contained in:
parent
7aaf597db1
commit
c3566b088d
|
@ -476,17 +476,17 @@ static HRESULT WINAPI class_object_GetNames(
|
||||||
TRACE("%p, %s, %08x, %s, %p\n", iface, debugstr_w(wszQualifierName), lFlags,
|
TRACE("%p, %s, %08x, %s, %p\n", iface, debugstr_w(wszQualifierName), lFlags,
|
||||||
debugstr_variant(pQualifierVal), pNames);
|
debugstr_variant(pQualifierVal), pNames);
|
||||||
|
|
||||||
if (wszQualifierName || pQualifierVal)
|
if (lFlags != WBEM_FLAG_ALWAYS &&
|
||||||
{
|
lFlags != WBEM_FLAG_NONSYSTEM_ONLY &&
|
||||||
FIXME("qualifier not supported\n");
|
lFlags != WBEM_FLAG_SYSTEM_ONLY)
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
if (lFlags != WBEM_FLAG_ALWAYS)
|
|
||||||
{
|
{
|
||||||
FIXME("flags %08x not supported\n", lFlags);
|
FIXME("flags %08x not supported\n", lFlags);
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
return get_properties( ec->query->view, pNames );
|
if (wszQualifierName || pQualifierVal)
|
||||||
|
FIXME("qualifier not supported\n");
|
||||||
|
|
||||||
|
return get_properties( ec->query->view, lFlags, pNames );
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI class_object_BeginEnumeration(
|
static HRESULT WINAPI class_object_BeginEnumeration(
|
||||||
|
|
|
@ -959,7 +959,7 @@ HRESULT put_propval( const struct view *view, UINT index, const WCHAR *name, VAR
|
||||||
return set_value( view->table, row, column, val, type );
|
return set_value( view->table, row, column, val, type );
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT get_properties( const struct view *view, SAFEARRAY **props )
|
HRESULT get_properties( const struct view *view, LONG flags, SAFEARRAY **props )
|
||||||
{
|
{
|
||||||
SAFEARRAY *sa;
|
SAFEARRAY *sa;
|
||||||
BSTR str;
|
BSTR str;
|
||||||
|
@ -970,8 +970,14 @@ HRESULT get_properties( const struct view *view, SAFEARRAY **props )
|
||||||
|
|
||||||
for (i = 0; i < view->table->num_cols; i++)
|
for (i = 0; i < view->table->num_cols; i++)
|
||||||
{
|
{
|
||||||
|
BOOL is_system;
|
||||||
|
|
||||||
if (is_method( view->table, i )) continue;
|
if (is_method( view->table, i )) continue;
|
||||||
|
|
||||||
|
is_system = is_system_prop( view->table->columns[i].name );
|
||||||
|
if ((flags & WBEM_FLAG_NONSYSTEM_ONLY) && is_system) continue;
|
||||||
|
else if ((flags & WBEM_FLAG_SYSTEM_ONLY) && !is_system) continue;
|
||||||
|
|
||||||
str = SysAllocString( view->table->columns[i].name );
|
str = SysAllocString( view->table->columns[i].name );
|
||||||
if (!str || SafeArrayPutElement( sa, &i, str ) != S_OK)
|
if (!str || SafeArrayPutElement( sa, &i, str ) != S_OK)
|
||||||
{
|
{
|
||||||
|
|
|
@ -616,6 +616,40 @@ static void test_query_async( IWbemServices *services )
|
||||||
SysFreeString( query );
|
SysFreeString( query );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_GetNames( IWbemServices *services )
|
||||||
|
{
|
||||||
|
static const WCHAR queryW[] =
|
||||||
|
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_',
|
||||||
|
'O','p','e','r','a','t','i','n','g','S','y','s','t','e','m',0};
|
||||||
|
BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW );
|
||||||
|
IEnumWbemClassObject *result;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
IWbemClassObject *obj;
|
||||||
|
SAFEARRAY *names;
|
||||||
|
ULONG count;
|
||||||
|
VARIANT val;
|
||||||
|
|
||||||
|
IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count );
|
||||||
|
if (!count) break;
|
||||||
|
|
||||||
|
VariantInit( &val );
|
||||||
|
hr = IWbemClassObject_GetNames( obj, NULL, WBEM_FLAG_NONSYSTEM_ONLY, &val, &names );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
|
||||||
|
SafeArrayDestroy( names );
|
||||||
|
IWbemClassObject_Release( obj );
|
||||||
|
}
|
||||||
|
IEnumWbemClassObject_Release( result );
|
||||||
|
SysFreeString( query );
|
||||||
|
SysFreeString( wql );
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(query)
|
START_TEST(query)
|
||||||
{
|
{
|
||||||
static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0};
|
static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0};
|
||||||
|
@ -647,6 +681,7 @@ START_TEST(query)
|
||||||
test_StdRegProv( services );
|
test_StdRegProv( services );
|
||||||
test_notification_query_async( services );
|
test_notification_query_async( services );
|
||||||
test_query_async( services );
|
test_query_async( services );
|
||||||
|
test_GetNames( services );
|
||||||
|
|
||||||
SysFreeString( path );
|
SysFreeString( path );
|
||||||
IWbemServices_Release( services );
|
IWbemServices_Release( services );
|
||||||
|
|
|
@ -200,7 +200,7 @@ HRESULT to_longlong( VARIANT *, LONGLONG *, CIMTYPE * ) DECLSPEC_HIDDEN;
|
||||||
SAFEARRAY *to_safearray( const struct array *, CIMTYPE ) DECLSPEC_HIDDEN;
|
SAFEARRAY *to_safearray( const struct array *, CIMTYPE ) DECLSPEC_HIDDEN;
|
||||||
VARTYPE to_vartype( CIMTYPE ) DECLSPEC_HIDDEN;
|
VARTYPE to_vartype( CIMTYPE ) DECLSPEC_HIDDEN;
|
||||||
void destroy_array( struct array *, CIMTYPE ) DECLSPEC_HIDDEN;
|
void destroy_array( struct array *, CIMTYPE ) DECLSPEC_HIDDEN;
|
||||||
HRESULT get_properties( const struct view *, SAFEARRAY ** ) DECLSPEC_HIDDEN;
|
HRESULT get_properties( const struct view *, LONG, SAFEARRAY ** ) DECLSPEC_HIDDEN;
|
||||||
HRESULT get_object( const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN;
|
HRESULT get_object( const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN;
|
||||||
BSTR get_method_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
|
BSTR get_method_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
|
||||||
BSTR get_property_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
|
BSTR get_property_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
|
||||||
|
|
Loading…
Reference in New Issue