[34085] | 1 | /* $Id: VBoxTrayMsg.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
| 2 | /** @file
|
---|
| 3 | * VBoxTrayMsg - Globally registered messages (RPC) to/from VBoxTray.
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2010-2023 Oracle and/or its affiliates.
|
---|
[34085] | 8 | *
|
---|
[96407] | 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
|
---|
[34085] | 26 | */
|
---|
| 27 |
|
---|
[76563] | 28 | #ifndef GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTrayMsg_h
|
---|
| 29 | #define GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTrayMsg_h
|
---|
[76540] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[34085] | 33 |
|
---|
[64326] | 34 | /** The IPC pipe's prefix (native).
|
---|
| 35 | * Will be followed by the username VBoxTray runs under. */
|
---|
[96451] | 36 | #define VBOXTRAY_IPC_PIPE_PREFIX "\\\\.\\pipe\\VBoxTrayIPC-"
|
---|
[47234] | 37 | /** The IPC header's magic. */
|
---|
[96451] | 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
|
---|
[34085] | 44 |
|
---|
[96451] | 45 |
|
---|
| 46 | /**
|
---|
| 47 | * VBoxTray IPC message types.
|
---|
| 48 | */
|
---|
| 49 | typedef enum VBOXTRAYIPCMSGTYPE
|
---|
[34085] | 50 | {
|
---|
[96451] | 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;
|
---|
[34085] | 70 |
|
---|
[96451] | 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 | */
|
---|
[47213] | 77 | typedef struct VBOXTRAYIPCHEADER
|
---|
[34085] | 78 | {
|
---|
[96451] | 79 | /** The header's magic (VBOXTRAY_IPC_HDR_MAGIC). */
|
---|
| 80 | uint32_t uMagic;
|
---|
[47213] | 81 | /** Header version, must be 0 by now. */
|
---|
[96451] | 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. */
|
---|
| 90 | typedef VBOXTRAYIPCHEADER *PVBOXTRAYIPCHEADER;
|
---|
[47213] | 91 |
|
---|
| 92 | /**
|
---|
[96451] | 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.
|
---|
[47213] | 97 | */
|
---|
[96451] | 98 | typedef struct VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T
|
---|
[34085] | 99 | {
|
---|
[96451] | 100 | /** Length of the message string (no terminator). */
|
---|
| 101 | uint32_t cchMsg;
|
---|
| 102 | /** Length of the title string (no terminator). */
|
---|
| 103 | uint32_t cchTitle;
|
---|
[34085] | 104 | /** Message type. */
|
---|
[96451] | 105 | uint32_t uType;
|
---|
[47213] | 106 | /** Time to show the message (in ms). */
|
---|
[96451] | 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;
|
---|
| 111 | typedef VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T *PVBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T;
|
---|
[34085] | 112 |
|
---|
[47213] | 113 | /**
|
---|
[96451] | 114 | * Reply to VBOXTRAYIPCMSGTYPE_USER_LAST_INPUT
|
---|
[47213] | 115 | */
|
---|
[96451] | 116 | typedef struct VBOXTRAYIPCREPLY_USER_LAST_INPUT_T
|
---|
[47213] | 117 | {
|
---|
[96451] | 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;
|
---|
| 122 | typedef VBOXTRAYIPCREPLY_USER_LAST_INPUT_T *PVBOXTRAYIPCREPLY_USER_LAST_INPUT_T;
|
---|
[47213] | 123 |
|
---|
[76563] | 124 | #endif /* !GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTrayMsg_h */
|
---|
[34085] | 125 |
|
---|