2 * Copyright 2010 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "mshtml_private.h"
32 #include "pluginhost.h"
34 #include "wine/debug.h"
35 #include "wine/unicode.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
40 IPropertyBag IPropertyBag_iface
;
45 static inline PropertyBag
*impl_from_IPropertyBag(IPropertyBag
*iface
)
47 return CONTAINING_RECORD(iface
, PropertyBag
, IPropertyBag_iface
);
50 static HRESULT WINAPI
PropertyBag_QueryInterface(IPropertyBag
*iface
, REFIID riid
, void **ppv
)
52 PropertyBag
*This
= impl_from_IPropertyBag(iface
);
54 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
55 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
56 *ppv
= &This
->IPropertyBag_iface
;
57 }else if(IsEqualGUID(&IID_IPropertyBag
, riid
)) {
58 TRACE("(%p)->(IID_IPropertyBag %p)\n", This
, ppv
);
59 *ppv
= &This
->IPropertyBag_iface
;
61 WARN("Unsopported interface %s\n", debugstr_guid(riid
));
66 IUnknown_AddRef((IUnknown
*)*ppv
);
70 static ULONG WINAPI
PropertyBag_AddRef(IPropertyBag
*iface
)
72 PropertyBag
*This
= impl_from_IPropertyBag(iface
);
73 LONG ref
= InterlockedIncrement(&This
->ref
);
75 TRACE("(%p) ref=%d\n", This
, ref
);
80 static ULONG WINAPI
PropertyBag_Release(IPropertyBag
*iface
)
82 PropertyBag
*This
= impl_from_IPropertyBag(iface
);
83 LONG ref
= InterlockedDecrement(&This
->ref
);
85 TRACE("(%p) ref=%d\n", This
, ref
);
93 static HRESULT WINAPI
PropertyBag_Read(IPropertyBag
*iface
, LPCOLESTR pszPropName
, VARIANT
*pVar
, IErrorLog
*pErrorLog
)
95 PropertyBag
*This
= impl_from_IPropertyBag(iface
);
96 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(pszPropName
), pVar
, pErrorLog
);
100 static HRESULT WINAPI
PropertyBag_Write(IPropertyBag
*iface
, LPCOLESTR pszPropName
, VARIANT
*pVar
)
102 PropertyBag
*This
= impl_from_IPropertyBag(iface
);
103 FIXME("(%p)->(%s %s)\n", This
, debugstr_w(pszPropName
), debugstr_variant(pVar
));
107 static const IPropertyBagVtbl PropertyBagVtbl
= {
108 PropertyBag_QueryInterface
,
115 HRESULT
create_param_prop_bag(IPropertyBag
**ret
)
117 PropertyBag
*prop_bag
;
119 prop_bag
= heap_alloc(sizeof(*prop_bag
));
121 return E_OUTOFMEMORY
;
123 prop_bag
->IPropertyBag_iface
.lpVtbl
= &PropertyBagVtbl
;
126 *ret
= &prop_bag
->IPropertyBag_iface
;