Commit fe79fea7 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Fix returned variant type and flavor for system properties.

parent 1b0d5cb1
......@@ -290,12 +290,7 @@ static HRESULT WINAPI class_object_Get(
TRACE("%p, %s, %08x, %p, %p, %p\n", iface, debugstr_w(wszName), lFlags, pVal, pType, plFlavor);
if (plFlavor)
{
FIXME("flavor parameter not supported\n");
*plFlavor = 0;
}
return get_propval( view, co->index, wszName, pVal, pType );
return get_propval( view, co->index, wszName, pVal, pType, plFlavor );
}
static HRESULT WINAPI class_object_Put(
......
......@@ -597,7 +597,7 @@ static UINT count_selected_props( const struct view *view )
}
static HRESULT get_system_propval( const struct view *view, UINT index, const WCHAR *name,
VARIANT *ret, CIMTYPE *type )
VARIANT *ret, CIMTYPE *type, LONG *flavor )
{
static const WCHAR classW[] = {'_','_','C','L','A','S','S',0};
static const WCHAR genusW[] = {'_','_','G','E','N','U','S',0};
......@@ -607,6 +607,8 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
static const WCHAR relpathW[] = {'_','_','R','E','L','P','A','T','H',0};
static const WCHAR serverW[] = {'_','_','S','E','R','V','E','R',0};
if (flavor) *flavor = WBEM_FLAVOR_ORIGIN_SYSTEM;
if (!strcmpiW( name, classW ))
{
V_VT( ret ) = VT_BSTR;
......@@ -616,8 +618,8 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
}
if (!strcmpiW( name, genusW ))
{
V_VT( ret ) = VT_INT;
V_INT( ret ) = WBEM_GENUS_INSTANCE; /* FIXME */
V_VT( ret ) = VT_I4;
V_I4( ret ) = WBEM_GENUS_INSTANCE; /* FIXME */
if (type) *type = CIM_SINT32;
return S_OK;
}
......@@ -637,8 +639,8 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
}
if (!strcmpiW( name, propcountW ))
{
V_VT( ret ) = VT_INT;
V_INT( ret ) = count_selected_props( view );
V_VT( ret ) = VT_I4;
V_I4( ret ) = count_selected_props( view );
if (type) *type = CIM_SINT32;
return S_OK;
}
......@@ -660,13 +662,14 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
return WBEM_E_NOT_FOUND;
}
HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VARIANT *ret, CIMTYPE *type )
HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VARIANT *ret,
CIMTYPE *type, LONG *flavor )
{
HRESULT hr;
UINT column, row = view->result[index];
LONGLONG val;
if (is_system_prop( name )) return get_system_propval( view, index, name, ret, type );
if (is_system_prop( name )) return get_system_propval( view, index, name, ret, type, flavor );
if (!is_selected_prop( view, name )) return WBEM_E_NOT_FOUND;
hr = get_column_index( view->table, name, &column );
......@@ -711,6 +714,7 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR
return WBEM_E_FAILED;
}
if (type) *type = view->table->columns[column].type & COL_TYPE_MASK;
if (flavor) *flavor = 0;
return S_OK;
}
......
......@@ -120,7 +120,7 @@ HRESULT create_view( const struct property *, const WCHAR *, const struct expr *
void destroy_view( struct view * ) DECLSPEC_HIDDEN;
struct table *get_table( const WCHAR * ) DECLSPEC_HIDDEN;
HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *,
CIMTYPE * ) DECLSPEC_HIDDEN;
CIMTYPE *, LONG * ) DECLSPEC_HIDDEN;
HRESULT get_properties( const struct view *, SAFEARRAY ** ) DECLSPEC_HIDDEN;
HRESULT WbemLocator_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
......
......@@ -201,6 +201,24 @@ typedef [v1_enum] enum tag_WBEM_CONDITION_FLAG_TYPE
WBEM_MASK_CLASS_CONDITION = 0x300
} WBEM_CONDITION_FLAG_TYPE;
typedef [v1_enum] enum tag_WBEM_FLAVOR_TYPE
{
WBEM_FLAVOR_DONT_PROPAGATE = 0,
WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE = 0x1,
WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS = 0x2,
WBEM_FLAVOR_MASK_PROPAGATION = 0xf,
WBEM_FLAVOR_OVERRIDABLE = 0,
WBEM_FLAVOR_NOT_OVERRIDABLE = 0x10,
WBEM_FLAVOR_MASK_PERMISSIONS = 0x10,
WBEM_FLAVOR_ORIGIN_LOCAL = 0,
WBEM_FLAVOR_ORIGIN_PROPAGATED = 0x20,
WBEM_FLAVOR_ORIGIN_SYSTEM = 0x40,
WBEM_FLAVOR_MASK_ORIGIN = 0x60,
WBEM_FLAVOR_NOT_AMENDED = 0,
WBEM_FLAVOR_AMENDED = 0x80,
WBEM_FLAVOR_MASK_AMENDED = 0x80
} WBEM_FLAVOR_TYPE;
typedef [v1_enum] enum tag_WBEM_GENUS_TYPE
{
WBEM_GENUS_CLASS = 1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment