https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e054ebd54c9bf0b407811…
commit e054ebd54c9bf0b4078110cd4c74896e55fac8f2
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Mon Feb 4 13:10:24 2019 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Mon Feb 4 13:10:24 2019 +0100
[WBEMDISP_WINETEST] Sync with Wine Staging 4.0. CORE-15682
---
modules/rostests/winetests/wbemdisp/wbemdisp.c | 94 ++++++++++++++++++++++++--
1 file changed, 89 insertions(+), 5 deletions(-)
diff --git a/modules/rostests/winetests/wbemdisp/wbemdisp.c
b/modules/rostests/winetests/wbemdisp/wbemdisp.c
index 0c426c569a..57baf848cc 100644
--- a/modules/rostests/winetests/wbemdisp/wbemdisp.c
+++ b/modules/rostests/winetests/wbemdisp/wbemdisp.c
@@ -48,6 +48,11 @@ static void test_ParseDisplayName(void)
static const WCHAR name4[] =
{'w','i','n','m','g','m','t','s',':','\\','\\','.','\\','r','o','o','t','\\','c','i','m','v','2',':',
'W','i','n','3','2','_','S','e','r','v','i','c','e',0};
+ static const WCHAR stdregprovW[] =
+
{'w','i','n','m','g','m','t','s',':','\\','\\','.','\\','r','o','o','t','\\','d','e','f','a','u','l','t',':',
+
'S','t','d','R','e','g','P','r','o','v',0};
+ static const WCHAR getstringvalueW[] =
+
{'G','e','t','S','t','r','i','n','g','V','a','l','u','e',0};
static const struct
{
const WCHAR *name;
@@ -56,10 +61,10 @@ static void test_ParseDisplayName(void)
ULONG eaten;
} tests[] =
{
- { name1, S_OK, &IID_ISWbemServices, sizeof(name1)/sizeof(name1[0]) - 1 },
- { name2, S_OK, &IID_ISWbemServices, sizeof(name2)/sizeof(name2[0]) - 1 },
- { name3, S_OK, &IID_ISWbemObject, sizeof(name3)/sizeof(name3[0]) - 1 },
- { name4, S_OK, &IID_ISWbemObject, sizeof(name4)/sizeof(name4[0]) - 1 }
+ { name1, S_OK, &IID_ISWbemServices, ARRAY_SIZE( name1 ) - 1 },
+ { name2, S_OK, &IID_ISWbemServices, ARRAY_SIZE( name2 ) - 1 },
+ { name3, S_OK, &IID_ISWbemObject, ARRAY_SIZE( name3 ) - 1 },
+ { name4, S_OK, &IID_ISWbemObject, ARRAY_SIZE( name4 ) - 1 }
};
IParseDisplayName *displayname;
IBindCtx *ctx;
@@ -79,7 +84,7 @@ static void test_ParseDisplayName(void)
hr = CreateBindCtx( 0, &ctx );
ok( hr == S_OK, "got %x\n", hr );
- for (i =0; i < sizeof(tests)/sizeof(tests[0]); i++)
+ for (i =0; i < ARRAY_SIZE( tests ); i++)
{
str = SysAllocString( tests[i].name );
eaten = 0xdeadbeef;
@@ -242,6 +247,36 @@ static void test_ParseDisplayName(void)
}
IBindCtx_Release( ctx );
+
+ hr = CreateBindCtx( 0, &ctx );
+ ok( hr == S_OK, "got %x\n", hr );
+
+ str = SysAllocString( stdregprovW );
+ hr = IParseDisplayName_ParseDisplayName( displayname, NULL, str, &eaten,
&moniker );
+ ok( hr == S_OK, "got %x\n", hr );
+ SysFreeString( str );
+
+ if (moniker)
+ {
+ ISWbemObject *sobj = NULL;
+ hr = IMoniker_BindToObject( moniker, ctx, NULL, &IID_ISWbemObject, (void
**)&sobj );
+ ok( hr == S_OK, "got %x\n",hr );
+ if (sobj)
+ {
+ DISPID dispid = 0xdeadbeef;
+
+ str = SysAllocString( getstringvalueW );
+ hr = ISWbemObject_GetIDsOfNames( sobj, &IID_NULL, &str, 1, english,
&dispid );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( dispid == 0x1000001, "got %x\n", dispid );
+
+ ISWbemObject_Release( sobj );
+ SysFreeString( str );
+ }
+ IMoniker_Release( moniker );
+ }
+
+ IBindCtx_Release(ctx);
IParseDisplayName_Release( displayname );
}
@@ -265,7 +300,11 @@ static void test_locator(void)
ISWbemObject *object;
ISWbemPropertySet *prop_set;
ISWbemProperty *prop;
+ ISWbemSecurity *security;
VARIANT var;
+ LONG count;
+ WbemImpersonationLevelEnum imp_level;
+ WbemAuthenticationLevelEnum auth_level;
hr = CoCreateInstance( &CLSID_SWbemLocator, NULL, CLSCTX_INPROC_SERVER,
&IID_ISWbemLocator, (void **)&locator );
ok( hr == S_OK, "got %x\n", hr );
@@ -284,6 +323,34 @@ static void test_locator(void)
SysFreeString( lang_bstr );
SysFreeString( query_bstr );
+ hr = ISWbemLocator_get_Security_( locator, &security );
+ ok( hr == S_OK, "got %x\n", hr );
+ imp_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_ImpersonationLevel( security, &imp_level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( imp_level == wbemImpersonationLevelImpersonate, "got %u\n", imp_level
);
+ hr = ISWbemSecurity_put_ImpersonationLevel( security, wbemImpersonationLevelAnonymous
);
+ ok( hr == S_OK, "got %x\n", hr );
+ imp_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_ImpersonationLevel( security, &imp_level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( imp_level == wbemImpersonationLevelAnonymous, "got %u\n", imp_level );
+
+ auth_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_AuthenticationLevel( security, &auth_level );
+ todo_wine {
+ ok( hr == WBEM_E_FAILED, "got %x\n", hr );
+ ok( auth_level == 0xdeadbeef, "got %u\n", auth_level );
+ }
+ hr = ISWbemSecurity_put_AuthenticationLevel( security, wbemAuthenticationLevelNone
);
+ ok( hr == S_OK, "got %x\n", hr );
+ auth_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_AuthenticationLevel( security, &auth_level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( auth_level == wbemAuthenticationLevelNone, "got %u\n", auth_level );
+ ISWbemSecurity_Release( security );
+ security = NULL;
+
hr = ISWbemObjectSet_get__NewEnum( object_set, (IUnknown**)&enum_var );
ok( hr == S_OK, "got %x\n", hr );
@@ -313,11 +380,28 @@ static void test_locator(void)
ok( hr == S_OK, "got %x\n", hr );
SysFreeString( procid_bstr );
+ count = 0;
+ hr = ISWbemPropertySet_get_Count( prop_set, &count );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( count > 0, "got %d\n", count );
+
hr = ISWbemProperty_get_Value( prop, &var );
ok( hr == S_OK, "got %x\n", hr );
ok( V_VT(&var) == VT_BSTR, "got %x\n", V_VT(&var) );
VariantClear( &var );
+ hr = ISWbemServices_get_Security_( services, &security );
+ ok( hr == S_OK, "got %x\n", hr );
+ imp_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_ImpersonationLevel( security, &imp_level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( imp_level == wbemImpersonationLevelImpersonate, "got %u\n", imp_level
);
+ auth_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_AuthenticationLevel( security, &auth_level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( auth_level == wbemAuthenticationLevelPktPrivacy, "got %u\n", auth_level
);
+
+ ISWbemSecurity_Release(security);
ISWbemProperty_Release( prop );
ISWbemPropertySet_Release( prop_set );
ISWbemObject_Release( object );