From 261e376495e668a893f119648478140d2c776393 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 12 Sep 2005 15:14:06 +0000 Subject: [PATCH] Fixed a number of pointer to integer conversions that wouldn't work right on a 64-bit platform. --- dlls/advapi32/registry.c | 4 +- dlls/avifil32/getframe.c | 2 +- dlls/dbghelp/coff.c | 6 +-- dlls/dsound/capture.c | 12 +++--- dlls/dsound/dsound.c | 8 ++-- dlls/dsound/dsound_main.c | 8 ++-- dlls/dsound/primary.c | 4 +- dlls/dsound/propset.c | 72 ++++++++++++++++++------------------ dlls/kernel/dosmem.c | 4 +- dlls/kernel/kernel_private.h | 6 +-- dlls/msacm/format.c | 2 +- dlls/msacm/stream.c | 16 ++++---- dlls/msvcrt/cppexcept.c | 6 +-- dlls/msvcrt/locale.c | 4 +- dlls/ntdll/directory.c | 2 +- dlls/ntdll/exception.c | 2 +- dlls/ntdll/sec.c | 10 ++--- dlls/ntdll/virtual.c | 4 +- dlls/opengl32/wgl.c | 2 +- dlls/setupapi/queue.c | 2 +- dlls/user/caret.c | 2 +- dlls/user/exticon.c | 2 +- dlls/user/spy.c | 6 +-- dlls/version/info.c | 4 +- dlls/x11drv/event.c | 4 +- dlls/x11drv/keyboard.c | 4 +- include/windowsx.h | 28 +++++++------- tools/winebuild/res32.c | 2 +- tools/winedump/debug.c | 4 +- tools/wrc/newstruc.c | 6 +-- 30 files changed, 117 insertions(+), 121 deletions(-) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 1e57cee91ed..3ab02697cf8 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -100,7 +100,7 @@ inline static int is_version_nt(void) static HKEY create_special_root_hkey( HANDLE hkey, DWORD access ) { HKEY ret = 0; - int idx = (UINT)hkey - (UINT)HKEY_SPECIAL_ROOT_FIRST; + int idx = (UINT_PTR)hkey - (UINT_PTR)HKEY_SPECIAL_ROOT_FIRST; if (hkey == HKEY_CURRENT_USER) { @@ -135,7 +135,7 @@ inline static HKEY get_special_root_hkey( HKEY hkey ) if ((hkey >= HKEY_SPECIAL_ROOT_FIRST) && (hkey <= HKEY_SPECIAL_ROOT_LAST)) { - if (!(ret = special_root_keys[(UINT)hkey - (UINT)HKEY_SPECIAL_ROOT_FIRST])) + if (!(ret = special_root_keys[(UINT_PTR)hkey - (UINT_PTR)HKEY_SPECIAL_ROOT_FIRST])) ret = create_special_root_hkey( hkey, KEY_ALL_ACCESS ); } return ret; diff --git a/dlls/avifil32/getframe.c b/dlls/avifil32/getframe.c index 654cb918009..874d78fda5a 100644 --- a/dlls/avifil32/getframe.c +++ b/dlls/avifil32/getframe.c @@ -341,7 +341,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface, if (This->pStream == NULL) return AVIERR_ERROR; - if ((LONG)lpbiWanted == AVIGETFRAMEF_BESTDISPLAYFMT) { + if (lpbiWanted == (LPBITMAPINFOHEADER)AVIGETFRAMEF_BESTDISPLAYFMT) { lpbi = NULL; bBestDisplay = TRUE; } diff --git a/dlls/dbghelp/coff.c b/dlls/dbghelp/coff.c index 4b33f658b73..1c7dccbcb33 100644 --- a/dlls/dbghelp/coff.c +++ b/dlls/dbghelp/coff.c @@ -174,10 +174,8 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) coff = (const IMAGE_COFF_SYMBOLS_HEADER*)msc_dbg->root; - coff_symbols = (const IMAGE_SYMBOL*)((unsigned int)coff + - coff->LvaToFirstSymbol); - coff_linetab = (const IMAGE_LINENUMBER*)((unsigned int)coff + - coff->LvaToFirstLinenumber); + coff_symbols = (const IMAGE_SYMBOL*)((const char *)coff + coff->LvaToFirstSymbol); + coff_linetab = (const IMAGE_LINENUMBER*)((const char *)coff + coff->LvaToFirstLinenumber); coff_strtab = (const char*)(coff_symbols + coff->NumberOfSymbols); linetab_indx = 0; diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c index b956cccd971..d173a629b90 100644 --- a/dlls/dsound/capture.c +++ b/dlls/dsound/capture.c @@ -308,7 +308,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)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)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); @@ -321,7 +321,7 @@ DirectSoundCaptureEnumerateA( } for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)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); @@ -370,7 +370,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)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)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); @@ -387,7 +387,7 @@ DirectSoundCaptureEnumerateW( } for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)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); @@ -681,7 +681,7 @@ IDirectSoundCaptureImpl_Initialize( This->device = device; device->guid = devGUID; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&(This->device->driver),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&(This->device->driver),0)); if ( (err != DS_OK) && (err != DSERR_UNSUPPORTED) ) { WARN("waveInMessage failed; err=%lx\n",err); return err; @@ -896,7 +896,7 @@ DSOUND_CreateDirectSoundCaptureBuffer( flags |= WAVE_DIRECTSOUND; err = mmErr(waveInOpen(&(ipDSC->device->hwi), ipDSC->device->drvdesc.dnDevNode, ipDSC->device->pwfx, - (DWORD)DSOUND_capture_callback, (DWORD)ipDSC->device, flags)); + (DWORD_PTR)DSOUND_capture_callback, (DWORD)ipDSC->device, flags)); if (err != DS_OK) { WARN("waveInOpen failed\n"); This->dsound->device->capture_buffer = 0; diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index c04caa4096e..0af1961a7a5 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -468,7 +468,7 @@ static HRESULT WINAPI IDirectSoundImpl_DuplicateSoundBuffer( } /* FIXME: hack to make sure we have a secondary buffer */ - if ((DWORD)((SecondaryBufferImpl *)psb)->dsb == (DWORD)This) { + if ((IDirectSoundImpl *)((SecondaryBufferImpl *)psb)->dsb == This) { WARN("trying to duplicate primary buffer\n"); *ppdsb = NULL; return DSERR_INVALIDCALL; @@ -711,7 +711,7 @@ static HRESULT WINAPI IDirectSoundImpl_Initialize( device->guid = devGUID; /* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */ - waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&device->driver, 0); + waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&device->driver, 0); /* Disable the direct sound driver to force emulation if requested. */ if (ds_hw_accel == DS_HW_ACCEL_EMULATION) @@ -744,7 +744,7 @@ static HRESULT WINAPI IDirectSoundImpl_Initialize( hr = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, device->pwfx, - (DWORD)DSOUND_callback, (DWORD)device, + (DWORD_PTR)DSOUND_callback, (DWORD)device, flags)); if (hr != DS_OK) { WARN("waveOutOpen failed\n"); @@ -817,7 +817,7 @@ static HRESULT WINAPI IDirectSoundImpl_Initialize( DSOUND_renderer[device->drvdesc.dnDevNode] = device; timeBeginPeriod(DS_TIME_RES); DSOUND_renderer[device->drvdesc.dnDevNode]->timerID = timeSetEvent(DS_TIME_DEL, DS_TIME_RES, DSOUND_timer, - (DWORD)DSOUND_renderer[device->drvdesc.dnDevNode], TIME_PERIODIC | TIME_CALLBACK_FUNCTION); + (DWORD_PTR)DSOUND_renderer[device->drvdesc.dnDevNode], TIME_PERIODIC | TIME_CALLBACK_FUNCTION); } else { WARN("DSOUND_PrimaryCreate failed\n"); } diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index 1a2f5e2af28..f92193f4efd 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -316,7 +316,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)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)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); @@ -329,7 +329,7 @@ HRESULT WINAPI DirectSoundEnumerateA( } for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)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); @@ -377,7 +377,7 @@ HRESULT WINAPI DirectSoundEnumerateW( 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)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)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); @@ -394,7 +394,7 @@ HRESULT WINAPI DirectSoundEnumerateW( } for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)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/primary.c b/dlls/dsound/primary.c index 09907b90034..af2f2855bf4 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -264,7 +264,7 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) waveOutClose(device->hwo); device->hwo = 0; err = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, - device->pwfx, (DWORD)DSOUND_callback, (DWORD)device, + device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD)device, flags)); if (err == DS_OK) { err = IDsDriver_CreateSoundBuffer(device->driver,device->pwfx, @@ -372,7 +372,7 @@ static HRESULT WINAPI PrimaryBufferImpl_SetFormat( waveOutClose(device->hwo); device->hwo = 0; err = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, - device->pwfx, (DWORD)DSOUND_callback, (DWORD)device, + device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD)device, flags)); if (err == DS_OK) { err = DSOUND_PrimaryOpen(device); diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c index 83f3be16294..bd0773cfdc5 100644 --- a/dlls/dsound/propset.c +++ b/dlls/dsound/propset.c @@ -443,14 +443,14 @@ static HRESULT WINAPI DSPROPERTY_Description1( DSDRIVERDESC desc; ppd->WaveDeviceId = wod; ppd->Devnode = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)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)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -474,14 +474,14 @@ static HRESULT WINAPI DSPROPERTY_Description1( DSDRIVERDESC desc; ppd->WaveDeviceId = wid; ppd->Devnode = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)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)&drv,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -506,14 +506,14 @@ static HRESULT WINAPI DSPROPERTY_Description1( ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; ppd->Devnode = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)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)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -539,14 +539,14 @@ static HRESULT WINAPI DSPROPERTY_Description1( ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; ppd->WaveDeviceId = wid; ppd->Devnode = wid; - err = mmErr(waveInMessage((HWAVEIN)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)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(waveInMessage((HWAVEIN)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveInMessage((HWAVEIN)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -619,7 +619,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( if (IsEqualGUID( &dev_guid, &DSOUND_renderer_guids[wod] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -635,7 +635,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -668,7 +668,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -684,7 +684,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -716,7 +716,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( TRACE("DSOUND_renderer_guids[%ld]\n", wod); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -732,7 +732,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -764,7 +764,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( DSDRIVERDESC desc; TRACE("DSOUND_capture_guids[%ld]\n", wid); ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -780,7 +780,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -861,7 +861,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( DSDRIVERDESC desc; TRACE("DSOUND_renderer_guids[%ld]\n", wod); ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -877,7 +877,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -910,7 +910,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -926,7 +926,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -958,7 +958,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( TRACE("DSOUND_renderer_guids[%ld]\n", wod); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -974,7 +974,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1006,7 +1006,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( DSDRIVERDESC desc; TRACE("DSOUND_capture_guids[%ld]\n", wid); ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -1022,7 +1022,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1078,7 +1078,7 @@ static HRESULT WINAPI DSPROPERTY_Enumerate1( devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; ZeroMemory(&data, sizeof(data)); @@ -1092,7 +1092,7 @@ static HRESULT WINAPI DSPROPERTY_Enumerate1( MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW) ); data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1105,7 +1105,7 @@ static HRESULT WINAPI DSPROPERTY_Enumerate1( devs = waveInGetNumDevs(); for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; ZeroMemory(&data, sizeof(data)); @@ -1119,7 +1119,7 @@ static HRESULT WINAPI DSPROPERTY_Enumerate1( MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW) ); data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1165,7 +1165,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateA( devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { DWORD size; err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0)); @@ -1187,7 +1187,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateA( data.Interface = szInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1206,7 +1206,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateA( devs = waveInGetNumDevs(); for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { DWORD size; err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0)); @@ -1228,7 +1228,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateA( data.Interface = szInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1280,7 +1280,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateW( devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200); WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200); @@ -1306,7 +1306,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateW( data.Interface = wInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1326,7 +1326,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateW( devs = waveInGetNumDevs(); for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200); WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200); @@ -1351,7 +1351,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateW( data.Module = wModule; data.Interface = wInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else diff --git a/dlls/kernel/dosmem.c b/dlls/kernel/dosmem.c index 56b2d768e70..7bb1b248bf2 100644 --- a/dlls/kernel/dosmem.c +++ b/dlls/kernel/dosmem.c @@ -224,7 +224,7 @@ UINT DOSMEM_MapLinearToDos(LPVOID ptr) { if (((char*)ptr >= DOSMEM_dosmem) && ((char*)ptr < DOSMEM_dosmem + DOSMEM_SIZE)) - return (UINT)ptr - (UINT)DOSMEM_dosmem; + return (char *)ptr - DOSMEM_dosmem; return (UINT)ptr; } @@ -236,7 +236,7 @@ UINT DOSMEM_MapLinearToDos(LPVOID ptr) */ LPVOID DOSMEM_MapDosToLinear(UINT ptr) { - if (ptr < DOSMEM_SIZE) return (LPVOID)(ptr + (UINT)DOSMEM_dosmem); + if (ptr < DOSMEM_SIZE) return DOSMEM_dosmem + ptr; return (LPVOID)ptr; } diff --git a/dlls/kernel/kernel_private.h b/dlls/kernel/kernel_private.h index 4cc61d542da..73c3f22ae3b 100644 --- a/dlls/kernel/kernel_private.h +++ b/dlls/kernel/kernel_private.h @@ -47,19 +47,19 @@ HANDLE WINAPI GetConsoleInputWaitHandle(void); static inline BOOL is_console_handle(HANDLE h) { - return h != INVALID_HANDLE_VALUE && ((DWORD)h & 3) == 3; + return h != INVALID_HANDLE_VALUE && ((UINT_PTR)h & 3) == 3; } /* map a real wineserver handle onto a kernel32 console handle */ static inline HANDLE console_handle_map(HANDLE h) { - return h != INVALID_HANDLE_VALUE ? (HANDLE)((DWORD)h ^ 3) : INVALID_HANDLE_VALUE; + return h != INVALID_HANDLE_VALUE ? (HANDLE)((UINT_PTR)h ^ 3) : INVALID_HANDLE_VALUE; } /* map a kernel32 console handle onto a real wineserver handle */ static inline HANDLE console_handle_unmap(HANDLE h) { - return h != INVALID_HANDLE_VALUE ? (HANDLE)((DWORD)h ^ 3) : INVALID_HANDLE_VALUE; + return h != INVALID_HANDLE_VALUE ? (HANDLE)((UINT_PTR)h ^ 3) : INVALID_HANDLE_VALUE; } extern HMODULE kernel32_handle; diff --git a/dlls/msacm/format.c b/dlls/msacm/format.c index c1f150f224f..c5c36b7835f 100644 --- a/dlls/msacm/format.c +++ b/dlls/msacm/format.c @@ -271,7 +271,7 @@ static INT_PTR CALLBACK FormatChooseDlgProc(HWND hWnd, UINT msg, MMRESULT WINAPI acmFormatChooseA(PACMFORMATCHOOSEA pafmtc) { return DialogBoxParamA(MSACM_hInstance32, MAKEINTRESOURCEA(DLG_ACMFORMATCHOOSE_ID), - pafmtc->hwndOwner, FormatChooseDlgProc, (INT)pafmtc); + pafmtc->hwndOwner, FormatChooseDlgProc, (LPARAM)pafmtc); } /*********************************************************************** diff --git a/dlls/msacm/stream.c b/dlls/msacm/stream.c index 44c62c313e7..35604fc712b 100644 --- a/dlls/msacm/stream.c +++ b/dlls/msacm/stream.c @@ -64,7 +64,7 @@ MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose) WARN("invalid handle\n"); return MMSYSERR_INVALHANDLE; } - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (DWORD)&was->drvInst, 0); + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (LPARAM)&was->drvInst, 0); if (ret == MMSYSERR_NOERROR) { if (was->hAcmDriver) acmDriverClose(was->hAcmDriver, 0L); @@ -116,7 +116,7 @@ MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, padsh->fdwConvert = fdwConvert; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CONVERT, (DWORD)&was->drvInst, (DWORD)padsh); + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CONVERT, (LPARAM)&was->drvInst, (LPARAM)padsh); if (ret == MMSYSERR_NOERROR) { padsh->fdwStatus |= ACMSTREAMHEADER_STATUSF_DONE; } @@ -228,7 +228,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw was->pDrv = wad; was->hAcmDriver = 0; /* not to close it in acmStreamClose */ - ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L); + ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (LPARAM)&was->drvInst, 0L); if (ret != MMSYSERR_NOERROR) goto errCleanUp; } else { @@ -249,7 +249,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw was->pDrv = wad; was->hAcmDriver = had; - ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L); + ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (LPARAM)&was->drvInst, 0L); TRACE("%s => %08x\n", debugstr_w(wadi->pszDriverAlias), ret); if (ret == MMSYSERR_NOERROR) { if (fdwOpen & ACM_STREAMOPENF_QUERY) { @@ -326,7 +326,7 @@ MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, padsh->pbPreparedDst = 0; padsh->cbPreparedDstLength = 0; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_PREPARE, (DWORD)&was->drvInst, (DWORD)padsh); + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_PREPARE, (LPARAM)&was->drvInst, (DWORD)padsh); if (ret == MMSYSERR_NOERROR || ret == MMSYSERR_NOTSUPPORTED) { ret = MMSYSERR_NOERROR; padsh->fdwStatus &= ~(ACMSTREAMHEADER_STATUSF_DONE|ACMSTREAMHEADER_STATUSF_INQUEUE); @@ -366,7 +366,7 @@ MMRESULT WINAPI acmStreamReset(HACMSTREAM has, DWORD fdwReset) WARN("invalid handle\n"); return MMSYSERR_INVALHANDLE; } else if (was->drvInst.fdwOpen & ACM_STREAMOPENF_ASYNC) { - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_RESET, (DWORD)&was->drvInst, 0); + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_RESET, (LPARAM)&was->drvInst, 0); } TRACE("=> (%d)\n", ret); return ret; @@ -412,7 +412,7 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, adss.cbStruct = sizeof(adss); adss.fdwSize = fdwSize; ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE, - (DWORD)&was->drvInst, (DWORD)&adss); + (LPARAM)&was->drvInst, (LPARAM)&adss); if (ret == MMSYSERR_NOERROR) { switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) { case ACM_STREAMSIZEF_DESTINATION: @@ -469,7 +469,7 @@ MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, padsh->fdwConvert = fdwUnprepare; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_UNPREPARE, (DWORD)&was->drvInst, (DWORD)padsh); + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_UNPREPARE, (LPARAM)&was->drvInst, (LPARAM)padsh); if (ret == MMSYSERR_NOERROR || ret == MMSYSERR_NOTSUPPORTED) { ret = MMSYSERR_NOERROR; padsh->fdwStatus &= ~(ACMSTREAMHEADER_STATUSF_DONE|ACMSTREAMHEADER_STATUSF_INQUEUE|ACMSTREAMHEADER_STATUSF_PREPARED); diff --git a/dlls/msvcrt/cppexcept.c b/dlls/msvcrt/cppexcept.c index 333846ec5a0..cd1534c6390 100644 --- a/dlls/msvcrt/cppexcept.c +++ b/dlls/msvcrt/cppexcept.c @@ -381,11 +381,11 @@ DEFINE_REGS_ENTRYPOINT( __CxxFrameHandler, 16, 0 ); */ void _CxxThrowException( exception *object, const cxx_exception_type *type ) { - DWORD args[3]; + ULONG_PTR args[3]; args[0] = CXX_FRAME_MAGIC; - args[1] = (DWORD)object; - args[2] = (DWORD)type; + args[1] = (ULONG_PTR)object; + args[2] = (ULONG_PTR)type; RaiseException( CXX_EXCEPTION, EH_NONCONTINUABLE, 3, args ); } diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index a7199a8ba2b..f5260dbc9bc 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -130,7 +130,7 @@ static int compare_info(LCID lcid, DWORD flags, char* buff, const char* cmp) } static BOOL CALLBACK -find_best_locale_proc(HMODULE hModule, LPCSTR type, LPCSTR name, WORD LangID, LONG lParam) +find_best_locale_proc(HMODULE hModule, LPCSTR type, LPCSTR name, WORD LangID, LONG_PTR lParam) { locale_search_t *res = (locale_search_t *)lParam; const LCID lcid = MAKELCID(LangID, SORT_DEFAULT); @@ -203,7 +203,7 @@ static LCID MSVCRT_locale_to_LCID(locale_search_t* locale) LCID lcid; EnumResourceLanguagesA(GetModuleHandleA("KERNEL32"), (LPSTR)RT_STRING, (LPCSTR)LOCALE_ILANGUAGE,find_best_locale_proc, - (LONG)locale); + (LONG_PTR)locale); if (!locale->match_flags) return 0; diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index d2dc09d23f4..4e4809b069d 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -711,7 +711,7 @@ static BOOLEAN match_filename( const UNICODE_STRING *name_str, const UNICODE_STR * * helper for NtQueryDirectoryFile */ -static FILE_BOTH_DIR_INFORMATION *append_entry( void *info_ptr, ULONG *pos, ULONG max_length, +static FILE_BOTH_DIR_INFORMATION *append_entry( void *info_ptr, ULONG_PTR *pos, ULONG max_length, const char *long_name, const char *short_name, const UNICODE_STRING *mask ) { diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 35b89b16b23..b23c6f7ca77 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -367,7 +367,7 @@ void WINAPI __regs_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEndFrame, PVOID un } if (((void*)frame < NtCurrentTeb()->Tib.StackLimit) || ((void*)(frame+1) > NtCurrentTeb()->Tib.StackBase) || - (int)frame & 3) + (UINT_PTR)frame & 3) { newrec.ExceptionCode = STATUS_BAD_STACK; newrec.ExceptionFlags = EH_NONCONTINUABLE; diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c index db4f4b1b5e8..7636d5ebe43 100644 --- a/dlls/ntdll/sec.c +++ b/dlls/ntdll/sec.c @@ -96,7 +96,7 @@ static NTSTATUS add_access_ace(PACL pAcl, DWORD dwAceRevision, DWORD dwAceFlags, /* calculate generic size of the ACE */ dwLengthSid = RtlLengthSid(pSid); dwAceSize = sizeof(ACE_HEADER) + sizeof(DWORD) + dwLengthSid; - if ((DWORD)(pAceHeader + dwAceSize) > (DWORD)(pAcl + pAcl->AclSize)) + if ((char *)pAceHeader + dwAceSize > (char *)pAcl + pAcl->AclSize) return STATUS_ALLOTTED_SPACE_EXCEEDED; /* fill the new ACE */ @@ -1084,11 +1084,11 @@ BOOLEAN WINAPI RtlFirstFreeAce( *x = 0; ace = (PACE_HEADER)(acl+1); for (i=0;iAceCount;i++) { - if ((DWORD)ace>=(((DWORD)acl)+acl->AclSize)) + if ((BYTE *)ace >= (BYTE *)acl + acl->AclSize) return 0; ace = (PACE_HEADER)(((BYTE*)ace)+ace->AceSize); } - if ((DWORD)ace>=(((DWORD)acl)+acl->AclSize)) + if ((BYTE *)ace >= (BYTE *)acl + acl->AclSize) return 0; *x = ace; return 1; @@ -1112,11 +1112,11 @@ NTSTATUS WINAPI RtlAddAce( if (!RtlFirstFreeAce(acl,&targetace)) return STATUS_INVALID_PARAMETER; nrofaces=0;ace=acestart; - while (((DWORD)ace-(DWORD)acestart)AceSize); } - if ((DWORD)targetace+acelen>(DWORD)acl+acl->AclSize) /* too much aces */ + if ((BYTE *)targetace + acelen > (BYTE *)acl + acl->AclSize) /* too much aces */ return STATUS_INVALID_PARAMETER; memcpy((LPBYTE)targetace,acestart,acelen); acl->AceCount+=nrofaces; diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 9f35200e322..9c4d12823ef 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -364,7 +364,7 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz struct file_view *view; struct list *ptr; - assert( !((unsigned int)base & page_mask) ); + assert( !((UINT_PTR)base & page_mask) ); assert( !(size & page_mask) ); /* Create the view structure */ @@ -1029,7 +1029,7 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz * really make sure that the *new* base address is also > 2GB. * Some DLLs really check the MSB of the module handle :-/ */ - if ((nt->OptionalHeader.ImageBase & 0x80000000) && !((DWORD)base & 0x80000000)) + if ((nt->OptionalHeader.ImageBase & 0x80000000) && !((ULONG_PTR)base & 0x80000000)) ERR( "Forced to relocate system DLL (base > 2GB). This is not good.\n" ); if (!do_relocations( ptr, relocs, ptr - base, total_size )) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index f21f05dd5d8..22e1d3a50d0 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -637,7 +637,7 @@ static BOOL internal_wglUseFontBitmaps(HDC hdc, else DPRINTF(" "); } - bitmap_ += (4 - (((unsigned int) bitmap_) & 0x03)); + bitmap_ += (4 - ((UINT_PTR)bitmap_ & 0x03)); DPRINTF("\n"); } } diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index 854648ac481..a444f9d37bc 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -1091,7 +1091,7 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC if (!queue->copy_queue.count && !queue->delete_queue.count && !queue->rename_queue.count) return TRUE; /* nothing to do */ - if (!handler( context, SPFILENOTIFY_STARTQUEUE, (UINT)owner, 0 )) return FALSE; + if (!handler( context, SPFILENOTIFY_STARTQUEUE, (UINT_PTR)owner, 0 )) return FALSE; /* perform deletes */ diff --git a/dlls/user/caret.c b/dlls/user/caret.c index 618bd8d112e..1252944fae4 100644 --- a/dlls/user/caret.c +++ b/dlls/user/caret.c @@ -73,7 +73,7 @@ static void CARET_DisplayCaret( HWND hwnd, const RECT *r ) /***************************************************************** * CARET_Callback */ -static void CALLBACK CARET_Callback( HWND hwnd, UINT msg, UINT id, DWORD ctime) +static void CALLBACK CARET_Callback( HWND hwnd, UINT msg, UINT_PTR id, DWORD ctime) { BOOL ret; RECT r; diff --git a/dlls/user/exticon.c b/dlls/user/exticon.c index add3c60f757..7b447367229 100644 --- a/dlls/user/exticon.c +++ b/dlls/user/exticon.c @@ -500,7 +500,7 @@ static UINT ICO_ExtractIconExW( const IMAGE_RESOURCE_DIRECTORY *resdir; /* go down this resource entry, name */ - resdir = (PIMAGE_RESOURCE_DIRECTORY)((DWORD)rootresdir+(xresent->u2.s3.OffsetToDirectory)); + resdir = (PIMAGE_RESOURCE_DIRECTORY)((char *)rootresdir + xresent->u2.s3.OffsetToDirectory); /* default language (0) */ resdir = find_entry_default(resdir,rootresdir); diff --git a/dlls/user/spy.c b/dlls/user/spy.c index 475f8a3eee1..e66db374dd9 100644 --- a/dlls/user/spy.c +++ b/dlls/user/spy.c @@ -1926,16 +1926,16 @@ static int indent_tls_index; /*********************************************************************** * get_indent_level */ -inline static int get_indent_level(void) +inline static INT_PTR get_indent_level(void) { - return (int)TlsGetValue( indent_tls_index ); + return (INT_PTR)TlsGetValue( indent_tls_index ); } /*********************************************************************** * set_indent_level */ -inline static void set_indent_level( int level ) +inline static void set_indent_level( INT_PTR level ) { TlsSetValue( indent_tls_index, (void *)level ); } diff --git a/dlls/version/info.c b/dlls/version/info.c index fac49bb0257..b53f7179ac3 100644 --- a/dlls/version/info.c +++ b/dlls/version/info.c @@ -592,7 +592,7 @@ static VS_VERSION_INFO_STRUCT16 *VersionInfo16_FindChild( VS_VERSION_INFO_STRUCT { VS_VERSION_INFO_STRUCT16 *child = VersionInfo16_Children( info ); - while ( (DWORD)child < (DWORD)info + info->wLength ) + while ((char *)child < (char *)info + info->wLength ) { if ( !strncasecmp( child->szKey, szKey, cbKey ) ) return child; @@ -612,7 +612,7 @@ static VS_VERSION_INFO_STRUCT32 *VersionInfo32_FindChild( VS_VERSION_INFO_STRUCT { VS_VERSION_INFO_STRUCT32 *child = VersionInfo32_Children( info ); - while ( (DWORD)child < (DWORD)info + info->wLength ) + while ((char *)child < (char *)info + info->wLength ) { if ( !strncmpiW( child->szKey, szKey, cbKey ) ) return child; diff --git a/dlls/x11drv/event.c b/dlls/x11drv/event.c index 8e87daec52d..8d01d0639f1 100644 --- a/dlls/x11drv/event.c +++ b/dlls/x11drv/event.c @@ -203,7 +203,7 @@ done: */ static Bool filter_event( Display *display, XEvent *event, char *arg ) { - DWORD mask = (ULONG_PTR)arg; + ULONG_PTR mask = (ULONG_PTR)arg; if ((mask & QS_ALLINPUT) == QS_ALLINPUT) return 1; @@ -233,7 +233,7 @@ static Bool filter_event( Display *display, XEvent *event, char *arg ) /*********************************************************************** * process_events */ -static int process_events( Display *display, DWORD mask ) +static int process_events( Display *display, ULONG_PTR mask ) { XEvent event; HWND hwnd; diff --git a/dlls/x11drv/keyboard.c b/dlls/x11drv/keyboard.c index 48ab7f62cd4..f0271583060 100644 --- a/dlls/x11drv/keyboard.c +++ b/dlls/x11drv/keyboard.c @@ -1748,7 +1748,7 @@ UINT X11DRV_GetKeyboardLayoutList(INT size, HKL *hkl) { if (hkl) { - DWORD layout = main_key_tab[i].lcid; + ULONG_PTR layout = main_key_tab[i].lcid; LANGID langid; /* see comment for GetKeyboardLayout */ @@ -1770,7 +1770,7 @@ UINT X11DRV_GetKeyboardLayoutList(INT size, HKL *hkl) */ HKL X11DRV_GetKeyboardLayout(DWORD dwThreadid) { - DWORD layout; + ULONG_PTR layout; LANGID langid; if (dwThreadid && dwThreadid != GetCurrentThreadId()) diff --git a/include/windowsx.h b/include/windowsx.h index 23f268c8108..6bd3a2a4d90 100644 --- a/include/windowsx.h +++ b/include/windowsx.h @@ -36,28 +36,28 @@ extern "C" { #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) -#define GET_EM_LINESCROLL_MPS(vert, horz) (WPARAM)horz, (LONG)vert +#define GET_EM_LINESCROLL_MPS(vert, horz) (WPARAM)horz, (LPARAM)vert #define GET_EM_SETSEL_START(wp, lp) (INT)(wp) #define GET_EM_SETSEL_END(wp, lp) (lp) -#define GET_EM_SETSEL_MPS(iStart, iEnd) (WPARAM)(iStart), (LONG)(iEnd) +#define GET_EM_SETSEL_MPS(iStart, iEnd) (WPARAM)(iStart), (LPARAM)(iEnd) #define GET_WM_ACTIVATE_STATE(wp, lp) LOWORD(wp) #define GET_WM_ACTIVATE_FMINIMIZED(wp, lp) (BOOL)HIWORD(wp) #define GET_WM_ACTIVATE_HWND(wp, lp) (HWND)(lp) -#define GET_WM_ACTIVATE_MPS(s, fmin, hwnd) (WPARAM)MAKELONG((s), (fmin)), (LONG)(hwnd) +#define GET_WM_ACTIVATE_MPS(s, fmin, hwnd) (WPARAM)MAKELONG((s), (fmin)), (LPARAM)(hwnd) #define GET_WM_CHANGECBCHAIN_HWNDNEXT(wp, lp) (HWND)(lp) #define GET_WM_CHARTOITEM_CHAR(wp, lp) (TCHAR)LOWORD(wp) #define GET_WM_CHARTOITEM_POS(wp, lp) HIWORD(wp) #define GET_WM_CHARTOITEM_HWND(wp, lp) (HWND)(lp) -#define GET_WM_CHARTOITEM_MPS(ch, pos, hwnd) (WPARAM)MAKELONG((pos), (ch)), (LONG)(hwnd) +#define GET_WM_CHARTOITEM_MPS(ch, pos, hwnd) (WPARAM)MAKELONG((pos), (ch)), (LPARAM)(hwnd) #define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp) #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp) #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp) -#define GET_WM_COMMAND_MPS(id, hwnd, cmd) (WPARAM)MAKELONG(id, cmd), (LONG)(hwnd) +#define GET_WM_COMMAND_MPS(id, hwnd, cmd) (WPARAM)MAKELONG(id, cmd), (LPARAM)(hwnd) #define WM_CTLCOLOR 0x0019 @@ -65,46 +65,46 @@ extern "C" { #define GET_WM_CTLCOLOR_HWND(wp, lp, msg) (HWND)(lp) #define GET_WM_CTLCOLOR_TYPE(wp, lp, msg) (WORD)(msg - WM_CTLCOLORMSGBOX) #define GET_WM_CTLCOLOR_MSG(type) (WORD)(WM_CTLCOLORMSGBOX+(type)) -#define GET_WM_CTLCOLOR_MPS(hdc, hwnd, type) (WPARAM)(hdc), (LONG)(hwnd) +#define GET_WM_CTLCOLOR_MPS(hdc, hwnd, type) (WPARAM)(hdc), (LPARAM)(hwnd) #define GET_WM_HSCROLL_CODE(wp, lp) LOWORD(wp) #define GET_WM_HSCROLL_POS(wp, lp) HIWORD(wp) #define GET_WM_HSCROLL_HWND(wp, lp) (HWND)(lp) -#define GET_WM_HSCROLL_MPS(code, pos, hwnd) (WPARAM)MAKELONG(code, pos), (LONG)(hwnd) +#define GET_WM_HSCROLL_MPS(code, pos, hwnd) (WPARAM)MAKELONG(code, pos), (LPARAM)(hwnd) #define GET_WM_MENUCHAR_CHAR(wp, lp) (TCHAR)LOWORD(wp) #define GET_WM_MENUCHAR_HMENU(wp, lp) (HMENU)(lp) #define GET_WM_MENUCHAR_FMENU(wp, lp) (BOOL)HIWORD(wp) -#define GET_WM_MENUCHAR_MPS(ch, hmenu, f) (WPARAM)MAKELONG(ch, f), (LONG)(hmenu) +#define GET_WM_MENUCHAR_MPS(ch, hmenu, f) (WPARAM)MAKELONG(ch, f), (LPARAM)(hmenu) #define GET_WM_MENUSELECT_CMD(wp, lp) LOWORD(wp) #define GET_WM_MENUSELECT_FLAGS(wp, lp) (UINT)(int)(short)HIWORD(wp) #define GET_WM_MENUSELECT_HMENU(wp, lp) (HMENU)(lp) -#define GET_WM_MENUSELECT_MPS(cmd, f, hmenu) (WPARAM)MAKELONG(cmd, f), (LONG)(hmenu) +#define GET_WM_MENUSELECT_MPS(cmd, f, hmenu) (WPARAM)MAKELONG(cmd, f), (LPARAM)(hmenu) -#define GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wp, lp) (lp == (LONG)hwnd) +#define GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wp, lp) (lp == (LPARAM)hwnd) #define GET_WM_MDIACTIVATE_HWNDDEACT(wp, lp) (HWND)(wp) #define GET_WM_MDIACTIVATE_HWNDACTIVATE(wp, lp) (HWND)(lp) #define GET_WM_MDIACTIVATE_MPS(f, hwndD, hwndA) (WPARAM)(hwndA), 0 -#define GET_WM_MDISETMENU_MPS(hmenuF, hmenuW) (WPARAM)hmenuF, (LONG)hmenuW +#define GET_WM_MDISETMENU_MPS(hmenuF, hmenuW) (WPARAM)hmenuF, (LPARAM)hmenuW #define GET_WM_PARENTNOTIFY_MSG(wp, lp) LOWORD(wp) #define GET_WM_PARENTNOTIFY_ID(wp, lp) HIWORD(wp) #define GET_WM_PARENTNOTIFY_HWNDCHILD(wp, lp) (HWND)(lp) #define GET_WM_PARENTNOTIFY_X(wp, lp) (int)(short)LOWORD(lp) #define GET_WM_PARENTNOTIFY_Y(wp, lp) (int)(short)HIWORD(lp) -#define GET_WM_PARENTNOTIFY_MPS(msg, id, hwnd) (WPARAM)MAKELONG(id, msg), (LONG)(hwnd) +#define GET_WM_PARENTNOTIFY_MPS(msg, id, hwnd) (WPARAM)MAKELONG(id, msg), (LPARAM)(hwnd) #define GET_WM_PARENTNOTIFY2_MPS(msg, x, y) (WPARAM)MAKELONG(0, msg), MAKELONG(x, y) #define GET_WM_VKEYTOITEM_CODE(wp, lp) (int)(short)LOWORD(wp) #define GET_WM_VKEYTOITEM_ITEM(wp, lp) HIWORD(wp) #define GET_WM_VKEYTOITEM_HWND(wp, lp) (HWND)(lp) -#define GET_WM_VKEYTOITEM_MPS(code, item, hwnd) (WPARAM)MAKELONG(item, code), (LONG)(hwnd) +#define GET_WM_VKEYTOITEM_MPS(code, item, hwnd) (WPARAM)MAKELONG(item, code), (LPARAM)(hwnd) #define GET_WM_VSCROLL_CODE(wp, lp) LOWORD(wp) #define GET_WM_VSCROLL_POS(wp, lp) HIWORD(wp) #define GET_WM_VSCROLL_HWND(wp, lp) (HWND)(lp) -#define GET_WM_VSCROLL_MPS(code, pos, hwnd) (WPARAM)MAKELONG(code, pos), (LONG)(hwnd) +#define GET_WM_VSCROLL_MPS(code, pos, hwnd) (WPARAM)MAKELONG(code, pos), (LPARAM)(hwnd) /****** KERNEL Macro APIs ******************************************************/ diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c index 17b45a818b4..e00fe335c2b 100644 --- a/tools/winebuild/res32.c +++ b/tools/winebuild/res32.c @@ -208,7 +208,7 @@ static void load_next_resource( DLLSPEC *spec ) res->data = file_pos - 2*sizeof(DWORD) + hdr_size; get_string( &res->type ); get_string( &res->name ); - if ((int)file_pos & 2) get_word(); /* align to dword boundary */ + if ((UINT_PTR)file_pos & 2) get_word(); /* align to dword boundary */ get_dword(); /* skip data version */ get_word(); /* skip mem options */ res->lang = get_word(); diff --git a/tools/winedump/debug.c b/tools/winedump/debug.c index 4eb67869959..419447d9041 100644 --- a/tools/winedump/debug.c +++ b/tools/winedump/debug.c @@ -521,8 +521,8 @@ void dump_coff(unsigned long coffbase, unsigned long len, void* pmt) coff = (PIMAGE_COFF_SYMBOLS_HEADER)PRD(coffbase, len); - coff_symbols = (PIMAGE_SYMBOL) ((unsigned int) coff + coff->LvaToFirstSymbol); - coff_linetab = (PIMAGE_LINENUMBER) ((unsigned int) coff + coff->LvaToFirstLinenumber); + coff_symbols = (PIMAGE_SYMBOL) ((char *)coff + coff->LvaToFirstSymbol); + coff_linetab = (PIMAGE_LINENUMBER) ((char *)coff + coff->LvaToFirstLinenumber); coff_strtab = (char *) (coff_symbols + coff->NumberOfSymbols); printf("\nDebug table: COFF format. modbase %p, coffbase %p\n", PRD(0, 0), coff); diff --git a/tools/wrc/newstruc.c b/tools/wrc/newstruc.c index 9129caa181a..675a03a8416 100644 --- a/tools/wrc/newstruc.c +++ b/tools/wrc/newstruc.c @@ -816,8 +816,7 @@ static void handle_ani_list(riff_tag_t *lst, enum res_e type, int isswapped) isprint(rtp->tag[2]) ? rtp->tag[2] : '.', isprint(rtp->tag[3]) ? rtp->tag[3] : '.'); - /* FIXME: This relies in sizeof(DWORD) == sizeof(pointer_type) */ - if((DWORD)rtp & 1) + if((UINT_PTR)rtp & 1) rtp = SKIP_TAG(rtp,1); } } @@ -927,8 +926,7 @@ ani_curico_t *new_ani_curico(enum res_e type, raw_data_t *rd, int *memopt) isprint(rtp->tag[2]) ? rtp->tag[2] : '.', isprint(rtp->tag[3]) ? rtp->tag[3] : '.'); - /* FIXME: This relies in sizeof(DWORD) == sizeof(pointer_type) */ - if((DWORD)rtp & 1) + if((UINT_PTR)rtp & 1) rtp = SKIP_TAG(rtp,1); }