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
 
struct  PBI
 
struct  IOSB
 
struct  FSI
 
struct  pollfd
 

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 GetCompressedFileSizeA   apr_winapi_GetCompressedFileSizeA
 
#define GetCompressedFileSize   apr_winapi_GetCompressedFileSizeA
 
#define GetCompressedFileSizeW   apr_winapi_GetCompressedFileSizeW
 
#define QueryTimerResolution   apr_winapi_NtQueryTimerResolution
 
#define SetTimerResolution   apr_winapi_NtSetTimerResolution
 
#define QueryInformationProcess   apr_winapi_NtQueryInformationProcess
 
#define QueryObject   apr_winapi_NtQueryObject
 
#define ZwQueryInformationFile   apr_winapi_ZwQueryInformationFile
 
#define CreateToolhelp32Snapshot   apr_winapi_CreateToolhelp32Snapshot
 
#define Process32FirstW   apr_winapi_Process32FirstW
 
#define Process32NextW   apr_winapi_Process32NextW
 
#define POLLRDNORM   0x0100
 
#define POLLRDBAND   0x0200
 
#define POLLIN   (POLLRDNORM | POLLRDBAND)
 
#define POLLPRI   0x0400
 
#define POLLWRNORM   0x0010
 
#define POLLOUT   (POLLWRNORM)
 
#define POLLWRBAND   0x0020
 
#define POLLERR   0x0001
 
#define POLLHUP   0x0002
 
#define POLLNVAL   0x0004
 
#define WSAPoll   apr_winapi_WSAPoll
 
#define HAVE_POLL   1
 
#define SetDllDirectoryW   apr_winapi_SetDllDirectoryW
 

Typedefs

typedef struct PBI PBI
 
typedef struct PBIPPBI
 
typedef struct IOSB IOSB
 
typedef struct IOSBPIOSB
 
typedef struct FSI FSI
 
typedef struct FSIPFSI
 
typedef struct pollfd WSAPOLLFD
 
typedef struct pollfdPWSAPOLLFD
 
typedef struct pollfdLPWSAPOLLFD
 

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
}
 
enum  apr_dlltoken_e {
  DLL_WINBASEAPI = 0, DLL_WINADVAPI = 1, DLL_WINSOCKAPI = 2, DLL_WINSOCK2API = 3,
  DLL_SHSTDAPI = 4, DLL_NTDLL = 5, DLL_defined = 6
}
 

Functions

int apr_wastrtoastr (char const *const **retarr, wchar_t const *const *arr, int args)
 
apr_status_t apr_get_oslevel (apr_oslevel_e *)
 
FARPROC apr_load_dll_func (apr_dlltoken_e fnLib, char *fnName, int ordinal)
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_WINBASEAPI, DWORD, WINAPI, GetCompressedFileSizeA, 0,(IN LPCSTR lpFileName, OUT LPDWORD lpFileSizeHigh),(lpFileName, lpFileSizeHigh))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_WINBASEAPI, DWORD, WINAPI, GetCompressedFileSizeW, 0,(IN LPCWSTR lpFileName, OUT LPDWORD lpFileSizeHigh),(lpFileName, lpFileSizeHigh))
 
 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, NtQueryInformationProcess, 0,(HANDLE hProcess, INTinfo, PVOID pPI, ULONG LenPI, ULONG *pSizePI),(hProcess, info, pPI, LenPI, pSizePI))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_NTDLL, LONG, WINAPI, NtQueryObject, 0,(HANDLE hObject, INTinfo, PVOID pOI, ULONG LenOI, ULONG *pSizeOI),(hObject, info, pOI, LenOI, pSizeOI))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_NTDLL, LONG, WINAPI, ZwQueryInformationFile, 0,(HANDLE hObject, PVOIDpIOSB, PVOIDpFI, ULONGLenFI, ULONGinfo),(hObject, pIOSB, pFI, LenFI, info))
 
 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_WINSOCK2API, int, WSAAPI, WSAPoll, 0,(IN OUT LPWSAPOLLFD fdArray, IN ULONG fds, IN INT timeout),(fdArray, fds, timeout))
 
 APR_DECLARE_LATE_DLL_FUNC (DLL_WINBASEAPI, BOOL, WINAPI, SetDllDirectoryW, 0,(IN LPCWSTR lpPathName),(lpPathName))
 

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 apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \
static int apr_winapi_chk_##fn = 0; \
static APR_INLINE int apr_winapi_ld_##fn(void) \
{ if (apr_winapi_pfn_##fn) return 1; \
if (apr_winapi_chk_##fn ++) return 0; \
if (!apr_winapi_pfn_##fn) \
apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \
apr_load_dll_func(lib, #fn, ord); \
if (apr_winapi_pfn_##fn) 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;} }; \
#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 GetCompressedFileSize   apr_winapi_GetCompressedFileSizeA
#define GetCompressedFileSizeA   apr_winapi_GetCompressedFileSizeA
#define GetCompressedFileSizeW   apr_winapi_GetCompressedFileSizeW
#define HAVE_POLL   1
#define IF_WIN_OS_IS_UNICODE
#define POLLERR   0x0001
#define POLLHUP   0x0002
#define POLLIN   (POLLRDNORM | POLLRDBAND)
#define POLLNVAL   0x0004
#define POLLOUT   (POLLWRNORM)
#define POLLPRI   0x0400
#define POLLRDBAND   0x0200
#define POLLRDNORM   0x0100
#define POLLWRBAND   0x0020
#define POLLWRNORM   0x0010
#define Process32FirstW   apr_winapi_Process32FirstW
#define Process32NextW   apr_winapi_Process32NextW
#define QueryInformationProcess   apr_winapi_NtQueryInformationProcess
#define QueryObject   apr_winapi_NtQueryObject
#define QueryTimerResolution   apr_winapi_NtQueryTimerResolution
#define SetDllDirectoryW   apr_winapi_SetDllDirectoryW
#define SetTimerResolution   apr_winapi_NtSetTimerResolution
#define WSAHighByte   2
#define WSALowByte   0
#define WSAPoll   apr_winapi_WSAPoll
#define ZwQueryInformationFile   apr_winapi_ZwQueryInformationFile

Typedef Documentation

typedef struct FSI FSI
typedef struct IOSB IOSB
typedef struct pollfd* LPWSAPOLLFD
typedef struct PBI PBI
typedef struct FSI * PFSI
typedef struct IOSB * PIOSB
typedef struct PBI * PPBI
typedef struct pollfd * PWSAPOLLFD
typedef struct pollfd WSAPOLLFD

Enumeration Type Documentation

Enumerator
DLL_WINBASEAPI 
DLL_WINADVAPI 
DLL_WINSOCKAPI 
DLL_WINSOCK2API 
DLL_SHSTDAPI 
DLL_NTDLL 
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 

Function Documentation

APR_DECLARE_LATE_DLL_FUNC ( DLL_WINBASEAPI  ,
DWORD  ,
WINAPI  ,
GetCompressedFileSizeA  ,
,
(IN LPCSTR lpFileName, OUT LPDWORD lpFileSizeHigh)  ,
(lpFileName, lpFileSizeHigh)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_WINBASEAPI  ,
DWORD  ,
WINAPI  ,
GetCompressedFileSizeW  ,
,
(IN LPCWSTR lpFileName, OUT LPDWORD lpFileSizeHigh)  ,
(lpFileName, lpFileSizeHigh)   
)
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  ,
NtQueryInformationProcess  ,
,
(HANDLE hProcess, INTinfo, PVOID pPI, ULONG LenPI, ULONG *pSizePI)  ,
(hProcess, info, pPI, LenPI, pSizePI)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_NTDLL  ,
LONG  ,
WINAPI  ,
NtQueryObject  ,
,
(HANDLE hObject, INTinfo, PVOID pOI, ULONG LenOI, ULONG *pSizeOI)  ,
(hObject, info, pOI, LenOI, pSizeOI)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_NTDLL  ,
LONG  ,
WINAPI  ,
ZwQueryInformationFile  ,
,
(HANDLE hObject, PVOIDpIOSB, PVOIDpFI, ULONGLenFI, ULONGinfo)  ,
(hObject, pIOSB, pFI, LenFI, info  
)
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_WINSOCK2API  ,
int  ,
WSAAPI  ,
WSAPoll  ,
,
(IN OUT LPWSAPOLLFD fdArray, IN ULONG fds, IN INT timeout)  ,
(fdArray, fds, timeout)   
)
APR_DECLARE_LATE_DLL_FUNC ( DLL_WINBASEAPI  ,
BOOL  ,
WINAPI  ,
SetDllDirectoryW  ,
,
(IN LPCWSTR lpPathName)  ,
(lpPathName)   
)
apr_status_t apr_get_oslevel ( apr_oslevel_e )
FARPROC apr_load_dll_func ( apr_dlltoken_e  fnLib,
char *  fnName,
int  ordinal 
)
int apr_wastrtoastr ( char const *const **  retarr,
wchar_t const *const *  arr,
int  args 
)

Variable Documentation

int APR_DECLARE_DATA apr_app_init_complete