ULONG -> ULONG_PTR when casting handles

svn path=/trunk/; revision=43524
This commit is contained in:
Timo Kreuzer 2009-10-16 23:11:28 +00:00
parent b3f7a6bd5f
commit 3a1ea98678

View file

@ -1815,7 +1815,7 @@ WdmAudGetLineInfo(
if (DeviceInfo->Flags == MIXER_GETLINEINFOF_DESTINATION) if (DeviceInfo->Flags == MIXER_GETLINEINFOF_DESTINATION)
{ {
if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount) if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
{ {
/* invalid parameter */ /* invalid parameter */
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
@ -1826,7 +1826,7 @@ WdmAudGetLineInfo(
/* invalid parameter */ /* invalid parameter */
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
} }
MixerLineSrc = GetSourceMixerLineByLineId(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DESTINATION_LINE); MixerLineSrc = GetSourceMixerLineByLineId(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DESTINATION_LINE);
ASSERT(MixerLineSrc); ASSERT(MixerLineSrc);
/* copy cached data */ /* copy cached data */
@ -1835,13 +1835,13 @@ WdmAudGetLineInfo(
} }
else if (DeviceInfo->Flags == MIXER_GETLINEINFOF_SOURCE) else if (DeviceInfo->Flags == MIXER_GETLINEINFOF_SOURCE)
{ {
if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount) if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
{ {
/* invalid parameter */ /* invalid parameter */
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
} }
MixerLineSrc = GetSourceMixerLineByLineId(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DESTINATION_LINE); MixerLineSrc = GetSourceMixerLineByLineId(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DESTINATION_LINE);
ASSERT(MixerLineSrc); ASSERT(MixerLineSrc);
if (DeviceInfo->u.MixLine.dwSource >= MixerLineSrc->Line.cConnections) if (DeviceInfo->u.MixLine.dwSource >= MixerLineSrc->Line.cConnections)
@ -1851,7 +1851,7 @@ WdmAudGetLineInfo(
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
} }
MixerLineSrc = GetSourceMixerLine(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DeviceInfo->u.MixLine.dwSource); MixerLineSrc = GetSourceMixerLine(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DeviceInfo->u.MixLine.dwSource);
if (MixerLineSrc) if (MixerLineSrc)
{ {
DPRINT("Line %u Name %S\n", MixerLineSrc->Line.dwSource, MixerLineSrc->Line.szName); DPRINT("Line %u Name %S\n", MixerLineSrc->Line.dwSource, MixerLineSrc->Line.szName);
@ -1861,13 +1861,13 @@ WdmAudGetLineInfo(
} }
else if (DeviceInfo->Flags == MIXER_GETLINEINFOF_LINEID) else if (DeviceInfo->Flags == MIXER_GETLINEINFOF_LINEID)
{ {
if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount) if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
{ {
/* invalid parameter */ /* invalid parameter */
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
} }
MixerLineSrc = GetSourceMixerLineByLineId(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DeviceInfo->u.MixLine.dwLineID); MixerLineSrc = GetSourceMixerLineByLineId(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DeviceInfo->u.MixLine.dwLineID);
if (!MixerLineSrc) if (!MixerLineSrc)
{ {
DPRINT1("Failed to find Line with id %u\n", DeviceInfo->u.MixLine.dwLineID); DPRINT1("Failed to find Line with id %u\n", DeviceInfo->u.MixLine.dwLineID);
@ -1880,13 +1880,13 @@ WdmAudGetLineInfo(
} }
else if (DeviceInfo->Flags == MIXER_GETLINEINFOF_COMPONENTTYPE) else if (DeviceInfo->Flags == MIXER_GETLINEINFOF_COMPONENTTYPE)
{ {
if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount) if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
{ {
/* invalid parameter */ /* invalid parameter */
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
} }
MixerLineSrc = GetSourceMixerLineByComponentType(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DeviceInfo->u.MixLine.dwComponentType); MixerLineSrc = GetSourceMixerLineByComponentType(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DeviceInfo->u.MixLine.dwComponentType);
ASSERT(MixerLineSrc); ASSERT(MixerLineSrc);
/* copy cached data */ /* copy cached data */
@ -1923,13 +1923,13 @@ WdmAudGetLineControls(
if (DeviceInfo->Flags == MIXER_GETLINECONTROLSF_ALL) if (DeviceInfo->Flags == MIXER_GETLINECONTROLSF_ALL)
{ {
if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount) if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
{ {
/* invalid parameter */ /* invalid parameter */
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
} }
MixerLineSrc = GetSourceMixerLineByLineId(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DeviceInfo->u.MixControls.dwLineID); MixerLineSrc = GetSourceMixerLineByLineId(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DeviceInfo->u.MixControls.dwLineID);
ASSERT(MixerLineSrc); ASSERT(MixerLineSrc);
if (MixerLineSrc) if (MixerLineSrc)
{ {
@ -1939,13 +1939,13 @@ WdmAudGetLineControls(
} }
else if (DeviceInfo->Flags == MIXER_GETLINECONTROLSF_ONEBYTYPE) else if (DeviceInfo->Flags == MIXER_GETLINECONTROLSF_ONEBYTYPE)
{ {
if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount) if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
{ {
/* invalid parameter */ /* invalid parameter */
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
} }
MixerLineSrc = GetSourceMixerLineByLineId(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DeviceInfo->u.MixControls.dwLineID); MixerLineSrc = GetSourceMixerLineByLineId(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DeviceInfo->u.MixControls.dwLineID);
ASSERT(MixerLineSrc); ASSERT(MixerLineSrc);
Index = 0; Index = 0;
@ -1963,13 +1963,13 @@ WdmAudGetLineControls(
} }
else if (DeviceInfo->Flags == MIXER_GETLINECONTROLSF_ONEBYID) else if (DeviceInfo->Flags == MIXER_GETLINECONTROLSF_ONEBYID)
{ {
if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount) if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
{ {
/* invalid parameter */ /* invalid parameter */
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
} }
DPRINT1("MixerId %u ControlId %u\n",(ULONG)DeviceInfo->hDevice, DeviceInfo->u.MixControls.dwControlID); DPRINT1("MixerId %u ControlId %u\n",(ULONG_PTR)DeviceInfo->hDevice, DeviceInfo->u.MixControls.dwControlID);
Status = GetMixerControlById(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DeviceInfo->u.MixControls.dwControlID, NULL, &MixerControl, NULL); Status = GetMixerControlById(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DeviceInfo->u.MixControls.dwControlID, NULL, &MixerControl, NULL);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
RtlMoveMemory(DeviceInfo->u.MixControls.pamxctrl, MixerControl, sizeof(MIXERCONTROLW)); RtlMoveMemory(DeviceInfo->u.MixControls.pamxctrl, MixerControl, sizeof(MIXERCONTROLW));
@ -2173,7 +2173,7 @@ WdmAudSetControlDetails(
DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension; DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
/* get mixer control */ /* get mixer control */
Status = GetMixerControlById(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DeviceInfo->u.MixDetails.dwControlID, &MixerLine, &MixerControl, &NodeId); Status = GetMixerControlById(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DeviceInfo->u.MixDetails.dwControlID, &MixerLine, &MixerControl, &NodeId);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
@ -2225,7 +2225,7 @@ WdmAudGetControlDetails(
DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension; DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
/* get mixer control */ /* get mixer control */
Status = GetMixerControlById(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DeviceInfo->u.MixDetails.dwControlID, &MixerLine, &MixerControl, &NodeId); Status = GetMixerControlById(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DeviceInfo->u.MixDetails.dwControlID, &MixerLine, &MixerControl, &NodeId);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {