kernel32: Fix the GetComputerName* functions to not write to the buffer at all if there is not enough space.

Robert Shearman rob at
Thu Feb 15 17:22:18 CST 2007

Add tests for the GetComputerName* functions that show this issue.

Fix an off-by-one error in setting the size when there is not enough space.

Remove the exception handlers for GetComputerNameW, 
GetComputerNameExA/W, since testing on XP SP2 shows that access 
violations are not caught and these are not present on Win9x, which does 
have an exception handler.
  dlls/kernel32/computername.c  |  100 +++++++++++--------------------
  dlls/kernel32/tests/environ.c |  131 
  2 files changed, 166 insertions(+), 65 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ce09ea4f5543d447bb3650b16e6c2e1778d3f0f1.diff
Type: text/x-patch
Size: 12102 bytes
Desc: not available
Url :

More information about the wine-patches mailing list