Re: Patch 1/2 - [scrrun] - Add initial support for Dictionary - try 2
Hi Vijay, On 06/08/12 03:15, Vijay Kiran Kamuju wrote:
+ *ppvObject = NULL; + if ( IsEqualGUID( riid, &IID_IDictionary ) || + IsEqualGUID( riid, &IID_IPersist ) || + IsEqualGUID( riid, &IID_IDispatch ) || + IsEqualGUID( riid, &IID_IUnknown ) ) + { + *ppvObject = This; + }
That's not the right way to cast object to interface. See http://wiki.winehq.org/COMGuideline Cheers, Jacek
On Fri, Jun 8, 2012 at 11:00 AM, Jacek Caban <jacek(a)codeweavers.com> wrote:
Hi Vijay,
On 06/08/12 03:15, Vijay Kiran Kamuju wrote:
+ *ppvObject = NULL; + if ( IsEqualGUID( riid, &IID_IDictionary ) || + IsEqualGUID( riid, &IID_IPersist ) || + IsEqualGUID( riid, &IID_IDispatch ) || + IsEqualGUID( riid, &IID_IUnknown ) ) + { + *ppvObject = This; + } Attaching the new dictionary.c with a bit more functionality, please review
That's not the right way to cast object to interface. See http://wiki.winehq.org/COMGuideline
Cheers, Jacek
On 6/8/12 7:44 PM, Vijay Kiran Kamuju wrote:
On Fri, Jun 8, 2012 at 11:00 AM, Jacek Caban<jacek(a)codeweavers.com> wrote:
Hi Vijay,
On 06/08/12 03:15, Vijay Kiran Kamuju wrote:
+ *ppvObject = NULL; + if ( IsEqualGUID( riid,&IID_IDictionary ) || + IsEqualGUID( riid,&IID_IPersist ) || + IsEqualGUID( riid,&IID_IDispatch ) || + IsEqualGUID( riid,&IID_IUnknown ) ) + { + *ppvObject = This; + } Attaching the new dictionary.c with a bit more functionality, please review
This looks mostly right. There is one thing I'd change: static ULONG WINAPI dictionary_AddRef(IDictionary *iface) { IDictionaryImpl *This = impl_from_IDictionary( iface ); return InterlockedIncrement(&This->ref ); } [...] dictionary_AddRef(iface); You may just use IDistionary_AddRef here (or IUnknown_AddRef) instead of directly calling the function. This way you don't need to move dictionary_AddRef out of vtbl order (and I generally consider it a better practice, but that's just a personal opinion). Thanks, Jacek
participants (2)
-
Jacek Caban -
Vijay Kiran Kamuju