oleaut32: Win64 printf format warning fixes.
diff --git a/dlls/oleaut32/Makefile.in b/dlls/oleaut32/Makefile.in
index 258332c..0d2f99d 100644
--- a/dlls/oleaut32/Makefile.in
+++ b/dlls/oleaut32/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -D_OLEAUT32_ -DCOM_NO_WINDOWS_H -DWINE_NO_LONG_AS_INT
+EXTRADEFS = -D_OLEAUT32_ -DCOM_NO_WINDOWS_H
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
diff --git a/dlls/oleaut32/connpt.c b/dlls/oleaut32/connpt.c
index e2b75e8..63e3b2c 100644
--- a/dlls/oleaut32/connpt.c
+++ b/dlls/oleaut32/connpt.c
@@ -194,7 +194,7 @@
   ConnectionPointImpl *This = (ConnectionPointImpl *)iface;
   ULONG refCount = InterlockedIncrement(&This->ref);
 
-  TRACE("(%p)->(ref before=%ld)\n", This, refCount - 1);
+  TRACE("(%p)->(ref before=%d)\n", This, refCount - 1);
 
   return refCount;
 }
@@ -210,7 +210,7 @@
   ConnectionPointImpl *This = (ConnectionPointImpl *)iface;
   ULONG refCount = InterlockedDecrement(&This->ref);
 
-  TRACE("(%p)->(ref before=%ld)\n", This, refCount + 1);
+  TRACE("(%p)->(ref before=%d)\n", This, refCount + 1);
 
   /*
    * If the reference count goes down to 0, perform suicide.
@@ -291,7 +291,7 @@
 						   DWORD dwCookie)
 {
   ConnectionPointImpl *This = (ConnectionPointImpl *)iface;
-  TRACE("(%p)->(%ld)\n", This, dwCookie);
+  TRACE("(%p)->(%d)\n", This, dwCookie);
 
   if(dwCookie == 0 || dwCookie > This->maxSinks) return E_INVALIDARG;
 
@@ -463,7 +463,7 @@
   EnumConnectionsImpl *This = (EnumConnectionsImpl *)iface;
   ULONG refCount = InterlockedIncrement(&This->ref);
 
-  TRACE("(%p)->(ref before=%ld)\n", This, refCount - 1);
+  TRACE("(%p)->(ref before=%d)\n", This, refCount - 1);
 
   IUnknown_AddRef(This->pUnk);
   return refCount;
@@ -479,7 +479,7 @@
   EnumConnectionsImpl *This = (EnumConnectionsImpl *)iface;
   ULONG refCount = InterlockedDecrement(&This->ref);
 
-  TRACE("(%p)->(ref before=%ld)\n", This, refCount + 1);
+  TRACE("(%p)->(ref before=%d)\n", This, refCount + 1);
 
   IUnknown_Release(This->pUnk);
 
@@ -501,7 +501,7 @@
 {
   EnumConnectionsImpl *This = (EnumConnectionsImpl *)iface;
   DWORD nRet = 0;
-  TRACE("(%p)->(%ld, %p, %p)\n", This, cConn, pCD, pEnum);
+  TRACE("(%p)->(%d, %p, %p)\n", This, cConn, pCD, pEnum);
 
   if(pEnum == NULL) {
     if(cConn != 1)
@@ -535,7 +535,7 @@
 					       ULONG cSkip)
 {
   EnumConnectionsImpl *This = (EnumConnectionsImpl *)iface;
-  TRACE("(%p)->(%ld)\n", This, cSkip);
+  TRACE("(%p)->(%d)\n", This, cSkip);
 
   if(This->nCur + cSkip >= This->nConns)
     return S_FALSE;
diff --git a/dlls/oleaut32/dispatch.c b/dlls/oleaut32/dispatch.c
index c3b8b88..5021d9f 100644
--- a/dlls/oleaut32/dispatch.c
+++ b/dlls/oleaut32/dispatch.c
@@ -252,7 +252,7 @@
     StdDispatch *This = (StdDispatch *)iface;
     ULONG refCount = InterlockedIncrement(&This->ref);
 
-    TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
+    TRACE("(%p)->(ref before=%u)\n",This, refCount - 1);
 
     return refCount;
 }
@@ -267,7 +267,7 @@
     StdDispatch *This = (StdDispatch *)iface;
     ULONG refCount = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)->(ref before=%lu)\n", This, refCount + 1);
+    TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
 
     if (!refCount)
     {
@@ -325,7 +325,7 @@
 static HRESULT WINAPI StdDispatch_GetTypeInfo(LPDISPATCH iface, UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
 {
     StdDispatch *This = (StdDispatch *)iface;
-    TRACE("(%d, %lx, %p)\n", iTInfo, lcid, ppTInfo);
+    TRACE("(%d, %x, %p)\n", iTInfo, lcid, ppTInfo);
 
     *ppTInfo = NULL;
     if (iTInfo != 0)
@@ -368,7 +368,7 @@
 static HRESULT WINAPI StdDispatch_GetIDsOfNames(LPDISPATCH iface, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId)
 {
     StdDispatch *This = (StdDispatch *)iface;
-    TRACE("(%s, %p, %d, 0x%lx, %p)\n", debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
+    TRACE("(%s, %p, %d, 0x%x, %p)\n", debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
 
     if (!IsEqualGUID(riid, &IID_NULL))
     {
@@ -406,7 +406,7 @@
                                          EXCEPINFO * pExcepInfo, UINT * puArgErr)
 {
     StdDispatch *This = (StdDispatch *)iface;
-    TRACE("(%ld, %s, 0x%lx, 0x%x, %p, %p, %p, %p)\n", dispIdMember, debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+    TRACE("(%d, %s, 0x%x, 0x%x, %p, %p, %p, %p)\n", dispIdMember, debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 
     if (!IsEqualGUID(riid, &IID_NULL))
     {
diff --git a/dlls/oleaut32/hash.c b/dlls/oleaut32/hash.c
index 9934b64..b3929f3 100644
--- a/dlls/oleaut32/hash.c
+++ b/dlls/oleaut32/hash.c
@@ -517,7 +517,7 @@
   switch (PRIMARYLANGID(LANGIDFROMLCID(lcid)))
   {
   default:
-    ERR("Unknown lcid %lx, treating as latin-based, please report\n", lcid);
+    ERR("Unknown lcid %x, treating as latin-based, please report\n", lcid);
     /* .. Fall Through .. */
   case LANG_AFRIKAANS:  case LANG_ALBANIAN:   case LANG_ARMENIAN:
   case LANG_ASSAMESE:   case LANG_AZERI:      case LANG_BASQUE:
diff --git a/dlls/oleaut32/ole2disp.c b/dlls/oleaut32/ole2disp.c
index 14c4293..a09ef7c 100644
--- a/dlls/oleaut32/ole2disp.c
+++ b/dlls/oleaut32/ole2disp.c
@@ -220,7 +220,7 @@
 	LCID lcid,
 	ITypeInfo **pptinfo)
 {
-	FIXME("(%p,%ld,%p),stub\n",pidata,lcid,pptinfo);
+	FIXME("(%p,%d,%p),stub\n",pidata,lcid,pptinfo);
 	return E_NOTIMPL;
 }
 
@@ -244,6 +244,6 @@
 HRESULT WINAPI RegisterActiveObject16(
 	IUnknown *punk, REFCLSID rclsid, DWORD dwFlags, unsigned long *pdwRegister
 ) {
-	FIXME("(%p,%s,0x%08lx,%p):stub\n",punk,debugstr_guid(rclsid),dwFlags,pdwRegister);
+	FIXME("(%p,%s,0x%08x,%p):stub\n",punk,debugstr_guid(rclsid),dwFlags,pdwRegister);
 	return E_NOTIMPL;
 }
diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c
index 95b5fe8..bee444f 100644
--- a/dlls/oleaut32/oleaut.c
+++ b/dlls/oleaut32/oleaut.c
@@ -620,7 +620,7 @@
   COLORREF colorref;
   BYTE b = HIBYTE(HIWORD(clr));
 
-  TRACE("(%08lx, %p, %p)\n", clr, hpal, pColorRef);
+  TRACE("(%08x, %p, %p)\n", clr, hpal, pColorRef);
 
   /*
    * In case pColorRef is NULL, provide our own to simplify the code.
@@ -820,7 +820,7 @@
  */
 BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved)
 {
-  TRACE("(%p,%ld,%p)\n", hInstDll, fdwReason, lpvReserved);
+  TRACE("(%p,%d,%p)\n", hInstDll, fdwReason, lpvReserved);
 
   switch (fdwReason) {
   case DLL_PROCESS_ATTACH:
diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c
index 6f27d21..706ecf0 100644
--- a/dlls/oleaut32/olefont.c
+++ b/dlls/oleaut32/olefont.c
@@ -617,7 +617,7 @@
   IFont* iface)
 {
   OLEFontImpl *this = (OLEFontImpl *)iface;
-  TRACE("(%p)->(ref=%ld)\n", this, this->ref);
+  TRACE("(%p)->(ref=%d)\n", this, this->ref);
   return InterlockedIncrement(&this->ref);
 }
 
@@ -631,7 +631,7 @@
 {
   OLEFontImpl *this = (OLEFontImpl *)iface;
   ULONG ret;
-  TRACE("(%p)->(ref=%ld)\n", this, this->ref);
+  TRACE("(%p)->(ref=%d)\n", this, this->ref);
 
   /*
    * Decrease the reference count on this object.
@@ -740,7 +740,7 @@
   CY     size)
 {
   OLEFontImpl *this = (OLEFontImpl *)iface;
-  TRACE("(%p)->(%ld)\n", this, size.s.Lo);
+  TRACE("(%p)->(%d)\n", this, size.s.Lo);
   this->description.cySize.s.Hi = 0;
   this->description.cySize.s.Lo = size.s.Lo;
   OLEFont_SendNotify(this, DISPID_FONT_SIZE);
@@ -1183,7 +1183,7 @@
   LONG   cyHimetric)
 {
   OLEFontImpl *this = (OLEFontImpl *)iface;
-  TRACE("(%p)->(%ld, %ld)\n", this, cyLogical, cyHimetric);
+  TRACE("(%p)->(%d, %d)\n", this, cyLogical, cyHimetric);
 
   this->cyLogical  = cyLogical;
   this->cyHimetric = cyHimetric;
@@ -1222,7 +1222,7 @@
   HFONT hfont)
 {
   OLEFontImpl *this = (OLEFontImpl *)iface;
-  TRACE("(%p)->(%p) (lock=%ld)\n", this, hfont, this->fontLock);
+  TRACE("(%p)->(%p) (lock=%d)\n", this, hfont, this->fontLock);
 
   if ( (hfont == 0) ||
        (hfont != this->gdiFont) )
@@ -1243,7 +1243,7 @@
   HFONT hfont)
 {
   OLEFontImpl *this = (OLEFontImpl *)iface;
-  TRACE("(%p)->(%p) (lock=%ld)\n", this, hfont, this->fontLock);
+  TRACE("(%p)->(%p) (lock=%d)\n", this, hfont, this->fontLock);
 
   if ( (hfont == 0) ||
        (hfont != this->gdiFont) )
@@ -1360,7 +1360,7 @@
   }
   hres = ITypeLib_GetTypeInfoOfGuid(tl, &IID_IFontDisp, ppTInfo);
   if (FAILED(hres)) {
-    FIXME("Did not IDispatch typeinfo from typelib, hres %lx\n",hres);
+    FIXME("Did not IDispatch typeinfo from typelib, hres %x\n",hres);
   }
   return hres;
 }
@@ -1432,7 +1432,7 @@
   OLEFontImpl *this = impl_from_IDispatch(iface);
   HRESULT hr;
 
-  TRACE("%p->(%ld,%s,0x%lx,0x%x,%p,%p,%p,%p)\n", this, dispIdMember,
+  TRACE("%p->(%d,%s,0x%x,0x%x,%p,%p,%p,%p)\n", this, dispIdMember,
     debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExepInfo,
     puArgErr);
 
@@ -1635,7 +1635,7 @@
     }
     break;
   default:
-    ERR("member not found for dispid 0x%lx\n", dispIdMember);
+    ERR("member not found for dispid 0x%x\n", dispIdMember);
     return DISP_E_MEMBERNOTFOUND;
   }
 }
@@ -2199,7 +2199,7 @@
     }
 
     if (FAILED(iRes))
-        WARN("-- 0x%08lx\n", iRes);
+        WARN("-- 0x%08x\n", iRes);
     return iRes;
 }
 
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index a175f4a..f178575 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -388,7 +388,7 @@
   OLEPictureImpl *This = (OLEPictureImpl *)iface;
   ULONG refCount = InterlockedIncrement(&This->ref);
 
-  TRACE("(%p)->(ref before=%ld)\n", This, refCount - 1);
+  TRACE("(%p)->(ref before=%d)\n", This, refCount - 1);
 
   return refCount;
 }
@@ -404,7 +404,7 @@
   OLEPictureImpl *This = (OLEPictureImpl *)iface;
   ULONG refCount = InterlockedDecrement(&This->ref);
 
-  TRACE("(%p)->(ref before=%ld)\n", This, refCount + 1);
+  TRACE("(%p)->(ref before=%d)\n", This, refCount + 1);
 
   /*
    * If the reference count goes down to 0, perform suicide.
@@ -560,7 +560,7 @@
       hres = S_OK;
   }
 
-  TRACE("returning 0x%08lx, palette handle %08x\n", hres, *phandle);
+  TRACE("returning 0x%08x, palette handle %08x\n", hres, *phandle);
   return hres;
 }
 
@@ -583,7 +583,7 @@
 					       OLE_XSIZE_HIMETRIC *pwidth)
 {
   OLEPictureImpl *This = (OLEPictureImpl *)iface;
-  TRACE("(%p)->(%p): width is %ld\n", This, pwidth, This->himetricWidth);
+  TRACE("(%p)->(%p): width is %d\n", This, pwidth, This->himetricWidth);
   *pwidth = This->himetricWidth;
   return S_OK;
 }
@@ -595,7 +595,7 @@
 						OLE_YSIZE_HIMETRIC *pheight)
 {
   OLEPictureImpl *This = (OLEPictureImpl *)iface;
-  TRACE("(%p)->(%p): height is %ld\n", This, pheight, This->himetricHeight);
+  TRACE("(%p)->(%p): height is %d\n", This, pheight, This->himetricHeight);
   *pheight = This->himetricHeight;
   return S_OK;
 }
@@ -612,10 +612,10 @@
 					    LPCRECT prcWBounds)
 {
   OLEPictureImpl *This = (OLEPictureImpl *)iface;
-  TRACE("(%p)->(%p, (%ld,%ld), (%ld,%ld) <- (%ld,%ld), (%ld,%ld), %p)\n",
+  TRACE("(%p)->(%p, (%d,%d), (%d,%d) <- (%d,%d), (%d,%d), %p)\n",
 	This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, prcWBounds);
   if(prcWBounds)
-    TRACE("prcWBounds (%ld,%ld) - (%ld,%ld)\n", prcWBounds->left, prcWBounds->top,
+    TRACE("prcWBounds (%d,%d) - (%d,%d)\n", prcWBounds->left, prcWBounds->top,
 	  prcWBounds->right, prcWBounds->bottom);
 
   /*
@@ -1426,14 +1426,14 @@
    */
   hr=IStream_Stat(pStm,&statstg,STATFLAG_NONAME);
   if (hr) {
-      TRACE("stat failed with hres %lx, proceeding to read all data.\n",hr);
+      TRACE("stat failed with hres %x, proceeding to read all data.\n",hr);
       statfailed = TRUE;
       /* we will read at least 8 byte ... just right below */
       statstg.cbSize.QuadPart = 8;
   }
   hr=IStream_Read(pStm,header,8,&xread);
   if (hr || xread!=8) {
-      FIXME("Failure while reading picture header (hr is %lx, nread is %ld).\n",hr,xread);
+      FIXME("Failure while reading picture header (hr is %x, nread is %d).\n",hr,xread);
       return hr;
   }
 
@@ -1452,7 +1452,7 @@
           toread = statstg.cbSize.QuadPart-8;
           xread = 8;
       } else {
-          FIXME("Unknown stream header magic: %08lx\n", header[0]);
+          FIXME("Unknown stream header magic: %08x\n", header[0]);
           toread = header[1];
       }
   }
@@ -1482,8 +1482,8 @@
           }
       }
       if (hr)
-          TRACE("hr in no-stat loader case is %08lx\n", hr);
-      TRACE("loaded %ld bytes.\n", xread);
+          TRACE("hr in no-stat loader case is %08x\n", hr);
+      TRACE("loaded %d bytes.\n", xread);
       This->datalen = xread;
       This->data    = xbuf;
   } else {
@@ -1501,7 +1501,7 @@
               break;
       }
       if (xread != This->datalen)
-          FIXME("Could only read %ld of %d bytes out of stream?\n",xread,This->datalen);
+          FIXME("Could only read %d of %d bytes out of stream?\n",xread,This->datalen);
   }
   if (This->datalen == 0) { /* Marks the "NONE" picture */
       This->desc.picType = PICTYPE_NONE;
@@ -1531,7 +1531,7 @@
   default:
   {
     unsigned int i;
-    FIXME("Unknown magic %04x, %ld read bytes:\n",magic,xread);
+    FIXME("Unknown magic %04x, %d read bytes:\n",magic,xread);
     hr=E_FAIL;
     for (i=0;i<xread+8;i++) {
 	if (i<8) MESSAGE("%02x ",((unsigned char*)&header)[i]);
@@ -1656,7 +1656,7 @@
 				pInfoBitmap->bmiHeader.biBitCount);
 			FIXME("DEBUG: bitmap nplanes is %d\n",
 				pInfoBitmap->bmiHeader.biPlanes);
-			FIXME("DEBUG: bitmap biSizeImage is %lu\n",
+			FIXME("DEBUG: bitmap biSizeImage is %u\n",
 				pInfoBitmap->bmiHeader.biSizeImage);
 */
 			/* Let's start with one CURSORICONFILEDIR and one CURSORICONFILEDIRENTRY */
@@ -1731,7 +1731,7 @@
 				&& GetDIBits(hDC, infoIcon.hbmMask, 0, pIconEntry->bHeight,
 					pIconData + iOffsetMaskData, pInfoBitmap, DIB_RGB_COLORS))) {
 
-                printf("ERROR: unable to get bitmap mask (error %lu)\n",
+                printf("ERROR: unable to get bitmap mask (error %u)\n",
 					GetLastError());
 
 			}
@@ -1744,7 +1744,7 @@
 			iSuccess = 1;
 		} else {
 /*
-			printf("ERROR: unable to get bitmap information via GetDIBits() (error %lu)\n",
+			printf("ERROR: unable to get bitmap information via GetDIBits() (error %u)\n",
 				GetLastError());
 */
 		}
@@ -1761,7 +1761,7 @@
 		if (infoIcon.hbmColor) DeleteObject(infoIcon.hbmColor);
 		HeapFree(GetProcessHeap(), 0, pInfoBitmap);
 	} else {
-		printf("ERROR: Unable to get icon information (error %lu)\n",
+		printf("ERROR: Unable to get icon information (error %u)\n",
 			GetLastError());
 	}
 	return iSuccess;
@@ -1964,7 +1964,7 @@
 
   hres = ITypeLib_GetTypeInfoOfGuid(tl, &IID_IPictureDisp, ppTInfo);
   if (FAILED(hres))
-    ERR("Did not get IPictureDisp typeinfo from typelib, hres %lx\n", hres);
+    ERR("Did not get IPictureDisp typeinfo from typelib, hres %x\n", hres);
 
   return hres;
 }
@@ -2101,7 +2101,7 @@
     break;
   }
 
-  ERR("invalid dispid 0x%lx or wFlags 0x%x\n", dispIdMember, wFlags);
+  ERR("invalid dispid 0x%x or wFlags 0x%x\n", dispIdMember, wFlags);
   return DISP_E_MEMBERNOTFOUND;
 }
 
@@ -2211,7 +2211,7 @@
   IPicture	*newpic;
   HRESULT hr;
 
-  TRACE("(%p,%ld,%d,%s,%p), partially implemented.\n",
+  TRACE("(%p,%d,%d,%s,%p), partially implemented.\n",
 	lpstream, lSize, fRunmode, debugstr_guid(riid), ppvObj);
 
   hr = OleCreatePictureIndirect(NULL,riid,!fRunmode,(LPVOID*)&newpic);
@@ -2243,7 +2243,7 @@
   IPicture	*newpic;
   HRESULT hr;
 
-  FIXME("(%p,%ld,%d,%s,x=%ld,y=%ld,f=%lx,%p), partially implemented.\n",
+  FIXME("(%p,%d,%d,%s,x=%d,y=%d,f=%x,%p), partially implemented.\n",
 	lpstream, lSize, fRunmode, debugstr_guid(riid), xsiz, ysiz, flags, ppvObj);
 
   hr = OleCreatePictureIndirect(NULL,riid,!fRunmode,(LPVOID*)&newpic);
@@ -2283,7 +2283,7 @@
   IPersistStream *pStream;
   HRESULT hRes;
 
-  TRACE("(%s,%p,%ld,%08lx,%s,%p): stub\n",
+  TRACE("(%s,%p,%d,%08x,%s,%p): stub\n",
         debugstr_w(szURLorPath), punkCaller, dwReserved, clrReserved,
         debugstr_guid(riid), ppvRet);
 
diff --git a/dlls/oleaut32/recinfo.c b/dlls/oleaut32/recinfo.c
index 2396362..97a9545 100644
--- a/dlls/oleaut32/recinfo.c
+++ b/dlls/oleaut32/recinfo.c
@@ -157,7 +157,7 @@
 {
     IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
     ULONG ref = InterlockedIncrement(&This->ref);
-    TRACE("(%p) -> %ld\n", This, ref);
+    TRACE("(%p) -> %d\n", This, ref);
     return ref;
 }
 
@@ -166,7 +166,7 @@
     IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
     ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p) -> %ld\n", This, ref);
+    TRACE("(%p) -> %d\n", This, ref);
 
     if(!ref) {
         int i;
@@ -365,7 +365,7 @@
     IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
     int i;
 
-    TRACE("(%p)->(%08lx %p %s %p)\n", This, wFlags, pvData, debugstr_w(szFieldName),
+    TRACE("(%p)->(%08x %p %s %p)\n", This, wFlags, pvData, debugstr_w(szFieldName),
                                     pvarField);
 
     if(!pvData || !szFieldName || !pvarField
@@ -393,7 +393,7 @@
     IRecordInfoImpl *This = (IRecordInfoImpl*)iface;
     int i;
 
-    FIXME("(%p)->(%08lx %p %s %p) stub\n", This, wFlags, pvData, debugstr_w(szFieldName), pvarField);
+    FIXME("(%p)->(%08x %p %s %p) stub\n", This, wFlags, pvData, debugstr_w(szFieldName), pvarField);
 
     if(!pvData || !szFieldName || !pvarField
             || (wFlags != INVOKE_PROPERTYPUTREF && wFlags != INVOKE_PROPERTYPUT))
@@ -512,7 +512,7 @@
     ITypeLib *pTypeLib;
     HRESULT hres;
     
-    TRACE("(%p,%ld,%ld,%ld,%p,%p)\n", rGuidTypeLib, uVerMajor, uVerMinor,
+    TRACE("(%p,%d,%d,%d,%p,%p)\n", rGuidTypeLib, uVerMajor, uVerMinor,
             lcid, rGuidTypeInfo, ppRecInfo);
 
     hres = LoadRegTypeLib(rGuidTypeLib, uVerMajor, uVerMinor, lcid, &pTypeLib);
@@ -551,7 +551,7 @@
     
     hres = ITypeInfo_GetTypeAttr(pTI, &typeattr);
     if(FAILED(hres) || !typeattr) {
-        WARN("GetTypeAttr failed: %08lx\n", hres);
+        WARN("GetTypeAttr failed: %08x\n", hres);
         return hres;
     }
 
@@ -560,7 +560,7 @@
         memcpy(&guid, &typeattr->guid, sizeof(GUID));
         ITypeInfo_ReleaseTypeAttr(pTI, typeattr);
         if(FAILED(hres)) {
-            WARN("GetRefTypeInfo failed: %08lx\n", hres);
+            WARN("GetRefTypeInfo failed: %08x\n", hres);
             return hres;
         }
         ITypeInfo_GetTypeAttr(pTypeInfo, &typeattr);
@@ -611,7 +611,7 @@
         hres = ITypeInfo_GetDocumentation(pTypeInfo, vardesc->memid, &ret->fields[i].name,
                 NULL, NULL, NULL);
         if(FAILED(hres))
-            WARN("GetDocumentation failed: %08lx\n", hres);
+            WARN("GetDocumentation failed: %08x\n", hres);
         ITypeInfo_ReleaseVarDesc(pTypeInfo, vardesc);
     }
         
diff --git a/dlls/oleaut32/safearray.c b/dlls/oleaut32/safearray.c
index d3dd5e1..93656f2 100644
--- a/dlls/oleaut32/safearray.c
+++ b/dlls/oleaut32/safearray.c
@@ -276,7 +276,7 @@
     ULONG ulCellCount = SAFEARRAY_GetCellCount(psa);
 
     if (ulStartCell > ulCellCount) {
-      FIXME("unexpted ulcellcount %ld, start %ld\n",ulCellCount,ulStartCell);
+      FIXME("unexpted ulcellcount %d, start %d\n",ulCellCount,ulStartCell);
       return E_UNEXPECTED;
     }
 
@@ -359,7 +359,7 @@
         HRESULT hRet;
 
         hRet = VariantCopy(lpDest, lpVariant);
-        if (FAILED(hRet)) FIXME("VariantCopy failed with 0x%lx\n", hRet);
+        if (FAILED(hRet)) FIXME("VariantCopy failed with 0x%x\n", hRet);
         lpVariant++;
         lpDest++;
       }
@@ -464,7 +464,7 @@
 
   (*ppsaOut)->cDims = cDims;
 
-  TRACE("(%d): %lu bytes allocated for descriptor.\n", cDims, allocSize);
+  TRACE("(%d): %u bytes allocated for descriptor.\n", cDims, allocSize);
   return S_OK;
 }
 
@@ -542,7 +542,7 @@
       if (psa->pvData)
       {
         hRet = S_OK;
-        TRACE("%lu bytes allocated for data at %p (%lu objects).\n",
+        TRACE("%u bytes allocated for data at %p (%u objects).\n",
               ulSize * psa->cbElements, psa->pvData, ulSize);
       }
     }
@@ -648,7 +648,7 @@
  */
 SAFEARRAY* WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements)
 {
-  TRACE("(%d->%s,%ld,%ld\n", vt, debugstr_vt(vt), lLbound, cElements);
+  TRACE("(%d->%s,%d,%d\n", vt, debugstr_vt(vt), lLbound, cElements);
     
   if (vt == VT_RECORD)
     return NULL;
@@ -680,7 +680,7 @@
   IRecordInfo* iRecInfo = (IRecordInfo*)pvExtra;
   SAFEARRAY* psa;
 
- TRACE("(%d->%s,%ld,%ld,%p\n", vt, debugstr_vt(vt), lLbound, cElements, pvExtra);
+ TRACE("(%d->%s,%d,%d,%p\n", vt, debugstr_vt(vt), lLbound, cElements, pvExtra);
  
   if (vt == VT_RECORD)
   {
@@ -859,9 +859,9 @@
         VARIANT* lpDest = (VARIANT*)lpvDest;
 
         hRet = VariantClear(lpDest);
-        if (FAILED(hRet)) FIXME("VariantClear failed with 0x%lx\n", hRet);
+        if (FAILED(hRet)) FIXME("VariantClear failed with 0x%x\n", hRet);
         hRet = VariantCopy(lpDest, lpVariant);
-        if (FAILED(hRet)) FIXME("VariantCopy failed with 0x%lx\n", hRet);
+        if (FAILED(hRet)) FIXME("VariantCopy failed with 0x%x\n", hRet);
       }
       else if (psa->fFeatures & FADF_BSTR)
       {
@@ -943,7 +943,7 @@
         /* The original content of pvData is ignored. */
         V_VT(lpDest) = VT_EMPTY;
         hRet = VariantCopy(lpDest, lpVariant);
-	if (FAILED(hRet)) FIXME("VariantCopy failed with 0x%lx\n", hRet);
+	if (FAILED(hRet)) FIXME("VariantCopy failed with 0x%x\n", hRet);
       }
       else if (psa->fFeatures & FADF_BSTR)
       {
@@ -1057,7 +1057,7 @@
  */
 UINT WINAPI SafeArrayGetDim(SAFEARRAY *psa)
 {
-  TRACE("(%p) returning %ld\n", psa, psa ? psa->cDims : 0ul);  
+  TRACE("(%p) returning %d\n", psa, psa ? psa->cDims : 0u);  
   return psa ? psa->cDims : 0;
 }
 
@@ -1077,7 +1077,7 @@
  */
 UINT WINAPI SafeArrayGetElemsize(SAFEARRAY *psa)
 {
-  TRACE("(%p) returning %ld\n", psa, psa ? psa->cbElements : 0ul);
+  TRACE("(%p) returning %d\n", psa, psa ? psa->cbElements : 0u);
   return psa ? psa->cbElements : 0;
 }
 
diff --git a/dlls/oleaut32/stubs.c b/dlls/oleaut32/stubs.c
index 71a1697..ac2d494 100644
--- a/dlls/oleaut32/stubs.c
+++ b/dlls/oleaut32/stubs.c
@@ -58,9 +58,8 @@
     LPUNKNOWN* ppUnk, ULONG cPages, LPCLSID pPageClsID, LCID lcid,
     DWORD dwReserved, LPVOID pvReserved )
 {
-	FIXME("(%p,%d,%d,%s,%ld,%p,%ld,%p,%x,%ld,%p), not implemented (olepro32.dll)\n",
+	FIXME("(%p,%d,%d,%s,%d,%p,%d,%p,%x,%d,%p), not implemented (olepro32.dll)\n",
 		hwndOwner,x,y,debugstr_w(lpszCaption),cObjects,ppUnk,cPages,
 		pPageClsID, (int)lcid,dwReserved,pvReserved);
 	return S_OK;
 }
-
diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index 9c4987f..539937d 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -144,26 +144,26 @@
     
     hres = CreateStreamOnHGlobal(0,TRUE,&pStm);
     if (hres) {
-	ERR("Stream create failed %lx\n",hres);
+	ERR("Stream create failed %x\n",hres);
 	return hres;
     }
     
     hres = IStream_Write(pStm,buf->base+buf->curoff,xsize,&res);
     if (hres) {
-        ERR("stream write %lx\n",hres);
+        ERR("stream write %x\n",hres);
         return hres;
     }
     
     memset(&seekto,0,sizeof(seekto));
     hres = IStream_Seek(pStm,seekto,SEEK_SET,&newpos);
     if (hres) {
-        ERR("Failed Seek %lx\n",hres);
+        ERR("Failed Seek %x\n",hres);
         return hres;
     }
     
     hres = CoUnmarshalInterface(pStm,riid,(LPVOID*)pUnk);
     if (hres) {
-	ERR("Unmarshalling interface %s failed with %lx\n",debugstr_guid(riid),hres);
+	ERR("Unmarshalling interface %s failed with %x\n",debugstr_guid(riid),hres);
 	return hres;
     }
     
@@ -199,13 +199,13 @@
     
     hres = CreateStreamOnHGlobal(0,TRUE,&pStm);
     if (hres) {
-	ERR("Stream create failed %lx\n",hres);
+	ERR("Stream create failed %x\n",hres);
 	goto fail;
     }
     
     hres = CoMarshalInterface(pStm,riid,pUnk,0,NULL,0);
     if (hres) {
-	ERR("Marshalling interface %s failed with %lx\n", debugstr_guid(riid), hres);
+	ERR("Marshalling interface %s failed with %x\n", debugstr_guid(riid), hres);
 	goto fail;
     }
     
@@ -219,13 +219,13 @@
     memset(&seekto,0,sizeof(seekto));
     hres = IStream_Seek(pStm,seekto,SEEK_SET,&newpos);
     if (hres) {
-        ERR("Failed Seek %lx\n",hres);
+        ERR("Failed Seek %x\n",hres);
         goto fail;
     }
     
     hres = IStream_Read(pStm,tempbuf,ststg.cbSize.u.LowPart,&res);
     if (hres) {
-        ERR("Failed Read %lx\n",hres);
+        ERR("Failed Read %x\n",hres);
         goto fail;
     }
     
@@ -397,7 +397,7 @@
     ICOM_THIS_MULTI(TMProxyImpl,lpvtbl2,iface);
     ULONG refCount = InterlockedIncrement(&This->ref);
 
-    TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
+    TRACE("(%p)->(ref before=%u)\n",This, refCount - 1);
 
     return refCount;
 }
@@ -408,7 +408,7 @@
     ICOM_THIS_MULTI(TMProxyImpl,lpvtbl2,iface);
     ULONG refCount = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1);
+    TRACE("(%p)->(ref before=%u)\n",This, refCount + 1);
 
     if (!refCount)
     {
@@ -539,7 +539,7 @@
     case VT_UI8:
     case VT_CY:
 	hres = S_OK;
-	if (debugout) TRACE_(olerelay)("%lx%lx",arg[0],arg[1]);
+	if (debugout) TRACE_(olerelay)("%x%x",arg[0],arg[1]);
 	if (writeit)
 	    hres = xbuf_add(buf,(LPBYTE)arg,8);
 	return hres;
@@ -551,27 +551,27 @@
     case VT_R4:
     case VT_UI4:
 	hres = S_OK;
-	if (debugout) TRACE_(olerelay)("%lx",*arg);
+	if (debugout) TRACE_(olerelay)("%x",*arg);
 	if (writeit)
 	    hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD));
 	return hres;
     case VT_I2:
     case VT_UI2:
 	hres = S_OK;
-	if (debugout) TRACE_(olerelay)("%04lx",*arg & 0xffff);
+	if (debugout) TRACE_(olerelay)("%04x",*arg & 0xffff);
 	if (writeit)
 	    hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD));
 	return hres;
     case VT_I1:
     case VT_UI1:
 	hres = S_OK;
-	if (debugout) TRACE_(olerelay)("%02lx",*arg & 0xff);
+	if (debugout) TRACE_(olerelay)("%02x",*arg & 0xff);
 	if (writeit)
 	    hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD));
 	return hres;
     case VT_I4|VT_BYREF:
 	hres = S_OK;
-	if (debugout) TRACE_(olerelay)("&0x%lx",*arg);
+	if (debugout) TRACE_(olerelay)("&0x%x",*arg);
 	if (writeit)
 	    hres = xbuf_add(buf,(LPBYTE)(DWORD*)*arg,sizeof(DWORD));
 	/* do not dealloc at this time */
@@ -656,7 +656,7 @@
 
 	    hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.lptdesc->u.hreftype,&tinfo2);
 	    if (hres) {
-		ERR("Could not get typeinfo of hreftype %lx for VT_USERDEFINED.\n",tdesc->u.lptdesc->u.hreftype);
+		ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED.\n",tdesc->u.lptdesc->u.hreftype);
 		return hres;
 	    }
 	    ITypeInfo_GetTypeAttr(tinfo2,&tattr);
@@ -694,14 +694,14 @@
 	return hres;
     }
     case VT_UNKNOWN:
-	if (debugout) TRACE_(olerelay)("unk(0x%lx)",*arg);
+	if (debugout) TRACE_(olerelay)("unk(0x%x)",*arg);
 	if (writeit)
 	    hres = _marshal_interface(buf,&IID_IUnknown,(LPUNKNOWN)*arg);
 	if (dealloc && *(IUnknown **)arg)
 	    IUnknown_Release((LPUNKNOWN)*arg);
 	return hres;
     case VT_DISPATCH:
-	if (debugout) TRACE_(olerelay)("idisp(0x%lx)",*arg);
+	if (debugout) TRACE_(olerelay)("idisp(0x%x)",*arg);
 	if (writeit)
 	    hres = _marshal_interface(buf,&IID_IDispatch,(LPUNKNOWN)*arg);
 	if (dealloc && *(IUnknown **)arg)
@@ -716,7 +716,7 @@
 
 	hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.hreftype,&tinfo2);
 	if (hres) {
-	    ERR("Could not get typeinfo of hreftype %lx for VT_USERDEFINED.\n",tdesc->u.hreftype);
+	    ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED.\n",tdesc->u.hreftype);
 	    return hres;
 	}
 	ITypeInfo_GetTypeAttr(tinfo2,&tattr);
@@ -775,7 +775,7 @@
 	    return serialize_param(tinfo2,writeit,debugout,dealloc,&tattr->tdescAlias,arg,buf);
 	case TKIND_ENUM:
 	    hres = S_OK;
-	    if (debugout) TRACE_(olerelay)("%lx",*arg);
+	    if (debugout) TRACE_(olerelay)("%x",*arg);
 	    if (writeit)
 	        hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD));
 	    return hres;
@@ -793,7 +793,7 @@
 
 	if (debugout) TRACE_(olerelay)("carr");
 	for (i=0;i<adesc->cDims;i++) {
-	    if (debugout) TRACE_(olerelay)("[%ld]",adesc->rgbounds[i].cElements);
+	    if (debugout) TRACE_(olerelay)("[%d]",adesc->rgbounds[i].cElements);
 	    arrsize *= adesc->rgbounds[i].cElements;
 	}
 	if (debugout) TRACE_(olerelay)("(vt %s)",debugstr_vt(adesc->tdescElem.vt));
@@ -876,7 +876,7 @@
 		hres = xbuf_get(buf,(LPBYTE)arg,8);
 		if (hres) ERR("Failed to read integer 8 byte\n");
 	    }
-	    if (debugout) TRACE_(olerelay)("%lx%lx",arg[0],arg[1]);
+	    if (debugout) TRACE_(olerelay)("%x%x",arg[0],arg[1]);
 	    return hres;
         case VT_ERROR:
 	case VT_BOOL:
@@ -889,7 +889,7 @@
 		hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD));
 		if (hres) ERR("Failed to read integer 4 byte\n");
 	    }
-	    if (debugout) TRACE_(olerelay)("%lx",*arg);
+	    if (debugout) TRACE_(olerelay)("%x",*arg);
 	    return hres;
         case VT_I2:
         case VT_UI2:
@@ -899,7 +899,7 @@
 		if (hres) ERR("Failed to read integer 4 byte\n");
 		memcpy(arg,&x,2);
 	    }
-	    if (debugout) TRACE_(olerelay)("%04lx",*arg & 0xffff);
+	    if (debugout) TRACE_(olerelay)("%04x",*arg & 0xffff);
 	    return hres;
         case VT_I1:
 	case VT_UI1:
@@ -909,7 +909,7 @@
 		if (hres) ERR("Failed to read integer 4 byte\n");
 		memcpy(arg,&x,1);
 	    }
-	    if (debugout) TRACE_(olerelay)("%02lx",*arg & 0xff);
+	    if (debugout) TRACE_(olerelay)("%02x",*arg & 0xff);
 	    return hres;
         case VT_I4|VT_BYREF:
 	    hres = S_OK;
@@ -919,7 +919,7 @@
 		hres = xbuf_get(buf,(LPBYTE)*arg,sizeof(DWORD));
 		if (hres) ERR("Failed to read integer 4 byte\n");
 	    }
-	    if (debugout) TRACE_(olerelay)("&0x%lx",*(DWORD*)*arg);
+	    if (debugout) TRACE_(olerelay)("&0x%x",*(DWORD*)*arg);
 	    return hres;
 	case VT_BSTR|VT_BYREF: {
 	    BSTR **bstr = (BSTR **)arg;
@@ -992,7 +992,7 @@
 
 		hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.lptdesc->u.hreftype,&tinfo2);
 		if (hres) {
-		    ERR("Could not get typeinfo of hreftype %lx for VT_USERDEFINED.\n",tdesc->u.lptdesc->u.hreftype);
+		    ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED.\n",tdesc->u.lptdesc->u.hreftype);
 		    return hres;
 		}
 		ITypeInfo_GetTypeAttr(tinfo2,&tattr);
@@ -1064,7 +1064,7 @@
 
 	    hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.hreftype,&tinfo2);
 	    if (hres) {
-		ERR("Could not get typeinfo of hreftype %lx for VT_USERDEFINED.\n",tdesc->u.hreftype);
+		ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED.\n",tdesc->u.hreftype);
 		return hres;
 	    }
 	    hres = ITypeInfo_GetTypeAttr(tinfo2,&tattr);
@@ -1114,7 +1114,7 @@
 		        hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD));
 		        if (hres) ERR("Failed to read enum (4 byte)\n");
 		    }
-		    if (debugout) TRACE_(olerelay)("%lx",*arg);
+		    if (debugout) TRACE_(olerelay)("%x",*arg);
 		    return hres;
 		default:
 		    ERR("Unhandled typekind %d\n",tattr->typekind);
@@ -1188,7 +1188,7 @@
 
 	    hres = ITypeInfo_GetTypeAttr(tinfo, &attr);
 	    if (hres) {
-		ERR("GetTypeAttr failed with %lx\n",hres);
+		ERR("GetTypeAttr failed with %x\n",hres);
 		return hres;
 	    }
 	    /* Not found, so look in inherited ifaces. */
@@ -1200,7 +1200,7 @@
 		}
 		hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
 		if (hres) {
-		    ERR("Did not find a typeinfo for reftype %ld?\n",href);
+		    ERR("Did not find a typeinfo for reftype %d?\n",href);
 		    continue;
 		}
 		hres = _get_funcdesc(tinfo2,iMethod,tactual,fdesc,iname,fname);
@@ -1309,7 +1309,7 @@
 	);
 
 	if (hres) {
-	    ERR("Failed to serialize param, hres %lx\n",hres);
+	    ERR("Failed to serialize param, hres %x\n",hres);
 	    break;
 	}
 	xargs+=_argsize(elem->tdesc.vt);
@@ -1321,18 +1321,18 @@
     msg.iMethod  = method;
     hres = IRpcChannelBuffer_GetBuffer(chanbuf,&msg,&(tpinfo->iid));
     if (hres) {
-	ERR("RpcChannelBuffer GetBuffer failed, %lx\n",hres);
+	ERR("RpcChannelBuffer GetBuffer failed, %x\n",hres);
 	goto exit;
     }
     memcpy(msg.Buffer,buf.base,buf.curoff);
     if (relaydeb) TRACE_(olerelay)("\n");
     hres = IRpcChannelBuffer_SendReceive(chanbuf,&msg,&status);
     if (hres) {
-	ERR("RpcChannelBuffer SendReceive failed, %lx\n",hres);
+	ERR("RpcChannelBuffer SendReceive failed, %x\n",hres);
 	goto exit;
     }
 
-    if (relaydeb) TRACE_(olerelay)(" status = %08lx (",status);
+    if (relaydeb) TRACE_(olerelay)(" status = %08x (",status);
     if (buf.base)
 	buf.base = HeapReAlloc(GetProcessHeap(),0,buf.base,msg.cbBuffer);
     else
@@ -1367,7 +1367,7 @@
 	    &buf
         );
 	if (hres) {
-	    ERR("Failed to unmarshall param, hres %lx\n",hres);
+	    ERR("Failed to unmarshall param, hres %x\n",hres);
 	    status = hres;
 	    break;
 	}
@@ -1377,7 +1377,7 @@
     hres = xbuf_get(&buf, (LPBYTE)&remoteresult, sizeof(DWORD));
     if (hres != S_OK)
         goto exit;
-    if (relaydeb) TRACE_(olerelay)(") = %08lx\n", remoteresult);
+    if (relaydeb) TRACE_(olerelay)(") = %08x\n", remoteresult);
 
     hres = remoteresult;
 
@@ -1385,7 +1385,7 @@
     HeapFree(GetProcessHeap(),0,buf.base);
     IRpcChannelBuffer_Release(chanbuf);
     ITypeInfo_Release(tinfo);
-    TRACE("-- 0x%08lx\n", hres);
+    TRACE("-- 0x%08x\n", hres);
     return hres;
 }
 
@@ -1439,7 +1439,7 @@
 {
     TMProxyImpl *This = (TMProxyImpl *)iface;
 
-    TRACE("(%d, %lx, %p)\n", iTInfo, lcid, ppTInfo);
+    TRACE("(%d, %x, %p)\n", iTInfo, lcid, ppTInfo);
 
     return IDispatch_GetTypeInfo(This->dispatch, iTInfo, lcid, ppTInfo);
 }
@@ -1448,7 +1448,7 @@
 {
     TMProxyImpl *This = (TMProxyImpl *)iface;
 
-    TRACE("(%s, %p, %d, 0x%lx, %p)\n", debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
+    TRACE("(%s, %p, %d, 0x%x, %p)\n", debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
 
     return IDispatch_GetIDsOfNames(This->dispatch, riid, rgszNames,
                                    cNames, lcid, rgDispId);
@@ -1460,7 +1460,7 @@
 {
     TMProxyImpl *This = (TMProxyImpl *)iface;
 
-    TRACE("(%ld, %s, 0x%lx, 0x%x, %p, %p, %p, %p)\n", dispIdMember,
+    TRACE("(%d, %s, 0x%x, 0x%x, %p, %p, %p, %p)\n", dispIdMember,
           debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult,
           pExcepInfo, puArgErr);
 
@@ -1538,7 +1538,7 @@
 		hres = _get_funcdesc(tinfo,i,&tinfo2,&fdesc,NULL,NULL);
                 ITypeInfo_Release(tinfo2);
 		if (hres) {
-		    ERR("GetFuncDesc %lx should not fail here.\n",hres);
+		    ERR("GetFuncDesc %x should not fail here.\n",hres);
 		    return hres;
 		}
 		/* some args take more than 4 byte on the stack */
@@ -1652,7 +1652,7 @@
     TMStubImpl *This = (TMStubImpl *)iface;
     ULONG refCount = InterlockedIncrement(&This->ref);
         
-    TRACE("(%p)->(ref before=%lu)\n", This, refCount - 1);
+    TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
 
     return refCount;
 }
@@ -1663,7 +1663,7 @@
     TMStubImpl *This = (TMStubImpl *)iface;
     ULONG refCount = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)->(ref before=%lu)\n", This, refCount + 1);
+    TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
 
     if (!refCount)
     {
@@ -1754,7 +1754,7 @@
 
     hres = _get_funcdesc(This->tinfo,xmsg->iMethod,&tinfo,&fdesc,&iname,NULL);
     if (hres) {
-	ERR("GetFuncDesc on method %ld failed with %lx\n",xmsg->iMethod,hres);
+	ERR("GetFuncDesc on method %d failed with %x\n",xmsg->iMethod,hres);
 	return hres;
     }
 
@@ -1797,7 +1797,7 @@
 	);
 	xargs += _argsize(elem->tdesc.vt);
 	if (hres) {
-	    ERR("Failed to deserialize param %s, hres %lx\n",relaystr(names[i+1]),hres);
+	    ERR("Failed to deserialize param %s, hres %x\n",relaystr(names[i+1]),hres);
 	    break;
 	}
     }
@@ -1816,7 +1816,7 @@
     __EXCEPT(NULL)
     {
         DWORD dwExceptionCode = GetExceptionCode();
-        ERR("invoke call failed with exception 0x%08lx (%ld)\n", dwExceptionCode, dwExceptionCode);
+        ERR("invoke call failed with exception 0x%08x (%d)\n", dwExceptionCode, dwExceptionCode);
         if (FAILED(dwExceptionCode))
             hres = dwExceptionCode;
         else
@@ -1843,7 +1843,7 @@
 	);
 	xargs += _argsize(elem->tdesc.vt);
 	if (hres) {
-	    ERR("Failed to stuballoc param, hres %lx\n",hres);
+	    ERR("Failed to stuballoc param, hres %x\n",hres);
 	    break;
 	}
     }
@@ -1858,7 +1858,7 @@
     xmsg->cbBuffer	= buf.curoff;
     hres = IRpcChannelBuffer_GetBuffer(rpcchanbuf, xmsg, &This->iid);
     if (hres != S_OK)
-        ERR("IRpcChannelBuffer_GetBuffer failed with error 0x%08lx\n", hres);
+        ERR("IRpcChannelBuffer_GetBuffer failed with error 0x%08x\n", hres);
 
     if (hres == S_OK)
         memcpy(xmsg->Buffer, buf.base, buf.curoff);
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 8ebfd0e..4e4e75c 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -228,7 +228,7 @@
     WCHAR Path[MAX_PATH];
     LONG res;
 
-    TRACE_(typelib)("(%s, %x.%x, 0x%lx, %p)\n", debugstr_guid(guid), wMaj, wMin, lcid, path);
+    TRACE_(typelib)("(%s, %x.%x, 0x%x, %p)\n", debugstr_guid(guid), wMaj, wMin, lcid, path);
 
     get_typelib_key( guid, wMaj, wMin, buffer );
 
@@ -276,7 +276,7 @@
         }
     }
     RegCloseKey( hkey );
-    TRACE_(typelib)("-- 0x%08lx\n", hr);
+    TRACE_(typelib)("-- 0x%08x\n", hr);
     return hr;
 }
 
@@ -359,7 +359,7 @@
                 break;
         }
 
-    TRACE(" returns %08lx\n",res);
+    TRACE(" returns %08x\n",res);
     return res;
 }
 
@@ -1033,7 +1033,7 @@
     case VT_VARIANT: sprintf(szVarType, "VT_VARIANT"); break;
     case VT_VOID: sprintf(szVarType, "VT_VOID"); break;
     case VT_HRESULT: sprintf(szVarType, "VT_HRESULT"); break;
-    case VT_USERDEFINED: sprintf(szVarType, "VT_USERDEFINED ref = %lx",
+    case VT_USERDEFINED: sprintf(szVarType, "VT_USERDEFINED ref = %x",
 				 pTD->u.hreftype); break;
     case VT_PTR: sprintf(szVarType, "ptr to ");
       dump_TypeDesc(pTD->u.lptdesc, szVarType + 7);
@@ -1068,7 +1068,7 @@
 }
 static void dump_FUNCDESC(const FUNCDESC *funcdesc) {
   int i;
-  MESSAGE("memid is %08lx\n",funcdesc->memid);
+  MESSAGE("memid is %08x\n",funcdesc->memid);
   for (i=0;i<funcdesc->cParams;i++) {
       MESSAGE("Param %d:\n",i);
       dump_ELEMDESC(funcdesc->lprgelemdescParam+i);
@@ -1152,7 +1152,7 @@
 {
     TRACE_(typelib)("%s %s\n", debugstr_guid(&(import->guid)),
 		    debugstr_w(import->name));
-    TRACE_(typelib)("v%d.%d lcid=%lx offset=%x\n", import->wVersionMajor,
+    TRACE_(typelib)("v%d.%d lcid=%x offset=%x\n", import->wVersionMajor,
 		    import->wVersionMinor, import->lcid, import->offset);
 }
 
@@ -1160,7 +1160,7 @@
 {
 	while (prt)
 	{
-	  TRACE_(typelib)("href:0x%08lx\n", prt->reference);
+	  TRACE_(typelib)("href:0x%08x\n", prt->reference);
 	  if(prt->index == -1)
 	    TRACE_(typelib)("%s\n", debugstr_guid(&(prt->guid)));
 	  else
@@ -1179,7 +1179,7 @@
 {
     while (impl) {
         TRACE_(typelib)(
-		"implementing/inheriting interface hRef = %lx implflags %x\n",
+		"implementing/inheriting interface hRef = %x implflags %x\n",
 		impl->hRef, impl->implflags);
 	impl = impl->next;
     }
@@ -1209,18 +1209,18 @@
       case VT_I2:   TRACE(",%d", V_I2(pvar)); break;
       case VT_UI2:  TRACE(",%d", V_UI2(pvar)); break;
       case VT_INT:
-      case VT_I4:   TRACE(",%ld", V_I4(pvar)); break;
+      case VT_I4:   TRACE(",%d", V_I4(pvar)); break;
       case VT_UINT:
-      case VT_UI4:  TRACE(",%ld", V_UI4(pvar)); break;
-      case VT_I8:   TRACE(",0x%08lx,0x%08lx", (ULONG)(V_I8(pvar) >> 32),
+      case VT_UI4:  TRACE(",%d", V_UI4(pvar)); break;
+      case VT_I8:   TRACE(",0x%08x,0x%08x", (ULONG)(V_I8(pvar) >> 32),
                           (ULONG)(V_I8(pvar) & 0xffffffff)); break;
-      case VT_UI8:  TRACE(",0x%08lx,0x%08lx", (ULONG)(V_UI8(pvar) >> 32),
+      case VT_UI8:  TRACE(",0x%08x,0x%08x", (ULONG)(V_UI8(pvar) >> 32),
                           (ULONG)(V_UI8(pvar) & 0xffffffff)); break;
       case VT_R4:   TRACE(",%3.3e", V_R4(pvar)); break;
       case VT_R8:   TRACE(",%3.3e", V_R8(pvar)); break;
       case VT_BOOL: TRACE(",%s", V_BOOL(pvar) ? "TRUE" : "FALSE"); break;
       case VT_BSTR: TRACE(",%s", debugstr_w(V_BSTR(pvar))); break;
-      case VT_CY:   TRACE(",0x%08lx,0x%08lx", V_CY(pvar).s.Hi,
+      case VT_CY:   TRACE(",0x%08x,0x%08x", V_CY(pvar).s.Hi,
                            V_CY(pvar).s.Lo); break;
       case VT_DATE:
         if(!VariantTimeToSystemTime(V_DATE(pvar), &st))
@@ -1249,7 +1249,7 @@
     if (pdp->cNamedArgs)
         TRACE("named args:\n");
     for (index = 0; index < pdp->cNamedArgs; index++)
-        TRACE( "\t0x%lx\n", pdp->rgdispidNamedArgs[index] );
+        TRACE( "\t0x%x\n", pdp->rgdispidNamedArgs[index] );
 
     if (pdp->cArgs)
         TRACE("args:\n");
@@ -1259,7 +1259,7 @@
 
 static void dump_TypeInfo(const ITypeInfoImpl * pty)
 {
-    TRACE("%p ref=%lu\n", pty, pty->ref);
+    TRACE("%p ref=%u\n", pty, pty->ref);
     TRACE("%s %s\n", debugstr_w(pty->Name), debugstr_w(pty->DocString));
     TRACE("attr:%s\n", debugstr_guid(&(pty->TypeAttr.guid)));
     TRACE("kind:%s\n", typekind_desc[pty->TypeAttr.typekind]);
@@ -1276,9 +1276,9 @@
 
 static void dump_VARDESC(const VARDESC *v)
 {
-    MESSAGE("memid %ld\n",v->memid);
+    MESSAGE("memid %d\n",v->memid);
     MESSAGE("lpstrSchema %s\n",debugstr_w(v->lpstrSchema));
-    MESSAGE("oInst %ld\n",v->u.oInst);
+    MESSAGE("oInst %d\n",v->u.oInst);
     dump_ELEMDESC(&(v->elemdescVar));
     MESSAGE("wVarFlags %x\n",v->wVarFlags);
     MESSAGE("varkind %d\n",v->varkind);
@@ -1394,7 +1394,7 @@
 /* read function */
 static DWORD MSFT_Read(void *buffer,  DWORD count, TLBContext *pcx, long where )
 {
-    TRACE_(typelib)("pos=0x%08x len=0x%08lx 0x%08x 0x%08x 0x%08lx\n",
+    TRACE_(typelib)("pos=0x%08x len=0x%08x 0x%08x 0x%08x 0x%08lx\n",
        pcx->pos, count, pcx->oStart, pcx->length, where);
 
     MSFT_Seek(pcx, where);
@@ -2238,7 +2238,7 @@
                     else if (dwSignature == SLTG_SIGNATURE)
                         *ppTypeLib = ITypeLib2_Constructor_SLTG(pBase, dwTLBLength);
                     else
-                        FIXME("Header type magic 0x%08lx not supported.\n",dwSignature);
+                        FIXME("Header type magic 0x%08x not supported.\n",dwSignature);
                 }
                 FreeResource( hGlobal );
             }
@@ -2290,7 +2290,7 @@
         LeaveCriticalSection(&cache_section);
         ret = S_OK;
     } else
-	ERR("Loading of typelib %s failed with error %ld\n", debugstr_w(pszFileName), GetLastError());
+	ERR("Loading of typelib %s failed with error %d\n", debugstr_w(pszFileName), GetLastError());
 
     return ret;
 }
@@ -2324,7 +2324,7 @@
     MSFT_SegDir tlbSegDir;
     ITypeLibImpl * pTypeLibImpl;
 
-    TRACE("%p, TLB length = %ld\n", pLib, dwTLBLength);
+    TRACE("%p, TLB length = %d\n", pLib, dwTLBLength);
 
     pTypeLibImpl = TypeLibImpl_Constructor();
     if (!pTypeLibImpl) return NULL;
@@ -2767,7 +2767,7 @@
 		(*import)->offset = lib_offs;
 		TLB_GUIDFromString( pNameTable + lib_offs + 4,
 				    &(*import)->guid);
-		if(sscanf(pNameTable + lib_offs + 40, "}#%hd.%hd#%lx#%s",
+		if(sscanf(pNameTable + lib_offs + 40, "}#%hd.%hd#%x#%s",
 			  &(*import)->wVersionMajor,
 			  &(*import)->wVersionMinor,
 			  &(*import)->lcid, fname) != 4) {
@@ -2854,7 +2854,7 @@
         (*ppVarDesc)->Name = TLB_MultiByteToBSTR(pItem->name + pNameTable);
 
       TRACE_(typelib)("byte_offs = 0x%x\n", pItem->byte_offs);
-      TRACE_(typelib)("memid = 0x%lx\n", pItem->memid);
+      TRACE_(typelib)("memid = 0x%x\n", pItem->memid);
 
       if (pItem->flags & 0x40) {
         TRACE_(typelib)("VAR_DISPATCH\n");
@@ -3168,7 +3168,7 @@
     DWORD len, order;
     ITypeInfoImpl **ppTypeInfoImpl;
 
-    TRACE_(typelib)("%p, TLB length = %ld\n", pLib, dwTLBLength);
+    TRACE_(typelib)("%p, TLB length = %d\n", pLib, dwTLBLength);
 
 
     pTypeLibImpl = TypeLibImpl_Constructor();
@@ -3177,10 +3177,10 @@
     pHeader = pLib;
 
     TRACE_(typelib)("header:\n");
-    TRACE_(typelib)("\tmagic=0x%08lx, file blocks = %d\n", pHeader->SLTG_magic,
+    TRACE_(typelib)("\tmagic=0x%08x, file blocks = %d\n", pHeader->SLTG_magic,
 	  pHeader->nrOfFileBlks );
     if (pHeader->SLTG_magic != SLTG_SIGNATURE) {
-	FIXME("Header type magic 0x%08lx not supported.\n",
+	FIXME("Header type magic 0x%08x not supported.\n",
 	      pHeader->SLTG_magic);
 	return NULL;
     }
@@ -3335,7 +3335,7 @@
 	FIXME("TypeInfoHeader magic = %04x\n", pTIHeader->magic);
 	return NULL;
       }
-      TRACE("pTIHeader->res06 = %lx, pTIHeader->res0e = %lx, pTIHeader->res16 = %lx, pTIHeader->res1e = %lx\n",
+      TRACE("pTIHeader->res06 = %x, pTIHeader->res0e = %x, pTIHeader->res16 = %x, pTIHeader->res1e = %x\n",
         pTIHeader->res06, pTIHeader->res0e, pTIHeader->res16, pTIHeader->res1e);
 
       *ppTypeInfoImpl = (ITypeInfoImpl*)ITypeInfo_Constructor();
@@ -3480,7 +3480,7 @@
     ITypeLibImpl *This = (ITypeLibImpl *)iface;
     ULONG ref = InterlockedIncrement(&This->ref);
 
-    TRACE("(%p)->ref was %lu\n",This, ref - 1);
+    TRACE("(%p)->ref was %u\n",This, ref - 1);
 
     return ref;
 }
@@ -3492,7 +3492,7 @@
     ITypeLibImpl *This = (ITypeLibImpl *)iface;
     ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)->(%lu)\n",This, ref);
+    TRACE("(%p)->(%u)\n",This, ref);
 
     if (!ref)
     {
@@ -3823,7 +3823,7 @@
     int i;
     UINT nNameBufLen = (lstrlenW(szNameBuf)+1)*sizeof(WCHAR);
 
-    TRACE("(%p)->(%s,%08lx,%p)\n", This, debugstr_w(szNameBuf), lHashVal,
+    TRACE("(%p)->(%s,%08x,%p)\n", This, debugstr_w(szNameBuf), lHashVal,
 	  pfName);
 
     *pfName=TRUE;
@@ -3976,7 +3976,7 @@
     HRESULT result;
     ITypeInfo *pTInfo;
 
-    FIXME("(%p) index %d lcid %ld half implemented stub!\n", This, index, lcid);
+    FIXME("(%p) index %d lcid %d half implemented stub!\n", This, index, lcid);
 
     /* the help string should be obtained from the helpstringdll,
      * using the _DLLGetDocumentation function, based on the supplied
@@ -4106,7 +4106,7 @@
     ITypeLibImpl *This = impl_from_ITypeComp(iface);
     ITypeInfoImpl *pTypeInfo;
 
-    TRACE("(%s, 0x%lx, 0x%x, %p, %p, %p)\n", debugstr_w(szName), lHash, wFlags, ppTInfo, pDescKind, pBindPtr);
+    TRACE("(%s, 0x%x, 0x%x, %p, %p, %p)\n", debugstr_w(szName), lHash, wFlags, ppTInfo, pDescKind, pBindPtr);
 
     *pDescKind = DESCKIND_NONE;
     pBindPtr->lptcomp = NULL;
@@ -4230,7 +4230,7 @@
     ITypeInfo ** ppTInfo,
     ITypeComp ** ppTComp)
 {
-    FIXME("(%s, %lx, %p, %p): stub\n", debugstr_w(szName), lHash, ppTInfo, ppTComp);
+    FIXME("(%s, %x, %p, %p): stub\n", debugstr_w(szName), lHash, ppTInfo, ppTComp);
     return E_NOTIMPL;
 }
 
@@ -4299,7 +4299,7 @@
 
     ITypeLib2_AddRef((ITypeLib2*)This->pTypeLib);
 
-    TRACE("(%p)->ref is %lu\n",This, ref);
+    TRACE("(%p)->ref is %u\n",This, ref);
     return ref;
 }
 
@@ -4310,7 +4310,7 @@
     ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
     ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)->(%lu)\n",This, ref);
+    TRACE("(%p)->(%u)\n",This, ref);
 
     if (ref)   {
       /* We don't release ITypeLib when ref=0 because
@@ -4715,7 +4715,7 @@
     const TLBFuncDesc *pFDesc;
     const TLBVarDesc *pVDesc;
     int i;
-    TRACE("(%p) memid=0x%08lx Maxname=%d\n", This, memid, cMaxNames);
+    TRACE("(%p) memid=0x%08x Maxname=%d\n", This, memid, cMaxNames);
     for(pFDesc=This->funclist; pFDesc && pFDesc->funcdesc.memid != memid; pFDesc=pFDesc->next);
     if(pFDesc)
     {
@@ -4821,9 +4821,9 @@
     if(TRACE_ON(ole))
     {
         if(SUCCEEDED(hr))
-            TRACE("SUCCESS -- hRef = 0x%08lx\n", *pRefType );
+            TRACE("SUCCESS -- hRef = 0x%08x\n", *pRefType );
         else
-            TRACE("FAILURE -- hresult = 0x%08lx\n", hr);
+            TRACE("FAILURE -- hresult = 0x%08x\n", hr);
     }
 
     return hr;
@@ -4886,7 +4886,7 @@
                 else
                    ret=DISP_E_UNKNOWNNAME;
             };
-            TRACE("-- 0x%08lx\n", ret);
+            TRACE("-- 0x%08x\n", ret);
             return ret;
         }
     }
@@ -4925,7 +4925,7 @@
     if (TRACE_ON(ole)) {
 	int i;
 	TRACE("Calling %p(",func);
-	for (i=0;i<nrargs;i++) TRACE("%08lx,",args[i]);
+	for (i=0;i<nrargs;i++) TRACE("%08x,",args[i]);
 	TRACE(")\n");
     }
 
@@ -5016,7 +5016,7 @@
 	res = -1;
 	break;
     }
-    TRACE("returns %08lx\n",res);
+    TRACE("returns %08x\n",res);
     return res;
 }
 
@@ -5031,15 +5031,15 @@
     hr = ITypeInfo_GetRefTypeInfo(tinfo, tdesc->u.hreftype, &tinfo2);
     if (hr)
     {
-        ERR("Could not get typeinfo of hreftype %lx for VT_USERDEFINED, "
-            "hr = 0x%08lx\n",
+        ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED, "
+            "hr = 0x%08x\n",
               tdesc->u.hreftype, hr);
         return hr;
     }
     hr = ITypeInfo_GetTypeAttr(tinfo2, &tattr);
     if (hr)
     {
-        ERR("ITypeInfo_GetTypeAttr failed, hr = 0x%08lx\n", hr);
+        ERR("ITypeInfo_GetTypeAttr failed, hr = 0x%08x\n", hr);
         ITypeInfo_Release(tinfo2);
         return hr;
     }
@@ -5244,7 +5244,7 @@
 
     if (pvargResult && (vtReturn != VT_EMPTY))
     {
-        TRACE("Method returned 0x%08lx\n",hres);
+        TRACE("Method returned 0x%08x\n",hres);
         V_VT(pvargResult) = vtReturn;
         V_UI4(pvargResult) = hres;
     }
@@ -5281,7 +5281,7 @@
     HRESULT hres;
     const TLBFuncDesc *pFuncInfo;
 
-    TRACE("(%p)(%p,id=%ld,flags=0x%08x,%p,%p,%p,%p)\n",
+    TRACE("(%p)(%p,id=%d,flags=0x%08x,%p,%p,%p,%p)\n",
       This,pIUnk,memid,wFlags,pDispParams,pVarResult,pExcepInfo,pArgErr
     );
 
@@ -5517,7 +5517,7 @@
 
             if ((V_VT(&varresult) == VT_ERROR) && FAILED(V_ERROR(&varresult)))
             {
-                WARN("invoked function failed with error 0x%08lx\n", V_ERROR(&varresult));
+                WARN("invoked function failed with error 0x%08x\n", V_ERROR(&varresult));
                 hres = DISP_E_EXCEPTION;
                 if (pExcepInfo) pExcepInfo->scode = V_ERROR(&varresult);
             }
@@ -5537,7 +5537,7 @@
                                      pVarResult,pExcepInfo,pArgErr
                                      );
                if (FAILED(hres))
-                   FIXME("IDispatch::Invoke failed with %08lx. (Could be not a real error?)\n", hres);
+                   FIXME("IDispatch::Invoke failed with %08x. (Could be not a real error?)\n", hres);
                IDispatch_Release(disp);
            } else
 	       FIXME("FUNC_DISPATCH used on object without IDispatch iface?\n");
@@ -5549,7 +5549,7 @@
             break;
         }
 
-        TRACE("-- 0x%08lx\n", hres);
+        TRACE("-- 0x%08x\n", hres);
         return hres;
 
     } else if(SUCCEEDED(hres = ITypeInfo2_GetVarIndexOfMemId(iface, memid, &var_index))) {
@@ -5580,7 +5580,7 @@
             WARN("Could not search inherited interface!\n");
         }
     }
-    ERR("did not find member id %ld, flags 0x%x!\n", memid, wFlags);
+    ERR("did not find member id %d, flags 0x%x!\n", memid, wFlags);
     return DISP_E_MEMBERNOTFOUND;
 }
 
@@ -5598,7 +5598,7 @@
     ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
     const TLBFuncDesc *pFDesc;
     const TLBVarDesc *pVDesc;
-    TRACE("(%p) memid %ld Name(%p) DocString(%p)"
+    TRACE("(%p) memid %d Name(%p) DocString(%p)"
           " HelpContext(%p) HelpFile(%p)\n",
         This, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
     if(memid==MEMBERID_NIL){ /* documentation for the typeinfo */
@@ -5650,7 +5650,7 @@
         WARN("Could not search inherited interface!\n");
     }
 
-    WARN("member %ld not found\n", memid);
+    WARN("member %d not found\n", memid);
     return TYPE_E_ELEMENTNOTFOUND;
 }
 
@@ -5666,7 +5666,7 @@
     ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
     const TLBFuncDesc *pFDesc;
 
-    TRACE("(%p)->(memid %lx, %d, %p, %p, %p)\n", This, memid, invKind, pBstrDllName, pBstrName, pwOrdinal);
+    TRACE("(%p)->(memid %x, %d, %p, %p, %p)\n", This, memid, invKind, pBstrDllName, pBstrName, pwOrdinal);
 
     if (pBstrDllName) *pBstrDllName = NULL;
     if (pBstrName) *pBstrName = NULL;
@@ -5751,7 +5751,7 @@
 	        break;
 	}
 	if(!pRefType)
-	  FIXME("Can't find pRefType for ref %lx\n", hRefType);
+	  FIXME("Can't find pRefType for ref %x\n", hRefType);
 	if(pRefType && hRefType != -1) {
             ITypeLib *pTLib = NULL;
 
@@ -5797,7 +5797,7 @@
 	}
     }
 
-    TRACE("(%p) hreftype 0x%04lx loaded %s (%p)\n", This, hRefType,
+    TRACE("(%p) hreftype 0x%04x loaded %s (%p)\n", This, hRefType,
           SUCCEEDED(result)? "SUCCESS":"FAILURE", *ppTInfo);
     return result;
 }
@@ -5816,7 +5816,7 @@
     WORD ordinal;
     HMODULE module;
 
-    TRACE("(%p)->(0x%lx, 0x%x, %p)\n", This, memid, invKind, ppv);
+    TRACE("(%p)->(0x%x, 0x%x, %p)\n", This, memid, invKind, ppv);
 
     hr = ITypeInfo_GetDllEntry(iface, memid, invKind, &dll, &entry, &ordinal);
     if (FAILED(hr))
@@ -5898,7 +5898,7 @@
     {
         IUnknown *pUnk;
         hr = GetActiveObject(&pTA->guid, NULL, &pUnk);
-        TRACE("GetActiveObject rets %08lx\n", hr);
+        TRACE("GetActiveObject rets %08x\n", hr);
         if(hr == S_OK)
         {
             hr = IUnknown_QueryInterface(pUnk, riid, ppvObj);
@@ -6027,7 +6027,7 @@
 {
     ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
     *pTypeFlags=This->TypeAttr.wTypeFlags;
-    TRACE("(%p) flags 0x%lx\n", This,*pTypeFlags);
+    TRACE("(%p) flags 0x%x\n", This,*pTypeFlags);
     return S_OK;
 }
 
@@ -6053,7 +6053,7 @@
     } else
         result = TYPE_E_ELEMENTNOTFOUND;
 
-    TRACE("(%p) memid 0x%08lx invKind 0x%04x -> %s\n", This,
+    TRACE("(%p) memid 0x%08x invKind 0x%04x -> %s\n", This,
           memid, invKind, SUCCEEDED(result) ? "SUCCESS" : "FAILED");
     return result;
 }
@@ -6080,7 +6080,7 @@
     } else
         result = TYPE_E_ELEMENTNOTFOUND;
 
-    TRACE("(%p) memid 0x%08lx -> %s\n", This,
+    TRACE("(%p) memid 0x%08x -> %s\n", This,
           memid, SUCCEEDED(result) ? "SUCCESS" : "FAILED");
     return result;
 }
@@ -6266,7 +6266,7 @@
     ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
     const TLBFuncDesc *pFDesc;
     const TLBVarDesc *pVDesc;
-    TRACE("(%p) memid %ld lcid(0x%lx)  HelpString(%p) "
+    TRACE("(%p) memid %d lcid(0x%x)  HelpString(%p) "
           "HelpStringContext(%p) HelpStringDll(%p)\n",
           This, memid, lcid, pbstrHelpString, pdwHelpStringContext,
           pbstrHelpStringDll );
@@ -6688,7 +6688,7 @@
     const TLBVarDesc *pVDesc;
     HRESULT hr = DISP_E_MEMBERNOTFOUND;
 
-    TRACE("(%s, %lx, 0x%x, %p, %p, %p)\n", debugstr_w(szName), lHash, wFlags, ppTInfo, pDescKind, pBindPtr);
+    TRACE("(%s, %x, 0x%x, %p, %p, %p)\n", debugstr_w(szName), lHash, wFlags, ppTInfo, pDescKind, pBindPtr);
 
     *pDescKind = DESCKIND_NONE;
     pBindPtr->lpfuncdesc = NULL;
@@ -6759,7 +6759,7 @@
     ITypeInfo ** ppTInfo,
     ITypeComp ** ppTComp)
 {
-    TRACE("(%s, %lx, %p, %p)\n", debugstr_w(szName), lHash, ppTInfo, ppTComp);
+    TRACE("(%s, %x, %p, %p)\n", debugstr_w(szName), lHash, ppTInfo, ppTComp);
 
     /* strange behaviour (does nothing) but like the
      * original */
diff --git a/dlls/oleaut32/typelib16.c b/dlls/oleaut32/typelib16.c
index 0c48b68..e681355 100644
--- a/dlls/oleaut32/typelib16.c
+++ b/dlls/oleaut32/typelib16.c
@@ -85,14 +85,14 @@
        	TRACE("\n");
 
 	if (HIWORD(guid)) {
-            sprintf( typelibkey, "SOFTWARE\\Classes\\Typelib\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\%d.%d\\%lx\\win16",
+            sprintf( typelibkey, "SOFTWARE\\Classes\\Typelib\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\%d.%d\\%x\\win16",
                      guid->Data1, guid->Data2, guid->Data3,
                      guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
                      guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7],
                      wMaj,wMin,lcid);
 	} else {
-		sprintf(xguid,"<guid 0x%08lx>",(DWORD)guid);
-		FIXME("(%s,%d,%d,0x%04lx,%p),can't handle non-string guids.\n",xguid,wMaj,wMin,(DWORD)lcid,path);
+		sprintf(xguid,"<guid 0x%08x>",(DWORD)guid);
+		FIXME("(%s,%d,%d,0x%04x,%p),can't handle non-string guids.\n",xguid,wMaj,wMin,(DWORD)lcid,path);
 		return E_FAIL;
 	}
 	plen = sizeof(pathname);
diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c
index cbcf8f5..5f3ead1 100644
--- a/dlls/oleaut32/typelib2.c
+++ b/dlls/oleaut32/typelib2.c
@@ -1150,7 +1150,7 @@
     ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
     ULONG ref = InterlockedIncrement(&This->ref);
 
-    TRACE("(%p)->ref was %lu\n",This, ref - 1);
+    TRACE("(%p)->ref was %u\n",This, ref - 1);
 
     return ref;
 }
@@ -1165,7 +1165,7 @@
     ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
     ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)->(%lu)\n",This, ref);
+    TRACE("(%p)->(%u)\n",This, ref);
 
     if (!ref) {
 	if (This->typelib) {
@@ -1295,7 +1295,7 @@
 {
     ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
 
-    TRACE("(%p,%ld)\n", iface, dwHelpContext);
+    TRACE("(%p,%d)\n", iface, dwHelpContext);
 
     This->typeinfo->helpcontext = dwHelpContext;
 
@@ -1380,7 +1380,7 @@
     int decoded_size;
 
     FIXME("(%p,%d,%p), stub!\n", iface, index, pFuncDesc);
-    FIXME("{%ld,%p,%p,%d,%d,%d,%d,%d,%d,%d,{%d},%d}\n", pFuncDesc->memid, pFuncDesc->lprgscode, pFuncDesc->lprgelemdescParam, pFuncDesc->funckind, pFuncDesc->invkind, pFuncDesc->callconv, pFuncDesc->cParams, pFuncDesc->cParamsOpt, pFuncDesc->oVft, pFuncDesc->cScodes, pFuncDesc->elemdescFunc.tdesc.vt, pFuncDesc->wFuncFlags);
+    FIXME("{%d,%p,%p,%d,%d,%d,%d,%d,%d,%d,{%d},%d}\n", pFuncDesc->memid, pFuncDesc->lprgscode, pFuncDesc->lprgelemdescParam, pFuncDesc->funckind, pFuncDesc->invkind, pFuncDesc->callconv, pFuncDesc->cParams, pFuncDesc->cParamsOpt, pFuncDesc->oVft, pFuncDesc->cScodes, pFuncDesc->elemdescFunc.tdesc.vt, pFuncDesc->wFuncFlags);
 /*     FIXME("{%d, %d}\n", pFuncDesc->lprgelemdescParam[0].tdesc.vt, pFuncDesc->lprgelemdescParam[1].tdesc.vt); */
 /*     return E_OUTOFMEMORY; */
     
@@ -1458,7 +1458,7 @@
 {
     ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
 
-    TRACE("(%p,%d,%ld)\n", iface, index, hRefType);
+    TRACE("(%p,%d,%d)\n", iface, index, hRefType);
 
     if ((This->typeinfo->typekind & 15) == TKIND_COCLASS) {
 	int offset;
@@ -1620,7 +1620,7 @@
     int alignment;
 
     TRACE("(%p,%d,%p), stub!\n", iface, index, pVarDesc);
-    TRACE("%ld, %p, %ld, {{%lx, %d}, {%p, %x}}, 0x%x, %d\n", pVarDesc->memid, pVarDesc->lpstrSchema, pVarDesc->u.oInst,
+    TRACE("%d, %p, %d, {{%x, %d}, {%p, %x}}, 0x%x, %d\n", pVarDesc->memid, pVarDesc->lpstrSchema, pVarDesc->u.oInst,
 	  pVarDesc->elemdescVar.tdesc.u.hreftype, pVarDesc->elemdescVar.tdesc.vt,
 	  pVarDesc->elemdescVar.u.paramdesc.pparamdescex, pVarDesc->elemdescVar.u.paramdesc.wParamFlags,
 	  pVarDesc->wVarFlags, pVarDesc->varkind);
@@ -1857,7 +1857,7 @@
         UINT index,
         DWORD dwHelpContext)
 {
-    FIXME("(%p,%d,%ld), stub!\n", iface, index, dwHelpContext);
+    FIXME("(%p,%d,%d), stub!\n", iface, index, dwHelpContext);
     return E_OUTOFMEMORY;
 }
 
@@ -1871,7 +1871,7 @@
         UINT index,
         DWORD dwHelpContext)
 {
-    FIXME("(%p,%d,%ld), stub!\n", iface, index, dwHelpContext);
+    FIXME("(%p,%d,%d), stub!\n", iface, index, dwHelpContext);
     return E_OUTOFMEMORY;
 }
 
@@ -1948,7 +1948,7 @@
         MEMBERID memid,          /* [I] The member id of the function to delete. */
         INVOKEKIND invKind)      /* [I] The invocation type of the function to delete. (?) */
 {
-    FIXME("(%p,%ld,%d), stub!\n", iface, memid, invKind);
+    FIXME("(%p,%d,%d), stub!\n", iface, memid, invKind);
     return E_OUTOFMEMORY;
 }
 
@@ -1986,7 +1986,7 @@
         ICreateTypeInfo2* iface, /* [I] The typeinfo from which to delete the variable description. */
         MEMBERID memid)          /* [I] The member id of the variable description to delete. */
 {
-    FIXME("(%p,%ld), stub!\n", iface, memid);
+    FIXME("(%p,%d), stub!\n", iface, memid);
     return E_OUTOFMEMORY;
 }
 
@@ -2122,7 +2122,7 @@
         ICreateTypeInfo2* iface,   /* [I] The typeinfo on which to set the help string context. */
         ULONG dwHelpStringContext) /* [I] The help string context. */
 {
-    FIXME("(%p,%ld), stub!\n", iface, dwHelpStringContext);
+    FIXME("(%p,%d), stub!\n", iface, dwHelpStringContext);
     return E_OUTOFMEMORY;
 }
 
@@ -2141,7 +2141,7 @@
         UINT index,                /* [I] The index for the function on which to set the help string context. */
         ULONG dwHelpStringContext) /* [I] The help string context. */
 {
-    FIXME("(%p,%d,%ld), stub!\n", iface, index, dwHelpStringContext);
+    FIXME("(%p,%d,%d), stub!\n", iface, index, dwHelpStringContext);
     return E_OUTOFMEMORY;
 }
 
@@ -2160,7 +2160,7 @@
         UINT index,                /* [I] The index of the variable on which to set the help string context. */
         ULONG dwHelpStringContext) /* [I] The help string context */
 {
-    FIXME("(%p,%d,%ld), stub!\n", iface, index, dwHelpStringContext);
+    FIXME("(%p,%d,%d), stub!\n", iface, index, dwHelpStringContext);
     return E_OUTOFMEMORY;
 }
 
@@ -2298,7 +2298,7 @@
         UINT cMaxNames,
         UINT* pcNames)
 {
-    FIXME("(%p,%ld,%p,%d,%p), stub!\n", iface, memid, rgBstrNames, cMaxNames, pcNames);
+    FIXME("(%p,%d,%p,%d,%p), stub!\n", iface, memid, rgBstrNames, cMaxNames, pcNames);
     return E_OUTOFMEMORY;
 }
 
@@ -2360,7 +2360,7 @@
         EXCEPINFO* pExcepInfo,
         UINT* puArgErr)
 {
-    FIXME("(%p,%p,%ld,%x,%p,%p,%p,%p), stub!\n", iface, pvInstance, memid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+    FIXME("(%p,%p,%d,%x,%p,%p,%p,%p), stub!\n", iface, pvInstance, memid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
     return E_OUTOFMEMORY;
 }
 
@@ -2377,7 +2377,7 @@
         DWORD* pdwHelpContext,
         BSTR* pBstrHelpFile)
 {
-    FIXME("(%p,%ld,%p,%p,%p,%p), stub!\n", iface, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
+    FIXME("(%p,%d,%p,%p,%p,%p), stub!\n", iface, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
     return E_OUTOFMEMORY;
 }
 
@@ -2394,7 +2394,7 @@
         BSTR* pBstrName,
         WORD* pwOrdinal)
 {
-    FIXME("(%p,%ld,%d,%p,%p,%p), stub!\n", iface, memid, invKind, pBstrDllName, pBstrName, pwOrdinal);
+    FIXME("(%p,%d,%d,%p,%p,%p), stub!\n", iface, memid, invKind, pBstrDllName, pBstrName, pwOrdinal);
     return E_OUTOFMEMORY;
 }
 
@@ -2408,7 +2408,7 @@
         HREFTYPE hRefType,
         ITypeInfo** ppTInfo)
 {
-    FIXME("(%p,%ld,%p), stub!\n", iface, hRefType, ppTInfo);
+    FIXME("(%p,%d,%p), stub!\n", iface, hRefType, ppTInfo);
     return E_OUTOFMEMORY;
 }
 
@@ -2423,7 +2423,7 @@
         INVOKEKIND invKind,
         PVOID* ppv)
 {
-    FIXME("(%p,%ld,%d,%p), stub!\n", iface, memid, invKind, ppv);
+    FIXME("(%p,%d,%d,%p), stub!\n", iface, memid, invKind, ppv);
     return E_OUTOFMEMORY;
 }
 
@@ -2452,7 +2452,7 @@
         MEMBERID memid,
         BSTR* pBstrMops)
 {
-    FIXME("(%p,%ld,%p), stub!\n", iface, memid, pBstrMops);
+    FIXME("(%p,%d,%p), stub!\n", iface, memid, pBstrMops);
     return E_OUTOFMEMORY;
 }
 
@@ -2565,7 +2565,7 @@
         INVOKEKIND invKind, /* [I] The invocation kind for the function. */
         UINT* pFuncIndex)   /* [O] The index of the function. */
 {
-    FIXME("(%p,%ld,%d,%p), stub!\n", iface, memid, invKind, pFuncIndex);
+    FIXME("(%p,%d,%d,%p), stub!\n", iface, memid, invKind, pFuncIndex);
     return E_OUTOFMEMORY;
 }
 
@@ -2584,7 +2584,7 @@
         MEMBERID memid,    /* [I] The member id for the variable. */
         UINT* pVarIndex)   /* [O] The index of the variable. */
 {
-    FIXME("(%p,%ld,%p), stub!\n", iface, memid, pVarIndex);
+    FIXME("(%p,%d,%p), stub!\n", iface, memid, pVarIndex);
     return E_OUTOFMEMORY;
 }
 
@@ -2706,7 +2706,7 @@
         DWORD* pdwHelpStringContext, /* [O] The help string context. */
         BSTR* pbstrHelpStringDll)    /* [O] The help file name. */
 {
-    FIXME("(%p,%ld,%ld,%p,%p,%p), stub!\n", iface, memid, lcid, pbstrHelpString, pdwHelpStringContext, pbstrHelpStringDll);
+    FIXME("(%p,%d,%d,%p,%p,%p), stub!\n", iface, memid, lcid, pbstrHelpString, pdwHelpStringContext, pbstrHelpStringDll);
     return E_OUTOFMEMORY;
 }
 
@@ -3016,7 +3016,7 @@
     ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
     ULONG ref = InterlockedIncrement(&This->ref);
 
-    TRACE("(%p)->ref was %lu\n",This, ref - 1);
+    TRACE("(%p)->ref was %u\n",This, ref - 1);
 
     return ref;
 }
@@ -3031,7 +3031,7 @@
     ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
     ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)->(%lu)\n",This, ref);
+    TRACE("(%p)->(%u)\n",This, ref);
 
     if (!ref) {
 	int i;
@@ -3190,7 +3190,7 @@
  */
 static HRESULT WINAPI ICreateTypeLib2_fnSetHelpContext(ICreateTypeLib2 * iface, DWORD dwHelpContext)
 {
-    FIXME("(%p,%ld), stub!\n", iface, dwHelpContext);
+    FIXME("(%p,%d), stub!\n", iface, dwHelpContext);
     return E_OUTOFMEMORY;
 }
 
@@ -3203,7 +3203,7 @@
 {
     ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
 
-    TRACE("(%p,%ld)\n", iface, lcid);
+    TRACE("(%p,%d)\n", iface, lcid);
 
     This->typelib_header.lcid2 = lcid;
 
@@ -3405,7 +3405,7 @@
 	ICreateTypeLib2 * iface,   /* [I] The type library to set the help string context for. */
 	ULONG dwHelpStringContext) /* [I] The help string context. */
 {
-    FIXME("(%p,%ld), stub!\n", iface, dwHelpStringContext);
+    FIXME("(%p,%d), stub!\n", iface, dwHelpStringContext);
     return E_OUTOFMEMORY;
 }
 
@@ -3619,7 +3619,7 @@
     int nameoffset;
     MSFT_NameIntro *nameintro;
 
-    TRACE("(%p,%s,%lx,%p)\n", iface, debugstr_w(szNameBuf), lHashVal, pfName);
+    TRACE("(%p,%s,%x,%p)\n", iface, debugstr_w(szNameBuf), lHashVal, pfName);
 
     ctl2_encode_name(This, szNameBuf, &encoded_name);
     nameoffset = ctl2_find_name(This, encoded_name);
@@ -3653,7 +3653,7 @@
 {
     ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
 
-    FIXME("(%p,%s,%lx,%p,%p,%p), stub!\n", This, debugstr_w(szNameBuf), lHashVal, ppTInfo, rgMemId, pcFound);
+    FIXME("(%p,%s,%x,%p,%p,%p), stub!\n", This, debugstr_w(szNameBuf), lHashVal, ppTInfo, rgMemId, pcFound);
 
     return E_OUTOFMEMORY;
 }
@@ -3737,7 +3737,7 @@
 {
     ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
 
-    FIXME("(%p,%d,%ld,%p,%p,%p), stub!\n", This, index, lcid, pbstrHelpString, pdwHelpStringContext, pbstrHelpStringDll);
+    FIXME("(%p,%d,%d,%p,%p,%p), stub!\n", This, index, lcid, pbstrHelpString, pdwHelpStringContext, pbstrHelpStringDll);
 
     return E_OUTOFMEMORY;
 }
diff --git a/dlls/oleaut32/usrmarshal.c b/dlls/oleaut32/usrmarshal.c
index 04b64b9..ddc55a2 100644
--- a/dlls/oleaut32/usrmarshal.c
+++ b/dlls/oleaut32/usrmarshal.c
@@ -111,7 +111,7 @@
         break;
 
     default:
-        ERR("Unknown type %lx\n", pstg->flags);
+        ERR("Unknown type %x\n", pstg->flags);
     }
 
     *(VOID**)pstg->pStorage = NULL;
@@ -182,7 +182,7 @@
     ALIGN_POINTER(Buffer, 3);
     header = (bstr_wire_t*)Buffer;
     if(header->len != header->len2)
-        FIXME("len %08lx != len2 %08lx\n", header->len, header->len2);
+        FIXME("len %08x != len2 %08x\n", header->len, header->len2);
     
     if(*pstr)
     {
@@ -287,11 +287,11 @@
     if (!V_DISPATCH(pvar))
       WARN("NULL dispatch pointer\n");
     else
-      ERR("Dispatch variant buffer size calculation failed, HRESULT=0x%lx\n", hr);
+      ERR("Dispatch variant buffer size calculation failed, HRESULT=0x%x\n", hr);
     return 0;
   }
   size += sizeof(ULONG); /* we have to store the buffersize in the stream */
-  TRACE("wire-size extra of dispatch variant is %ld\n", size);
+  TRACE("wire-size extra of dispatch variant is %d\n", size);
   return size;
 }
 
@@ -373,7 +373,7 @@
   IStream_Release(working);
 
   /* size includes the ULONG for the size written above */
-  TRACE("done, size=%ld\n", size);
+  TRACE("done, size=%d\n", size);
   return Buffer + size;
 }
 
@@ -393,7 +393,7 @@
   
   /* get the buffersize */
   memcpy(&size, Buffer, sizeof(ULONG));
-  TRACE("buffersize=%ld\n", size);
+  TRACE("buffersize=%d\n", size);
 
   working_mem = GlobalAlloc(0, size);
   if (!working_mem) return oldpos;
@@ -419,7 +419,7 @@
   IStream_Release(working); /* this also frees the underlying hglobal */
 
   /* size includes the ULONG for the size written above */
-  TRACE("done, processed=%ld bytes\n", size);
+  TRACE("done, processed=%d bytes\n", size);
   return Buffer + size;
 }
 
@@ -540,7 +540,7 @@
         }
     }
     header->clSize = ((Pos - Buffer) + 7) >> 3;
-    TRACE("marshalled size=%ld\n", header->clSize);
+    TRACE("marshalled size=%d\n", header->clSize);
     return Pos;
 }
 
@@ -1100,7 +1100,7 @@
   UINT uArgErr;
   EXCEPINFO ExcepInfo;
 
-  TRACE("(%p)->(%ld,%s,%lx,%x,%p,%p,%p,%p)\n", This,
+  TRACE("(%p)->(%d,%s,%x,%x,%p,%p,%p,%p)\n", This,
         dispIdMember, debugstr_guid(riid),
         lcid, wFlags, pDispParams, pVarResult,
         pExcepInfo, puArgErr);
@@ -1548,7 +1548,7 @@
     DWORD help_context;
     BSTR name, doc_string, help_file;
     HRESULT hr;
-    TRACE("(%p, %08lx, %p, %p, %p, %p)\n", This, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
+    TRACE("(%p, %08x, %p, %p, %p, %p)\n", This, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
 
     /* FIXME: presumably refPtrFlags is supposed to be a bitmask of which ptrs we actually want? */
     hr = ITypeInfo_RemoteGetDocumentation_Proxy(This, memid, 0, &name, &doc_string, &help_context, &help_file);
@@ -1577,7 +1577,7 @@
     DWORD* pdwHelpContext,
     BSTR* pBstrHelpFile)
 {
-    TRACE("(%p, %08lx, %08lx, %p, %p, %p, %p)\n", This, memid, refPtrFlags, pBstrName, pBstrDocString,
+    TRACE("(%p, %08x, %08x, %p, %p, %p, %p)\n", This, memid, refPtrFlags, pBstrName, pBstrDocString,
           pdwHelpContext, pBstrHelpFile);
     return ITypeInfo_GetDocumentation(This, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
 }
diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c
index 836fa69..0abc78c 100644
--- a/dlls/oleaut32/varformat.c
+++ b/dlls/oleaut32/varformat.c
@@ -530,7 +530,7 @@
   DWORD fmt_state = 0;
   LPCWSTR pFormat = lpszFormat;
 
-  TRACE("(%s,%p,%d,%d,%d,0x%08lx,%p)\n", debugstr_w(lpszFormat), rgbTok, cbTok,
+  TRACE("(%s,%p,%d,%d,%d,0x%08x,%p)\n", debugstr_w(lpszFormat), rgbTok, cbTok,
         nFirstDay, nFirstWeek, lcid, pcbActual);
 
   if (!rgbTok ||
@@ -1201,7 +1201,7 @@
   const BYTE* pToken = NULL;
   HRESULT hRes = S_OK;
 
-  TRACE("(%p->(%s%s),%s,%p,0x%08lx,%p,0x%08lx)\n", pVarIn, debugstr_VT(pVarIn),
+  TRACE("(%p->(%s%s),%s,%p,0x%08x,%p,0x%08x)\n", pVarIn, debugstr_VT(pVarIn),
         debugstr_VF(pVarIn), debugstr_w(lpszFormat), rgbTok, dwFlags, pbstrOut,
         lcid);
 
@@ -1535,7 +1535,7 @@
   const BYTE* pToken = NULL;
   HRESULT hRes;
 
-  TRACE("(%p->(%s%s),%s,%p,0x%08lx,%p,0x%08lx)\n", pVarIn, debugstr_VT(pVarIn),
+  TRACE("(%p->(%s%s),%s,%p,0x%08x,%p,0x%08x)\n", pVarIn, debugstr_VT(pVarIn),
         debugstr_VF(pVarIn), debugstr_w(lpszFormat), rgbTok, dwFlags, pbstrOut,
         lcid);
 
@@ -1869,7 +1869,7 @@
   BOOL bUpper = FALSE;
   HRESULT hRes = S_OK;
 
-  TRACE("(%p->(%s%s),%s,%p,0x%08lx,%p,0x%08lx)\n", pVarIn, debugstr_VT(pVarIn),
+  TRACE("(%p->(%s%s),%s,%p,0x%08x,%p,0x%08x)\n", pVarIn, debugstr_VT(pVarIn),
         debugstr_VF(pVarIn), debugstr_w(lpszFormat), rgbTok, dwFlags, pbstrOut,
         lcid);
 
@@ -1996,7 +1996,7 @@
   VARIANT vTmp;
   HRESULT hres;
 
-  TRACE("(%p,%s,%p,%lx,%p,0x%08lx)\n", pVarIn, debugstr_w(lpszFormat),
+  TRACE("(%p,%s,%p,%x,%p,0x%08x)\n", pVarIn, debugstr_w(lpszFormat),
           rgbTok, dwFlags, pbstrOut, lcid);
 
   if (!pbstrOut)
@@ -2083,7 +2083,7 @@
   BYTE buff[256];
   HRESULT hres;
 
-  TRACE("(%p->(%s%s),%s,%d,%d,0x%08lx,%p)\n", pVarIn, debugstr_VT(pVarIn),
+  TRACE("(%p->(%s%s),%s,%d,%d,0x%08x,%p)\n", pVarIn, debugstr_VT(pVarIn),
         debugstr_VF(pVarIn), debugstr_w(lpszFormat), nFirstDay, nFirstWeek,
         dwFlags, pbstrOut);
 
@@ -2096,7 +2096,7 @@
   if (SUCCEEDED(hres))
     hres = VarFormatFromTokens(pVarIn, lpszFormat, buff, dwFlags,
                                pbstrOut, LOCALE_USER_DEFAULT);
-  TRACE("returning 0x%08lx, %s\n", hres, debugstr_w(*pbstrOut));
+  TRACE("returning 0x%08x, %s\n", hres, debugstr_w(*pbstrOut));
   return hres;
 }
 
@@ -2134,7 +2134,7 @@
   static const WCHAR szEmpty[] = { '\0' };
   const BYTE* lpFmt = NULL;
 
-  TRACE("(%p->(%s%s),%d,0x%08lx,%p)\n", pVarIn, debugstr_VT(pVarIn),
+  TRACE("(%p->(%s%s),%d,0x%08x,%p)\n", pVarIn, debugstr_VT(pVarIn),
         debugstr_VF(pVarIn), nFormat, dwFlags, pbstrOut);
 
   if (!pVarIn || !pbstrOut || nFormat < 0 || nFormat > 4)
@@ -2187,7 +2187,7 @@
   HRESULT hRet;
   VARIANT vStr;
 
-  TRACE("(%p->(%s%s),%d,%d,%d,%d,0x%08lx,%p)\n", pVarIn, debugstr_VT(pVarIn),
+  TRACE("(%p->(%s%s),%d,%d,%d,%d,0x%08x,%p)\n", pVarIn, debugstr_VT(pVarIn),
         debugstr_VF(pVarIn), nDigits, nLeading, nParens, nGrouping, dwFlags, pbstrOut);
 
   if (!pVarIn || !pbstrOut || nDigits > 9)
@@ -2298,7 +2298,7 @@
   HRESULT hRet;
   VARIANT vDbl;
 
-  TRACE("(%p->(%s%s),%d,%d,%d,%d,0x%08lx,%p)\n", pVarIn, debugstr_VT(pVarIn),
+  TRACE("(%p->(%s%s),%d,%d,%d,%d,0x%08x,%p)\n", pVarIn, debugstr_VT(pVarIn),
         debugstr_VF(pVarIn), nDigits, nLeading, nParens, nGrouping,
         dwFlags, pbstrOut);
 
@@ -2372,7 +2372,7 @@
   HRESULT hRet;
   VARIANT vStr;
 
-  TRACE("(%p->(%s%s),%d,%d,%d,%d,0x%08lx,%p)\n", pVarIn, debugstr_VT(pVarIn),
+  TRACE("(%p->(%s%s),%d,%d,%d,%d,0x%08x,%p)\n", pVarIn, debugstr_VT(pVarIn),
         debugstr_VF(pVarIn), nDigits, nLeading, nParens, nGrouping, dwFlags, pbstrOut);
 
   if (!pVarIn || !pbstrOut || nDigits > 9)
@@ -2476,7 +2476,7 @@
     return E_INVALIDARG;
 
   if (dwFlags)
-    FIXME("Does not support dwFlags 0x%lx, ignoring.\n", dwFlags);
+    FIXME("Does not support dwFlags 0x%x, ignoring.\n", dwFlags);
 
   if (fAbbrev)
 	localeValue = LOCALE_SABBREVMONTHNAME1 + iMonth - 1;
@@ -2485,7 +2485,7 @@
 
   size = GetLocaleInfoW(LOCALE_USER_DEFAULT,localeValue, NULL, 0);
   if (!size) {
-    ERR("GetLocaleInfo 0x%lx failed.\n", localeValue);
+    ERR("GetLocaleInfo 0x%x failed.\n", localeValue);
     return HRESULT_FROM_WIN32(GetLastError());
   }
   *pbstrOut = SysAllocStringLen(NULL,size - 1);
@@ -2493,7 +2493,7 @@
     return E_OUTOFMEMORY;
   size = GetLocaleInfoW(LOCALE_USER_DEFAULT,localeValue, *pbstrOut, size);
   if (!size) {
-    ERR("GetLocaleInfo of 0x%lx failed in 2nd stage?!\n", localeValue);
+    ERR("GetLocaleInfo of 0x%x failed in 2nd stage?!\n", localeValue);
     SysFreeString(*pbstrOut);
     return HRESULT_FROM_WIN32(GetLastError());
   }
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index 3d1e67c..e0afe44 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -85,7 +85,7 @@
   VARTYPE vtFrom =  V_TYPE(ps);
   DWORD dwFlags = 0;
 
-  TRACE("(%p->(%s%s),0x%08lx,0x%04x,%p->(%s%s),%s%s)\n", pd, debugstr_VT(pd),
+  TRACE("(%p->(%s%s),0x%08x,0x%04x,%p->(%s%s),%s%s)\n", pd, debugstr_VT(pd),
         debugstr_VF(pd), lcid, wFlags, ps, debugstr_VT(ps), debugstr_VF(ps),
         debugstr_vt(vt), debugstr_vf(vt));
 
@@ -893,7 +893,7 @@
   if (pSrc != pvargSrc)
     VariantClear(pSrc);
 
-  TRACE("returning 0x%08lx, %p->(%s%s)\n", hres, pvargDest,
+  TRACE("returning 0x%08x, %p->(%s%s)\n", hres, pvargDest,
         debugstr_VT(pvargDest), debugstr_VF(pvargDest));
   return hres;
 }
@@ -948,7 +948,7 @@
 {
   HRESULT res = S_OK;
 
-  TRACE("(%p->(%s%s),%p->(%s%s),0x%08lx,0x%04x,%s%s)\n", pvargDest,
+  TRACE("(%p->(%s%s),%p->(%s%s),0x%08x,0x%04x,%s%s)\n", pvargDest,
         debugstr_VT(pvargDest), debugstr_VF(pvargDest), pvargSrc,
         debugstr_VT(pvargSrc), debugstr_VF(pvargSrc), lcid, wFlags,
         debugstr_vt(vt), debugstr_vf(vt));
@@ -999,7 +999,7 @@
     }
   }
 
-  TRACE("returning 0x%08lx, %p->(%s%s)\n", res, pvargDest,
+  TRACE("returning 0x%08x, %p->(%s%s)\n", res, pvargDest,
         debugstr_VT(pvargDest), debugstr_VF(pvargDest));
   return res;
 }
@@ -1304,7 +1304,7 @@
   UDATE ud;
   double dateVal;
 
-  TRACE("(%p->%d/%d/%d %d:%d:%d:%d %d %d,0x%08lx,0x%08lx,%p)\n", pUdateIn,
+  TRACE("(%p->%d/%d/%d %d:%d:%d:%d %d %d,0x%08x,0x%08x,%p)\n", pUdateIn,
         pUdateIn->st.wMonth, pUdateIn->st.wDay, pUdateIn->st.wYear,
         pUdateIn->st.wHour, pUdateIn->st.wMinute, pUdateIn->st.wSecond,
         pUdateIn->st.wMilliseconds, pUdateIn->st.wDayOfWeek,
@@ -1384,7 +1384,7 @@
   double datePart, timePart;
   int julianDays;
 
-  TRACE("(%g,0x%08lx,%p)\n", dateIn, dwFlags, lpUdate);
+  TRACE("(%g,0x%08x,%p)\n", dateIn, dwFlags, lpUdate);
 
   if (dateIn <= (DATE_MIN - 1.0) || dateIn >= (DATE_MAX + 1.0))
     return E_INVALIDARG;
@@ -1462,7 +1462,7 @@
     WARN("buffer too small for " #fld "\n"); \
   else \
     if (buff[0]) lpChars->name = buff[0]; \
-  TRACE("lcid 0x%lx, " #name "=%d '%c'\n", lcid, lpChars->name, lpChars->name)
+  TRACE("lcid 0x%x, " #name "=%d '%c'\n", lcid, lpChars->name, lpChars->name)
 
 /* Get the valid number characters for an lcid */
 void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID lcid, DWORD dwFlags)
@@ -1488,7 +1488,7 @@
             break;
     default: WARN("buffer too small for LOCALE_SCURRENCY\n");
   }
-  TRACE("lcid 0x%lx, cCurrencyLocal =%d,%d '%c','%c'\n", lcid, lpChars->cCurrencyLocal,
+  TRACE("lcid 0x%x, cCurrencyLocal =%d,%d '%c','%c'\n", lcid, lpChars->cCurrencyLocal,
         lpChars->cCurrencyLocal2, lpChars->cCurrencyLocal, lpChars->cCurrencyLocal2);
 }
 
@@ -1540,7 +1540,7 @@
   int iMaxDigits = sizeof(rgbTmp) / sizeof(BYTE);
   int cchUsed = 0;
 
-  TRACE("(%s,%ld,0x%08lx,%p,%p)\n", debugstr_w(lpszStr), lcid, dwFlags, pNumprs, rgbDig);
+  TRACE("(%s,%d,0x%08x,%p,%p)\n", debugstr_w(lpszStr), lcid, dwFlags, pNumprs, rgbDig);
 
   if (!pNumprs || !rgbDig)
     return E_INVALIDARG;
@@ -1947,7 +1947,7 @@
 
   int wholeNumberDigits, fractionalDigits, divisor10 = 0, multiplier10 = 0;
 
-  TRACE("(%p,%p,0x%lx,%p)\n", pNumprs, rgbDig, dwVtBits, pVarDst);
+  TRACE("(%p,%p,0x%x,%p)\n", pNumprs, rgbDig, dwVtBits, pVarDst);
 
   if (pNumprs->nBaseShift)
   {
@@ -2046,7 +2046,7 @@
       return S_OK;
     }
 
-    TRACE("Overflow: possible return types: 0x%lx, value: %s\n", dwVtBits, wine_dbgstr_longlong(ul64));
+    TRACE("Overflow: possible return types: 0x%x, value: %s\n", dwVtBits, wine_dbgstr_longlong(ul64));
     return DISP_E_OVERFLOW;
   }
 
@@ -2696,7 +2696,7 @@
     DWORD       xmask;
     HRESULT     rc;
 
-    TRACE("(%p->(%s%s),%p->(%s%s),0x%08lx,0x%08lx)\n", left, debugstr_VT(left),
+    TRACE("(%p->(%s%s),%p->(%s%s),0x%08x,0x%08x)\n", left, debugstr_VT(left),
           debugstr_VF(left), right, debugstr_VT(right), debugstr_VF(right), lcid, flags);
 
     lvt = V_VT(left) & VT_TYPEMASK;
@@ -3244,7 +3244,7 @@
     VariantClear(&lv);
     VariantClear(&rv);
     VariantClear(&tv);
-    TRACE("returning 0x%8lx (variant type %s)\n", hres, debugstr_VT(result));
+    TRACE("returning 0x%8x (variant type %s)\n", hres, debugstr_VT(result));
     return hres;
 }
 
@@ -3415,7 +3415,7 @@
     VariantClear(&lv);
     VariantClear(&rv);
     VariantClear(&tv);
-    TRACE("returning 0x%8lx (variant type %s)\n", hres, debugstr_VT(result));
+    TRACE("returning 0x%8x (variant type %s)\n", hres, debugstr_VT(result));
     return hres;
 }
 
@@ -4825,7 +4825,7 @@
     if (FAILED(hRet))
       V_VT(pVarOut) = VT_EMPTY;
 
-    TRACE("returning 0x%08lx (%s%s),%f\n", hRet, debugstr_VT(pVarOut),
+    TRACE("returning 0x%08x (%s%s),%f\n", hRet, debugstr_VT(pVarOut),
 	debugstr_VF(pVarOut), (V_VT(pVarOut) == VT_R4) ? V_R4(pVarOut) :
 	(V_VT(pVarOut) == VT_R8) ? V_R8(pVarOut) : 0);
 
@@ -5160,14 +5160,14 @@
     rc = VariantChangeType(&lv, left, 0, VT_I8);
     if(FAILED(rc))
     {
-      FIXME("Could not convert left type %d to %d? rc == 0x%lX\n", V_VT(left), VT_I8, rc);
+      FIXME("Could not convert left type %d to %d? rc == 0x%X\n", V_VT(left), VT_I8, rc);
       return rc;
     }
 
     rc = VariantChangeType(&rv, right, 0, VT_I8);
     if(FAILED(rc))
     {
-      FIXME("Could not convert right type %d to %d? rc == 0x%lX\n", V_VT(right), VT_I8, rc);
+      FIXME("Could not convert right type %d to %d? rc == 0x%X\n", V_VT(right), VT_I8, rc);
       return rc;
     }
 
diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c
index 519c9e0..f379517 100644
--- a/dlls/oleaut32/vartype.c
+++ b/dlls/oleaut32/vartype.c
@@ -6258,7 +6258,7 @@
   DWORD dwFormatFlags = dwFlags & LOCALE_NOUSEROVERRIDE;
   WCHAR date[128], *time;
 
-  TRACE("(%g,0x%08lx,0x%08lx,%p)\n", dateIn, lcid, dwFlags, pbstrOut);
+  TRACE("(%g,0x%08x,0x%08x,%p)\n", dateIn, lcid, dwFlags, pbstrOut);
 
   if (!pbstrOut || !VariantTimeToSystemTime(dateIn, &st))
     return E_INVALIDARG;
@@ -6333,7 +6333,7 @@
   DWORD dwResId = IDS_TRUE;
   LANGID langId;
 
-  TRACE("%d,0x%08lx,0x%08lx,%p\n", boolIn, lcid, dwFlags, pbstrOut);
+  TRACE("%d,0x%08x,0x%08x,%p\n", boolIn, lcid, dwFlags, pbstrOut);
 
   if (!pbstrOut)
     return E_INVALIDARG;
@@ -6635,7 +6635,7 @@
 {
     HRESULT hres;
 
-    TRACE("%s,%s,%ld,%08lx\n",
+    TRACE("%s,%s,%d,%08x\n",
      debugstr_wn(pbstrLeft, SysStringLen(pbstrLeft)),
      debugstr_wn(pbstrRight, SysStringLen(pbstrRight)), lcid, dwFlags);
 
@@ -6650,7 +6650,7 @@
 
     hres = CompareStringW(lcid, dwFlags, pbstrLeft, SysStringLen(pbstrLeft),
             pbstrRight, SysStringLen(pbstrRight)) - 1;
-    TRACE("%ld\n", hres);
+    TRACE("%d\n", hres);
     return hres;
 }
 
@@ -6864,7 +6864,7 @@
   else
     v3 = dp->dwValues[offset + 2];
 
-  TRACE("(%ld,%ld,%ld,%ld,%ld)\n", v1, v2, v3, iDate, offset);
+  TRACE("(%d,%d,%d,%d,%d)\n", v1, v2, v3, iDate, offset);
 
   /* If one number must be a month (Because a month name was given), then only
    * consider orders with the month in that position.
@@ -6892,7 +6892,7 @@
   }
 
 VARIANT_MakeDate_Start:
-  TRACE("dwAllOrders is 0x%08lx\n", dwAllOrders);
+  TRACE("dwAllOrders is 0x%08x\n", dwAllOrders);
 
   while (dwAllOrders)
   {
@@ -6924,7 +6924,7 @@
       dwTry = dwAllOrders;
     }
 
-    TRACE("Attempt %ld, dwTry is 0x%08lx\n", dwCount, dwTry);
+    TRACE("Attempt %d, dwTry is 0x%08x\n", dwCount, dwTry);
 
     dwCount++;
     if (!dwTry)
@@ -7013,7 +7013,7 @@
    * But Wine doesn't have/use that key as at the time of writing.
    */
   st->wYear = v3 < 30 ? 2000 + v3 : v3 < 100 ? 1900 + v3 : v3;
-  TRACE("Returning date %ld/%ld/%d\n", v1, v2, st->wYear);
+  TRACE("Returning date %d/%d/%d\n", v1, v2, st->wYear);
   return S_OK;
 }
 
@@ -7081,13 +7081,13 @@
 
   *pdateOut = 0.0;
 
-  TRACE("(%s,0x%08lx,0x%08lx,%p)\n", debugstr_w(strIn), lcid, dwFlags, pdateOut);
+  TRACE("(%s,0x%08x,0x%08x,%p)\n", debugstr_w(strIn), lcid, dwFlags, pdateOut);
 
   memset(&dp, 0, sizeof(dp));
 
   GetLocaleInfoW(lcid, LOCALE_IDATE|LOCALE_RETURN_NUMBER|(dwFlags & LOCALE_NOUSEROVERRIDE),
                  (LPWSTR)&iDate, sizeof(iDate)/sizeof(WCHAR));
-  TRACE("iDate is %ld\n", iDate);
+  TRACE("iDate is %d\n", iDate);
 
   /* Get the month/day/am/pm tokens for this locale */
   for (i = 0; i < sizeof(tokens)/sizeof(tokens[0]); i++)
@@ -7222,7 +7222,7 @@
      * magic here occurs in VARIANT_MakeDate() above, where we determine what
      * each date number must represent in the context of iDate.
      */
-    TRACE("0x%08lx\n", TIMEFLAG(0)|TIMEFLAG(1)|TIMEFLAG(2)|TIMEFLAG(3)|TIMEFLAG(4));
+    TRACE("0x%08x\n", TIMEFLAG(0)|TIMEFLAG(1)|TIMEFLAG(2)|TIMEFLAG(3)|TIMEFLAG(4));
 
     switch (TIMEFLAG(0)|TIMEFLAG(1)|TIMEFLAG(2)|TIMEFLAG(3)|TIMEFLAG(4))
     {