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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4