You don't need to enable this block. All its task is made by the for-loop before it. But you must specify device.

#if 1
                out_uint32_le(s, 0x20);     <--> out_uint32_le(s, g_rdpdr_device[i].device_type);
                out_uint32_le(s, 0);        <--> out_uint32_le(s, i);        /* RDP Device ID */
                out_uint8p(s, "SCARD", 5);  <--> out_uint8p(s, g_rdpdr_device[i].name, 8);
                out_uint8s(s, 3);           <--/

                out_uint32(s, 0);           <--> the same

We have done next:

1) have written simple "scard.c" where we have described SCARD_DEVICE_FNS
2) have modified "rdpdr.c" to point to SCARD_DEVICE_FNS for Smart Card redirections
3) have modified "rdesktop.c" to call the get_enum_device for Smart Card redirections

We found that the name of Smart Card Device must be "SCARD\0\0\0", only with this name redirection will work. We don't understand why, but think that this is a protocol limitation.

We can send this files to you, but them also contain some "printf" functions for debug purpose.

PS. Do You have ICQ? We can communicate by it, my number 264679502

Best regards,