16{
17 const WCHAR szUserNameFromNull[] =
L"(unknown)";
19
22
23
24
25
26
27
30 pCachedGetUserFromSid(
NULL, szUserName, &cchUserName);
31 ok(cchUserName == cchUserNameFromNull,
"cchUserName: expected %lu, got %lu\n", cchUserNameFromNull, cchUserName);
32 ok(
wcscmp(szUserName, szUserNameFromNull) == 0,
"szUserName: expected \"%S\", got \"%.*S\"\n", szUserNameFromNull, (
int)cchUserName, szUserName);
33
35 cchUserName = 1;
36 pCachedGetUserFromSid(
NULL, szUserName, &cchUserName);
37 ok(cchUserName == 0,
"cchUserName: expected 0, got %lu\n", cchUserName);
38 ok(szUserName[0] ==
UNICODE_NULL,
"szUserName: missing UNICODE_NULL, got \"%.*S\"\n", (
int)cchUserName, szUserName);
39
41 cchUserName = 2;
42 pCachedGetUserFromSid(
NULL, szUserName, &cchUserName);
43 ok(cchUserName == 1,
"cchUserName: expected 0, got %lu\n", cchUserName);
44 ok(szUserName[1] ==
UNICODE_NULL,
"szUserName: missing UNICODE_NULL, got \"%.*S\"\n", (
int)cchUserName, szUserName);
45 ok(
wcsncmp(szUserName, szUserNameFromNull, 1) == 0,
"szUserName: expected \"%.*S\", got \"%.*S\"\n", 1, szUserNameFromNull, (
int)cchUserName, szUserName);
46
48 cchUserName = cchUserNameFromNull;
49 pCachedGetUserFromSid(
NULL, szUserName, &cchUserName);
50 ok(cchUserName == cchUserNameFromNull - 1,
"cchUserName: expected %lu, got %lu\n", cchUserNameFromNull - 1, cchUserName);
51 ok(szUserName[cchUserNameFromNull - 1] ==
UNICODE_NULL,
"szUserName: missing UNICODE_NULL, got \"%.*S\"\n", (
int)cchUserName, szUserName);
52 ok(
wcsncmp(szUserName, szUserNameFromNull, cchUserNameFromNull - 1) == 0,
"szUserName: expected \"%.*S\", got \"%.*S\"\n", (
int)cchUserNameFromNull - 1, szUserNameFromNull, (
int)cchUserName, szUserName);
53
55 cchUserName = cchUserNameFromNull + 1;
56 pCachedGetUserFromSid(
NULL, szUserName, &cchUserName);
57 ok(cchUserName == cchUserNameFromNull,
"cchUserName: expected %lu, got %lu\n", cchUserNameFromNull, cchUserName);
58 ok(
wcscmp(szUserName, szUserNameFromNull) == 0,
"szUserName: expected \"%S\", got \"%.*S\"\n", szUserNameFromNull, (
int)cchUserName, szUserName);
59}
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
wchar_t *__cdecl wmemset(_Out_writes_all_(_N) wchar_t *_S, _In_ wchar_t _C, _In_ size_t _N)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)