VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Mouse/NT5/VBoxMF.h@ 39899

Last change on this file since 39899 was 38932, checked in by vboxsync, 13 years ago

VBoxMouse/win: simplify power handling, code formatting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1/* $Id: VBoxMF.h 38932 2011-10-03 11:22:39Z vboxsync $ */
2
3/** @file
4 * VBox Mouse filter header
5 */
6
7/*
8 * Copyright (C) 2011 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef VBOXMF_H
20#define VBOXMF_H
21
22#include <iprt/cdefs.h>
23#define LOG_GROUP LOG_GROUP_DRV_MOUSE
24#include <VBox/log.h>
25#include <iprt/err.h>
26#include <iprt/assert.h>
27#include "../common/VBoxMouseLog.h"
28RT_C_DECLS_BEGIN
29#include <ntddk.h>
30#include <ntddmou.h>
31#include <ntddkbd.h>
32#include <ntdd8042.h>
33RT_C_DECLS_END
34#include <VBox/VMMDev.h>
35
36#define IOCTL_INTERNAL_MOUSE_CONNECT CTL_CODE(FILE_DEVICE_MOUSE, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
37
38typedef VOID (*PFNSERVICECB)(PDEVICE_OBJECT DeviceObject, PMOUSE_INPUT_DATA InputDataStart,
39 PMOUSE_INPUT_DATA InputDataEnd, PULONG InputDataConsumed);
40
41typedef struct _INTERNAL_MOUSE_CONNECT_DATA
42{
43 PDEVICE_OBJECT pDO;
44 PFNSERVICECB pfnServiceCB;
45} INTERNAL_MOUSE_CONNECT_DATA, *PINTERNAL_MOUSE_CONNECT_DATA;
46
47typedef struct _VBOXMOUSE_DEVEXT
48{
49 LIST_ENTRY ListEntry;
50 PDEVICE_OBJECT pdoMain; /* PDO passed to VBoxDrvAddDevice */
51 PDEVICE_OBJECT pdoSelf; /* our PDO created in VBoxDrvAddDevice*/
52 PDEVICE_OBJECT pdoParent; /* Highest PDO in chain before we've attached our filter */
53
54 BOOLEAN bHostMouse; /* Indicates if we're filtering the chain with emulated i8042 PS/2 adapter */
55
56 INTERNAL_MOUSE_CONNECT_DATA OriginalConnectData; /* Original connect data intercepted in IOCTL_INTERNAL_MOUSE_CONNECT */
57 VMMDevReqMouseStatus *pSCReq; /* Preallocated request to use in pfnServiceCB */
58
59 IO_REMOVE_LOCK RemoveLock;
60} VBOXMOUSE_DEVEXT, *PVBOXMOUSE_DEVEXT;
61
62/* Interface functions */
63RT_C_DECLS_BEGIN
64 NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath);
65RT_C_DECLS_END
66
67NTSTATUS VBoxDrvAddDevice(IN PDRIVER_OBJECT Driver, IN PDEVICE_OBJECT PDO);
68VOID VBoxDrvUnload(IN PDRIVER_OBJECT Driver);
69
70/* IRP handlers */
71NTSTATUS VBoxIrpPassthrough(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
72NTSTATUS VBoxIrpInternalIOCTL(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
73NTSTATUS VBoxIrpPnP(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
74NTSTATUS VBoxIrpPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
75
76/* Internal functions */
77VOID VBoxDeviceAdded(PVBOXMOUSE_DEVEXT pDevExt);
78VOID VBoxInformHost(PVBOXMOUSE_DEVEXT pDevExt);
79VOID VBoxDeviceRemoved(PVBOXMOUSE_DEVEXT pDevExt);
80
81NTSTATUS VBoxNewProtInit();
82NTSTATUS VBoxNewProtTerm();
83
84VOID VBoxDrvNotifyServiceCB(PVBOXMOUSE_DEVEXT pDevExt, PMOUSE_INPUT_DATA InputDataStart, PMOUSE_INPUT_DATA InputDataEnd, PULONG InputDataConsumed);
85
86#endif /*VBOXMF_H*/
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette