Author: cgutman
Date: Sun Jul 31 17:18:50 2011
New Revision: 53005

URL: http://svn.reactos.org/svn/reactos?rev=53005&view=rev
Log:
[SERIAL]
- Update the I/O manager's global configuration table with the correct number 
of serial ports

Modified:
    trunk/reactos/drivers/serial/serial/pnp.c

Modified: trunk/reactos/drivers/serial/serial/pnp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/serial/serial/pnp.c?rev=53005&r1=53004&r2=53005&view=diff
==============================================================================
--- trunk/reactos/drivers/serial/serial/pnp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/serial/serial/pnp.c [iso-8859-1] Sun Jul 31 17:18:50 
2011
@@ -24,8 +24,6 @@
        NTSTATUS Status;
        WCHAR DeviceNameBuffer[32];
        UNICODE_STRING DeviceName;
-       static ULONG DeviceNumber = 0;
-       static ULONG ComPortNumber = 1;
 
        TRACE_(SERIAL, "SerialAddDeviceInternal()\n");
 
@@ -33,7 +31,7 @@
        ASSERT(Pdo);
 
        /* Create new device object */
-       swprintf(DeviceNameBuffer, L"\\Device\\Serial%lu", DeviceNumber);
+       swprintf(DeviceNameBuffer, L"\\Device\\Serial%lu", 
IoGetConfigurationInformation()->SerialCount);
        RtlInitUnicodeString(&DeviceName, DeviceNameBuffer);
        Status = IoCreateDevice(DriverObject,
                                sizeof(SERIAL_DEVICE_EXTENSION),
@@ -59,9 +57,9 @@
                goto ByeBye;
        }
 
-       DeviceExtension->SerialPortNumber = DeviceNumber++;
+       DeviceExtension->SerialPortNumber = 
IoGetConfigurationInformation()->SerialCount++;
        if (pComPortNumber == NULL)
-               DeviceExtension->ComPort = ComPortNumber++;
+               DeviceExtension->ComPort = DeviceExtension->SerialPortNumber + 
1;
        else
                DeviceExtension->ComPort = *pComPortNumber;
        DeviceExtension->Pdo = Pdo;


Reply via email to