[PATCH] dmime: IDirectMusicPerformance8_FreePMsg Release the unknown pointer.

Michael Stefaniuc mstefani at winehq.org
Wed Dec 18 14:55:19 CST 2019


Hello Alistair,

while this patch is technically correct
http://doc.51windows.net/Directx9_SDK/htm/dmuspmsg.htm
I'm wondering why it was triggered by bug #25728 (comments 34 and 35).

I don't see a FreePMsg in the log
https://bugs.winehq.org/attachment.cgi?id=65980
I also don't see a FreePMsg in any of the logs I have.
Nor in the attachments of all directx-dmusic bugs.

Also we don't set punkUser anywhere in the whole Wine code

wine$ git grep -n punkUser
dlls/dmime/performance.c:482:  if (pPMSG->punkUser)
dlls/dmime/performance.c:483:    IUnknown_Release(pPMSG->punkUser);
dlls/dmime/tests/performance.c:447:            ok(msg->punkUser != NULL,
"Unexpected NULL pointer\n");
dlls/dmime/tests/performance.c:448:            if (msg->punkUser) {
dlls/dmime/tests/performance.c:452:                hr =
IUnknown_QueryInterface(msg->punkUser, &IID_IDirectMusicSegmentState8,
(void**)&segmentstate);
include/dmusici.h:363:  IUnknown*          punkUser;

While we seem to have a test that checks for non-NULL punkUser, that
test doesn't runs on Wine. Changing to ok(msg->punkUser == NULL, ...)
still passes on Wine.
That test does run on Windows though
https://testbot.winehq.org/JobDetails.pl?Key=62304


So this patch is a no-op for now iff we allocate zero all the messages.
Else we might crash on uninitialized memory. So it does sound like a
"Deferred" to me.


bye
	michael



On 12/18/19 6:17 AM, Alistair Leslie-Hughes wrote:
> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
> ---
>  dlls/dmime/performance.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c
> index 9dbb469f388..a63bd3b4517 100644
> --- a/dlls/dmime/performance.c
> +++ b/dlls/dmime/performance.c
> @@ -479,7 +479,9 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_FreePMsg(IDirectMusicPerforma
>    DMUS_ItemRemoveFromQueue( This, pItem );
>    LeaveCriticalSection(&This->safe);
>  
> -  /** TODO: see if we should Release the pItem->pMsg->punkUser and others Interfaces */
> +  if (pPMSG->punkUser)
> +    IUnknown_Release(pPMSG->punkUser);
> +
>    HeapFree(GetProcessHeap(), 0, pItem);  
>    return S_OK;
>  }
> 




More information about the wine-devel mailing list