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.

svn path=/trunk/; revision=17332
This commit is contained in:
Gé van Geldorp 2005-08-12 17:19:46 +00:00
parent 5b9aceccd3
commit 7835b350bb
38 changed files with 1139 additions and 1034 deletions

View file

@ -49,7 +49,7 @@ typedef struct AntiMonikerImpl{
*/
const IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
ULONG ref; /* reference counter for this object */
LONG ref; /* reference counter for this object */
} AntiMonikerImpl;

View file

@ -52,7 +52,7 @@ typedef struct BindCtxImpl{
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 */

View file

@ -122,7 +122,7 @@ struct OLEClipbrd
/*
* Reference count of this object
*/
ULONG ref;
LONG ref;
};
typedef struct OLEClipbrd OLEClipbrd;
@ -145,7 +145,7 @@ typedef struct
/*
* Reference count of this object
*/
DWORD ref;
LONG ref;
/*
* IUnknown implementation of the parent data object.

View file

@ -1403,6 +1403,8 @@ HRESULT WINAPI CoRegisterClassObject(
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.

View file

@ -20,7 +20,7 @@
20 pascal CLSIDFromString(str ptr) CLSIDFromString16
21 stub ISVALIDPTRIN
22 stub ISVALIDPTROUT
23 stub ISVALIDINTERFACE
23 pascal IsValidInterface(segptr) IsValidInterface16
24 stub ISVALIDIID
25 stub RESULTFROMSCODE
26 stub GETSCODE
@ -147,7 +147,7 @@
148 stub MKVDEFAULTHASHKEY
149 stub DELETE16
150 stub COMEMCTXOF
151 stub COMEMALLOC
151 pascal CoMemAlloc(long long long)
152 stub COMEMFREE
153 stub SHRREALLOC
154 stub ___EXPORTEDSTUB

View file

@ -112,7 +112,7 @@ struct proxy_manager
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 apartment
{
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) */

View file

@ -54,7 +54,7 @@ typedef struct CompositeMonikerImpl{
*/
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 @@ typedef struct EnumMonikerImpl{
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 */

View file

@ -103,7 +103,7 @@ struct DataCache
/*
* Reference count of this object
*/
ULONG ref;
LONG ref;
/*
* IUnknown implementation of the outer object.

View file

@ -78,7 +78,7 @@ struct DefaultHandler
/*
* Reference count of this object
*/
ULONG ref;
LONG ref;
/*
* IUnknown implementation of the outer object.

View file

@ -131,7 +131,7 @@ typedef struct ErrorInfoImpl
const IErrorInfoVtbl *lpvtei;
const ICreateErrorInfoVtbl *lpvtcei;
const ISupportErrorInfoVtbl *lpvtsei;
DWORD ref;
LONG ref;
GUID m_Guid;
BSTR bstrSource;

View file

@ -53,7 +53,7 @@ typedef struct FileMonikerImpl{
*/
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 */

View file

@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
typedef struct _FTMarshalImpl {
const IUnknownVtbl *lpVtbl;
DWORD ref;
LONG ref;
const IMarshalVtbl *lpvtblFTM;
IUnknown *pUnkOuter;

View file

@ -60,7 +60,7 @@ struct HGLOBALStreamImpl
/*
* Reference count
*/
ULONG ref;
LONG ref;
/*
* Support for the stream

View file

@ -366,7 +366,7 @@ static const IMallocSpyVtbl VT_IMallocSpy;
typedef struct {
const IMallocSpyVtbl *lpVtbl;
DWORD ref;
LONG ref;
} _MallocSpy;
/* this is the static object instance */

View file

@ -29,6 +29,11 @@ typedef CHAR OLECHAR16;
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 @@ typedef LPCSTR LPCOLESTR16;
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 @@ extern LPMALLOC16 IMalloc16_Constructor(void);
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 @@ typedef struct tagSTATSTG16
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 @@ typedef OLECHAR16 **SNB16;
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

View file

@ -52,7 +52,7 @@ typedef struct ItemMonikerImpl{
*/
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 */

View file

@ -85,18 +85,27 @@ inline static HRESULT get_facbuf_for_iid(REFIID riid, IPSFactoryBuffer **facbuf)
}
/* 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 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno
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 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno
/* 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 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno
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 @@ HRESULT apartment_disconnectproxies(struct apartment *apt)
typedef struct _StdMarshalImpl
{
const IMarshalVtbl *lpvtbl;
DWORD ref;
LONG ref;
IID iid;
DWORD dwDestContext;
@ -826,7 +837,6 @@ StdMarshalImpl_MarshalInterface(
void* pvDestContext, DWORD mshlflags)
{
STDOBJREF stdobjref;
IUnknown *pUnk;
ULONG res;
HRESULT hres;
APARTMENT *apt = COM_CurrentApt();
@ -842,18 +852,7 @@ StdMarshalImpl_MarshalInterface(
/* 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);

View file

@ -57,7 +57,7 @@ struct HGLOBALLockBytesImpl
/*
* Reference count
*/
ULONG ref;
LONG ref;
/*
* Support for the LockBytes object
@ -155,6 +155,24 @@ static const ILockBytesVtbl HGLOBALLockBytesImpl_Vtbl =
/******************************************************************************
* 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 @@ HRESULT WINAPI CreateILockBytesOnHGlobal(HGLOBAL hGlobal,
/******************************************************************************
* 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,9 +253,9 @@ HRESULT WINAPI GetHGlobalFromILockBytes(ILockBytes* plkbyt, HGLOBAL* phglobal)
/******************************************************************************
* This is the constructor for the HGLOBALLockBytesImpl class.
*
* Params:
* hGlobal - Handle that will support the stream. can be NULL.
* fDeleteOnRelease - Flag set to TRUE if the HGLOBAL will be released
* PARAMS
* hGlobal [ I] Handle that will support the stream. can be NULL.
* fDeleteOnRelease [ I] Flag set to TRUE if the HGLOBAL will be released
* when the IStream object is destroyed.
*/
HGLOBALLockBytesImpl* HGLOBALLockBytesImpl_Construct(HGLOBAL hGlobal,

View file

@ -53,7 +53,7 @@ struct HGLOBALLockBytesImpl16
* since we want to cast this in an ILockBytes pointer
*/
const ILockBytes16Vtbl *lpVtbl;
ULONG ref;
LONG ref;
/*
* Support for the LockBytes object
@ -73,61 +73,6 @@ struct HGLOBALLockBytesImpl16
typedef struct HGLOBALLockBytesImpl16 HGLOBALLockBytesImpl16;
HGLOBALLockBytesImpl16* HGLOBALLockBytesImpl16_Construct(
HGLOBAL16 hGlobal,
BOOL16 fDeleteOnRelease);
void HGLOBALLockBytesImpl16_Destroy(HGLOBALLockBytesImpl16* This);
HRESULT WINAPI HGLOBALLockBytesImpl16_QueryInterface(
ILockBytes16* iface,
REFIID riid, /* [in] */
void** ppvObject); /* [out][iid_is] */
ULONG WINAPI HGLOBALLockBytesImpl16_AddRef(
ILockBytes16* iface);
ULONG WINAPI HGLOBALLockBytesImpl16_Release(
ILockBytes16* iface);
HRESULT WINAPI HGLOBALLockBytesImpl16_ReadAt(
ILockBytes16* iface,
ULARGE_INTEGER ulOffset, /* [in] */
void* pv, /* [out][length_is][size_is] */
ULONG cb, /* [in] */
ULONG* pcbRead); /* [out] */
HRESULT WINAPI HGLOBALLockBytesImpl16_WriteAt(
ILockBytes16* iface,
ULARGE_INTEGER ulOffset, /* [in] */
const void* pv, /* [in][size_is] */
ULONG cb, /* [in] */
ULONG* pcbWritten); /* [out] */
HRESULT WINAPI HGLOBALLockBytesImpl16_Flush(
ILockBytes16* iface);
HRESULT WINAPI HGLOBALLockBytesImpl16_SetSize(
ILockBytes16* iface,
ULARGE_INTEGER libNewSize); /* [in] */
HRESULT WINAPI HGLOBALLockBytesImpl16_LockRegion(
ILockBytes16* iface,
ULARGE_INTEGER libOffset, /* [in] */
ULARGE_INTEGER cb, /* [in] */
DWORD dwLockType); /* [in] */
HRESULT WINAPI HGLOBALLockBytesImpl16_UnlockRegion(
ILockBytes16* iface,
ULARGE_INTEGER libOffset, /* [in] */
ULARGE_INTEGER cb, /* [in] */
DWORD dwLockType); /* [in] */
HRESULT WINAPI HGLOBALLockBytesImpl16_Stat(
ILockBytes16* iface,
STATSTG16* pstatstg, /* [out] */
DWORD grfStatFlag); /* [in] */
/******************************************************************************
*
* HGLOBALLockBytesImpl16 implementation
@ -142,7 +87,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl16_Stat(
* fDeleteOnRelease - Flag set to TRUE if the HGLOBAL16 will be released
* when the IStream object is destroyed.
*/
HGLOBALLockBytesImpl16*
static HGLOBALLockBytesImpl16*
HGLOBALLockBytesImpl16_Construct(HGLOBAL16 hGlobal,
BOOL16 fDeleteOnRelease)
{
@ -207,7 +152,7 @@ HGLOBALLockBytesImpl16_Construct(HGLOBAL16 hGlobal,
* HGLOBALLockBytesImpl16 class. The pointer passed-in to this function will be
* freed and will not be valid anymore.
*/
void HGLOBALLockBytesImpl16_Destroy(HGLOBALLockBytesImpl16* This)
static void HGLOBALLockBytesImpl16_Destroy(HGLOBALLockBytesImpl16* This)
{
TRACE("()\n");
/*
@ -225,11 +170,25 @@ void HGLOBALLockBytesImpl16_Destroy(HGLOBALLockBytesImpl16* This)
HeapFree(GetProcessHeap(), 0, This);
}
/******************************************************************************
* This implements the IUnknown method AddRef for this
* class
*/
ULONG HGLOBALLockBytesImpl16_AddRef(ILockBytes16* iface)
{
HGLOBALLockBytesImpl16* const This=(HGLOBALLockBytesImpl16*)iface;
TRACE("(%p)\n",This);
return InterlockedIncrement(&This->ref);
}
/******************************************************************************
* This implements the IUnknown method QueryInterface for this
* class
*/
HRESULT WINAPI HGLOBALLockBytesImpl16_QueryInterface(
HRESULT HGLOBALLockBytesImpl16_QueryInterface(
ILockBytes16* iface, /* [in] SEGPTR */
REFIID riid, /* [in] */
void** ppvObject) /* [out][iid_is] (ptr to SEGPTR!) */
@ -258,8 +217,10 @@ HRESULT WINAPI HGLOBALLockBytesImpl16_QueryInterface(
/*
* Check that we obtained an interface.
*/
if ((*ppvObject)==0)
if ((*ppvObject)==0) {
FIXME("Unknown IID %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
/*
* Query Interface always increases the reference count by one when it is
@ -270,24 +231,11 @@ HRESULT WINAPI HGLOBALLockBytesImpl16_QueryInterface(
return S_OK;
}
/******************************************************************************
* This implements the IUnknown method AddRef for this
* class
*/
ULONG WINAPI HGLOBALLockBytesImpl16_AddRef(ILockBytes16* iface)
{
HGLOBALLockBytesImpl16* const This=(HGLOBALLockBytesImpl16*)iface;
TRACE("(%p)\n",This);
return InterlockedIncrement(&This->ref);
}
/******************************************************************************
* This implements the IUnknown method Release for this
* class
*/
ULONG WINAPI HGLOBALLockBytesImpl16_Release(ILockBytes16* iface)
ULONG HGLOBALLockBytesImpl16_Release(ILockBytes16* iface)
{
HGLOBALLockBytesImpl16* const This=(HGLOBALLockBytesImpl16*)iface;
ULONG ref;
@ -312,7 +260,7 @@ ULONG WINAPI HGLOBALLockBytesImpl16_Release(ILockBytes16* iface)
*
* See the documentation of ILockBytes for more info.
*/
HRESULT WINAPI HGLOBALLockBytesImpl16_ReadAt(
HRESULT HGLOBALLockBytesImpl16_ReadAt(
ILockBytes16* iface,
ULARGE_INTEGER ulOffset, /* [in] */
void* pv, /* [out][length_is][size_is] */
@ -377,6 +325,44 @@ HRESULT WINAPI HGLOBALLockBytesImpl16_ReadAt(
return STG_E_READFAULT;
}
/******************************************************************************
* This method is part of the ILockBytes interface.
*
* It will change the size of the byte array.
*
* See the documentation of ILockBytes for more info.
*/
HRESULT HGLOBALLockBytesImpl16_SetSize(
ILockBytes16* iface,
ULARGE_INTEGER libNewSize) /* [in] */
{
HGLOBALLockBytesImpl16* const This=(HGLOBALLockBytesImpl16*)iface;
HGLOBAL16 supportHandle;
TRACE("(%p,%ld)\n",This,libNewSize.u.LowPart);
/*
* As documented.
*/
if (libNewSize.u.HighPart != 0)
return STG_E_INVALIDFUNCTION;
if (This->byteArraySize.u.LowPart == libNewSize.u.LowPart)
return S_OK;
/*
* Re allocate the HGlobal to fit the new size of the stream.
*/
supportHandle = GlobalReAlloc16(This->supportHandle, libNewSize.u.LowPart, 0);
if (supportHandle == 0)
return STG_E_MEDIUMFULL;
This->supportHandle = supportHandle;
This->byteArraySize.u.LowPart = libNewSize.u.LowPart;
return S_OK;
}
/******************************************************************************
* This method is part of the ILockBytes interface.
*
@ -385,7 +371,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl16_ReadAt(
*
* See the documentation of ILockBytes for more info.
*/
HRESULT WINAPI HGLOBALLockBytesImpl16_WriteAt(
HRESULT HGLOBALLockBytesImpl16_WriteAt(
ILockBytes16* iface,
ULARGE_INTEGER ulOffset, /* [in] */
const void* pv, /* [in][size_is] */
@ -447,50 +433,12 @@ HRESULT WINAPI HGLOBALLockBytesImpl16_WriteAt(
*
* See the documentation of ILockBytes for more info.
*/
HRESULT WINAPI HGLOBALLockBytesImpl16_Flush(ILockBytes16* iface)
HRESULT HGLOBALLockBytesImpl16_Flush(ILockBytes16* iface)
{
TRACE("(%p)\n",iface);
return S_OK;
}
/******************************************************************************
* This method is part of the ILockBytes interface.
*
* It will change the size of the byte array.
*
* See the documentation of ILockBytes for more info.
*/
HRESULT WINAPI HGLOBALLockBytesImpl16_SetSize(
ILockBytes16* iface,
ULARGE_INTEGER libNewSize) /* [in] */
{
HGLOBALLockBytesImpl16* const This=(HGLOBALLockBytesImpl16*)iface;
HGLOBAL16 supportHandle;
TRACE("(%p,%ld)\n",This,libNewSize.u.LowPart);
/*
* As documented.
*/
if (libNewSize.u.HighPart != 0)
return STG_E_INVALIDFUNCTION;
if (This->byteArraySize.u.LowPart == libNewSize.u.LowPart)
return S_OK;
/*
* Re allocate the HGlobal to fit the new size of the stream.
*/
supportHandle = GlobalReAlloc16(This->supportHandle, libNewSize.u.LowPart, 0);
if (supportHandle == 0)
return STG_E_MEDIUMFULL;
This->supportHandle = supportHandle;
This->byteArraySize.u.LowPart = libNewSize.u.LowPart;
return S_OK;
}
/******************************************************************************
* This method is part of the ILockBytes interface.
*
@ -498,7 +446,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl16_SetSize(
*
* See the documentation of ILockBytes for more info.
*/
HRESULT WINAPI HGLOBALLockBytesImpl16_LockRegion(
HRESULT HGLOBALLockBytesImpl16_LockRegion(
ILockBytes16* iface,
ULARGE_INTEGER libOffset, /* [in] */
ULARGE_INTEGER cb, /* [in] */
@ -514,7 +462,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl16_LockRegion(
*
* See the documentation of ILockBytes for more info.
*/
HRESULT WINAPI HGLOBALLockBytesImpl16_UnlockRegion(
HRESULT HGLOBALLockBytesImpl16_UnlockRegion(
ILockBytes16* iface,
ULARGE_INTEGER libOffset, /* [in] */
ULARGE_INTEGER cb, /* [in] */
@ -531,7 +479,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl16_UnlockRegion(
*
* See the documentation of ILockBytes for more info.
*/
HRESULT WINAPI HGLOBALLockBytesImpl16_Stat(
HRESULT HGLOBALLockBytesImpl16_Stat(
ILockBytes16*iface,
STATSTG16* pstatstg, /* [out] */
DWORD grfStatFlag) /* [in] */

View file

@ -60,7 +60,7 @@ struct rot_entry
typedef struct RunningObjectTableImpl
{
const IRunningObjectTableVtbl *lpVtbl;
ULONG ref;
LONG ref;
struct list rot; /* list of ROT entries */
CRITICAL_SECTION lock;
@ -73,7 +73,7 @@ static RunningObjectTableImpl* runningObjectTableInstance = NULL;
static inline HRESULT WINAPI
IrotRegister(DWORD *cookie)
{
static DWORD last_cookie = 1;
static LONG last_cookie = 1;
*cookie = InterlockedIncrement(&last_cookie);
return S_OK;
}
@ -82,7 +82,7 @@ IrotRegister(DWORD *cookie)
typedef struct EnumMonikerImpl
{
const IEnumMonikerVtbl *lpVtbl;
ULONG ref;
LONG ref;
MInterfacePointer **monikers;
ULONG moniker_count;
@ -988,7 +988,7 @@ typedef struct MonikerMarshal
const IUnknownVtbl *lpVtbl;
const IMarshalVtbl *lpVtblMarshal;
ULONG ref;
LONG ref;
IMoniker *moniker;
} MonikerMarshal;

View file

@ -69,7 +69,7 @@ typedef struct
/******************************************************************************
* IMalloc16_QueryInterface [COMPOBJ.500]
*/
HRESULT WINAPI IMalloc16_fnQueryInterface(IMalloc16* iface,REFIID refiid,LPVOID *obj) {
HRESULT IMalloc16_fnQueryInterface(IMalloc16* iface,REFIID refiid,LPVOID *obj) {
IMalloc16Impl *This = (IMalloc16Impl *)iface;
TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(refiid),obj);
@ -85,7 +85,7 @@ HRESULT WINAPI IMalloc16_fnQueryInterface(IMalloc16* iface,REFIID refiid,LPVOID
/******************************************************************************
* IMalloc16_AddRef [COMPOBJ.501]
*/
ULONG WINAPI IMalloc16_fnAddRef(IMalloc16* iface) {
ULONG IMalloc16_fnAddRef(IMalloc16* iface) {
IMalloc16Impl *This = (IMalloc16Impl *)iface;
TRACE("(%p)->AddRef()\n",This);
return 1; /* cannot be freed */
@ -94,7 +94,7 @@ ULONG WINAPI IMalloc16_fnAddRef(IMalloc16* iface) {
/******************************************************************************
* IMalloc16_Release [COMPOBJ.502]
*/
ULONG WINAPI IMalloc16_fnRelease(IMalloc16* iface) {
ULONG IMalloc16_fnRelease(IMalloc16* iface) {
IMalloc16Impl *This = (IMalloc16Impl *)iface;
TRACE("(%p)->Release()\n",This);
return 1; /* cannot be freed */
@ -103,7 +103,7 @@ ULONG WINAPI IMalloc16_fnRelease(IMalloc16* iface) {
/******************************************************************************
* IMalloc16_Alloc [COMPOBJ.503]
*/
SEGPTR WINAPI IMalloc16_fnAlloc(IMalloc16* iface,DWORD cb) {
SEGPTR IMalloc16_fnAlloc(IMalloc16* iface,DWORD cb) {
IMalloc16Impl *This = (IMalloc16Impl *)iface;
TRACE("(%p)->Alloc(%ld)\n",This,cb);
return MapLS( HeapAlloc( GetProcessHeap(), 0, cb ) );
@ -112,7 +112,7 @@ SEGPTR WINAPI IMalloc16_fnAlloc(IMalloc16* iface,DWORD cb) {
/******************************************************************************
* IMalloc16_Free [COMPOBJ.505]
*/
VOID WINAPI IMalloc16_fnFree(IMalloc16* iface,SEGPTR pv)
VOID IMalloc16_fnFree(IMalloc16* iface,SEGPTR pv)
{
void *ptr = MapSL(pv);
IMalloc16Impl *This = (IMalloc16Impl *)iface;
@ -124,7 +124,7 @@ VOID WINAPI IMalloc16_fnFree(IMalloc16* iface,SEGPTR pv)
/******************************************************************************
* IMalloc16_Realloc [COMPOBJ.504]
*/
SEGPTR WINAPI IMalloc16_fnRealloc(IMalloc16* iface,SEGPTR pv,DWORD cb)
SEGPTR IMalloc16_fnRealloc(IMalloc16* iface,SEGPTR pv,DWORD cb)
{
SEGPTR ret;
IMalloc16Impl *This = (IMalloc16Impl *)iface;
@ -144,7 +144,7 @@ SEGPTR WINAPI IMalloc16_fnRealloc(IMalloc16* iface,SEGPTR pv,DWORD cb)
/******************************************************************************
* IMalloc16_GetSize [COMPOBJ.506]
*/
DWORD WINAPI IMalloc16_fnGetSize(const IMalloc16* iface,SEGPTR pv)
DWORD IMalloc16_fnGetSize(const IMalloc16* iface,SEGPTR pv)
{
IMalloc16Impl *This = (IMalloc16Impl *)iface;
TRACE("(%p)->GetSize(%08lx)\n",This,pv);
@ -154,7 +154,7 @@ DWORD WINAPI IMalloc16_fnGetSize(const IMalloc16* iface,SEGPTR pv)
/******************************************************************************
* IMalloc16_DidAlloc [COMPOBJ.507]
*/
INT16 WINAPI IMalloc16_fnDidAlloc(const IMalloc16* iface,LPVOID pv) {
INT16 IMalloc16_fnDidAlloc(const IMalloc16* iface,LPVOID pv) {
IMalloc16 *This = (IMalloc16 *)iface;
TRACE("(%p)->DidAlloc(%p)\n",This,pv);
return (INT16)-1;
@ -163,7 +163,7 @@ INT16 WINAPI IMalloc16_fnDidAlloc(const IMalloc16* iface,LPVOID pv) {
/******************************************************************************
* IMalloc16_HeapMinimize [COMPOBJ.508]
*/
LPVOID WINAPI IMalloc16_fnHeapMinimize(IMalloc16* iface) {
LPVOID IMalloc16_fnHeapMinimize(IMalloc16* iface) {
IMalloc16Impl *This = (IMalloc16Impl *)iface;
TRACE("(%p)->HeapMinimize()\n",This);
return NULL;
@ -370,7 +370,7 @@ HRESULT WINAPI ProgIDFromCLSID16(
if (ret == S_OK)
{
DWORD buf2len;
LONG buf2len;
char *buf2 = HeapAlloc(GetProcessHeap(), 0, 255);
buf2len = 255;
if (RegQueryValueA(xhkey, NULL, buf2, &buf2len))
@ -506,3 +506,18 @@ BOOL WINAPI COMPOBJ_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD
TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2);
return TRUE;
}
/***********************************************************************
* CoMemAlloc [COMPOBJ.151]
*/
SEGPTR WINAPI CoMemAlloc(DWORD size, DWORD dwMemContext, DWORD x) {
HRESULT hres;
SEGPTR segptr;
/* FIXME: check context handling */
TRACE("(%ld, 0x%08lx, 0x%08lx)\n", size, dwMemContext, x);
hres = _xmalloc16(size, &segptr);
if (hres != S_OK)
return (SEGPTR)0;
return segptr;
}

View file

@ -294,8 +294,8 @@ void WINAPI OleUninitialize(void)
/******************************************************************************
* OleInitializeWOW [OLE32.@]
*/
HRESULT WINAPI OleInitializeWOW(DWORD x) {
FIXME("(0x%08lx),stub!\n",x);
HRESULT WINAPI OleInitializeWOW(DWORD x, DWORD y) {
FIXME("(0x%08lx, 0x%08lx),stub!\n",x, y);
return 0;
}
@ -394,7 +394,7 @@ HRESULT WINAPI OleRegGetUserType(
DWORD cbData;
HKEY clsidKey;
LONG hres;
LPBYTE buffer;
LPSTR buffer;
HRESULT retVal;
/*
* Initialize the out parameter.
@ -464,7 +464,7 @@ HRESULT WINAPI OleRegGetUserType(
"",
NULL,
&dwKeyType,
buffer,
(LPBYTE) buffer,
&cbData);
RegCloseKey(clsidKey);

View file

@ -38,7 +38,7 @@
38 stub CREATEOLEADVISEHOLDER
39 stub CREATEDATAADVISEHOLDER
40 stub OLECREATEMENUDESCRIPTOR
41 stub OLESETMENUDESCRIPTOR
41 pascal OleSetMenuDescriptor(word word word ptr ptr) OleSetMenuDescriptor16
42 stub OLEDESTROYMENUDESCRIPTOR
43 stub OPENORCREATESTREAM
44 stub CREATEANTIMONIKER

View file

@ -152,3 +152,43 @@ HRESULT WINAPI CreateFileMoniker16(LPCOLESTR16 lpszPathName,LPMONIKER* ppmk)
FIXME("(%s,%p),stub!\n",lpszPathName,ppmk);
return E_NOTIMPL;
}
/******************************************************************************
* OleSetMenuDescriptor (OLE2.41)
*/
HRESULT WINAPI OleSetMenuDescriptor16(
HOLEMENU hOleMenu, /* FIXME: HOLEMENU16 likely */
HWND16 hwndFrame,
HWND16 hwndActiveObject,
LPOLEINPLACEFRAME lpFrame,
LPOLEINPLACEACTIVEOBJECT lpActiveObject)
{
FIXME("(%p, %x, %x, %p, %p), stub!\n", hOleMenu, hwndFrame, hwndActiveObject, lpFrame, lpActiveObject);
return E_NOTIMPL;
}
/******************************************************************************
* IsValidInterface [COMPOBJ.23]
*
* Determines whether a pointer is a valid interface.
*
* PARAMS
* punk [I] Interface to be tested.
*
* RETURNS
* TRUE, if the passed pointer is a valid interface, or FALSE otherwise.
*/
BOOL WINAPI IsValidInterface16(SEGPTR punk)
{
DWORD **ptr;
if (IsBadReadPtr16(punk,4))
return FALSE;
ptr = MapSL(punk);
if (IsBadReadPtr16((SEGPTR)ptr[0],4)) /* check vtable ptr */
return FALSE;
ptr = MapSL((SEGPTR)ptr[0]); /* ptr to first method */
if (IsBadReadPtr16((SEGPTR)ptr[0],2))
return FALSE;
return TRUE;
}

View file

@ -188,7 +188,7 @@
@ stdcall OleGetIconOfClass(ptr ptr long)
@ stub OleGetIconOfFile
@ stdcall OleInitialize(ptr)
@ stdcall OleInitializeWOW(long)
@ stdcall OleInitializeWOW(long long)
@ stdcall OleIsCurrentClipboard(ptr)
@ stdcall OleIsRunning(ptr)
@ stdcall OleLoad(ptr ptr ptr ptr)

View file

@ -43,7 +43,7 @@ typedef struct OleAdviseHolderImpl
{
const IOleAdviseHolderVtbl *lpVtbl;
DWORD ref;
LONG ref;
DWORD maxSinks;
IAdviseSink** arrayOfSinks;
@ -357,7 +357,7 @@ typedef struct DataAdviseHolder
{
const IDataAdviseHolderVtbl *lpVtbl;
DWORD ref;
LONG ref;
DWORD maxCons;
DataAdviseConnection* Connections;
} DataAdviseHolder;

View file

@ -89,7 +89,7 @@ const CLSID CLSID_PSFactoryBuffer = { 0x00000320, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0,
*/
typedef struct _CFStub {
const IRpcStubBufferVtbl *lpvtbl;
DWORD ref;
LONG ref;
LPUNKNOWN pUnkServer;
} CFStub;
@ -117,7 +117,10 @@ CFStub_Release(LPRPCSTUBBUFFER iface) {
ULONG ref;
ref = InterlockedDecrement(&This->ref);
if (!ref) HeapFree(GetProcessHeap(),0,This);
if (!ref) {
IRpcStubBuffer_Disconnect(iface);
HeapFree(GetProcessHeap(),0,This);
}
return ref;
}
@ -134,9 +137,12 @@ static void WINAPI
CFStub_Disconnect(LPRPCSTUBBUFFER iface) {
CFStub *This = (CFStub *)iface;
if (This->pUnkServer) {
IUnknown_Release(This->pUnkServer);
This->pUnkServer = NULL;
}
}
static HRESULT WINAPI
CFStub_Invoke(
LPRPCSTUBBUFFER iface,RPCOLEMESSAGE* msg,IRpcChannelBuffer* chanbuf
@ -269,7 +275,7 @@ CFStub_Construct(LPRPCSTUBBUFFER *ppv) {
typedef struct _CFProxy {
const IClassFactoryVtbl *lpvtbl_cf;
const IRpcProxyBufferVtbl *lpvtbl_proxy;
DWORD ref;
LONG ref;
IRpcChannelBuffer *chanbuf;
IUnknown *outer_unknown;
@ -460,7 +466,7 @@ CFProxy_Construct(IUnknown *pUnkOuter, LPVOID *ppv,LPVOID *ppProxy) {
typedef struct
{
const IRpcStubBufferVtbl *lpVtbl;
ULONG refs;
LONG refs;
IRemUnknown *iface;
} RemUnkStub;
@ -546,12 +552,15 @@ static HRESULT WINAPI RemUnkStub_Invoke(LPRPCSTUBBUFFER iface,
hr = IRemUnknown_RemQueryInterface(This->iface, &ipid, cRefs, cIids, iids, &pQIResults);
/* out */
pMsg->cbBuffer = cIids * sizeof(REMQIRESULT);
pMsg->cbBuffer = cIids * sizeof(REMQIRESULT) + sizeof(HRESULT);
I_RpcGetBuffer((RPC_MESSAGE *)pMsg);
if (hr) return hr;
buf = pMsg->Buffer;
*(HRESULT *)buf = hr;
buf += sizeof(HRESULT);
if (hr) return hr;
/* FIXME: pQIResults is a unique pointer so pQIResults can be NULL! */
memcpy(buf, pQIResults, cIids * sizeof(REMQIRESULT));
@ -655,7 +664,7 @@ static HRESULT RemUnkStub_Construct(IRpcStubBuffer **ppStub)
RemUnkStub *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
if (!This) return E_OUTOFMEMORY;
This->lpVtbl = &RemUnkStub_VTable;
This->refs = 0;
This->refs = 1;
This->iface = NULL;
*ppStub = (IRpcStubBuffer*)This;
return S_OK;
@ -665,7 +674,7 @@ static HRESULT RemUnkStub_Construct(IRpcStubBuffer **ppStub)
typedef struct _RemUnkProxy {
const IRemUnknownVtbl *lpvtbl_remunk;
const IRpcProxyBufferVtbl *lpvtbl_proxy;
DWORD refs;
LONG refs;
IRpcChannelBuffer *chan;
IUnknown *outer_unknown;
@ -745,8 +754,14 @@ static HRESULT WINAPI RemUnkProxy_RemQueryInterface(LPREMUNKNOWN iface,
hr = IRpcChannelBuffer_SendReceive(This->chan, &msg, &status);
if (SUCCEEDED(hr)) {
buf = msg.Buffer;
if (SUCCEEDED(hr)) {
hr = *(HRESULT *)buf;
buf += sizeof(HRESULT);
}
if (SUCCEEDED(hr)) {
*ppQIResults = CoTaskMemAlloc(cIids*sizeof(REMQIRESULT));
memcpy(*ppQIResults, buf, cIids*sizeof(REMQIRESULT));
}

View file

@ -88,7 +88,7 @@ static inline void get_rpc_endpoint(LPWSTR endpoint, const OXID *oxid)
typedef struct
{
const IRpcChannelBufferVtbl *lpVtbl;
DWORD refs;
LONG refs;
} RpcChannelBuffer;
typedef struct
@ -212,10 +212,14 @@ static DWORD WINAPI rpc_sendreceive_thread(LPVOID param)
static HRESULT WINAPI RpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER iface, RPCOLEMESSAGE *olemsg, ULONG *pstatus)
{
HRESULT hr = S_OK;
RPC_MESSAGE *msg = (RPC_MESSAGE *)olemsg;
RPC_STATUS status;
DWORD index;
struct dispatch_params *params;
DWORD tid;
IRpcStubBuffer *stub;
APARTMENT *apt;
IPID ipid;
TRACE("(%p) iMethod=%ld\n", olemsg, olemsg->iMethod);
@ -225,6 +229,29 @@ static HRESULT WINAPI RpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER iface, RPC
params->msg = olemsg;
params->status = RPC_S_OK;
/* Note: this is an optimization in the Microsoft OLE runtime that we need
* to copy, as shown by the test_no_couninitialize_client test. without
* short-circuiting the RPC runtime in the case below, the test will
* deadlock on the loader lock due to the RPC runtime needing to create
* a thread to process the RPC when this function is called indirectly
* from DllMain */
RpcBindingInqObject(msg->Handle, &ipid);
stub = ipid_to_apt_and_stubbuffer(&ipid, &apt);
if (apt && (apt->model & COINIT_APARTMENTTHREADED))
{
params->stub = stub;
params->chan = NULL; /* FIXME: pass server channel */
params->handle = CreateEventW(NULL, FALSE, FALSE, NULL);
TRACE("Calling apartment thread 0x%08lx...\n", apt->tid);
PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params);
}
else
{
if (stub) IRpcStubBuffer_Release(stub);
/* we use a separate thread here because we need to be able to
* pump the message loop in the application thread: if we do not,
* any windows created by this thread will hang and RPCs that try
@ -237,6 +264,8 @@ static HRESULT WINAPI RpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER iface, RPC
ERR("Could not create RpcSendReceive thread, error %lx\n", GetLastError());
hr = E_UNEXPECTED;
}
}
if (apt) apartment_release(apt);
if (hr == S_OK)
hr = CoWaitForMultipleHandles(0, INFINITE, 1, &params->handle, &index);
@ -431,7 +460,7 @@ static void __RPC_STUB dispatch_rpc(RPC_MESSAGE *msg)
if (!apt || !stub)
{
if (apt) apartment_release(apt);
/* ipid_to_apt_and_stubbuffer will already have logged the error */
ERR("no apartment found for ipid %s\n", debugstr_guid(&ipid));
return RpcRaiseException(RPC_E_DISCONNECTED);
}

View file

@ -155,7 +155,7 @@ static const IPropertyStorageVtbl IPropertyStorage_Vtbl;
typedef struct tagPropertyStorage_impl
{
const IPropertyStorageVtbl *vtbl;
DWORD ref;
LONG ref;
CRITICAL_SECTION cs;
IStream *stm;
BOOL dirty;

View file

@ -956,7 +956,7 @@ typedef struct
{
/* IUnknown fields */
const IStream16Vtbl *lpVtbl;
DWORD ref;
LONG ref;
/* IStream16 fields */
SEGPTR thisptr; /* pointer to this struct as segmented */
struct storage_pps_entry stde;
@ -968,7 +968,7 @@ typedef struct
/******************************************************************************
* IStream16_QueryInterface [STORAGE.518]
*/
HRESULT WINAPI IStream16_fnQueryInterface(
HRESULT IStream16_fnQueryInterface(
IStream16* iface,REFIID refiid,LPVOID *obj
) {
IStream16Impl *This = (IStream16Impl *)iface;
@ -984,7 +984,7 @@ HRESULT WINAPI IStream16_fnQueryInterface(
/******************************************************************************
* IStream16_AddRef [STORAGE.519]
*/
ULONG WINAPI IStream16_fnAddRef(IStream16* iface) {
ULONG IStream16_fnAddRef(IStream16* iface) {
IStream16Impl *This = (IStream16Impl *)iface;
return InterlockedIncrement(&This->ref);
}
@ -992,7 +992,7 @@ ULONG WINAPI IStream16_fnAddRef(IStream16* iface) {
/******************************************************************************
* IStream16_Release [STORAGE.520]
*/
ULONG WINAPI IStream16_fnRelease(IStream16* iface) {
ULONG IStream16_fnRelease(IStream16* iface) {
IStream16Impl *This = (IStream16Impl *)iface;
ULONG ref;
FlushFileBuffers(This->hf);
@ -1011,7 +1011,7 @@ ULONG WINAPI IStream16_fnRelease(IStream16* iface) {
* FIXME
* Does not handle 64 bits
*/
HRESULT WINAPI IStream16_fnSeek(
HRESULT IStream16_fnSeek(
IStream16* iface,LARGE_INTEGER offset,DWORD whence,ULARGE_INTEGER *newpos
) {
IStream16Impl *This = (IStream16Impl *)iface;
@ -1055,7 +1055,7 @@ HRESULT WINAPI IStream16_fnSeek(
/******************************************************************************
* IStream16_Read [STORAGE.521]
*/
HRESULT WINAPI IStream16_fnRead(
HRESULT IStream16_fnRead(
IStream16* iface,void *pv,ULONG cb,ULONG *pcbRead
) {
IStream16Impl *This = (IStream16Impl *)iface;
@ -1117,7 +1117,7 @@ HRESULT WINAPI IStream16_fnRead(
/******************************************************************************
* IStream16_Write [STORAGE.522]
*/
HRESULT WINAPI IStream16_fnWrite(
HRESULT IStream16_fnWrite(
IStream16* iface,const void *pv,ULONG cb,ULONG *pcbWrite
) {
IStream16Impl *This = (IStream16Impl *)iface;
@ -1450,7 +1450,7 @@ typedef struct
{
/* IUnknown fields */
const IStreamVtbl *lpVtbl;
DWORD ref;
LONG ref;
/* IStream32 fields */
struct storage_pps_entry stde;
int ppsent;
@ -1504,7 +1504,7 @@ typedef struct
{
/* IUnknown fields */
const IStorage16Vtbl *lpVtbl;
DWORD ref;
LONG ref;
/* IStorage16 fields */
SEGPTR thisptr; /* pointer to this struct as segmented */
struct storage_pps_entry stde;
@ -1515,7 +1515,7 @@ typedef struct
/******************************************************************************
* IStorage16_QueryInterface [STORAGE.500]
*/
HRESULT WINAPI IStorage16_fnQueryInterface(
HRESULT IStorage16_fnQueryInterface(
IStorage16* iface,REFIID refiid,LPVOID *obj
) {
IStorage16Impl *This = (IStorage16Impl *)iface;
@ -1532,7 +1532,7 @@ HRESULT WINAPI IStorage16_fnQueryInterface(
/******************************************************************************
* IStorage16_AddRef [STORAGE.501]
*/
ULONG WINAPI IStorage16_fnAddRef(IStorage16* iface) {
ULONG IStorage16_fnAddRef(IStorage16* iface) {
IStorage16Impl *This = (IStorage16Impl *)iface;
return InterlockedIncrement(&This->ref);
}
@ -1540,7 +1540,7 @@ ULONG WINAPI IStorage16_fnAddRef(IStorage16* iface) {
/******************************************************************************
* IStorage16_Release [STORAGE.502]
*/
ULONG WINAPI IStorage16_fnRelease(IStorage16* iface) {
ULONG IStorage16_fnRelease(IStorage16* iface) {
IStorage16Impl *This = (IStorage16Impl *)iface;
ULONG ref;
ref = InterlockedDecrement(&This->ref);
@ -1555,7 +1555,7 @@ ULONG WINAPI IStorage16_fnRelease(IStorage16* iface) {
/******************************************************************************
* IStorage16_Stat [STORAGE.517]
*/
HRESULT WINAPI IStorage16_fnStat(
HRESULT IStorage16_fnStat(
LPSTORAGE16 iface,STATSTG16 *pstatstg, DWORD grfStatFlag
) {
IStorage16Impl *This = (IStorage16Impl *)iface;
@ -1583,7 +1583,7 @@ HRESULT WINAPI IStorage16_fnStat(
/******************************************************************************
* IStorage16_Commit [STORAGE.509]
*/
HRESULT WINAPI IStorage16_fnCommit(
HRESULT IStorage16_fnCommit(
LPSTORAGE16 iface,DWORD commitflags
) {
IStorage16Impl *This = (IStorage16Impl *)iface;
@ -1596,7 +1596,7 @@ HRESULT WINAPI IStorage16_fnCommit(
/******************************************************************************
* IStorage16_CopyTo [STORAGE.507]
*/
HRESULT WINAPI IStorage16_fnCopyTo(LPSTORAGE16 iface,DWORD ciidExclude,const IID *rgiidExclude,SNB16 SNB16Exclude,IStorage16 *pstgDest) {
HRESULT IStorage16_fnCopyTo(LPSTORAGE16 iface,DWORD ciidExclude,const IID *rgiidExclude,SNB16 SNB16Exclude,IStorage16 *pstgDest) {
IStorage16Impl *This = (IStorage16Impl *)iface;
FIXME("IStorage16(%p)->(0x%08lx,%s,%p,%p),stub!\n",
This,ciidExclude,debugstr_guid(rgiidExclude),SNB16Exclude,pstgDest
@ -1608,7 +1608,7 @@ HRESULT WINAPI IStorage16_fnCopyTo(LPSTORAGE16 iface,DWORD ciidExclude,const IID
/******************************************************************************
* IStorage16_CreateStorage [STORAGE.505]
*/
HRESULT WINAPI IStorage16_fnCreateStorage(
HRESULT IStorage16_fnCreateStorage(
LPSTORAGE16 iface,LPCOLESTR16 pwcsName,DWORD grfMode,DWORD dwStgFormat,DWORD reserved2, IStorage16 **ppstg
) {
IStorage16Impl *This = (IStorage16Impl *)iface;
@ -1673,7 +1673,7 @@ HRESULT WINAPI IStorage16_fnCreateStorage(
/******************************************************************************
* IStorage16_CreateStream [STORAGE.503]
*/
HRESULT WINAPI IStorage16_fnCreateStream(
HRESULT IStorage16_fnCreateStream(
LPSTORAGE16 iface,LPCOLESTR16 pwcsName,DWORD grfMode,DWORD reserved1,DWORD reserved2, IStream16 **ppstm
) {
IStorage16Impl *This = (IStorage16Impl *)iface;
@ -1731,7 +1731,7 @@ HRESULT WINAPI IStorage16_fnCreateStream(
/******************************************************************************
* IStorage16_OpenStorage [STORAGE.506]
*/
HRESULT WINAPI IStorage16_fnOpenStorage(
HRESULT IStorage16_fnOpenStorage(
LPSTORAGE16 iface,LPCOLESTR16 pwcsName, IStorage16 *pstgPrio, DWORD grfMode, SNB16 snbExclude, DWORD reserved, IStorage16 **ppstg
) {
IStorage16Impl *This = (IStorage16Impl *)iface;
@ -1766,7 +1766,7 @@ HRESULT WINAPI IStorage16_fnOpenStorage(
/******************************************************************************
* IStorage16_OpenStream [STORAGE.504]
*/
HRESULT WINAPI IStorage16_fnOpenStream(
HRESULT IStorage16_fnOpenStream(
LPSTORAGE16 iface,LPCOLESTR16 pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream16 **ppstm
) {
IStorage16Impl *This = (IStorage16Impl *)iface;

View file

@ -23,6 +23,14 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* NOTES
* The compound file implementation of IStorage used for create
* and manage substorages and streams within a storage object
* residing in a compound file object.
*
* MSDN
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/stg/stg/istorage_compound_file_implementation.asp
*/
#include <assert.h>
@ -1583,6 +1591,13 @@ HRESULT WINAPI StorageImpl_MoveElementTo(
/*************************************************************************
* Commit (IStorage)
*
* Ensures that any changes made to a storage object open in transacted mode
* are reflected in the parent storage
*
* NOTES
* Wine doesn't implement transacted mode, which seems to be a basic
* optimization, so we can ignore this stub for now.
*/
HRESULT WINAPI StorageImpl_Commit(
IStorage* iface,
@ -1594,6 +1609,8 @@ HRESULT WINAPI StorageImpl_Commit(
/*************************************************************************
* Revert (IStorage)
*
* Discard all changes that have been made since the last commit operation
*/
HRESULT WINAPI StorageImpl_Revert(
IStorage* iface)
@ -6387,7 +6404,7 @@ static DWORD GetCreationModeFromSTGM(DWORD stgm)
*
* Memory allocated for pData must be freed by the caller
*/
HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA *pData, BOOL bStrem1)
static HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA *pData, BOOL bStrem1)
{
DWORD dwSize;
HRESULT hRes = S_OK;
@ -6555,7 +6572,7 @@ HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA *
* This function is used by OleConvertIStorageToOLESTREAM only.
*
*/
HRESULT OLECONVERT_SaveOLE10(OLECONVERT_OLESTREAM_DATA *pData, LPOLESTREAM pOleStream)
static HRESULT OLECONVERT_SaveOLE10(OLECONVERT_OLESTREAM_DATA *pData, LPOLESTREAM pOleStream)
{
DWORD dwSize;
HRESULT hRes = S_OK;
@ -6666,7 +6683,7 @@ HRESULT OLECONVERT_SaveOLE10(OLECONVERT_OLESTREAM_DATA *pData, LPOLESTREAM pOleS
*
*
*/
void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, BYTE *pBuffer, DWORD nBufferLength)
static void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, BYTE *pBuffer, DWORD nBufferLength)
{
HRESULT hRes;
HANDLE hFile;
@ -6716,7 +6733,7 @@ void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, BYTE *pBuffer, DWORD n
* Used by OleConvertIStorageToOLESTREAM only.
*
*/
DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData)
static DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData)
{
HANDLE hFile;
HRESULT hRes;
@ -7132,7 +7149,7 @@ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName
* This function is used by OleConvertOLESTREAMToIStorage only.
*
*/
void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD dwExtentY , BYTE *pData, DWORD dwDataLength)
static void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD dwExtentY , BYTE *pData, DWORD dwDataLength)
{
HRESULT hRes;
IStream *pStream;
@ -7216,7 +7233,7 @@ void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD d
* Might need to verify the data and return appropriate error message
*
*/
void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, BYTE *pData, DWORD dwDataLength)
static void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, BYTE *pData, DWORD dwDataLength)
{
HRESULT hRes;
IStream *pStream;
@ -7255,7 +7272,7 @@ void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, BYTE *pData, DWORD d
*
*
*/
HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dwSize)
static HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dwSize)
{
HRESULT hRes;
IStream *pStream;
@ -7325,7 +7342,7 @@ HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dw
*
*
*/
void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData)
static void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData)
{
HRESULT hRes;
@ -7378,7 +7395,7 @@ void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *
*
* Memory allocated for pData must be freed by the caller
*/
void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData)
static void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData)
{
HRESULT hRes;
IStream *pStream;

View file

@ -222,7 +222,7 @@ struct StorageBaseImpl
/*
* Reference count of this object
*/
ULONG ref;
LONG ref;
/*
* Ancestor storage (top level)
@ -430,7 +430,7 @@ struct IEnumSTATSTGImpl
const IEnumSTATSTGVtbl *lpVtbl; /* Needs to be the first item in the struct
* since we want to cast this in an IEnumSTATSTG pointer */
ULONG ref; /* Reference count */
LONG ref; /* Reference count */
StorageImpl* parentStorage; /* Reference to the parent storage */
ULONG firstPropertyNode; /* Index of the root of the storage to enumerate */
@ -487,7 +487,7 @@ struct StgStreamImpl
/*
* Reference count
*/
ULONG ref;
LONG ref;
/*
* Storage that is the parent(owner) of the stream

View file

@ -96,15 +96,13 @@ struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object, MSHLFLAG
return sm;
}
/* m->apt->cs must be held on entry to this function */
/* caller must remove stub manager from apartment prior to calling this function */
static void stub_manager_delete(struct stub_manager *m)
{
struct list *cursor;
TRACE("destroying %p (oid=%s)\n", m, wine_dbgstr_longlong(m->oid));
list_remove(&m->entry);
/* release every ifstub */
while ((cursor = list_head(&m->ifstubs)))
{
@ -230,9 +228,15 @@ ULONG stub_manager_int_release(struct stub_manager *This)
TRACE("after %ld\n", refs);
/* remove from apartment so no other thread can access it... */
if (!refs)
list_remove(&This->entry);
LeaveCriticalSection(&apt->cs);
/* ... so now we can delete it without being inside the apartment critsec */
if (!refs)
stub_manager_delete(This);
LeaveCriticalSection(&apt->cs);
return refs;
}
@ -336,7 +340,7 @@ HRESULT ipid_to_stub_manager(const IPID *ipid, APARTMENT **stub_apt, struct stub
*stub_apt = apartment_findfromtid(ipid->Data2);
if (!*stub_apt)
{
ERR("Couldn't find apartment corresponding to TID 0x%04x\n", ipid->Data2);
TRACE("Couldn't find apartment corresponding to TID 0x%04x\n", ipid->Data2);
return RPC_E_INVALID_OBJECT;
}
*stubmgr_ret = get_stub_manager_from_ipid(*stub_apt, ipid);
@ -411,7 +415,7 @@ struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *s
stub->stubbuffer = sb;
if (sb) IRpcStubBuffer_AddRef(sb);
/* no need to ref this, same object as sb */
IUnknown_AddRef(iptr);
stub->iface = iptr;
stub->iid = *iid;
@ -477,7 +481,9 @@ BOOL stub_manager_notify_unmarshal(struct stub_manager *m)
default:
WARN("object OID %s already unmarshaled\n",
wine_dbgstr_longlong(m->oid));
ret = FALSE;
ret = TRUE; /* FIXME: the state management should be per-ifstub, so
* it is disabled at the moment so that InstallShield
* works again */
break;
}
@ -505,9 +511,9 @@ void stub_manager_release_marshal_data(struct stub_manager *m, ULONG refs)
break;
}
stub_manager_ext_release(m, refs);
LeaveCriticalSection(&m->lock);
stub_manager_ext_release(m, refs);
}
/* is an ifstub table marshaled? */
@ -539,7 +545,7 @@ const IID IID_IRemUnknown = { 0x00000131, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46} }
typedef struct rem_unknown
{
const IRemUnknownVtbl *lpVtbl;
ULONG refs;
LONG refs;
} RemUnknown;
static const IRemUnknownVtbl RemUnknown_Vtbl;