From fe79fea731bd31a5e07f6151ff165ac58f64a51b Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Fri, 29 Jun 2012 13:39:34 +0200 Subject: [PATCH] wbemprox: Fix returned variant type and flavor for system properties. --- dlls/wbemprox/class.c | 7 +------ dlls/wbemprox/query.c | 18 +++++++++++------- dlls/wbemprox/wbemprox_private.h | 2 +- include/wbemcli.idl | 18 ++++++++++++++++++ 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c index d60f72671ed..ff729f2c07d 100644 --- a/dlls/wbemprox/class.c +++ b/dlls/wbemprox/class.c @@ -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( diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c index 7e5872ab8a6..0ac5a3e8b16 100644 --- a/dlls/wbemprox/query.c +++ b/dlls/wbemprox/query.c @@ -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; } diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h index e2ffce15151..437da283416 100644 --- a/dlls/wbemprox/wbemprox_private.h +++ b/dlls/wbemprox/wbemprox_private.h @@ -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; diff --git a/include/wbemcli.idl b/include/wbemcli.idl index 1cd76eb2eef..c76d4657f6c 100644 --- a/include/wbemcli.idl +++ b/include/wbemcli.idl @@ -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,