Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

objectsafety.cpp

00001 /*****************************************************************************
00002  * objectsafety.cpp: ActiveX control for VLC
00003  *****************************************************************************
00004  * Copyright (C) 2005 the VideoLAN team
00005  *
00006  * Authors: Damien Fouilleul <[email protected]>
00007  *
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
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 

Generated on Tue Dec 20 10:14:18 2005 for vlc-0.8.4a by  doxygen 1.4.2