Sync to Wine-20050725:
Robert Shearman <rob@codeweavers.com>
- Marshal return value from IRemUnknown_RemQueryInterface.
- We should be starting with 1 reference.
- IRpcStubBuffer_Disconnect can be called more than once.
- Silence now noisy error messages caused by changes in the way we call
  ipid_to_stubmanager. Move the error message to the one place it is
  needed.
- By-pass the RPC runtime if possible when calling an STA by posting a
  message directly to the apartment window for it to process. Fixes a
  deadlock in InstallShield caused by having to create a thread when
  freeing an object that comes from an STA apartment. Added tests that
  fail without this fix.
- Hack around broken state management so InstallShield works.
- Delete the stub manager outside of the apartment critical section
  because the deletion may require the object to re-enter the
  apartment.
- Always query for the correct stub interface, otherwise we will be
  pointing to the completely wrong object when a proxy does a
  queryinterface.
- Remove assumption that the stub buffer will handle the lifetime of
  the object.
Alex Villacis Lasso <a_villacis@palosanto.com>
- Initialize RegisteredClass properly in CoRegisterClassObject to
  prevent crash in CoRevokeClassObject when accessing (uninitialized)
  pMarshalledData.
Mike McCormack <mike@codeweavers.com>
- Fix gcc 4.0 -Wpointer-sign warnings.
Vitaly Lipatov <lav@etersoft.ru>
- Added some documentation.
Stefan Huehner <stefan@huehner.org>
- Fix some missing-declarations warnings.
Marcus Meissner <meissner@suse.de>
- 16bit interfaces are cdecl, so drop the WINAPI.
- 16bit COM interfaces are cdecl, not WINAPI.
- OleInitializeWOW gets 2 arguments.
- Added OleSetMenuDescriptor16 stub.
Marcus Meissner <marcus@jet.franken.de>
- Implemented IsValidInterface16, CoMemAlloc.
  Added debug to HGLOBALLockBytes16_QueryInterface.
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.spec
Modified: trunk/reactos/lib/ole32/compobj_private.h
Modified: trunk/reactos/lib/ole32/compositemoniker.c
Modified: trunk/reactos/lib/ole32/datacache.c
Modified: trunk/reactos/lib/ole32/defaulthandler.c
Modified: trunk/reactos/lib/ole32/errorinfo.c
Modified: trunk/reactos/lib/ole32/filemoniker.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/ifs.h
Modified: trunk/reactos/lib/ole32/itemmoniker.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/ole16.c
Modified: trunk/reactos/lib/ole32/ole2.c
Modified: trunk/reactos/lib/ole32/ole2.spec
Modified: trunk/reactos/lib/ole32/ole2_16.c
Modified: trunk/reactos/lib/ole32/ole2conv.spec
Modified: trunk/reactos/lib/ole32/ole2nls.spec
Modified: trunk/reactos/lib/ole32/ole2prox.spec
Modified: trunk/reactos/lib/ole32/ole2thk.spec
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_prop.c
Modified: trunk/reactos/lib/ole32/storage.c
Modified: trunk/reactos/lib/ole32/storage.spec
Modified: trunk/reactos/lib/ole32/storage32.c
Modified: trunk/reactos/lib/ole32/storage32.h
Modified: trunk/reactos/lib/ole32/stubmanager.c

Modified: trunk/reactos/lib/ole32/antimoniker.c
--- trunk/reactos/lib/ole32/antimoniker.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/antimoniker.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -49,7 +49,7 @@
      */
     const IROTDataVtbl*  lpvtbl2;  /* VTable relative to the IROTData interface.*/
 
-    ULONG ref; /* reference counter for this object */
+    LONG ref; /* reference counter for this object */
 
 } AntiMonikerImpl;
 

Modified: trunk/reactos/lib/ole32/bindctx.c
--- trunk/reactos/lib/ole32/bindctx.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/bindctx.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -52,7 +52,7 @@
 
     const IBindCtxVtbl *lpVtbl; /* VTable relative to the IBindCtx interface.*/
 
-    ULONG ref; /* reference counter for this object */
+    LONG ref; /* reference counter for this object */
 
     BindCtxObject* bindCtxTable; /* this is a table in which all bounded objects are stored*/
     DWORD          bindCtxTableLastIndex;  /* first free index in the table */

Modified: trunk/reactos/lib/ole32/clipboard.c
--- trunk/reactos/lib/ole32/clipboard.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/clipboard.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -122,7 +122,7 @@
   /*
    * Reference count of this object
    */
-  ULONG                      ref;
+  LONG                       ref;
 };
 
 typedef struct OLEClipbrd OLEClipbrd;
@@ -145,7 +145,7 @@
   /*
    * Reference count of this object
    */
-  DWORD                        ref;
+  LONG                         ref;
 
   /*
    * IUnknown implementation of the parent data object.

Modified: trunk/reactos/lib/ole32/compobj.c
--- trunk/reactos/lib/ole32/compobj.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/compobj.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -1403,6 +1403,8 @@
   newClass->classIdentifier = *rclsid;
   newClass->runContext      = dwClsContext;
   newClass->connectFlags    = flags;
+  newClass->pMarshaledData  = NULL;
+
   /*
    * Use the address of the chain node as the cookie since we are sure it's
    * unique. FIXME: not on 64-bit platforms.

Modified: trunk/reactos/lib/ole32/compobj.spec
--- trunk/reactos/lib/ole32/compobj.spec	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/compobj.spec	2005-08-12 17:19:46 UTC (rev 17332)
@@ -1,218 +1,218 @@
-1 pascal CoBuildVersion() CoBuildVersion
-2 pascal CoInitialize(long) CoInitialize16
-3 pascal CoUninitialize() CoUninitialize16
-4 pascal CoGetMalloc(long ptr) CoGetMalloc16
-5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject16
-6 pascal CoRevokeClassObject(long) CoRevokeClassObject16
-7 pascal CoGetClassObject(ptr long ptr ptr ptr) CoGetClassObject
-8 stub COMARSHALINTERFACE
-9 stub COUNMARSHALINTERFACE
-10 stub COLOADLIBRARY
-11 stub COFREELIBRARY
-12 stub COFREEALLLIBRARIES
-13 pascal CoCreateInstance(ptr ptr long ptr ptr) CoCreateInstance
-14 stub STRINGFROMIID
-15 pascal CoDisconnectObject(ptr long) CoDisconnectObject
-16 stub CORELEASEMARSHALDATA
-17 pascal -ret16 CoFreeUnusedLibraries() CoFreeUnusedLibraries
-18 pascal -ret16 IsEqualGUID(ptr ptr) IsEqualGUID16
-19 pascal StringFromCLSID(ptr ptr) StringFromCLSID16
-20 pascal CLSIDFromString(str ptr) CLSIDFromString16
-21 stub ISVALIDPTRIN
-22 stub ISVALIDPTROUT
-23 stub ISVALIDINTERFACE
-24 stub ISVALIDIID
-25 stub RESULTFROMSCODE
-26 stub GETSCODE
-27 pascal CoRegisterMessageFilter(ptr ptr) CoRegisterMessageFilter16
-28 stub COISHANDLERCONNECTED
-29 stub SHRADDREF
-30 pascal -ret16 CoFileTimeToDosDateTime(ptr ptr ptr) CoFileTimeToDosDateTime16
-31 pascal -ret16 CoDosDateTimeToFileTime(word word ptr) CoDosDateTimeToFileTime16
-32 stub COMARSHALHRESULT
-33 stub COUNMARSHALHRESULT
-34 pascal CoGetCurrentProcess() CoGetCurrentProcess
-35 stub SHRCREATE
-36 stub COISOLE1CLASS
-37 stub _GUID_NULL
-38 stub _IID_IUNKNOWN
-39 stub _IID_ICLASSFACTORY
-40 stub _IID_IMALLOC
-41 stub _IID_IMARSHAL
-42 stub _IID_IRPCCHANNEL
-43 stub _IID_IRPCSTUB
-44 stub _IID_ISTUBMANAGER
-45 stub _IID_IRPCPROXY
-46 stub _IID_IPROXYMANAGER
-47 stub _IID_IPSFACTORY
-48 stub _IID_ILOCKBYTES
-49 stub _IID_ISTORAGE
-50 stub _IID_ISTREAM
-51 stub _IID_IENUMSTATSTG
-52 stub _IID_IBINDCTX
-53 stub _IID_IMONIKER
-54 stub _IID_IRUNNINGOBJECTTABLE
-55 stub _IID_IINTERNALMONIKER
-56 stub _IID_IROOTSTORAGE
-57 stub _IID_IDFRESERVED1
-58 stub _IID_IDFRESERVED2
-59 stub _IID_IDFRESERVED3
-60 stub _IID_IMESSAGEFILTER
-61 pascal CLSIDFromProgID(str ptr) CLSIDFromProgID16
-62 pascal ProgIDFromCLSID(ptr ptr) ProgIDFromCLSID16
-63 pascal CoLockObjectExternal(segptr word word) CoLockObjectExternal16
-64 stub _CLSID_STDMARSHAL
-65 stub COGETTREATASCLASS
-66 stub COTREATASCLASS
-67 stub COGETSTANDARDMARSHAL
-68 stub PROPAGATERESULT
-69 stub IIDFROMSTRING
-70 stub _IID_ISTDMARSHALINFO
-71 pascal CoCreateStandardMalloc(long ptr) CoCreateStandardMalloc16
-72 stub _IID_IEXTERNALCONNECTION
-73 stub COCREATEGUID
-75 stub FNASSERT
-76 pascal StringFromGUID2(ptr ptr word) StringFromGUID2
-77 stub COGETCLASSEXT
-78 stub OLE1CLASSFROMCLSID2
-79 stub CLSIDFROMOLE1CLASS
-80 stub COOPENCLASSKEY
-81 stub GUIDFROMSTRING
-82 pascal CoFileTimeNow(ptr) CoFileTimeNow
-83 stub REMALLOCOID
-84 stub REMFREEOID
-85 stub REMCREATEREMOTEHANDLER
-86 stub REMCONNECTTOOBJECT
-87 stub REMGETINFOFORCID
-88 stub LRPCCALL
-89 stub LRPCDISPATCH
-90 stub LRPCREGISTERMONITOR
-91 stub LRPCREVOKEMONITOR
-92 stub LRPCGETTHREADWINDOW
-93 stub TIMERCALLBACKPROC
-94 pascal LookupETask(ptr ptr) LookupETask16
-95 pascal -ret16 SetETask(word ptr) SetETask16
-96 stub LRPCFREEMONITORDATA
-97 stub REMLOOKUPSHUNK
-98 stub SHRGETSIZE
-99 stub CALLTHKMGRUNINITIALIZE
-100 stub ??0CARRAYFVALUE@@REC@KI@Z
-101 stub ??1CARRAYFVALUE@@REC@XZ
-102 stub ?ASSERTVALID@CARRAYFVALUE@@RFCXXZ
-103 stub ?FREEEXTRA@CARRAYFVALUE@@RECXXZ
-104 stub ?_GETAT@CARRAYFVALUE@@RFCPEXH@Z
-105 stub ?GETSIZE@CARRAYFVALUE@@RFCHXZ
-106 stub ?REMOVEALL@CARRAYFVALUE@@RECXXZ
-107 stub SHRDESTROY
-108 stub ?INDEXOF@CARRAYFVALUE@@RECHPEXII@Z
-109 stub ?INSERTAT@CARRAYFVALUE@@RECHHPEXH@Z
-110 stub COSETSTATE
-111 stub ?REMOVEAT@CARRAYFVALUE@@RECXHH@Z
-112 stub ?SETAT@CARRAYFVALUE@@RECXHPEX@Z
-113 stub ?SETATGROW@CARRAYFVALUE@@RECHHPEX@Z
-114 stub ?SETSIZE@CARRAYFVALUE@@RECHHH@Z
-115 pascal CoGetState(ptr) CoGetState16
-116 pascal DllEntryPoint(long word word word long word) COMPOBJ_DllEntryPoint
-117 stub ?RELEASE@CSTDMALLOC@@VEAKXZ
-118 stub ?ALLOC@CSTDMALLOC@@VEAPEXK@Z
-119 stub SHRRELEASE
-120 stub ?GETASSOCAT@CMAPKEYTOVALUE@@BFCPEUCASSOC@1@PEXIAEI@Z
-121 stub ?SETASSOCKEY@CMAPKEYTOVALUE@@BFCHPEUCASSOC@1@PEXI@Z
-122 stub ??1CMAPKEYTOVALUE@@REC@XZ
-123 stub ?GETASSOCKEYPTR@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@PEPEXPEI@Z
-124 stub ?NEWASSOC@CMAPKEYTOVALUE@@BECPEUCASSOC@1@IPEXI0@Z
-125 stub ?SIZEASSOC@CMAPKEYTOVALUE@@BFCIXZ
-126 stub ?FREEASSOC@CMAPKEYTOVALUE@@BECXPEUCASSOC@1@@Z
-127 stub ?GETSTARTPOSITION@CMAPKEYTOVALUE@@RFCPEXXZ
-128 stub ?GETNEXTASSOC@CMAPKEYTOVALUE@@RFCXPEPEXPEXPEI1@Z
-129 stub ?COMPAREASSOCKEY@CMAPKEYTOVALUE@@BFCHPEUCASSOC@1@PEXI@Z
-130 stub ?REMOVEHKEY@CMAPKEYTOVALUE@@RECHK@Z
-131 stub ?GETHKEY@CMAPKEYTOVALUE@@RFCKPEXI@Z
-132 stub ?GETCOUNT@CMAPKEYTOVALUE@@RFCHXZ
-133 stub ?LOOKUP@CMAPKEYTOVALUE@@RFCHPEXI0@Z
-134 stub ?GETASSOCVALUE@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@PEX@Z
-135 stub ?REMOVEKEY@CMAPKEYTOVALUE@@RECHPEXI@Z
-136 stub ?REMOVEALL@CMAPKEYTOVALUE@@RECXXZ
-137 stub SHRALLOC
-138 stub ?FREEASSOCKEY@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@@Z
-139 stub ?SETAT@CMAPKEYTOVALUE@@RECHPEXI0@Z
-140 stub ?LOOKUPHKEY@CMAPKEYTOVALUE@@RFCHKPEX@Z
-141 stub ?ASSERTVALID@CMAPKEYTOVALUE@@RFCXXZ
-142 stub ?SETASSOCVALUE@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@PEX@Z
-143 stub ?SETATHKEY@CMAPKEYTOVALUE@@RECHKPEX@Z
-144 stub ??0CMAPKEYTOVALUE@@REC@KIIHP7CIPEXI@ZI@Z
-145 stub ?INITHASHTABLE@CMAPKEYTOVALUE@@BECHXZ
-146 stub ?GETASSOCVALUEPTR@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@PEPEX@Z
-147 stub ?LOOKUPADD@CMAPKEYTOVALUE@@RFCHPEXI0@Z
-148 stub MKVDEFAULTHASHKEY
-149 stub DELETE16
-150 stub COMEMCTXOF
-151 stub COMEMALLOC
-152 stub COMEMFREE
-153 stub SHRREALLOC
-154 stub ___EXPORTEDSTUB
-155 stub LRPCREGISTERWIN32SMONITOR
-156 stub MYREMGETINFOFORCID
-157 stub SHRFREE
-158 stub OPNEW16
-159 stub ADDCOINFO
-160 stub CORUNMODALLOOP
-161 stub COHANDLEINCOMINGCALL
-162 stub COSETACKSTATE
-163 stub SHRDIDALLOC
-164 stub ?GETAT@CARRAYFVALUE@@RFCPEXH@Z
-165 stub ?GETUPPERBOUND@CARRAYFVALUE@@RFCHXZ
-166 stub OPDELETE16
-167 stub ?GETSIZEVALUE@CARRAYFVALUE@@RFCHXZ
-168 stub ?PROXY1632ADDREF@@ZAKPEVCPROXY1632@@@Z
-# FIXME: 169 is a duplicate of 97
-169 stub REMLOOKUPSHUNK_dup
-170 stub ?ISEMPTY@CMAPKEYTOVALUE@@RFCHXZ
-171 stub ?FREE@CSTDMALLOC@@VEAXPEX@Z
-172 stub CALLTHKMGRINITIALIZE
-173 stub ?REALLOC@CSTDMALLOC@@VEAPEXPEXK@Z
-174 stub ?SM16RHQI@@ZAPEXPEVCSM16RELEASEHANDLER@@AFUGUID@@PEPEX@Z
-175 stub ?PROXY1632METHOD10@@ZAKPEVCPROXY1632@@@Z
-# FIXME: 176 is a duplicate of 154
-176 stub ___EXPORTEDSTUB_dup
-177 stub ?PROXY1632METHOD20@@ZAKPEVCPROXY1632@@@Z
-178 stub ?PROXY1632METHOD11@@ZAKPEVCPROXY1632@@@Z
-179 stub ?PROXY1632METHOD30@@ZAKPEVCPROXY1632@@@Z
-180 stub ?PROXY1632METHOD21@@ZAKPEVCPROXY1632@@@Z
-181 stub ?PROXY1632METHOD12@@ZAKPEVCPROXY1632@@@Z
-182 stub ?PROXY1632METHOD31@@ZAKPEVCPROXY1632@@@Z
-183 stub ?PROXY1632METHOD22@@ZAKPEVCPROXY1632@@@Z
-184 stub ?PROXY1632METHOD13@@ZAKPEVCPROXY1632@@@Z
-185 stub ?GETSIZE@CSTDMALLOC@@VEAKPEX@Z
-186 stub ?PROXY1632METHOD23@@ZAKPEVCPROXY1632@@@Z
-187 stub ?PROXY1632METHOD14@@ZAKPEVCPROXY1632@@@Z
-188 stub ?PROXY1632METHOD24@@ZAKPEVCPROXY1632@@@Z
-189 stub ?PROXY1632METHOD15@@ZAKPEVCPROXY1632@@@Z
-190 stub ?PROXY1632METHOD25@@ZAKPEVCPROXY1632@@@Z
-191 stub ?PROXY1632METHOD16@@ZAKPEVCPROXY1632@@@Z
-192 stub ?PROXY1632METHOD26@@ZAKPEVCPROXY1632@@@Z
-193 stub ?PROXY1632METHOD17@@ZAKPEVCPROXY1632@@@Z
-194 stub ?PROXY1632METHOD27@@ZAKPEVCPROXY1632@@@Z
-195 stub ?PROXY1632METHOD18@@ZAKPEVCPROXY1632@@@Z
-196 stub ?PROXY1632METHOD28@@ZAKPEVCPROXY1632@@@Z
-197 stub ?ADDREF@CSTDMALLOC@@VEAKXZ
-198 stub ?PROXY1632METHOD19@@ZAKPEVCPROXY1632@@@Z
-199 stub ?PROXY1632METHOD29@@ZAKPEVCPROXY1632@@@Z
-200 stub CALL32INITIALIZE
-201 pascal CALLOBJECTINWOW(ptr ptr) CallObjectInWOW
-203 stub CALLOBJECTINWOWCHECKINIT
-204 stub CALLOBJECTINWOWCHECKTHKMGR
-205 stub CONVERTHR1632
-206 stub CONVERTHR3216
-207 stub ADDAPPCOMPATFLAG
-
-# WINE internal relays (for Win16 interfaces)
-500 cdecl IMalloc16_QueryInterface(ptr ptr ptr) IMalloc16_fnQueryInterface
-501 cdecl IMalloc16_AddRef(ptr) IMalloc16_fnAddRef
-502 cdecl IMalloc16_Release(ptr) IMalloc16_fnRelease
-503 cdecl IMalloc16_Alloc(ptr long) IMalloc16_fnAlloc
-504 cdecl IMalloc16_Realloc(ptr segptr long) IMalloc16_fnRealloc
-505 cdecl IMalloc16_Free(ptr segptr) IMalloc16_fnFree
-506 cdecl IMalloc16_GetSize(ptr segptr) IMalloc16_fnGetSize
-507 cdecl IMalloc16_DidAlloc(ptr segptr) IMalloc16_fnDidAlloc
-508 cdecl IMalloc16_HeapMinimize(ptr) IMalloc16_fnHeapMinimize
+1 pascal CoBuildVersion() CoBuildVersion
+2 pascal CoInitialize(long) CoInitialize16
+3 pascal CoUninitialize() CoUninitialize16
+4 pascal CoGetMalloc(long ptr) CoGetMalloc16
+5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject16
+6 pascal CoRevokeClassObject(long) CoRevokeClassObject16
+7 pascal CoGetClassObject(ptr long ptr ptr ptr) CoGetClassObject
+8 stub COMARSHALINTERFACE
+9 stub COUNMARSHALINTERFACE
+10 stub COLOADLIBRARY
+11 stub COFREELIBRARY
+12 stub COFREEALLLIBRARIES
+13 pascal CoCreateInstance(ptr ptr long ptr ptr) CoCreateInstance
+14 stub STRINGFROMIID
+15 pascal CoDisconnectObject(ptr long) CoDisconnectObject
+16 stub CORELEASEMARSHALDATA
+17 pascal -ret16 CoFreeUnusedLibraries() CoFreeUnusedLibraries
+18 pascal -ret16 IsEqualGUID(ptr ptr) IsEqualGUID16
+19 pascal StringFromCLSID(ptr ptr) StringFromCLSID16
+20 pascal CLSIDFromString(str ptr) CLSIDFromString16
+21 stub ISVALIDPTRIN
+22 stub ISVALIDPTROUT
+23 pascal IsValidInterface(segptr) IsValidInterface16
+24 stub ISVALIDIID
+25 stub RESULTFROMSCODE
+26 stub GETSCODE
+27 pascal CoRegisterMessageFilter(ptr ptr) CoRegisterMessageFilter16
+28 stub COISHANDLERCONNECTED
+29 stub SHRADDREF
+30 pascal -ret16 CoFileTimeToDosDateTime(ptr ptr ptr) CoFileTimeToDosDateTime16
+31 pascal -ret16 CoDosDateTimeToFileTime(word word ptr) CoDosDateTimeToFileTime16
+32 stub COMARSHALHRESULT
+33 stub COUNMARSHALHRESULT
+34 pascal CoGetCurrentProcess() CoGetCurrentProcess
+35 stub SHRCREATE
+36 stub COISOLE1CLASS
+37 stub _GUID_NULL
+38 stub _IID_IUNKNOWN
+39 stub _IID_ICLASSFACTORY
+40 stub _IID_IMALLOC
+41 stub _IID_IMARSHAL
+42 stub _IID_IRPCCHANNEL
+43 stub _IID_IRPCSTUB
+44 stub _IID_ISTUBMANAGER
+45 stub _IID_IRPCPROXY
+46 stub _IID_IPROXYMANAGER
+47 stub _IID_IPSFACTORY
+48 stub _IID_ILOCKBYTES
+49 stub _IID_ISTORAGE
+50 stub _IID_ISTREAM
+51 stub _IID_IENUMSTATSTG
+52 stub _IID_IBINDCTX
+53 stub _IID_IMONIKER
+54 stub _IID_IRUNNINGOBJECTTABLE
+55 stub _IID_IINTERNALMONIKER
+56 stub _IID_IROOTSTORAGE
+57 stub _IID_IDFRESERVED1
+58 stub _IID_IDFRESERVED2
+59 stub _IID_IDFRESERVED3
+60 stub _IID_IMESSAGEFILTER
+61 pascal CLSIDFromProgID(str ptr) CLSIDFromProgID16
+62 pascal ProgIDFromCLSID(ptr ptr) ProgIDFromCLSID16
+63 pascal CoLockObjectExternal(segptr word word) CoLockObjectExternal16
+64 stub _CLSID_STDMARSHAL
+65 stub COGETTREATASCLASS
+66 stub COTREATASCLASS
+67 stub COGETSTANDARDMARSHAL
+68 stub PROPAGATERESULT
+69 stub IIDFROMSTRING
+70 stub _IID_ISTDMARSHALINFO
+71 pascal CoCreateStandardMalloc(long ptr) CoCreateStandardMalloc16
+72 stub _IID_IEXTERNALCONNECTION
+73 stub COCREATEGUID
+75 stub FNASSERT
+76 pascal StringFromGUID2(ptr ptr word) StringFromGUID2
+77 stub COGETCLASSEXT
+78 stub OLE1CLASSFROMCLSID2
+79 stub CLSIDFROMOLE1CLASS
+80 stub COOPENCLASSKEY
+81 stub GUIDFROMSTRING
+82 pascal CoFileTimeNow(ptr) CoFileTimeNow
+83 stub REMALLOCOID
+84 stub REMFREEOID
+85 stub REMCREATEREMOTEHANDLER
+86 stub REMCONNECTTOOBJECT
+87 stub REMGETINFOFORCID
+88 stub LRPCCALL
+89 stub LRPCDISPATCH
+90 stub LRPCREGISTERMONITOR
+91 stub LRPCREVOKEMONITOR
+92 stub LRPCGETTHREADWINDOW
+93 stub TIMERCALLBACKPROC
+94 pascal LookupETask(ptr ptr) LookupETask16
+95 pascal -ret16 SetETask(word ptr) SetETask16
+96 stub LRPCFREEMONITORDATA
+97 stub REMLOOKUPSHUNK
+98 stub SHRGETSIZE
+99 stub CALLTHKMGRUNINITIALIZE
+100 stub ??0CARRAYFVALUE@@REC@KI@Z
+101 stub ??1CARRAYFVALUE@@REC@XZ
+102 stub ?ASSERTVALID@CARRAYFVALUE@@RFCXXZ
+103 stub ?FREEEXTRA@CARRAYFVALUE@@RECXXZ
+104 stub ?_GETAT@CARRAYFVALUE@@RFCPEXH@Z
+105 stub ?GETSIZE@CARRAYFVALUE@@RFCHXZ
+106 stub ?REMOVEALL@CARRAYFVALUE@@RECXXZ
+107 stub SHRDESTROY
+108 stub ?INDEXOF@CARRAYFVALUE@@RECHPEXII@Z
+109 stub ?INSERTAT@CARRAYFVALUE@@RECHHPEXH@Z
+110 stub COSETSTATE
+111 stub ?REMOVEAT@CARRAYFVALUE@@RECXHH@Z
+112 stub ?SETAT@CARRAYFVALUE@@RECXHPEX@Z
+113 stub ?SETATGROW@CARRAYFVALUE@@RECHHPEX@Z
+114 stub ?SETSIZE@CARRAYFVALUE@@RECHHH@Z
+115 pascal CoGetState(ptr) CoGetState16
+116 pascal DllEntryPoint(long word word word long word) COMPOBJ_DllEntryPoint
+117 stub ?RELEASE@CSTDMALLOC@@VEAKXZ
+118 stub ?ALLOC@CSTDMALLOC@@VEAPEXK@Z
+119 stub SHRRELEASE
+120 stub ?GETASSOCAT@CMAPKEYTOVALUE@@BFCPEUCASSOC@1@PEXIAEI@Z
+121 stub ?SETASSOCKEY@CMAPKEYTOVALUE@@BFCHPEUCASSOC@1@PEXI@Z
+122 stub ??1CMAPKEYTOVALUE@@REC@XZ
+123 stub ?GETASSOCKEYPTR@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@PEPEXPEI@Z
+124 stub ?NEWASSOC@CMAPKEYTOVALUE@@BECPEUCASSOC@1@IPEXI0@Z
+125 stub ?SIZEASSOC@CMAPKEYTOVALUE@@BFCIXZ
+126 stub ?FREEASSOC@CMAPKEYTOVALUE@@BECXPEUCASSOC@1@@Z
+127 stub ?GETSTARTPOSITION@CMAPKEYTOVALUE@@RFCPEXXZ
+128 stub ?GETNEXTASSOC@CMAPKEYTOVALUE@@RFCXPEPEXPEXPEI1@Z
+129 stub ?COMPAREASSOCKEY@CMAPKEYTOVALUE@@BFCHPEUCASSOC@1@PEXI@Z
+130 stub ?REMOVEHKEY@CMAPKEYTOVALUE@@RECHK@Z
+131 stub ?GETHKEY@CMAPKEYTOVALUE@@RFCKPEXI@Z
+132 stub ?GETCOUNT@CMAPKEYTOVALUE@@RFCHXZ
+133 stub ?LOOKUP@CMAPKEYTOVALUE@@RFCHPEXI0@Z
+134 stub ?GETASSOCVALUE@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@PEX@Z
+135 stub ?REMOVEKEY@CMAPKEYTOVALUE@@RECHPEXI@Z
+136 stub ?REMOVEALL@CMAPKEYTOVALUE@@RECXXZ
+137 stub SHRALLOC
+138 stub ?FREEASSOCKEY@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@@Z
+139 stub ?SETAT@CMAPKEYTOVALUE@@RECHPEXI0@Z
+140 stub ?LOOKUPHKEY@CMAPKEYTOVALUE@@RFCHKPEX@Z
+141 stub ?ASSERTVALID@CMAPKEYTOVALUE@@RFCXXZ
+142 stub ?SETASSOCVALUE@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@PEX@Z
+143 stub ?SETATHKEY@CMAPKEYTOVALUE@@RECHKPEX@Z
+144 stub ??0CMAPKEYTOVALUE@@REC@KIIHP7CIPEXI@ZI@Z
+145 stub ?INITHASHTABLE@CMAPKEYTOVALUE@@BECHXZ
+146 stub ?GETASSOCVALUEPTR@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@PEPEX@Z
+147 stub ?LOOKUPADD@CMAPKEYTOVALUE@@RFCHPEXI0@Z
+148 stub MKVDEFAULTHASHKEY
+149 stub DELETE16
+150 stub COMEMCTXOF
+151 pascal CoMemAlloc(long long long)
+152 stub COMEMFREE
+153 stub SHRREALLOC
+154 stub ___EXPORTEDSTUB
+155 stub LRPCREGISTERWIN32SMONITOR
+156 stub MYREMGETINFOFORCID
+157 stub SHRFREE
+158 stub OPNEW16
+159 stub ADDCOINFO
+160 stub CORUNMODALLOOP
+161 stub COHANDLEINCOMINGCALL
+162 stub COSETACKSTATE
+163 stub SHRDIDALLOC
+164 stub ?GETAT@CARRAYFVALUE@@RFCPEXH@Z
+165 stub ?GETUPPERBOUND@CARRAYFVALUE@@RFCHXZ
+166 stub OPDELETE16
+167 stub ?GETSIZEVALUE@CARRAYFVALUE@@RFCHXZ
+168 stub ?PROXY1632ADDREF@@ZAKPEVCPROXY1632@@@Z
+# FIXME: 169 is a duplicate of 97
+169 stub REMLOOKUPSHUNK_dup
+170 stub ?ISEMPTY@CMAPKEYTOVALUE@@RFCHXZ
+171 stub ?FREE@CSTDMALLOC@@VEAXPEX@Z
+172 stub CALLTHKMGRINITIALIZE
+173 stub ?REALLOC@CSTDMALLOC@@VEAPEXPEXK@Z
+174 stub ?SM16RHQI@@ZAPEXPEVCSM16RELEASEHANDLER@@AFUGUID@@PEPEX@Z
+175 stub ?PROXY1632METHOD10@@ZAKPEVCPROXY1632@@@Z
+# FIXME: 176 is a duplicate of 154
+176 stub ___EXPORTEDSTUB_dup
+177 stub ?PROXY1632METHOD20@@ZAKPEVCPROXY1632@@@Z
+178 stub ?PROXY1632METHOD11@@ZAKPEVCPROXY1632@@@Z
+179 stub ?PROXY1632METHOD30@@ZAKPEVCPROXY1632@@@Z
+180 stub ?PROXY1632METHOD21@@ZAKPEVCPROXY1632@@@Z
+181 stub ?PROXY1632METHOD12@@ZAKPEVCPROXY1632@@@Z
+182 stub ?PROXY1632METHOD31@@ZAKPEVCPROXY1632@@@Z
+183 stub ?PROXY1632METHOD22@@ZAKPEVCPROXY1632@@@Z
+184 stub ?PROXY1632METHOD13@@ZAKPEVCPROXY1632@@@Z
+185 stub ?GETSIZE@CSTDMALLOC@@VEAKPEX@Z
+186 stub ?PROXY1632METHOD23@@ZAKPEVCPROXY1632@@@Z
+187 stub ?PROXY1632METHOD14@@ZAKPEVCPROXY1632@@@Z
+188 stub ?PROXY1632METHOD24@@ZAKPEVCPROXY1632@@@Z
+189 stub ?PROXY1632METHOD15@@ZAKPEVCPROXY1632@@@Z
+190 stub ?PROXY1632METHOD25@@ZAKPEVCPROXY1632@@@Z
+191 stub ?PROXY1632METHOD16@@ZAKPEVCPROXY1632@@@Z
+192 stub ?PROXY1632METHOD26@@ZAKPEVCPROXY1632@@@Z
+193 stub ?PROXY1632METHOD17@@ZAKPEVCPROXY1632@@@Z
+194 stub ?PROXY1632METHOD27@@ZAKPEVCPROXY1632@@@Z
+195 stub ?PROXY1632METHOD18@@ZAKPEVCPROXY1632@@@Z
+196 stub ?PROXY1632METHOD28@@ZAKPEVCPROXY1632@@@Z
+197 stub ?ADDREF@CSTDMALLOC@@VEAKXZ
+198 stub ?PROXY1632METHOD19@@ZAKPEVCPROXY1632@@@Z
+199 stub ?PROXY1632METHOD29@@ZAKPEVCPROXY1632@@@Z
+200 stub CALL32INITIALIZE
+201 pascal CALLOBJECTINWOW(ptr ptr) CallObjectInWOW
+203 stub CALLOBJECTINWOWCHECKINIT
+204 stub CALLOBJECTINWOWCHECKTHKMGR
+205 stub CONVERTHR1632
+206 stub CONVERTHR3216
+207 stub ADDAPPCOMPATFLAG
+
+# WINE internal relays (for Win16 interfaces)
+500 cdecl IMalloc16_QueryInterface(ptr ptr ptr) IMalloc16_fnQueryInterface
+501 cdecl IMalloc16_AddRef(ptr) IMalloc16_fnAddRef
+502 cdecl IMalloc16_Release(ptr) IMalloc16_fnRelease
+503 cdecl IMalloc16_Alloc(ptr long) IMalloc16_fnAlloc
+504 cdecl IMalloc16_Realloc(ptr segptr long) IMalloc16_fnRealloc
+505 cdecl IMalloc16_Free(ptr segptr) IMalloc16_fnFree
+506 cdecl IMalloc16_GetSize(ptr segptr) IMalloc16_fnGetSize
+507 cdecl IMalloc16_DidAlloc(ptr segptr) IMalloc16_fnDidAlloc
+508 cdecl IMalloc16_HeapMinimize(ptr) IMalloc16_fnHeapMinimize
Property changes on: trunk/reactos/lib/ole32/compobj.spec
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/reactos/lib/ole32/compobj_private.h
--- trunk/reactos/lib/ole32/compobj_private.h	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/compobj_private.h	2005-08-12 17:19:46 UTC (rev 17332)
@@ -112,7 +112,7 @@
   OXID oxid;                /* object exported ID (RO) */
   OID oid;                  /* object ID (RO) */
   struct list interfaces;   /* imported interfaces (CS cs) */
-  DWORD refs;               /* proxy reference count (LOCK) */
+  LONG refs;                /* proxy reference count (LOCK) */
   CRITICAL_SECTION cs;      /* thread safety for this object and children */
   ULONG sorflags;           /* STDOBJREF flags (RO) */
   IRemUnknown *remunk;      /* proxy to IRemUnknown used for lifecycle management (CS cs) */
@@ -124,12 +124,12 @@
 {
   struct list entry;       
 
-  DWORD refs;              /* refcount of the apartment (LOCK) */
+  LONG  refs;              /* refcount of the apartment (LOCK) */
   DWORD model;             /* threading model (RO) */
   DWORD tid;               /* thread id (RO) */
   HANDLE thread;           /* thread handle (RO) */
   OXID oxid;               /* object exporter ID (RO) */
-  DWORD ipidc;             /* interface pointer ID counter, starts at 1 (LOCK) */
+  LONG ipidc;              /* interface pointer ID counter, starts at 1 (LOCK) */
   HWND win;                /* message window (RO) */
   CRITICAL_SECTION cs;     /* thread safety */
   LPMESSAGEFILTER filter;  /* message filter (CS cs) */

Modified: trunk/reactos/lib/ole32/compositemoniker.c
--- trunk/reactos/lib/ole32/compositemoniker.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/compositemoniker.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -54,7 +54,7 @@
      */
     const IROTDataVtbl*  lpvtbl2;  /* VTable relative to the IROTData interface.*/
 
-    ULONG ref; /* reference counter for this object */
+    LONG ref; /* reference counter for this object */
 
     IMoniker** tabMoniker; /* dynamaic table containing all components (monikers) of this composite moniker */
 
@@ -70,7 +70,7 @@
 
     const IEnumMonikerVtbl *lpVtbl;  /* VTable relative to the IEnumMoniker interface.*/
 
-    ULONG ref; /* reference counter for this object */
+    LONG ref; /* reference counter for this object */
 
     IMoniker** tabMoniker; /* dynamic table containing the enumerated monikers */
 

Modified: trunk/reactos/lib/ole32/datacache.c
--- trunk/reactos/lib/ole32/datacache.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/datacache.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -103,7 +103,7 @@
   /*
    * Reference count of this object
    */
-  ULONG ref;
+  LONG ref;
 
   /*
    * IUnknown implementation of the outer object.

Modified: trunk/reactos/lib/ole32/defaulthandler.c
--- trunk/reactos/lib/ole32/defaulthandler.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/defaulthandler.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -78,7 +78,7 @@
   /*
    * Reference count of this object
    */
-  ULONG ref;
+  LONG ref;
 
   /*
    * IUnknown implementation of the outer object.

Modified: trunk/reactos/lib/ole32/errorinfo.c
--- trunk/reactos/lib/ole32/errorinfo.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/errorinfo.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -131,7 +131,7 @@
 	const IErrorInfoVtbl           *lpvtei;
 	const ICreateErrorInfoVtbl     *lpvtcei;
 	const ISupportErrorInfoVtbl    *lpvtsei;
-	DWORD				ref;
+	LONG				ref;
 
 	GUID m_Guid;
 	BSTR bstrSource;

Modified: trunk/reactos/lib/ole32/filemoniker.c
--- trunk/reactos/lib/ole32/filemoniker.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/filemoniker.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -53,7 +53,7 @@
      */
     const IROTDataVtbl*  lpvtbl2;  /* VTable relative to the IROTData interface.*/
 
-    ULONG ref; /* reference counter for this object */
+    LONG ref; /* reference counter for this object */
 
     LPOLESTR filePathName; /* path string identified by this filemoniker */
 

Modified: trunk/reactos/lib/ole32/ftmarshal.c
--- trunk/reactos/lib/ole32/ftmarshal.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/ftmarshal.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -38,7 +38,7 @@
 
 typedef struct _FTMarshalImpl {
 	const IUnknownVtbl *lpVtbl;
-	DWORD ref;
+	LONG ref;
 	const IMarshalVtbl *lpvtblFTM;
 
 	IUnknown *pUnkOuter;

Modified: trunk/reactos/lib/ole32/hglobalstream.c
--- trunk/reactos/lib/ole32/hglobalstream.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/hglobalstream.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -60,7 +60,7 @@
   /*
    * Reference count
    */
-  ULONG		     ref;
+  LONG		     ref;
 
   /*
    * Support for the stream

Modified: trunk/reactos/lib/ole32/ifs.c
--- trunk/reactos/lib/ole32/ifs.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/ifs.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -366,7 +366,7 @@
 
 typedef struct {
         const IMallocSpyVtbl *lpVtbl;
-        DWORD ref;
+        LONG ref;
 } _MallocSpy;
 
 /* this is the static object instance */

Modified: trunk/reactos/lib/ole32/ifs.h
--- trunk/reactos/lib/ole32/ifs.h	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/ifs.h	2005-08-12 17:19:46 UTC (rev 17332)
@@ -29,6 +29,11 @@
 typedef LPSTR LPOLESTR16;
 typedef LPCSTR LPCOLESTR16;
 
+#define STDMETHOD16CALLTYPE __cdecl
+#define STDMETHOD16(m) HRESULT (STDMETHOD16CALLTYPE *m)
+#define STDMETHOD16_(t,m) t (STDMETHOD16CALLTYPE *m)
+
+
 /***********************************************************************
  * IMalloc16 interface
  */
@@ -38,16 +43,16 @@
 DECLARE_INTERFACE_(IMalloc16,IUnknown)
 {
     /*** IUnknown methods ***/
-    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
-    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
-    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD16_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD16_(ULONG,Release)(THIS) PURE;
     /*** IMalloc16 methods ***/
-    STDMETHOD_(LPVOID,Alloc)(THIS_ DWORD   cb) PURE;
-    STDMETHOD_(LPVOID,Realloc)(THIS_ LPVOID  pv, DWORD  cb) PURE;
-    STDMETHOD_(void,Free)(THIS_ LPVOID  pv) PURE;
-    STDMETHOD_(DWORD,GetSize)(THIS_ LPVOID  pv) PURE;
-    STDMETHOD_(INT16,DidAlloc)(THIS_ LPVOID  pv) PURE;
-    STDMETHOD_(LPVOID,HeapMinimize)(THIS) PURE;
+    STDMETHOD16_(LPVOID,Alloc)(THIS_ DWORD   cb) PURE;
+    STDMETHOD16_(LPVOID,Realloc)(THIS_ LPVOID  pv, DWORD  cb) PURE;
+    STDMETHOD16_(void,Free)(THIS_ LPVOID  pv) PURE;
+    STDMETHOD16_(DWORD,GetSize)(THIS_ LPVOID  pv) PURE;
+    STDMETHOD16_(INT16,DidAlloc)(THIS_ LPVOID  pv) PURE;
+    STDMETHOD16_(LPVOID,HeapMinimize)(THIS) PURE;
 };
 #undef INTERFACE
 
@@ -63,17 +68,17 @@
 DECLARE_INTERFACE_(ILockBytes16,IUnknown)
 {
     /*** IUnknown methods ***/
-    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
-    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
-    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD16_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD16_(ULONG,Release)(THIS) PURE;
     /*** ILockBytes16 methods ***/
-    STDMETHOD(ReadAt)(THIS_ ULARGE_INTEGER ulOffset, void *pv, ULONG  cb, ULONG *pcbRead) PURE;
-    STDMETHOD(WriteAt)(THIS_ ULARGE_INTEGER ulOffset, const void *pv, ULONG cb, ULONG *pcbWritten) PURE;
-    STDMETHOD(Flush)(THIS) PURE;
-    STDMETHOD(SetSize)(THIS_ ULARGE_INTEGER cb) PURE;
-    STDMETHOD(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER  cb, DWORD dwLockType) PURE;
-    STDMETHOD(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER  cb, DWORD dwLockType) PURE;
-    STDMETHOD(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag) PURE;
+    STDMETHOD16(ReadAt)(THIS_ ULARGE_INTEGER ulOffset, void *pv, ULONG  cb, ULONG *pcbRead) PURE;
+    STDMETHOD16(WriteAt)(THIS_ ULARGE_INTEGER ulOffset, const void *pv, ULONG cb, ULONG *pcbWritten) PURE;
+    STDMETHOD16(Flush)(THIS) PURE;
+    STDMETHOD16(SetSize)(THIS_ ULARGE_INTEGER cb) PURE;
+    STDMETHOD16(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER  cb, DWORD dwLockType) PURE;
+    STDMETHOD16(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER  cb, DWORD dwLockType) PURE;
+    STDMETHOD16(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag) PURE;
 };
 #undef INTERFACE
 
@@ -98,22 +103,22 @@
 DECLARE_INTERFACE_(IStream16,ISequentialStream)
 {
     /*** IUnknown methods ***/
-    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
-    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
-    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD16_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD16_(ULONG,Release)(THIS) PURE;
     /*** ISequentialStream methods ***/
-    STDMETHOD_(HRESULT,Read)(THIS_ void* pv, ULONG cb, ULONG* pcbRead) PURE;
-    STDMETHOD_(HRESULT,Write)(THIS_ const void* pv, ULONG cb, ULONG* pcbWritten) PURE;
+    STDMETHOD16_(HRESULT,Read)(THIS_ void* pv, ULONG cb, ULONG* pcbRead) PURE;
+    STDMETHOD16_(HRESULT,Write)(THIS_ const void* pv, ULONG cb, ULONG* pcbWritten) PURE;
     /*** IStream16 methods ***/
-    STDMETHOD(Seek)(THIS_ LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) PURE;
-    STDMETHOD(SetSize)(THIS_ ULARGE_INTEGER libNewSize) PURE;
-    STDMETHOD(CopyTo)(THIS_ IStream16* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) PURE;
-    STDMETHOD(Commit)(THIS_ DWORD grfCommitFlags) PURE;
-    STDMETHOD(Revert)(THIS) PURE;
-    STDMETHOD(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE;
-    STDMETHOD(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE;
-    STDMETHOD(Stat)(THIS_ STATSTG* pstatstg, DWORD grfStatFlag) PURE;
-    STDMETHOD(Clone)(THIS_ IStream16** ppstm) PURE;
+    STDMETHOD16(Seek)(THIS_ LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) PURE;
+    STDMETHOD16(SetSize)(THIS_ ULARGE_INTEGER libNewSize) PURE;
+    STDMETHOD16(CopyTo)(THIS_ IStream16* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) PURE;
+    STDMETHOD16(Commit)(THIS_ DWORD grfCommitFlags) PURE;
+    STDMETHOD16(Revert)(THIS) PURE;
+    STDMETHOD16(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE;
+    STDMETHOD16(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE;
+    STDMETHOD16(Stat)(THIS_ STATSTG* pstatstg, DWORD grfStatFlag) PURE;
+    STDMETHOD16(Clone)(THIS_ IStream16** ppstm) PURE;
 };
 #undef INTERFACE
 
@@ -125,25 +130,25 @@
 DECLARE_INTERFACE_(IStorage16,IUnknown)
 {
     /*** IUnknown methods ***/
-    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
-    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
-    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD16_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD16_(ULONG,Release)(THIS) PURE;
     /*** IStorage16 methods ***/
-    STDMETHOD_(HRESULT,CreateStream)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream16** ppstm) PURE;
-    STDMETHOD_(HRESULT,OpenStream)(THIS_ LPCOLESTR16 pwcsName, void* reserved1, DWORD grfMode, DWORD reserved2, IStream16** ppstm) PURE;
-    STDMETHOD_(HRESULT,CreateStorage)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage16** ppstg) PURE;
-    STDMETHOD_(HRESULT,OpenStorage)(THIS_ LPCOLESTR16 pwcsName, IStorage16* pstgPriority, DWORD grfMode, SNB16 snbExclude, DWORD reserved, IStorage16** ppstg) PURE;
-    STDMETHOD_(HRESULT,CopyTo)(THIS_ DWORD ciidExclude, const IID* rgiidExclude, SNB16 snbExclude, IStorage16* pstgDest) PURE;
-    STDMETHOD_(HRESULT,MoveElementTo)(THIS_ LPCOLESTR16 pwcsName, IStorage16* pstgDest, LPCOLESTR16 pwcsNewName, DWORD grfFlags) PURE;
-    STDMETHOD_(HRESULT,Commit)(THIS_ DWORD grfCommitFlags) PURE;
-    STDMETHOD_(HRESULT,Revert)(THIS) PURE;
-    STDMETHOD_(HRESULT,EnumElements)(THIS_ DWORD reserved1, void* reserved2, DWORD reserved3, IEnumSTATSTG** ppenum) PURE;
-    STDMETHOD_(HRESULT,DestroyElement)(THIS_ LPCOLESTR16 pwcsName) PURE;
-    STDMETHOD_(HRESULT,RenameElement)(THIS_ LPCOLESTR16 pwcsOldName, LPCOLESTR16 pwcsNewName) PURE;
-    STDMETHOD_(HRESULT,SetElementTimes)(THIS_ LPCOLESTR16 pwcsName, const FILETIME* pctime, const FILETIME* patime, const FILETIME* pmtime) PURE;
-    STDMETHOD_(HRESULT,SetClass)(THIS_ REFCLSID clsid) PURE;
-    STDMETHOD_(HRESULT,SetStateBits)(THIS_ DWORD grfStateBits, DWORD grfMask) PURE;
-    STDMETHOD_(HRESULT,Stat)(THIS_ STATSTG* pstatstg, DWORD grfStatFlag) PURE;
+    STDMETHOD16_(HRESULT,CreateStream)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream16** ppstm) PURE;
+    STDMETHOD16_(HRESULT,OpenStream)(THIS_ LPCOLESTR16 pwcsName, void* reserved1, DWORD grfMode, DWORD reserved2, IStream16** ppstm) PURE;
+    STDMETHOD16_(HRESULT,CreateStorage)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage16** ppstg) PURE;
+    STDMETHOD16_(HRESULT,OpenStorage)(THIS_ LPCOLESTR16 pwcsName, IStorage16* pstgPriority, DWORD grfMode, SNB16 snbExclude, DWORD reserved, IStorage16** ppstg) PURE;
+    STDMETHOD16_(HRESULT,CopyTo)(THIS_ DWORD ciidExclude, const IID* rgiidExclude, SNB16 snbExclude, IStorage16* pstgDest) PURE;
+    STDMETHOD16_(HRESULT,MoveElementTo)(THIS_ LPCOLESTR16 pwcsName, IStorage16* pstgDest, LPCOLESTR16 pwcsNewName, DWORD grfFlags) PURE;
+    STDMETHOD16_(HRESULT,Commit)(THIS_ DWORD grfCommitFlags) PURE;
+    STDMETHOD16_(HRESULT,Revert)(THIS) PURE;
+    STDMETHOD16_(HRESULT,EnumElements)(THIS_ DWORD reserved1, void* reserved2, DWORD reserved3, IEnumSTATSTG** ppenum) PURE;
+    STDMETHOD16_(HRESULT,DestroyElement)(THIS_ LPCOLESTR16 pwcsName) PURE;
+    STDMETHOD16_(HRESULT,RenameElement)(THIS_ LPCOLESTR16 pwcsOldName, LPCOLESTR16 pwcsNewName) PURE;
+    STDMETHOD16_(HRESULT,SetElementTimes)(THIS_ LPCOLESTR16 pwcsName, const FILETIME* pctime, const FILETIME* patime, const FILETIME* pmtime) PURE;
+    STDMETHOD16_(HRESULT,SetClass)(THIS_ REFCLSID clsid) PURE;
+    STDMETHOD16_(HRESULT,SetStateBits)(THIS_ DWORD grfStateBits, DWORD grfMask) PURE;
+    STDMETHOD16_(HRESULT,Stat)(THIS_ STATSTG* pstatstg, DWORD grfStatFlag) PURE;
 };
 #undef INTERFACE
 

Modified: trunk/reactos/lib/ole32/itemmoniker.c
--- trunk/reactos/lib/ole32/itemmoniker.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/itemmoniker.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -52,7 +52,7 @@
      */
     const IROTDataVtbl*  lpvtbl2;  /* VTable relative to the IROTData interface.*/
 
-    ULONG ref; /* reference counter for this object */
+    LONG ref; /* reference counter for this object */
 
     LPOLESTR itemName; /* item name identified by this ItemMoniker */
 

Modified: trunk/reactos/lib/ole32/marshal.c
--- trunk/reactos/lib/ole32/marshal.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/marshal.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -85,18 +85,27 @@
 }
 
 /* creates a new stub manager */
-HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnknown *obj, MSHLFLAGS mshlflags)
+HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnknown *object, MSHLFLAGS mshlflags)
 {
     struct stub_manager *manager;
     struct ifstub       *ifstub;
     BOOL                 tablemarshal;
     IRpcStubBuffer      *stub = NULL;
     HRESULT              hr;
+    IUnknown            *iobject = NULL; /* object of type riid */
 
     hr = apartment_getoxid(apt, &stdobjref->oxid);
     if (hr != S_OK)
         return hr;
 
+    hr = IUnknown_QueryInterface(object, riid, (void **)&iobject);
+    if (hr != S_OK)
+    {
+        ERR("object doesn't expose interface %s, failing with error 0x%08lx\n",
+            debugstr_guid(riid), hr);
+        return E_NOINTERFACE;
+    }
+  
     /* IUnknown doesn't require a stub buffer, because it never goes out on
      * the wire */
     if (!IsEqualIID(riid, &IID_IUnknown))
@@ -107,19 +116,19 @@
         if (hr != S_OK)
         {
             ERR("couldn't get IPSFactory buffer for interface %s\n", debugstr_guid(riid));
+            IUnknown_Release(iobject);
             return hr;
         }
     
-        hr = IPSFactoryBuffer_CreateStub(psfb, riid, obj, &stub);
+        hr = IPSFactoryBuffer_CreateStub(psfb, riid, iobject, &stub);
         IPSFactoryBuffer_Release(psfb);
         if (hr != S_OK)
         {
             ERR("Failed to create an IRpcStubBuffer from IPSFactory for %s\n", debugstr_guid(riid));
+            IUnknown_Release(iobject);
             return hr;
         }
     }
-    else /* need to addref object anyway */
-        IUnknown_AddRef(obj);
 
     if (mshlflags & MSHLFLAGS_NOPING)
         stdobjref->flags = SORF_NOPING;
@@ -128,16 +137,17 @@
 
     /* FIXME: what happens if we register an interface twice with different
      * marshaling flags? */
-    if ((manager = get_stub_manager_from_object(apt, obj)))
+    if ((manager = get_stub_manager_from_object(apt, object)))
         TRACE("registering new ifstub on pre-existing manager\n");
     else
     {
         TRACE("constructing new stub manager\n");
 
-        manager = new_stub_manager(apt, obj, mshlflags);
+        manager = new_stub_manager(apt, object, mshlflags);
         if (!manager)
         {
             if (stub) IRpcStubBuffer_Release(stub);
+            IUnknown_Release(iobject);
             return E_OUTOFMEMORY;
         }
     }
@@ -145,10 +155,11 @@
 
     tablemarshal = ((mshlflags & MSHLFLAGS_TABLESTRONG) || (mshlflags & MSHLFLAGS_TABLEWEAK));
 
-    ifstub = stub_manager_new_ifstub(manager, stub, obj, riid);
+    ifstub = stub_manager_new_ifstub(manager, stub, iobject, riid);
+    IUnknown_Release(iobject);
+    if (stub) IRpcStubBuffer_Release(stub);
     if (!ifstub)
     {
-        IRpcStubBuffer_Release(stub);
         stub_manager_int_release(manager);
         /* FIXME: should we do another release to completely destroy the
          * stub manager? */
@@ -763,7 +774,7 @@
 typedef struct _StdMarshalImpl
 {
     const IMarshalVtbl	*lpvtbl;
-    DWORD		ref;
+    LONG		ref;
 
     IID			iid;
     DWORD		dwDestContext;
@@ -826,7 +837,6 @@
     void* pvDestContext, DWORD mshlflags)
 {
     STDOBJREF             stdobjref;
-    IUnknown             *pUnk;  
     ULONG                 res;
     HRESULT               hres;
     APARTMENT            *apt = COM_CurrentApt();
@@ -842,18 +852,7 @@
     /* make sure this apartment can be reached from other threads / processes */
     RPC_StartRemoting(apt);
 
-    hres = IUnknown_QueryInterface((LPUNKNOWN)pv, riid, (LPVOID*)&pUnk);
-    if (hres != S_OK)
-    {
-        ERR("object doesn't expose interface %s, failing with error 0x%08lx\n",
-            debugstr_guid(riid), hres);
-        return E_NOINTERFACE;
-    }
-
-    hres = marshal_object(apt, &stdobjref, riid, pUnk, mshlflags);
-  
-    IUnknown_Release(pUnk);
-  
+    hres = marshal_object(apt, &stdobjref, riid, (IUnknown *)pv, mshlflags);
     if (hres)
     {
         ERR("Failed to create ifstub, hres=0x%lx\n", hres);

Modified: trunk/reactos/lib/ole32/memlockbytes.c
--- trunk/reactos/lib/ole32/memlockbytes.c	2005-08-12 17:07:28 UTC (rev 17331)
+++ trunk/reactos/lib/ole32/memlockbytes.c	2005-08-12 17:19:46 UTC (rev 17332)
@@ -57,7 +57,7 @@
   /*
    * Reference count
    */
-  ULONG        ref;
+  LONG        ref;
 
   /*
    * Support for the LockBytes object
@@ -155,6 +155,24 @@
 
 /******************************************************************************
  *           CreateILockBytesOnHGlobal     [OLE32.@]
+ *
+ * Create a byte array object which is intended to be the compound file foundation.
+ * This object supports a COM implementation of the ILockBytes interface.
+ *
+ * PARAMS
+ *  hGlobal           [ I] Global memory handle
+ *  fDeleteOnRelease  [ I] Whether the handle should be freed when the object is released. 
+ *  ppLkbyt           [ O] Address of ILockBytes pointer that receives
+ *                         the interface pointer to the new byte array object.
+ *
+ * RETURNS
+ *  Success: S_OK
+ *
+ * NOTES
+ *  The supplied ILockBytes pointer can be used by the StgCreateDocfileOnILockBytes
+ *  function to build a compound file on top of this byte array object.
+ *  The ILockBytes interface instance calls the GlobalReAlloc function to grow
+ *  the memory block as required.
  */
 HRESULT WINAPI CreateILockBytesOnHGlobal(HGLOBAL      hGlobal,
                                          BOOL         fDeleteOnRelease,
@@ -176,6 +194,17 @@
 
 /******************************************************************************
  *           GetHGlobalFromILockBytes     [OLE32.@]
+ *
+ * Retrieve a global memory handle to a byte array object created
+ * using the CreateILockBytesOnHGlobal function.
+ *
+ * PARAMS
+ *  plkbyt   [ I]  Pointer to the ILockBytes interface on byte array object
+ *  phglobal [ O]  Address to store a global memory handle
+ * RETURNS
+ *  S_OK          if *phglobal has a correct value
+ *  E_INVALIDARG  if any parameters are invalid
+ *  
  */
 HRESULT WINAPI GetHGlobalFromILockBytes(ILockBytes* plkbyt, HGLOBAL* phglobal)
 {
@@ -224,10 +253,10 @@
 /******************************************************************************
  * This is the constructor for the HGLOBALLockBytesImpl class.
  *
- * Params:
- *    hGlobal          - Handle that will support the stream. can be NULL.
[truncated at 1000 lines; 2292 more skipped]