00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "plugin.h"
00024 #include "objectsafety.h"
00025
00026 #include "axvlc_idl.h"
00027
00028 #if 0
00029 const GUID IID_IObjectSafety =
00030 {0xCB5BDC81,0x93C1,0x11cf,{0x8F,0x20,0x00,0x80,0x5F,0x2C,0xD0,0x64}};
00031 #endif
00032
00033 using namespace std;
00034
00035 STDMETHODIMP VLCObjectSafety::GetInterfaceSafetyOptions(
00036 REFIID riid,
00037 DWORD *pdwSupportedOptions,
00038 DWORD *pdwEnabledOptions
00039 )
00040 {
00041 if( (NULL == pdwSupportedOptions) || (NULL == pdwEnabledOptions) )
00042 return E_POINTER;
00043
00044 *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACESAFE_FOR_UNTRUSTED_CALLER;
00045
00046 if( (IID_IDispatch == riid)
00047 || (IID_IVLCControl == riid) )
00048 {
00049 *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER;
00050 return NOERROR;
00051 }
00052 else if( (IID_IPersist == riid)
00053 || (IID_IPersistStreamInit == riid)
00054 || (IID_IPersistStorage == riid)
00055 || (IID_IPersistPropertyBag == riid) )
00056 {
00057 *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA;
00058 return NOERROR;
00059 }
00060 *pdwEnabledOptions = 0;
00061 return E_NOINTERFACE;
00062 };
00063
00064 STDMETHODIMP VLCObjectSafety::SetInterfaceSafetyOptions(
00065 REFIID riid,
00066 DWORD dwOptionSetMask,
00067 DWORD dwEnabledOptions
00068 )
00069 {
00070 if( (IID_IDispatch == riid)
00071 || (IID_IVLCControl == riid) )
00072 {
00073 if( (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwOptionSetMask)
00074 && (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwEnabledOptions) )
00075 {
00076 return NOERROR;
00077 }
00078 return E_FAIL;
00079 }
00080 else if( (IID_IPersist == riid)
00081 || (IID_IPersistStreamInit == riid)
00082 || (IID_IPersistStorage == riid)
00083 || (IID_IPersistPropertyBag == riid) )
00084 {
00085 if( (INTERFACESAFE_FOR_UNTRUSTED_DATA == dwOptionSetMask)
00086 && (INTERFACESAFE_FOR_UNTRUSTED_DATA == dwEnabledOptions) )
00087 {
00088 return NOERROR;
00089 }
00090 return E_FAIL;
00091 }
00092 return E_FAIL;
00093 };
00094