亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sermdep.c

?? This is a serial mouse driver, which is compliant with Plug and Play, supports dynamic detection (vi
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*++

Copyright (c) 1990-1998 Microsoft Corporation, All Rights Reserved
Copyright (c) 1993  Logitech Inc.

Module Name:

    sermdep.c

Abstract:

    The initialization and hardware-dependent portions of
    the Microsoft serial (i8250) mouse port driver.  Modifications
    to support new mice similar to the serial mouse should be
    localized to this file.

Environment:

    Kernel mode only.

Notes:

    NOTES:  (Future/outstanding issues)

    - Powerfail not implemented.

    - Consolidate duplicate code, where possible and appropriate.

    - The serial ballpoint is supported.   However, Windows USER does not
      intend (right now) to use the ballpoint in anything except mouse
      emulation mode.  In ballpoint mode, there is extra functionality that
      would need to be supported.  E.g., the driver would need to pass
      back extra button information from the 4th byte of the ballpoint
      data packet.  Windows USER would need/want to allow the user to select
      which buttons are used, what the orientation of the ball is (esp.
      important for lefthanders), sensitivity, and acceleration profile.


Revision History:


--*/

#include "stdarg.h"
#include "stdio.h"
#include "string.h"
#include "ntddk.h"
#include "mouser.h"
#include "sermlog.h"
#include "cseries.h"
#include "mseries.h"
#include "debug.h"

//
// Use the alloc_text pragma to specify the driver initialization routines
// (they can be paged out).
//

#ifdef ALLOC_PRAGMA
#pragma alloc_text(INIT, DriverEntry)
#pragma alloc_text(PAGE, SerialMouseServiceParameters)
#pragma alloc_text(PAGE, SerialMouseClosePort)
#pragma alloc_text(PAGE, SerialMouseInitializeHardware)
#pragma alloc_text(PAGE, SerialMouseInitializeDevice)
#pragma alloc_text(PAGE, SerialMouseSpinUpRead)
#pragma alloc_text(PAGE, SerialMouseStartDevice)
#pragma alloc_text(PAGE, SerialMouseUnload)

#if DBG
#pragma alloc_text(INIT,SerialMouseGetDebugFlags)
#endif

#endif

#if DBG
ULONG GlobalDebugFlags;
#endif

NTSTATUS
DriverEntry(
    IN PDRIVER_OBJECT DriverObject,
    IN PUNICODE_STRING RegistryPath
    )

/*++

Routine Description:

    This routine initializes the serial (i8250) mouse port driver.

Arguments:

    DriverObject - Pointer to driver object created by system.

    RegistryPath - Pointer to the Unicode name of the registry path
        for this driver.

Return Value:

    The function value is the final status from the initialization operation.

--*/

{
    PUNICODE_STRING regPath;
    NTSTATUS status;

    status = IoAllocateDriverObjectExtension(DriverObject,
                                             (PVOID) 1,
                                             sizeof(UNICODE_STRING),
                                             (PVOID *) &regPath);

    ASSERT(NT_SUCCESS(status));

    if (regPath) {
        regPath->MaximumLength = RegistryPath->Length + sizeof(UNICODE_NULL);
        regPath->Length = RegistryPath->Length;
        regPath->Buffer = ExAllocatePool(NonPagedPool,
                                         regPath->MaximumLength);

        if (regPath->Buffer) {
            RtlZeroMemory(regPath->Buffer,
                          regPath->MaximumLength);

            RtlMoveMemory(regPath->Buffer,
                          RegistryPath->Buffer,
                          RegistryPath->Length);
        }
        else {
            regPath->MaximumLength = regPath->Length = 0;
        }
    }

#if DBG
    SerialMouseGetDebugFlags(regPath);
#endif

    //
    // Set up the device driver entry points and leave
    //

    DriverObject->MajorFunction[IRP_MJ_CREATE] = SerialMouseCreate;
    DriverObject->MajorFunction[IRP_MJ_CLOSE]  = SerialMouseClose;
    DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS]  =
                                                 SerialMouseFlush;
    DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] =
                                         SerialMouseInternalDeviceControl;

    DriverObject->MajorFunction[IRP_MJ_PNP]    = SerialMousePnP;
    DriverObject->MajorFunction[IRP_MJ_POWER]  = SerialMousePower;

    DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
                                                 SerialMouseSystemControl;

    DriverObject->DriverUnload                 = SerialMouseUnload;
    DriverObject->DriverExtension->AddDevice   = SerialMouseAddDevice;

    return STATUS_SUCCESS;
}

VOID
SerialMouseClosePort(
    PDEVICE_EXTENSION DeviceExtension,
    PIRP              Irp
    )
{
    PIO_STACK_LOCATION next;

    SerialMouseRestorePort(DeviceExtension);

    next = IoGetNextIrpStackLocation (Irp);
    RtlZeroMemory(next, sizeof(IO_STACK_LOCATION));
    next->MajorFunction = IRP_MJ_CLEANUP;

    SerialMouseSendIrpSynchronously(DeviceExtension->TopOfStack,
                                    Irp,
                                    FALSE);

    next = IoGetNextIrpStackLocation (Irp);
    RtlZeroMemory(next, sizeof(IO_STACK_LOCATION));
    next->MajorFunction = IRP_MJ_CLOSE;

    SerialMouseSendIrpSynchronously(DeviceExtension->TopOfStack,
                                    Irp,
                                    FALSE);

}
NTSTATUS
SerialMouseSpinUpRead(
    PDEVICE_EXTENSION DeviceExtension
    )
{
    NTSTATUS status;

    PAGED_CODE();

    IoAcquireRemoveLock(&DeviceExtension->RemoveLock,
                        DeviceExtension->ReadIrp);

    ASSERT(DeviceExtension->Started);

    //
    // SerialMouseStartRead needs started to be set to true
    //
    DeviceExtension->ReadInterlock = SERIAL_MOUSE_END_READ;

    status = SerialMouseStartRead(DeviceExtension);

    if (status == STATUS_PENDING || status == STATUS_SUCCESS) {
        Print(DeviceExtension, DBG_PNP_INFO,
              ("Start read succeeded, 0x%x\n", status));

        status = STATUS_SUCCESS;
    }
    else {
        Print(DeviceExtension, DBG_PNP_ERROR,
              ("Start read failed, 0x%x\n", status));

        ASSERT(!NT_SUCCESS(status));

        //
        // No need to release the remove lock here.  If SerialMouseStartRead
        // fails, then it will release the lock on its own.
        //
        // IoReleaseRemoveLock(&DeviceExtension->RemoveLock,
        //                     DeviceExtension->ReadIrp);

        DeviceExtension->Started = FALSE;
    }

    return status;
}

NTSTATUS
SerialMouseStartDevice(
    PDEVICE_EXTENSION DeviceExtension,
    PIRP              Irp,
    BOOLEAN           CloseOnFailure
    )
{
    PIO_STACK_LOCATION  next;
    NTSTATUS            status;

    PAGED_CODE();

    status = SerialMouseInitializeDevice(DeviceExtension);

    Print(DeviceExtension, DBG_PNP_INFO, ("InitializeDevice 0x%x\n", status));

    if (NT_SUCCESS(status)) {
        status = SerialMouseSpinUpRead(DeviceExtension);
    }

    if (!NT_SUCCESS(status) && CloseOnFailure) {

        Print(DeviceExtension, DBG_PNP_ERROR,
              ("sending close due to failure, 0x%x\n", status));

        //
        // The start failed and we sent the create as part of the start
        // Send the matching cleanup/close so the port is accessible again.
        //
        SerialMouseClosePort(DeviceExtension, Irp);

        InterlockedDecrement(&DeviceExtension->EnableCount);
    }

    return status;
}

NTSTATUS
SerialMouseInitializeDevice (
    IN PDEVICE_EXTENSION    DeviceExtension
    )

/*++

Routine Description:

    This routine initializes the device for the given device
    extension.

Arguments:

    DriverObject        - Supplies the driver object.

    TmpDeviceExtension  - Supplies a temporary device extension for the
                            device to initialize.

    RegistryPath        - Supplies the registry path.

    BaseDeviceName      - Supplies the base device name to the device
                            to create.

Return Value:

    None.

--*/

{
#define DUMP_COUNT 4
    NTSTATUS                status = STATUS_SUCCESS;
    PIO_ERROR_LOG_PACKET    errorLogEntry;
    ULONG                   uniqueErrorValue,
                            dumpCount = 0,
                            i,
                            dumpData[DUMP_COUNT];
    UNICODE_STRING              keyName;
    KEVENT                  event;
    IO_STATUS_BLOCK         iosb;
    ULONG                   waitMask;

    for (i = 0; i < DUMP_COUNT; i++) {
        dumpData[i] = 0;
    }

    Print(DeviceExtension, DBG_SS_TRACE, ("StartDevice, enter\n"));

    PAGED_CODE();

    DeviceExtension->Started = TRUE;

    //
    // Set the wait mask to zero so that when we send the
    // wait request it won't get completed due to init flipping lines
    //
    // (the wait mask could have been set by a previous app or by this driver
    //  and we are coming out of a > D0 state)
    //
    waitMask = 0x0;
    KeInitializeEvent(&event, NotificationEvent, FALSE);

    SerialMouseIoSyncIoctlEx(IOCTL_SERIAL_SET_WAIT_MASK,
                             DeviceExtension->TopOfStack,
                             &event,
                             &iosb,
                             &waitMask,
                             sizeof(ULONG),
                             NULL,
                             0);

    //
    // Initialize the h/w and figure out what type of mouse is on the port
    //
    status = SerialMouseInitializeHardware(DeviceExtension);

    if (!NT_SUCCESS(status)) {
        Print(DeviceExtension, DBG_SS_ERROR,
              ("Could not initialize hardware\n"));
        goto SerialMouseInitializeExit;
    }

    if (!DeviceExtension->MouseAttributes.MouseIdentifier) {
        DeviceExtension->MouseAttributes.MouseIdentifier =
            MOUSE_SERIAL_HARDWARE;
    }

    DeviceExtension->DetectionSupported = TRUE;
    SerialMouseStartDetection(DeviceExtension);

SerialMouseInitializeExit:

    //
    // Log an error, if necessary.
    //

    if (status != STATUS_SUCCESS) {
        DeviceExtension->Started = FALSE;

        errorLogEntry = (PIO_ERROR_LOG_PACKET)
            IoAllocateErrorLogEntry(
                DeviceExtension->Self,
                (UCHAR) (sizeof(IO_ERROR_LOG_PACKET)
                         + (dumpCount * sizeof(ULONG)))
                );

        if (errorLogEntry != NULL) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合av网| 91传媒视频在线播放| 久久99久久久久| 欧美色欧美亚洲另类二区| 91.xcao| 久久久国际精品| 亚洲成人激情社区| aaa亚洲精品一二三区| 777a∨成人精品桃花网| 亚洲欧美激情插| 国产成人8x视频一区二区| 欧美裸体一区二区三区| 亚洲欧洲精品成人久久奇米网| 日日夜夜免费精品视频| 色欧美乱欧美15图片| 中文字幕av一区二区三区免费看| 蜜桃久久久久久| 欧美网站一区二区| 一区二区在线看| av一区二区三区四区| 精品88久久久久88久久久| 欧美视频一区二区三区| 亚洲与欧洲av电影| 成人午夜又粗又硬又大| 精品久久久网站| 三级在线观看一区二区| 精品视频在线免费看| 一区二区三区在线视频免费| 波多野结衣在线aⅴ中文字幕不卡| 欧美一级理论片| 午夜精品久久久久久久久久| 91豆麻精品91久久久久久| 国产精品系列在线| 国产91色综合久久免费分享| 国产亚洲婷婷免费| 成人性生交大合| 国产精品伦理一区二区| 成人综合婷婷国产精品久久 | 美国av一区二区| 亚洲资源中文字幕| 欧洲av一区二区嗯嗯嗯啊| 在线观看www91| 欧美α欧美αv大片| 亚洲视频在线一区| 久久丁香综合五月国产三级网站| 国产精品18久久久久久vr| 色哟哟国产精品| 久久综合九色综合久久久精品综合| 国产精品国产成人国产三级| 青草av.久久免费一区| 色狠狠一区二区| 国产欧美精品一区| 喷白浆一区二区| 在线精品视频一区二区| 国产女人18毛片水真多成人如厕| 成人免费视频app| 91精品欧美一区二区三区综合在 | 亚洲美女屁股眼交| 精品一区二区三区免费视频| 色噜噜狠狠成人网p站| 国产嫩草影院久久久久| 久久精品国产第一区二区三区| 欧美在线观看一区二区| 亚洲婷婷综合色高清在线| 国产高清在线精品| 欧美精品一区二区三区很污很色的| 亚洲一区二区三区四区不卡| 国产91清纯白嫩初高中在线观看| 欧美一级二级三级乱码| 天堂蜜桃一区二区三区 | 亚洲一区二区五区| 暴力调教一区二区三区| 国产日韩精品一区二区三区 | 久久久久久97三级| 蜜臀99久久精品久久久久久软件| 精品视频999| 亚洲电影中文字幕在线观看| 91电影在线观看| 亚洲国产成人91porn| 欧美日韩精品免费观看视频| 亚洲线精品一区二区三区| 在线区一区二视频| 一区二区在线免费| 欧美日韩不卡在线| 美腿丝袜亚洲一区| 久久综合九色综合欧美98| 国产高清久久久久| 日本一区二区三区免费乱视频| 成人理论电影网| 亚洲精品乱码久久久久久黑人 | 欧美日韩黄色一区二区| 亚洲成av人片在www色猫咪| 欧美高清视频一二三区 | 亚洲男同性恋视频| 色婷婷国产精品| 香蕉久久夜色精品国产使用方法 | 中文字幕va一区二区三区| bt欧美亚洲午夜电影天堂| 亚洲婷婷综合久久一本伊一区| 欧美这里有精品| 蜜臀av一级做a爰片久久| 亚洲精品一区二区三区香蕉| 国产成人精品www牛牛影视| 亚洲免费观看高清完整版在线观看 | 国产亚洲成年网址在线观看| 成人黄色综合网站| 亚洲成人在线网站| 久久久99精品免费观看不卡| 99久久精品免费看国产免费软件| 亚洲一区在线免费观看| 欧美成人女星排行榜| 成人理论电影网| 亚洲福利视频一区| 久久久91精品国产一区二区精品 | 亚洲v中文字幕| 2021久久国产精品不只是精品| 99精品黄色片免费大全| 免费高清视频精品| 亚洲品质自拍视频网站| 精品人在线二区三区| 色国产精品一区在线观看| 激情久久五月天| 亚洲不卡av一区二区三区| 国产精品天美传媒| 日韩一级片网站| 欧美亚洲日本国产| 成人h版在线观看| 男女男精品视频网| 一区二区在线免费观看| 久久久噜噜噜久噜久久综合| 欧美日韩精品一区二区| eeuss鲁片一区二区三区| 久久99深爱久久99精品| 亚洲第一精品在线| 亚洲欧美日韩系列| 亚洲国产激情av| 日韩精品一区二区三区在线 | 奇米色777欧美一区二区| 亚洲免费观看在线观看| 国产无一区二区| 精品久久久三级丝袜| 欧美精品18+| 91成人国产精品| 91玉足脚交白嫩脚丫在线播放| 国产精品1024| 亚洲综合男人的天堂| 国产成a人无v码亚洲福利| 亚洲精品中文字幕乱码三区| 精品福利一区二区三区免费视频| 欧美美女视频在线观看| 色丁香久综合在线久综合在线观看| 国产不卡高清在线观看视频| 极品销魂美女一区二区三区| 蜜桃视频一区二区| 久久国产精品99久久人人澡| 蜜臀av一区二区在线观看 | eeuss鲁片一区二区三区 | 国产99久久久国产精品潘金网站| 日本在线不卡视频| 偷拍与自拍一区| 日韩国产欧美一区二区三区| 日本三级亚洲精品| 麻豆成人久久精品二区三区红 | 亚洲精品一区二区三区在线观看 | 国产精品成人一区二区艾草| 国产精品久久久爽爽爽麻豆色哟哟| 欧美激情一区不卡| 成人免费在线播放视频| 亚洲天堂网中文字| 亚洲一级片在线观看| 午夜亚洲国产au精品一区二区| 婷婷久久综合九色综合绿巨人| 三级成人在线视频| 韩国欧美一区二区| 91亚洲午夜精品久久久久久| 91国产丝袜在线播放| 777久久久精品| 欧美精品一区二区久久久| 亚洲国产精品传媒在线观看| 亚洲免费av高清| 日本va欧美va瓶| 成人一区二区三区| 欧美日韩精品系列| 久久久精品免费网站| 一区二区在线观看不卡| 免费在线看成人av| 成人app网站| 69精品人人人人| 国产欧美精品在线观看| 亚洲精品国产精华液| 老司机午夜精品99久久| 99精品视频在线观看| 欧美变态tickling挠脚心| 亚洲男人的天堂av| 国产在线精品一区二区夜色 | 日韩国产欧美在线观看| 国产成人日日夜夜| 777亚洲妇女| 中文字幕一区av| 韩国三级在线一区|