[PATCH] ole32: Implement CreateObjrefMoniker().
Nikolay Sivov
nsivov at codeweavers.com
Wed Oct 13 07:03:10 CDT 2021
On 10/13/21 2:35 PM, Dmitry Timoshkov wrote:
> +static const IMonikerVtbl VT_ObjrefMonikerImpl =
> +{
> + ObjrefMonikerImpl_QueryInterface,
> + PointerMonikerImpl_AddRef,
> + PointerMonikerImpl_Release,
> + ObjrefMonikerImpl_GetClassID,
> + PointerMonikerImpl_IsDirty,
> + PointerMonikerImpl_Load,
> + ObjrefMonikerImpl_Save,
> + PointerMonikerImpl_GetSizeMax,
> + PointerMonikerImpl_BindToObject,
> + PointerMonikerImpl_BindToStorage,
> + PointerMonikerImpl_Reduce,
> + PointerMonikerImpl_ComposeWith,
> + ObjrefMonikerImpl_Enum,
> + PointerMonikerImpl_IsEqual,
> + PointerMonikerImpl_Hash,
> + PointerMonikerImpl_IsRunning,
> + ObjrefMonikerImpl_GetTimeOfLastChange,
> + PointerMonikerImpl_Inverse,
> + PointerMonikerImpl_CommonPrefixWith,
> + PointerMonikerImpl_RelativePathTo,
> + ObjrefMonikerImpl_GetDisplayName,
> + PointerMonikerImpl_ParseDisplayName,
> + ObjrefMonikerImpl_IsSystemMoniker
> +};
> +
I think separate implementation would be better. According to docs more
methods are supposed to differ, like running state handling, or
Load()/GetSizeMax().
It's worth checking if objref moniker keeps a reference to passed
pointer at all. Since its purpose is to identify running object RPC-way,
I suspect it's not a simple pointer wrapper.
> +static PointerMonikerImpl *unsafe_impl_from_IMoniker(IMoniker *iface)
> +{
> + if (iface->lpVtbl != &VT_PointerMonikerImpl && iface->lpVtbl != &VT_ObjrefMonikerImpl)
> + return NULL;
> + return CONTAINING_RECORD(iface, PointerMonikerImpl, IMoniker_iface);
> +}
This implies that IsEqual() could return S_OK for mismatching moniker
types, which is not backed by tests, or docs.
There are some copy-paste problems in tests.
More information about the wine-devel
mailing list