Changeset 5982 in vbox
- Timestamp:
- Dec 6, 2007 11:08:42 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r5963 r5982 156 156 # enable VRDP server 157 157 VBOX_WITH_VRDP = 1 158 # enable the new VRDP server interface which does not use COM159 VBOX_WITH_VRDP_NO_COM = 1160 158 # build VRDP authentication modules 161 159 VBOX_WITH_VRDP_AUTHMOD = 1 -
trunk/include/VBox/VBoxGuest.h
r5891 r5982 737 737 738 738 #pragma pack(1) 739 740 739 /** VBVA command header. */ 741 740 typedef struct _VBVACMDHDR … … 747 746 uint16_t h; 748 747 } VBVACMDHDR; 749 750 /* VBVA order codes. Must be >= 0, because the VRDP server internally751 * uses negative values to mark some operations.752 * Values are important since they are used as an index in the753 * "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_COM774 /* 128 bit bitmap hash. */775 typedef uint8_t VRDPBITMAPHASH[16];776 777 typedef struct _VRDPORDERPOINT778 {779 int16_t x;780 int16_t y;781 } VRDPORDERPOINT;782 783 typedef struct _VRDPORDERPOLYPOINTS784 {785 uint8_t c;786 VRDPORDERPOINT a[16];787 } VRDPORDERPOLYPOINTS;788 789 typedef struct _VRDPORDERAREA790 {791 int16_t x;792 int16_t y;793 uint16_t w;794 uint16_t h;795 } VRDPORDERAREA;796 797 typedef struct _VRDPORDERBOUNDS798 {799 VRDPORDERPOINT pt1;800 VRDPORDERPOINT pt2;801 } VRDPORDERBOUNDS;802 803 typedef struct _VRDPORDERREPEAT804 {805 VRDPORDERBOUNDS bounds;806 } VRDPORDERREPEAT;807 808 809 /* Header for bitmap bits in VBVA VRDP operations. */810 typedef struct _VRDPDATABITS811 {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 _VRDPORDERSOLIDRECT822 {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 _VRDPORDERSOLIDBLT831 {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 _VRDPORDERDSTBLT841 {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 _VRDPORDERSCREENBLT850 {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 _VRDPORDERPATBLTBRUSH861 {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 _VRDPORDERMEMBLT875 {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 _VRDPORDERCACHEDBITMAP887 {888 VRDPBITMAPHASH hash;889 /* VRDPDATABITS and the bitmap data follows. */890 } VRDPORDERCACHEDBITMAP;891 892 typedef struct _VRDPORDERDELETEDBITMAP893 {894 VRDPBITMAPHASH hash;895 } VRDPORDERDELETEDBITMAP;896 897 typedef struct _VRDPORDERLINE898 {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 _VRDPORDERPOLYLINE912 {913 VRDPORDERPOINT ptStart;914 uint8_t mix;915 uint32_t rgb;916 VRDPORDERPOLYPOINTS points;917 } VRDPORDERPOLYLINE;918 919 typedef struct _VRDPORDERELLIPSE920 {921 VRDPORDERPOINT pt1;922 VRDPORDERPOINT pt2;923 uint8_t mix;924 uint8_t fillMode;925 uint32_t rgb;926 } VRDPORDERELLIPSE;927 928 typedef struct _VRDPORDERSAVESCREEN929 {930 VRDPORDERPOINT pt1;931 VRDPORDERPOINT pt2;932 uint8_t ident;933 uint8_t restore;934 } VRDPORDERSAVESCREEN;935 #endif /* VRDP_NO_COM */936 748 #pragma pack() 937 749 -
trunk/include/VBox/vrdpapi.h
r5782 r5982 19 19 #define ___VBox_vrdpapi_h 20 20 21 #ifdef VRDP_NO_COM22 21 #include <iprt/cdefs.h> 23 22 #include <iprt/types.h> 24 #else25 #include <VBox/cdefs.h>26 #include <VBox/types.h>27 #endif /* VRDP_NO_COM */28 23 29 24 #ifdef IN_RING0 … … 55 50 #endif /* __cplusplus */ 56 51 57 #ifdef VRDP_NO_COM 58 /* New, callback based VRDP server interface declarations. */ 52 /* Callback based VRDP server interface declarations. */ 59 53 60 54 #if defined(IN_VRDP) … … 953 947 HVRDPSERVER *phServer); 954 948 955 typedef VRDPDECL(int) FNVRDPCREATESERVER (const VRDPINTERFACEHDR *pCallbacks,956 void *pvCallback,957 VRDPINTERFACEHDR **ppEntryPoints,958 HVRDPSERVER *phServer);949 typedef DECLCALLBACK(int) FNVRDPCREATESERVER (const VRDPINTERFACEHDR *pCallbacks, 950 void *pvCallback, 951 VRDPINTERFACEHDR **ppEntryPoints, 952 HVRDPSERVER *phServer); 959 953 typedef FNVRDPCREATESERVER *PFNVRDPCREATESERVER; 960 #else961 /**962 * Start server for the specified IConsole.963 *964 * @return VBox status code965 * @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 _VRDPCOLORPOINTER1011 {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 to1115 * 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 return1119 * only the status code (VRDPUSBREQRETHDR only):1120 * VRDP_USB_REQ_OPEN1121 * VRDP_USB_REQ_RESET1122 * VRDP_USB_REQ_SET_CONFIG1123 * VRDP_USB_REQ_CLAIM_INTERFACE1124 * VRDP_USB_REQ_RELEASE_INTERFACE1125 * VRDP_USB_REQ_INTERFACE_SETTING1126 * VRDP_USB_REQ_CLEAR_HALTED_EP1127 *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 _VRDPUSBPKTHDR1135 {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 _VRDPUSBREQRETHDR1144 {1145 /* Device status. */1146 VRDPUSBSTATUS status;1147 /* Device id. */1148 VRDPUSBDEVID id;1149 } VRDPUSBREQRETHDR;1150 1151 1152 /* VRDP_USB_REQ_OPEN1153 */1154 typedef struct _VRDP_USB_REQ_OPEN_PARM1155 {1156 uint8_t code;1157 VRDPUSBDEVID id;1158 } VRDP_USB_REQ_OPEN_PARM;1159 1160 typedef struct _VRDP_USB_REQ_OPEN_RET1161 {1162 VRDPUSBREQRETHDR hdr;1163 } VRDP_USB_REQ_OPEN_RET;1164 1165 1166 /* VRDP_USB_REQ_CLOSE1167 */1168 typedef struct _VRDP_USB_REQ_CLOSE_PARM1169 {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_RESET1178 */1179 typedef struct _VRDP_USB_REQ_RESET_PARM1180 {1181 uint8_t code;1182 VRDPUSBDEVID id;1183 } VRDP_USB_REQ_RESET_PARM;1184 1185 typedef struct _VRDP_USB_REQ_RESET_RET1186 {1187 VRDPUSBREQRETHDR hdr;1188 } VRDP_USB_REQ_RESET_RET;1189 1190 1191 /* VRDP_USB_REQ_SET_CONFIG1192 */1193 typedef struct _VRDP_USB_REQ_SET_CONFIG_PARM1194 {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_RET1201 {1202 VRDPUSBREQRETHDR hdr;1203 } VRDP_USB_REQ_SET_CONFIG_RET;1204 1205 1206 /* VRDP_USB_REQ_CLAIM_INTERFACE1207 */1208 typedef struct _VRDP_USB_REQ_CLAIM_INTERFACE_PARM1209 {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_RET1216 {1217 VRDPUSBREQRETHDR hdr;1218 } VRDP_USB_REQ_CLAIM_INTERFACE_RET;1219 1220 1221 /* VRDP_USB_REQ_RELEASE_INTERFACE1222 */1223 typedef struct _VRDP_USB_REQ_RELEASE_INTERFACE_PARM1224 {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_RET1231 {1232 VRDPUSBREQRETHDR hdr;1233 } VRDP_USB_REQ_RELEASE_INTERFACE_RET;1234 1235 1236 /* VRDP_USB_REQ_INTERFACE_SETTING1237 */1238 typedef struct _VRDP_USB_REQ_INTERFACE_SETTING_PARM1239 {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_RET1247 {1248 VRDPUSBREQRETHDR hdr;1249 } VRDP_USB_REQ_INTERFACE_SETTING_RET;1250 1251 1252 /* VRDP_USB_REQ_QUEUE_URB1253 */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_PARM1266 {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 be1279 * eventually the indirect result.1280 */1281 1282 1283 /* VRDP_USB_REQ_REAP_URB1284 * Notificationg from server to client that server expects an URB1285 * 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_PARM1290 {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 _VRDPUSBREQREAPURBBODY1306 {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_RET1316 {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_EP1324 */1325 typedef struct _VRDP_USB_REQ_CLEAR_HALTED_EP_PARM1326 {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_RET1333 {1334 VRDPUSBREQRETHDR hdr;1335 } VRDP_USB_REQ_CLEAR_HALTED_EP_RET;1336 1337 1338 /* VRDP_USB_REQ_CANCEL_URB1339 */1340 typedef struct _VRDP_USB_REQ_CANCEL_URB_PARM1341 {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_LIST1351 *1352 * Server polls USB devices on client by sending this request1353 * periodically. Client sends back a list of all devices1354 * 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_PARM1358 {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 _VRDPUSBDEVICEDESC1364 {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_RET1397 {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 _VRDPUSBREQNEGOTIATEPARM1406 {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 _VRDPUSBREQNEGOTIATERET1420 {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 parameter1464 * of the FNVRDPUSBCALLBACK. Note that the value is the same as1465 * 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 _VRDPSERVERCALLBACK1522 {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_t1585 */1586 #define VRDP_QI_ACTIVE (0)1587 1588 /** How many times a client connected up to current moment.1589 * uint32_t1590 */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 UTC1595 */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 UTC1600 */1601 #define VRDP_QI_END_TIME (3)1602 1603 /** How many bytes were sent in last (current) connection.1604 * uint64_t1605 */1606 #define VRDP_QI_BYTES_SENT (4)1607 1608 /** How many bytes were sent in all connections.1609 * uint64_t1610 */1611 #define VRDP_QI_BYTES_SENT_TOTAL (5)1612 1613 /** How many bytes were received in last (current) connection.1614 * uint64_t1615 */1616 #define VRDP_QI_BYTES_RECEIVED (6)1617 1618 /** How many bytes were received in all connections.1619 * uint64_t1620 */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 the1665 * 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 */1669 954 1670 955 __END_DECLS -
trunk/src/VBox/Additions/WINNT/Graphics/Display/vrdp.c
r5952 r5982 20 20 #include "driver.h" 21 21 #include "vrdpbmp.h" 22 #include <VBox/VRDPOrders.h> 22 23 23 24 #define VRDP_MAKE_OP(__c) (__c) … … 440 441 if (bytesPerPixel > 0) 441 442 { 442 bRc = vrdpWriteHdr (ppdev, VRDP_MAKE_OP(V BVA_VRDP_DIRTY_RECT));443 bRc = vrdpWriteHdr (ppdev, VRDP_MAKE_OP(VRDP_ORDER_DIRTY_RECT)); 443 444 444 445 if (bRc) … … 523 524 bounds.pt2.y = (int16_t)(prcl->bottom); 524 525 525 return vrdpReportOrder (ppdev, &bounds, sizeof (bounds), V BVA_VRDP_BOUNDS);526 return vrdpReportOrder (ppdev, &bounds, sizeof (bounds), VRDP_ORDER_BOUNDS); 526 527 } 527 528 … … 546 547 repeat.bounds.pt2.y = (int16_t)(prcl->bottom); 547 548 548 bRc = vrdpReportOrder (ppdev, &repeat, sizeof (repeat), V BVA_VRDP_REPEAT);549 bRc = vrdpReportOrder (ppdev, &repeat, sizeof (repeat), VRDP_ORDER_REPEAT); 549 550 550 551 if (!bRc) … … 693 694 order.rgb = rgb; 694 695 695 vrdpReportOrderGeneric (ppdev, pClipRects, &order, sizeof (order), V BVA_VRDP_SOLIDRECT);696 vrdpReportOrderGeneric (ppdev, pClipRects, &order, sizeof (order), VRDP_ORDER_SOLIDRECT); 696 697 } 697 698 … … 711 712 order.rop = rop3; 712 713 713 vrdpReportOrderGeneric (ppdev, pClipRects, &order, sizeof (order), V BVA_VRDP_SOLIDBLT);714 vrdpReportOrderGeneric (ppdev, pClipRects, &order, sizeof (order), VRDP_ORDER_SOLIDBLT); 714 715 } 715 716 … … 761 762 memcpy (order.pattern, pBrush->u.pat.au8Pattern, sizeof (order.pattern)); 762 763 763 vrdpReportOrderGeneric (ppdev, pClipRects, &order, sizeof (order), V BVA_VRDP_PATBLTBRUSH);764 vrdpReportOrderGeneric (ppdev, pClipRects, &order, sizeof (order), VRDP_ORDER_PATBLTBRUSH); 764 765 } 765 766 … … 777 778 order.rop = rop3; 778 779 779 vrdpReportOrderGeneric (ppdev, pClipRects, &order, sizeof (order), V BVA_VRDP_DSTBLT);780 vrdpReportOrderGeneric (ppdev, pClipRects, &order, sizeof (order), VRDP_ORDER_DSTBLT); 780 781 } 781 782 … … 796 797 order.rop = rop3; 797 798 798 vrdpReportOrderGeneric (ppdev, pClipRects, &order, sizeof (order), V BVA_VRDP_SCREENBLT);799 vrdpReportOrderGeneric (ppdev, pClipRects, &order, sizeof (order), VRDP_ORDER_SCREENBLT); 799 800 } 800 801 … … 819 820 memcpy (order.hash, phash, sizeof (*phash)); 820 821 821 vrdpReportOrder (ppdev, &order, sizeof (order), V BVA_VRDP_MEMBLT);822 vrdpReportOrder (ppdev, &order, sizeof (order), VRDP_ORDER_MEMBLT); 822 823 } 823 824 … … 863 864 memcpy (order.hash, phash, sizeof (*phash)); 864 865 865 bRc = vrdpReportOrder (ppdev, &order, sizeof (order), V BVA_VRDP_CACHED_BITMAP);866 bRc = vrdpReportOrder (ppdev, &order, sizeof (order), VRDP_ORDER_CACHED_BITMAP); 866 867 867 868 if (bRc) … … 888 889 memcpy (order.hash, phash, sizeof (*phash)); 889 890 890 vrdpReportOrder (ppdev, &order, sizeof (order), V BVA_VRDP_DELETED_BITMAP);891 vrdpReportOrder (ppdev, &order, sizeof (order), VRDP_ORDER_DELETED_BITMAP); 891 892 } 892 893 … … 1264 1265 prclBounds->left, prclBounds->right, prclBounds->top, prclBounds->bottom, clipRects.rects.c)); 1265 1266 1266 vrdpReportOrderGeneric (ppdev, &clipRects, &order, sizeof (order), V BVA_VRDP_LINE);1267 vrdpReportOrderGeneric (ppdev, &clipRects, &order, sizeof (order), VRDP_ORDER_LINE); 1267 1268 } 1268 1269 } … … 1427 1428 else if (ppo->fl & PO_ELLIPSE) 1428 1429 { 1429 if (vboxOrderSupported (ppdev, V BVA_VRDP_ELLIPSE))1430 if (vboxOrderSupported (ppdev, VRDP_ORDER_ELLIPSE)) 1430 1431 { 1431 1432 VRDPORDERELLIPSE order; … … 1440 1441 order.rgb = vrdpColor2RGB (pso, pbo->iSolidColor); 1441 1442 1442 vrdpReportOrderGeneric (ppdev, &clipRects, &order, sizeof (order), V BVA_VRDP_ELLIPSE);1443 vrdpReportOrderGeneric (ppdev, &clipRects, &order, sizeof (order), VRDP_ORDER_ELLIPSE); 1443 1444 } 1444 1445 else … … 1513 1514 DISPDBG((1, "vrdpStrokePath: Report order, points overflow.\n")); 1514 1515 1515 vrdpReportOrderGenericBounds (ppdev, &clipRects, &bounds, &order, sizeof (order), V BVA_VRDP_POLYLINE);1516 vrdpReportOrderGenericBounds (ppdev, &clipRects, &bounds, &order, sizeof (order), VRDP_ORDER_POLYLINE); 1516 1517 1517 1518 order.points.c = 0; … … 1543 1544 if (order.points.c > 0) 1544 1545 { 1545 vrdpReportOrderGenericBounds (ppdev, &clipRects, &bounds, &order, sizeof (order), V BVA_VRDP_POLYLINE);1546 vrdpReportOrderGenericBounds (ppdev, &clipRects, &bounds, &order, sizeof (order), VRDP_ORDER_POLYLINE); 1546 1547 } 1547 1548 … … 1710 1711 order.restore = 0; 1711 1712 1712 vrdpReportOrderGeneric (ppdev, NULL, &order, sizeof (order), V BVA_VRDP_SAVESCREEN);1713 vrdpReportOrderGeneric (ppdev, NULL, &order, sizeof (order), VRDP_ORDER_SAVESCREEN); 1713 1714 } break; 1714 1715 … … 1725 1726 order.restore = 1; 1726 1727 1727 if (vrdpReportOrderGeneric (ppdev, NULL, &order, sizeof (order), V BVA_VRDP_SAVESCREEN))1728 if (vrdpReportOrderGeneric (ppdev, NULL, &order, sizeof (order), VRDP_ORDER_SAVESCREEN)) 1728 1729 { 1729 1730 uint8_t *pu8Bits; -
trunk/src/VBox/Additions/WINNT/Graphics/Display/vrdpbmp.c
r4071 r5982 22 22 #include "vrdpbmp.h" 23 23 #include <iprt/crc64.h> 24 #include <VBox/VRDPOrders.h> 24 25 25 26 /* -
trunk/src/VBox/Main/ConsoleImpl.cpp
r5743 r5982 457 457 } 458 458 459 #ifdef VRDP_NO_COM460 459 int Console::VRDPClientLogon (uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain) 461 #else462 DECLCALLBACK(int) Console::vrdp_ClientLogon (void *pvUser,463 uint32_t u32ClientId,464 const char *pszUser,465 const char *pszPassword,466 const char *pszDomain)467 #endif /* VRDP_NO_COM */468 460 { 469 461 LogFlowFuncEnter(); 470 462 LogFlowFunc (("%d, %s, %s, %s\n", u32ClientId, pszUser, pszPassword, pszDomain)); 471 463 472 #ifdef VRDP_NO_COM 473 Console *console = this; 474 #else 475 Console *console = static_cast <Console *> (pvUser); 476 #endif /* VRDP_NO_COM */ 477 AssertReturn (console, VERR_INVALID_POINTER); 478 479 AutoCaller autoCaller (console); 464 AutoCaller autoCaller (this); 480 465 if (!autoCaller.isOk()) 481 466 { … … 487 472 488 473 Guid uuid; 489 HRESULT hrc = console->mMachine->COMGETTER (Id) (uuid.asOutParam());474 HRESULT hrc = mMachine->COMGETTER (Id) (uuid.asOutParam()); 490 475 AssertComRCReturn (hrc, VERR_ACCESS_DENIED); 491 476 492 477 VRDPAuthType_T authType = VRDPAuthType_VRDPAuthNull; 493 hrc = console->mVRDPServer->COMGETTER(AuthType) (&authType);478 hrc = mVRDPServer->COMGETTER(AuthType) (&authType); 494 479 AssertComRCReturn (hrc, VERR_ACCESS_DENIED); 495 480 496 481 ULONG authTimeout = 0; 497 hrc = console->mVRDPServer->COMGETTER(AuthTimeout) (&authTimeout);482 hrc = mVRDPServer->COMGETTER(AuthTimeout) (&authTimeout); 498 483 AssertComRCReturn (hrc, VERR_ACCESS_DENIED); 499 484 … … 518 503 /* Multiconnection check. */ 519 504 BOOL allowMultiConnection = FALSE; 520 hrc = console->mVRDPServer->COMGETTER(AllowMultiConnection) (&allowMultiConnection);505 hrc = mVRDPServer->COMGETTER(AllowMultiConnection) (&allowMultiConnection); 521 506 AssertComRCReturn (hrc, VERR_ACCESS_DENIED); 522 507 523 LogFlowFunc(("allowMultiConnection %d, console->mcVRDPClients = %d\n", allowMultiConnection, console->mcVRDPClients));508 LogFlowFunc(("allowMultiConnection %d, mcVRDPClients = %d\n", allowMultiConnection, mcVRDPClients)); 524 509 525 510 if (allowMultiConnection == FALSE) … … 529 514 * value is 0 for first client. 530 515 */ 531 if ( console->mcVRDPClients > 0)516 if (mcVRDPClients > 0) 532 517 { 533 518 /* Reject. */ … … 548 533 { 549 534 /* Call the external library. */ 550 result = console->mConsoleVRDPServer->Authenticate (uuid, guestJudgement, pszUser, pszPassword, pszDomain, u32ClientId);535 result = mConsoleVRDPServer->Authenticate (uuid, guestJudgement, pszUser, pszPassword, pszDomain, u32ClientId); 551 536 552 537 if (result != VRDPAuthDelegateToGuest) … … 564 549 guestJudgement = VRDPAuthGuestNotReacted; 565 550 566 if ( console->mVMMDev)551 if (mVMMDev) 567 552 { 568 553 /* Issue the request to guest. Assume that the call does not require EMT. It should not. */ … … 571 556 uint32_t u32GuestFlags = VMMDEV_SETCREDENTIALS_JUDGE; 572 557 573 int rc = console->mVMMDev->getVMMDevPort()->pfnSetCredentials (console->mVMMDev->getVMMDevPort(),558 int rc = mVMMDev->getVMMDevPort()->pfnSetCredentials (mVMMDev->getVMMDevPort(), 574 559 pszUser, pszPassword, pszDomain, u32GuestFlags); 575 560 … … 577 562 { 578 563 /* Wait for guest. */ 579 rc = console->mVMMDev->WaitCredentialsJudgement (authTimeout, &u32GuestFlags);564 rc = mVMMDev->WaitCredentialsJudgement (authTimeout, &u32GuestFlags); 580 565 581 566 if (VBOX_SUCCESS (rc)) … … 607 592 LogRel(("VRDPAUTH: Guest judgement %d.\n", guestJudgement)); 608 593 LogFlowFunc (("External auth called again with guest judgement = %d\n", guestJudgement)); 609 result = console->mConsoleVRDPServer->Authenticate (uuid, guestJudgement, pszUser, pszPassword, pszDomain, u32ClientId);594 result = mConsoleVRDPServer->Authenticate (uuid, guestJudgement, pszUser, pszPassword, pszDomain, u32ClientId); 610 595 } 611 596 else … … 641 626 } 642 627 643 #ifdef VRDP_NO_COM644 628 void Console::VRDPClientConnect (uint32_t u32ClientId) 645 #else646 DECLCALLBACK(void) Console::vrdp_ClientConnect (void *pvUser,647 uint32_t u32ClientId)648 #endif /* VRDP_NO_COM */649 629 { 650 630 LogFlowFuncEnter(); 651 631 652 #ifdef VRDP_NO_COM 653 Console *console = this; 654 #else 655 Console *console = static_cast <Console *> (pvUser); 656 #endif /* VRDP_NO_COM */ 657 AssertReturnVoid (console); 658 659 AutoCaller autoCaller (console); 632 AutoCaller autoCaller (this); 660 633 AssertComRCReturnVoid (autoCaller.rc()); 661 634 662 635 #ifdef VBOX_VRDP 663 uint32_t u32Clients = ASMAtomicIncU32(& console->mcVRDPClients);636 uint32_t u32Clients = ASMAtomicIncU32(&mcVRDPClients); 664 637 665 638 if (u32Clients == 1) 666 639 { 667 console->getVMMDev()->getVMMDevPort()->668 pfnVRDPChange ( console->getVMMDev()->getVMMDevPort(),640 getVMMDev()->getVMMDevPort()-> 641 pfnVRDPChange (getVMMDev()->getVMMDevPort(), 669 642 true, VRDP_EXPERIENCE_LEVEL_FULL); // @todo configurable 670 643 } 671 644 672 645 NOREF(u32ClientId); 673 console->mDisplay->VideoAccelVRDP (true);646 mDisplay->VideoAccelVRDP (true); 674 647 #endif /* VBOX_VRDP */ 675 648 … … 678 651 } 679 652 680 #ifdef VRDP_NO_COM681 653 void Console::VRDPClientDisconnect (uint32_t u32ClientId, 682 654 uint32_t fu32Intercepted) 683 #else684 DECLCALLBACK(void) Console::vrdp_ClientDisconnect (void *pvUser,685 uint32_t u32ClientId,686 uint32_t fu32Intercepted)687 #endif /* VRDP_NO_COM */688 655 { 689 656 LogFlowFuncEnter(); 690 657 691 #ifdef VRDP_NO_COM 692 Console *console = this; 693 #else 694 Console *console = static_cast <Console *> (pvUser); 695 #endif /* VRDP_NO_COM */ 696 AssertReturnVoid (console); 697 698 AutoCaller autoCaller (console); 658 AutoCaller autoCaller (this); 699 659 AssertComRCReturnVoid (autoCaller.rc()); 700 660 701 AssertReturnVoid ( console->mConsoleVRDPServer);661 AssertReturnVoid (mConsoleVRDPServer); 702 662 703 663 #ifdef VBOX_VRDP 704 uint32_t u32Clients = ASMAtomicDecU32(& console->mcVRDPClients);664 uint32_t u32Clients = ASMAtomicDecU32(&mcVRDPClients); 705 665 706 666 if (u32Clients == 0) 707 667 { 708 console->getVMMDev()->getVMMDevPort()->709 pfnVRDPChange ( console->getVMMDev()->getVMMDevPort(),668 getVMMDev()->getVMMDevPort()-> 669 pfnVRDPChange (getVMMDev()->getVMMDevPort(), 710 670 false, 0); 711 671 } 712 672 713 console->mDisplay->VideoAccelVRDP (false);673 mDisplay->VideoAccelVRDP (false); 714 674 #endif /* VBOX_VRDP */ 715 675 716 676 if (fu32Intercepted & VRDP_CLIENT_INTERCEPT_USB) 717 677 { 718 console->mConsoleVRDPServer->USBBackendDelete (u32ClientId);678 mConsoleVRDPServer->USBBackendDelete (u32ClientId); 719 679 } 720 680 … … 722 682 if (fu32Intercepted & VRDP_CLIENT_INTERCEPT_CLIPBOARD) 723 683 { 724 console->mConsoleVRDPServer->ClipboardDelete (u32ClientId);684 mConsoleVRDPServer->ClipboardDelete (u32ClientId); 725 685 } 726 686 727 687 if (fu32Intercepted & VRDP_CLIENT_INTERCEPT_AUDIO) 728 688 { 729 console->mcAudioRefs--;730 731 if ( console->mcAudioRefs <= 0)732 { 733 if ( console->mAudioSniffer)689 mcAudioRefs--; 690 691 if (mcAudioRefs <= 0) 692 { 693 if (mAudioSniffer) 734 694 { 735 PPDMIAUDIOSNIFFERPORT port = console->mAudioSniffer->getAudioSnifferPort();695 PPDMIAUDIOSNIFFERPORT port = mAudioSniffer->getAudioSnifferPort(); 736 696 if (port) 737 697 { … … 744 704 745 705 Guid uuid; 746 HRESULT hrc = console->mMachine->COMGETTER (Id) (uuid.asOutParam());706 HRESULT hrc = mMachine->COMGETTER (Id) (uuid.asOutParam()); 747 707 AssertComRC (hrc); 748 708 749 709 VRDPAuthType_T authType = VRDPAuthType_VRDPAuthNull; 750 hrc = console->mVRDPServer->COMGETTER(AuthType) (&authType);710 hrc = mVRDPServer->COMGETTER(AuthType) (&authType); 751 711 AssertComRC (hrc); 752 712 753 713 if (authType == VRDPAuthType_VRDPAuthExternal) 754 console->mConsoleVRDPServer->AuthDisconnect (uuid, u32ClientId);714 mConsoleVRDPServer->AuthDisconnect (uuid, u32ClientId); 755 715 756 716 LogFlowFuncLeave(); … … 758 718 } 759 719 760 #ifdef VRDP_NO_COM761 720 void Console::VRDPInterceptAudio (uint32_t u32ClientId) 762 #else763 DECLCALLBACK(void) Console::vrdp_InterceptAudio (void *pvUser,764 uint32_t u32ClientId)765 #endif /* VRDP_NO_COM */766 721 { 767 722 LogFlowFuncEnter(); 768 723 769 #ifdef VRDP_NO_COM 770 Console *console = this; 771 #else 772 Console *console = static_cast <Console *> (pvUser); 773 #endif /* VRDP_NO_COM */ 774 AssertReturnVoid (console); 775 776 AutoCaller autoCaller (console); 724 AutoCaller autoCaller (this); 777 725 AssertComRCReturnVoid (autoCaller.rc()); 778 726 779 727 LogFlowFunc (("mAudioSniffer %p, u32ClientId %d.\n", 780 console->mAudioSniffer, u32ClientId));728 mAudioSniffer, u32ClientId)); 781 729 NOREF(u32ClientId); 782 730 783 731 #ifdef VBOX_VRDP 784 console->mcAudioRefs++;785 786 if ( console->mcAudioRefs == 1)787 { 788 if ( console->mAudioSniffer)789 { 790 PPDMIAUDIOSNIFFERPORT port = console->mAudioSniffer->getAudioSnifferPort();732 mcAudioRefs++; 733 734 if (mcAudioRefs == 1) 735 { 736 if (mAudioSniffer) 737 { 738 PPDMIAUDIOSNIFFERPORT port = mAudioSniffer->getAudioSnifferPort(); 791 739 if (port) 792 740 { … … 801 749 } 802 750 803 #ifdef VRDP_NO_COM804 751 void Console::VRDPInterceptUSB (uint32_t u32ClientId, void **ppvIntercept) 805 #else806 DECLCALLBACK(void) Console::vrdp_InterceptUSB (void *pvUser,807 uint32_t u32ClientId,808 PFNVRDPUSBCALLBACK *ppfn,809 void **ppv)810 #endif /* VRDP_NO_COM */811 752 { 812 753 LogFlowFuncEnter(); 813 754 814 #ifdef VRDP_NO_COM 815 Console *console = this; 816 #else 817 Console *console = static_cast <Console *> (pvUser); 818 #endif /* VRDP_NO_COM */ 819 AssertReturnVoid (console); 820 821 AutoCaller autoCaller (console); 755 AutoCaller autoCaller (this); 822 756 AssertComRCReturnVoid (autoCaller.rc()); 823 757 824 AssertReturnVoid (console->mConsoleVRDPServer); 825 826 #ifdef VRDP_NO_COM 758 AssertReturnVoid (mConsoleVRDPServer); 759 827 760 mConsoleVRDPServer->USBBackendCreate (u32ClientId, ppvIntercept); 828 #else829 console->mConsoleVRDPServer->USBBackendCreate (u32ClientId, ppfn, ppv);830 #endif /* VRDP_NO_COM */831 761 832 762 LogFlowFuncLeave(); … … 834 764 } 835 765 836 #ifdef VRDP_NO_COM837 766 void Console::VRDPInterceptClipboard (uint32_t u32ClientId) 838 #else839 DECLCALLBACK(void) Console::vrdp_InterceptClipboard (void *pvUser,840 uint32_t u32ClientId,841 PFNVRDPCLIPBOARDCALLBACK *ppfn,842 void **ppv)843 #endif /* VRDP_NO_COM */844 767 { 845 768 LogFlowFuncEnter(); 846 769 847 #ifdef VRDP_NO_COM 848 Console *console = this; 849 #else 850 Console *console = static_cast <Console *> (pvUser); 851 #endif /* VRDP_NO_COM */ 852 AssertReturnVoid (console); 853 854 AutoCaller autoCaller (console); 770 AutoCaller autoCaller (this); 855 771 AssertComRCReturnVoid (autoCaller.rc()); 856 772 857 AssertReturnVoid ( console->mConsoleVRDPServer);773 AssertReturnVoid (mConsoleVRDPServer); 858 774 859 775 #ifdef VBOX_VRDP 860 #ifdef VRDP_NO_COM861 776 mConsoleVRDPServer->ClipboardCreate (u32ClientId); 862 #else863 console->mConsoleVRDPServer->ClipboardCreate (u32ClientId, ppfn, ppv);864 #endif /* VRDP_NO_COM */865 777 #endif /* VBOX_VRDP */ 866 778 … … 869 781 } 870 782 871 872 #ifdef VRDP_NO_COM873 #else874 // static875 VRDPSERVERCALLBACK Console::sVrdpServerCallback =876 {877 vrdp_ClientLogon,878 vrdp_ClientConnect,879 vrdp_ClientDisconnect,880 vrdp_InterceptAudio,881 vrdp_InterceptUSB,882 vrdp_InterceptClipboard883 };884 #endif /* VRDP_NO_COM */885 783 886 784 //static … … 3275 3173 else 3276 3174 { 3277 #ifdef VRDP_NO_COM3278 3175 mConsoleVRDPServer->EnableConnections (); 3279 #else3280 mConsoleVRDPServer->SetCallback ();3281 #endif /* VRDP_NO_COM */3282 3176 } 3283 3177 } … … 5882 5776 5883 5777 #ifdef VBOX_VRDP 5884 { 5885 /* Enable client connections to the server. */ 5886 ConsoleVRDPServer *server = console->consoleVRDPServer(); 5887 #ifdef VRDP_NO_COM 5888 server->EnableConnections (); 5889 #else 5890 server->SetCallback (); 5891 #endif /* VRDP_NO_COM */ 5892 } 5778 /* Enable client connections to the server. */ 5779 console->consoleVRDPServer()->EnableConnections (); 5893 5780 #endif /* VBOX_VRDP */ 5894 5781 -
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r5782 r5982 19 19 #include "ConsoleImpl.h" 20 20 #include "DisplayImpl.h" 21 #ifdef VRDP_NO_COM22 21 #include "KeyboardImpl.h" 23 22 #include "MouseImpl.h" 24 #include <VBox/VRDPOrders.h>25 #endif /* VRDP_NO_COM */26 23 27 24 #include "Logging.h" … … 32 29 33 30 #include <VBox/err.h> 34 35 #ifdef VRDP_NO_COM 31 #include <VBox/VRDPOrders.h> 32 36 33 class VRDPConsoleCallback : public IConsoleCallback 37 34 { … … 569 566 return S_OK; 570 567 } 571 #endif /* VRDP_NO_COM */572 568 573 569 … … 578 574 RTLDRMOD ConsoleVRDPServer::mVRDPLibrary; 579 575 580 #ifdef VRDP_NO_COM581 576 PFNVRDPCREATESERVER ConsoleVRDPServer::mpfnVRDPCreateServer = NULL; 582 577 … … 599 594 ConsoleVRDPServer::VRDPCallbackVideoModeHint 600 595 }; 601 #else602 int (VBOXCALL *ConsoleVRDPServer::mpfnVRDPStartServer) (IConsole *pConsole, IVRDPServer *pVRDPServer, HVRDPSERVER *phServer);603 int (VBOXCALL *ConsoleVRDPServer::mpfnVRDPSetFramebuffer) (HVRDPSERVER hServer, IFramebuffer *pFramebuffer, uint32_t fFlags);604 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPSetCallback) (HVRDPSERVER hServer, VRDPSERVERCALLBACK *pcallback, void *pvUser);605 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPShutdownServer) (HVRDPSERVER hServer);606 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPSendUpdateBitmap)(HVRDPSERVER hServer, unsigned uScreenId, unsigned x, unsigned y, unsigned w, unsigned h);607 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPSendResize) (HVRDPSERVER hServer);608 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPSendAudioSamples)(HVRDPSERVER hserver, void *pvSamples, uint32_t cSamples, VRDPAUDIOFORMAT format);609 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPSendAudioVolume) (HVRDPSERVER hserver, uint16_t left, uint16_t right);610 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPSendUSBRequest) (HVRDPSERVER hserver, uint32_t u32ClientId, void *pvParms, uint32_t cbParms);611 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPSendUpdate) (HVRDPSERVER hServer, unsigned uScreenId, void *pvUpdate, uint32_t cbUpdate);612 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPQueryInfo) (HVRDPSERVER hserver, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut);613 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPClipboard) (HVRDPSERVER hserver, uint32_t u32Function, uint32_t u32Format, const void *pvData, uint32_t cbData, uint32_t *pcbActualRead);614 #endif /* VRDP_NO_COM */615 596 #endif /* VBOX_VRDP */ 616 597 617 #ifdef VRDP_NO_COM618 598 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackQueryProperty (void *pvCallback, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut) 619 599 { … … 1020 1000 server->mConsole->getDisplay ()->SetVideoModeHint(cWidth, cHeight, cBitsPerPixel, uScreenId); 1021 1001 } 1022 #endif /* VRDP_NO_COM */1023 1002 1024 1003 ConsoleVRDPServer::ConsoleVRDPServer (Console *console) … … 1044 1023 mhServer = 0; 1045 1024 1046 #ifdef VRDP_NO_COM1047 1025 m_fGuestWantsAbsolute = false; 1048 1026 m_mousex = 0; … … 1065 1043 mConsoleCallback->AddRef(); 1066 1044 console->RegisterCallback(mConsoleCallback); 1067 #endif /* VRDP_NO_COM */1068 1045 #endif /* VBOX_VRDP */ 1069 1046 … … 1075 1052 Stop (); 1076 1053 1077 #ifdef VRDP_NO_COM1078 1054 if (mConsoleCallback) 1079 1055 { … … 1092 1068 } 1093 1069 } 1094 #endif /* VRDP_NO_COM */ 1070 1095 1071 if (RTCritSectIsInitialized (&mCritSect)) 1096 1072 { … … 1116 1092 && loadVRDPLibrary ()) 1117 1093 { 1118 #ifdef VRDP_NO_COM1119 1094 rc = mpfnVRDPCreateServer (&mCallbacks.header, this, (VRDPINTERFACEHDR **)&mpEntryPoints, &mhServer); 1120 #else1121 rc = mpfnVRDPStartServer(mConsole, vrdpserver, &mhServer);1122 #endif /* VRDP_NO_COM */1123 1095 1124 1096 if (VBOX_SUCCESS(rc)) … … 1138 1110 } 1139 1111 1140 #ifdef VRDP_NO_COM1141 1112 void ConsoleVRDPServer::EnableConnections (void) 1142 1113 { … … 1168 1139 #endif /* VBOX_VRDP */ 1169 1140 } 1170 #else1171 void ConsoleVRDPServer::SetCallback (void)1172 {1173 #ifdef VBOX_VRDP1174 /* This is called after VM is created and allows the server to accept client connection. */1175 if (mhServer && mpfnVRDPSetCallback)1176 {1177 mpfnVRDPSetCallback (mhServer, mConsole->getVrdpServerCallback (), mConsole);1178 }1179 #endif /* VBOX_VRDP */1180 }1181 #endif /* VRDP_NO_COM */1182 1141 1183 1142 void ConsoleVRDPServer::Stop (void) … … 1193 1152 mhServer = 0; 1194 1153 1195 #ifdef VRDP_NO_COM1196 1154 if (mpEntryPoints && hServer) 1197 1155 { 1198 1156 mpEntryPoints->VRDPDestroy (hServer); 1199 1157 } 1200 #else1201 mpfnVRDPShutdownServer (hServer);1202 #endif /* VRDP_NO_COM */1203 1158 } 1204 1159 #endif /* VBOX_VRDP */ … … 1543 1498 { 1544 1499 /* The guest announces clipboard formats. This must be delivered to all clients. */ 1545 #ifdef VRDP_NO_COM1546 1500 if (mpEntryPoints && pServer->mhServer) 1547 1501 { … … 1553 1507 NULL); 1554 1508 } 1555 #else1556 if (mpfnVRDPClipboard)1557 {1558 mpfnVRDPClipboard (pServer->mhServer,1559 VRDP_CLIPBOARD_FUNCTION_FORMAT_ANNOUNCE,1560 pParms->u32Format,1561 NULL,1562 0,1563 NULL);1564 }1565 #endif /* VRDP_NO_COM */1566 1509 } break; 1567 1510 … … 1572 1515 * announced the requested format most recently. 1573 1516 */ 1574 #ifdef VRDP_NO_COM1575 1517 if (mpEntryPoints && pServer->mhServer) 1576 1518 { … … 1582 1524 &pParms->cbData); 1583 1525 } 1584 #else1585 if (mpfnVRDPClipboard)1586 {1587 mpfnVRDPClipboard (pServer->mhServer,1588 VRDP_CLIPBOARD_FUNCTION_DATA_READ,1589 pParms->u32Format,1590 pParms->pvData,1591 pParms->cbData,1592 &pParms->cbData);1593 }1594 #endif /* VRDP_NO_COM */1595 1526 } break; 1596 1527 1597 1528 case VBOX_CLIPBOARD_EXT_FN_DATA_WRITE: 1598 1529 { 1599 #ifdef VRDP_NO_COM1600 1530 if (mpEntryPoints && pServer->mhServer) 1601 1531 { … … 1607 1537 NULL); 1608 1538 } 1609 #else1610 if (mpfnVRDPClipboard)1611 {1612 mpfnVRDPClipboard (pServer->mhServer,1613 VRDP_CLIPBOARD_FUNCTION_DATA_WRITE,1614 pParms->u32Format,1615 pParms->pvData,1616 pParms->cbData,1617 NULL);1618 }1619 #endif /* VRDP_NO_COM */1620 1539 } break; 1621 1540 … … 1628 1547 } 1629 1548 1630 #ifdef VRDP_NO_COM1631 1549 void ConsoleVRDPServer::ClipboardCreate (uint32_t u32ClientId) 1632 #else1633 void ConsoleVRDPServer::ClipboardCreate (uint32_t u32ClientId, PFNVRDPCLIPBOARDCALLBACK *ppfn, void **ppv)1634 #endif /* VRDP_NO_COM */1635 1550 { 1636 1551 int rc = lockConsoleVRDPServer (); … … 1647 1562 } 1648 1563 } 1649 1650 #ifdef VRDP_NO_COM1651 #else1652 if (VBOX_SUCCESS (rc))1653 {1654 *ppfn = ClipboardCallback;1655 *ppv = this;1656 }1657 #endif /* VRDP_NO_COM */1658 1564 1659 1565 unlockConsoleVRDPServer (); … … 1681 1587 * The ConsoleVRDPServer keeps a list of created backend instances. 1682 1588 */ 1683 #ifdef VRDP_NO_COM1684 1589 void ConsoleVRDPServer::USBBackendCreate (uint32_t u32ClientId, void **ppvIntercept) 1685 #else1686 void ConsoleVRDPServer::USBBackendCreate (uint32_t u32ClientId, PFNVRDPUSBCALLBACK *ppfn, void **ppv)1687 #endif /* VRDP_NO_COM */1688 1590 { 1689 1591 #ifdef VBOX_WITH_USB … … 1716 1618 unlockConsoleVRDPServer (); 1717 1619 1718 #ifdef VRDP_NO_COM1719 1620 if (ppvIntercept) 1720 1621 { 1721 1622 *ppvIntercept = pRemoteUSBBackend; 1722 1623 } 1723 #else1724 pRemoteUSBBackend->QueryVRDPCallbackPointer (ppfn, ppv);1725 #endif /* VRDP_NO_COM */1726 1624 } 1727 1625 … … 1945 1843 { 1946 1844 #ifdef VBOX_VRDP 1947 #ifdef VRDP_NO_COM1948 1845 if (mpEntryPoints && mhServer) 1949 1846 { 1950 1847 mpEntryPoints->VRDPUpdate (mhServer, uScreenId, pvUpdate, cbUpdate); 1951 1848 } 1952 #else1953 if (mpfnVRDPSendUpdate)1954 mpfnVRDPSendUpdate (mhServer, uScreenId, pvUpdate, cbUpdate);1955 #endif /* VRDP_NO_COM */1956 1849 #endif 1957 1850 } … … 1960 1853 { 1961 1854 #ifdef VBOX_VRDP 1962 #ifdef VRDP_NO_COM1963 1855 if (mpEntryPoints && mhServer) 1964 1856 { 1965 1857 mpEntryPoints->VRDPResize (mhServer); 1966 1858 } 1967 #else1968 if (mpfnVRDPSendResize)1969 mpfnVRDPSendResize (mhServer);1970 #endif /* VRDP_NO_COM */1971 1859 #endif 1972 1860 } … … 1975 1863 { 1976 1864 #ifdef VBOX_VRDP 1977 #ifdef VRDP_NO_COM1978 1865 VRDPORDERHDR update; 1979 1866 update.x = x; … … 1985 1872 mpEntryPoints->VRDPUpdate (mhServer, uScreenId, &update, sizeof (update)); 1986 1873 } 1987 #else1988 if (mpfnVRDPSendUpdateBitmap)1989 mpfnVRDPSendUpdateBitmap (mhServer, uScreenId, x, y, w, h);1990 #endif /* VRDP_NO_COM */1991 1874 #endif 1992 1875 } 1993 1876 1994 #ifdef VRDP_NO_COM 1995 #else 1996 void ConsoleVRDPServer::SetFramebuffer (IFramebuffer *framebuffer, uint32_t fFlags) const 1877 void ConsoleVRDPServer::SendAudioSamples (void *pvSamples, uint32_t cSamples, VRDPAUDIOFORMAT format) const 1997 1878 { 1998 1879 #ifdef VBOX_VRDP 1999 if (mpfnVRDPSetFramebuffer) 2000 mpfnVRDPSetFramebuffer (mhServer, framebuffer, fFlags); 1880 if (mpEntryPoints && mhServer) 1881 { 1882 mpEntryPoints->VRDPAudioSamples (mhServer, pvSamples, cSamples, format); 1883 } 2001 1884 #endif 2002 1885 } 2003 #endif /* VRDP_NO_COM */ 2004 2005 void ConsoleVRDPServer::SendAudioSamples (void *pvSamples, uint32_t cSamples, VRDPAUDIOFORMAT format) const 1886 1887 void ConsoleVRDPServer::SendAudioVolume (uint16_t left, uint16_t right) const 2006 1888 { 2007 1889 #ifdef VBOX_VRDP 2008 #ifdef VRDP_NO_COM2009 1890 if (mpEntryPoints && mhServer) 2010 1891 { 2011 mpEntryPoints->VRDPAudioSamples (mhServer, pvSamples, cSamples, format); 2012 } 2013 #else 2014 if (mpfnVRDPSendAudioSamples) 2015 mpfnVRDPSendAudioSamples (mhServer, pvSamples, cSamples, format); 2016 #endif /* VRDP_NO_COM */ 1892 mpEntryPoints->VRDPAudioVolume (mhServer, left, right); 1893 } 2017 1894 #endif 2018 1895 } 2019 1896 2020 void ConsoleVRDPServer::Send AudioVolume (uint16_t left, uint16_t right) const1897 void ConsoleVRDPServer::SendUSBRequest (uint32_t u32ClientId, void *pvParms, uint32_t cbParms) const 2021 1898 { 2022 1899 #ifdef VBOX_VRDP 2023 #ifdef VRDP_NO_COM2024 1900 if (mpEntryPoints && mhServer) 2025 1901 { 2026 mpEntryPoints->VRDPAudioVolume (mhServer, left, right); 2027 } 2028 #else 2029 if (mpfnVRDPSendAudioVolume) 2030 mpfnVRDPSendAudioVolume (mhServer, left, right); 2031 #endif /* VRDP_NO_COM */ 1902 mpEntryPoints->VRDPUSBRequest (mhServer, u32ClientId, pvParms, cbParms); 1903 } 2032 1904 #endif 2033 1905 } 2034 1906 2035 void ConsoleVRDPServer:: SendUSBRequest (uint32_t u32ClientId, void *pvParms, uint32_t cbParms) const1907 void ConsoleVRDPServer::QueryInfo (uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut) const 2036 1908 { 2037 1909 #ifdef VBOX_VRDP 2038 #ifdef VRDP_NO_COM2039 1910 if (mpEntryPoints && mhServer) 2040 1911 { 2041 mpEntryPoints->VRDPUSBRequest (mhServer, u32ClientId, pvParms, cbParms);2042 }2043 #else2044 if (mpfnVRDPSendUSBRequest)2045 mpfnVRDPSendUSBRequest (mhServer, u32ClientId, pvParms, cbParms);2046 #endif /* VRDP_NO_COM */2047 #endif2048 }2049 2050 void ConsoleVRDPServer::QueryInfo (uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut) const2051 {2052 #ifdef VBOX_VRDP2053 #ifdef VRDP_NO_COM2054 if (mpEntryPoints && mhServer)2055 {2056 1912 mpEntryPoints->VRDPQueryInfo (mhServer, index, pvBuffer, cbBuffer, pcbOut); 2057 1913 } 2058 #else2059 if (mpfnVRDPQueryInfo)2060 mpfnVRDPQueryInfo (mhServer, index, pvBuffer, cbBuffer, pcbOut);2061 #endif /* VRDP_NO_COM */2062 1914 #endif 2063 1915 } … … 2085 1937 #define DEFSYMENTRY(a) { #a, (void**)&mpfn##a } 2086 1938 2087 #ifdef VRDP_NO_COM2088 1939 static const struct SymbolEntry symbols[] = 2089 1940 { 2090 1941 DEFSYMENTRY(VRDPCreateServer) 2091 1942 }; 2092 #else2093 static const struct SymbolEntry symbols[] =2094 {2095 DEFSYMENTRY(VRDPStartServer),2096 DEFSYMENTRY(VRDPSetCallback),2097 DEFSYMENTRY(VRDPShutdownServer),2098 DEFSYMENTRY(VRDPSendUpdate),2099 DEFSYMENTRY(VRDPSendUpdateBitmap),2100 DEFSYMENTRY(VRDPSendResize),2101 DEFSYMENTRY(VRDPSendAudioSamples),2102 DEFSYMENTRY(VRDPSendAudioVolume),2103 DEFSYMENTRY(VRDPSendUSBRequest),2104 DEFSYMENTRY(VRDPQueryInfo),2105 DEFSYMENTRY(VRDPClipboard)2106 };2107 #endif /* VRDP_NO_COM */2108 1943 2109 1944 #undef DEFSYMENTRY -
trunk/src/VBox/Main/Makefile.kmk
r5976 r5982 279 279 ifdef VBOX_WITH_VRDP 280 280 VBoxC_DEFS += VBOX_VRDP IN_VRDP_R3 281 ifdef VBOX_WITH_VRDP_NO_COM282 VBoxC_DEFS += VRDP_NO_COM283 endif284 281 endif 285 282 ifdef VBOX_WITH_HGCM -
trunk/src/VBox/Main/include/ConsoleImpl.h
r5741 r5982 180 180 AudioSniffer *getAudioSniffer () { return mAudioSniffer; } 181 181 182 #ifdef VRDP_NO_COM183 182 int VRDPClientLogon (uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain); 184 183 void VRDPClientConnect (uint32_t u32ClientId); … … 187 186 void VRDPInterceptUSB (uint32_t u32ClientId, void **ppvIntercept); 188 187 void VRDPInterceptClipboard (uint32_t u32ClientId); 189 #else190 static VRDPSERVERCALLBACK *getVrdpServerCallback () { return &sVrdpServerCallback; };191 #endif /* VRDP_NO_COM */192 188 193 189 void processRemoteUSBDevices (uint32_t u32ClientId, VRDPUSBDEVICEDESC *pDevList, uint32_t cbDevList); … … 442 438 volatile uint32_t mcVRDPClients; 443 439 444 #ifdef VRDP_NO_COM445 #else446 static DECLCALLBACK(int) vrdp_ClientLogon (void *pvUser, uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain);447 static DECLCALLBACK(void) vrdp_ClientConnect (void *pvUser, uint32_t u32ClientId);448 static DECLCALLBACK(void) vrdp_ClientDisconnect (void *pvUser, uint32_t u32ClientId, uint32_t fu32Intercepted);449 static DECLCALLBACK(void) vrdp_InterceptAudio (void *pvUser, uint32_t u32ClientId);450 static DECLCALLBACK(void) vrdp_InterceptUSB (void *pvUser, uint32_t u32ClientId, PFNVRDPUSBCALLBACK *ppfn, void **ppv);451 static DECLCALLBACK(void) vrdp_InterceptClipboard (void *pvUser, uint32_t u32ClientId, PFNVRDPCLIPBOARDCALLBACK *ppfn, void **ppv);452 453 static VRDPSERVERCALLBACK sVrdpServerCallback;454 #endif /* VRDP_NO_COM */455 456 440 static const char *sSSMConsoleUnit; 457 441 static uint32_t sSSMConsoleVer; -
trunk/src/VBox/Main/include/ConsoleVRDPServer.h
r5782 r5982 26 26 #include <VBox/HostServices/VBoxClipboardExt.h> 27 27 28 #ifdef VRDP_NO_COM29 28 #include "SchemaDefs.h" 30 #endif /* VRDP_NO_COM */31 29 32 30 // ConsoleVRDPServer 33 31 /////////////////////////////////////////////////////////////////////////////// 34 32 35 #ifdef VRDP_NO_COM36 33 typedef struct _VRDPInputSynch 37 34 { … … 47 44 bool fClientScrollLock; 48 45 } VRDPInputSynch; 49 #endif /* VRDP_NO_COM */50 46 51 47 /* Member of Console. Helper class for VRDP server management. Not a COM class. */ … … 57 53 58 54 int Launch (void); 59 #ifdef VRDP_NO_COM 55 60 56 void NotifyAbsoluteMouse (bool fGuestWantsAbsolute) 61 57 { … … 88 84 void MousePointerUpdate (const VRDPCOLORPOINTER *pPointer); 89 85 void MousePointerHide (void); 90 #else 91 void SetCallback (void); 92 #endif /* VRDP_NO_COM */ 86 93 87 void Stop (void); 94 88 … … 99 93 void AuthDisconnect (const Guid &uuid, uint32_t u32ClientId); 100 94 101 #ifdef VRDP_NO_COM102 95 void USBBackendCreate (uint32_t u32ClientId, void **ppvIntercept); 103 #else104 void USBBackendCreate (uint32_t u32ClientId, PFNVRDPUSBCALLBACK *ppfn, void **ppv);105 #endif /* VRDP_NO_COM */106 96 void USBBackendDelete (uint32_t u32ClientId); 107 97 … … 119 109 void waitRemoteUSBThreadEvent (unsigned cMillies); 120 110 121 #ifdef VRDP_NO_COM122 111 void ClipboardCreate (uint32_t u32ClientId); 123 #else124 void ClipboardCreate (uint32_t u32ClientId, PFNVRDPCLIPBOARDCALLBACK *ppfn, void **ppv);125 #endif /* VRDP_NO_COM */126 112 void ClipboardDelete (uint32_t u32ClientId); 127 113 … … 132 118 void SendResize (void) const; 133 119 void SendUpdateBitmap (unsigned uScreenId, uint32_t x, uint32_t y, uint32_t w, uint32_t h) const; 134 #ifdef VRDP_NO_COM135 #else136 void SetFramebuffer (IFramebuffer *framebuffer, uint32_t fFlags) const;137 #endif /* VRDP_NO_COM */138 120 139 121 void SendAudioSamples (void *pvSamples, uint32_t cSamples, VRDPAUDIOFORMAT format) const; … … 157 139 static RTLDRMOD mVRDPLibrary; 158 140 159 #ifdef VRDP_NO_COM160 141 static PFNVRDPCREATESERVER mpfnVRDPCreateServer; 161 142 … … 185 166 186 167 VRDPInputSynch m_InputSynch; 187 #else188 // VRDP API function pointers189 static int (VBOXCALL *mpfnVRDPStartServer) (IConsole *pConsole, IVRDPServer *pVRDPServer, HVRDPSERVER *phServer);190 static int (VBOXCALL *mpfnVRDPSetFramebuffer) (HVRDPSERVER hServer, IFramebuffer *pFramebuffer, uint32_t fFlags);191 static void (VBOXCALL *mpfnVRDPSetCallback) (HVRDPSERVER hServer, VRDPSERVERCALLBACK *pcallback, void *pvUser);192 static void (VBOXCALL *mpfnVRDPShutdownServer) (HVRDPSERVER hServer);193 static void (VBOXCALL *mpfnVRDPSendUpdateBitmap)(HVRDPSERVER hServer, unsigned uScreenId, unsigned x, unsigned y, unsigned w, unsigned h);194 static void (VBOXCALL *mpfnVRDPSendResize) (HVRDPSERVER hServer);195 static void (VBOXCALL *mpfnVRDPSendAudioSamples)(HVRDPSERVER hserver, void *pvSamples, uint32_t cSamples, VRDPAUDIOFORMAT format);196 static void (VBOXCALL *mpfnVRDPSendAudioVolume) (HVRDPSERVER hserver, uint16_t left, uint16_t right);197 static void (VBOXCALL *mpfnVRDPSendUSBRequest) (HVRDPSERVER hserver, uint32_t u32ClientId, void *pvParms, uint32_t cbParms);198 static void (VBOXCALL *mpfnVRDPSendUpdate) (HVRDPSERVER hServer, unsigned uScreenId, void *pvUpdate, uint32_t cbUpdate);199 static void (VBOXCALL *mpfnVRDPQueryInfo) (HVRDPSERVER hserver, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut);200 static void (VBOXCALL *mpfnVRDPClipboard) (HVRDPSERVER hserver, uint32_t u32Function, uint32_t u32Format, const void *pvData, uint32_t cbData, uint32_t *pcbActualRead);201 #endif /* VRDP_NO_COM */202 168 #endif /* VBOX_VRDP */ 203 169 -
trunk/src/VBox/Main/include/RemoteUSBBackend.h
r4071 r5982 34 34 class ConsoleVRDPServer; 35 35 36 #ifdef VRDP_NO_COM37 36 DECLCALLBACK(int) USBClientResponseCallback (void *pv, uint32_t u32ClientId, uint8_t code, const void *pvRet, uint32_t cbRet); 38 #endif /* VRDP_NO_COM */39 37 40 38 … … 64 62 void AddRef (void); 65 63 void Release (void); 66 67 #ifdef VRDP_NO_COM68 #else69 void QueryVRDPCallbackPointer (PFNVRDPUSBCALLBACK *ppfn, void **ppv);70 #endif /* VRDP_NO_COM */71 64 72 65 REMOTEUSBCALLBACK *GetBackendCallbackPointer (void) { return &mCallback; }
Note:
See TracChangeset
for help on using the changeset viewer.