VirtualBox

Changeset 5982 in vbox for trunk/include


Ignore:
Timestamp:
Dec 6, 2007 11:08:42 AM (17 years ago)
Author:
vboxsync
Message:

Removed obsolete VRDP server interface that used COM.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuest.h

    r5891 r5982  
    737737
    738738#pragma pack(1)
    739 
    740739/** VBVA command header. */
    741740typedef struct _VBVACMDHDR
     
    747746   uint16_t h;
    748747} VBVACMDHDR;
    749 
    750 /* VBVA order codes. Must be >= 0, because the VRDP server internally
    751  * uses negative values to mark some operations.
    752  * Values are important since they are used as an index in the
    753  * "supported orders" bit mask.
    754  */
    755 #define VBVA_VRDP_DIRTY_RECT     (0)
    756 #define VBVA_VRDP_SOLIDRECT      (1)
    757 #define VBVA_VRDP_SOLIDBLT       (2)
    758 #define VBVA_VRDP_DSTBLT         (3)
    759 #define VBVA_VRDP_SCREENBLT      (4)
    760 #define VBVA_VRDP_PATBLTBRUSH    (5)
    761 #define VBVA_VRDP_MEMBLT         (6)
    762 #define VBVA_VRDP_CACHED_BITMAP  (7)
    763 #define VBVA_VRDP_DELETED_BITMAP (8)
    764 #define VBVA_VRDP_LINE           (9)
    765 #define VBVA_VRDP_BOUNDS         (10)
    766 #define VBVA_VRDP_REPEAT         (11)
    767 #define VBVA_VRDP_POLYLINE       (12)
    768 #define VBVA_VRDP_ELLIPSE        (13)
    769 #define VBVA_VRDP_SAVESCREEN     (14)
    770 
    771 #define VBVA_VRDP_INDEX_TO_BIT(__index) (1 << (__index))
    772 
    773 #ifndef VRDP_NO_COM
    774 /* 128 bit bitmap hash. */
    775 typedef uint8_t VRDPBITMAPHASH[16];
    776 
    777 typedef struct _VRDPORDERPOINT
    778 {
    779     int16_t  x;
    780     int16_t  y;
    781 } VRDPORDERPOINT;
    782 
    783 typedef struct _VRDPORDERPOLYPOINTS
    784 {
    785     uint8_t  c;
    786     VRDPORDERPOINT a[16];
    787 } VRDPORDERPOLYPOINTS;
    788 
    789 typedef struct _VRDPORDERAREA
    790 {
    791     int16_t  x;
    792     int16_t  y;
    793     uint16_t w;
    794     uint16_t h;
    795 } VRDPORDERAREA;
    796 
    797 typedef struct _VRDPORDERBOUNDS
    798 {
    799     VRDPORDERPOINT pt1;
    800     VRDPORDERPOINT pt2;
    801 } VRDPORDERBOUNDS;
    802 
    803 typedef struct _VRDPORDERREPEAT
    804 {
    805     VRDPORDERBOUNDS bounds;
    806 } VRDPORDERREPEAT;
    807 
    808 
    809 /* Header for bitmap bits in VBVA VRDP operations. */
    810 typedef struct _VRDPDATABITS
    811 {
    812     /* Size of bitmap data without the header. */
    813     uint32_t cb;
    814     int16_t  x;
    815     int16_t  y;
    816     uint16_t cWidth;
    817     uint16_t cHeight;
    818     uint8_t cbPixel;
    819 } VRDPDATABITS;
    820 
    821 typedef struct _VRDPORDERSOLIDRECT
    822 {
    823     int16_t  x;
    824     int16_t  y;
    825     uint16_t w;
    826     uint16_t h;
    827     uint32_t rgb;
    828 } VRDPORDERSOLIDRECT;
    829 
    830 typedef struct _VRDPORDERSOLIDBLT
    831 {
    832     int16_t  x;
    833     int16_t  y;
    834     uint16_t w;
    835     uint16_t h;
    836     uint32_t rgb;
    837     uint8_t  rop;
    838 } VRDPORDERSOLIDBLT;
    839 
    840 typedef struct _VRDPORDERDSTBLT
    841 {
    842     int16_t  x;
    843     int16_t  y;
    844     uint16_t w;
    845     uint16_t h;
    846     uint8_t  rop;
    847 } VRDPORDERDSTBLT;
    848 
    849 typedef struct _VRDPORDERSCREENBLT
    850 {
    851     int16_t  x;
    852     int16_t  y;
    853     uint16_t w;
    854     uint16_t h;
    855     int16_t  xSrc;
    856     int16_t  ySrc;
    857     uint8_t  rop;
    858 } VRDPORDERSCREENBLT;
    859 
    860 typedef struct _VRDPORDERPATBLTBRUSH
    861 {
    862     int16_t  x;
    863     int16_t  y;
    864     uint16_t w;
    865     uint16_t h;
    866     int8_t   xSrc;
    867     int8_t   ySrc;
    868     uint32_t rgbFG;
    869     uint32_t rgbBG;
    870     uint8_t  rop;
    871     uint8_t  pattern[8];
    872 } VRDPORDERPATBLTBRUSH;
    873 
    874 typedef struct _VRDPORDERMEMBLT
    875 {
    876     int16_t  x;
    877     int16_t  y;
    878     uint16_t w;
    879     uint16_t h;
    880     int16_t  xSrc;
    881     int16_t  ySrc;
    882     uint8_t  rop;
    883     VRDPBITMAPHASH hash;
    884 } VRDPORDERMEMBLT;
    885 
    886 typedef struct _VRDPORDERCACHEDBITMAP
    887 {
    888     VRDPBITMAPHASH hash;
    889     /* VRDPDATABITS and the bitmap data follows. */
    890 } VRDPORDERCACHEDBITMAP;
    891 
    892 typedef struct _VRDPORDERDELETEDBITMAP
    893 {
    894     VRDPBITMAPHASH hash;
    895 } VRDPORDERDELETEDBITMAP;
    896 
    897 typedef struct _VRDPORDERLINE
    898 {
    899     int16_t  x1;
    900     int16_t  y1;
    901     int16_t  x2;
    902     int16_t  y2;
    903     int16_t  xBounds1;
    904     int16_t  yBounds1;
    905     int16_t  xBounds2;
    906     int16_t  yBounds2;
    907     uint8_t  mix;
    908     uint32_t rgb;
    909 } VRDPORDERLINE;
    910 
    911 typedef struct _VRDPORDERPOLYLINE
    912 {
    913     VRDPORDERPOINT ptStart;
    914     uint8_t  mix;
    915     uint32_t rgb;
    916     VRDPORDERPOLYPOINTS points;
    917 } VRDPORDERPOLYLINE;
    918 
    919 typedef struct _VRDPORDERELLIPSE
    920 {
    921     VRDPORDERPOINT pt1;
    922     VRDPORDERPOINT pt2;
    923     uint8_t  mix;
    924     uint8_t  fillMode;
    925     uint32_t rgb;
    926 } VRDPORDERELLIPSE;
    927 
    928 typedef struct _VRDPORDERSAVESCREEN
    929 {
    930     VRDPORDERPOINT pt1;
    931     VRDPORDERPOINT pt2;
    932     uint8_t ident;
    933     uint8_t restore;
    934 } VRDPORDERSAVESCREEN;
    935 #endif /* VRDP_NO_COM */
    936748#pragma pack()
    937749
  • trunk/include/VBox/vrdpapi.h

    r5782 r5982  
    1919#define ___VBox_vrdpapi_h
    2020
    21 #ifdef VRDP_NO_COM
    2221#include <iprt/cdefs.h>
    2322#include <iprt/types.h>
    24 #else
    25 #include <VBox/cdefs.h>
    26 #include <VBox/types.h>
    27 #endif /* VRDP_NO_COM */
    2823
    2924#ifdef IN_RING0
     
    5550#endif /* __cplusplus */
    5651
    57 #ifdef VRDP_NO_COM
    58 /* New, callback based VRDP server interface declarations. */
     52/* Callback based VRDP server interface declarations. */
    5953
    6054#if defined(IN_VRDP)
     
    953947                                HVRDPSERVER *phServer);
    954948
    955 typedef VRDPDECL(int) FNVRDPCREATESERVER (const VRDPINTERFACEHDR *pCallbacks,
    956                                           void *pvCallback,
    957                                           VRDPINTERFACEHDR **ppEntryPoints,
    958                                           HVRDPSERVER *phServer);
     949typedef DECLCALLBACK(int) FNVRDPCREATESERVER (const VRDPINTERFACEHDR *pCallbacks,
     950                                              void *pvCallback,
     951                                              VRDPINTERFACEHDR **ppEntryPoints,
     952                                              HVRDPSERVER *phServer);
    959953typedef FNVRDPCREATESERVER *PFNVRDPCREATESERVER;
    960 #else
    961 /**
    962  * Start server for the specified IConsole.
    963  *
    964  * @return VBox status code
    965  * @param pconsole     Pointer to IConsole instance to fetch display, mouse and keyboard interfaces.
    966  * @param pvrdpserver  Pointer to IVRDPServer instance to fetch configuration.
    967  * @param phserver     Pointer to server instance handle,
    968  *                     created by the function.
    969  */
    970 VRDPR3DECL(int) VRDPStartServer (IConsole *pconsole, IVRDPServer *pvrdpserver, HVRDPSERVER *phserver);
    971 
    972 
    973 /**
    974  * Shutdown server.
    975  *
    976  * @param hserver Handle of VRDP server instance to be stopped.
    977  */
    978 VRDPR3DECL(void) VRDPShutdownServer (HVRDPSERVER hserver);
    979 
    980 
    981 /**
    982  * Send framebuffer bitmap to client.
    983  *
    984  * @param hserver Handle of VRDP server instance.
    985  * @param x       top left horizontal coordinate in framebuffer.
    986  * @param y       top left vertical coordinate in framebuffer.
    987  * @param w       width of rectangle.
    988  * @param h       height of rectangle.
    989  */
    990 VRDPR3DECL(void) VRDPSendUpdateBitmap (HVRDPSERVER hserver, unsigned uScreenId, unsigned x, unsigned y, unsigned w, unsigned h);
    991 
    992 /**
    993  * Inform client that display was resized.
    994  * New width and height are taken from the current framebuffer.
    995  *
    996  * @param hserver Handle of VRDP server instance.
    997  */
    998 VRDPR3DECL(void) VRDPSendResize (HVRDPSERVER hserver);
    999 
    1000 /**
    1001  * Send an update in accelerated mode.
    1002  *
    1003  * @param hserver   Handle of VRDP server instance.
    1004  * @param pvUpdate  The update information. Actually pointer to VBoxGuest.h::VBVACMDHDR structure with extra data.
    1005  * @param cbUpdate  Size of the update data.
    1006  */
    1007 VRDPR3DECL(void) VRDPSendUpdate (HVRDPSERVER hserver, unsigned uScreenId, void *pvUpdate, uint32_t cbUpdate);
    1008 
    1009 /** @todo comment the structure. */
    1010 typedef struct _VRDPCOLORPOINTER
    1011 {
    1012     uint16_t u16HotX;
    1013     uint16_t u16HotY;
    1014     uint16_t u16Width;
    1015     uint16_t u16Height;
    1016     uint16_t u16MaskLen;
    1017     uint16_t u16DataLen;
    1018     uint32_t vrdpInternal;
    1019 } VRDPCOLORPOINTER;
    1020 
    1021 typedef VRDPCOLORPOINTER *PVRDPCOLORPOINTER;
    1022 
    1023 /**
    1024  * Set mouse pointer shape.
    1025  *
    1026  * @param hserver Handle of VRDP server instance.
    1027  * @param porder  The pointer shape information.
    1028  */
    1029 VRDPR3DECL(void) VRDPSendColorPointer (HVRDPSERVER hserver, PVRDPCOLORPOINTER pdata);
    1030 
    1031 /**
    1032  * Hide mouse pointer.
    1033  *
    1034  * @param hserver Handle of VRDP server instance.
    1035  */
    1036 VRDPR3DECL(void) VRDPSendHidePointer (HVRDPSERVER hserver);
    1037 
    1038 /** Audio format information packed in a 32 bit value. */
    1039 typedef uint32_t VRDPAUDIOFORMAT;
    1040 
    1041 /** Constructs 32 bit value for given frequency, number of channel and bits per sample. */
    1042 #define VRDP_AUDIO_FMT_MAKE(freq, c, bps, s) ((((s) & 0x1) << 28) + (((bps) & 0xFF) << 20) + (((c) & 0xF) << 16) + ((freq) & 0xFFFF))
    1043 
    1044 /** Decode frequency. */
    1045 #define VRDP_AUDIO_FMT_SAMPLE_FREQ(a) ((a) & 0xFFFF)
    1046 /** Decode number of channels. */
    1047 #define VRDP_AUDIO_FMT_CHANNELS(a) (((a) >> 16) & 0xF)
    1048 /** Decode number signess. */
    1049 #define VRDP_AUDIO_FMT_SIGNED(a) (((a) >> 28) & 0x1)
    1050 /** Decode number of bits per sample. */
    1051 #define VRDP_AUDIO_FMT_BITS_PER_SAMPLE(a) (((a) >> 20) & 0xFF)
    1052 /** Decode number of bytes per sample. */
    1053 #define VRDP_AUDIO_FMT_BYTES_PER_SAMPLE(a) ((VRDP_AUDIO_FMT_BITS_PER_SAMPLE(a) + 7) / 8)
    1054 
    1055 /**
    1056  * Queues the samples to be sent to client.
    1057  *
    1058  * @param hserver    Handle of VRDP server instance.
    1059  * @param pvSamples  Address of samples to be sent.
    1060  * @param cSamples   Number of samples.
    1061  * @param format     Encoded audio format for these samples.
    1062  */
    1063 VRDPR3DECL(void) VRDPSendAudioSamples (HVRDPSERVER hserver, void *pvSamples, uint32_t cSamples, VRDPAUDIOFORMAT format);
    1064 
    1065 /**
    1066  * Sets sound volume on client.
    1067  *
    1068  * @param hserver    Handle of VRDP server instance.
    1069  * @param left       0..0xFFFF volume level for left channel.
    1070  * @param right      0..0xFFFF volume level for right channel.
    1071  */
    1072 VRDPR3DECL(void) VRDPSendAudioVolume (HVRDPSERVER hserver, uint16_t left, uint16_t right);
    1073 
    1074 
    1075 /*
    1076  * Remote USB backend protocol.
    1077  */
    1078 
    1079 /* The version of Remote USB Protocol. */
    1080 #define VRDP_USB_VERSION (1)
    1081 
    1082 /** USB backend operations. */
    1083 #define VRDP_USB_REQ_OPEN              (0)
    1084 #define VRDP_USB_REQ_CLOSE             (1)
    1085 #define VRDP_USB_REQ_RESET             (2)
    1086 #define VRDP_USB_REQ_SET_CONFIG        (3)
    1087 #define VRDP_USB_REQ_CLAIM_INTERFACE   (4)
    1088 #define VRDP_USB_REQ_RELEASE_INTERFACE (5)
    1089 #define VRDP_USB_REQ_INTERFACE_SETTING (6)
    1090 #define VRDP_USB_REQ_QUEUE_URB         (7)
    1091 #define VRDP_USB_REQ_REAP_URB          (8)
    1092 #define VRDP_USB_REQ_CLEAR_HALTED_EP   (9)
    1093 #define VRDP_USB_REQ_CANCEL_URB        (10)
    1094 
    1095 /** USB service operations. */
    1096 #define VRDP_USB_REQ_DEVICE_LIST       (11)
    1097 #define VRDP_USB_REQ_NEGOTIATE         (12)
    1098 
    1099 /** An operation completion status is a byte. */
    1100 typedef uint8_t VRDPUSBSTATUS;
    1101 
    1102 /** USB device identifier is an 32 bit value. */
    1103 typedef uint32_t VRDPUSBDEVID;
    1104 
    1105 /** Status codes. */
    1106 #define VRDP_USB_STATUS_SUCCESS        ((VRDPUSBSTATUS)0)
    1107 #define VRDP_USB_STATUS_ACCESS_DENIED  ((VRDPUSBSTATUS)1)
    1108 #define VRDP_USB_STATUS_DEVICE_REMOVED ((VRDPUSBSTATUS)2)
    1109 
    1110 /*
    1111  * Data structures to use with VRDPSendUSBRequest.
    1112  * The *RET* structures always represent the layout of VRDP data.
    1113  * The *PARM* structures normally the same as VRDP layout.
    1114  * However the VRDP_USB_REQ_QUEUE_URB_PARM has a pointer to
    1115  * URB data in place where actual data will be in VRDP layout.
    1116  *
    1117  * Since replies (*RET*) are asynchronous, the 'success'
    1118  * replies are not required for operations which return
    1119  * only the status code (VRDPUSBREQRETHDR only):
    1120  *  VRDP_USB_REQ_OPEN
    1121  *  VRDP_USB_REQ_RESET
    1122  *  VRDP_USB_REQ_SET_CONFIG
    1123  *  VRDP_USB_REQ_CLAIM_INTERFACE
    1124  *  VRDP_USB_REQ_RELEASE_INTERFACE
    1125  *  VRDP_USB_REQ_INTERFACE_SETTING
    1126  *  VRDP_USB_REQ_CLEAR_HALTED_EP
    1127  *
    1128  */
    1129 
    1130 /* VRDP layout has no aligments. */
    1131 #pragma pack(1)
    1132 
    1133 /* Common header for all VRDP USB packets. After the reply hdr follows *PARM* or *RET* data. */
    1134 typedef struct _VRDPUSBPKTHDR
    1135 {
    1136     /* Total length of the reply NOT including the 'length' field. */
    1137     uint32_t length;
    1138     /* The operation code for which the reply was sent by the client. */
    1139     uint8_t code;
    1140 } VRDPUSBPKTHDR;
    1141 
    1142 /* Common header for all return structures. */
    1143 typedef struct _VRDPUSBREQRETHDR
    1144 {
    1145     /* Device status. */
    1146     VRDPUSBSTATUS status;
    1147     /* Device id. */
    1148     VRDPUSBDEVID id;
    1149 } VRDPUSBREQRETHDR;
    1150 
    1151 
    1152 /* VRDP_USB_REQ_OPEN
    1153  */
    1154 typedef struct _VRDP_USB_REQ_OPEN_PARM
    1155 {
    1156     uint8_t code;
    1157     VRDPUSBDEVID id;
    1158 } VRDP_USB_REQ_OPEN_PARM;
    1159 
    1160 typedef struct _VRDP_USB_REQ_OPEN_RET
    1161 {
    1162     VRDPUSBREQRETHDR hdr;
    1163 } VRDP_USB_REQ_OPEN_RET;
    1164 
    1165 
    1166 /* VRDP_USB_REQ_CLOSE
    1167  */
    1168 typedef struct _VRDP_USB_REQ_CLOSE_PARM
    1169 {
    1170     uint8_t code;
    1171     VRDPUSBDEVID id;
    1172 } VRDP_USB_REQ_CLOSE_PARM;
    1173 
    1174 /* The close request has no returned data. */
    1175 
    1176 
    1177 /* VRDP_USB_REQ_RESET
    1178  */
    1179 typedef struct _VRDP_USB_REQ_RESET_PARM
    1180 {
    1181     uint8_t code;
    1182     VRDPUSBDEVID id;
    1183 } VRDP_USB_REQ_RESET_PARM;
    1184 
    1185 typedef struct _VRDP_USB_REQ_RESET_RET
    1186 {
    1187     VRDPUSBREQRETHDR hdr;
    1188 } VRDP_USB_REQ_RESET_RET;
    1189 
    1190 
    1191 /* VRDP_USB_REQ_SET_CONFIG
    1192  */
    1193 typedef struct _VRDP_USB_REQ_SET_CONFIG_PARM
    1194 {
    1195     uint8_t code;
    1196     VRDPUSBDEVID id;
    1197     uint8_t configuration;
    1198 } VRDP_USB_REQ_SET_CONFIG_PARM;
    1199 
    1200 typedef struct _VRDP_USB_REQ_SET_CONFIG_RET
    1201 {
    1202     VRDPUSBREQRETHDR hdr;
    1203 } VRDP_USB_REQ_SET_CONFIG_RET;
    1204 
    1205 
    1206 /* VRDP_USB_REQ_CLAIM_INTERFACE
    1207  */
    1208 typedef struct _VRDP_USB_REQ_CLAIM_INTERFACE_PARM
    1209 {
    1210     uint8_t code;
    1211     VRDPUSBDEVID id;
    1212     uint8_t iface;
    1213 } VRDP_USB_REQ_CLAIM_INTERFACE_PARM;
    1214 
    1215 typedef struct _VRDP_USB_REQ_CLAIM_INTERFACE_RET
    1216 {
    1217     VRDPUSBREQRETHDR hdr;
    1218 } VRDP_USB_REQ_CLAIM_INTERFACE_RET;
    1219 
    1220 
    1221 /* VRDP_USB_REQ_RELEASE_INTERFACE
    1222  */
    1223 typedef struct _VRDP_USB_REQ_RELEASE_INTERFACE_PARM
    1224 {
    1225     uint8_t code;
    1226     VRDPUSBDEVID id;
    1227     uint8_t iface;
    1228 } VRDP_USB_REQ_RELEASE_INTERFACE_PARM;
    1229 
    1230 typedef struct _VRDP_USB_REQ_RELEASE_INTERFACE_RET
    1231 {
    1232     VRDPUSBREQRETHDR hdr;
    1233 } VRDP_USB_REQ_RELEASE_INTERFACE_RET;
    1234 
    1235 
    1236 /* VRDP_USB_REQ_INTERFACE_SETTING
    1237  */
    1238 typedef struct _VRDP_USB_REQ_INTERFACE_SETTING_PARM
    1239 {
    1240     uint8_t code;
    1241     VRDPUSBDEVID id;
    1242     uint8_t iface;
    1243     uint8_t setting;
    1244 } VRDP_USB_REQ_INTERFACE_SETTING_PARM;
    1245 
    1246 typedef struct _VRDP_USB_REQ_INTERFACE_SETTING_RET
    1247 {
    1248     VRDPUSBREQRETHDR hdr;
    1249 } VRDP_USB_REQ_INTERFACE_SETTING_RET;
    1250 
    1251 
    1252 /* VRDP_USB_REQ_QUEUE_URB
    1253  */
    1254 
    1255 #define VRDP_USB_TRANSFER_TYPE_CTRL (0)
    1256 #define VRDP_USB_TRANSFER_TYPE_ISOC (1)
    1257 #define VRDP_USB_TRANSFER_TYPE_BULK (2)
    1258 #define VRDP_USB_TRANSFER_TYPE_INTR (3)
    1259 #define VRDP_USB_TRANSFER_TYPE_MSG  (4)
    1260 
    1261 #define VRDP_USB_DIRECTION_SETUP (0)
    1262 #define VRDP_USB_DIRECTION_IN    (1)
    1263 #define VRDP_USB_DIRECTION_OUT   (2)
    1264 
    1265 typedef struct _VRDP_USB_REQ_QUEUE_URB_PARM
    1266 {
    1267     uint8_t code;
    1268     VRDPUSBDEVID id;
    1269     uint32_t handle;    /* Distinguishes that particular URB. Later used in CancelURB and returned by ReapURB */
    1270     uint8_t type;
    1271     uint8_t ep;
    1272     uint8_t direction;
    1273     uint32_t urblen;    /* Length of the URB. */
    1274     uint32_t datalen;   /* Length of the data. */
    1275     void *data;         /* In RDP layout the data follow. */
    1276 } VRDP_USB_REQ_QUEUE_URB_PARM;
    1277 
    1278 /* The queue URB has no explicit return. The reap URB reply will be
    1279  * eventually the indirect result.
    1280  */
    1281 
    1282 
    1283 /* VRDP_USB_REQ_REAP_URB
    1284  * Notificationg from server to client that server expects an URB
    1285  * from any device.
    1286  * Only sent if negotiated URB return method is polling.
    1287  * Normally, the client will send URBs back as soon as they are ready.
    1288  */
    1289 typedef struct _VRDP_USB_REQ_REAP_URB_PARM
    1290 {
    1291     uint8_t code;
    1292 } VRDP_USB_REQ_REAP_URB_PARM;
    1293 
    1294 
    1295 #define VRDP_USB_XFER_OK    (0)
    1296 #define VRDP_USB_XFER_STALL (1)
    1297 #define VRDP_USB_XFER_DNR   (2)
    1298 #define VRDP_USB_XFER_CRC   (3)
    1299 
    1300 #define VRDP_USB_REAP_FLAG_CONTINUED (0x0)
    1301 #define VRDP_USB_REAP_FLAG_LAST      (0x1)
    1302 
    1303 #define VRDP_USB_REAP_VALID_FLAGS    (VRDP_USB_REAP_FLAG_LAST)
    1304 
    1305 typedef struct _VRDPUSBREQREAPURBBODY
    1306 {
    1307     VRDPUSBDEVID     id;        /* From which device the URB arrives. */
    1308     uint8_t          flags;     /* VRDP_USB_REAP_FLAG_* */
    1309     uint8_t          error;     /* VRDP_USB_XFER_* */
    1310     uint32_t         handle;    /* Handle of returned URB. Not 0. */
    1311     uint32_t         len;       /* Length of data actually transferred. */
    1312     /* Data follow. */
    1313 } VRDPUSBREQREAPURBBODY;
    1314 
    1315 typedef struct _VRDP_USB_REQ_REAP_URB_RET
    1316 {
    1317     /* The REAP URB has no header, only completed URBs are returned. */
    1318     VRDPUSBREQREAPURBBODY body;
    1319     /* Another body may follow, depending on flags. */
    1320 } VRDP_USB_REQ_REAP_URB_RET;
    1321 
    1322 
    1323 /* VRDP_USB_REQ_CLEAR_HALTED_EP
    1324  */
    1325 typedef struct _VRDP_USB_REQ_CLEAR_HALTED_EP_PARM
    1326 {
    1327     uint8_t code;
    1328     VRDPUSBDEVID id;
    1329     uint8_t ep;
    1330 } VRDP_USB_REQ_CLEAR_HALTED_EP_PARM;
    1331 
    1332 typedef struct _VRDP_USB_REQ_CLEAR_HALTED_EP_RET
    1333 {
    1334     VRDPUSBREQRETHDR hdr;
    1335 } VRDP_USB_REQ_CLEAR_HALTED_EP_RET;
    1336 
    1337 
    1338 /* VRDP_USB_REQ_CANCEL_URB
    1339  */
    1340 typedef struct _VRDP_USB_REQ_CANCEL_URB_PARM
    1341 {
    1342     uint8_t code;
    1343     VRDPUSBDEVID id;
    1344     uint32_t handle;
    1345 } VRDP_USB_REQ_CANCEL_URB_PARM;
    1346 
    1347 /* The cancel URB request has no return. */
    1348 
    1349 
    1350 /* VRDP_USB_REQ_DEVICE_LIST
    1351  *
    1352  * Server polls USB devices on client by sending this request
    1353  * periodically. Client sends back a list of all devices
    1354  * connected to it. Each device is assigned with an identifier,
    1355  * that is used to distinguish the particular device.
    1356  */
    1357 typedef struct _VRDP_USB_REQ_DEVICE_LIST_PARM
    1358 {
    1359     uint8_t code;
    1360 } VRDP_USB_REQ_DEVICE_LIST_PARM;
    1361 
    1362 /* Data is a list of the following variable length structures. */
    1363 typedef struct _VRDPUSBDEVICEDESC
    1364 {
    1365     /* Offset of the next structure. 0 if last. */
    1366     uint16_t oNext;
    1367 
    1368     /* Identifier of the device assigned by client. */
    1369     VRDPUSBDEVID id;
    1370 
    1371     /** USB version number. */
    1372     uint16_t        bcdUSB;
    1373     /** Device class. */
    1374     uint8_t         bDeviceClass;
    1375     /** Device subclass. */
    1376     uint8_t         bDeviceSubClass;
    1377     /** Device protocol */
    1378     uint8_t         bDeviceProtocol;
    1379     /** Vendor ID. */
    1380     uint16_t        idVendor;
    1381     /** Product ID. */
    1382     uint16_t        idProduct;
    1383     /** Revision, integer part. */
    1384     uint16_t        bcdRev;
    1385     /** Manufacturer string. */
    1386     uint16_t        oManufacturer;
    1387     /** Product string. */
    1388     uint16_t        oProduct;
    1389     /** Serial number string. */
    1390     uint16_t        oSerialNumber;
    1391     /** Physical USB port the device is connected to. */
    1392     uint16_t        idPort;
    1393 
    1394 } VRDPUSBDEVICEDESC;
    1395 
    1396 typedef struct _VRDP_USB_REQ_DEVICE_LIST_RET
    1397 {
    1398     VRDPUSBDEVICEDESC body;
    1399     /* Other devices may follow.
    1400      * The list ends with (uint16_t)0,
    1401      * which means that an empty list consists of 2 zero bytes.
    1402      */
    1403 } VRDP_USB_REQ_DEVICE_LIST_RET;
    1404 
    1405 typedef struct _VRDPUSBREQNEGOTIATEPARM
    1406 {
    1407     uint8_t code;
    1408 
    1409     /* Remote USB Protocol version. */
    1410     uint32_t version;
    1411 
    1412 } VRDPUSBREQNEGOTIATEPARM;
    1413 
    1414 #define VRDP_USB_CAPS_FLAG_ASYNC    (0x0)
    1415 #define VRDP_USB_CAPS_FLAG_POLL     (0x1)
    1416 
    1417 #define VRDP_USB_CAPS_VALID_FLAGS   (VRDP_USB_CAPS_FLAG_POLL)
    1418 
    1419 typedef struct _VRDPUSBREQNEGOTIATERET
    1420 {
    1421     uint8_t flags;
    1422 } VRDPUSBREQNEGOTIATERET;
    1423 
    1424 #pragma pack()
    1425 
    1426 
    1427 #define VRDP_CLIPBOARD_FORMAT_NULL         (0x0)
    1428 #define VRDP_CLIPBOARD_FORMAT_UNICODE_TEXT (0x1)
    1429 #define VRDP_CLIPBOARD_FORMAT_BITMAP       (0x2)
    1430 #define VRDP_CLIPBOARD_FORMAT_HTML         (0x4)
    1431 
    1432 #define VRDP_CLIPBOARD_FUNCTION_FORMAT_ANNOUNCE (0)
    1433 #define VRDP_CLIPBOARD_FUNCTION_DATA_READ       (1)
    1434 #define VRDP_CLIPBOARD_FUNCTION_DATA_WRITE      (2)
    1435 
    1436 /**
    1437  * Called by the host when (VRDP_CLIPBOARD_FUNCTION_*):
    1438  *   - (0) guest announces available clipboard formats;
    1439  *   - (1) guest requests clipboard data;
    1440  *   - (2) guest responds to the client's request for clipboard data.
    1441  *
    1442  * @param hserver     The VRDP server handle.
    1443  * @param u32Function The cause of the call.
    1444  * @param u32Format   Bitmask of announced formats or the format of data.
    1445  * @param pvData      Points to: (1) buffer to be filled with clients data;
    1446  *                               (2) data from the host.
    1447  * @param cbData      Size of 'pvData' buffer in bytes.
    1448  * @param pcbActualRead Size of the copied data in bytes.
    1449  *
    1450  */
    1451 VRDPR3DECL(void) VRDPClipboard (HVRDPSERVER hserver,
    1452                                 uint32_t u32Function,
    1453                                 uint32_t u32Format,
    1454                                 void *pvData,
    1455                                 uint32_t cbData,
    1456                                 uint32_t *pcbActualRead);
    1457 
    1458 /**
    1459  * Sends a USB request.
    1460  *
    1461  * @param hserver      Handle of VRDP server instance.
    1462  * @param u32ClientId  An identifier that allows the server to find the corresponding client.
    1463  *                     The identifier is always passed by the server as a parameter
    1464  *                     of the FNVRDPUSBCALLBACK. Note that the value is the same as
    1465  *                     in the VRDPSERVERCALLBACK functions.
    1466  * @param pvParm       Function specific parameters buffer.
    1467  * @param cbParm       Size of the buffer.
    1468  */
    1469 VRDPR3DECL(void) VRDPSendUSBRequest (HVRDPSERVER hserver,
    1470                                      uint32_t u32ClientId,
    1471                                      void *pvParm,
    1472                                      uint32_t cbRarm);
    1473 
    1474 
    1475 /**
    1476  * Called by the server when a reply is received from a client.
    1477  *
    1478  * @param pvCallback  Callback specific value returned by VRDPSERVERCALLBACK::pfnInterceptUSB.
    1479  * @param u32ClientId Identifies the client that sent the reply.
    1480  * @param u8Code      The operation code VRDP_USB_REQ_*.
    1481  * @param pvRet       Points to data received from the client.
    1482  * @param cbRet       Size of the data in bytes.
    1483  *
    1484  * @return VBox error code.
    1485  */
    1486 typedef DECLCALLBACK(int) FNVRDPUSBCALLBACK (void *pvCallback,
    1487                                              uint32_t u32ClientId,
    1488                                              uint8_t u8Code,
    1489                                              const void *pvRet,
    1490                                              uint32_t cbRet);
    1491                                              
    1492 typedef FNVRDPUSBCALLBACK *PFNVRDPUSBCALLBACK;
    1493 
    1494 /**
    1495  * Called by the server when (VRDP_CLIPBOARD_FUNCTION_*):
    1496  *   - (0) client announces available clipboard formats;
    1497  *   - (1) client requests clipboard data.
    1498  *
    1499  * @param pvCallback  Callback specific value returned by VRDPSERVERCALLBACK::pfnInterceptClipboard.
    1500  * @param u32ClientId Identifies the RDP client that sent the reply.
    1501  * @param u32Function The cause of the callback.
    1502  * @param u32Format   Bitmask of reported formats or the format of received data.
    1503  * @param pvData      Reserved.
    1504  * @param cbData      Reserved.
    1505  *
    1506  * @return VBox error code.
    1507  */
    1508 typedef DECLCALLBACK(int) FNVRDPCLIPBOARDCALLBACK (void *pvCallback,
    1509                                                    uint32_t u32ClientId,
    1510                                                    uint32_t u32Function,
    1511                                                    uint32_t u32Format,
    1512                                                    const void *pvData,
    1513                                                    uint32_t cbData);
    1514                                              
    1515 typedef FNVRDPCLIPBOARDCALLBACK *PFNVRDPCLIPBOARDCALLBACK;
    1516 
    1517 #define VRDP_CLIENT_INTERCEPT_AUDIO     (0x1)
    1518 #define VRDP_CLIENT_INTERCEPT_USB       (0x2)
    1519 #define VRDP_CLIENT_INTERCEPT_CLIPBOARD (0x4)
    1520 
    1521 typedef struct _VRDPSERVERCALLBACK
    1522 {
    1523     /* A client is logging in.
    1524      *
    1525      * @param pvUser       The callback specific pointer.
    1526      * @param u32ClientId  An unique client identifier generated by the server.
    1527      * @param pszUser      The username.
    1528      * @param pszPassword  The password.
    1529      * @param pszDomain    The domain.
    1530      *
    1531      * @return VBox error code.
    1532      */
    1533     DECLR3CALLBACKMEMBER(int, pfnClientLogon, (void *pvUser,
    1534                                              uint32_t u32ClientId,
    1535                                              const char *pszUser,
    1536                                              const char *pszPassword,
    1537                                              const char *pszDomain));
    1538     /* The client has connected.
    1539      *
    1540      * @param pvUser       The callback specific pointer.
    1541      * @param u32ClientId  An unique client identifier generated by the server.
    1542      */
    1543     DECLR3CALLBACKMEMBER(void, pfnClientConnect, (void *pvUser,
    1544                                                 uint32_t u32ClientId));
    1545     /* The client has been disconnected.
    1546      *
    1547      * @param pvUser          The callback specific pointer.
    1548      * @param u32ClientId     An unique client identifier generated by the server.
    1549      * @param fu32Intercepted What was intercepted by the client (VRDP_CLIENT_INTERCEPT_*).
    1550      */
    1551     DECLR3CALLBACKMEMBER(void, pfnClientDisconnect, (void *pvUser,
    1552                                                    uint32_t u32ClientId,
    1553                                                    uint32_t fu32Intercepted));
    1554     /* The client supports audio channel.
    1555      */
    1556     DECLR3CALLBACKMEMBER(void, pfnInterceptAudio, (void *pvUser,
    1557                                                  uint32_t u32ClientId));
    1558     /* The client supports USB channel.
    1559      */
    1560     DECLR3CALLBACKMEMBER(void, pfnInterceptUSB, (void *pvUser,
    1561                                                uint32_t u32ClientId,
    1562                                                PFNVRDPUSBCALLBACK *ppfn,
    1563                                                void **ppv));
    1564     /* The client supports clipboard channel.
    1565      */
    1566     DECLR3CALLBACKMEMBER(void, pfnInterceptClipboard, (void *pvUser,
    1567                                                      uint32_t u32ClientId,
    1568                                                      PFNVRDPCLIPBOARDCALLBACK *ppfn,
    1569                                                      void **ppv));
    1570 } VRDPSERVERCALLBACK;
    1571 
    1572 /**
    1573  * Set a callback pointers table that will be called by the server in certain situations.
    1574  *
    1575  * @param hserver      Handle of VRDP server instance.
    1576  * @param pCallback    Pointer to VRDPSERVERCALLBACK structure with function pointers.
    1577  * @param pvUser       An pointer to be passed to the callback functions.
    1578  */
    1579 VRDPR3DECL(void) VRDPSetCallback (HVRDPSERVER hserver, VRDPSERVERCALLBACK *pCallback, void *pvUser);
    1580 
    1581 /** Indexes of information values. */
    1582 
    1583 /** Whether a client is connected at the moment.
    1584  * uint32_t
    1585  */
    1586 #define VRDP_QI_ACTIVE                 (0)
    1587 
    1588 /** How many times a client connected up to current moment.
    1589  * uint32_t
    1590  */
    1591 #define VRDP_QI_NUMBER_OF_CLIENTS      (1)
    1592 
    1593 /** When last connection was established.
    1594  * int64_t time in milliseconds since 1970-01-01 00:00:00 UTC
    1595  */
    1596 #define VRDP_QI_BEGIN_TIME             (2)
    1597 
    1598 /** When last connection was terminated or current time if connection still active.
    1599  * int64_t time in milliseconds since 1970-01-01 00:00:00 UTC
    1600  */
    1601 #define VRDP_QI_END_TIME               (3)
    1602 
    1603 /** How many bytes were sent in last (current) connection.
    1604  * uint64_t
    1605  */
    1606 #define VRDP_QI_BYTES_SENT             (4)
    1607 
    1608 /** How many bytes were sent in all connections.
    1609  * uint64_t
    1610  */
    1611 #define VRDP_QI_BYTES_SENT_TOTAL       (5)
    1612 
    1613 /** How many bytes were received in last (current) connection.
    1614  * uint64_t
    1615  */
    1616 #define VRDP_QI_BYTES_RECEIVED         (6)
    1617 
    1618 /** How many bytes were received in all connections.
    1619  * uint64_t
    1620  */
    1621 #define VRDP_QI_BYTES_RECEIVED_TOTAL   (7)
    1622 
    1623 /** Login user name supplied by the client.
    1624  * UTF8 nul terminated string.
    1625  */
    1626 #define VRDP_QI_USER                   (8)
    1627 
    1628 /** Login domain supplied by the client.
    1629  * UTF8 nul terminated string.
    1630  */
    1631 #define VRDP_QI_DOMAIN                 (9)
    1632 
    1633 /** The client name supplied by the client.
    1634  * UTF8 nul terminated string.
    1635  */
    1636 #define VRDP_QI_CLIENT_NAME            (10)
    1637 
    1638 /** IP address of the client.
    1639  * UTF8 nul terminated string.
    1640  */
    1641 #define VRDP_QI_CLIENT_IP              (11)
    1642 
    1643 /** The client software version number.
    1644  * uint32_t.
    1645  */
    1646 #define VRDP_QI_CLIENT_VERSION         (12)
    1647 
    1648 /** Public key exchange method used when connection was established.
    1649  *  Values: 0 - RDP4 public key exchange scheme.
    1650  *          1 - X509 sertificates were sent to client.
    1651  * uint32_t.
    1652  */
    1653 #define VRDP_QI_ENCRYPTION_STYLE       (13)
    1654 
    1655 /**
    1656  * Query various information from the VRDP server.
    1657  *
    1658  * @param index     VRDP_QI_* identifier of information to be returned.
    1659  * @param pvBuffer  Address of memory buffer to which the information must be written.
    1660  * @param cbBuffer  Size of the memory buffer in bytes.
    1661  * @param pcbOut    Size in bytes of returned information value.
    1662  *
    1663  * @remark The caller must check the *pcbOut. 0 there means no information was returned.
    1664  *         A value greater than cbBuffer means that information is too big to fit in the
    1665  *         buffer, in that case no information was placed to the buffer.
    1666  */
    1667 VRDPR3DECL(void) VRDPQueryInfo (HVRDPSERVER hserver, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut);
    1668 #endif /* VRDP_NO_COM */
    1669954
    1670955__END_DECLS
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