@@ -72,8 +72,6 @@ struct performance
72
72
struct message
73
73
{
74
74
struct list entry ;
75
- BOOL bInUse ;
76
- DWORD cb ;
77
75
DMUS_PMSG pMsg ;
78
76
};
79
77
@@ -91,7 +89,7 @@ static struct message *ProceedMsg(struct performance *This, struct message *cur)
91
89
SetEvent (This -> hNotification );
92
90
}
93
91
list_remove (& cur -> entry );
94
- cur -> bInUse = FALSE ;
92
+ list_init ( & cur -> entry ) ;
95
93
switch (cur -> pMsg .dwType ) {
96
94
case DMUS_PMSGT_WAVE :
97
95
case DMUS_PMSGT_TEMPO :
@@ -406,7 +404,7 @@ static HRESULT WINAPI performance_SendPMsg(IDirectMusicPerformance8 *iface, DMUS
406
404
407
405
EnterCriticalSection (& This -> safe );
408
406
409
- if (message -> bInUse )
407
+ if (! list_empty ( & message -> entry ) )
410
408
hr = DMUS_E_ALREADY_SENT ;
411
409
else
412
410
{
@@ -429,7 +427,6 @@ static HRESULT WINAPI performance_SendPMsg(IDirectMusicPerformance8 *iface, DMUS
429
427
if (next -> pMsg .rtTime >= message -> pMsg .rtTime ) break ;
430
428
list_add_before (& next -> entry , & message -> entry );
431
429
432
- message -> bInUse = TRUE;
433
430
hr = S_OK ;
434
431
}
435
432
@@ -515,6 +512,7 @@ static HRESULT WINAPI performance_AllocPMsg(IDirectMusicPerformance8 *iface, ULO
515
512
516
513
if (!(message = calloc (1 , size - sizeof (DMUS_PMSG ) + sizeof (struct message )))) return E_OUTOFMEMORY ;
517
514
message -> pMsg .dwSize = size ;
515
+ list_init (& message -> entry );
518
516
* msg = & message -> pMsg ;
519
517
520
518
return S_OK ;
@@ -532,7 +530,7 @@ static HRESULT WINAPI performance_FreePMsg(IDirectMusicPerformance8 *iface, DMUS
532
530
message = DMUS_PMSGToItem (msg );
533
531
534
532
EnterCriticalSection (& This -> safe );
535
- hr = message -> bInUse ? DMUS_E_CANNOT_FREE : S_OK ;
533
+ hr = ! list_empty ( & message -> entry ) ? DMUS_E_CANNOT_FREE : S_OK ;
536
534
LeaveCriticalSection (& This -> safe );
537
535
538
536
if (SUCCEEDED (hr ))
0 commit comments