Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_arch_misc.h File Reference
#include "apr.h"
#include "apr_portable.h"
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_getopt.h"
#include "apr_thread_proc.h"
#include "apr_file_io.h"
#include "apr_errno.h"
#include <tlhelp32.h>
Include dependency graph for apr_arch_misc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  apr_other_child_rec_t
 

Macros

#define WSAHighByte   2
 
#define WSALowByte   0
 
#define APR_HAS_ANSI_FS   0
 
#define IF_WIN_OS_IS_UNICODE
 
#define ELSE_WIN_OS_IS_ANSI
 
#define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names)
 
#define APR_HAVE_LATE_DLL_FUNC(fn)   apr_winapi_ld_##fn()
 
#define QueryTimerResolution   apr_winapi_NtQueryTimerResolution
 
#define SetTimerResolution   apr_winapi_NtSetTimerResolution
 
#define CreateToolhelp32Snapshot   apr_winapi_CreateToolhelp32Snapshot
 
#define Process32FirstW   apr_winapi_Process32FirstW
 
#define Process32NextW   apr_winapi_Process32NextW
 
#define HAVE_POLL   1
 
#define if_nametoindex   apr_winapi_if_nametoindex
 
#define if_indextoname   apr_winapi_if_indextoname
 

Enumerations

enum  apr_oslevel_e {
  APR_WIN_UNK = 0, APR_WIN_UNSUP = 1, APR_WIN_95 = 10, APR_WIN_95_B = 11,
  APR_WIN_95_OSR2 = 12, APR_WIN_98 = 14, APR_WIN_98_SE = 16, APR_WIN_ME = 18,
  APR_WIN_UNICODE = 20, APR_WIN_CE_3 = 23, APR_WIN_NT = 30, APR_WIN_NT_3_5 = 35,
  APR_WIN_NT_3_51 = 36, APR_WIN_NT_4 = 40, APR_WIN_NT_4_SP2 = 42, APR_WIN_NT_4_SP3 = 43,
  APR_WIN_NT_4_SP4 = 44, APR_WIN_NT_4_SP5 = 45, APR_WIN_NT_4_SP6 = 46, APR_WIN_2000 = 50,
  APR_WIN_2000_SP1 = 51, APR_WIN_2000_SP2 = 52, APR_WIN_XP = 60, APR_WIN_XP_SP1 = 61,
  APR_WIN_XP_SP2 = 62, APR_WIN_2003 = 70, APR_WIN_VISTA = 80, APR_WIN_7 = 90,
  APR_WIN_7_SP1 = 91, APR_WIN_8 = 100, APR_WIN_8_1 = 110, APR_WIN_10 = 120
}
 
enum  apr_dlltoken_e {
  DLL_WINBASEAPI = 0, DLL_WINADVAPI = 1, DLL_WINSOCKAPI = 2, DLL_WINSOCK2API = 3,
  DLL_SHSTDAPI = 4, DLL_NTDLL = 5, DLL_IPHLPAPI = 6, DLL_API_MS_WIN_DOWNLEVEL_SHELL32_L1_1_0 = 7,
  DLL_defined = 8
}
 

Functions

int apr_wastrtoastr (char const *const **retarr, wchar_t const *const *arr, int args)
 
apr_status_t apr_get_oslevel (apr_oslevel_e *)
 
DWORD apr_wait_for_single_object (HANDLE handle, apr_interval_time_t timeout)
 
FARPROC apr_load_dll_func (apr_dlltoken_e fnLib, char *fnName, int ordinal)
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_NTDLL, LONG, WINAPI, NtQueryTimerResolution, 0,(ULONG *pMaxRes, ULONG *pMinRes, ULONG *pCurRes),(pMaxRes, pMinRes, pCurRes))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_NTDLL, LONG, WINAPI, NtSetTimerResolution, 0,(ULONG ReqRes, BOOLAcquire, ULONG *pNewRes),(ReqRes, Acquire, pNewRes))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_NTDLL, LONG, WINAPI, NtWaitForSingleObject, 0,(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER Timeout),(Handle, Alertable, Timeout))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_WINBASEAPI, HANDLE, WINAPI, CreateToolhelp32Snapshot, 0,(DWORD dwFlags, DWORD th32ProcessID),(dwFlags, th32ProcessID))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_WINBASEAPI, BOOL, WINAPI, Process32FirstW, 0,(HANDLE hSnapshot, LPPROCESSENTRY32W lppe),(hSnapshot, lppe))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_WINBASEAPI, BOOL, WINAPI, Process32NextW, 0,(HANDLE hSnapshot, LPPROCESSENTRY32W lppe),(hSnapshot, lppe))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_IPHLPAPI, NET_IFINDEX, WINAPI, if_nametoindex, 0,(IN PCSTR InterfaceName),(InterfaceName))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_IPHLPAPI, PCHAR, NETIOAPI_API_, if_indextoname, 0,(NET_IFINDEX InterfaceIndex, PCHARInterfaceName),(InterfaceIndex, InterfaceName))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_API_MS_WIN_DOWNLEVEL_SHELL32_L1_1_0, LPWSTR *, STDAPICALLTYPE, CommandLineToArgvW, 0,(LPCWSTR lpCmdLine, int *pNumArgs),(lpCmdLine, pNumArgs))
 

Variables

int APR_DECLARE_DATA apr_app_init_complete
 
APR_DECLARE_DATA apr_oslevel_e apr_os_level
 

Macro Definition Documentation

#define APR_DECLARE_LATE_DLL_FUNC (   lib,
  rettype,
  calltype,
  fn,
  ord,
  args,
  names 
)
Value:
typedef rettype (calltype *apr_winapi_fpt_##fn) args; \
static volatile apr_winapi_fpt_##fn apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) (ULONG_PTR) (-1); \
static APR_INLINE int apr_winapi_ld_##fn(void) \
{ \
apr_winapi_fpt_##fn cached_func = apr_winapi_pfn_##fn; \
if (cached_func == (apr_winapi_fpt_##fn) (ULONG_PTR) (-1)) { \
cached_func = (apr_winapi_fpt_##fn) apr_load_dll_func(lib, #fn, ord); \
/* Pointer-sized writes are atomic on Windows. */ \
apr_winapi_pfn_##fn = cached_func; \
} \
if (cached_func) return 1; else return 0; }; \
static APR_INLINE rettype apr_winapi_##fn args \
{ if (apr_winapi_ld_##fn()) \
return (*(apr_winapi_pfn_##fn)) names; \
else { SetLastError(ERROR_INVALID_FUNCTION); return 0;} }; \
FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal)
#define APR_INLINE
Definition: apr.h:65
#define APR_HAS_ANSI_FS   0
#define APR_HAVE_LATE_DLL_FUNC (   fn)    apr_winapi_ld_##fn()
#define CreateToolhelp32Snapshot   apr_winapi_CreateToolhelp32Snapshot
#define ELSE_WIN_OS_IS_ANSI
#define HAVE_POLL   1
#define if_indextoname   apr_winapi_if_indextoname
#define if_nametoindex   apr_winapi_if_nametoindex
#define IF_WIN_OS_IS_UNICODE
#define Process32FirstW   apr_winapi_Process32FirstW
#define Process32NextW   apr_winapi_Process32NextW
#define QueryTimerResolution   apr_winapi_NtQueryTimerResolution
#define SetTimerResolution   apr_winapi_NtSetTimerResolution
#define WSAHighByte   2
#define WSALowByte   0

Enumeration Type Documentation

Enumerator
DLL_WINBASEAPI 
DLL_WINADVAPI 
DLL_WINSOCKAPI 
DLL_WINSOCK2API 
DLL_SHSTDAPI 
DLL_NTDLL 
DLL_IPHLPAPI 
DLL_API_MS_WIN_DOWNLEVEL_SHELL32_L1_1_0 
DLL_defined 
Enumerator
APR_WIN_UNK 
APR_WIN_UNSUP 
APR_WIN_95 
APR_WIN_95_B 
APR_WIN_95_OSR2 
APR_WIN_98 
APR_WIN_98_SE 
APR_WIN_ME 
APR_WIN_UNICODE 
APR_WIN_CE_3 
APR_WIN_NT 
APR_WIN_NT_3_5 
APR_WIN_NT_3_51 
APR_WIN_NT_4 
APR_WIN_NT_4_SP2 
APR_WIN_NT_4_SP3 
APR_WIN_NT_4_SP4 
APR_WIN_NT_4_SP5 
APR_WIN_NT_4_SP6 
APR_WIN_2000 
APR_WIN_2000_SP1 
APR_WIN_2000_SP2 
APR_WIN_XP 
APR_WIN_XP_SP1 
APR_WIN_XP_SP2 
APR_WIN_2003 
APR_WIN_VISTA 
APR_WIN_7 
APR_WIN_7_SP1 
APR_WIN_8 
APR_WIN_8_1 
APR_WIN_10 

Function Documentation

APR_DECLARE_LATE_DLL_FUNC ( DLL_NTDLL  ,
LONG  ,
WINAPI  ,
NtQueryTimerResolution  ,
,
(ULONG *pMaxRes, ULONG *pMinRes, ULONG *pCurRes)  ,
(pMaxRes, pMinRes, pCurRes)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_NTDLL  ,
LONG  ,
WINAPI  ,
NtSetTimerResolution  ,
,
(ULONG ReqRes, BOOLAcquire, ULONG *pNewRes)  ,
(ReqRes, Acquire, pNewRes)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_NTDLL  ,
LONG  ,
WINAPI  ,
NtWaitForSingleObject  ,
,
(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER Timeout)  ,
(Handle, Alertable, Timeout)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_WINBASEAPI  ,
HANDLE  ,
WINAPI  ,
CreateToolhelp32Snapshot  ,
,
(DWORD dwFlags, DWORD th32ProcessID)  ,
(dwFlags, th32ProcessID)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_WINBASEAPI  ,
BOOL  ,
WINAPI  ,
Process32FirstW  ,
,
(HANDLE hSnapshot, LPPROCESSENTRY32W lppe)  ,
(hSnapshot, lppe)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_WINBASEAPI  ,
BOOL  ,
WINAPI  ,
Process32NextW  ,
,
(HANDLE hSnapshot, LPPROCESSENTRY32W lppe)  ,
(hSnapshot, lppe)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_IPHLPAPI  ,
NET_IFINDEX  ,
WINAPI  ,
if_nametoindex  ,
,
(IN PCSTR InterfaceName)  ,
(InterfaceName)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_IPHLPAPI  ,
PCHAR  ,
NETIOAPI_API_  ,
if_indextoname  ,
,
(NET_IFINDEX InterfaceIndex, PCHARInterfaceName)  ,
(InterfaceIndex, InterfaceName)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_API_MS_WIN_DOWNLEVEL_SHELL32_L1_1_0  ,
LPWSTR *  ,
STDAPICALLTYPE  ,
CommandLineToArgvW  ,
,
(LPCWSTR lpCmdLine, int *pNumArgs)  ,
(lpCmdLine, pNumArgs)   
)
apr_status_t apr_get_oslevel ( apr_oslevel_e )
FARPROC apr_load_dll_func ( apr_dlltoken_e  fnLib,
char *  fnName,
int  ordinal 
)
DWORD apr_wait_for_single_object ( HANDLE  handle,
apr_interval_time_t  timeout 
)
int apr_wastrtoastr ( char const *const **  retarr,
wchar_t const *const *  arr,
int  args 
)

Variable Documentation

int APR_DECLARE_DATA apr_app_init_complete