diff --git a/dlls/advapi32/tests/crypt_lmhash.c b/dlls/advapi32/tests/crypt_lmhash.c index 253090a970e..384221f065d 100644 --- a/dlls/advapi32/tests/crypt_lmhash.c +++ b/dlls/advapi32/tests/crypt_lmhash.c @@ -34,56 +34,44 @@ struct ustring { unsigned char *Buffer; }; -typedef NTSTATUS (WINAPI *fnSystemFunction001)(const BYTE *, const BYTE *, LPBYTE); -typedef NTSTATUS (WINAPI *fnSystemFunction002)(const BYTE *, const BYTE *, LPBYTE); -typedef NTSTATUS (WINAPI *fnSystemFunction003)(const BYTE *, LPBYTE); -typedef NTSTATUS (WINAPI *fnSystemFunction004)(const struct ustring *, const struct ustring *, struct ustring *); -typedef NTSTATUS (WINAPI *fnSystemFunction005)(const struct ustring *, const struct ustring *, struct ustring *); -typedef VOID (WINAPI *fnSystemFunction006)( PCSTR passwd, PSTR lmhash ); -typedef NTSTATUS (WINAPI *fnSystemFunction008)(const BYTE *, const BYTE *, LPBYTE); -typedef NTSTATUS (WINAPI *fnSystemFunction009)(const BYTE *, const BYTE *, LPBYTE); typedef int (WINAPI *descrypt)(unsigned char *, unsigned char *, unsigned char *); -typedef NTSTATUS (WINAPI *fnSystemFunction030)(const void*, const void*); -typedef NTSTATUS (WINAPI *fnSystemFunction032)(struct ustring *, const struct ustring *); - -fnSystemFunction001 pSystemFunction001; -fnSystemFunction002 pSystemFunction002; -fnSystemFunction003 pSystemFunction003; -fnSystemFunction004 pSystemFunction004; -fnSystemFunction004 pSystemFunction005; -fnSystemFunction006 pSystemFunction006; -fnSystemFunction008 pSystemFunction008; -fnSystemFunction008 pSystemFunction009; +static NTSTATUS (WINAPI *pSystemFunction001)(const BYTE *, const BYTE *, LPBYTE); +static NTSTATUS (WINAPI *pSystemFunction002)(const BYTE *, const BYTE *, LPBYTE); +static NTSTATUS (WINAPI *pSystemFunction003)(const BYTE *, LPBYTE); +static NTSTATUS (WINAPI *pSystemFunction004)(const struct ustring *, const struct ustring *, struct ustring *); +static NTSTATUS (WINAPI *pSystemFunction005)(const struct ustring *, const struct ustring *, struct ustring *); +static VOID (WINAPI *pSystemFunction006)( PCSTR passwd, PSTR lmhash ); +static NTSTATUS (WINAPI *pSystemFunction008)(const BYTE *, const BYTE *, LPBYTE); +static NTSTATUS (WINAPI *pSystemFunction009)(const BYTE *, const BYTE *, LPBYTE); +static NTSTATUS (WINAPI *pSystemFunction032)(struct ustring *, const struct ustring *); /* encrypt two blocks */ -descrypt pSystemFunction012; -descrypt pSystemFunction014; -descrypt pSystemFunction016; -descrypt pSystemFunction018; -descrypt pSystemFunction020; -descrypt pSystemFunction022; +static descrypt pSystemFunction012; +static descrypt pSystemFunction014; +static descrypt pSystemFunction016; +static descrypt pSystemFunction018; +static descrypt pSystemFunction020; +static descrypt pSystemFunction022; /* decrypt two blocks */ -descrypt pSystemFunction013; -descrypt pSystemFunction015; -descrypt pSystemFunction017; -descrypt pSystemFunction019; -descrypt pSystemFunction021; -descrypt pSystemFunction023; +static descrypt pSystemFunction013; +static descrypt pSystemFunction015; +static descrypt pSystemFunction017; +static descrypt pSystemFunction019; +static descrypt pSystemFunction021; +static descrypt pSystemFunction023; /* encrypt two blocks with a 32bit key */ -descrypt pSystemFunction024; -descrypt pSystemFunction025; +static descrypt pSystemFunction024; +static descrypt pSystemFunction025; /* decrypt two blocks with a 32bit key */ -descrypt pSystemFunction026; -descrypt pSystemFunction027; +static descrypt pSystemFunction026; +static descrypt pSystemFunction027; typedef int (WINAPI *memcmpfunc)(unsigned char *, unsigned char *); -memcmpfunc pSystemFunction030; -memcmpfunc pSystemFunction031; - -fnSystemFunction032 pSystemFunction032; +static memcmpfunc pSystemFunction030; +static memcmpfunc pSystemFunction031; static void test_SystemFunction006(void) { @@ -545,49 +533,49 @@ START_TEST(crypt_lmhash) { HMODULE module = GetModuleHandleA("advapi32.dll"); - pSystemFunction001 = (fnSystemFunction001)GetProcAddress( module, "SystemFunction001" ); + pSystemFunction001 = (void *)GetProcAddress( module, "SystemFunction001" ); if (pSystemFunction001) test_SystemFunction001(); else win_skip("SystemFunction001 is not available\n"); - pSystemFunction002 = (fnSystemFunction002)GetProcAddress( module, "SystemFunction002" ); + pSystemFunction002 = (void *)GetProcAddress( module, "SystemFunction002" ); if (pSystemFunction002) test_SystemFunction002(); else win_skip("SystemFunction002 is not available\n"); - pSystemFunction003 = (fnSystemFunction003)GetProcAddress( module, "SystemFunction003" ); + pSystemFunction003 = (void *)GetProcAddress( module, "SystemFunction003" ); if (pSystemFunction003) test_SystemFunction003(); else win_skip("SystemFunction002 is not available\n"); - pSystemFunction004 = (fnSystemFunction004)GetProcAddress( module, "SystemFunction004" ); + pSystemFunction004 = (void *)GetProcAddress( module, "SystemFunction004" ); if (pSystemFunction004) test_SystemFunction004(); else win_skip("SystemFunction004 is not available\n"); - pSystemFunction005 = (fnSystemFunction005)GetProcAddress( module, "SystemFunction005" ); + pSystemFunction005 = (void *)GetProcAddress( module, "SystemFunction005" ); if (pSystemFunction005) test_SystemFunction005(); else win_skip("SystemFunction005 is not available\n"); - pSystemFunction006 = (fnSystemFunction006)GetProcAddress( module, "SystemFunction006" ); + pSystemFunction006 = (void *)GetProcAddress( module, "SystemFunction006" ); if (pSystemFunction006) test_SystemFunction006(); else win_skip("SystemFunction006 is not available\n"); - pSystemFunction008 = (fnSystemFunction008)GetProcAddress( module, "SystemFunction008" ); + pSystemFunction008 = (void *)GetProcAddress( module, "SystemFunction008" ); if (pSystemFunction008) test_SystemFunction008(); else win_skip("SystemFunction008 is not available\n"); - pSystemFunction009 = (fnSystemFunction009)GetProcAddress( module, "SystemFunction009" ); + pSystemFunction009 = (void *)GetProcAddress( module, "SystemFunction009" ); if (pSystemFunction009) test_SystemFunction009(); else @@ -641,7 +629,7 @@ START_TEST(crypt_lmhash) test_memcmpfunc(pSystemFunction030); test_memcmpfunc(pSystemFunction031); - pSystemFunction032 = (fnSystemFunction032)GetProcAddress( module, "SystemFunction032" ); + pSystemFunction032 = (void *)GetProcAddress( module, "SystemFunction032" ); if (pSystemFunction032) test_SystemFunction032(); else diff --git a/dlls/advapi32/tests/crypt_md4.c b/dlls/advapi32/tests/crypt_md4.c index e866910d970..e67becb1f03 100644 --- a/dlls/advapi32/tests/crypt_md4.c +++ b/dlls/advapi32/tests/crypt_md4.c @@ -36,18 +36,14 @@ typedef struct unsigned char digest[16]; } MD4_CTX; -typedef VOID (WINAPI *fnMD4Init)( MD4_CTX *ctx ); -typedef VOID (WINAPI *fnMD4Update)( MD4_CTX *ctx, const unsigned char *src, const int len ); -typedef VOID (WINAPI *fnMD4Final)( MD4_CTX *ctx ); -typedef int (WINAPI *fnSystemFunction007)(const UNICODE_STRING *, LPBYTE); +static VOID (WINAPI *pMD4Init)( MD4_CTX *ctx ); +static VOID (WINAPI *pMD4Update)( MD4_CTX *ctx, const unsigned char *src, const int len ); +static VOID (WINAPI *pMD4Final)( MD4_CTX *ctx ); +static int (WINAPI *pSystemFunction007)(const UNICODE_STRING *, LPBYTE); typedef int (WINAPI *md4hashfunc)(LPVOID, const LPBYTE, LPBYTE); -fnMD4Init pMD4Init; -fnMD4Update pMD4Update; -fnMD4Final pMD4Final; -fnSystemFunction007 pSystemFunction007; -md4hashfunc pSystemFunction010; -md4hashfunc pSystemFunction011; +static md4hashfunc pSystemFunction010; +static md4hashfunc pSystemFunction011; #define ctxcmp( a, b ) memcmp( a, b, FIELD_OFFSET( MD4_CTX, in ) ) @@ -149,16 +145,16 @@ START_TEST(crypt_md4) module = GetModuleHandleA( "advapi32.dll" ); - pMD4Init = (fnMD4Init)GetProcAddress( module, "MD4Init" ); - pMD4Update = (fnMD4Update)GetProcAddress( module, "MD4Update" ); - pMD4Final = (fnMD4Final)GetProcAddress( module, "MD4Final" ); + pMD4Init = (void *)GetProcAddress( module, "MD4Init" ); + pMD4Update = (void *)GetProcAddress( module, "MD4Update" ); + pMD4Final = (void *)GetProcAddress( module, "MD4Final" ); if (pMD4Init && pMD4Update && pMD4Final) test_md4_ctx(); else win_skip("MD4Init and/or MD4Update and/or MD4Final are not available\n"); - pSystemFunction007 = (fnSystemFunction007)GetProcAddress( module, "SystemFunction007" ); + pSystemFunction007 = (void *)GetProcAddress( module, "SystemFunction007" ); if (pSystemFunction007) test_SystemFunction007(); else diff --git a/dlls/advapi32/tests/crypt_md5.c b/dlls/advapi32/tests/crypt_md5.c index 9136dfbc28c..4cf88688ea6 100644 --- a/dlls/advapi32/tests/crypt_md5.c +++ b/dlls/advapi32/tests/crypt_md5.c @@ -33,13 +33,9 @@ typedef struct unsigned char digest[16]; } MD5_CTX; -typedef VOID (WINAPI *fnMD5Init)( MD5_CTX *ctx ); -typedef VOID (WINAPI *fnMD5Update)( MD5_CTX *ctx, const unsigned char *src, const int len ); -typedef VOID (WINAPI *fnMD5Final)( MD5_CTX *ctx ); - -fnMD5Init pMD5Init; -fnMD5Update pMD5Update; -fnMD5Final pMD5Final; +static VOID (WINAPI *pMD5Init)( MD5_CTX *ctx ); +static VOID (WINAPI *pMD5Update)( MD5_CTX *ctx, const unsigned char *src, const int len ); +static VOID (WINAPI *pMD5Final)( MD5_CTX *ctx ); #define ctxcmp( a, b ) memcmp( a, b, FIELD_OFFSET( MD5_CTX, in ) ) @@ -79,9 +75,9 @@ static void test_md5_ctx(void) module = GetModuleHandleA("advapi32.dll"); - pMD5Init = (fnMD5Init)GetProcAddress( module, "MD5Init" ); - pMD5Update = (fnMD5Update)GetProcAddress( module, "MD5Update" ); - pMD5Final = (fnMD5Final)GetProcAddress( module, "MD5Final" ); + pMD5Init = (void *)GetProcAddress( module, "MD5Init" ); + pMD5Update = (void *)GetProcAddress( module, "MD5Update" ); + pMD5Final = (void *)GetProcAddress( module, "MD5Final" ); if (!pMD5Init || !pMD5Update || !pMD5Final) { diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index f599bb1eae6..f91ebb2bf97 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -62,23 +62,23 @@ typedef struct _OBJECT_BASIC_INFORMATION { static BOOL (WINAPI *pAddAccessAllowedAceEx)(PACL, DWORD, DWORD, DWORD, PSID); static BOOL (WINAPI *pAddAccessDeniedAceEx)(PACL, DWORD, DWORD, DWORD, PSID); static BOOL (WINAPI *pAddAuditAccessAceEx)(PACL, DWORD, DWORD, DWORD, PSID, BOOL, BOOL); -typedef VOID (WINAPI *fnBuildTrusteeWithSidA)( PTRUSTEEA pTrustee, PSID pSid ); -typedef VOID (WINAPI *fnBuildTrusteeWithNameA)( PTRUSTEEA pTrustee, LPSTR pName ); -typedef VOID (WINAPI *fnBuildTrusteeWithObjectsAndNameA)( PTRUSTEEA pTrustee, +static VOID (WINAPI *pBuildTrusteeWithSidA)( PTRUSTEEA pTrustee, PSID pSid ); +static VOID (WINAPI *pBuildTrusteeWithNameA)( PTRUSTEEA pTrustee, LPSTR pName ); +static VOID (WINAPI *pBuildTrusteeWithObjectsAndNameA)( PTRUSTEEA pTrustee, POBJECTS_AND_NAME_A pObjName, SE_OBJECT_TYPE ObjectType, LPSTR ObjectTypeName, LPSTR InheritedObjectTypeName, LPSTR Name ); -typedef VOID (WINAPI *fnBuildTrusteeWithObjectsAndSidA)( PTRUSTEEA pTrustee, +static VOID (WINAPI *pBuildTrusteeWithObjectsAndSidA)( PTRUSTEEA pTrustee, POBJECTS_AND_SID pObjSid, GUID* pObjectGuid, GUID* pInheritedObjectGuid, PSID pSid ); -typedef LPSTR (WINAPI *fnGetTrusteeNameA)( PTRUSTEEA pTrustee ); -typedef BOOL (WINAPI *fnMakeSelfRelativeSD)( PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR, LPDWORD ); -typedef BOOL (WINAPI *fnConvertSidToStringSidA)( PSID pSid, LPSTR *str ); -typedef BOOL (WINAPI *fnConvertStringSidToSidA)( LPCSTR str, PSID pSid ); +static LPSTR (WINAPI *pGetTrusteeNameA)( PTRUSTEEA pTrustee ); +static BOOL (WINAPI *pMakeSelfRelativeSD)( PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR, LPDWORD ); +static BOOL (WINAPI *pConvertSidToStringSidA)( PSID pSid, LPSTR *str ); +static BOOL (WINAPI *pConvertStringSidToSidA)( LPCSTR str, PSID pSid ); static BOOL (WINAPI *pCheckTokenMembership)(HANDLE, PSID, PBOOL); static BOOL (WINAPI *pConvertStringSecurityDescriptorToSecurityDescriptorA)(LPCSTR, DWORD, PSECURITY_DESCRIPTOR*, PULONG ); @@ -86,9 +86,9 @@ static BOOL (WINAPI *pConvertStringSecurityDescriptorToSecurityDescriptorW)(LPCW PSECURITY_DESCRIPTOR*, PULONG ); static BOOL (WINAPI *pConvertSecurityDescriptorToStringSecurityDescriptorA)(PSECURITY_DESCRIPTOR, DWORD, SECURITY_INFORMATION, LPSTR *, PULONG ); -typedef BOOL (WINAPI *fnGetFileSecurityA)(LPCSTR, SECURITY_INFORMATION, +static BOOL (WINAPI *pGetFileSecurityA)(LPCSTR, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, DWORD, LPDWORD); -typedef BOOL (WINAPI *fnSetFileSecurityA)(LPCSTR, SECURITY_INFORMATION, +static BOOL (WINAPI *pSetFileSecurityA)(LPCSTR, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR); static DWORD (WINAPI *pGetNamedSecurityInfoA)(LPSTR, SE_OBJECT_TYPE, SECURITY_INFORMATION, PSID*, PSID*, PACL*, PACL*, @@ -96,15 +96,15 @@ static DWORD (WINAPI *pGetNamedSecurityInfoA)(LPSTR, SE_OBJECT_TYPE, SECURITY_IN static PDWORD (WINAPI *pGetSidSubAuthority)(PSID, DWORD); static PUCHAR (WINAPI *pGetSidSubAuthorityCount)(PSID); static BOOL (WINAPI *pIsValidSid)(PSID); -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, +static DWORD (WINAPI *pRtlAdjustPrivilege)(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN); +static BOOL (WINAPI *pCreateWellKnownSid)(WELL_KNOWN_SID_TYPE,PSID,PSID,DWORD*); +static BOOL (WINAPI *pDuplicateTokenEx)(HANDLE,DWORD,LPSECURITY_ATTRIBUTES, SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE); -typedef NTSTATUS (WINAPI *fnLsaQueryInformationPolicy)(LSA_HANDLE,POLICY_INFORMATION_CLASS,PVOID*); -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 *pLsaQueryInformationPolicy)(LSA_HANDLE,POLICY_INFORMATION_CLASS,PVOID*); +static NTSTATUS (WINAPI *pLsaClose)(LSA_HANDLE); +static NTSTATUS (WINAPI *pLsaFreeMemory)(PVOID); +static NTSTATUS (WINAPI *pLsaOpenPolicy)(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 BOOL (WINAPI *pSetSecurityDescriptorControl)(PSECURITY_DESCRIPTOR, SECURITY_DESCRIPTOR_CONTROL, @@ -118,24 +118,6 @@ static HMODULE hmod; static int myARGC; static char** myARGV; -fnBuildTrusteeWithSidA pBuildTrusteeWithSidA; -fnBuildTrusteeWithNameA pBuildTrusteeWithNameA; -fnBuildTrusteeWithObjectsAndNameA pBuildTrusteeWithObjectsAndNameA; -fnBuildTrusteeWithObjectsAndSidA pBuildTrusteeWithObjectsAndSidA; -fnGetTrusteeNameA pGetTrusteeNameA; -fnMakeSelfRelativeSD pMakeSelfRelativeSD; -fnConvertSidToStringSidA pConvertSidToStringSidA; -fnConvertStringSidToSidA pConvertStringSidToSidA; -fnGetFileSecurityA pGetFileSecurityA; -fnSetFileSecurityA pSetFileSecurityA; -fnRtlAdjustPrivilege pRtlAdjustPrivilege; -fnCreateWellKnownSid pCreateWellKnownSid; -fnDuplicateTokenEx pDuplicateTokenEx; -fnLsaQueryInformationPolicy pLsaQueryInformationPolicy; -fnLsaClose pLsaClose; -fnLsaFreeMemory pLsaFreeMemory; -fnLsaOpenPolicy pLsaOpenPolicy; - struct sidRef { SID_IDENTIFIER_AUTHORITY auth; @@ -161,9 +143,9 @@ static void init(void) (void *)GetProcAddress(hmod, "ConvertStringSecurityDescriptorToSecurityDescriptorW" ); pConvertSecurityDescriptorToStringSecurityDescriptorA = (void *)GetProcAddress(hmod, "ConvertSecurityDescriptorToStringSecurityDescriptorA" ); - pGetFileSecurityA = (fnGetFileSecurityA)GetProcAddress(hmod, "GetFileSecurityA" ); - pSetFileSecurityA = (fnSetFileSecurityA)GetProcAddress(hmod, "SetFileSecurityA" ); - pCreateWellKnownSid = (fnCreateWellKnownSid)GetProcAddress( hmod, "CreateWellKnownSid" ); + pGetFileSecurityA = (void *)GetProcAddress(hmod, "GetFileSecurityA" ); + pSetFileSecurityA = (void *)GetProcAddress(hmod, "SetFileSecurityA" ); + pCreateWellKnownSid = (void *)GetProcAddress( hmod, "CreateWellKnownSid" ); pGetNamedSecurityInfoA = (void *)GetProcAddress(hmod, "GetNamedSecurityInfoA"); pGetSidSubAuthority = (void *)GetProcAddress(hmod, "GetSidSubAuthority"); pGetSidSubAuthorityCount = (void *)GetProcAddress(hmod, "GetSidSubAuthorityCount"); @@ -216,12 +198,10 @@ static void test_sid(void) BOOL r; LPSTR str = NULL; - pConvertSidToStringSidA = (fnConvertSidToStringSidA) - GetProcAddress( hmod, "ConvertSidToStringSidA" ); + pConvertSidToStringSidA = (void *)GetProcAddress( hmod, "ConvertSidToStringSidA" ); if( !pConvertSidToStringSidA ) return; - pConvertStringSidToSidA = (fnConvertStringSidToSidA) - GetProcAddress( hmod, "ConvertStringSidToSidA" ); + pConvertStringSidToSidA = (void *)GetProcAddress( hmod, "ConvertStringSidToSidA" ); if( !pConvertStringSidToSidA ) return; @@ -355,16 +335,11 @@ static void test_trustee(void) memset( &ZeroGuid, 0x00, sizeof (ZeroGuid) ); - pBuildTrusteeWithSidA = (fnBuildTrusteeWithSidA) - GetProcAddress( hmod, "BuildTrusteeWithSidA" ); - pBuildTrusteeWithNameA = (fnBuildTrusteeWithNameA) - GetProcAddress( hmod, "BuildTrusteeWithNameA" ); - pBuildTrusteeWithObjectsAndNameA = (fnBuildTrusteeWithObjectsAndNameA) - GetProcAddress (hmod, "BuildTrusteeWithObjectsAndNameA" ); - pBuildTrusteeWithObjectsAndSidA = (fnBuildTrusteeWithObjectsAndSidA) - GetProcAddress (hmod, "BuildTrusteeWithObjectsAndSidA" ); - pGetTrusteeNameA = (fnGetTrusteeNameA) - GetProcAddress (hmod, "GetTrusteeNameA" ); + pBuildTrusteeWithSidA = (void *)GetProcAddress( hmod, "BuildTrusteeWithSidA" ); + pBuildTrusteeWithNameA = (void *)GetProcAddress( hmod, "BuildTrusteeWithNameA" ); + pBuildTrusteeWithObjectsAndNameA = (void *)GetProcAddress (hmod, "BuildTrusteeWithObjectsAndNameA" ); + pBuildTrusteeWithObjectsAndSidA = (void *)GetProcAddress (hmod, "BuildTrusteeWithObjectsAndSidA" ); + pGetTrusteeNameA = (void *)GetProcAddress (hmod, "GetTrusteeNameA" ); if( !pBuildTrusteeWithSidA || !pBuildTrusteeWithNameA || !pBuildTrusteeWithObjectsAndNameA || !pBuildTrusteeWithObjectsAndSidA || !pGetTrusteeNameA ) @@ -862,8 +837,7 @@ static void test_AccessCheck(void) skip("not running on NT, skipping test\n"); return; } - pRtlAdjustPrivilege = (fnRtlAdjustPrivilege) - GetProcAddress(NtDllModule, "RtlAdjustPrivilege"); + pRtlAdjustPrivilege = (void *)GetProcAddress(NtDllModule, "RtlAdjustPrivilege"); if (!pRtlAdjustPrivilege) { win_skip("missing RtlAdjustPrivilege, skipping test\n"); @@ -1377,7 +1351,7 @@ static void test_sid_str(PSID * sid) } } -struct well_known_sid_value +static const struct well_known_sid_value { BOOL without_domain; const char *sid_string; @@ -1452,7 +1426,7 @@ static void test_CreateWellKnownSid(void) for (i = 0; i < sizeof(well_known_sid_values)/sizeof(well_known_sid_values[0]); i++) { - struct well_known_sid_value *value = &well_known_sid_values[i]; + const struct well_known_sid_value *value = &well_known_sid_values[i]; char sid_buffer[SECURITY_MAX_SID_SIZE]; LPSTR str; DWORD cb; @@ -1725,10 +1699,10 @@ static void test_LookupAccountSid(void) } } - pLsaQueryInformationPolicy = (fnLsaQueryInformationPolicy)GetProcAddress( hmod, "LsaQueryInformationPolicy"); - pLsaOpenPolicy = (fnLsaOpenPolicy)GetProcAddress( hmod, "LsaOpenPolicy"); - pLsaFreeMemory = (fnLsaFreeMemory)GetProcAddress( hmod, "LsaFreeMemory"); - pLsaClose = (fnLsaClose)GetProcAddress( hmod, "LsaClose"); + pLsaQueryInformationPolicy = (void *)GetProcAddress( hmod, "LsaQueryInformationPolicy"); + pLsaOpenPolicy = (void *)GetProcAddress( hmod, "LsaOpenPolicy"); + pLsaFreeMemory = (void *)GetProcAddress( hmod, "LsaFreeMemory"); + pLsaClose = (void *)GetProcAddress( hmod, "LsaClose"); if (pLsaQueryInformationPolicy && pLsaOpenPolicy && pLsaFreeMemory && pLsaClose) { @@ -2401,7 +2375,7 @@ static void test_impersonation_level(void) HKEY hkey; DWORD error; - pDuplicateTokenEx = (fnDuplicateTokenEx) GetProcAddress(hmod, "DuplicateTokenEx"); + pDuplicateTokenEx = (void *)GetProcAddress(hmod, "DuplicateTokenEx"); if( !pDuplicateTokenEx ) { win_skip("DuplicateTokenEx is not available\n"); return;