ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

NTSTATUS NTAPI SermouseStartDevice ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 78 of file fdo.c.

Referenced by SermousePnp().

{
    PSERMOUSE_DEVICE_EXTENSION DeviceExtension;
    SERMOUSE_MOUSE_TYPE MouseType;
    NTSTATUS Status;

    DeviceExtension = (PSERMOUSE_DEVICE_EXTENSION)DeviceObject->DeviceExtension;

    ASSERT(DeviceExtension->PnpState == dsStopped);
    ASSERT(DeviceExtension->LowerDevice);
    MouseType = SermouseDetectLegacyDevice(DeviceExtension->LowerDevice);
    if (MouseType == mtNone)
    {
        WARN_(SERMOUSE, "No mouse connected to Fdo %p\n",
            DeviceExtension->LowerDevice);
        return STATUS_DEVICE_NOT_CONNECTED;
    }

    switch (MouseType)
    {
        case mtMicrosoft:
            DeviceExtension->AttributesInformation.MouseIdentifier = MOUSE_SERIAL_HARDWARE;
            DeviceExtension->AttributesInformation.NumberOfButtons = 2;
            break;
        case mtLogitech:
            DeviceExtension->AttributesInformation.MouseIdentifier = MOUSE_SERIAL_HARDWARE;
            DeviceExtension->AttributesInformation.NumberOfButtons = 3;
            break;
        case mtWheelZ:
            DeviceExtension->AttributesInformation.MouseIdentifier = WHEELMOUSE_SERIAL_HARDWARE;
            DeviceExtension->AttributesInformation.NumberOfButtons = 3;
            break;
        default:
            WARN_(SERMOUSE, "Unknown mouse type 0x%lx\n", MouseType);
            ASSERT(FALSE);
            return STATUS_UNSUCCESSFUL;
    }

    if (DeviceExtension->DriverExtension->NumberOfButtons != 0)
        /* Override the number of buttons */
        DeviceExtension->AttributesInformation.NumberOfButtons = DeviceExtension->DriverExtension->NumberOfButtons;

    DeviceExtension->AttributesInformation.SampleRate = 1200 / 8;
    DeviceExtension->AttributesInformation.InputDataQueueLength = 1;
    DeviceExtension->MouseType = MouseType;
    DeviceExtension->PnpState = dsStarted;

    /* Start read loop */
    Status = PsCreateSystemThread(
        &DeviceExtension->WorkerThreadHandle,
        (ACCESS_MASK)0L,
        NULL,
        NULL,
        NULL,
        SermouseDeviceWorker,
        DeviceObject);

    return Status;
}

Generated on Sun May 27 2012 05:23:06 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.