[PATCH 2/2] wbemdisp/tests: Add ISWbemSecurity tests
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Tue Jun 5 00:45:12 CDT 2018
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
dlls/wbemdisp/tests/wbemdisp.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/dlls/wbemdisp/tests/wbemdisp.c b/dlls/wbemdisp/tests/wbemdisp.c
index 171a91e..b8cd5c8 100644
--- a/dlls/wbemdisp/tests/wbemdisp.c
+++ b/dlls/wbemdisp/tests/wbemdisp.c
@@ -265,7 +265,10 @@ static void test_locator(void)
ISWbemObject *object;
ISWbemPropertySet *prop_set;
ISWbemProperty *prop;
+ ISWbemSecurity *security;
VARIANT var;
+ WbemImpersonationLevelEnum level;
+ WbemAuthenticationLevelEnum authenication;
hr = CoCreateInstance( &CLSID_SWbemLocator, NULL, CLSCTX_INPROC_SERVER, &IID_ISWbemLocator, (void **)&locator );
ok( hr == S_OK, "got %x\n", hr );
@@ -284,6 +287,21 @@ 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 );
+ hr = ISWbemSecurity_put_ImpersonationLevel( security, wbemImpersonationLevelImpersonate );
+ ok( hr == S_OK, "got %x\n", hr );
+ hr = ISWbemSecurity_get_ImpersonationLevel( security, &level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( level == wbemImpersonationLevelImpersonate, "got %d\n", level );
+ hr = ISWbemSecurity_put_AuthenticationLevel( security, wbemAuthenticationLevelPktPrivacy );
+ ok( hr == S_OK, "got %x\n", hr );
+ hr = ISWbemSecurity_get_AuthenticationLevel( security, &authenication );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( authenication == wbemAuthenticationLevelPktPrivacy, "got %d\n", authenication );
+ ISWbemSecurity_Release( security );
+ security = NULL;
+
hr = ISWbemObjectSet_get__NewEnum( object_set, (IUnknown**)&enum_var );
ok( hr == S_OK, "got %x\n", hr );
@@ -318,6 +336,16 @@ static void test_locator(void)
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 );
+ hr = ISWbemSecurity_get_ImpersonationLevel( security, &level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( level == wbemImpersonationLevelImpersonate, "got %d\n", level );
+ hr = ISWbemSecurity_get_AuthenticationLevel( security, &authenication );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( authenication == wbemAuthenticationLevelPktPrivacy, "got %d\n", authenication );
+
+ ISWbemSecurity_Release(security);
ISWbemProperty_Release( prop );
ISWbemPropertySet_Release( prop_set );
ISWbemObject_Release( object );
--
1.9.1
More information about the wine-devel
mailing list