ole32: Fix CoLockObjectExternal to respect fLastUnlockReleases.

This commit is contained in:
Robert Shearman 2006-08-03 20:24:57 +01:00 committed by Alexandre Julliard
parent ab378803ef
commit 6455b9e1a0
4 changed files with 7 additions and 7 deletions

View file

@ -2234,7 +2234,7 @@ HRESULT WINAPI CoLockObjectExternal(
if (fLock)
stub_manager_ext_addref(stubmgr, 1);
else
stub_manager_ext_release(stubmgr, 1);
stub_manager_ext_release(stubmgr, 1, fLastUnlockReleases);
stub_manager_int_release(stubmgr);

View file

@ -187,7 +187,7 @@ ULONG stub_manager_int_addref(struct stub_manager *This);
ULONG stub_manager_int_release(struct stub_manager *This);
struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object);
ULONG stub_manager_ext_addref(struct stub_manager *m, ULONG refs);
ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs);
ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs, BOOL last_unlock_releases);
struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, REFIID iid, MSHLFLAGS flags);
struct ifstub *stub_manager_find_ifstub(struct stub_manager *m, REFIID iid, MSHLFLAGS flags);
struct stub_manager *get_stub_manager(APARTMENT *apt, OID oid);

View file

@ -1190,7 +1190,7 @@ StdMarshalImpl_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, v
/* unref the ifstub. FIXME: only do this on success? */
if (!stub_manager_is_table_marshaled(stubmgr, &stdobjref.ipid))
stub_manager_ext_release(stubmgr, stdobjref.cPublicRefs);
stub_manager_ext_release(stubmgr, stdobjref.cPublicRefs, TRUE);
stub_manager_int_release(stubmgr);
return hres;

View file

@ -253,7 +253,7 @@ ULONG stub_manager_ext_addref(struct stub_manager *m, ULONG refs)
}
/* remove some external references */
ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs)
ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs, BOOL last_unlock_releases)
{
ULONG rc;
@ -267,7 +267,7 @@ ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs)
TRACE("removed %lu refs from %p (oid %s), rc is now %lu\n", refs, m, wine_dbgstr_longlong(m->oid), rc);
if (rc == 0)
if (rc == 0 && last_unlock_releases)
stub_manager_int_release(m);
return rc;
@ -537,7 +537,7 @@ void stub_manager_release_marshal_data(struct stub_manager *m, ULONG refs, const
else if (ifstub->flags & MSHLFLAGS_TABLESTRONG)
refs = 1;
stub_manager_ext_release(m, refs);
stub_manager_ext_release(m, refs, TRUE);
}
/* is an ifstub table marshaled? */
@ -717,7 +717,7 @@ static HRESULT WINAPI RemUnknown_RemRelease(IRemUnknown *iface,
break;
}
stub_manager_ext_release(stubmgr, InterfaceRefs[i].cPublicRefs);
stub_manager_ext_release(stubmgr, InterfaceRefs[i].cPublicRefs, TRUE);
if (InterfaceRefs[i].cPrivateRefs)
FIXME("Releasing %ld refs securely not implemented\n", InterfaceRefs[i].cPrivateRefs);