[ros-diffs] [tkreuzer] 43524: ULONG -> ULONG_PTR when casting handles

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sat Oct 17 01:11:28 CEST 2009


Author: tkreuzer
Date: Sat Oct 17 01:11:28 2009
New Revision: 43524

URL: http://svn.reactos.org/svn/reactos?rev=43524&view=rev
Log:
ULONG -> ULONG_PTR when casting handles

Modified:
    trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mixer.c

Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mixer.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mixer.c?rev=43524&r1=43523&r2=43524&view=diff
==============================================================================
--- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mixer.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mixer.c [iso-8859-1] Sat Oct 17 01:11:28 2009
@@ -1815,7 +1815,7 @@
 
     if (DeviceInfo->Flags == MIXER_GETLINEINFOF_DESTINATION)
     {
-        if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
+        if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
         {
             /* invalid parameter */
             return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
@@ -1826,7 +1826,7 @@
             /* invalid parameter */
             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);
 
         /* copy cached data */
@@ -1835,13 +1835,13 @@
     }
     else if (DeviceInfo->Flags == MIXER_GETLINEINFOF_SOURCE)
     {
-        if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
+        if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
         {
             /* invalid parameter */
             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);
 
         if (DeviceInfo->u.MixLine.dwSource >= MixerLineSrc->Line.cConnections)
@@ -1851,7 +1851,7 @@
             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)
         {
             DPRINT("Line %u Name %S\n", MixerLineSrc->Line.dwSource, MixerLineSrc->Line.szName);
@@ -1861,13 +1861,13 @@
     }
     else if (DeviceInfo->Flags == MIXER_GETLINEINFOF_LINEID)
     {
-        if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
+        if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
         {
             /* invalid parameter */
             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)
         {
             DPRINT1("Failed to find Line with id %u\n", DeviceInfo->u.MixLine.dwLineID);
@@ -1880,13 +1880,13 @@
     }
     else if (DeviceInfo->Flags == MIXER_GETLINEINFOF_COMPONENTTYPE)
     {
-        if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
+        if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
         {
             /* invalid parameter */
             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);
 
         /* copy cached data */
@@ -1923,13 +1923,13 @@
 
     if (DeviceInfo->Flags == MIXER_GETLINECONTROLSF_ALL)
     {
-        if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
+        if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
         {
             /* invalid parameter */
             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);
         if (MixerLineSrc)
         {
@@ -1939,13 +1939,13 @@
     }
     else if (DeviceInfo->Flags == MIXER_GETLINECONTROLSF_ONEBYTYPE)
     {
-        if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
+        if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
         {
             /* invalid parameter */
             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);
 
         Index = 0;
@@ -1963,13 +1963,13 @@
     }
     else if (DeviceInfo->Flags == MIXER_GETLINECONTROLSF_ONEBYID)
     {
-        if ((ULONG)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
+        if ((ULONG_PTR)DeviceInfo->hDevice >= DeviceExtension->MixerInfoCount)
         {
             /* invalid parameter */
             return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
         }
-        DPRINT1("MixerId %u ControlId %u\n",(ULONG)DeviceInfo->hDevice,  DeviceInfo->u.MixControls.dwControlID);
-        Status = GetMixerControlById(&DeviceExtension->MixerInfo[(ULONG)DeviceInfo->hDevice], DeviceInfo->u.MixControls.dwControlID, NULL, &MixerControl, NULL);
+        DPRINT1("MixerId %u ControlId %u\n",(ULONG_PTR)DeviceInfo->hDevice,  DeviceInfo->u.MixControls.dwControlID);
+        Status = GetMixerControlById(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice], DeviceInfo->u.MixControls.dwControlID, NULL, &MixerControl, NULL);
         if (NT_SUCCESS(Status))
         {
             RtlMoveMemory(DeviceInfo->u.MixControls.pamxctrl, MixerControl, sizeof(MIXERCONTROLW));
@@ -2173,7 +2173,7 @@
     DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
 
     /* 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))
     {
@@ -2225,7 +2225,7 @@
     DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
 
     /* 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))
     {




More information about the Ros-diffs mailing list