#306 Fix client screen depth advertisement

Internals (36)
Felix Buenemann

The attached patch changes the screen depth request/advertisement sent by the client according to Microsoft protocol documentation MS-RDPBCGR.pdf pg. 32-37. Without the patch connecting to a 24bpp capable server with 32bpp will fallback to 8bpp (because highColorDepth has an invalid value of 32). WIth the patch we correctly set highColorDepth to 24bpp for fallback and signal 32bpp connection via earlyCapabilityFlags.

I am also falling back to 32bpp if 24bpp was requersted and the server only support 32bpp but not 24bpp (which should be the case if it's 32bpp capable). It could be arqued that falling back would mean 16bpp, but I find this behaviour closer to what the user expects.

I also fixed some fields that seemed to be wrongly setup when comparing with the M$ spec. Some stuff seemed wrongly positioned or byteswapped.

There also was an output of out_uint32_le(s, 1) that I removed - was that supposed to be the digital product id? It seemed out of place so I just kept that zeroed out.


  • Jay Sorg
    Jay Sorg

    Do you have the right file here.
    I don't see any diff between this and what is in rdesktop.org but I still see the problem.

  • Correct patch for 32bpp fallback behaviour.

  • Added correct patch file, thx jsorg71.

  • Patch is working as advertised -- I have been using it since September. Tested with Windows 7 (32 bpp) and 2003 (24 bpp) remotes.