[PATCH 1/4] Additional test note for RtlDetermineDosPathNameType_U, get function pointers in common way.
Nikolay Sivov
bunglehead at gmail.com
Sun Dec 20 16:40:44 CST 2009
---
dlls/ntdll/tests/path.c | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/tests/path.c b/dlls/ntdll/tests/path.c
index 9d39cdc..620d505 100644
--- a/dlls/ntdll/tests/path.c
+++ b/dlls/ntdll/tests/path.c
@@ -81,6 +81,11 @@ static void test_RtlDetermineDosPathNameType(void)
ret = pRtlDetermineDosPathNameType_U( buffer );
ok( ret == test->ret, "Wrong result %d/%d for %s\n", ret, test->ret, test->path );
}
+
+#if (0)
+ /* NULL path pointer - crashes on native too */
+ ret = pRtlDetermineDosPathNameType_U( NULL );
+#endif
}
@@ -295,6 +300,21 @@ static void test_RtlGetFullPathName_U(void)
}
}
+static void init_pointers(void)
+{
+ HMODULE mod = GetModuleHandleA("ntdll.dll");
+
+#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(mod, #f))
+ MAKEFUNC(RtlMultiByteToUnicodeN);
+ MAKEFUNC(RtlUnicodeToMultiByteN);
+ MAKEFUNC(RtlDetermineDosPathNameType_U);
+ MAKEFUNC(RtlIsDosDeviceName_U);
+ MAKEFUNC(RtlOemStringToUnicodeString);
+ MAKEFUNC(RtlIsNameLegalDOS8Dot3);
+ MAKEFUNC(RtlGetFullPathName_U);
+#undef MAKEFUNC
+}
+
START_TEST(path)
{
HMODULE mod = GetModuleHandleA("ntdll.dll");
@@ -304,13 +324,8 @@ START_TEST(path)
return;
}
- pRtlMultiByteToUnicodeN = (void *)GetProcAddress(mod,"RtlMultiByteToUnicodeN");
- pRtlUnicodeToMultiByteN = (void *)GetProcAddress(mod,"RtlUnicodeToMultiByteN");
- pRtlDetermineDosPathNameType_U = (void *)GetProcAddress(mod,"RtlDetermineDosPathNameType_U");
- pRtlIsDosDeviceName_U = (void *)GetProcAddress(mod,"RtlIsDosDeviceName_U");
- pRtlOemStringToUnicodeString = (void *)GetProcAddress(mod,"RtlOemStringToUnicodeString");
- pRtlIsNameLegalDOS8Dot3 = (void *)GetProcAddress(mod,"RtlIsNameLegalDOS8Dot3");
- pRtlGetFullPathName_U = (void *)GetProcAddress(mod,"RtlGetFullPathName_U");
+ init_pointers();
+
if (pRtlDetermineDosPathNameType_U)
test_RtlDetermineDosPathNameType();
if (pRtlIsDosDeviceName_U)
--
1.5.6.5
--=-bd3+Edaz1BOix2xnKuAu--
More information about the wine-patches
mailing list