From 0ae74c2a9b2b59e1414522e162c51b1d83b7cb77 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Wed, 28 Jan 2009 01:07:25 +0100 Subject: [PATCH] dsound: Use UlongToHandle to make the real payload a HWAVEIN/HWAVEOUT. Fixes Win64 compiler warnings. --- dlls/dsound/capture.c | 10 ++--- dlls/dsound/dsound_main.c | 8 ++-- dlls/dsound/propset.c | 88 +++++++++++++++++++-------------------- 3 files changed, 53 insertions(+), 53 deletions(-) diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c index 6fefcfacd9e..1e32d7feec0 100644 --- a/dlls/dsound/capture.c +++ b/dlls/dsound/capture.c @@ -289,7 +289,7 @@ DirectSoundCaptureEnumerateA( if (GetDeviceID(&DSDEVID_DefaultCapture, &guid) == DS_OK) { for (wid = 0; wid < devs; ++wid) { if (IsEqualGUID( &guid, &DSOUND_capture_guids[wid] ) ) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", "Primary Sound Capture Driver",desc.szDrvname,lpContext); @@ -302,7 +302,7 @@ DirectSoundCaptureEnumerateA( } for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", debugstr_guid(&DSOUND_capture_guids[wid]),desc.szDesc,desc.szDrvname,lpContext); @@ -351,7 +351,7 @@ DirectSoundCaptureEnumerateW( if (GetDeviceID(&DSDEVID_DefaultCapture, &guid) == DS_OK) { for (wid = 0; wid < devs; ++wid) { if (IsEqualGUID( &guid, &DSOUND_capture_guids[wid] ) ) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", "Primary Sound Capture Driver",desc.szDrvname,lpContext); @@ -368,7 +368,7 @@ DirectSoundCaptureEnumerateW( } for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", debugstr_guid(&DSOUND_capture_guids[wid]),desc.szDesc,desc.szDrvname,lpContext); @@ -1550,7 +1550,7 @@ HRESULT DirectSoundCaptureDevice_Initialize( device->driver = NULL; if (ds_hw_accel != DS_HW_ACCEL_EMULATION) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&(device->driver),0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&device->driver,0)); if ( (err != DS_OK) && (err != DSERR_UNSUPPORTED) ) { WARN("waveInMessage failed; err=%x\n",err); return err; diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index 82f6a8cbddc..44897bc9946 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -308,7 +308,7 @@ HRESULT WINAPI DirectSoundEnumerateA( if (GetDeviceID(&DSDEVID_DefaultPlayback, &guid) == DS_OK) { for (wod = 0; wod < devs; ++wod) { if (IsEqualGUID( &guid, &DSOUND_renderer_guids[wod]) ) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", "Primary Sound Driver","",lpContext); @@ -321,7 +321,7 @@ HRESULT WINAPI DirectSoundEnumerateA( } for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", debugstr_guid(&DSOUND_renderer_guids[wod]),desc.szDesc,desc.szDrvname,lpContext); @@ -370,7 +370,7 @@ HRESULT WINAPI DirectSoundEnumerateW( static const WCHAR empty[] = { 0 }; for (wod = 0; wod < devs; ++wod) { if (IsEqualGUID( &guid, &DSOUND_renderer_guids[wod] ) ) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", "Primary Sound Driver",desc.szDrvname,lpContext); @@ -385,7 +385,7 @@ HRESULT WINAPI DirectSoundEnumerateW( } for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", debugstr_guid(&DSOUND_renderer_guids[wod]),desc.szDesc,desc.szDrvname,lpContext); diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c index 00a3120713f..4b6d77e76b2 100644 --- a/dlls/dsound/propset.c +++ b/dlls/dsound/propset.c @@ -447,14 +447,14 @@ static HRESULT DSPROPERTY_Description1( DSDRIVERDESC desc; ppd->WaveDeviceId = wod; ppd->Devnode = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA)); lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA)); 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_PTR)&drv, 0)); + err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -478,14 +478,14 @@ static HRESULT DSPROPERTY_Description1( DSDRIVERDESC desc; ppd->WaveDeviceId = wid; ppd->Devnode = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA)); lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA)); 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_PTR)&drv,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -510,14 +510,14 @@ static HRESULT DSPROPERTY_Description1( ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; ppd->Devnode = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA)); lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA)); 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_PTR)&drv, 0)); + err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -543,14 +543,14 @@ static HRESULT DSPROPERTY_Description1( ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; ppd->WaveDeviceId = wid; ppd->Devnode = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA)); lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA)); 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_PTR)&drv, 0)); + err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -622,7 +622,7 @@ static HRESULT DSPROPERTY_DescriptionA( if (IsEqualGUID( &dev_guid, &DSOUND_renderer_guids[wod] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -638,7 +638,7 @@ static HRESULT DSPROPERTY_DescriptionA( ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); + err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -671,7 +671,7 @@ static HRESULT DSPROPERTY_DescriptionA( if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -687,7 +687,7 @@ static HRESULT DSPROPERTY_DescriptionA( ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -719,7 +719,7 @@ static HRESULT DSPROPERTY_DescriptionA( TRACE("DSOUND_renderer_guids[%d]\n", wod); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -735,7 +735,7 @@ static HRESULT DSPROPERTY_DescriptionA( ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); + err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -767,7 +767,7 @@ static HRESULT DSPROPERTY_DescriptionA( DSDRIVERDESC desc; TRACE("DSOUND_capture_guids[%d]\n", wid); ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -783,7 +783,7 @@ static HRESULT DSPROPERTY_DescriptionA( ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -863,7 +863,7 @@ static HRESULT DSPROPERTY_DescriptionW( DSDRIVERDESC desc; TRACE("DSOUND_renderer_guids[%d]\n", wod); ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -879,7 +879,7 @@ static HRESULT DSPROPERTY_DescriptionW( ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); + err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -912,7 +912,7 @@ static HRESULT DSPROPERTY_DescriptionW( if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -928,7 +928,7 @@ static HRESULT DSPROPERTY_DescriptionW( ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -960,7 +960,7 @@ static HRESULT DSPROPERTY_DescriptionW( TRACE("DSOUND_renderer_guids[%d]\n", wod); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -976,7 +976,7 @@ static HRESULT DSPROPERTY_DescriptionW( ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); + err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1008,7 +1008,7 @@ static HRESULT DSPROPERTY_DescriptionW( DSDRIVERDESC desc; TRACE("DSOUND_capture_guids[%d]\n", wid); ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -1024,7 +1024,7 @@ static HRESULT DSPROPERTY_DescriptionW( ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1078,7 +1078,7 @@ static HRESULT DSPROPERTY_Enumerate1( devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; ZeroMemory(&data, sizeof(data)); @@ -1092,7 +1092,7 @@ static HRESULT DSPROPERTY_Enumerate1( MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW)/sizeof(WCHAR) ); data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); + err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1105,7 +1105,7 @@ static HRESULT DSPROPERTY_Enumerate1( devs = waveInGetNumDevs(); for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; ZeroMemory(&data, sizeof(data)); @@ -1119,7 +1119,7 @@ static HRESULT DSPROPERTY_Enumerate1( MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW)/sizeof(WCHAR) ); data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); + err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1160,14 +1160,14 @@ static HRESULT DSPROPERTY_EnumerateA( devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { DWORD size; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0)); if (err == DS_OK) { WCHAR * nameW = HeapAlloc(GetProcessHeap(),0,size); if (nameW) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDEVICEINTERFACE,(DWORD_PTR)nameW,size)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDEVICEINTERFACE,(DWORD_PTR)nameW,size)); if (err == DS_OK) { CHAR * szInterface = HeapAlloc(GetProcessHeap(),0,size/sizeof(WCHAR)); if (szInterface) { @@ -1182,7 +1182,7 @@ static HRESULT DSPROPERTY_EnumerateA( data.Interface = szInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); + err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1201,14 +1201,14 @@ static HRESULT DSPROPERTY_EnumerateA( devs = waveInGetNumDevs(); for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { DWORD size; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0)); if (err == DS_OK) { WCHAR * nameW = HeapAlloc(GetProcessHeap(),0,size); if (nameW) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDEVICEINTERFACE,(DWORD_PTR)nameW,size)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDEVICEINTERFACE,(DWORD_PTR)nameW,size)); if (err == DS_OK) { CHAR * szInterface = HeapAlloc(GetProcessHeap(),0,size/sizeof(WCHAR)); if (szInterface) { @@ -1223,7 +1223,7 @@ static HRESULT DSPROPERTY_EnumerateA( data.Interface = szInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); + err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1270,17 +1270,17 @@ static HRESULT DSPROPERTY_EnumerateW( devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200); WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200); if (wDescription && wModule) { DWORD size; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDEVICEINTERFACESIZE, (DWORD_PTR)&size, 0)); + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDEVICEINTERFACESIZE, (DWORD_PTR)&size, 0)); if (err == DS_OK) { WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,size); if (wInterface) { - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDEVICEINTERFACE, (DWORD_PTR)wInterface, size)); + err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDEVICEINTERFACE, (DWORD_PTR)wInterface, size)); if (err == DS_OK) { PIDSCDRIVER drv; ZeroMemory(&data, sizeof(data)); @@ -1296,7 +1296,7 @@ static HRESULT DSPROPERTY_EnumerateW( data.Interface = wInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); + err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1316,17 +1316,17 @@ static HRESULT DSPROPERTY_EnumerateW( devs = waveInGetNumDevs(); for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200); WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200); if (wDescription && wModule) { DWORD size; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDEVICEINTERFACESIZE, (DWORD_PTR)&size, 0)); + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDEVICEINTERFACESIZE, (DWORD_PTR)&size, 0)); if (err == DS_OK) { WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,size); if (wInterface) { - err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDEVICEINTERFACE, (DWORD_PTR)wInterface, size)); + err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDEVICEINTERFACE, (DWORD_PTR)wInterface, size)); if (err == DS_OK) { PIDSCDRIVER drv; ZeroMemory(&data, sizeof(data)); @@ -1341,7 +1341,7 @@ static HRESULT DSPROPERTY_EnumerateW( data.Module = wModule; data.Interface = wInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); + err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else