1 | /* $Id: VBoxUsbIdc.h 76568 2019-01-01 04:34:11Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Windows USB Proxy - Monitor Driver communication interface.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2019 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 |
|
---|
27 | #ifndef VBOX_INCLUDED_SRC_VBoxUSB_win_cmn_VBoxUsbIdc_h
|
---|
28 | #define VBOX_INCLUDED_SRC_VBoxUSB_win_cmn_VBoxUsbIdc_h
|
---|
29 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
30 | # pragma once
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #define VBOXUSBIDC_VERSION_MAJOR 1
|
---|
34 | #define VBOXUSBIDC_VERSION_MINOR 0
|
---|
35 |
|
---|
36 | #define VBOXUSBIDC_INTERNAL_IOCTL_GET_VERSION CTL_CODE(FILE_DEVICE_UNKNOWN, 0x618, METHOD_NEITHER, FILE_WRITE_ACCESS)
|
---|
37 | #define VBOXUSBIDC_INTERNAL_IOCTL_PROXY_STARTUP CTL_CODE(FILE_DEVICE_UNKNOWN, 0x619, METHOD_NEITHER, FILE_WRITE_ACCESS)
|
---|
38 | #define VBOXUSBIDC_INTERNAL_IOCTL_PROXY_TEARDOWN CTL_CODE(FILE_DEVICE_UNKNOWN, 0x61A, METHOD_NEITHER, FILE_WRITE_ACCESS)
|
---|
39 | #define VBOXUSBIDC_INTERNAL_IOCTL_PROXY_STATE_CHANGE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x61B, METHOD_NEITHER, FILE_WRITE_ACCESS)
|
---|
40 |
|
---|
41 | typedef struct
|
---|
42 | {
|
---|
43 | uint32_t u32Major;
|
---|
44 | uint32_t u32Minor;
|
---|
45 | } VBOXUSBIDC_VERSION, *PVBOXUSBIDC_VERSION;
|
---|
46 |
|
---|
47 | typedef void *HVBOXUSBIDCDEV;
|
---|
48 |
|
---|
49 | /* the initial device state is USBDEVICESTATE_HELD_BY_PROXY */
|
---|
50 | typedef struct VBOXUSBIDC_PROXY_STARTUP
|
---|
51 | {
|
---|
52 | union
|
---|
53 | {
|
---|
54 | /* in: device PDO */
|
---|
55 | PDEVICE_OBJECT pPDO;
|
---|
56 | /* out: device handle to be used for subsequent USBSUP_PROXY_XXX calls */
|
---|
57 | HVBOXUSBIDCDEV hDev;
|
---|
58 | } u;
|
---|
59 | } VBOXUSBIDC_PROXY_STARTUP, *PVBOXUSBIDC_PROXY_STARTUP;
|
---|
60 |
|
---|
61 | typedef struct VBOXUSBIDC_PROXY_TEARDOWN
|
---|
62 | {
|
---|
63 | HVBOXUSBIDCDEV hDev;
|
---|
64 | } VBOXUSBIDC_PROXY_TEARDOWN, *PVBOXUSBIDC_PROXY_TEARDOWN;
|
---|
65 |
|
---|
66 | typedef enum
|
---|
67 | {
|
---|
68 | VBOXUSBIDC_PROXY_STATE_UNKNOWN = 0,
|
---|
69 | VBOXUSBIDC_PROXY_STATE_IDLE,
|
---|
70 | VBOXUSBIDC_PROXY_STATE_INITIAL = VBOXUSBIDC_PROXY_STATE_IDLE,
|
---|
71 | VBOXUSBIDC_PROXY_STATE_USED_BY_GUEST
|
---|
72 | } VBOXUSBIDC_PROXY_STATE;
|
---|
73 |
|
---|
74 | typedef struct VBOXUSBIDC_PROXY_STATE_CHANGE
|
---|
75 | {
|
---|
76 | HVBOXUSBIDCDEV hDev;
|
---|
77 | VBOXUSBIDC_PROXY_STATE enmState;
|
---|
78 | } VBOXUSBIDC_PROXY_STATE_CHANGE, *PVBOXUSBIDC_PROXY_STATE_CHANGE;
|
---|
79 |
|
---|
80 | NTSTATUS VBoxUsbIdcInit();
|
---|
81 | VOID VBoxUsbIdcTerm();
|
---|
82 | NTSTATUS VBoxUsbIdcProxyStarted(PDEVICE_OBJECT pPDO, HVBOXUSBIDCDEV *phDev);
|
---|
83 | NTSTATUS VBoxUsbIdcProxyStopped(HVBOXUSBIDCDEV hDev);
|
---|
84 |
|
---|
85 | #endif /* !VBOX_INCLUDED_SRC_VBoxUSB_win_cmn_VBoxUsbIdc_h */
|
---|