From 90078d708b41037834f95f3e9e4d6c554aa87e40 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Mon, 5 May 2008 23:05:08 -0700 Subject: [PATCH] netapi32: Fix test crash occuring when in a specific situation --- dlls/netapi32/tests/wksta.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dlls/netapi32/tests/wksta.c b/dlls/netapi32/tests/wksta.c index 5eefba4..01d0d6f 100644 --- a/dlls/netapi32/tests/wksta.c +++ b/dlls/netapi32/tests/wksta.c @@ -80,7 +80,17 @@ static void run_wkstausergetinfo_tests(void) /* Level 0 */ ok(pNetWkstaUserGetInfo(NULL, 0, (LPBYTE *)&ui0) == NERR_Success, - "NetWkstaUserGetInfo is successful\n"); + "NetWkstaUserGetInfo is unsuccessful\n"); + + ok(ui0 != NULL, "ui0 is NULL\n"); + /* This failure occured when I ran sshd as service and didn't authenticate + * Since the test dereferences ui0, the rest of this test is worthless + */ + if (!ui0) + { + return; + } + ok(!lstrcmpW(user_name, ui0->wkui0_username), "This is really user name\n"); pNetApiBufferSize(ui0, &dwSize); ok(dwSize >= (sizeof(WKSTA_USER_INFO_0) + -- 1.5.4.1