int capabilityLength = data.getLittleEndian16();
int version = data.getLittleEndian32();
}
private void rdpdr_send_capabilities() {
RdpPackage s;
s = new RdpPackage(0x54);
s.setLittleEndian16(RDPDR_COMPONENT_TYPE_CORE);
s.setLittleEndian16(PAKID_CORE_CLIENT_CAPABILITY);
s.setLittleEndian16(5);// numCapabilities
s.setLittleEndian16(0);// pad
/* Output device direction general capability set */
// s.setLittleEndian16(1); /* first */
// s.setLittleEndian16(0x28); /* length */
// s.setLittleEndian32(1);
// s.setLittleEndian32(2);
// s.setLittleEndian16(2);
// s.setLittleEndian16(5);
// s.setLittleEndian16(1);
// s.setLittleEndian16(5);
// s.setLittleEndian16(0xFFFF);
// s.setLittleEndian16(0);
// s.setLittleEndian32(0);
// s.setLittleEndian32(3);
// s.setLittleEndian32(0);
// s.setLittleEndian32(0);
s.setLittleEndian16(CAP_GENERAL_TYPE);
s.setLittleEndian16(44);
s.setLittleEndian32(GENERAL_CAPABILITY_VERSION_01);
s.setLittleEndian32(0);// osType, ignored on receipt
s.setLittleEndian32(0);// osVersion, unused and must be set to zero
s.setLittleEndian16(1); // protocolMajorVersion, must be set to 1
s.setLittleEndian16(DR_MINOR_RDP_VERSION_5_2);// protocolMinorVersion
s.setLittleEndian32(0x0000FFFF); // ioCode1
s.setLittleEndian32(0); // ioCode2, must be set to zero, reserved for future use
s.setLittleEndian32(RDPDR_DEVICE_REMOVE_PDUS | RDPDR_CLIENT_DISPLAY_NAME_PDU | RDPDR_USER_LOGGEDON_PDU); // extendedPDU
s.setLittleEndian32(ENABLE_ASYNCIO); // extraFlags1
s.setLittleEndian32(0); // extraFlags2, must be set to zero, reserved for future use5f7pre
s.setLittleEndian32(0); /* SpecialTypeDeviceCap, number of special devices to be redirected before logon */
s.setLittleEndian16(CAP_PRINTER_TYPE);
s.setLittleEndian16(8);
s.setLittleEndian32(PRINT_CAPABILITY_VERSION_01);
s.setLittleEndian16(CAP_PORT_TYPE); /* third */
s.setLittleEndian16(8); /* length */
s.setLittleEndian32(PORT_CAPABILITY_VERSION_01);
s.setLittleEndian16(CAP_DRIVE_TYPE); /* fourth */
s.setLittleEndian16(8); /* length */
s.setLittleEndian32(DRIVE_CAPABILITY_VERSION_01);
s.setLittleEndian16(CAP_SMARTCARD_TYPE); /* fifth */
s.setLittleEndian16(8); /* length */
s.setLittleEndian32(SMARTCARD_CAPABILITY_VERSION_01);
s.markEnd();
try {
this.send_packet(s);
} catch (RdesktopException e) {
} catch (CryptoException e) {