VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTrayMsg.h

最後變更 在這個檔案是 107972,由 vboxsync 提交於 7 週 前

VBoxTray/IPC: Added a note about VBOXTRAY_IPC_HDR_VERSION (VBox >= 6.0 vs. older versions).

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 4.2 KB
 
1/* $Id: VBoxTrayMsg.h 107972 2025-01-28 17:10:46Z vboxsync $ */
2/** @file
3 * VBoxTrayMsg - Globally registered messages (RPC) to/from VBoxTray.
4 */
5
6/*
7 * Copyright (C) 2010-2024 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.alldomusa.eu.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTrayMsg_h
29#define GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTrayMsg_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/** The IPC pipe's prefix (native).
35 * Will be followed by the username VBoxTray runs under. */
36#define VBOXTRAY_IPC_PIPE_PREFIX "\\\\.\\pipe\\VBoxTrayIPC-"
37/** The IPC header's magic. */
38#define VBOXTRAY_IPC_HDR_MAGIC 0x19840804
39/** IPC header version number.
40 * Note: This has been changed in VBox 6.0 (r153295) to be 1.
41 * For VBox < 6.0 the value was 0. */
42#define VBOXTRAY_IPC_HDR_VERSION 1
43/** The max payload size accepted by VBoxTray. Clients trying to send more
44 * will be disconnected. */
45#define VBOXTRAY_IPC_MAX_PAYLOAD _16K
46
47
48/**
49 * VBoxTray IPC message types.
50 */
51typedef enum VBOXTRAYIPCMSGTYPE
52{
53 /** Customary invalid zero value. */
54 VBOXTRAYIPCMSGTYPE_INVALID = 0,
55 /** Restarts VBoxTray - not implemented.
56 * Payload: None.
57 * Reply: None. */
58 VBOXTRAYIPCMSGTYPE_RESTART,
59 /** Shows a balloon message in the tray area.
60 * Payload: VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T
61 * Reply: None */
62 VBOXTRAYIPCMSGTYPE_SHOW_BALLOON_MSG,
63 /** Time since the last user input for the user VBoxTray is running as.
64 * Payload: None.
65 * Reply: VBOXTRAYIPCREPLY_USER_LAST_INPUT_T. */
66 VBOXTRAYIPCMSGTYPE_USER_LAST_INPUT,
67 /** End of valid types. */
68 VBOXTRAYIPCMSGTYPE_END,
69 /* Make sure the type is 32-bit wide. */
70 VBOXTRAYIPCMSGTYPE_32BIT_HACK = 0x7fffffff
71} VBOXTRAYIPCMSGTYPE;
72
73/**
74 * VBoxTray's IPC header.
75 *
76 * All messages have one of these. The payload following it is optional and
77 * specific to each individual message type.
78 */
79typedef struct VBOXTRAYIPCHEADER
80{
81 /** The header's magic (VBOXTRAY_IPC_HDR_MAGIC). */
82 uint32_t uMagic;
83 /** Header version, must be 0 by now. */
84 uint32_t uVersion;
85 /** Message type, a VBOXTRAYIPCMSGTYPE value. */
86 VBOXTRAYIPCMSGTYPE enmMsgType;
87 /** Payload length in bytes.
88 * When present, the payload follows this header. */
89 uint32_t cbPayload;
90} VBOXTRAYIPCHEADER;
91/** Pointer to a VBoxTray IPC header. */
92typedef VBOXTRAYIPCHEADER *PVBOXTRAYIPCHEADER;
93
94/**
95 * Tells VBoxTray to show a balloon message in Windows' tray area.
96 *
97 * This may or may not work depending on the system's configuration / set user
98 * preference.
99 */
100typedef struct VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T
101{
102 /** Length of the message string (no terminator). */
103 uint32_t cchMsg;
104 /** Length of the title string (no terminator). */
105 uint32_t cchTitle;
106 /** Message type. */
107 uint32_t uType;
108 /** Time to show the message (in ms). */
109 uint32_t cMsTimeout;
110 /** Variable length buffer containing two szero terminated strings, first is */
111 char szzStrings[RT_FLEXIBLE_ARRAY];
112} VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T;
113typedef VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T *PVBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T;
114
115/**
116 * Reply to VBOXTRAYIPCMSGTYPE_USER_LAST_INPUT
117 */
118typedef struct VBOXTRAYIPCREPLY_USER_LAST_INPUT_T
119{
120 /** How many seconds since the last user input event.
121 * Set to UINT32_MAX if we don't know. */
122 uint32_t cSecSinceLastInput;
123} VBOXTRAYIPCREPLY_USER_LAST_INPUT_T;
124typedef VBOXTRAYIPCREPLY_USER_LAST_INPUT_T *PVBOXTRAYIPCREPLY_USER_LAST_INPUT_T;
125
126#endif /* !GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTrayMsg_h */
127
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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