Hi,
License: X11
ChangeLog:
Jon Griffiths <jon_p_griffiths@yahoo.com>
+dlls/shlwapi/regstream.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/regstream.c Sat Apr 26 19:30:04 2003
+++ wine-develop2/dlls/shlwapi/regstream.c Wed May 14 22:40:32 2003
@@ -21,7 +21,6 @@
#include <string.h>
-#include "winerror.h"
#include "winbase.h"
#include "objbase.h"
#include "winreg.h"
@@ -30,9 +29,18 @@
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
+
typedef struct
-{ ICOM_VFIELD(IStream);
- DWORD ref;
+{
+ ICOM_VFIELD(IStream);
+ LONG ref;
HKEY hKey;
LPBYTE pbBuffer;
DWORD dwLength;
@@ -46,19 +54,17 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
+ TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObj);
*ppvObj = NULL;
- if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
- *ppvObj = This;
- else if(IsEqualIID(riid, &IID_IStream)) /*IStream*/
+ if (IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IStream))
+ {
*ppvObj = This;
- if(*ppvObj)
- {
IStream_AddRef((IStream*)*ppvObj);
- TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
+ TRACE("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
@@ -72,7 +78,7 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)->(count=%lu)\n",This, This->ref);
+ TRACE("(%p)->() count=%ld)\n",This, This->ref);
return InterlockedIncrement(&This->ref);
}
@@ -84,11 +90,11 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)->()\n",This);
+ TRACE("(%p)->() count=%ld)\n",This, This->ref);
if (!InterlockedDecrement(&This->ref))
{
- TRACE(" destroying SHReg IStream (%p)\n",This);
+ TRACE("Destroying ISHRegStream %p\n", This);
if (This->pbBuffer)
HeapFree(GetProcessHeap(),0,This->pbBuffer);
@@ -111,7 +117,7 @@
DWORD dwBytesToRead, dwBytesLeft;
- TRACE("(%p)->(%p,0x%08lx,%p)\n",This, pv, cb, pcbRead);
+ TRACE("(%p)->(%p,0x%08lX,%p)\n",This, pv, cb, pcbRead);
if (!pv)
return STG_E_INVALIDPOINTER;
@@ -140,7 +146,7 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n",This);
+ TRACE("(%p)->(%p,0x%08lX,%p)\n", This, pv, cb, pcbWritten);
if (pcbWritten)
*pcbWritten = 0;
@@ -155,7 +161,7 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n",This);
+ TRACE("(%p)->(" FS_I64 ",%ld,%p)\n", This, dlibMove.QuadPart, dwOrigin, plibNewPosition);
if (plibNewPosition)
plibNewPosition->QuadPart = 0;
@@ -169,7 +175,7 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n",This);
+ TRACE("(%p)->(" FS_UI64 ")\n", This, libNewSize.QuadPart);
return E_NOTIMPL;
}
@@ -180,7 +186,7 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n",This);
+ TRACE("(%p)->(%p," FS_UI64 ",%p,%p)\n", This, pstm, cb.QuadPart, pcbRead, pcbWritten);
if (pcbRead)
pcbRead->QuadPart = 0;
if (pcbWritten)
@@ -195,8 +201,7 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n",This);
-
+ TRACE("(%p)->(0x%08lX)\n", This, grfCommitFlags);
return E_NOTIMPL;
}
@@ -207,8 +212,7 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n",This);
-
+ TRACE("(%p)->()\n", This);
return E_NOTIMPL;
}
@@ -219,20 +223,18 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n",This);
-
+ TRACE("(%p)->(" FS_UI64 "," FS_UI64 ",%ld)\n", This, libOffset.QuadPart, cb.QuadPart, dwLockType);
return E_NOTIMPL;
}
/*************************************************************************
* IStream_fnStat
*/
-static HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG* pstatstg, DWORD grfStatFlag)
+static HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG* pstatstg, DWORD grfStatFlag)
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n",This);
-
+ TRACE("(%p)->(%p,%ld)\n", This, pstatstg, grfStatFlag);
return E_NOTIMPL;
}
@@ -243,7 +245,7 @@
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n",This);
+ TRACE("(%p)->(%p)\n", This, ppstm);
if (ppstm)
*ppstm = NULL;
return E_NOTIMPL;
@@ -276,7 +278,7 @@
static ULONG WINAPI IStream_fnAddRefDummy(IStream *iface)
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n", This);
+ TRACE("(%p)->()\n", This);
return 2;
}
@@ -286,7 +288,7 @@
static ULONG WINAPI IStream_fnReleaseDummy(IStream *iface)
{
ICOM_THIS(ISHRegStream, iface);
- TRACE("(%p)\n", This);
+ TRACE("(%p)->()\n", This);
return 1;
}
@@ -295,9 +297,11 @@
*/
static HRESULT WINAPI IStream_fnReadDummy(IStream *iface, LPVOID pv, ULONG cb, ULONG* pcbRead)
{
- if (pcbRead)
- *pcbRead = 0;
- return E_NOTIMPL;
+ ICOM_THIS(ISHRegStream, iface);
+ TRACE("(%p)->(%p,0x%08lX,%p)\n",This, pv, cb, pcbRead);
+ if (pcbRead)
+ *pcbRead = 0;
+ return E_NOTIMPL;
}
static struct ICOM_VTABLE(IStream) DummyRegStreamVTable =
@@ -376,7 +380,7 @@
LPBYTE lpBuff = NULL;
DWORD dwLength, dwType;
- TRACE("(%p,%s,%s,0x%08lx)\n", hKey, pszSubkey, pszValue, dwMode);
+ TRACE("(%p,%s,%s,0x%08lX)\n", hKey, pszSubkey, pszValue, dwMode);
/* Open the key, read in binary data and create stream */
if (!RegOpenKeyExA (hKey, pszSubkey, 0, KEY_READ, &hStrKey) &&
@@ -405,7 +409,7 @@
LPBYTE lpBuff = NULL;
DWORD dwLength, dwType;
- TRACE("(%p,%s,%s,0x%08lx)\n", hKey, debugstr_w(pszSubkey),
+ TRACE("(%p,%s,%s,0x%08lX)\n", hKey, debugstr_w(pszSubkey),
debugstr_w(pszValue), dwMode);
/* Open the key, read in binary data and create stream */
@@ -444,7 +448,7 @@
{
IStream *iStream;
- TRACE("(%p,%s,%s,0x%08lx)\n", hkey, pszSubkey, pszValue, dwMode);
+ TRACE("(%p,%s,%s,0x%08lX)\n", hkey, pszSubkey, pszValue, dwMode);
iStream = SHOpenRegStream2A(hkey, pszSubkey, pszValue, dwMode);
return iStream ? iStream : (IStream *)&rsDummyRegStream;
@@ -460,7 +464,7 @@
{
IStream *iStream;
- TRACE("(%p,%s,%s,0x%08lx)\n", hkey, debugstr_w(pszSubkey),
+ TRACE("(%p,%s,%s,0x%08lX)\n", hkey, debugstr_w(pszSubkey),
debugstr_w(pszValue), dwMode);
iStream = SHOpenRegStream2W(hkey, pszSubkey, pszValue, dwMode);
return iStream ? iStream : (IStream *)&rsDummyRegStream;