[NTDLL_APITEST]

- Try GetProcAddress even on private functions. Allows easier testing in ROS by temporarily exporting them.

svn path=/trunk/; revision=56419
This commit is contained in:
Thomas Faber 2012-04-25 13:06:30 +00:00
parent 3263e4fd82
commit c1abc87910
3 changed files with 62 additions and 7 deletions

View file

@ -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 @@ START_TEST(RtlDetermineDosPathNameType)
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);
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);
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++)

View file

@ -163,11 +163,53 @@ START_TEST(RtlDoesFileExists)
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 */
while (GetFileAttributes(FileName) != INVALID_FILE_ATTRIBUTES)

View file

@ -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 @@ START_TEST(RtlGetFullPathName_Ustr)
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()