/// <summary> /// Create a TS_COMPDESK_CAPABILITYSET type Capability, 2.2.7.2.9 /// Problem: hardcode as SDK bug (miss member) /// </summary> /// <param name="setSurfBits">The Set Surface Bits Command (section 2.2.9.2.1) is supported or not.</param> /// <param name="frameMarker">The Frame Marker Command (section 2.2.9.2.3) is supported or not.</param> /// <param name="streamSurfBits">The Stream Surface Bits Command (section 2.2.9.2.2) is supported or not.</param> /// <returns>TS_SURFCMDS_CAPABILITYSET type Capability</returns> public static TS_SURFCMDS_CAPABILITYSET CreateSurfaceCmdCapSet(CmdFlags_Values cmdFlags) { TS_SURFCMDS_CAPABILITYSET surfCmds = new TS_SURFCMDS_CAPABILITYSET(); surfCmds.capabilitySetType = capabilitySetType_Values.CAPSETTYPE_SURFACE_COMMANDS; surfCmds.lengthCapability = (ushort)Marshal.SizeOf(surfCmds); surfCmds.cmdFlags = cmdFlags; return surfCmds; }
/// <summary> /// Method to receive and decode client capabilities. /// </summary> /// <param name="serverMaxRequestSize">The MaxRequestSize field of the server-to-client Multifragment Update Capability Set. </param> /// <param name="supportedRfxCaps">Output the TS_RFX_ICAP array supported by the client.</param> public void ReceiveAndCheckClientCapabilities(uint serverMaxRequestSize, out TS_RFX_ICAP[] supportedRfxCaps) { supportedRfxCaps = null; s2cMaxRequestSize = serverMaxRequestSize; ConfirmCapabilitySets = this.rdpbcgrSessionContext.ConfirmCapabilitySets; foreach (ITsCapsSet capSet in ConfirmCapabilitySets) { if (capSet is TS_MULTIFRAGMENTUPDATE_CAPABILITYSET) { this.is_Client_Multifragment_Update_CapabilitySet_Received = true; this.client_Multifragment_Update_CapabilitySet = (TS_MULTIFRAGMENTUPDATE_CAPABILITYSET)capSet; } else if (capSet is TS_LARGE_POINTER_CAPABILITYSET) { this.is_Client_Large_Pointer_Capability_Set_Received = true; this.client_Large_Pointer_Capability_Set = (TS_LARGE_POINTER_CAPABILITYSET)capSet; } else if (capSet is TS_BITMAPCACHE_CAPABILITYSET_REV2) { this.is_Client_Revision2_Bitmap_Cache_Capability_Set_Received = true; this.client_Revision2_Bitmap_Cache_Capability_Set = (TS_BITMAPCACHE_CAPABILITYSET_REV2)capSet; } else if (capSet is TS_FRAME_ACKNOWLEDGE_CAPABILITYSET) { this.is_TS_FRAME_ACKNOWLEDGE_CAPABILITYSET_Received = true; this.clientTS_FRAME_ACKNOWLEDGE_CAPABILITYSET = (TS_FRAME_ACKNOWLEDGE_CAPABILITYSET)capSet; } else if (capSet is TS_SURFCMDS_CAPABILITYSET) { this.is_Client_Surface_Commands_Capability_Set_Received = true; this.client_Surface_Commands_Capability_Set = (TS_SURFCMDS_CAPABILITYSET)capSet; if ((this.client_Surface_Commands_Capability_Set.cmdFlags & CmdFlags_Values.SURFCMDS_STREAMSURFACEBITS) == CmdFlags_Values.SURFCMDS_STREAMSURFACEBITS) { this.clientupportStreamSurfaceBits = true; } } else if (capSet is TS_BITMAPCODECS_CAPABILITYSET) { this.is_Client_Bitmap_Codecs_Capability_Set_Received = true; this.client_Bitmap_Codecs_Capability_Set = (TS_BITMAPCODECS_CAPABILITYSET)capSet; foreach (TS_BITMAPCODEC codec in this.client_Bitmap_Codecs_Capability_Set.supportedBitmapCodecs.bitmapCodecArray) { if (is_REMOTEFX_CODEC_GUID(codec.codecGUID)) { is_TS_RFX_CLNT_CAPS_CONTAINER_Received = true; remoteFXCodecID = codec.codecID; this.client_RFX_Caps_Container = rdprfxServerDecoder.Decode_TS_RFX_CLNT_CAPS_CONTAINER(codec.codecProperties); supportedRfxCaps = this.client_RFX_Caps_Container.capsData.capsetsData[0].icapsData; break; } } } } //Verify Client Capabilities VerifyClientCapabilities(); }