[Python-Dev] [Python-checkins] r85934 - in python/branches/py3k: Misc/NEWS Modules/socketmodule.c

Scott Dial scott+python-dev at scottdial.com
Mon Nov 1 00:08:00 CET 2010


On 10/30/2010 4:08 PM, Martin v. Löwis wrote:
>> I think size should be in TCHARs, not in bytes. (MSDN says so)
>> And GetComputerName's signature differs from MSDN. (Maybe should
>> use GetComputerNameExW again?)
> 
> You are right. So how about this patch?

Still not quite right. The call to GetComputerNameExW after
ERROR_MORE_DATA (which gives the number of *bytes* needed) still needs
to pass "size/sizeof(wchar_t)" back into GetComputerNameExW since it
wants the number TCHARs. I don't think the +1 is needed either (MSDN
says it already included the null-terminator in the byte count.

-- 
Scott Dial
scott at scottdial.com
scodial at cs.indiana.edu


More information about the Python-Dev mailing list