1 /*****************************************************************************
2 * objectsafety.cpp: ActiveX control for VLC
3 *****************************************************************************
4 * Copyright (C) 2005 VideoLAN
6 * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
21 *****************************************************************************/
24 #include "objectsafety.h"
26 #include "axvlc_idl.h"
29 const GUID IID_IObjectSafety =
30 {0xCB5BDC81,0x93C1,0x11cf,{0x8F,0x20,0x00,0x80,0x5F,0x2C,0xD0,0x64}};
33 STDMETHODIMP VLCObjectSafety::GetInterfaceSafetyOptions(
35 DWORD *pdwSupportedOptions,
36 DWORD *pdwEnabledOptions
39 if( (NULL == pdwSupportedOptions) || (NULL == pdwEnabledOptions) )
42 *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACESAFE_FOR_UNTRUSTED_CALLER;
44 if( (IID_IDispatch == riid)
45 || (IID_IVLCControl == riid) )
47 *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER;
50 else if( (IID_IPersist == riid)
51 || (IID_IPersistStreamInit == riid)
52 || (IID_IPersistStorage == riid)
53 || (IID_IPersistPropertyBag == riid) )
55 *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA;
58 *pdwEnabledOptions = 0;
62 STDMETHODIMP VLCObjectSafety::SetInterfaceSafetyOptions(
64 DWORD dwOptionSetMask,
65 DWORD dwEnabledOptions
68 if( (IID_IDispatch == riid)
69 || (IID_IVLCControl == riid) )
71 if( (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwOptionSetMask)
72 && (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwEnabledOptions) )
78 else if( (IID_IPersist == riid)
79 || (IID_IPersistStreamInit == riid)
80 || (IID_IPersistStorage == riid)
81 || (IID_IPersistPropertyBag == riid) )
83 if( (INTERFACESAFE_FOR_UNTRUSTED_DATA == dwOptionSetMask)
84 && (INTERFACESAFE_FOR_UNTRUSTED_DATA == dwEnabledOptions) )