|
|
|
1 |
|
// This is a part of the Active Template Library. |
2 |
|
// Copyright (C) 1996-2000 Microsoft Corporation |
3 |
|
// All rights reserved. |
4 |
|
// |
5 |
|
// This source code is only intended as a supplement to the |
6 |
|
// Active Template Library Reference and related |
7 |
|
// electronic documentation provided with the library. |
8 |
|
// See these sources for detailed information regarding the |
9 |
|
// Active Template Library product. |
10 |
|
|
11 |
|
#ifndef __ATLWMIPROV_H__ |
12 |
|
#define __ATLWMIPROV_H__ |
13 |
|
|
14 |
|
#pragma once |
15 |
|
|
16 |
|
#ifndef __cplusplus |
17 |
|
#error requires C++ compilation (use a .cpp suffix) |
18 |
|
#endif |
19 |
|
|
20 |
|
#ifndef __wbemprov_h__ |
21 |
|
#include <wbemprov.h> |
22 |
|
#endif |
23 |
|
|
24 |
|
#ifndef __wmiutils_h__ |
25 |
|
#include <wmiutils.h> |
26 |
|
#endif |
27 |
|
|
28 |
|
namespace ATL |
29 |
|
{ |
30 |
|
|
31 |
|
class ATL_NO_VTABLE IWbemInstProviderImpl : public IWbemServices, |
32 |
|
public IWbemProviderInit |
33 |
|
|
34 |
|
{ |
35 |
|
public: |
36 |
|
|
37 |
|
//IWbemServices |
38 |
|
|
39 |
|
HRESULT STDMETHODCALLTYPE OpenNamespace( |
40 |
|
/* [in] */ const BSTR Namespace, |
41 |
|
/* [in] */ long lFlags, |
42 |
|
/* [in] */ IWbemContext __RPC_FAR *pCtx, |
43 |
|
/* [unique][in][out] */ IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace, |
44 |
|
/* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult) {return WBEM_E_NOT_SUPPORTED;}; |
45 |
|
|
46 |
|
/*?*/HRESULT STDMETHODCALLTYPE CancelAsyncCall( |
47 |
|
/* [in] */ IWbemObjectSink __RPC_FAR *pSink) {return WBEM_E_NOT_SUPPORTED;}; |
48 |
|
|
49 |
|
/*?*/HRESULT STDMETHODCALLTYPE QueryObjectSink( |
50 |
|
/* [in] */ long lFlags, |
51 |
|
/* [out] */ IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler) {return WBEM_E_NOT_SUPPORTED;}; |
52 |
|
|
53 |
|
HRESULT STDMETHODCALLTYPE GetObject( |
54 |
|
/* [in] */ const BSTR ObjectPath, |
55 |
|
/* [in] */ long lFlags, |
56 |
|
/* [in] */ IWbemContext __RPC_FAR *pCtx, |
57 |
|
/* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject, |
58 |
|
/* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}; |
59 |
|
|
60 |
|
|
61 |
|
HRESULT STDMETHODCALLTYPE PutClass( |
62 |
|
/* [in] */ IWbemClassObject __RPC_FAR *pObject, |
63 |
|
/* [in] */ long lFlags, |
64 |
|
/* [in] */ IWbemContext __RPC_FAR *pCtx, |
65 |
|
/* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}; |
66 |
|
|
67 |
|
HRESULT STDMETHODCALLTYPE PutClassAsync( |
68 |
|
/* [in] */ IWbemClassObject __RPC_FAR *pObject, |
69 |
|
/* [in] */ long lFlags, |
70 |
|
/* [in] */ IWbemContext __RPC_FAR *pCtx, |
71 |
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}; |
72 |
|
|
73 |
|
HRESULT STDMETHODCALLTYPE DeleteClass( |
74 |
|
/* [in] */ const BSTR Class, |
777 |
|
case SecurityAnonymous: |
778 |
|
{ |
779 |
|
t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ; |
780 |
|
} |
781 |
|
break ; |
782 |
|
|
783 |
|
case SecurityIdentification: |
784 |
|
{ |
785 |
|
t_ImpersonationLevel = RPC_C_IMP_LEVEL_IDENTIFY ; |
786 |
|
} |
787 |
|
break ; |
788 |
|
|
789 |
|
case SecurityImpersonation: |
790 |
|
{ |
791 |
|
t_ImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE ; |
792 |
|
} |
793 |
|
break ; |
794 |
|
|
795 |
|
case SecurityDelegation: |
796 |
|
{ |
797 |
|
t_ImpersonationLevel = RPC_C_IMP_LEVEL_DELEGATE ; |
798 |
|
} |
799 |
|
break ; |
800 |
|
|
801 |
|
default: |
802 |
|
{ |
803 |
|
t_Result = MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,E_UNEXPECTED); |
804 |
|
} |
805 |
|
break ; |
806 |
|
} |
807 |
|
} |
808 |
|
} |
809 |
|
else |
810 |
|
{ |
811 |
|
t_Result = MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,GetLastError()); |
812 |
|
} |
813 |
|
|
814 |
|
CoRevertToSelf(); |
815 |
|
} |
816 |
|
|
817 |
|
a_Level = t_ImpersonationLevel ; |
818 |
|
return t_Result ; |
819 |
|
} |
820 |
|
|
821 |
|
}; |
822 |
|
} //namespace ATL |
823 |
|
|
824 |
|
#endif //__ATLWMIPROV_H__ |
825 |
|
|
|
|
|