Nikolay Sivov : scrrun: Improved tracing of IDictionary methods.

Alexandre Julliard julliard at winehq.org
Wed Dec 7 15:20:29 CST 2016


Module: wine
Branch: master
Commit: 62cb1f8d6fea65259425363ea25fc332d403535f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=62cb1f8d6fea65259425363ea25fc332d403535f

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Dec  7 13:33:57 2016 +0300

scrrun: Improved tracing of IDictionary methods.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/scrrun/dictionary.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/dlls/scrrun/dictionary.c b/dlls/scrrun/dictionary.c
index 844b4d1..3c8fc82 100644
--- a/dlls/scrrun/dictionary.c
+++ b/dlls/scrrun/dictionary.c
@@ -240,19 +240,19 @@ static HRESULT WINAPI dict_enum_QueryInterface(IEnumVARIANT *iface, REFIID riid,
 static ULONG WINAPI dict_enum_AddRef(IEnumVARIANT *iface)
 {
     struct dictionary_enum *This = impl_from_IEnumVARIANT(iface);
-    TRACE("(%p)\n", This);
-    return InterlockedIncrement(&This->ref);
+    ULONG ref = InterlockedIncrement(&This->ref);
+    TRACE("(%p)->(%u)\n", This, ref);
+    return ref;
 }
 
 static ULONG WINAPI dict_enum_Release(IEnumVARIANT *iface)
 {
     struct dictionary_enum *This = impl_from_IEnumVARIANT(iface);
-    LONG ref;
+    LONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)\n", This);
+    TRACE("(%p)->(%u)\n", This, ref);
 
-    ref = InterlockedDecrement(&This->ref);
-    if(ref == 0) {
+    if (!ref) {
         list_remove(&This->notify);
         IDictionary_Release(&This->dict->IDictionary_iface);
         heap_free(This);
@@ -411,20 +411,21 @@ static HRESULT WINAPI dictionary_QueryInterface(IDictionary *iface, REFIID riid,
 static ULONG WINAPI dictionary_AddRef(IDictionary *iface)
 {
     dictionary *This = impl_from_IDictionary(iface);
-    TRACE("(%p)\n", This);
+    ULONG ref = InterlockedIncrement(&This->ref);
 
-    return InterlockedIncrement(&This->ref);
+    TRACE("(%p)->(%u)\n", This, ref);
+
+    return ref;
 }
 
 static ULONG WINAPI dictionary_Release(IDictionary *iface)
 {
     dictionary *This = impl_from_IDictionary(iface);
-    LONG ref;
+    ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)\n", This);
+    TRACE("(%p)->(%u)\n", This, ref);
 
-    ref = InterlockedDecrement(&This->ref);
-    if(ref == 0) {
+    if (!ref) {
         IDictionary_RemoveAll(iface);
         heap_free(This);
     }
@@ -436,7 +437,7 @@ static HRESULT WINAPI dictionary_GetTypeInfoCount(IDictionary *iface, UINT *pcti
 {
     dictionary *This = impl_from_IDictionary(iface);
 
-    TRACE("(%p)->()\n", This);
+    TRACE("(%p)->(%p)\n", This, pctinfo);
 
     *pctinfo = 1;
     return S_OK;
@@ -885,7 +886,7 @@ HRESULT WINAPI Dictionary_CreateInstance(IClassFactory *factory,IUnknown *outer,
 {
     dictionary *This;
 
-    TRACE("(%p)\n", obj);
+    TRACE("(%p, %p, %s, %p)\n", factory, outer, debugstr_guid(riid), obj);
 
     *obj = NULL;
 




More information about the wine-cvs mailing list