mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 20:06:40 +00:00
[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:
parent
3263e4fd82
commit
c1abc87910
3 changed files with 62 additions and 7 deletions
|
@ -6,6 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define WIN32_NO_STATUS
|
#define WIN32_NO_STATUS
|
||||||
|
#define UNICODE
|
||||||
#include <wine/test.h>
|
#include <wine/test.h>
|
||||||
#include <pseh/pseh2.h>
|
#include <pseh/pseh2.h>
|
||||||
#include <ndk/mmfuncs.h>
|
#include <ndk/mmfuncs.h>
|
||||||
|
@ -183,18 +184,22 @@ START_TEST(RtlDetermineDosPathNameType)
|
||||||
USHORT Length;
|
USHORT Length;
|
||||||
|
|
||||||
if (!RtlDetermineDosPathNameType_Ustr)
|
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);
|
StartSeh() RtlDetermineDosPathNameType_U(NULL); EndSeh(STATUS_ACCESS_VIOLATION);
|
||||||
|
|
||||||
if (RtlDetermineDosPathNameType_Ustr)
|
if (RtlDetermineDosPathNameType_Ustr)
|
||||||
{
|
{
|
||||||
UNICODE_STRING PathString;
|
UNICODE_STRING PathString;
|
||||||
StartSeh() RtlDetermineDosPathNameType_Ustr(NULL); EndSeh(STATUS_ACCESS_VIOLATION);
|
StartSeh() RtlDetermineDosPathNameType_Ustr(NULL); EndSeh(STATUS_ACCESS_VIOLATION);
|
||||||
|
|
||||||
RtlInitEmptyUnicodeString(&PathString, NULL, MAXUSHORT);
|
RtlInitEmptyUnicodeString(&PathString, NULL, MAXUSHORT);
|
||||||
PathType = RtlDetermineDosPathNameType_Ustr(&PathString);
|
PathType = RtlDetermineDosPathNameType_Ustr(&PathString);
|
||||||
ok(PathType == RtlPathTypeRelative, "PathType = %d\n", PathType);
|
ok(PathType == RtlPathTypeRelative, "PathType = %d\n", PathType);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < sizeof(Tests) / sizeof(Tests[0]); i++)
|
for (i = 0; i < sizeof(Tests) / sizeof(Tests[0]); i++)
|
||||||
|
|
|
@ -163,11 +163,53 @@ START_TEST(RtlDoesFileExists)
|
||||||
BOOL Success;
|
BOOL Success;
|
||||||
HANDLE Handle;
|
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()
|
StartSeh()
|
||||||
Ret = RtlDoesFileExists_U(NULL);
|
Ret = RtlDoesFileExists_U(NULL);
|
||||||
ok(Ret == FALSE, "NULL file exists?!\n");
|
ok(Ret == FALSE, "NULL file exists?!\n");
|
||||||
EndSeh(STATUS_SUCCESS);
|
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);
|
swprintf(FileName, L"C:\\%ls", CustomPath);
|
||||||
/* Make sure this directory doesn't exist */
|
/* Make sure this directory doesn't exist */
|
||||||
while (GetFileAttributes(FileName) != INVALID_FILE_ATTRIBUTES)
|
while (GetFileAttributes(FileName) != INVALID_FILE_ATTRIBUTES)
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define WIN32_NO_STATUS
|
#define WIN32_NO_STATUS
|
||||||
|
#define UNICODE
|
||||||
#include <wine/test.h>
|
#include <wine/test.h>
|
||||||
#include <pseh/pseh2.h>
|
#include <pseh/pseh2.h>
|
||||||
#include <ndk/rtlfuncs.h>
|
#include <ndk/rtlfuncs.h>
|
||||||
|
@ -307,7 +308,14 @@ START_TEST(RtlGetFullPathName_Ustr)
|
||||||
PATH_TYPE_AND_UNKNOWN PathType;
|
PATH_TYPE_AND_UNKNOWN PathType;
|
||||||
|
|
||||||
if (!RtlGetFullPathName_Ustr)
|
if (!RtlGetFullPathName_Ustr)
|
||||||
return;
|
{
|
||||||
|
RtlGetFullPathName_Ustr = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlGetFullPathName_Ustr");
|
||||||
|
if (!RtlGetFullPathName_Ustr)
|
||||||
|
{
|
||||||
|
skip("RtlGetFullPathName_Ustr unavailable\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* NULL parameters */
|
/* NULL parameters */
|
||||||
StartSeh()
|
StartSeh()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue