- Update the I/O manager's global configuration table with the correct number of serial ports

svn path=/trunk/; revision=53005
This commit is contained in:
Cameron Gutman 2011-07-31 17:18:50 +00:00
parent e4b89070d6
commit 85b2720526

View file

@ -24,8 +24,6 @@ SerialAddDeviceInternal(
NTSTATUS Status;
WCHAR DeviceNameBuffer[32];
UNICODE_STRING DeviceName;
static ULONG DeviceNumber = 0;
static ULONG ComPortNumber = 1;
TRACE_(SERIAL, "SerialAddDeviceInternal()\n");
@ -33,7 +31,7 @@ SerialAddDeviceInternal(
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 @@ SerialAddDeviceInternal(
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;