Hi,
 
I found a com port bug in rdesktop. The reproducing process is listed as following:
 
1) Install the zip into a w2k3 server 
2) With admin account, do "regsvr32CachConnectionCtrl.dll", after your extract the zip file under dos command. 
3) then, you can run "CachConnectionTest.exe".
 
What happened was that Rdesktop kept getting error "Port unavailable", but win32 rdp client 
does not, and the "Status:" should show "Connected".
 
Is there anybody to know the reason?
 
In order to fix this bug,  I"d like to use "rdpproxy"  to capture the communication between a rdp-server and  rdp-client:

Windows 2003 <=====> RDP PROXY <=====> Windows 2003
RDP-Client                                                      RDP-Server

I changed the line 59 in rdpproxy.c as following:
From: static const unsigned char client_salt_hdr[] = {0x01, 0x00, 0x00, 0x00, 0x00, SEC_MODULUS_SIZE + 8, 0x00, 0x00, 0x00};
To:   static const unsigned char client_salt_hdr[] = {0x01, 0x02, 0x00, 0x00, 0x00, SEC_MODULUS_SIZE + 8, 0x00, 0x00, 0x00};
 
So rdp client which comes with win2003 or XP can exchange some PDUs with window2003. But after a while, the server reset the connection and complain that "The RDP-Protocoll component "DATA ENCRYPTION" has recognized an error in the  protocol flow and has disconncted the client".
(I have no copy of XP RTM)
 
Now, my question are
 
1) Who knows the reason, and how to fix this bug?
 
2) Is there any option on server set to have the server abide this encryption error.
 
3) Is there any difference between the RDP win32 client coming with XP RTM and other versions of win32 RDP client