From 7bf4eee7ad1c9fb7d3cca6d8c0648c0b9a6354f6 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Fri, 20 Aug 2004 20:01:31 +0000 Subject: [PATCH] Remove wine specific DRV_QUERYDSOUNDGUID message and calculate it in dsound.dll (like in 2k/xp). --- dlls/dsound/capture.c | 91 ++++----- dlls/dsound/dsound.c | 19 +- dlls/dsound/dsound_main.c | 133 ++++++------ dlls/dsound/dsound_private.h | 3 + dlls/dsound/propset.c | 359 +++++++++++++++------------------ dlls/winmm/lolvldrv.c | 1 - dlls/winmm/winealsa/audio.c | 34 ---- dlls/winmm/winearts/audio.c | 8 - dlls/winmm/wineaudioio/audio.c | 16 -- dlls/winmm/winejack/audio.c | 8 - dlls/winmm/winenas/audio.c | 8 - dlls/winmm/wineoss/audio.c | 31 --- include/mmddk.h | 1 - 13 files changed, 273 insertions(+), 439 deletions(-) diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c index c42ec1d761..cce7881bc4 100644 --- a/dlls/dsound/capture.c +++ b/dlls/dsound/capture.c @@ -80,7 +80,6 @@ static IDirectSoundCaptureBuffer8Vtbl dscbvt; static IDirectSoundFullDuplexVtbl dsfdvt; static IDirectSoundCaptureImpl* dsound_capture = NULL; -static GUID capture_guids[MAXWAVEDRIVERS]; static const char * captureStateString[] = { "STATE_STOPPED", @@ -197,20 +196,16 @@ DirectSoundCaptureEnumerateA( devs = waveInGetNumDevs(); if (devs > 0) { if (GetDeviceID(&DSDEVID_DefaultCapture, &guid) == DS_OK) { - GUID temp; for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&temp,0)); - if (err == DS_OK) { - if (IsEqualGUID( &guid, &temp ) ) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); - if (err == DS_OK) { - TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", - "Primary Sound Capture Driver",desc.szDrvName,lpContext); - if (lpDSEnumCallback(NULL, "Primary Sound Capture Driver", desc.szDrvName, lpContext) == FALSE) - return DS_OK; - } - } - } + if (IsEqualGUID( &guid, &capture_guids[wid] ) ) { + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + if (err == DS_OK) { + TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", + "Primary Sound Capture Driver",desc.szDrvName,lpContext); + if (lpDSEnumCallback(NULL, "Primary Sound Capture Driver", desc.szDrvName, lpContext) == FALSE) + return DS_OK; + } + } } } } @@ -218,13 +213,10 @@ DirectSoundCaptureEnumerateA( for (wid = 0; wid < devs; ++wid) { err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); if (err == DS_OK) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&capture_guids[wid],0)); - if (err == DS_OK) { - TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", - debugstr_guid(&capture_guids[wid]),desc.szDesc,desc.szDrvName,lpContext); - if (lpDSEnumCallback(&capture_guids[wid], desc.szDesc, desc.szDrvName, lpContext) == FALSE) - return DS_OK; - } + TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", + debugstr_guid(&capture_guids[wid]),desc.szDesc,desc.szDrvName,lpContext); + if (lpDSEnumCallback(&capture_guids[wid], desc.szDesc, desc.szDrvName, lpContext) == FALSE) + return DS_OK; } } @@ -266,24 +258,20 @@ DirectSoundCaptureEnumerateW( devs = waveInGetNumDevs(); if (devs > 0) { if (GetDeviceID(&DSDEVID_DefaultCapture, &guid) == DS_OK) { - GUID temp; for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&temp,0)); - if (err == DS_OK) { - if (IsEqualGUID( &guid, &temp ) ) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); - if (err == DS_OK) { - TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", - "Primary Sound Capture Driver",desc.szDrvName,lpContext); - MultiByteToWideChar( CP_ACP, 0, "Primary Sound Capture Driver", -1, - wDesc, sizeof(wDesc)/sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, - wName, sizeof(wName)/sizeof(WCHAR) ); - if (lpDSEnumCallback(NULL, wDesc, wName, lpContext) == FALSE) - return DS_OK; - } - } - } + if (IsEqualGUID( &guid, &capture_guids[wid] ) ) { + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + if (err == DS_OK) { + TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", + "Primary Sound Capture Driver",desc.szDrvName,lpContext); + MultiByteToWideChar( CP_ACP, 0, "Primary Sound Capture Driver", -1, + wDesc, sizeof(wDesc)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, + wName, sizeof(wName)/sizeof(WCHAR) ); + if (lpDSEnumCallback(NULL, wDesc, wName, lpContext) == FALSE) + return DS_OK; + } + } } } } @@ -291,17 +279,14 @@ DirectSoundCaptureEnumerateW( for (wid = 0; wid < devs; ++wid) { err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); if (err == DS_OK) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&capture_guids[wid],0)); - if (err == DS_OK) { - TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", - debugstr_guid(&capture_guids[wid]),desc.szDesc,desc.szDrvName,lpContext); - MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, - wDesc, sizeof(wDesc)/sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, - wName, sizeof(wName)/sizeof(WCHAR) ); - if (lpDSEnumCallback((LPGUID)&capture_guids[wid], wDesc, wName, lpContext) == FALSE) - return DS_OK; - } + TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", + debugstr_guid(&capture_guids[wid]),desc.szDesc,desc.szDrvName,lpContext); + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, + wDesc, sizeof(wDesc)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, + wName, sizeof(wName)/sizeof(WCHAR) ); + if (lpDSEnumCallback((LPGUID)&capture_guids[wid], wDesc, wName, lpContext) == FALSE) + return DS_OK; } } @@ -552,13 +537,7 @@ IDirectSoundCaptureImpl_Initialize( /* enumerate WINMM audio devices and find the one we want */ for (wid=0; wid 0) { if (GetDeviceID(&DSDEVID_DefaultPlayback, &guid) == DS_OK) { - GUID temp; for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)&temp,0)); - if (err == DS_OK) { - if (IsEqualGUID( &guid, &temp ) ) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); - if (err == DS_OK) { - TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", - "Primary Sound Driver",desc.szDrvName,lpContext); - if (lpDSEnumCallback(NULL, "Primary Sound Driver", desc.szDrvName, lpContext) == FALSE) - return DS_OK; - } + if (IsEqualGUID( &guid, &renderer_guids[wod]) ) { + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + if (err == DS_OK) { + TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", + "Primary Sound Driver",desc.szDrvName,lpContext); + if (lpDSEnumCallback(NULL, "Primary Sound Driver", desc.szDrvName, lpContext) == FALSE) + return DS_OK; } } } @@ -365,13 +354,10 @@ HRESULT WINAPI DirectSoundEnumerateA( for (wod = 0; wod < devs; ++wod) { err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); if (err == DS_OK) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)&device_guids[wod],0)); - if (err == DS_OK) { - TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", - debugstr_guid(&device_guids[wod]),desc.szDesc,desc.szDrvName,lpContext); - if (lpDSEnumCallback(&device_guids[wod], desc.szDesc, desc.szDrvName, lpContext) == FALSE) - return DS_OK; - } + TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", + debugstr_guid(&renderer_guids[wod]),desc.szDesc,desc.szDrvName,lpContext); + if (lpDSEnumCallback(&renderer_guids[wod], desc.szDesc, desc.szDrvName, lpContext) == FALSE) + return DS_OK; } } return DS_OK; @@ -412,22 +398,18 @@ HRESULT WINAPI DirectSoundEnumerateW( devs = waveOutGetNumDevs(); if (devs > 0) { if (GetDeviceID(&DSDEVID_DefaultPlayback, &guid) == DS_OK) { - GUID temp; for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)&temp,0)); - if (err == DS_OK) { - if (IsEqualGUID( &guid, &temp ) ) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); - if (err == DS_OK) { - TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", - "Primary Sound Driver",desc.szDrvName,lpContext); - MultiByteToWideChar( CP_ACP, 0, "Primary Sound Driver", -1, - wDesc, sizeof(wDesc)/sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, - wName, sizeof(wName)/sizeof(WCHAR) ); - if (lpDSEnumCallback(NULL, wDesc, wName, lpContext) == FALSE) - return DS_OK; - } + if (IsEqualGUID( &guid, &renderer_guids[wod] ) ) { + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + if (err == DS_OK) { + TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", + "Primary Sound Driver",desc.szDrvName,lpContext); + MultiByteToWideChar( CP_ACP, 0, "Primary Sound Driver", -1, + wDesc, sizeof(wDesc)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, + wName, sizeof(wName)/sizeof(WCHAR) ); + if (lpDSEnumCallback(NULL, wDesc, wName, lpContext) == FALSE) + return DS_OK; } } } @@ -437,17 +419,14 @@ HRESULT WINAPI DirectSoundEnumerateW( for (wod = 0; wod < devs; ++wod) { err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); if (err == DS_OK) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)&device_guids[wod],0)); - if (err == DS_OK) { - TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", - debugstr_guid(&device_guids[wod]),desc.szDesc,desc.szDrvName,lpContext); - MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, - wDesc, sizeof(wDesc)/sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, - wName, sizeof(wName)/sizeof(WCHAR) ); - if (lpDSEnumCallback(&device_guids[wod], wDesc, wName, lpContext) == FALSE) - return DS_OK; - } + TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", + debugstr_guid(&renderer_guids[wod]),desc.szDesc,desc.szDrvName,lpContext); + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, + wDesc, sizeof(wDesc)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, + wName, sizeof(wName)/sizeof(WCHAR) ); + if (lpDSEnumCallback(&renderer_guids[wod], wDesc, wName, lpContext) == FALSE) + return DS_OK; } } return DS_OK; @@ -678,3 +657,35 @@ DWORD WINAPI DSOUND_DllCanUnloadNow(void) FIXME("(void): stub\n"); return S_FALSE; } + +#define INIT_GUID(guid, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + guid.Data1 = l; guid.Data2 = w1; guid.Data3 = w2; \ + guid.Data4[0] = b1; guid.Data4[1] = b2; guid.Data4[2] = b3; \ + guid.Data4[3] = b4; guid.Data4[4] = b5; guid.Data4[5] = b6; \ + guid.Data4[6] = b7; guid.Data4[7] = b8; + +/*********************************************************************** + * DllMain (DSOUND.init) + */ +BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + int i; + TRACE("(%p 0x%lx %p)\n", hInstDLL, fdwReason, lpvReserved); + + switch (fdwReason) { + case DLL_PROCESS_ATTACH: + TRACE("DLL_PROCESS_ATTACH\n"); + for (i = 0; i < MAXWAVEDRIVERS; i++) { + INIT_GUID(renderer_guids[i], 0xbd6dd71a, 0x3deb, 0x11d1, 0xb1, 0x71, 0x00, 0xc0, 0x4f, 0xc2, 0x00, 0x00 + i); + INIT_GUID(capture_guids[i], 0xbd6dd71b, 0x3deb, 0x11d1, 0xb1, 0x71, 0x00, 0xc0, 0x4f, 0xc2, 0x00, 0x00 + i); + } + break; + case DLL_PROCESS_DETACH: + TRACE("DLL_PROCESS_DETACH\n"); + break; + default: + TRACE("UNKNOWN REASON\n"); + break; + } + return TRUE; +} diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 0de1eb1d15..f4694331d5 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -489,6 +489,9 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb); extern IDirectSoundImpl* dsound; +extern GUID renderer_guids[MAXWAVEDRIVERS]; +extern GUID capture_guids[MAXWAVEDRIVERS]; + extern HRESULT mmErr(UINT err); extern void setup_dsound_options(void); extern const char * get_device_id(LPCGUID pGuid); diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c index b0fad2a4e1..241affa75a 100644 --- a/dlls/dsound/propset.c +++ b/dlls/dsound/propset.c @@ -378,32 +378,26 @@ static HRESULT WINAPI DSPROPERTY_Description1( ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; wodn = waveOutGetNumDevs(); for (wod = 0; wod < wodn; wod++) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0)); - if (err == DS_OK) { - if (IsEqualGUID( &dev_guid, &guid) ) { - DSDRIVERDESC desc; - ppd->WaveDeviceId = wod; - ppd->Devnode = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); - if (err == DS_OK) { - PIDSDRIVER drv = NULL; - strncpy(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA) - 1); - strncpy(ppd->ModuleA, desc.szDrvName, sizeof(ppd->ModuleA) - 1); - MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); - if (err == DS_OK && drv) - ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; - break; - } else { - WARN("waveOutMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } - } - } else { - WARN("waveOutMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } + if (IsEqualGUID( &dev_guid, &renderer_guids[wod] ) ) { + DSDRIVERDESC desc; + ppd->WaveDeviceId = wod; + ppd->Devnode = wod; + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + if (err == DS_OK) { + PIDSDRIVER drv = NULL; + strncpy(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA) - 1); + strncpy(ppd->ModuleA, desc.szDrvName, sizeof(ppd->ModuleA) - 1); + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + if (err == DS_OK && drv) + ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; + break; + } else { + WARN("waveOutMessage failed\n"); + return E_PROP_ID_UNSUPPORTED; + } + } } } else if ( IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultCapture) || IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) { @@ -413,33 +407,26 @@ static HRESULT WINAPI DSPROPERTY_Description1( ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; widn = waveInGetNumDevs(); for (wid = 0; wid < widn; wid++) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0)); - if (err == DS_OK) { - if (IsEqualGUID( &dev_guid, &guid) ) { - DSDRIVERDESC desc; - ppd->WaveDeviceId = wid; - ppd->Devnode = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); - if (err == DS_OK) { - PIDSCDRIVER drv; - strncpy(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA) - 1); - strncpy(ppd->ModuleA, desc.szDrvName, sizeof(ppd->ModuleA) - 1); - MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); - if (err == DS_OK && drv) - ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; - break; - } else { - WARN("waveInMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } - break; - } - } else { - WARN("waveInMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } + if (IsEqualGUID( &dev_guid, &guid) ) { + DSDRIVERDESC desc; + ppd->WaveDeviceId = wid; + ppd->Devnode = wid; + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + if (err == DS_OK) { + PIDSCDRIVER drv; + strncpy(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA) - 1); + strncpy(ppd->ModuleA, desc.szDrvName, sizeof(ppd->ModuleA) - 1); + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); + if (err == DS_OK && drv) + ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; + break; + } else { + WARN("waveInMessage failed\n"); + return E_PROP_ID_UNSUPPORTED; + } + } } } else { BOOL found = FALSE; @@ -448,40 +435,66 @@ static HRESULT WINAPI DSPROPERTY_Description1( /* given specific device so try the render devices first */ wodn = waveOutGetNumDevs(); for (wod = 0; wod < wodn; wod++) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0)); - if (err == DS_OK) { - if (IsEqualGUID( &ppd->DeviceId, &guid) ) { - DSDRIVERDESC desc; - TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); - ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; - ppd->WaveDeviceId = wod; - ppd->Devnode = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); - if (err == DS_OK) { - PIDSDRIVER drv = NULL; - strncpy(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA) - 1); - strncpy(ppd->ModuleA, desc.szDrvName, sizeof(ppd->ModuleA) - 1); - MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); - if (err == DS_OK && drv) - ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; - found = TRUE; - break; - } else { - WARN("waveOutMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } - } - } else { - WARN("waveOutMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } + if (IsEqualGUID( &ppd->DeviceId, &renderer_guids[wod] ) ) { + DSDRIVERDESC desc; + TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); + ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; + ppd->WaveDeviceId = wod; + ppd->Devnode = wod; + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + if (err == DS_OK) { + PIDSDRIVER drv = NULL; + strncpy(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA) - 1); + strncpy(ppd->ModuleA, desc.szDrvName, sizeof(ppd->ModuleA) - 1); + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + if (err == DS_OK && drv) + ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; + found = TRUE; + break; + } else { + WARN("waveOutMessage failed\n"); + return E_PROP_ID_UNSUPPORTED; + } + } } if (found == FALSE) { - WARN("device not found\n"); - return E_PROP_ID_UNSUPPORTED; + ULONG wid; + int widn; + /* given specific device so try the capture devices next */ + widn = waveInGetNumDevs(); + for (wid = 0; wid < widn; wid++) { + if (IsEqualGUID( &ppd->DeviceId, &capture_guids[wid] ) ) { + DSDRIVERDESC desc; + TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n"); + ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; + ppd->WaveDeviceId = wid; + ppd->Devnode = wid; + err = mmErr(waveInMessage((HWAVEIN)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + if (err == DS_OK) { + PIDSDRIVER drv = NULL; + strncpy(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA) - 1); + strncpy(ppd->ModuleA, desc.szDrvName, sizeof(ppd->ModuleA) - 1); + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); + err = mmErr(waveInMessage((HWAVEIN)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + if (err == DS_OK && drv) + ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; + found = TRUE; + break; + } else { + WARN("waveInMessage failed\n"); + return E_PROP_ID_UNSUPPORTED; + } + } + } + + if (found == FALSE) { + WARN("device not found\n"); + return E_PROP_ID_UNSUPPORTED; + } } } @@ -501,7 +514,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( { PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA) pPropData; HRESULT err; - GUID guid, dev_guid; + GUID dev_guid; TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n", debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned); @@ -531,9 +544,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; wodn = waveOutGetNumDevs(); for (wod = 0; wod < wodn; wod++) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0)); - if (err == DS_OK) { - if (IsEqualGUID( &dev_guid, &guid) ) { + if (IsEqualGUID( &dev_guid, &renderer_guids[wod] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wod; err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); @@ -560,10 +571,6 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( return E_PROP_ID_UNSUPPORTED; } } - } else { - WARN("waveOutMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } } } else if (IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultCapture) || IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) { @@ -573,9 +580,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; widn = waveInGetNumDevs(); for (wid = 0; wid < widn; wid++) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0)); - if (err == DS_OK) { - if (IsEqualGUID( &dev_guid, &guid) ) { + if (IsEqualGUID( &dev_guid, &capture_guids[wid] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wid; err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); @@ -603,10 +608,6 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( } break; } - } else { - WARN("waveOutMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } } } else { BOOL found = FALSE; @@ -615,9 +616,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( /* given specific device so try the render devices first */ wodn = waveOutGetNumDevs(); for (wod = 0; wod < wodn; wod++) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0)); - if (err == DS_OK) { - if (IsEqualGUID( &ppd->DeviceId, &guid) ) { + if (IsEqualGUID( &ppd->DeviceId, &renderer_guids[wod] ) ) { DSDRIVERDESC desc; TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; @@ -647,10 +646,6 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( return E_PROP_ID_UNSUPPORTED; } } - } else { - WARN("waveOutMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } } if (found == FALSE) { @@ -675,7 +670,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( { PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA) pPropData; HRESULT err; - GUID guid, dev_guid; + GUID dev_guid; TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n", debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned); @@ -705,9 +700,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; wodn = waveOutGetNumDevs(); for (wod = 0; wod < wodn; wod++) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0)); - if (err == DS_OK) { - if (IsEqualGUID( &dev_guid, &guid) ) { + if (IsEqualGUID( &dev_guid, &renderer_guids[wod] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wod; err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); @@ -734,10 +727,6 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( return E_PROP_ID_UNSUPPORTED; } } - } else { - WARN("waveOutMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } } } else if (IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultCapture) || IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) { @@ -747,9 +736,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; widn = waveInGetNumDevs(); for (wid = 0; wid < widn; wid++) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0)); - if (err == DS_OK) { - if (IsEqualGUID( &dev_guid, &guid) ) { + if (IsEqualGUID( &dev_guid, &capture_guids[wid] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wid; err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); @@ -777,10 +764,6 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( } break; } - } else { - WARN("waveInMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } } } else { BOOL found = FALSE; @@ -789,9 +772,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( /* given specific device so try the render devices first */ wodn = waveOutGetNumDevs(); for (wod = 0; wod < wodn; wod++) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0)); - if (err == DS_OK) { - if (IsEqualGUID( &ppd->DeviceId, &guid) ) { + if (IsEqualGUID( &ppd->DeviceId, &renderer_guids[wod] ) ) { DSDRIVERDESC desc; TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; @@ -821,10 +802,6 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( return E_PROP_ID_UNSUPPORTED; } } - } else { - WARN("waveOutMessage failed\n"); - return E_PROP_ID_UNSUPPORTED; - } } if (found == FALSE) { @@ -868,25 +845,21 @@ static HRESULT WINAPI DSPROPERTY_EnumerateA( if (ppd->Callback) { unsigned devs, wod, wid; DSDRIVERDESC desc; - GUID guid; DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA data; devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); if (err == DS_OK) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0)); - if (err == DS_OK) { - memset(&data, 0, sizeof(data)); - data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; - data.WaveDeviceId = wod; - data.DeviceId = guid; - data.Description = desc.szDesc; - data.Module = desc.szDrvName; - data.Interface = "Interface"; - TRACE("calling Callback(%p,%p)\n", &data, ppd->Context); - (ppd->Callback)(&data, ppd->Context); - } + memset(&data, 0, sizeof(data)); + data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; + data.WaveDeviceId = wod; + data.DeviceId = renderer_guids[wod]; + data.Description = desc.szDesc; + data.Module = desc.szDrvName; + data.Interface = "Interface"; + TRACE("calling Callback(%p,%p)\n", &data, ppd->Context); + (ppd->Callback)(&data, ppd->Context); } } @@ -894,18 +867,15 @@ static HRESULT WINAPI DSPROPERTY_EnumerateA( for (wid = 0; wid < devs; ++wid) { err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); if (err == DS_OK) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0)); - if (err == DS_OK) { - memset(&data, 0, sizeof(data)); - data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; - data.WaveDeviceId = wid; - data.DeviceId = guid; - data.Description = desc.szDesc; - data.Module = desc.szDrvName; - data.Interface = "Interface"; - TRACE("calling Callback(%p,%p)\n", &data, ppd->Context); - (ppd->Callback)(&data, ppd->Context); - } + memset(&data, 0, sizeof(data)); + data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; + data.WaveDeviceId = wid; + data.DeviceId = capture_guids[wid]; + data.Description = desc.szDesc; + data.Module = desc.szDrvName; + data.Interface = "Interface"; + TRACE("calling Callback(%p,%p)\n", &data, ppd->Context); + (ppd->Callback)(&data, ppd->Context); } } @@ -940,35 +910,31 @@ static HRESULT WINAPI DSPROPERTY_EnumerateW( if (ppd->Callback) { unsigned devs, wod, wid; DSDRIVERDESC desc; - GUID guid; DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data; devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); if (err == DS_OK) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0)); - if (err == DS_OK) { - /* FIXME: this is a memory leak */ - WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200); - WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200); - WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,0x200); - - memset(&data, 0, sizeof(data)); - data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; - data.WaveDeviceId = wod; - data.DeviceId = guid; - - MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, wDescription, 0x100 ); - MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, wModule, 0x100 ); - MultiByteToWideChar( CP_ACP, 0, "Interface", -1, wInterface, 0x100 ); - - data.Description = wDescription; - data.Module = wModule; - data.Interface = wInterface; - TRACE("calling Callback(%p,%p)\n", &data, ppd->Context); - (ppd->Callback)(&data, ppd->Context); - } + /* FIXME: this is a memory leak */ + WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200); + WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200); + WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,0x200); + + memset(&data, 0, sizeof(data)); + data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; + data.WaveDeviceId = wod; + data.DeviceId = renderer_guids[wod]; + + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, wDescription, 0x100 ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, wModule, 0x100 ); + MultiByteToWideChar( CP_ACP, 0, "Interface", -1, wInterface, 0x100 ); + + data.Description = wDescription; + data.Module = wModule; + data.Interface = wInterface; + TRACE("calling Callback(%p,%p)\n", &data, ppd->Context); + (ppd->Callback)(&data, ppd->Context); } } @@ -976,28 +942,25 @@ static HRESULT WINAPI DSPROPERTY_EnumerateW( for (wid = 0; wid < devs; ++wid) { err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); if (err == DS_OK) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0)); - if (err == DS_OK) { - /* FIXME: this is a memory leak */ - WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200); - WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200); - WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,0x200); - - memset(&data, 0, sizeof(data)); - data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; - data.WaveDeviceId = wid; - data.DeviceId = guid; - - MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, wDescription, 0x100 ); - MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, wModule, 0x100 ); - MultiByteToWideChar( CP_ACP, 0, "Interface", -1, wInterface, 0x100 ); - - data.Description = wDescription; - data.Module = wModule; - data.Interface = wInterface; - TRACE("calling Callback(%p,%p)\n", &data, ppd->Context); - (ppd->Callback)(&data, ppd->Context); - } + /* FIXME: this is a memory leak */ + WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200); + WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200); + WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,0x200); + + memset(&data, 0, sizeof(data)); + data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; + data.WaveDeviceId = wid; + data.DeviceId = capture_guids[wid]; + + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, wDescription, 0x100 ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, wModule, 0x100 ); + MultiByteToWideChar( CP_ACP, 0, "Interface", -1, wInterface, 0x100 ); + + data.Description = wDescription; + data.Module = wModule; + data.Interface = wInterface; + TRACE("calling Callback(%p,%p)\n", &data, ppd->Context); + (ppd->Callback)(&data, ppd->Context); } } diff --git a/dlls/winmm/lolvldrv.c b/dlls/winmm/lolvldrv.c index 26e7c9b329..62a02b6c8b 100644 --- a/dlls/winmm/lolvldrv.c +++ b/dlls/winmm/lolvldrv.c @@ -512,7 +512,6 @@ UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, case DRV_QUERYDSOUNDIFACE: /* Wine-specific: Retrieve DirectSound interface */ case DRV_QUERYDSOUNDDESC: /* Wine-specific: Retrieve DirectSound driver description*/ - case DRV_QUERYDSOUNDGUID: /* Wine-specific: Retrieve DirectSound driver GUID */ return MMDRV_Message(mld, uMsg, dwParam1, dwParam2, TRUE); default: diff --git a/dlls/winmm/winealsa/audio.c b/dlls/winmm/winealsa/audio.c index d2d8ef78fa..53e06acdb7 100644 --- a/dlls/winmm/winealsa/audio.c +++ b/dlls/winmm/winealsa/audio.c @@ -188,7 +188,6 @@ typedef struct { /* DirectSound stuff */ DSDRIVERDESC ds_desc; - GUID ds_guid; } WINE_WAVEOUT; typedef struct { @@ -235,7 +234,6 @@ typedef struct { /* DirectSound stuff */ DSDRIVERDESC ds_desc; - GUID ds_guid; } WINE_WAVEIN; static WINE_WAVEOUT WOutDev [MAX_WAVEOUTDRV]; @@ -245,7 +243,6 @@ static DWORD ALSA_WidNumDevs; static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc); -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid); /* These strings used only for tracing */ static const char * getCmdString(enum win_wm_message msg) @@ -672,12 +669,6 @@ end: return result; } -#define INIT_GUID(guid, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - guid.Data1 = l; guid.Data2 = w1; guid.Data3 = w2; \ - guid.Data4[0] = b1; guid.Data4[1] = b2; guid.Data4[2] = b3; \ - guid.Data4[3] = b4; guid.Data4[4] = b5; guid.Data4[5] = b6; \ - guid.Data4[6] = b7; guid.Data4[7] = b8; - /****************************************************************** * ALSA_WaveInit * @@ -713,7 +704,6 @@ LONG ALSA_WaveInit(void) wwo->caps.dwSupport = WAVECAPS_VOLUME; strcpy(wwo->ds_desc.szDesc, "WineALSA DirectSound Driver"); strcpy(wwo->ds_desc.szDrvName, "winealsa.drv"); - INIT_GUID(wwo->ds_guid, 0xbd6dd71a, 0x3deb, 0x11d1, 0xb1, 0x71, 0x00, 0xc0, 0x4f, 0xc2, 0x00, 0x00 + 0); if (!wine_dlopen("libasound.so.2", RTLD_LAZY|RTLD_GLOBAL, NULL, 0)) { @@ -828,7 +818,6 @@ LONG ALSA_WaveInit(void) wwi->caps.dwSupport = WAVECAPS_VOLUME; strcpy(wwi->ds_desc.szDesc, "WineALSA DirectSound Driver"); strcpy(wwi->ds_desc.szDrvName, "winealsa.drv"); - INIT_GUID(wwi->ds_guid, 0xbd6dd71b, 0x3deb, 0x11d1, 0xb1, 0x71, 0x00, 0xc0, 0x4f, 0xc2, 0x00, 0x00 + 0); snd_pcm_info_alloca(&info); snd_pcm_hw_params_alloca(&hw_params); @@ -2173,7 +2162,6 @@ DWORD WINAPI ALSA_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, case DRV_QUERYDEVICEINTERFACE: return wodDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2); case DRV_QUERYDSOUNDIFACE: return wodDsCreate (wDevID, (PIDSDRIVER*)dwParam1); case DRV_QUERYDSOUNDDESC: return wodDsDesc (wDevID, (PDSDRIVERDESC)dwParam1); - case DRV_QUERYDSOUNDGUID: return wodDsGuid (wDevID, (LPGUID)dwParam1); default: FIXME("unknown message %d!\n", wMsg); @@ -2736,15 +2724,6 @@ static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc) return MMSYSERR_NOERROR; } -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid) -{ - TRACE("(%d,%p)\n",wDevID,pGuid); - - memcpy(pGuid, &(WOutDev[wDevID].ds_guid), sizeof(GUID)); - - return MMSYSERR_NOERROR; -} - /*======================================================================* * Low level WAVE IN implementation * *======================================================================*/ @@ -3550,18 +3529,6 @@ static DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc) return MMSYSERR_NOERROR; } -/************************************************************************** - * widDsGuid [internal] - */ -static DWORD widDsGuid(UINT wDevID, LPGUID pGuid) -{ - TRACE("(%d,%p)\n",wDevID,pGuid); - - memcpy(pGuid, &(WInDev[wDevID].ds_guid), sizeof(GUID)); - - return MMSYSERR_NOERROR; -} - /************************************************************************** * widMessage (WINEALSA.@) */ @@ -3593,7 +3560,6 @@ DWORD WINAPI ALSA_widMessage(UINT wDevID, UINT wMsg, DWORD dwUser, case DRV_QUERYDEVICEINTERFACE: return widDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2); case DRV_QUERYDSOUNDIFACE: return widDsCreate (wDevID, (PIDSCDRIVER*)dwParam1); case DRV_QUERYDSOUNDDESC: return widDsDesc (wDevID, (PDSDRIVERDESC)dwParam1); - case DRV_QUERYDSOUNDGUID: return widDsGuid (wDevID, (LPGUID)dwParam1); default: FIXME("unknown message %d!\n", wMsg); } diff --git a/dlls/winmm/winearts/audio.c b/dlls/winmm/winearts/audio.c index ed2f8254de..7bbb7bbdef 100644 --- a/dlls/winmm/winearts/audio.c +++ b/dlls/winmm/winearts/audio.c @@ -207,7 +207,6 @@ static WINE_WAVEIN WInDev [MAX_WAVEINDRV]; static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc); -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid); /* These strings used only for tracing */ static const char *wodPlayerCmdString[] = { @@ -1581,7 +1580,6 @@ DWORD WINAPI ARTS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, case DRV_QUERYDEVICEINTERFACE: return wodDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2); case DRV_QUERYDSOUNDIFACE: return wodDsCreate (wDevID, (PIDSDRIVER*)dwParam1); case DRV_QUERYDSOUNDDESC: return wodDsDesc (wDevID, (PDSDRIVERDESC)dwParam1); - case DRV_QUERYDSOUNDGUID: return wodDsGuid (wDevID, (LPGUID)dwParam1); default: FIXME("unknown message %d!\n", wMsg); } @@ -2133,12 +2131,6 @@ static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc) return MMSYSERR_NOERROR; } -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid) -{ - memcpy(pGuid, &DSDEVID_DefaultPlayback, sizeof(GUID)); - return MMSYSERR_NOERROR; -} - #else /* !HAVE_ARTS */ /************************************************************************** diff --git a/dlls/winmm/wineaudioio/audio.c b/dlls/winmm/wineaudioio/audio.c index 955b8fc701..378471fcfd 100644 --- a/dlls/winmm/wineaudioio/audio.c +++ b/dlls/winmm/wineaudioio/audio.c @@ -182,8 +182,6 @@ static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); static DWORD widDsCreate(UINT wDevID, PIDSCDRIVER* drv); static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc); static DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc); -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid); -static DWORD widDsGuid(UINT wDevID, LPGUID pGuid); static DWORD bytes_to_mmtime(LPMMTIME lpTime, DWORD position, PCMWAVEFORMAT* format) @@ -1262,7 +1260,6 @@ DWORD WINAPI LIBAUDIOIO_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, case DRV_QUERYDSOUNDIFACE: return wodDsCreate (wDevID, (PIDSDRIVER*)dwParam1); case DRV_QUERYDSOUNDDESC: return wodDsDesc (wDevID, (PDSDRIVERDESC)dwParam1); - case DRV_QUERYDSOUNDGUID: return wodDsGuid (wDevID, (LPGUID)dwParam1); default: FIXME("unknown message %d!\n", wMsg); } @@ -1706,12 +1703,6 @@ static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc) return MMSYSERR_NOERROR; } -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid) -{ - memcpy(pGuid, &DSDEVID_DefaultPlayback, sizeof(GUID)); - return MMSYSERR_NOERROR; -} - /*======================================================================* * Low level WAVE IN implementation * *======================================================================*/ @@ -2258,7 +2249,6 @@ DWORD WINAPI LIBAUDIOIO_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, case WIDM_STOP: return widStop (wDevID); case DRV_QUERYDSOUNDIFACE: return widDsCreate (wDevID, (PIDSCDRIVER*)dwParam1); case DRV_QUERYDSOUNDDESC: return widDsDesc (wDevID, (PDSDRIVERDESC)dwParam1); - case DRV_QUERYDSOUNDGUID: return widDsGuid (wDevID, (LPGUID)dwParam1); default: FIXME("unknown message %u!\n", wMsg); } @@ -2285,12 +2275,6 @@ static DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc) return MMSYSERR_NOERROR; } -static DWORD widDsGuid(UINT wDevID, LPGUID pGuid) -{ - memcpy(pGuid, &DSDEVID_DefaultCapture, sizeof(GUID)); - return MMSYSERR_NOERROR; -} - #else /* HAVE_LIBAUDIOIO */ /************************************************************************** diff --git a/dlls/winmm/winejack/audio.c b/dlls/winmm/winejack/audio.c index ffe35f1b5e..bb8c2733e4 100644 --- a/dlls/winmm/winejack/audio.c +++ b/dlls/winmm/winejack/audio.c @@ -195,7 +195,6 @@ static WINE_WAVEIN WInDev [MAX_WAVEINDRV ]; static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc); -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid); static LPWAVEHDR wodHelper_PlayPtrNext(WINE_WAVEOUT* wwo); static DWORD wodHelper_NotifyCompletions(WINE_WAVEOUT* wwo, BOOL force); @@ -1767,7 +1766,6 @@ DWORD WINAPI JACK_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, case DRV_QUERYDEVICEINTERFACE: return wodDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2); case DRV_QUERYDSOUNDIFACE: return wodDsCreate(wDevID, (PIDSDRIVER*)dwParam1); case DRV_QUERYDSOUNDDESC: return wodDsDesc(wDevID, (PDSDRIVERDESC)dwParam1); - case DRV_QUERYDSOUNDGUID: return wodDsGuid(wDevID, (LPGUID)dwParam1); default: FIXME("unknown message %d!\n", wMsg); } @@ -1818,12 +1816,6 @@ static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc) return MMSYSERR_NOERROR; } -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid) -{ - memcpy(pGuid, &DSDEVID_DefaultPlayback, sizeof(GUID)); - return MMSYSERR_NOERROR; -} - /*======================================================================* * Low level WAVE IN implementation * *======================================================================*/ diff --git a/dlls/winmm/winenas/audio.c b/dlls/winmm/winenas/audio.c index b4c0ab2927..3204a0a3ae 100644 --- a/dlls/winmm/winenas/audio.c +++ b/dlls/winmm/winenas/audio.c @@ -189,7 +189,6 @@ static WINE_WAVEOUT WOutDev [MAX_WAVEOUTDRV]; static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc); -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid); /* NASFUNC */ @@ -1286,7 +1285,6 @@ DWORD WINAPI NAS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, case DRV_QUERYDSOUNDIFACE: return wodDsCreate (wDevID, (PIDSDRIVER*)dwParam1); case DRV_QUERYDSOUNDDESC: return wodDsDesc (wDevID, (PDSDRIVERDESC)dwParam1); - case DRV_QUERYDSOUNDGUID: return wodDsGuid (wDevID, (LPGUID)dwParam1); default: FIXME("unknown message %d!\n", wMsg); } @@ -1313,12 +1311,6 @@ static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc) return MMSYSERR_NOERROR; } -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid) -{ - memcpy(pGuid, &DSDEVID_DefaultPlayback, sizeof(GUID)); - return MMSYSERR_NOERROR; -} - static int nas_init(void) { TRACE("NAS INIT\n"); if (!(AuServ = AuOpenServer(NULL, 0, NULL, 0, NULL, NULL))) diff --git a/dlls/winmm/wineoss/audio.c b/dlls/winmm/wineoss/audio.c index 92dd017f55..717d703d16 100644 --- a/dlls/winmm/wineoss/audio.c +++ b/dlls/winmm/wineoss/audio.c @@ -174,8 +174,6 @@ typedef struct tagOSS_DEVICE { DSDRIVERDESC ds_desc; DSDRIVERCAPS ds_caps; DSCDRIVERCAPS dsc_caps; - GUID ds_guid; - GUID dsc_guid; } OSS_DEVICE; static OSS_DEVICE OSS_Devices[MAX_WAVEDRV]; @@ -236,8 +234,6 @@ static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); static DWORD widDsCreate(UINT wDevID, PIDSCDRIVER* drv); static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc); static DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc); -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid); -static DWORD widDsGuid(UINT wDevID, LPGUID pGuid); /* These strings used only for tracing */ static const char * getCmdString(enum win_wm_message msg) @@ -308,7 +304,6 @@ static const char * getMessage(UINT msg) MSG_TO_STR(DRV_QUERYDEVICEINTERFACE); MSG_TO_STR(DRV_QUERYDSOUNDIFACE); MSG_TO_STR(DRV_QUERYDSOUNDDESC); - MSG_TO_STR(DRV_QUERYDSOUNDGUID); } #undef MSG_TO_STR sprintf(unknown, "UNKNOWN(0x%04x)", msg); @@ -1166,11 +1161,6 @@ static void OSS_WaveFullDuplexInit(OSS_DEVICE* ossdev) ossdev->duplex_out_caps.dwFormats, ossdev->duplex_out_caps.dwSupport); } -#define INIT_GUID(guid, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - guid.Data1 = l; guid.Data2 = w1; guid.Data3 = w2; \ - guid.Data4[0] = b1; guid.Data4[1] = b2; guid.Data4[2] = b3; \ - guid.Data4[3] = b4; guid.Data4[4] = b5; guid.Data4[5] = b6; \ - guid.Data4[6] = b7; guid.Data4[7] = b8; /****************************************************************** * OSS_WaveInit * @@ -1192,9 +1182,6 @@ LONG OSS_WaveInit(void) } sprintf(OSS_Devices[i].interface_name, "wineoss: %s", OSS_Devices[i].dev_name); - - INIT_GUID(OSS_Devices[i].ds_guid, 0xbd6dd71a, 0x3deb, 0x11d1, 0xb1, 0x71, 0x00, 0xc0, 0x4f, 0xc2, 0x00, 0x00 + i); - INIT_GUID(OSS_Devices[i].dsc_guid, 0xbd6dd71b, 0x3deb, 0x11d1, 0xb1, 0x71, 0x00, 0xc0, 0x4f, 0xc2, 0x00, 0x00 + i); } /* start with output devices */ @@ -2388,7 +2375,6 @@ DWORD WINAPI OSS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, case DRV_QUERYDEVICEINTERFACE: return wdDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2); case DRV_QUERYDSOUNDIFACE: return wodDsCreate (wDevID, (PIDSDRIVER*)dwParam1); case DRV_QUERYDSOUNDDESC: return wodDsDesc (wDevID, (PDSDRIVERDESC)dwParam1); - case DRV_QUERYDSOUNDGUID: return wodDsGuid (wDevID, (LPGUID)dwParam1); default: FIXME("unknown message %d!\n", wMsg); } @@ -3293,13 +3279,6 @@ static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc) return MMSYSERR_NOERROR; } -static DWORD wodDsGuid(UINT wDevID, LPGUID pGuid) -{ - TRACE("(%d,%p)\n",wDevID,pGuid); - memcpy(pGuid, &(WOutDev[wDevID].ossdev->ds_guid), sizeof(GUID)); - return MMSYSERR_NOERROR; -} - /*======================================================================* * Low level WAVE IN implementation * *======================================================================*/ @@ -4038,7 +4017,6 @@ DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, case DRV_QUERYDEVICEINTERFACE: return wdDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2); case DRV_QUERYDSOUNDIFACE: return widDsCreate (wDevID, (PIDSCDRIVER*)dwParam1); case DRV_QUERYDSOUNDDESC: return widDsDesc (wDevID, (PDSDRIVERDESC)dwParam1); - case DRV_QUERYDSOUNDGUID: return widDsGuid (wDevID, (LPGUID)dwParam1); default: FIXME("unknown message %u!\n", wMsg); } @@ -4889,15 +4867,6 @@ static DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc) return MMSYSERR_NOERROR; } -static DWORD widDsGuid(UINT wDevID, LPGUID pGuid) -{ - TRACE("(%d,%p)\n",wDevID,pGuid); - - memcpy(pGuid, &(WInDev[wDevID].ossdev->dsc_guid), sizeof(GUID)); - - return MMSYSERR_NOERROR; -} - #else /* !HAVE_OSS */ /************************************************************************** diff --git a/include/mmddk.h b/include/mmddk.h index 5ece749094..48f12b0fdc 100644 --- a/include/mmddk.h +++ b/include/mmddk.h @@ -91,7 +91,6 @@ typedef struct { #ifdef __WINESRC__ #define DRV_QUERYDSOUNDIFACE (DRV_RESERVED + 20) #define DRV_QUERYDSOUNDDESC (DRV_RESERVED + 21) -#define DRV_QUERYDSOUNDGUID (DRV_RESERVED + 22) #endif #define WODM_INIT DRVM_INIT -- 2.32.0.93.g670b81a890