00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __OBJECTSAFETY_H__
00024 #define __OBJECTSAFETY_H__
00025
00026 #if HAVE_OBJSAFE_HEADER
00027
00028
00029
00030 #include <objsafe.h>
00031
00032 #else
00033
00034
00035
00036
00037
00038 extern "C" const IID IID_IObjectSafety;
00039
00040 #define INTERFACESAFE_FOR_UNTRUSTED_CALLER 1L
00041 #define INTERFACESAFE_FOR_UNTRUSTED_DATA 2L
00042
00043 struct IObjectSafety : public IUnknown
00044 {
00045 virtual STDMETHODIMP GetInterfaceSafetyOptions(
00046 REFIID riid,
00047 DWORD __RPC_FAR *pdwSupportedOptions,
00048 DWORD __RPC_FAR *pdwEnabledOptions
00049 ) = 0;
00050
00051 virtual STDMETHODIMP SetInterfaceSafetyOptions(
00052 REFIID riid,
00053 DWORD dwSupportedOptions,
00054 DWORD dwOptionSetMask
00055 ) = 0;
00056 };
00057
00058 #endif
00059
00060 class VLCObjectSafety : public IObjectSafety
00061 {
00062 public:
00063
00064 VLCObjectSafety(VLCPlugin *p_instance) : _p_instance(p_instance) {};
00065 virtual ~VLCObjectSafety() {};
00066
00067
00068 STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
00069 {
00070 if( (NULL != ppv)
00071 && (IID_IUnknown == riid)
00072 && (IID_IObjectSafety == riid) )
00073 {
00074 AddRef();
00075 *ppv = reinterpret_cast<LPVOID>(this);
00076 return NOERROR;
00077 }
00078 return _p_instance->pUnkOuter->QueryInterface(riid, ppv);
00079 };
00080
00081 STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->pUnkOuter->AddRef(); };
00082 STDMETHODIMP_(ULONG) Release(void) { return _p_instance->pUnkOuter->Release(); };
00083
00084
00085 STDMETHODIMP GetInterfaceSafetyOptions(
00086 REFIID riid,
00087 DWORD *pdwSupportedOptions,
00088 DWORD *pdwEnabledOptions
00089 );
00090
00091 STDMETHODIMP SetInterfaceSafetyOptions(
00092 REFIID riid,
00093 DWORD dwOptionSetMask,
00094 DWORD dwEnabledOptions
00095 );
00096
00097 private:
00098
00099 VLCPlugin *_p_instance;
00100 };
00101
00102 #endif