Paul Vriens : advapi32/tests: Make tests run again on win95.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Aug 14 07:13:02 CDT 2007
Module: wine
Branch: master
Commit: 4e8b83dcde670f03ed381be2583a88e6313f39d7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4e8b83dcde670f03ed381be2583a88e6313f39d7
Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date: Tue Aug 14 11:05:04 2007 +0200
advapi32/tests: Make tests run again on win95.
---
dlls/advapi32/tests/security.c | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 1595930..a49662c 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -55,6 +55,9 @@ static BOOL (WINAPI *pConvertStringSecurityDescriptorToSecurityDescriptorA)(LPCS
PSECURITY_DESCRIPTOR*, PULONG );
typedef BOOL (WINAPI *fnGetFileSecurityA)(LPCSTR, SECURITY_INFORMATION,
PSECURITY_DESCRIPTOR, DWORD, LPDWORD);
+static DWORD (WINAPI *pGetNamedSecurityInfoA)(LPSTR, SE_OBJECT_TYPE, SECURITY_INFORMATION,
+ PSID*, PSID*, PACL*, PACL*,
+ PSECURITY_DESCRIPTOR*);
typedef DWORD (WINAPI *fnRtlAdjustPrivilege)(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
typedef BOOL (WINAPI *fnCreateWellKnownSid)(WELL_KNOWN_SID_TYPE,PSID,PSID,DWORD*);
typedef BOOL (WINAPI *fnDuplicateTokenEx)(HANDLE,DWORD,LPSECURITY_ATTRIBUTES,
@@ -65,6 +68,7 @@ typedef NTSTATUS (WINAPI *fnLsaClose)(LSA_HANDLE);
typedef NTSTATUS (WINAPI *fnLsaFreeMemory)(PVOID);
typedef NTSTATUS (WINAPI *fnLsaOpenPolicy)(PLSA_UNICODE_STRING,PLSA_OBJECT_ATTRIBUTES,ACCESS_MASK,PLSA_HANDLE);
static NTSTATUS (WINAPI *pNtQueryObject)(HANDLE,OBJECT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
+static DWORD (WINAPI *pSetEntriesInAclW)(ULONG, PEXPLICIT_ACCESSW, PACL, PACL*);
static HMODULE hmod;
static int myARGC;
@@ -102,6 +106,8 @@ static void init(void)
hmod = GetModuleHandle("advapi32.dll");
pConvertStringSecurityDescriptorToSecurityDescriptorA =
(void *)GetProcAddress(hmod, "ConvertStringSecurityDescriptorToSecurityDescriptorA" );
+ pGetNamedSecurityInfoA = (void *)GetProcAddress(hmod, "GetNamedSecurityInfoA");
+ pSetEntriesInAclW = (void *)GetProcAddress(hmod, "SetEntriesInAclW");
myARGC = winetest_get_mainargs( &myARGV );
}
@@ -1714,7 +1720,13 @@ static void test_SetEntriesInAcl(void)
ACL *acl = (ACL*)0xdeadbeef;
DWORD res;
- res = SetEntriesInAclW(0, NULL, NULL, &acl);
+ if (!pSetEntriesInAclW)
+ {
+ skip("SetEntriesInAclW is not available\n");
+ return;
+ }
+
+ res = pSetEntriesInAclW(0, NULL, NULL, &acl);
if(res == ERROR_CALL_NOT_IMPLEMENTED)
{
skip("SetEntriesInAclW is not implemented\n");
@@ -1737,11 +1749,17 @@ static void test_GetNamedSecurityInfoA(void)
BOOL ret;
CHAR windows_dir[MAX_PATH];
+ if (!pGetNamedSecurityInfoA)
+ {
+ skip("GetNamedSecurityInfoA is not available\n");
+ return;
+ }
+
ret = GetWindowsDirectoryA(windows_dir, MAX_PATH);
ok(ret, "GetWindowsDirectory failed with error %d\n", GetLastError());
SetLastError(0xdeadbeef);
- error = GetNamedSecurityInfoA(windows_dir, SE_FILE_OBJECT,
+ error = pGetNamedSecurityInfoA(windows_dir, SE_FILE_OBJECT,
OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION,
NULL, NULL, NULL, NULL, &pSecDesc);
if (error != ERROR_SUCCESS && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
More information about the wine-cvs
mailing list