From 985555c58f63cc8479ab77a68e2b6215b9e55a4c Mon Sep 17 00:00:00 2001 From: Mark Jansen Date: Sat, 4 Mar 2017 20:27:39 +0000 Subject: [PATCH] [APPHELP_APITEST] Check which parts of apphelp accept NT paths svn path=/trunk/; revision=74061 --- rostests/apitests/apphelp/db.cpp | 11 +++++++++++ rostests/apitests/apphelp/layerapi.c | 15 +++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/rostests/apitests/apphelp/db.cpp b/rostests/apitests/apphelp/db.cpp index 70d202395f8..7ceb9a7e138 100644 --- a/rostests/apitests/apphelp/db.cpp +++ b/rostests/apitests/apphelp/db.cpp @@ -1148,6 +1148,7 @@ static void test_mode_generic(const char* workdir, HSDB hsdb, int cur) TAGID tagid; TAGREF trApphelp; DWORD expect_flags = 0, adwExeFlags_0, exe_count; + UNICODE_STRING exenameNT; memset(&query, 0xab, sizeof(query)); @@ -1290,6 +1291,16 @@ static void test_mode_generic(const char* workdir, HSDB hsdb, int cur) ok(pdb != NULL && pdb != (PDB)0x12345678, "Expected pdb to be set to a valid pdb, was: %p\n", pdb); ok(tagid == 0, "Expected tagid to be set to 0, was: 0x%x\n", tagid); + + + if (RtlDosPathNameToNtPathName_U(exenameW, &exenameNT, NULL, NULL)) + { + ret = pSdbGetMatchingExe(hsdb, exenameNT.Buffer, NULL, NULL, 0, (SDBQUERYRESULT*)&query); + ok(ret, "SdbGetMatchingExe should not fail for %d.\n", cur); + + RtlFreeUnicodeString(&exenameNT); + } + if (test_exedata[cur].extra_file) DeleteFileA(testfile); DeleteFileA(exename); diff --git a/rostests/apitests/apphelp/layerapi.c b/rostests/apitests/apphelp/layerapi.c index 2d43b08bda3..34700fad7da 100644 --- a/rostests/apitests/apphelp/layerapi.c +++ b/rostests/apitests/apphelp/layerapi.c @@ -141,6 +141,21 @@ void expect_Sdb_imp(PCSTR path, DWORD type, BOOL result, DWORD lenResult, PCSTR } WideCharToMultiByte(CP_ACP, 0, buffer, -1, resultBuffer, sizeof(resultBuffer), NULL, NULL); winetest_ok(!strcmp(stringResult, resultBuffer), "Expected the result to be '%s', was '%s'\n", stringResult, resultBuffer); + + if (result) + { + UNICODE_STRING pathNT; + + if (RtlDosPathNameToNtPathName_U(pathW, &pathNT, NULL, NULL)) + { + memset(buffer, 0, sizeof(buffer)); + dwBufSize = sizeof(buffer); + winetest_ok(pSdbGetPermLayerKeys(pathNT.Buffer, buffer, &dwBufSize, type) == FALSE, "Expected pSdbGetPermLayerKeys to fail for NT path\n"); + + RtlFreeUnicodeString(&pathNT); + } + } + } -- 2.17.1