Commit 8ee430d1 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

kernel32/tests: Get the test to run on Windows 95.

parent c43f6146
......@@ -29,6 +29,7 @@ static HANDLE (WINAPI *pCreateActCtxW)(PCACTCTXW);
static BOOL (WINAPI *pDeactivateActCtx)(DWORD,ULONG_PTR);
static BOOL (WINAPI *pFindActCtxSectionStringW)(DWORD,const GUID *,ULONG,LPCWSTR,PACTCTX_SECTION_KEYED_DATA);
static BOOL (WINAPI *pGetCurrentActCtx)(HANDLE *);
static BOOL (WINAPI *pIsDebuggerPresent)(void);
static BOOL (WINAPI *pQueryActCtxW)(DWORD,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T*);
static VOID (WINAPI *pReleaseActCtx)(HANDLE);
......@@ -881,8 +882,9 @@ static void test_actctx(void)
test_detailed_info(handle, &detailed_info1);
test_info_in_assembly(handle, 1, &manifest1_info);
if (!IsDebuggerPresent()) /* CloseHandle will generate an exception if a debugger is present */
if (pIsDebuggerPresent && !pIsDebuggerPresent())
{
/* CloseHandle will generate an exception if a debugger is present */
b = CloseHandle(handle);
ok(!b, "CloseHandle succeeded\n");
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() == %u\n", GetLastError());
......@@ -1137,6 +1139,7 @@ static BOOL init_funcs(void)
X(DeactivateActCtx);
X(FindActCtxSectionStringW);
X(GetCurrentActCtx);
X(IsDebuggerPresent);
X(QueryActCtxW);
X(ReleaseActCtx);
#undef X
......
......@@ -28,6 +28,9 @@
#include "winbase.h"
#include "winerror.h"
static HINSTANCE hkernel32;
static HANDLE (WINAPI *pFindFirstFileExA)(LPCSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD);
/* keep filename and filenameW the same */
static const char filename[] = "testfile.xxx";
static const WCHAR filenameW[] = { 't','e','s','t','f','i','l','e','.','x','x','x',0 };
......@@ -1420,12 +1423,18 @@ static void test_FindFirstFileExA(void)
WIN32_FIND_DATAA search_results;
HANDLE handle;
if (!pFindFirstFileExA)
{
skip("FindFirstFileExA() is missing\n");
return;
}
CreateDirectoryA("test-dir", NULL);
_lclose(_lcreat("test-dir\\file1", 0));
_lclose(_lcreat("test-dir\\file2", 0));
CreateDirectoryA("test-dir\\dir1", NULL);
/* FindExLimitToDirectories is ignored */
handle = FindFirstFileExA("test-dir\\*", FindExInfoStandard, &search_results, FindExSearchLimitToDirectories, NULL, 0);
handle = pFindFirstFileExA("test-dir\\*", FindExInfoStandard, &search_results, FindExSearchLimitToDirectories, NULL, 0);
ok(handle != INVALID_HANDLE_VALUE, "FindFirstFile failed (err=%u)\n", GetLastError());
ok(strcmp(search_results.cFileName, ".") == 0, "First entry should be '.', is %s\n", search_results.cFileName);
......@@ -1895,6 +1904,9 @@ static void test_RemoveDirectory(void)
START_TEST(file)
{
hkernel32 = GetModuleHandleA("kernel32.dll");
pFindFirstFileExA=(void*)GetProcAddress(hkernel32, "FindFirstFileExA");
test__hread( );
test__hwrite( );
test__lclose( );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment