On 6/8/12 7:44 PM, Vijay Kiran Kamuju wrote:
On Fri, Jun 8, 2012 at 11:00 AM, Jacek Cabanjacek@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