kernel32: Trace the modified buffer on error.

This commit is contained in:
James Hawkins 2008-08-28 21:14:11 -05:00 committed by Alexandre Julliard
parent 9aef134bdc
commit 39732cf927
1 changed files with 8 additions and 1 deletions

View File

@ -24,6 +24,13 @@
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winnls.h"
static CHAR string[MAX_PATH];
#define ok_w(res, format, szString) \
\
WideCharToMultiByte(CP_ACP, 0, szString, -1, string, MAX_PATH, NULL, NULL); \
ok(res, format, string);
static BOOL (WINAPI *pGetComputerNameExA)(COMPUTER_NAME_FORMAT,LPSTR,LPDWORD);
static BOOL (WINAPI *pGetComputerNameExW)(COMPUTER_NAME_FORMAT,LPWSTR,LPDWORD);
@ -156,7 +163,7 @@ static void test_GetSetEnvironmentVariableW(void)
lstrcpyW(buf, fooW);
ret_size = GetEnvironmentVariableW(name, buf, lstrlenW(value));
ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
ok_w(lstrcmpW(buf, fooW) == 0, "should not touch the buffer: %s\n", buf);
ok(ret_size == lstrlenW(value) + 1,
"should return length with terminating 0 ret_size=%d\n", ret_size);