[APPHELP_APITEST] Check which parts of apphelp accept NT paths
authorMark Jansen <mark.jansen@reactos.org>
Sat, 4 Mar 2017 20:27:39 +0000 (20:27 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 4 Mar 2017 20:27:39 +0000 (20:27 +0000)
svn path=/trunk/; revision=74061

rostests/apitests/apphelp/db.cpp
rostests/apitests/apphelp/layerapi.c

index 70d2023..7ceb9a7 100644 (file)
@@ -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;
     TAGID tagid;
     TAGREF trApphelp;
     DWORD expect_flags = 0, adwExeFlags_0, exe_count;
+    UNICODE_STRING exenameNT;
 
     memset(&query, 0xab, sizeof(query));
 
 
     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);
 
     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);
     if (test_exedata[cur].extra_file)
         DeleteFileA(testfile);
     DeleteFileA(exename);
index 2d43b08..34700fa 100644 (file)
@@ -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);
     }
     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);
+        }
+    }
+
 }
 
 
 }