VirtualBox

Changeset 45109 in vbox for trunk/include/VBox/HostServices


Ignore:
Timestamp:
Mar 20, 2013 4:41:00 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84401
Message:

GuestCtrl: More stuff for IGuestFile and IGuestSession handling (work in progress).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/GuestControlSvc.h

    r45076 r45109  
    330330     */
    331331    GUEST_EXEC_IO_NOTIFY = 210,
    332     /** Guest notifies the host about a file event, like opening,
    333      *  closing, seeking etc.
     332    /**
     333     * Guest notifies the host about some file event.
    334334     */
    335335    GUEST_FILE_NOTIFY = 240
     
    363363/**
    364364 * Guest file notification types.
     365 * @sa HGCMMsgFileNotify.
    365366 */
    366367enum GUEST_FILE_NOTIFYTYPE
     
    377378
    378379/**
    379  * Guest file seeking types.
     380 * Guest file seeking types. Has to
     381 * match FileSeekType in Main.
    380382 */
    381383enum GUEST_FILE_SEEKTYPE
     
    693695    /** File handle to read from. */
    694696    HGCMFunctionParameter handle;
    695     /** Actual size of data (in bytes). */
     697    /** Size (in bytes) to read. */
    696698    HGCMFunctionParameter size;
    697     /** Where to put the read data into. */
    698     HGCMFunctionParameter data;
    699699
    700700} HGCMMsgFileRead;
     
    714714    /** Actual size of data (in bytes). */
    715715    HGCMFunctionParameter size;
    716     /** Where to put the read data into. */
    717     HGCMFunctionParameter data;
    718716
    719717} HGCMMsgFileReadAt;
     
    785783} HGCMMsgFileTell;
    786784
    787 typedef struct HGCMMsgFileNotify
     785/******************************************************************************
     786* HGCM replies from the guest. These are handled in Main's low-level HGCM     *
     787* callbacks and dispatched to the appropriate guest object.                   *
     788******************************************************************************/
     789
     790typedef struct HGCMReplyFileNotify
    788791{
    789792    VBoxGuestHGCMCallInfo hdr;
     
    792795    /** Notification type. */
    793796    HGCMFunctionParameter type;
    794     /** Notification payload. */
    795     HGCMFunctionParameter payload;
    796 
    797 } HGCMMsgFileNotify;
     797    /** IPRT result of overall operation. */
     798    HGCMFunctionParameter rc;
     799    union
     800    {
     801        struct
     802        {
     803            /** Guest file handle. */
     804            HGCMFunctionParameter handle;
     805        } open;
     806        /** Note: Close does not have any additional data (yet). */
     807        struct
     808        {
     809            /** Actual data read (if any). */
     810            HGCMFunctionParameter data;
     811        } read;
     812        struct
     813        {
     814            /** How much data (in bytes) have been successfully written. */
     815            HGCMFunctionParameter written;
     816        } write;
     817        struct
     818        {
     819            HGCMFunctionParameter offset;
     820        } seek;
     821        struct
     822        {
     823            HGCMFunctionParameter offset;
     824        } tell;
     825    } u;
     826
     827} HGCMReplyFileNotify;
    798828
    799829#pragma pack ()
     
    832862    /** Notification type. */
    833863    uint32_t uType;
    834     /** Notification result. */
     864    /** Notification result. Note: int vs. uint32! */
    835865    uint32_t uResult;
    836866} CALLBACKDATA_SESSION_NOTIFY, *PCALLBACKDATA_SESSION_NOTIFY;
     
    882912} CALLBACKDATA_PROC_INPUT, *PCALLBACKDATA_PROC_INPUT;
    883913
     914/**
     915 * General guest file notification callback.
     916 */
    884917typedef struct CALLBACKDATA_FILE_NOTIFY
    885918{
    886919    /** Callback data header. */
    887920    CALLBACKDATA_HEADER hdr;
    888     /** The file handle. */
    889     uint32_t uHandle;
     921    /** Notification type. */
     922    uint32_t uType;
     923    /** IPRT result of overall operation. */
     924    uint32_t rc;
     925    union
     926    {
     927        struct
     928        {
     929            /** Guest file handle. */
     930            uint32_t uHandle;
     931        } open;
     932        /** Note: Close does not have any additional data (yet). */
     933        struct
     934        {
     935            /** How much data (in bytes) have been read. */
     936            uint32_t cbData;
     937            /** Actual data read (if any). */
     938            void *pvData;
     939        } read;
     940        struct
     941        {
     942            /** How much data (in bytes) have been successfully written. */
     943            uint32_t cbWritten;
     944        } write;
     945        struct
     946        {
     947            /** New file offset after successful seek. */
     948            uint64_t uOffActual;
     949        } seek;
     950        struct
     951        {
     952            /** New file offset after successful tell. */
     953            uint64_t uOffActual;
     954        } tell;
     955    } u;
    890956} CALLBACKDATA_FILE_NOTIFY, *PCALLBACKDATA_FILE_NOTIFY;
    891957
    892 /******************************************************************************
    893 * Callback payload structures.                                                *
    894 ******************************************************************************/
    895 
    896 /*
    897  * These structures contain the actual payload, based of the given payload
    898  * type the HGCM message includes.
    899  */
    900 
    901 typedef struct CALLBACKPAYLOAD_FILE_NOTIFY_OPEN
    902 {
    903     /** IPRT result of overall operation. */
    904     int32_t rc;
    905     /** File handle on successful opening. */
    906     uint32_t uHandle;
    907 } CALLBACKPAYLOAD_FILE_NOTIFY_OPEN, *PCALLBACKPAYLOAD_FILE_NOTIFY_OPEN;
    908 
    909 typedef struct CALLBACKPAYLOAD_FILE_NOTIFY_CLOSE
    910 {
    911     /** IPRT result of overall operation. */
    912     int32_t rc;
    913 } CALLBACKPAYLOAD_FILE_NOTIFY_CLOSE, *PCALLBACKPAYLOAD_FILE_NOTIFY_CLOSE;
    914 
    915 typedef struct CALLBACKPAYLOAD_FILE_NOTIFY_READ
    916 {
    917     /** IPRT result of overall operation. */
    918     int32_t rc;
    919     /** How much data (in bytes) have been read. */
    920     uint32_t cbData;
    921     /** Actual data read (if any). */
    922     void *pvData;
    923 } CALLBACKPAYLOAD_FILE_NOTIFY_READ, *PCALLBACKPAYLOAD_FILE_NOTIFY_READ;
    924 
    925 typedef struct CALLBACKPAYLOAD_FILE_NOTIFY_WRITE
    926 {
    927     /** IPRT result of overall operation. */
    928     int32_t rc;
    929     /** How much data (in bytes) have been successfully written. */
    930     uint32_t cbWritten;
    931 } CALLBACKPAYLOAD_FILE_NOTIFY_WRITE, *PCALLBACKPAYLOAD_FILE_NOTIFY_WRITE;
    932 
    933 typedef struct CALLBACKPAYLOAD_FILE_NOTFIY_SEEK
    934 {
    935     /** IPRT result of overall operation. */
    936     int32_t rc;
    937     /** New file offset after successful seek. */
    938     uint64_t uOffActual;
    939 } CALLBACKPAYLOAD_FILE_NOTFIY_SEEK, *PCALLBACKPAYLOAD_FILE_NOTIFY_SEEK;
    940 
    941 typedef struct CALLBACKPAYLOAD_FILE_NOTFIY_TELL
    942 {
    943     /** IPRT result of overall operation. */
    944     int32_t rc;
    945     /** Current file offset after successful tell. */
    946     uint64_t uOffActual;
    947 } CALLBACKPAYLOAD_FILE_NOTFIY_TELL, *PCALLBACKPAYLOAD_FILE_NOTIFY_TELL;
    948 
    949958} /* namespace guestControl */
    950959
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