[ros-diffs] [tfaber] 56419: [NTDLL_APITEST] - Try GetProcAddress even on private functions. Allows easier testing in ROS by temporarily exporting them.

tfaber at svn.reactos.org tfaber at svn.reactos.org
Wed Apr 25 13:06:30 UTC 2012


Author: tfaber
Date: Wed Apr 25 13:06:30 2012
New Revision: 56419

URL: http://svn.reactos.org/svn/reactos?rev=56419&view=rev
Log:
[NTDLL_APITEST]
- Try GetProcAddress even on private functions. Allows easier testing in ROS by temporarily exporting them.

Modified:
    trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c
    trunk/rostests/apitests/ntdll/RtlDoesFileExists.c
    trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c

Modified: trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c?rev=56419&r1=56418&r2=56419&view=diff
==============================================================================
--- trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c [iso-8859-1] Wed Apr 25 13:06:30 2012
@@ -6,6 +6,7 @@
  */
 
 #define WIN32_NO_STATUS
+#define UNICODE
 #include <wine/test.h>
 #include <pseh/pseh2.h>
 #include <ndk/mmfuncs.h>
@@ -183,18 +184,22 @@
     USHORT Length;
 
     if (!RtlDetermineDosPathNameType_Ustr)
-        skip("RtlDetermineDosPathNameType_Ustr unavailable\n");
+    {
+        RtlDetermineDosPathNameType_Ustr = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDetermineDosPathNameType_Ustr");
+        if (!RtlDetermineDosPathNameType_Ustr)
+            skip("RtlDetermineDosPathNameType_Ustr unavailable\n");
+    }
 
     StartSeh() RtlDetermineDosPathNameType_U(NULL);     EndSeh(STATUS_ACCESS_VIOLATION);
 
     if (RtlDetermineDosPathNameType_Ustr)
     {
-    UNICODE_STRING PathString;
-    StartSeh() RtlDetermineDosPathNameType_Ustr(NULL);  EndSeh(STATUS_ACCESS_VIOLATION);
-
-    RtlInitEmptyUnicodeString(&PathString, NULL, MAXUSHORT);
-    PathType = RtlDetermineDosPathNameType_Ustr(&PathString);
-    ok(PathType == RtlPathTypeRelative, "PathType = %d\n", PathType);
+        UNICODE_STRING PathString;
+        StartSeh() RtlDetermineDosPathNameType_Ustr(NULL);  EndSeh(STATUS_ACCESS_VIOLATION);
+
+        RtlInitEmptyUnicodeString(&PathString, NULL, MAXUSHORT);
+        PathType = RtlDetermineDosPathNameType_Ustr(&PathString);
+        ok(PathType == RtlPathTypeRelative, "PathType = %d\n", PathType);
     }
 
     for (i = 0; i < sizeof(Tests) / sizeof(Tests[0]); i++)

Modified: trunk/rostests/apitests/ntdll/RtlDoesFileExists.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlDoesFileExists.c?rev=56419&r1=56418&r2=56419&view=diff
==============================================================================
--- trunk/rostests/apitests/ntdll/RtlDoesFileExists.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/RtlDoesFileExists.c [iso-8859-1] Wed Apr 25 13:06:30 2012
@@ -163,10 +163,52 @@
     BOOL Success;
     HANDLE Handle;
 
+    if (!RtlDoesFileExists_UEx)
+    {
+        RtlDoesFileExists_UEx = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDoesFileExists_UEx");
+        if (!RtlDoesFileExists_UEx)
+            skip("RtlDoesFileExists_UEx unavailable\n");
+    }
+
+    if (!RtlDoesFileExists_UStr)
+    {
+        RtlDoesFileExists_UStr = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDoesFileExists_UStr");
+        if (!RtlDoesFileExists_UStr)
+            skip("RtlDoesFileExists_UStr unavailable\n");
+    }
+
+    if (!RtlDoesFileExists_UstrEx)
+    {
+        RtlDoesFileExists_UstrEx = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDoesFileExists_UstrEx");
+        if (!RtlDoesFileExists_UstrEx)
+            skip("RtlDoesFileExists_UstrEx unavailable\n");
+    }
+
     StartSeh()
         Ret = RtlDoesFileExists_U(NULL);
         ok(Ret == FALSE, "NULL file exists?!\n");
     EndSeh(STATUS_SUCCESS);
+
+    if (RtlDoesFileExists_UEx)
+    {
+        StartSeh()
+            Ret = RtlDoesFileExists_UEx(NULL, TRUE);
+            ok(Ret == FALSE, "NULL file exists?!\n");
+            Ret = RtlDoesFileExists_UEx(NULL, FALSE);
+            ok(Ret == FALSE, "NULL file exists?!\n");
+        EndSeh(STATUS_SUCCESS);
+    }
+
+    if (RtlDoesFileExists_UStr)
+    {
+        StartSeh() Ret = RtlDoesFileExists_UStr(NULL);      EndSeh(STATUS_ACCESS_VIOLATION);
+    }
+
+    if (RtlDoesFileExists_UstrEx)
+    {
+        StartSeh() RtlDoesFileExists_UstrEx(NULL, FALSE);   EndSeh(STATUS_ACCESS_VIOLATION);
+        StartSeh() RtlDoesFileExists_UstrEx(NULL, TRUE);    EndSeh(STATUS_ACCESS_VIOLATION);
+    }
 
     swprintf(FileName, L"C:\\%ls", CustomPath);
     /* Make sure this directory doesn't exist */

Modified: trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c?rev=56419&r1=56418&r2=56419&view=diff
==============================================================================
--- trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c [iso-8859-1] Wed Apr 25 13:06:30 2012
@@ -6,6 +6,7 @@
  */
 
 #define WIN32_NO_STATUS
+#define UNICODE
 #include <wine/test.h>
 #include <pseh/pseh2.h>
 #include <ndk/rtlfuncs.h>
@@ -307,7 +308,14 @@
     PATH_TYPE_AND_UNKNOWN PathType;
 
     if (!RtlGetFullPathName_Ustr)
-        return;
+    {
+        RtlGetFullPathName_Ustr = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlGetFullPathName_Ustr");
+        if (!RtlGetFullPathName_Ustr)
+        {
+            skip("RtlGetFullPathName_Ustr unavailable\n");
+            return;
+        }
+    }
 
     /* NULL parameters */
     StartSeh()




More information about the Ros-diffs mailing list