Sync (35): shlwapi istream.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

License: X11

ChangeLog:

  Jon Griffiths <jon_p_griffiths@yahoo.com>

  +dlls/shlwapi/istream.c
    Fix msvc warnings, standardise TRACEs

=====
"Don't wait for the seas to part, or messiahs to come;
 Don't you sit around and waste this chance..." - Live

jon_p_griffiths@yahoo.com

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
--- wine/dlls/shlwapi/istream.c	Sat Apr 26 19:30:03 2003
+++ wine-develop2/dlls/shlwapi/istream.c	Wed Jul  9 19:51:03 2003
@@ -22,7 +22,6 @@
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
 #include "winbase.h"
-#include "winerror.h"
 #include "winnls.h"
 #define NO_SHLWAPI_REG
 #define NO_SHLWAPI_PATH
@@ -31,11 +30,19 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
+#ifdef __WINE_USE_MSVCRT
+#define FS_I64 "%I64d"
+#define FS_UI64 "%I64u"
+#else
+#define FS_I64 "%lld"
+#define FS_UI64 "%llu"
+#endif
+
 /* Layout of ISHFileStream object */
 typedef struct
 {
   ICOM_VFIELD(IStream);
-  ULONG    ref;
+  ULONG     ref;
   HANDLE   hFile;
   DWORD    dwMode;
   LPOLESTR lpszPath;
@@ -53,7 +60,7 @@
 {
   ICOM_THIS(ISHFileStream, iface);
 
-  TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppvObj);
+  TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObj);
 
   *ppvObj = NULL;
 
@@ -62,9 +69,11 @@
   {
     *ppvObj = This;
 
+    TRACE("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
     IStream_AddRef((IStream*)*ppvObj);
     return S_OK;
   }
+  TRACE("-- Interface: E_NOINTERFACE\n");
   return E_NOINTERFACE;
 }
 
@@ -75,7 +84,7 @@
 {
   ICOM_THIS(ISHFileStream, iface);
 
-  TRACE("(%p)\n", This);
+  TRACE("(%p)->() count=%ld)\n",This, This->ref);
   return InterlockedIncrement(&This->ref);
 }
 
@@ -85,18 +94,20 @@
 static ULONG WINAPI IStream_fnRelease(IStream *iface)
 {
   ICOM_THIS(ISHFileStream, iface);
-  ULONG ulRet;
+  LONG lRet;
 
-  TRACE("(%p)\n", This);
+  TRACE("(%p)->() count=%ld)\n",This, This->ref);
 
-  if (!(ulRet = InterlockedDecrement(&This->ref)))
+  if (!(lRet = InterlockedDecrement(&This->ref)))
   {
+    TRACE("Destroying ISHFileStream %p\n", This);
+
     IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */
     LocalFree((HLOCAL)This->lpszPath);
     CloseHandle(This->hFile);
     HeapFree(GetProcessHeap(), 0, This);
   }
-  return ulRet;
+  return lRet;
 }
 
 /**************************************************************************
@@ -108,7 +119,7 @@
   HRESULT hRet = S_OK;
   DWORD dwRead = 0;
 
-  TRACE("(%p,%p,0x%08lx,%p)\n", This, pv, cb, pcbRead);
+  TRACE("(%p)->(%p,0x%08lX,%p)\n",This, pv, cb, pcbRead);
 
   if (!pv)
     hRet = STG_E_INVALIDPOINTER;
@@ -132,7 +143,7 @@
   HRESULT hRet = S_OK;
   DWORD dwWritten = 0;
 
-  TRACE("(%p,%p,0x%08lx,%p)\n", This, pv, cb, pcbWritten);
+  TRACE("(%p)->(%p,0x%08lX,%p)\n", This, pv, cb, pcbWritten);
 
   if (!pv)
     hRet = STG_E_INVALIDPOINTER;
@@ -158,7 +169,7 @@
   ICOM_THIS(ISHFileStream, iface);
   DWORD dwPos;
 
-  TRACE("(%p,%ld,%ld,%p)\n", This, dlibMove.s.LowPart, dwOrigin, pNewPos);
+  TRACE("(%p)->(" FS_I64 ",%ld,%p)\n", This, dlibMove.QuadPart, dwOrigin, pNewPos);
 
   IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */
   dwPos = SetFilePointer(This->hFile, dlibMove.s.LowPart, NULL, dwOrigin);
@@ -178,7 +189,7 @@
 {
   ICOM_THIS(ISHFileStream, iface);
 
-  TRACE("(%p,%ld)\n", This, libNewSize.s.LowPart);
+  TRACE("(%p)->(" FS_UI64 ")\n", This, libNewSize.QuadPart);
   IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */
   return E_NOTIMPL;
 }
@@ -194,7 +205,7 @@
   ULONGLONG ulSize;
   HRESULT hRet = S_OK;
 
-  TRACE("(%p,%p,%ld,%p,%p)\n", This, pstm, cb.s.LowPart, pcbRead, pcbWritten);
+  TRACE("(%p)->(%p," FS_UI64 ",%p,%p)\n", This, pstm, cb.QuadPart, pcbRead, pcbWritten);
 
   if (pcbRead)
     pcbRead->QuadPart = 0;
@@ -240,7 +251,7 @@
 {
   ICOM_THIS(ISHFileStream, iface);
 
-  TRACE("(%p,%ld)\n", This, grfCommitFlags);
+  TRACE("(%p)->(0x%08lX)\n", This, grfCommitFlags);
   /* Currently unbuffered: This function is not needed */
   return S_OK;
 }
@@ -252,7 +263,7 @@
 {
   ICOM_THIS(ISHFileStream, iface);
 
-  TRACE("(%p)\n", This);
+  TRACE("(%p)->()\n", This);
   return E_NOTIMPL;
 }
 
@@ -263,7 +274,7 @@
                                                  ULARGE_INTEGER cb, DWORD dwLockType)
 {
   ICOM_THIS(ISHFileStream, iface);
-  TRACE("(%p,%ld,%ld,%ld)\n", This, libOffset.s.LowPart, cb.s.LowPart, dwLockType);
+  TRACE("(%p)->(" FS_UI64 "," FS_UI64 ",%ld)\n", This, libOffset.QuadPart, cb.QuadPart, dwLockType);
   return E_NOTIMPL;
 }
 
@@ -277,7 +288,7 @@
   BY_HANDLE_FILE_INFORMATION fi;
   HRESULT hRet = S_OK;
 
-  TRACE("(%p,%p,%ld)\n", This, lpStat, grfStatFlag);
+  TRACE("(%p)->(%p,%ld)\n", This, lpStat, grfStatFlag);
 
   if (!grfStatFlag)
     hRet = STG_E_INVALIDPOINTER;
@@ -312,7 +323,7 @@
 {
   ICOM_THIS(ISHFileStream, iface);
 
-  TRACE("(%p)\n",This);
+  TRACE("(%p)->(%p)\n", This, ppstm);
   if (ppstm)
     *ppstm = NULL;
   return E_NOTIMPL;
@@ -480,7 +491,7 @@
     return E_INVALIDARG;
 
   dwAttr = GetFileAttributesW(lpszPath);
-  if (dwAttr == -1u)
+  if (dwAttr == INVALID_FILE_ATTRIBUTES)
     dwAttr = 0;
 
   return SHCreateStreamOnFileEx(lpszPath, dwMode|STGM_WRITE, dwAttr,

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux