[DSOUND] little patch

Robert Reif reif at earthlink.net
Thu Mar 10 20:40:10 CST 2005


Raphael wrote:

>Hi
>
>Changelog:
> - try to have better match caps with hw caps so games can active more hw 
>support
>
>Regards,
>Raphael
>  
>
> 
>-	This->lock.DebugInfo->Spare[1] = 0;
>+	/*This->lock.DebugInfo->Spare[1] = 0;*/
> 	DeleteCriticalSection(&(This->lock));
>  
>
You have to zero this out or DeleteCriticalSection will try
to delete that static memory.

>+    if (pDS->drvcaps.dwFlags | DSCAPS_PRIMARYMONO)  pDS->pwfx->nChannels = 1;
>+    if (pDS->drvcaps.dwFlags | DSCAPS_PRIMARY16BIT) pDS->pwfx->wBitsPerSample = 16;
>+    pDS->pwfx->nBlockAlign     = pDS->pwfx->wBitsPerSample * pDS->pwfx->nChannels / 8;
>+    pDS->pwfx->nAvgBytesPerSec = pDS->pwfx->nSamplesPerSec * pDS->pwfx->nBlockAlign;
>+
>
You can't do this and be compatible with windows.

> 
>+#ifndef __WINE_DSOUND_PRIVATE_H
>+#define __WINE_DSOUND_PRIVATE_H
>
You can't include this more than once because there is only one .h file
so it's not really necessary.

>+#define WINE_SET_CS_NAME(cs, name) (cs)->DebugInfo->Spare[1] = (DWORD) name
>+#define WINE_GET_CS_NAME(cs) (const char*) (cs)->lock.DebugInfo->Spare[1]
>  
>
This is a wine specific trick and should probably be put somewhere global so
all users can be consistent.  The name should have DEBUG in it somewhere.




More information about the wine-devel mailing list