VirtualBox

Ignore:
Timestamp:
Aug 24, 2022 9:56:54 AM (2 years ago)
Author:
vboxsync
Message:

Add/NT/Inst,Add/NT/VBoxTray,Add/VBoxService: Cleaned up VBoxGuestInstallHelper.cpp (tested) and the VBoxTray IPC interface (not tested). The motivation for the former was to make it compile in no-CRT mode, the latter was buggy code. The IPC interface is not backwards compatible, this is intentional to avoid buggy code. bugref:10261

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTrayMsg.h

    r96407 r96451  
    3434/** The IPC pipe's prefix (native).
    3535 * Will be followed by the username VBoxTray runs under. */
    36 #define VBOXTRAY_IPC_PIPE_PREFIX      "\\\\.\\pipe\\VBoxTrayIPC-"
     36#define VBOXTRAY_IPC_PIPE_PREFIX        "\\\\.\\pipe\\VBoxTrayIPC-"
    3737/** The IPC header's magic. */
    38 #define VBOXTRAY_IPC_HDR_MAGIC        0x19840804
     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
    3944
    40 enum VBOXTRAYIPCMSGTYPE
     45
     46/**
     47 * VBoxTray IPC message types.
     48 */
     49typedef enum VBOXTRAYIPCMSGTYPE
    4150{
    42     /** Restarts VBoxTray. */
    43     VBOXTRAYIPCMSGTYPE_RESTART        = 10,
    44     /** Shows a balloon message in the tray area. */
    45     VBOXTRAYIPCMSGTYPE_SHOWBALLOONMSG = 100,
    46     /** Retrieves the current user's last input
    47      *  time. This will be the user VBoxTray is running
    48      *  under. No actual message for this command
    49      *  required. */
    50     VBOXTRAYIPCMSGTYPE_USERLASTINPUT  = 120
    51 };
     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;
    5270
    53 /* VBoxTray's IPC header. */
     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 */
    5477typedef struct VBOXTRAYIPCHEADER
    5578{
    56     /** The header's magic. */
    57     uint32_t uMagic;
     79    /** The header's magic (VBOXTRAY_IPC_HDR_MAGIC). */
     80    uint32_t            uMagic;
    5881    /** Header version, must be 0 by now. */
    59     uint32_t uHdrVersion;
    60     /** Message type. Specifies a message
    61      *  of VBOXTRAYIPCMSGTYPE. */
    62     uint32_t uMsgType;
    63     /** Message length (in bytes). This must
    64      *  include the overall message length, including
    65      *  (eventual) dynamically allocated areas which
    66      *  are passed into the message structure.
    67      */
    68     uint32_t uMsgLen;
    69 
    70 } VBOXTRAYIPCHEADER, *PVBOXTRAYIPCHEADER;
     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;
    7191
    7292/**
    73  * Tells VBoxTray to show a balloon message in Windows'
    74  * tray area. This may or may not work depending on the
    75  * system's configuration / set user preference.
     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.
    7697 */
    77 typedef struct VBOXTRAYIPCMSG_SHOWBALLOONMSG
     98typedef struct VBOXTRAYIPCMSG_SHOW_BALLOON_MSG_T
    7899{
    79     /** Length of message body (in bytes). */
    80     uint32_t cbMsgContent;
    81     /** Length of message title (in bytes). */
    82     uint32_t cbMsgTitle;
     100    /** Length of the message string (no terminator). */
     101    uint32_t    cchMsg;
     102    /** Length of the title string (no terminator). */
     103    uint32_t    cchTitle;
    83104    /** Message type. */
    84     uint32_t uType;
     105    uint32_t    uType;
    85106    /** Time to show the message (in ms). */
    86     uint32_t uShowMS;
    87     /** Dynamically allocated stuff.
    88      *
    89      *  Note: These must come at the end of the
    90      *  structure to not overwrite any important
    91      *  stuff above.
    92      */
    93     /** Message body. Can be up to 256 chars
    94      *  long. */
    95     char     szMsgContent[1];
    96         /** Message title. Can be up to 73 chars
    97      *  long. */
    98     char     szMsgTitle[1];
    99 } VBOXTRAYIPCMSG_SHOWBALLOONMSG, *PVBOXTRAYIPCMSG_SHOWBALLOONMSG;
     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;
    100112
    101113/**
    102  * Response telling the last input of the current user.
     114 * Reply to VBOXTRAYIPCMSGTYPE_USER_LAST_INPUT
    103115 */
    104 typedef struct VBOXTRAYIPCRES_USERLASTINPUT
     116typedef struct VBOXTRAYIPCREPLY_USER_LAST_INPUT_T
    105117{
    106     /** Last occurred user input event (in seconds). */
    107     uint32_t uLastInput;
    108 } VBOXTRAYIPCRES_USERLASTINPUT, *PVBOXTRAYIPCRES_USERLASTINPUT;
     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;
    109123
    110124#endif /* !GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTrayMsg_h */
Note: See TracChangeset for help on using the changeset viewer.

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