Gijs Vermeulen : wbemprox: Accept 0 and WBEM_FLAG_ALWAYS | WBEM_MASK_CONDITION_ORIGIN as flags in IWbemClassObject::GetNames().
Alexandre Julliard
julliard at winehq.org
Tue Mar 23 15:07:43 CDT 2021
Module: wine
Branch: oldstable
Commit: d8db8cd313756dd48d963b63ee3b37fc4b2ee533
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d8db8cd313756dd48d963b63ee3b37fc4b2ee533
Author: Gijs Vermeulen <gijsvrm at gmail.com>
Date: Mon Aug 10 12:09:10 2020 +0200
wbemprox: Accept 0 and WBEM_FLAG_ALWAYS | WBEM_MASK_CONDITION_ORIGIN as flags in IWbemClassObject::GetNames().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=34770
Signed-off-by: Gijs Vermeulen <gijsvrm at gmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 06e455c247c4e7ba56cbdcd636e165418490b299)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/wbemprox/class.c | 12 ++++++++++--
dlls/wbemprox/tests/query.c | 15 +++++++++++++++
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c
index a2e04d1a15c..8f8ec76fa51 100644
--- a/dlls/wbemprox/class.c
+++ b/dlls/wbemprox/class.c
@@ -482,13 +482,21 @@ static HRESULT WINAPI class_object_GetNames(
TRACE("%p, %s, %08x, %s, %p\n", iface, debugstr_w(wszQualifierName), lFlags,
debugstr_variant(pQualifierVal), pNames);
- if (lFlags != WBEM_FLAG_ALWAYS &&
+ if (!pNames)
+ return WBEM_E_INVALID_PARAMETER;
+
+ /* Combination used in a handful of broken apps */
+ if (lFlags == (WBEM_FLAG_ALWAYS | WBEM_MASK_CONDITION_ORIGIN))
+ lFlags = WBEM_FLAG_ALWAYS;
+
+ if (lFlags && (lFlags != WBEM_FLAG_ALWAYS &&
lFlags != WBEM_FLAG_NONSYSTEM_ONLY &&
- lFlags != WBEM_FLAG_SYSTEM_ONLY)
+ lFlags != WBEM_FLAG_SYSTEM_ONLY))
{
FIXME("flags %08x not supported\n", lFlags);
return E_NOTIMPL;
}
+
if (wszQualifierName || pQualifierVal)
FIXME("qualifier not supported\n");
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c
index b254837afd2..efe203f1a2b 100644
--- a/dlls/wbemprox/tests/query.c
+++ b/dlls/wbemprox/tests/query.c
@@ -1128,6 +1128,21 @@ static void test_GetNames( IWbemServices *services )
IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count );
if (!count) break;
+ hr = IWbemClassObject_GetNames( obj, NULL, 0, NULL, NULL );
+ ok( hr == WBEM_E_INVALID_PARAMETER, "got %08x\n", hr );
+
+ hr = IWbemClassObject_GetNames( obj, NULL, 0, NULL, &names );
+ ok( hr == S_OK, "got %08x\n", hr );
+ SafeArrayDestroy( names );
+
+ hr = IWbemClassObject_GetNames( obj, NULL, WBEM_FLAG_ALWAYS, NULL, &names );
+ ok( hr == S_OK, "got %08x\n", hr );
+ SafeArrayDestroy( names );
+
+ hr = IWbemClassObject_GetNames( obj, NULL, WBEM_FLAG_ALWAYS | WBEM_MASK_CONDITION_ORIGIN, NULL, &names );
+ ok( hr == S_OK, "got %08x\n", hr );
+ SafeArrayDestroy( names );
+
VariantInit( &val );
hr = IWbemClassObject_GetNames( obj, NULL, WBEM_FLAG_NONSYSTEM_ONLY, &val, &names );
ok( hr == S_OK, "got %08x\n", hr );
More information about the wine-cvs
mailing list