1 | /* $Id: VBoxUsbIdc.h 69250 2017-10-24 19:18:49Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Windows USB Proxy - Monitor Driver communication interface.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2016 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 | #ifndef ___VBoxUsbIdc_h___
|
---|
27 | #define ___VBoxUsbIdc_h___
|
---|
28 |
|
---|
29 | #define VBOXUSBIDC_VERSION_MAJOR 1
|
---|
30 | #define VBOXUSBIDC_VERSION_MINOR 0
|
---|
31 |
|
---|
32 | #define VBOXUSBIDC_INTERNAL_IOCTL_GET_VERSION CTL_CODE(FILE_DEVICE_UNKNOWN, 0x618, METHOD_NEITHER, FILE_WRITE_ACCESS)
|
---|
33 | #define VBOXUSBIDC_INTERNAL_IOCTL_PROXY_STARTUP CTL_CODE(FILE_DEVICE_UNKNOWN, 0x619, METHOD_NEITHER, FILE_WRITE_ACCESS)
|
---|
34 | #define VBOXUSBIDC_INTERNAL_IOCTL_PROXY_TEARDOWN CTL_CODE(FILE_DEVICE_UNKNOWN, 0x61A, METHOD_NEITHER, FILE_WRITE_ACCESS)
|
---|
35 | #define VBOXUSBIDC_INTERNAL_IOCTL_PROXY_STATE_CHANGE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x61B, METHOD_NEITHER, FILE_WRITE_ACCESS)
|
---|
36 |
|
---|
37 | typedef struct
|
---|
38 | {
|
---|
39 | uint32_t u32Major;
|
---|
40 | uint32_t u32Minor;
|
---|
41 | } VBOXUSBIDC_VERSION, *PVBOXUSBIDC_VERSION;
|
---|
42 |
|
---|
43 | typedef void *HVBOXUSBIDCDEV;
|
---|
44 |
|
---|
45 | /* the initial device state is USBDEVICESTATE_HELD_BY_PROXY */
|
---|
46 | typedef struct VBOXUSBIDC_PROXY_STARTUP
|
---|
47 | {
|
---|
48 | union
|
---|
49 | {
|
---|
50 | /* in: device PDO */
|
---|
51 | PDEVICE_OBJECT pPDO;
|
---|
52 | /* out: device handle to be used for subsequent USBSUP_PROXY_XXX calls */
|
---|
53 | HVBOXUSBIDCDEV hDev;
|
---|
54 | } u;
|
---|
55 | } VBOXUSBIDC_PROXY_STARTUP, *PVBOXUSBIDC_PROXY_STARTUP;
|
---|
56 |
|
---|
57 | typedef struct VBOXUSBIDC_PROXY_TEARDOWN
|
---|
58 | {
|
---|
59 | HVBOXUSBIDCDEV hDev;
|
---|
60 | } VBOXUSBIDC_PROXY_TEARDOWN, *PVBOXUSBIDC_PROXY_TEARDOWN;
|
---|
61 |
|
---|
62 | typedef enum
|
---|
63 | {
|
---|
64 | VBOXUSBIDC_PROXY_STATE_UNKNOWN = 0,
|
---|
65 | VBOXUSBIDC_PROXY_STATE_IDLE,
|
---|
66 | VBOXUSBIDC_PROXY_STATE_INITIAL = VBOXUSBIDC_PROXY_STATE_IDLE,
|
---|
67 | VBOXUSBIDC_PROXY_STATE_USED_BY_GUEST
|
---|
68 | } VBOXUSBIDC_PROXY_STATE;
|
---|
69 |
|
---|
70 | typedef struct VBOXUSBIDC_PROXY_STATE_CHANGE
|
---|
71 | {
|
---|
72 | HVBOXUSBIDCDEV hDev;
|
---|
73 | VBOXUSBIDC_PROXY_STATE enmState;
|
---|
74 | } VBOXUSBIDC_PROXY_STATE_CHANGE, *PVBOXUSBIDC_PROXY_STATE_CHANGE;
|
---|
75 |
|
---|
76 | NTSTATUS VBoxUsbIdcInit();
|
---|
77 | VOID VBoxUsbIdcTerm();
|
---|
78 | NTSTATUS VBoxUsbIdcProxyStarted(PDEVICE_OBJECT pPDO, HVBOXUSBIDCDEV *phDev);
|
---|
79 | NTSTATUS VBoxUsbIdcProxyStopped(HVBOXUSBIDCDEV hDev);
|
---|
80 |
|
---|
81 | #endif /* #ifndef ___VBoxUsbIdc_h___ */
|
---|