From bdf583b349a6c721a968ccee66358fc59f24e3fc Mon Sep 17 00:00:00 2001 From: Andrew Nguyen Date: Wed, 16 Jun 2010 23:40:04 -0500 Subject: [PATCH] ntdll/tests: Add tests to examine output file part pointer behavior for RtlGetFullPathName_U. --- dlls/ntdll/tests/path.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dlls/ntdll/tests/path.c b/dlls/ntdll/tests/path.c index 9d39cdcd9ab..90db536a827 100644 --- a/dlls/ntdll/tests/path.c +++ b/dlls/ntdll/tests/path.c @@ -226,6 +226,9 @@ static void test_RtlIsNameLegalDOS8Dot3(void) } static void test_RtlGetFullPathName_U(void) { + static const WCHAR emptyW[] = {0}; + static const WCHAR deadbeefW[] = {'d','e','a','d','b','e','e','f',0}; + struct test { const char *path; @@ -269,6 +272,26 @@ static void test_RtlGetFullPathName_U(void) DWORD reslen; UINT len; + file_part = (WCHAR *)0xdeadbeef; + lstrcpyW(rbufferW, deadbeefW); + ret = pRtlGetFullPathName_U(NULL, MAX_PATH, rbufferW, &file_part); + ok(!ret, "Expected RtlGetFullPathName_U to return 0, got %u\n", ret); + ok(!lstrcmpW(rbufferW, deadbeefW), + "Expected the output buffer to be untouched, got %s\n", wine_dbgstr_w(rbufferW)); + ok(file_part == (WCHAR *)0xdeadbeef || + file_part == NULL, /* Win7 */ + "Expected file part pointer to be untouched, got %p\n", file_part); + + file_part = (WCHAR *)0xdeadbeef; + lstrcpyW(rbufferW, deadbeefW); + ret = pRtlGetFullPathName_U(emptyW, MAX_PATH, rbufferW, &file_part); + ok(!ret, "Expected RtlGetFullPathName_U to return 0, got %u\n", ret); + ok(!lstrcmpW(rbufferW, deadbeefW), + "Expected the output buffer to be untouched, got %s\n", wine_dbgstr_w(rbufferW)); + ok(file_part == (WCHAR *)0xdeadbeef || + file_part == NULL, /* Win7 */ + "Expected file part pointer to be untouched, got %p\n", file_part); + for (test = tests; test->path; test++) { len= strlen(test->rname) * sizeof(WCHAR); -- 2.11.4.GIT