Sync to Wine-20050419:
Juan Lang <juan_lang@yahoo.com>
- Implement PropSys{Alloc|Free}String, and support BSTRs in
  PropVariant{Clear|Copy} using them.
- Begin implementing IPropertyStorage.
- Add traces, add unit tests for IPropertyStorage, and fix the problems
  they caught.
- Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests.
- add write support to IPropertyStorage, with tests
- misc. cleanups the tests turned up
- Add a comment about byte order, change types to reduce casting and not
  cast away constness.
Vincent Beron <vberon@mecano.gme.usherb.ca>
- Change prototypes so gcc with some warnings doesn't bark.
- Correct and complete some api documentation.
Mike McCormack <mike@codeweavers.com>
- Eliminate forward declarations, make functions static.
- Eliminate casts of the return value of HeapAlloc.
- Remove function prototypes, make functions static.
- StgOpenStorage shouldn't open zero length storage files.
- Remove unnecessary function prototypes.
Robert Shearman <rob@codeweavers.com>
- Add critsec debugging info.
- Move the modal loop called during RPCs into CoWaitForMultipleHandles.
- Use a mutex for long remoting calls to IRemUnknown methods.
- Remove locking in apartment_disconnectproxies as it is not needed.
- Use PostMessage instead of SendMessage so we can run the message
  loop or not as appropriate.
- Rename apartment functions to become more object-oriented.
- Rename register_ifstub to marshal_object to more accurately describe
  what it does.
- Add new function, apartment_getoxid, to prepare for a possible
  future patch where remoting is started on demand.
Jon Griffiths <jon_p_griffiths@yahoo.com>
- Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc).
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Huw Davies <huw@codeweavers.com>
- Don't close reg key if the open failed.
- WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's
  unclear when (if at all) this gets written.
Alexandre Julliard <julliard@winehq.org>
- Fixed a buffer overflow.
Joris Huizer <jorishuizer@planet.nl>
- A few memory checks avoiding memory leaks.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Zero out an invalidated runningObjectTableInstance pointer.
Dimitrie O. Paun <dpaun@rogers.com>
- Remove the need for the non-standard (Close|Delete)MetaFile16().
Troy Rollo <wine@troy.rollo.name>
- ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles.
Modified: trunk/reactos/include/wine/objidl.h
Modified: trunk/reactos/lib/ole32/Makefile.in
Modified: trunk/reactos/lib/ole32/antimoniker.c
Modified: trunk/reactos/lib/ole32/bindctx.c
Modified: trunk/reactos/lib/ole32/clipboard.c
Modified: trunk/reactos/lib/ole32/compobj.c
Modified: trunk/reactos/lib/ole32/compobj_private.h
Modified: trunk/reactos/lib/ole32/compositemoniker.c
Modified: trunk/reactos/lib/ole32/datacache.c
Added: trunk/reactos/lib/ole32/dictionary.c
Added: trunk/reactos/lib/ole32/dictionary.h
Modified: trunk/reactos/lib/ole32/errorinfo.c
Modified: trunk/reactos/lib/ole32/ftmarshal.c
Modified: trunk/reactos/lib/ole32/hglobalstream.c
Modified: trunk/reactos/lib/ole32/ifs.c
Modified: trunk/reactos/lib/ole32/marshal.c
Modified: trunk/reactos/lib/ole32/memlockbytes.c
Modified: trunk/reactos/lib/ole32/memlockbytes16.c
Modified: trunk/reactos/lib/ole32/moniker.c
Modified: trunk/reactos/lib/ole32/ole2.c
Modified: trunk/reactos/lib/ole32/ole2_16.c
Modified: trunk/reactos/lib/ole32/ole2impl.c
Modified: trunk/reactos/lib/ole32/ole32.spec
Modified: trunk/reactos/lib/ole32/oleobj.c
Modified: trunk/reactos/lib/ole32/oleproxy.c
Modified: trunk/reactos/lib/ole32/rpc.c
Modified: trunk/reactos/lib/ole32/stg_bigblockfile.c
Modified: trunk/reactos/lib/ole32/stg_prop.c
Modified: trunk/reactos/lib/ole32/stg_stream.c
Modified: trunk/reactos/lib/ole32/storage32.c
Modified: trunk/reactos/lib/ole32/storage32.h
Modified: trunk/reactos/lib/ole32/stubmanager.c
Modified: trunk/reactos/w32api/include/objbase.h
Modified: trunk/reactos/w32api/include/objidl.h
Modified: trunk/reactos/w32api/include/propidl.h
Modified: trunk/reactos/w32api/include/winerror.h

Modified: trunk/reactos/include/wine/objidl.h
--- trunk/reactos/include/wine/objidl.h	2005-05-05 17:45:00 UTC (rev 15009)
+++ trunk/reactos/include/wine/objidl.h	2005-05-05 18:16:09 UTC (rev 15010)
@@ -111,6 +111,7 @@
 	FILETIME mtime;
 	FILETIME ctime;
 	FILETIME atime;
+	DWORD dwOSVersion;
 } STATPROPSETSTG;
 typedef enum tagEXTCONN {
 	EXTCONN_STRONG=1,
@@ -911,17 +912,17 @@
 	STDMETHOD_(ULONG,AddRef)(THIS) PURE;
 	STDMETHOD_(ULONG,Release)(THIS) PURE;
 	STDMETHOD(ReadMultiple)(THIS_ ULONG,PROPSPEC const*,PROPVARIANT*) PURE;
-	STDMETHOD(WriteMultiple)(THIS_ ULONG,PROPSPEC const*,PROPVARIANT*,PROPID) PURE;
+	STDMETHOD(WriteMultiple)(THIS_ ULONG,const PROPSPEC *,const PROPVARIANT *,PROPID) PURE;
 	STDMETHOD(DeleteMultiple)(THIS_ ULONG,PROPSPEC const*) PURE;
 	STDMETHOD(ReadPropertyNames)(THIS_ ULONG,PROPID const*,LPWSTR*) PURE;
 	STDMETHOD(WritePropertyNames)(THIS_ ULONG,PROPID const*,LPWSTR const*) PURE;
 	STDMETHOD(DeletePropertyNames)(THIS_ ULONG,PROPID const*) PURE;
-	STDMETHOD(SetClass)(THIS_ REFCLSID) PURE;
 	STDMETHOD(Commit)(THIS_ DWORD) PURE;
 	STDMETHOD(Revert)(THIS) PURE;
 	STDMETHOD(Enum)(THIS_ IEnumSTATPROPSTG**) PURE;
-	STDMETHOD(Stat)(THIS_ STATPROPSTG*) PURE;
 	STDMETHOD(SetTimes)(THIS_ FILETIME const*,FILETIME const*,FILETIME const*) PURE;
+	STDMETHOD(SetClass)(THIS_ REFCLSID) PURE;
+	STDMETHOD(Stat)(THIS_ STATPROPSETSTG*) PURE;
 };
 #undef INTERFACE
 
@@ -932,7 +933,7 @@
 	STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
 	STDMETHOD_(ULONG,AddRef)(THIS) PURE;
 	STDMETHOD_(ULONG,Release)(THIS) PURE;
-	STDMETHOD(Create)(THIS_ REFFMTID,CLSID*,DWORD,DWORD,LPPROPERTYSTORAGE*) PURE;
+	STDMETHOD(Create)(THIS_ REFFMTID,const CLSID*,DWORD,DWORD,LPPROPERTYSTORAGE*) PURE;
 	STDMETHOD(Open)(THIS_ REFFMTID,DWORD,LPPROPERTYSTORAGE*) PURE;
 	STDMETHOD(Delete)(THIS_ REFFMTID) PURE;
 	STDMETHOD(Enum)(THIS_ IEnumSTATPROPSETSTG**) PURE;

Modified: trunk/reactos/lib/ole32/Makefile.in
--- trunk/reactos/lib/ole32/Makefile.in	2005-05-05 17:45:00 UTC (rev 15009)
+++ trunk/reactos/lib/ole32/Makefile.in	2005-05-05 18:16:09 UTC (rev 15010)
@@ -5,7 +5,7 @@
 VPATH     = @srcdir@
 MODULE    = ole32.dll
 IMPORTS   = advapi32 user32 gdi32 rpcrt4 kernel32 ntdll
-EXTRALIBS = -luuid
+EXTRALIBS = -luuid $(LIBUNICODE)
 
 C_SRCS = \
 	antimoniker.c \
@@ -15,6 +15,7 @@
 	compositemoniker.c \
 	datacache.c \
 	defaulthandler.c \
+	dictionary.c \
 	errorinfo.c \
 	filemoniker.c \
 	ftmarshal.c \

Modified: trunk/reactos/lib/ole32/antimoniker.c
--- trunk/reactos/lib/ole32/antimoniker.c	2005-05-05 17:45:00 UTC (rev 15009)
+++ trunk/reactos/lib/ole32/antimoniker.c	2005-05-05 18:16:09 UTC (rev 15010)
@@ -29,7 +29,6 @@
 #include "windef.h"
 #include "winbase.h"
 #include "winerror.h"
-#include "wine/unicode.h"
 #include "objbase.h"
 #include "wine/debug.h"
 #include "moniker.h"
@@ -54,135 +53,48 @@
 
 } AntiMonikerImpl;
 
-/********************************************************************************/
-/* AntiMoniker prototype functions :                                            */
 
-/* IUnknown prototype functions */
-static HRESULT WINAPI AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject);
-static ULONG   WINAPI AntiMonikerImpl_AddRef(IMoniker* iface);
-static ULONG   WINAPI AntiMonikerImpl_Release(IMoniker* iface);
-
-/* IPersist prototype functions */
-static HRESULT WINAPI AntiMonikerImpl_GetClassID(IMoniker* iface, CLSID *pClassID);
-
-/* IPersistStream prototype functions */
-static HRESULT WINAPI AntiMonikerImpl_IsDirty(IMoniker* iface);
-static HRESULT WINAPI AntiMonikerImpl_Load(IMoniker* iface, IStream* pStm);
-static HRESULT WINAPI AntiMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty);
-static HRESULT WINAPI AntiMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize);
-
-/* IMoniker prototype functions */
-static HRESULT WINAPI AntiMonikerImpl_BindToObject(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
-static HRESULT WINAPI AntiMonikerImpl_BindToStorage(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
-static HRESULT WINAPI AntiMonikerImpl_Reduce(IMoniker* iface,IBindCtx* pbc, DWORD dwReduceHowFar,IMoniker** ppmkToLeft, IMoniker** ppmkReduced);
-static HRESULT WINAPI AntiMonikerImpl_ComposeWith(IMoniker* iface,IMoniker* pmkRight,BOOL fOnlyIfNotGeneric, IMoniker** ppmkComposite);
-static HRESULT WINAPI AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker);
-static HRESULT WINAPI AntiMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker);
-static HRESULT WINAPI AntiMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash);
-static HRESULT WINAPI AntiMonikerImpl_IsRunning(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, IMoniker* pmkNewlyRunning);
-static HRESULT WINAPI AntiMonikerImpl_GetTimeOfLastChange(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, FILETIME* pAntiTime);
-static HRESULT WINAPI AntiMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk);
-static HRESULT WINAPI AntiMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther, IMoniker** ppmkPrefix);
-static HRESULT WINAPI AntiMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath);
-static HRESULT WINAPI AntiMonikerImpl_GetDisplayName(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR *ppszDisplayName);
-static HRESULT WINAPI AntiMonikerImpl_ParseDisplayName(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR pszDisplayName, ULONG* pchEaten, IMoniker** ppmkOut);
-static HRESULT WINAPI AntiMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys);
-
-/********************************************************************************/
-/* IROTData prototype functions                                                 */
-
-/* IUnknown prototype functions */
-static HRESULT WINAPI AntiMonikerROTDataImpl_QueryInterface(IROTData* iface,REFIID riid,VOID** ppvObject);
-static ULONG   WINAPI AntiMonikerROTDataImpl_AddRef(IROTData* iface);
-static ULONG   WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface);
-
-/* IROTData prototype function */
-static HRESULT WINAPI AntiMonikerROTDataImpl_GetComparaisonData(IROTData* iface,BYTE* pbData,ULONG cbMax,ULONG* pcbData);
-
-/* Local function used by AntiMoniker implementation */
-HRESULT WINAPI AntiMonikerImpl_Construct(AntiMonikerImpl* iface);
-HRESULT WINAPI AntiMonikerImpl_Destroy(AntiMonikerImpl* iface);
-
-/********************************************************************************/
-/* Virtual function table for the AntiMonikerImpl class which  include IPersist,*/
-/* IPersistStream and IMoniker functions.                                       */
-static IMonikerVtbl VT_AntiMonikerImpl =
-{
-    AntiMonikerImpl_QueryInterface,
-    AntiMonikerImpl_AddRef,
-    AntiMonikerImpl_Release,
-    AntiMonikerImpl_GetClassID,
-    AntiMonikerImpl_IsDirty,
-    AntiMonikerImpl_Load,
-    AntiMonikerImpl_Save,
-    AntiMonikerImpl_GetSizeMax,
-    AntiMonikerImpl_BindToObject,
-    AntiMonikerImpl_BindToStorage,
-    AntiMonikerImpl_Reduce,
-    AntiMonikerImpl_ComposeWith,
-    AntiMonikerImpl_Enum,
-    AntiMonikerImpl_IsEqual,
-    AntiMonikerImpl_Hash,
-    AntiMonikerImpl_IsRunning,
-    AntiMonikerImpl_GetTimeOfLastChange,
-    AntiMonikerImpl_Inverse,
-    AntiMonikerImpl_CommonPrefixWith,
-    AntiMonikerImpl_RelativePathTo,
-    AntiMonikerImpl_GetDisplayName,
-    AntiMonikerImpl_ParseDisplayName,
-    AntiMonikerImpl_IsSystemMoniker
-};
-
-/********************************************************************************/
-/* Virtual function table for the IROTData class.                               */
-static IROTDataVtbl VT_ROTDataImpl =
-{
-    AntiMonikerROTDataImpl_QueryInterface,
-    AntiMonikerROTDataImpl_AddRef,
-    AntiMonikerROTDataImpl_Release,
-    AntiMonikerROTDataImpl_GetComparaisonData
-};
-
 /*******************************************************************************
  *        AntiMoniker_QueryInterface
  *******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
+static HRESULT WINAPI
+AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
 {
     AntiMonikerImpl *This = (AntiMonikerImpl *)iface;
 
-  TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
+    TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
 
-  /* Perform a sanity check on the parameters.*/
+    /* Perform a sanity check on the parameters.*/
     if ( (This==0) || (ppvObject==0) )
 	return E_INVALIDARG;
 
-  /* Initialize the return parameter */
-  *ppvObject = 0;
+    /* Initialize the return parameter */
+    *ppvObject = 0;
 
-  /* Compare the riid with the interface IDs implemented by this object.*/
-  if (IsEqualIID(&IID_IUnknown, riid) ||
-      IsEqualIID(&IID_IPersist, riid) ||
-      IsEqualIID(&IID_IPersistStream, riid) ||
-      IsEqualIID(&IID_IMoniker, riid)
-     )
-      *ppvObject = iface;
+    /* Compare the riid with the interface IDs implemented by this object.*/
+    if (IsEqualIID(&IID_IUnknown, riid) ||
+        IsEqualIID(&IID_IPersist, riid) ||
+        IsEqualIID(&IID_IPersistStream, riid) ||
+        IsEqualIID(&IID_IMoniker, riid))
+        *ppvObject = iface;
     else if (IsEqualIID(&IID_IROTData, riid))
         *ppvObject = (IROTData*)&(This->lpvtbl2);
 
-  /* Check that we obtained an interface.*/
+    /* Check that we obtained an interface.*/
     if ((*ppvObject)==0)
         return E_NOINTERFACE;
 
-   /* Query Interface always increases the reference count by one when it is successful */
-  AntiMonikerImpl_AddRef(iface);
+    /* always increase the reference count by one when it is successful */
+    IMoniker_AddRef(iface);
 
-  return S_OK;
+    return S_OK;
 }
 
 /******************************************************************************
  *        AntiMoniker_AddRef
  ******************************************************************************/
-ULONG WINAPI AntiMonikerImpl_AddRef(IMoniker* iface)
+static ULONG WINAPI
+AntiMonikerImpl_AddRef(IMoniker* iface)
 {
     AntiMonikerImpl *This = (AntiMonikerImpl *)iface;
 
@@ -194,7 +106,8 @@
 /******************************************************************************
  *        AntiMoniker_Release
  ******************************************************************************/
-ULONG WINAPI AntiMonikerImpl_Release(IMoniker* iface)
+static ULONG WINAPI
+AntiMonikerImpl_Release(IMoniker* iface)
 {
     AntiMonikerImpl *This = (AntiMonikerImpl *)iface;
     ULONG ref;
@@ -204,7 +117,7 @@
     ref = InterlockedDecrement(&This->ref);
 
     /* destroy the object if there's no more reference on it */
-    if (ref == 0) AntiMonikerImpl_Destroy(This);
+    if (ref == 0) HeapFree(GetProcessHeap(),0,This);
 
     return ref;
 }
@@ -212,7 +125,8 @@
 /******************************************************************************
  *        AntiMoniker_GetClassID
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_GetClassID(IMoniker* iface,CLSID *pClassID)
+static HRESULT WINAPI
+AntiMonikerImpl_GetClassID(IMoniker* iface,CLSID *pClassID)
 {
     TRACE("(%p,%p),stub!\n",iface,pClassID);
 
@@ -227,7 +141,8 @@
 /******************************************************************************
  *        AntiMoniker_IsDirty
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_IsDirty(IMoniker* iface)
+static HRESULT WINAPI
+AntiMonikerImpl_IsDirty(IMoniker* iface)
 {
     /* Note that the OLE-provided implementations of the IPersistStream::IsDirty
        method in the OLE-provided moniker interfaces always return S_FALSE because
@@ -241,7 +156,8 @@
 /******************************************************************************
  *        AntiMoniker_Load
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Load(IMoniker* iface,IStream* pStm)
+static HRESULT WINAPI
+AntiMonikerImpl_Load(IMoniker* iface,IStream* pStm)
 {
     DWORD constant=1,dwbuffer;
     HRESULT res;
@@ -258,7 +174,8 @@
 /******************************************************************************
  *        AntiMoniker_Save
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Save(IMoniker* iface,IStream* pStm,BOOL fClearDirty)
+static HRESULT WINAPI
+AntiMonikerImpl_Save(IMoniker* iface,IStream* pStm,BOOL fClearDirty)
 {
     DWORD constant=1;
     HRESULT res;
@@ -271,9 +188,12 @@
 
 /******************************************************************************
  *        AntiMoniker_GetSizeMax
+ *
+ * PARAMS
+ * pcbSize [out] Pointer to size of stream needed to save object
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_GetSizeMax(IMoniker* iface,
-                                          ULARGE_INTEGER* pcbSize)/* Pointer to size of stream needed to save object */
+static HRESULT WINAPI
+AntiMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
 {
     TRACE("(%p,%p)\n",iface,pcbSize);
 
@@ -282,8 +202,11 @@
 
     /* for more details see AntiMonikerImpl_Save coments */
 
-    /* Normaly the sizemax must be the  size of DWORD ! but I tested this function it ususlly return 16 bytes */
-    /* more than the number of bytes used by AntiMoniker::Save function */
+    /*
+     * Normally the sizemax must be sizeof DWORD, but
+     * I tested this function it usually return 16 bytes
+     * more than the number of bytes used by AntiMoniker::Save function
+     */
     pcbSize->u.LowPart =  sizeof(DWORD)+16;
 
     pcbSize->u.HighPart=0;
@@ -292,39 +215,11 @@
 }
 
 /******************************************************************************
- *         AntiMoniker_Construct (local function)
- *******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Construct(AntiMonikerImpl* This)
-{
-
-    TRACE("(%p)\n",This);
-
-    /* Initialize the virtual fgunction table. */
-    This->lpvtbl1      = &VT_AntiMonikerImpl;
-    This->lpvtbl2      = &VT_ROTDataImpl;
-    This->ref          = 0;
-
-    return S_OK;
-}
-
-/******************************************************************************
- *        AntiMoniker_Destroy (local function)
- *******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Destroy(AntiMonikerImpl* This)
-{
-    TRACE("(%p)\n",This);
-
-    return HeapFree(GetProcessHeap(),0,This);
-}
-
-/******************************************************************************
  *                  AntiMoniker_BindToObject
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_BindToObject(IMoniker* iface,
-                                            IBindCtx* pbc,
-                                            IMoniker* pmkToLeft,
-                                            REFIID riid,
-                                            VOID** ppvResult)
+static HRESULT WINAPI
+AntiMonikerImpl_BindToObject(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft,
+                             REFIID riid, VOID** ppvResult)
 {
     TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult);
     return E_NOTIMPL;
@@ -333,11 +228,9 @@
 /******************************************************************************
  *        AntiMoniker_BindToStorage
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_BindToStorage(IMoniker* iface,
-                                             IBindCtx* pbc,
-                                             IMoniker* pmkToLeft,
-                                             REFIID riid,
-                                             VOID** ppvResult)
+static HRESULT WINAPI
+AntiMonikerImpl_BindToStorage(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft,
+                              REFIID riid, VOID** ppvResult)
 {
     TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult);
     return E_NOTIMPL;
@@ -346,11 +239,9 @@
 /******************************************************************************
  *        AntiMoniker_Reduce
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Reduce(IMoniker* iface,
-                                      IBindCtx* pbc,
-                                      DWORD dwReduceHowFar,
-                                      IMoniker** ppmkToLeft,
-                                      IMoniker** ppmkReduced)
+static HRESULT WINAPI
+AntiMonikerImpl_Reduce(IMoniker* iface, IBindCtx* pbc, DWORD dwReduceHowFar,
+                       IMoniker** ppmkToLeft, IMoniker** ppmkReduced)
 {
     TRACE("(%p,%p,%ld,%p,%p)\n",iface,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced);
 
@@ -366,10 +257,9 @@
 /******************************************************************************
  *        AntiMoniker_ComposeWith
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_ComposeWith(IMoniker* iface,
-                                           IMoniker* pmkRight,
-                                           BOOL fOnlyIfNotGeneric,
-                                           IMoniker** ppmkComposite)
+static HRESULT WINAPI
+AntiMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight,
+                            BOOL fOnlyIfNotGeneric, IMoniker** ppmkComposite)
 {
 
     TRACE("(%p,%p,%d,%p)\n",iface,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
@@ -388,7 +278,8 @@
 /******************************************************************************
  *        AntiMoniker_Enum
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker)
+static HRESULT WINAPI
+AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker)
 {
     TRACE("(%p,%d,%p)\n",iface,fForward,ppenumMoniker);
 
@@ -403,7 +294,8 @@
 /******************************************************************************
  *        AntiMoniker_IsEqual
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker)
+static HRESULT WINAPI
+AntiMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker)
 {
     DWORD mkSys;
 
@@ -423,7 +315,7 @@
 /******************************************************************************
  *        AntiMoniker_Hash
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash)
+static HRESULT WINAPI AntiMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash)
 {
     if (pdwHash==NULL)
         return E_POINTER;
@@ -436,10 +328,9 @@
 /******************************************************************************
  *        AntiMoniker_IsRunning
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_IsRunning(IMoniker* iface,
-                                         IBindCtx* pbc,
-                                         IMoniker* pmkToLeft,
-                                         IMoniker* pmkNewlyRunning)
+static HRESULT WINAPI
+AntiMonikerImpl_IsRunning(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft,
+                          IMoniker* pmkNewlyRunning)
 {
     IRunningObjectTable* rot;
     HRESULT res;
@@ -452,7 +343,7 @@
     res=IBindCtx_GetRunningObjectTable(pbc,&rot);
 
     if (FAILED(res))
-    return res;
+        return res;
 
     res = IRunningObjectTable_IsRunning(rot,iface);
 
@@ -464,7 +355,7 @@
 /******************************************************************************
  *        AntiMoniker_GetTimeOfLastChange
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_GetTimeOfLastChange(IMoniker* iface,
+static HRESULT WINAPI AntiMonikerImpl_GetTimeOfLastChange(IMoniker* iface,
                                                    IBindCtx* pbc,
                                                    IMoniker* pmkToLeft,
                                                    FILETIME* pAntiTime)
@@ -476,7 +367,8 @@
 /******************************************************************************
  *        AntiMoniker_Inverse
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
+static HRESULT WINAPI
+AntiMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
 {
     TRACE("(%p,%p)\n",iface,ppmk);
 
@@ -491,7 +383,8 @@
 /******************************************************************************
  *        AntiMoniker_CommonPrefixWith
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
+static HRESULT WINAPI
+AntiMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
 {
     DWORD mkSys;
 
@@ -514,7 +407,8 @@
 /******************************************************************************
  *        AntiMoniker_RelativePathTo
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath)
+static HRESULT WINAPI
+AntiMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath)
 {
     TRACE("(%p,%p,%p)\n",iface,pmOther,ppmkRelPath);
 
@@ -531,10 +425,9 @@
 /******************************************************************************
  *        AntiMoniker_GetDisplayName
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_GetDisplayName(IMoniker* iface,
-                                              IBindCtx* pbc,
-                                              IMoniker* pmkToLeft,
-                                              LPOLESTR *ppszDisplayName)
+static HRESULT WINAPI
+AntiMonikerImpl_GetDisplayName(IMoniker* iface, IBindCtx* pbc,
+                               IMoniker* pmkToLeft, LPOLESTR *ppszDisplayName)
 {
     static const WCHAR back[]={'\\','.','.',0};
 
@@ -553,7 +446,7 @@
     if (*ppszDisplayName==NULL)
         return E_OUTOFMEMORY;
 
-    strcpyW(*ppszDisplayName,back);
+    lstrcpyW(*ppszDisplayName,back);
 
     return S_OK;
 }
@@ -561,12 +454,10 @@
 /******************************************************************************
  *        AntiMoniker_ParseDisplayName
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_ParseDisplayName(IMoniker* iface,
-                                                IBindCtx* pbc,
-                                                IMoniker* pmkToLeft,
-                                                LPOLESTR pszDisplayName,
-                                                ULONG* pchEaten,
-                                                IMoniker** ppmkOut)
+static HRESULT WINAPI
+AntiMonikerImpl_ParseDisplayName(IMoniker* iface, IBindCtx* pbc,
+                                 IMoniker* pmkToLeft, LPOLESTR pszDisplayName,
+                                 ULONG* pchEaten, IMoniker** ppmkOut)
 {
     TRACE("(%p,%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pszDisplayName,pchEaten,ppmkOut);
     return E_NOTIMPL;
@@ -575,7 +466,8 @@
 /******************************************************************************
  *        AntiMoniker_IsSystemMoniker
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys)
+static HRESULT WINAPI
+AntiMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys)
 {
     TRACE("(%p,%p)\n",iface,pwdMksys);
 
@@ -590,9 +482,9 @@
 /*******************************************************************************
  *        AntiMonikerIROTData_QueryInterface
  *******************************************************************************/
-HRESULT WINAPI AntiMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObject)
+static HRESULT WINAPI
+AntiMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObject)
 {
-
     ICOM_THIS_From_IROTData(IMoniker, iface);
 
     TRACE("(%p,%p,%p)\n",iface,riid,ppvObject);
@@ -603,7 +495,7 @@
 /***********************************************************************
  *        AntiMonikerIROTData_AddRef
  */
-ULONG   WINAPI AntiMonikerROTDataImpl_AddRef(IROTData *iface)
+static ULONG WINAPI AntiMonikerROTDataImpl_AddRef(IROTData *iface)
 {
     ICOM_THIS_From_IROTData(IMoniker, iface);
 
@@ -615,7 +507,7 @@
 /***********************************************************************
  *        AntiMonikerIROTData_Release
  */
-ULONG   WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface)
+static ULONG WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface)
 {
     ICOM_THIS_From_IROTData(IMoniker, iface);
 
@@ -627,16 +519,71 @@
 /******************************************************************************
  *        AntiMonikerIROTData_GetComparaisonData
  ******************************************************************************/
-HRESULT WINAPI AntiMonikerROTDataImpl_GetComparaisonData(IROTData* iface,
-                                                         BYTE* pbData,
-                                                         ULONG cbMax,
-                                                         ULONG* pcbData)
+static HRESULT WINAPI
+AntiMonikerROTDataImpl_GetComparaisonData(IROTData* iface, BYTE* pbData,
+                                          ULONG cbMax, ULONG* pcbData)
 {
     FIXME("(),stub!\n");
     return E_NOTIMPL;
 }
 
+/********************************************************************************/
+/* Virtual function table for the AntiMonikerImpl class which  include IPersist,*/
+/* IPersistStream and IMoniker functions.                                       */
+static IMonikerVtbl VT_AntiMonikerImpl =
+{
+    AntiMonikerImpl_QueryInterface,
+    AntiMonikerImpl_AddRef,
+    AntiMonikerImpl_Release,
+    AntiMonikerImpl_GetClassID,
+    AntiMonikerImpl_IsDirty,
+    AntiMonikerImpl_Load,
+    AntiMonikerImpl_Save,
+    AntiMonikerImpl_GetSizeMax,
+    AntiMonikerImpl_BindToObject,
+    AntiMonikerImpl_BindToStorage,
+    AntiMonikerImpl_Reduce,
+    AntiMonikerImpl_ComposeWith,
+    AntiMonikerImpl_Enum,
+    AntiMonikerImpl_IsEqual,
+    AntiMonikerImpl_Hash,
+    AntiMonikerImpl_IsRunning,
+    AntiMonikerImpl_GetTimeOfLastChange,
+    AntiMonikerImpl_Inverse,
+    AntiMonikerImpl_CommonPrefixWith,
+    AntiMonikerImpl_RelativePathTo,
+    AntiMonikerImpl_GetDisplayName,
+    AntiMonikerImpl_ParseDisplayName,
+    AntiMonikerImpl_IsSystemMoniker
+};
+
+/********************************************************************************/
+/* Virtual function table for the IROTData class.                               */
+static IROTDataVtbl VT_ROTDataImpl =
+{
+    AntiMonikerROTDataImpl_QueryInterface,
+    AntiMonikerROTDataImpl_AddRef,
+    AntiMonikerROTDataImpl_Release,
+    AntiMonikerROTDataImpl_GetComparaisonData
+};
+
 /******************************************************************************
+ *         AntiMoniker_Construct (local function)
+ *******************************************************************************/
+static HRESULT AntiMonikerImpl_Construct(AntiMonikerImpl* This)
+{
+
+    TRACE("(%p)\n",This);
+
+    /* Initialize the virtual fgunction table. */
+    This->lpvtbl1      = &VT_AntiMonikerImpl;
+    This->lpvtbl2      = &VT_ROTDataImpl;
+    This->ref          = 0;
+
+    return S_OK;
+}
+
+/******************************************************************************
  *        CreateAntiMoniker	[OLE32.@]
  ******************************************************************************/
 HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk)
@@ -653,9 +600,8 @@
         return STG_E_INSUFFICIENTMEMORY;
 
     hr = AntiMonikerImpl_Construct(newAntiMoniker);
-
-    if (FAILED(hr)){
-
+    if (FAILED(hr))
+    {
         HeapFree(GetProcessHeap(),0,newAntiMoniker);
         return hr;
     }

Modified: trunk/reactos/lib/ole32/bindctx.c
--- trunk/reactos/lib/ole32/bindctx.c	2005-05-05 17:45:00 UTC (rev 15009)
+++ trunk/reactos/lib/ole32/bindctx.c	2005-05-05 18:16:09 UTC (rev 15010)
@@ -27,7 +27,6 @@
 #include "winerror.h"
 #include "windef.h"
 #include "winbase.h"
-#include "wine/unicode.h"
 #include "objbase.h"
 #include "wine/debug.h"
 
@@ -64,82 +63,42 @@
 } BindCtxImpl;
 
 /* IBindCtx prototype functions : */
+static HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects(IBindCtx*);
+static HRESULT BindCtxImpl_GetObjectIndex(BindCtxImpl*, IUnknown*, LPOLESTR, DWORD *);
 
-/* IUnknown functions*/
-static HRESULT WINAPI BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppvObject);
-static ULONG   WINAPI BindCtxImpl_AddRef(IBindCtx* iface);
-static ULONG   WINAPI BindCtxImpl_Release(IBindCtx* iface);
-/* IBindCtx functions */
-static HRESULT WINAPI BindCtxImpl_RegisterObjectBound(IBindCtx* iface,IUnknown* punk);
-static HRESULT WINAPI BindCtxImpl_RevokeObjectBound(IBindCtx* iface, IUnknown* punk);
-static HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects(IBindCtx* iface);
-static HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts);
-static HRESULT WINAPI BindCtxImpl_GetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts);
-static HRESULT WINAPI BindCtxImpl_GetRunningObjectTable(IBindCtx* iface,IRunningObjectTable** pprot);
-static HRESULT WINAPI BindCtxImpl_RegisterObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown* punk);
-static HRESULT WINAPI BindCtxImpl_GetObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown** punk);
-static HRESULT WINAPI BindCtxImpl_EnumObjectParam(IBindCtx* iface,IEnumString** ppenum);
-static HRESULT WINAPI BindCtxImpl_RevokeObjectParam(IBindCtx* iface,LPOLESTR pszkey);
-/* Local functions*/
-HRESULT WINAPI BindCtxImpl_Construct(BindCtxImpl* This);
-HRESULT WINAPI BindCtxImpl_Destroy(BindCtxImpl* This);
-HRESULT WINAPI BindCtxImpl_GetObjectIndex(BindCtxImpl* This,IUnknown* punk,LPOLESTR pszkey,DWORD *index);
-
-/* Virtual function table for the BindCtx class. */
-static IBindCtxVtbl VT_BindCtxImpl =
-    {
-    BindCtxImpl_QueryInterface,
-    BindCtxImpl_AddRef,
-    BindCtxImpl_Release,
-    BindCtxImpl_RegisterObjectBound,
-    BindCtxImpl_RevokeObjectBound,
-    BindCtxImpl_ReleaseBoundObjects,
-    BindCtxImpl_SetBindOptions,
-    BindCtxImpl_GetBindOptions,
-    BindCtxImpl_GetRunningObjectTable,
-    BindCtxImpl_RegisterObjectParam,
-    BindCtxImpl_GetObjectParam,
-    BindCtxImpl_EnumObjectParam,
-    BindCtxImpl_RevokeObjectParam
-};
-
 /*******************************************************************************
  *        BindCtx_QueryInterface
  *******************************************************************************/
-HRESULT WINAPI BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppvObject)
+static HRESULT WINAPI
+BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppvObject)
 {
-  BindCtxImpl *This = (BindCtxImpl *)iface;
+    BindCtxImpl *This = (BindCtxImpl *)iface;
 
-  TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
+    TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
 
-  /* Perform a sanity check on the parameters.*/
-  if ( (This==0) || (ppvObject==0) )
-      return E_INVALIDARG;
+    /* Perform a sanity check on the parameters.*/
+    if ( (This==0) || (ppvObject==0) )
+        return E_INVALIDARG;
 
-  /* Initialize the return parameter.*/
-  *ppvObject = 0;
+    /* Initialize the return parameter.*/
+    *ppvObject = 0;
 
-  /* Compare the riid with the interface IDs implemented by this object.*/
-  if (IsEqualIID(&IID_IUnknown, riid))
-      *ppvObject = (IBindCtx*)This;
-  else
-      if (IsEqualIID(&IID_IBindCtx, riid))
-          *ppvObject = (IBindCtx*)This;
+    /* Compare the riid with the interface IDs implemented by this object.*/
+    if (IsEqualIID(&IID_IUnknown, riid) ||
+        IsEqualIID(&IID_IBindCtx, riid))
+    {
+        *ppvObject = (IBindCtx*)This;
+        IBindCtx_AddRef(iface);
+        return S_OK;
+    }
 
-  /* Check that we obtained an interface.*/
-  if ((*ppvObject)==0)
-      return E_NOINTERFACE;
-
-   /* Query Interface always increases the reference count by one when it is successful */
-  BindCtxImpl_AddRef(iface);
-
-  return S_OK;
+    return E_NOINTERFACE;
 }
 
 /******************************************************************************
  *       BindCtx_AddRef
  ******************************************************************************/
-ULONG WINAPI BindCtxImpl_AddRef(IBindCtx* iface)
+static ULONG WINAPI BindCtxImpl_AddRef(IBindCtx* iface)
 {
     BindCtxImpl *This = (BindCtxImpl *)iface;
 
@@ -149,9 +108,25 @@
 }
 
 /******************************************************************************
+ *        BindCtx_Destroy    (local function)
+ *******************************************************************************/
+static HRESULT BindCtxImpl_Destroy(BindCtxImpl* This)
+{
+    TRACE("(%p)\n",This);
+
+    /* free the table space memory */
+    HeapFree(GetProcessHeap(),0,This->bindCtxTable);
+
+    /* free the bindctx structure */
+    HeapFree(GetProcessHeap(),0,This);
+
+    return S_OK;
+}
+
+/******************************************************************************
  *        BindCtx_Release
  ******************************************************************************/
-ULONG WINAPI BindCtxImpl_Release(IBindCtx* iface)
+static ULONG WINAPI BindCtxImpl_Release(IBindCtx* iface)
 {
     BindCtxImpl *This = (BindCtxImpl *)iface;
     ULONG ref;
@@ -159,8 +134,8 @@
     TRACE("(%p)\n",This);
 
     ref = InterlockedDecrement(&This->ref);
-
-    if (ref == 0){
+    if (ref == 0)
+    {
         /* release all registered objects */
         BindCtxImpl_ReleaseBoundObjects((IBindCtx*)This);
 
@@ -171,59 +146,10 @@
 
 
 /******************************************************************************
- *         BindCtx_Construct (local function)
- *******************************************************************************/
-HRESULT WINAPI BindCtxImpl_Construct(BindCtxImpl* This)
-{
-    TRACE("(%p)\n",This);
-
-    /* Initialize the virtual function table.*/
-    This->lpVtbl       = &VT_BindCtxImpl;
-    This->ref          = 0;
-
-    /* Initialize the BIND_OPTS2 structure */
-    This->bindOption2.cbStruct  = sizeof(BIND_OPTS2);
-    This->bindOption2.grfFlags = 0;
-    This->bindOption2.grfMode = STGM_READWRITE;
-    This->bindOption2.dwTickCountDeadline = 0;
-
-    This->bindOption2.dwTrackFlags = 0;
-    This->bindOption2.dwClassContext = CLSCTX_SERVER;
-    This->bindOption2.locale = 1033;
-    This->bindOption2.pServerInfo = 0;
-
-    /* Initialize the bindctx table */
-    This->bindCtxTableSize=BLOCK_TAB_SIZE;
-    This->bindCtxTableLastIndex=0;
-    This->bindCtxTable= HeapAlloc(GetProcessHeap(), 0,This->bindCtxTableSize*sizeof(BindCtxObject));
-
-    if (This->bindCtxTable==NULL)
-        return E_OUTOFMEMORY;
-
-    return S_OK;
-}
-
-/******************************************************************************
- *        BindCtx_Destroy    (local function)
- *******************************************************************************/
-HRESULT WINAPI BindCtxImpl_Destroy(BindCtxImpl* This)
-{
-    TRACE("(%p)\n",This);
-
-    /* free the table space memory */
-    HeapFree(GetProcessHeap(),0,This->bindCtxTable);
-
-    /* free the bindctx structure */
-    HeapFree(GetProcessHeap(),0,This);
-
-    return S_OK;
-}
-
-
-/******************************************************************************
  *        BindCtx_RegisterObjectBound
  ******************************************************************************/
-HRESULT WINAPI BindCtxImpl_RegisterObjectBound(IBindCtx* iface,IUnknown* punk)
+static HRESULT WINAPI
+BindCtxImpl_RegisterObjectBound(IBindCtx* iface,IUnknown* punk)
 {
     BindCtxImpl *This = (BindCtxImpl *)iface;
     DWORD lastIndex=This->bindCtxTableLastIndex;
@@ -261,7 +187,8 @@
 /******************************************************************************
  *        BindCtx_RevokeObjectBound
  ******************************************************************************/
-HRESULT WINAPI BindCtxImpl_RevokeObjectBound(IBindCtx* iface, IUnknown* punk)
+static HRESULT WINAPI
+BindCtxImpl_RevokeObjectBound(IBindCtx* iface, IUnknown* punk)
 {
     DWORD index,j;
 
@@ -289,7 +216,8 @@
 /******************************************************************************
  *        BindCtx_ReleaseBoundObjects
  ******************************************************************************/
-HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects(IBindCtx* iface)
+static HRESULT WINAPI
+BindCtxImpl_ReleaseBoundObjects(IBindCtx* iface)
 {
     DWORD i;
 
@@ -312,7 +240,8 @@
 /******************************************************************************
  *        BindCtx_SetBindOptions
  ******************************************************************************/
-HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
+static HRESULT WINAPI
+BindCtxImpl_SetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
 {
     BindCtxImpl *This = (BindCtxImpl *)iface;
 
@@ -333,7 +262,8 @@
 /******************************************************************************
  *        BindCtx_GetBindOptions
  ******************************************************************************/
-HRESULT WINAPI BindCtxImpl_GetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
+static HRESULT WINAPI
+BindCtxImpl_GetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
 {
     BindCtxImpl *This = (BindCtxImpl *)iface;
 
@@ -354,7 +284,8 @@
 /******************************************************************************
  *        BindCtx_GetRunningObjectTable
  ******************************************************************************/
-HRESULT WINAPI BindCtxImpl_GetRunningObjectTable(IBindCtx* iface,IRunningObjectTable** pprot)
+static HRESULT WINAPI
+BindCtxImpl_GetRunningObjectTable(IBindCtx* iface,IRunningObjectTable** pprot)
 {
     HRESULT res;
 
@@ -373,7 +304,8 @@
 /******************************************************************************
  *        BindCtx_RegisterObjectParam
  ******************************************************************************/
-HRESULT WINAPI BindCtxImpl_RegisterObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown* punk)
+static HRESULT WINAPI
+BindCtxImpl_RegisterObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown* punk)
 {
     DWORD index=0;
     BindCtxImpl *This = (BindCtxImpl *)iface;
@@ -399,23 +331,26 @@
 
         This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj=NULL;
 
-    else{
+    else
+    {
 
         This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj=
             HeapAlloc(GetProcessHeap(),0,(sizeof(WCHAR)*(1+lstrlenW(pszkey))));
 
         if (This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj==NULL)
             return E_OUTOFMEMORY;
-        strcpyW(This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj,pszkey);
+        lstrcpyW(This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj,pszkey);
     }
 
     This->bindCtxTableLastIndex++;
 
-    if (This->bindCtxTableLastIndex == This->bindCtxTableSize){ /* table is full ! must be resized */
+    if (This->bindCtxTableLastIndex == This->bindCtxTableSize)
+    {
+        /* table is full ! must be resized */
 
         This->bindCtxTableSize+=BLOCK_TAB_SIZE; /* new table size */
-
-        if (This->bindCtxTableSize > (MAX_TAB_SIZE-BLOCK_TAB_SIZE)){
+        if (This->bindCtxTableSize > (MAX_TAB_SIZE-BLOCK_TAB_SIZE))
+        {
             FIXME("This->bindCtxTableSize: %ld is out of data limite \n",This->bindCtxTableSize);
             return E_FAIL;
         }
@@ -431,7 +366,8 @@
 /******************************************************************************
  *        BindCtx_GetObjectParam
  ******************************************************************************/
-HRESULT WINAPI BindCtxImpl_GetObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown** punk)
+static HRESULT WINAPI
+BindCtxImpl_GetObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnknown** punk)
 {
     DWORD index;
     BindCtxImpl *This = (BindCtxImpl *)iface;
@@ -456,7 +392,8 @@
 /******************************************************************************
  *        BindCtx_RevokeObjectParam
  ******************************************************************************/
-HRESULT WINAPI BindCtxImpl_RevokeObjectParam(IBindCtx* iface,LPOLESTR ppenum)
+static HRESULT WINAPI
+BindCtxImpl_RevokeObjectParam(IBindCtx* iface,LPOLESTR ppenum)
 {
     DWORD index,j;
 
@@ -484,7 +421,8 @@
 /******************************************************************************
  *        BindCtx_EnumObjectParam
  ******************************************************************************/
-HRESULT WINAPI BindCtxImpl_EnumObjectParam(IBindCtx* iface,IEnumString** pszkey)
+static HRESULT WINAPI
+BindCtxImpl_EnumObjectParam(IBindCtx* iface,IEnumString** pszkey)
 {
     FIXME("(%p,%p),stub!\n",iface,pszkey);
[truncated at 1000 lines; 6850 more skipped]