From 46e5c6127df85e41659083897e1ce39df2f2413e Mon Sep 17 00:00:00 2001 From: Tau Date: Sun, 3 Nov 2019 08:36:37 -0500 Subject: [PATCH] Fix function pointer calling convention syntax Fixes MSVC build --- hooklib/dll.c | 10 +++++----- hooklib/dns.c | 8 ++++---- hooklib/path.c | 20 ++++++++++---------- hooklib/reg.c | 12 ++++++------ idzio/di.c | 2 +- platform/netenv.c | 10 +++++----- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/hooklib/dll.c b/hooklib/dll.c index 3ab88e9..94f7137 100644 --- a/hooklib/dll.c +++ b/hooklib/dll.c @@ -34,11 +34,11 @@ static void * WINAPI hook_GetProcAddress(HMODULE mod, const char *name); /* Link pointers */ -static HMODULE WINAPI (*next_GetModuleHandleA)(const char *name); -static HMODULE WINAPI (*next_GetModuleHandleW)(const wchar_t *name); -static HMODULE WINAPI (*next_LoadLibraryA)(const char *name); -static HMODULE WINAPI (*next_LoadLibraryW)(const wchar_t *name); -static void * WINAPI (*next_GetProcAddress)(HMODULE mod, const char *name); +static HMODULE (WINAPI *next_GetModuleHandleA)(const char *name); +static HMODULE (WINAPI *next_GetModuleHandleW)(const wchar_t *name); +static HMODULE (WINAPI *next_LoadLibraryA)(const char *name); +static HMODULE (WINAPI *next_LoadLibraryW)(const wchar_t *name); +static void * (WINAPI *next_GetProcAddress)(HMODULE mod, const char *name); static const struct hook_symbol dll_loader_syms[] = { { diff --git a/hooklib/dns.c b/hooklib/dns.c index f75085d..04699d3 100644 --- a/hooklib/dns.c +++ b/hooklib/dns.c @@ -68,7 +68,7 @@ static int WSAAPI hook_getaddrinfo( /* Link pointers */ -static DNS_STATUS WINAPI (*next_DnsQuery_A)( +static DNS_STATUS (WINAPI *next_DnsQuery_A)( const char *pszName, WORD wType, DWORD Options, @@ -76,7 +76,7 @@ static DNS_STATUS WINAPI (*next_DnsQuery_A)( DNS_RECORD **ppQueryResults, void *pReserved); -static DNS_STATUS WINAPI (*next_DnsQuery_W)( +static DNS_STATUS (WINAPI *next_DnsQuery_W)( const wchar_t *pszName, WORD wType, DWORD Options, @@ -84,12 +84,12 @@ static DNS_STATUS WINAPI (*next_DnsQuery_W)( DNS_RECORD **ppQueryResults, void *pReserved); -static DNS_STATUS WINAPI (*next_DnsQueryEx)( +static DNS_STATUS (WINAPI *next_DnsQueryEx)( POLYFILL_DNS_QUERY_REQUEST *pRequest, void *pQueryResults, void *pCancelHandle); -static int WSAAPI (*next_getaddrinfo)( +static int (WSAAPI *next_getaddrinfo)( const char *pNodeName, const char *pServiceName, const ADDRINFOA *pHints, diff --git a/hooklib/path.c b/hooklib/path.c index 2c219a2..6f41a53 100644 --- a/hooklib/path.c +++ b/hooklib/path.c @@ -77,15 +77,15 @@ static BOOL WINAPI hook_GetFileAttributesExW( /* Link pointers */ -static BOOL WINAPI (*next_CreateDirectoryA)( +static BOOL (WINAPI *next_CreateDirectoryA)( const char *lpFileName, SECURITY_ATTRIBUTES *lpSecurityAttributes); -static BOOL WINAPI (*next_CreateDirectoryW)( +static BOOL (WINAPI *next_CreateDirectoryW)( const wchar_t *lpFileName, SECURITY_ATTRIBUTES *lpSecurityAttributes); -static HANDLE WINAPI (*next_CreateFileA)( +static HANDLE (WINAPI *next_CreateFileA)( const char *lpFileName, uint32_t dwDesiredAccess, uint32_t dwShareMode, @@ -94,7 +94,7 @@ static HANDLE WINAPI (*next_CreateFileA)( uint32_t dwFlagsAndAttributes, HANDLE hTemplateFile); -static HANDLE WINAPI (*next_CreateFileW)( +static HANDLE (WINAPI *next_CreateFileW)( const wchar_t *lpFileName, uint32_t dwDesiredAccess, uint32_t dwShareMode, @@ -103,7 +103,7 @@ static HANDLE WINAPI (*next_CreateFileW)( uint32_t dwFlagsAndAttributes, HANDLE hTemplateFile); -static HANDLE WINAPI (*next_FindFirstFileExA)( +static HANDLE (WINAPI *next_FindFirstFileExA)( const char *lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, void *lpFindFileData, @@ -111,7 +111,7 @@ static HANDLE WINAPI (*next_FindFirstFileExA)( void *lpSearchFilter, DWORD dwAdditionalFlags); -static HANDLE WINAPI (*next_FindFirstFileExW)( +static HANDLE (WINAPI *next_FindFirstFileExW)( const wchar_t *lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, void *lpFindFileData, @@ -119,16 +119,16 @@ static HANDLE WINAPI (*next_FindFirstFileExW)( void *lpSearchFilter, DWORD dwAdditionalFlags); -static DWORD WINAPI (*next_GetFileAttributesA)(const char *lpFileName); +static DWORD (WINAPI *next_GetFileAttributesA)(const char *lpFileName); -static DWORD WINAPI (*next_GetFileAttributesW)(const wchar_t *lpFileName); +static DWORD (WINAPI *next_GetFileAttributesW)(const wchar_t *lpFileName); -static BOOL WINAPI (*next_GetFileAttributesExA)( +static BOOL (WINAPI *next_GetFileAttributesExA)( const char *lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, void *lpFileInformation); -static BOOL WINAPI (*next_GetFileAttributesExW)( +static BOOL (WINAPI *next_GetFileAttributesExW)( const wchar_t *lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, void *lpFileInformation); diff --git a/hooklib/reg.c b/hooklib/reg.c index a92ac83..6028e8e 100644 --- a/hooklib/reg.c +++ b/hooklib/reg.c @@ -91,14 +91,14 @@ static LSTATUS WINAPI hook_RegSetValueExW( /* Link pointers */ -static LSTATUS WINAPI (*next_RegOpenKeyExW)( +static LSTATUS (WINAPI *next_RegOpenKeyExW)( HKEY parent, const wchar_t *name, uint32_t flags, uint32_t access, HKEY *out); -static LSTATUS WINAPI (*next_RegCreateKeyExW)( +static LSTATUS (WINAPI *next_RegCreateKeyExW)( HKEY parent, const wchar_t *name, uint32_t reserved, @@ -109,9 +109,9 @@ static LSTATUS WINAPI (*next_RegCreateKeyExW)( HKEY *out, uint32_t *disposition); -static LSTATUS WINAPI (*next_RegCloseKey)(HKEY handle); +static LSTATUS (WINAPI *next_RegCloseKey)(HKEY handle); -static LSTATUS WINAPI (*next_RegQueryValueExA)( +static LSTATUS (WINAPI *next_RegQueryValueExA)( HKEY handle, const char *name, void *reserved, @@ -119,7 +119,7 @@ static LSTATUS WINAPI (*next_RegQueryValueExA)( void *bytes, uint32_t *nbytes); -static LSTATUS WINAPI (*next_RegQueryValueExW)( +static LSTATUS (WINAPI *next_RegQueryValueExW)( HKEY handle, const wchar_t *name, void *reserved, @@ -127,7 +127,7 @@ static LSTATUS WINAPI (*next_RegQueryValueExW)( void *bytes, uint32_t *nbytes); -static LSTATUS WINAPI (*next_RegSetValueExW)( +static LSTATUS (WINAPI *next_RegSetValueExW)( HKEY handle, const wchar_t *name, uint32_t reserved, diff --git a/idzio/di.c b/idzio/di.c index cf01a67..63aeba0 100644 --- a/idzio/di.c +++ b/idzio/di.c @@ -74,7 +74,7 @@ HRESULT idz_di_init( { HRESULT hr; HMODULE dinput8; - HRESULT WINAPI (*api_entry)(HINSTANCE,DWORD,REFIID,LPVOID *,LPUNKNOWN); + HRESULT (WINAPI *api_entry)(HINSTANCE,DWORD,REFIID,LPVOID *,LPUNKNOWN); wchar_t dll_path[MAX_PATH]; UINT path_pos; diff --git a/platform/netenv.c b/platform/netenv.c index 0309922..f44c653 100644 --- a/platform/netenv.c +++ b/platform/netenv.c @@ -68,28 +68,28 @@ static uint32_t WINAPI hook_IcmpSendEcho2( /* Link pointers */ -static uint32_t WINAPI (*next_GetAdaptersAddresses)( +static uint32_t (WINAPI *next_GetAdaptersAddresses)( uint32_t Family, uint32_t Flags, void *Reserved, IP_ADAPTER_ADDRESSES *AdapterAddresses, uint32_t *SizePointer); -static uint32_t WINAPI (*next_GetAdaptersInfo)( +static uint32_t (WINAPI *next_GetAdaptersInfo)( IP_ADAPTER_INFO *AdapterInfo, uint32_t *SizePointer); -static uint32_t WINAPI (*next_GetBestRoute)( +static uint32_t (WINAPI *next_GetBestRoute)( uint32_t src_ip, uint32_t dest_ip, MIB_IPFORWARDROW *route); -static uint32_t WINAPI (*next_GetIfTable)( +static uint32_t (WINAPI *next_GetIfTable)( MIB_IFTABLE *pIfTable, uint32_t *pdwSize, BOOL bOrder); -static uint32_t WINAPI (*next_IcmpSendEcho2)( +static uint32_t (WINAPI *next_IcmpSendEcho2)( HANDLE IcmpHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine,