1 /*****************************************************************************
\r
2 * objectsafety.h: ActiveX control for VLC
\r
3 *****************************************************************************
\r
4 * Copyright (C) 2005 VideoLAN
\r
6 * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; either version 2 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU General Public License
\r
19 * along with this program; if not, write to the Free Software
\r
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
\r
21 *****************************************************************************/
\r
23 #ifndef __OBJECTSAFETY_H__
\r
24 #define __OBJECTSAFETY_H__
\r
26 #if HAVE_OBJSAFE_HEADER
\r
28 ** at last, a version of mingw that supports this header
\r
30 #include <objsafe.h>
\r
34 // {CB5BDC81-93C1-11cf-8F20-00805F2CD064}
\r
35 extern "C" const IID IID_IObjectSafety;
\r
37 #define INTERFACESAFE_FOR_UNTRUSTED_CALLER 1L
\r
38 #define INTERFACESAFE_FOR_UNTRUSTED_DATA 2L
\r
40 struct IObjectSafety : public IUnknown
\r
42 virtual STDMETHODIMP GetInterfaceSafetyOptions(
\r
44 DWORD __RPC_FAR *pdwSupportedOptions,
\r
45 DWORD __RPC_FAR *pdwEnabledOptions
\r
48 virtual STDMETHODIMP SetInterfaceSafetyOptions(
\r
50 DWORD dwSupportedOptions,
\r
51 DWORD dwOptionSetMask
\r
57 class VLCObjectSafety : public IObjectSafety
\r
61 VLCObjectSafety(VLCPlugin *p_instance) : _p_instance(p_instance) {};
\r
62 virtual ~VLCObjectSafety() {};
\r
65 STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
\r
68 && (IID_IUnknown == riid)
\r
69 && (IID_IObjectSafety == riid) )
\r
72 *ppv = reinterpret_cast<LPVOID>(this);
\r
75 return _p_instance->QueryInterface(riid, ppv);
\r
78 STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
\r
79 STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
\r
82 STDMETHODIMP GetInterfaceSafetyOptions(
\r
84 DWORD *pdwSupportedOptions,
\r
85 DWORD *pdwEnabledOptions
\r
88 STDMETHODIMP SetInterfaceSafetyOptions(
\r
90 DWORD dwOptionSetMask,
\r
91 DWORD dwEnabledOptions
\r
96 VLCPlugin *_p_instance;
\r