VirtualBox

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

Last change on this file since 106945 was 106061, checked in by vboxsync, 3 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 KB
Line 
1/* $Id: VBoxTrayMsg.h 106061 2024-09-16 14:03:52Z 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.virtualbox.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#define VBOXTRAY_IPC_HDR_VERSION 1
41/** The max payload size accepted by VBoxTray. Clients trying to send more
42 * will be disconnected. */
43#define VBOXTRAY_IPC_MAX_PAYLOAD _16K
44
45
46/**
47 * VBoxTray IPC message types.
48 */
49typedef enum VBOXTRAYIPCMSGTYPE
50{
51 /** Customary invalid zero value. */
52 VBOXTRAYIPCMSGTYPE_INVALID = 0,
53 /** Restarts VBoxTray - not implemented.
54 * Payload: None.
55 * Reply: None. */
56 VBOXTRAYIPCMSGTYPE_RESTART,
57 /** Shows a balloon message in the tray area.
58 * Payload: VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T
59 * Reply: None */
60 VBOXTRAYIPCMSGTYPE_SHOW_BALLOON_MSG,
61 /** Time since the last user input for the user VBoxTray is running as.
62 * Payload: None.
63 * Reply: VBOXTRAYIPCREPLY_USER_LAST_INPUT_T. */
64 VBOXTRAYIPCMSGTYPE_USER_LAST_INPUT,
65 /** End of valid types. */
66 VBOXTRAYIPCMSGTYPE_END,
67 /* Make sure the type is 32-bit wide. */
68 VBOXTRAYIPCMSGTYPE_32BIT_HACK = 0x7fffffff
69} VBOXTRAYIPCMSGTYPE;
70
71/**
72 * VBoxTray's IPC header.
73 *
74 * All messages have one of these. The payload following it is optional and
75 * specific to each individual message type.
76 */
77typedef struct VBOXTRAYIPCHEADER
78{
79 /** The header's magic (VBOXTRAY_IPC_HDR_MAGIC). */
80 uint32_t uMagic;
81 /** Header version, must be 0 by now. */
82 uint32_t uVersion;
83 /** Message type, a VBOXTRAYIPCMSGTYPE value. */
84 VBOXTRAYIPCMSGTYPE enmMsgType;
85 /** Payload length in bytes.
86 * When present, the payload follows this header. */
87 uint32_t cbPayload;
88} VBOXTRAYIPCHEADER;
89/** Pointer to a VBoxTray IPC header. */
90typedef VBOXTRAYIPCHEADER *PVBOXTRAYIPCHEADER;
91
92/**
93 * Tells VBoxTray to show a balloon message in Windows' tray area.
94 *
95 * This may or may not work depending on the system's configuration / set user
96 * preference.
97 */
98typedef struct VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T
99{
100 /** Length of the message string (no terminator). */
101 uint32_t cchMsg;
102 /** Length of the title string (no terminator). */
103 uint32_t cchTitle;
104 /** Message type. */
105 uint32_t uType;
106 /** Time to show the message (in ms). */
107 uint32_t cMsTimeout;
108 /** Variable length buffer containing two szero terminated strings, first is */
109 char szzStrings[RT_FLEXIBLE_ARRAY];
110} VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T;
111typedef VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T *PVBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T;
112
113/**
114 * Reply to VBOXTRAYIPCMSGTYPE_USER_LAST_INPUT
115 */
116typedef struct VBOXTRAYIPCREPLY_USER_LAST_INPUT_T
117{
118 /** How many seconds since the last user input event.
119 * Set to UINT32_MAX if we don't know. */
120 uint32_t cSecSinceLastInput;
121} VBOXTRAYIPCREPLY_USER_LAST_INPUT_T;
122typedef VBOXTRAYIPCREPLY_USER_LAST_INPUT_T *PVBOXTRAYIPCREPLY_USER_LAST_INPUT_T;
123
124#endif /* !GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTrayMsg_h */
125
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