none
Windows 8 Bitmap Cache Bug RRS feed

  • Question

  • Hi,

     

    I know Windows 8 is still beta, so it is not officially supported, but I still found a minor bug that is likely just a one-liner to fix. Windows 8 does not set the bitsPerPixelId field in the Cache Bitmap - Revision 2 (CACHE_BITMAP_REV2_ORDER) order: http://msdn.microsoft.com/en-us/library/cc241616

    bitsPerPixelId (4 bits): A 4-bit, unsigned integer. The color depth of the bitmap data in bits per pixel. MUST be one of the following values.

    Value Meaning

    CBR2_8BPP
    0x3

    8 bits per pixel

    CBR2_16BPP
    0x4

    16 bits per pixel

    CBR2_24BPP
    0x5

    24 bits per pixel

    CBR2_32BPP
    0x6

    32 bits per pixel

    From my observation, all other versions of Windows set this field properly, but Windows 8 always has it set to zero. The spec does not mention zero being a valid value for this field. I worked around this problem for now by checking for an invalid bitsPerPixelId value and setting it to a sane value based on the negotiated color depth. While this works, Windows 8 still doesn't comply to the current specification for that field.

    I captured sample flags (extraFlags) from Windows Server 2008 R2 SP1 and Windows 8 for comparison, here are the results:

     

    Windows Server 2008 R2 SP1:

     

    0x0422: 000001000 0100 010

     

    010 cacheId: 2

    0100 bitsPerPixelId: 4

    000001000 flags:

    CBR2_NO_BITMAP_COMPRESSION_HDR

     

    0x0C22: 000011000 0100 010

     

    010 cacheId: 2

    0100 bitsPerPixelId: 4

    000011000 flags:

    CBR2_NO_BITMAP_COMPRESSION_HDR

    CBR2_DO_NOT_CACHE

     

    Windows 8:

     

    0x0482: 000001001 0000 010

     

    010 cacheId: 2

    0000 bitsPerPixelId: 0 <- invalid!

    000001001 flags:

    CBR2_NO_BITMAP_COMPRESSION_HDR

    CBR2_HEIGHT_SAME_AS_WIDTH

     

    0x0C82: 000011001 0000 010

     

    010 cacheId: 2

    0000 bitsPerPixelId: 0 <- invalid!

    000011001 flags:

    CBR2_NO_BITMAP_COMPRESSION_HDR

    CBR2_HEIGHT_SAME_AS_WIDTH

    CBR2_DO_NOT_CACHE

     

     

     

     

    Thursday, January 5, 2012 1:04 AM

Answers