Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=34770 Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/wbemprox/class.c | 15 ++++++++++----- dlls/wbemprox/tests/query.c | 15 +++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c index db6017e0c9..b146b04df8 100644 --- a/dlls/wbemprox/class.c +++ b/dlls/wbemprox/class.c @@ -484,13 +484,18 @@ 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 e48722f3bc..476840fbc3 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1009,6 +1009,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 );
On Sun, 2020-08-09 at 14:56 +0200, Gijs Vermeulen wrote:
- 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;
- }
Double negation of lFlags is not necessary. I think we should keep the E_NOTIMPL return for flags that aren't implemented.