Commit 89d8e13b authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Simplify apartment lookup helper.

parent 92957515
......@@ -1237,12 +1237,8 @@ DWORD apartment_release(struct apartment *apt)
return ret;
}
/* The given OXID must be local to this process:
*
* The ref parameter is here mostly to ensure people remember that
* they get one, you should normally take a ref for thread safety.
*/
struct apartment *apartment_findfromoxid(OXID oxid, BOOL ref)
/* The given OXID must be local to this process */
struct apartment *apartment_findfromoxid(OXID oxid)
{
struct apartment *result = NULL;
struct list *cursor;
......@@ -1254,7 +1250,7 @@ struct apartment *apartment_findfromoxid(OXID oxid, BOOL ref)
if (apt->oxid == oxid)
{
result = apt;
if (ref) apartment_addref(result);
apartment_addref(result);
break;
}
}
......
......@@ -246,7 +246,7 @@ void OLEDD_UnInitialize(void) DECLSPEC_HIDDEN;
/* Apartment Functions */
struct apartment *apartment_findfromoxid(OXID oxid, BOOL ref) DECLSPEC_HIDDEN;
struct apartment *apartment_findfromoxid(OXID oxid) DECLSPEC_HIDDEN;
struct apartment *apartment_findfromtid(DWORD tid) DECLSPEC_HIDDEN;
DWORD apartment_release(struct apartment *apt) DECLSPEC_HIDDEN;
HRESULT apartment_disconnectproxies(struct apartment *apt) DECLSPEC_HIDDEN;
......
......@@ -1468,7 +1468,7 @@ static HRESULT std_unmarshal_interface(MSHCTX dest_context, void *dest_context_d
* ignore table marshaling and normal marshaling rules regarding number of
* unmarshals, etc, but if you abuse these rules then your proxy could end
* up returning RPC_E_DISCONNECTED. */
if ((stub_apt = apartment_findfromoxid(obj.std.oxid, TRUE)))
if ((stub_apt = apartment_findfromoxid(obj.std.oxid)))
{
if ((stubmgr = get_stub_manager(stub_apt, obj.std.oid)))
{
......@@ -1555,7 +1555,7 @@ static HRESULT std_release_marshal_data(IStream *pStm)
wine_dbgstr_longlong(obj.std.oid),
wine_dbgstr_guid(&obj.std.ipid));
if (!(apt = apartment_findfromoxid(obj.std.oxid, TRUE)))
if (!(apt = apartment_findfromoxid(obj.std.oxid)))
{
WARN("Could not map OXID %s to apartment object\n",
wine_dbgstr_longlong(obj.std.oxid));
......
......@@ -503,7 +503,7 @@ static HRESULT ipid_to_ifstub(const IPID *ipid, struct apartment **stub_apt,
{
/* FIXME: hack for IRemUnknown */
if (ipid->Data2 == 0xffff)
*stub_apt = apartment_findfromoxid(*(const OXID *)ipid->Data4, TRUE);
*stub_apt = apartment_findfromoxid(*(const OXID *)ipid->Data4);
else
*stub_apt = apartment_findfromtid(ipid->Data2);
if (!*stub_apt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment