"Fossies" - the Fresh Open Source Software Archive

Member "apr-1.7.0/include/arch/win32/apr_arch_misc.h" (19 Mar 2019, 17323 Bytes) of package /linux/www/apr-1.7.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "apr_arch_misc.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.6.5_vs_1.7.0.

    1 /* Licensed to the Apache Software Foundation (ASF) under one or more
    2  * contributor license agreements.  See the NOTICE file distributed with
    3  * this work for additional information regarding copyright ownership.
    4  * The ASF licenses this file to You under the Apache License, Version 2.0
    5  * (the "License"); you may not use this file except in compliance with
    6  * the License.  You may obtain a copy of the License at
    7  *
    8  *     http://www.apache.org/licenses/LICENSE-2.0
    9  *
   10  * Unless required by applicable law or agreed to in writing, software
   11  * distributed under the License is distributed on an "AS IS" BASIS,
   12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13  * See the License for the specific language governing permissions and
   14  * limitations under the License.
   15  */
   16 
   17 #ifndef MISC_H
   18 #define MISC_H
   19 
   20 #include "apr.h"
   21 #include "apr_portable.h"
   22 #include "apr_private.h"
   23 #include "apr_general.h"
   24 #include "apr_pools.h"
   25 #include "apr_getopt.h"
   26 #include "apr_thread_proc.h"
   27 #include "apr_file_io.h"
   28 #include "apr_errno.h"
   29 #include "apr_getopt.h"
   30 
   31 #if APR_HAVE_STDIO_H
   32 #include <stdio.h>
   33 #endif
   34 #if APR_HAVE_SIGNAL_H
   35 #include <signal.h>
   36 #endif
   37 #if APR_HAVE_PTHREAD_H
   38 #include <pthread.h>
   39 #endif
   40 #if APR_HAVE_STDLIB_H
   41 #include <stdlib.h>
   42 #endif
   43 #if APR_HAVE_STRING_H
   44 #include <string.h>
   45 #endif
   46 #ifndef _WIN32_WCE
   47 #include <tlhelp32.h>
   48 #endif
   49 
   50 #if defined(HAVE_IF_INDEXTONAME) && defined(_MSC_VER)
   51 #include <Iphlpapi.h>
   52 #endif
   53 
   54 struct apr_other_child_rec_t {
   55     apr_pool_t *p;
   56     struct apr_other_child_rec_t *next;
   57     apr_proc_t *proc;
   58     void (*maintenance) (int, void *, int);
   59     void *data;
   60     apr_os_file_t write_fd;
   61 };
   62 
   63 #define WSAHighByte 2
   64 #define WSALowByte 0
   65 
   66 /* start.c and apr_app.c helpers and communication within misc.c
   67  *
   68  * They are not for public consumption, although apr_app_init_complete
   69  * must be an exported symbol to avoid reinitialization.
   70  */
   71 extern int APR_DECLARE_DATA apr_app_init_complete;
   72 
   73 int apr_wastrtoastr(char const * const * *retarr,
   74                     wchar_t const * const *arr, int args);
   75 
   76 /* Platform specific designation of run time os version.
   77  * Gaps allow for specific service pack levels that
   78  * export new kernel or winsock functions or behavior.
   79  */
   80 typedef enum {
   81     APR_WIN_UNK =       0,
   82     APR_WIN_UNSUP =     1,
   83     APR_WIN_95 =       10,
   84     APR_WIN_95_B =     11,
   85     APR_WIN_95_OSR2 =  12,
   86     APR_WIN_98 =       14,
   87     APR_WIN_98_SE =    16,
   88     APR_WIN_ME =       18,
   89 
   90     APR_WIN_UNICODE =  20, /* Prior versions support only narrow chars */
   91 
   92     APR_WIN_CE_3 =     23, /* CE is an odd beast, not supporting */
   93                            /* some pre-NT features, such as the    */
   94     APR_WIN_NT =       30, /* narrow charset APIs (fooA fns), while  */
   95     APR_WIN_NT_3_5 =   35, /* not supporting some NT-family features.  */
   96     APR_WIN_NT_3_51 =  36,
   97 
   98     APR_WIN_NT_4 =     40,
   99     APR_WIN_NT_4_SP2 = 42,
  100     APR_WIN_NT_4_SP3 = 43,
  101     APR_WIN_NT_4_SP4 = 44,
  102     APR_WIN_NT_4_SP5 = 45,
  103     APR_WIN_NT_4_SP6 = 46,
  104 
  105     APR_WIN_2000 =     50,
  106     APR_WIN_2000_SP1 = 51,
  107     APR_WIN_2000_SP2 = 52,
  108     APR_WIN_XP =       60,
  109     APR_WIN_XP_SP1 =   61,
  110     APR_WIN_XP_SP2 =   62,
  111     APR_WIN_2003 =     70,
  112     APR_WIN_VISTA =    80,
  113     APR_WIN_7 =        90
  114 } apr_oslevel_e;
  115 
  116 extern APR_DECLARE_DATA apr_oslevel_e apr_os_level;
  117 
  118 apr_status_t apr_get_oslevel(apr_oslevel_e *);
  119 
  120 /* The APR_HAS_ANSI_FS symbol is PRIVATE, and internal to APR.
  121  * APR only supports char data for filenames.  Like most applications,
  122  * characters >127 are essentially undefined.  APR_HAS_UNICODE_FS lets
  123  * the application know that utf-8 is the encoding method of APR, and
  124  * only incidently hints that we have Wide OS calls.
  125  *
  126  * APR_HAS_ANSI_FS is simply an OS flag to tell us all calls must be
  127  * the unicode eqivilant.
  128  */
  129 
  130 #if defined(_WIN32_WCE) || defined(WINNT)
  131 #define APR_HAS_ANSI_FS           0
  132 #else
  133 #define APR_HAS_ANSI_FS           1
  134 #endif
  135 
  136 /* IF_WIN_OS_IS_UNICODE / ELSE_WIN_OS_IS_ANSI help us keep the code trivial
  137  * where have runtime tests for unicode-ness, that aren't needed in any
  138  * build which supports only WINNT or WCE.
  139  */
  140 #if APR_HAS_ANSI_FS && APR_HAS_UNICODE_FS
  141 #define IF_WIN_OS_IS_UNICODE if (apr_os_level >= APR_WIN_UNICODE)
  142 #define ELSE_WIN_OS_IS_ANSI else
  143 #else /* APR_HAS_UNICODE_FS */
  144 #define IF_WIN_OS_IS_UNICODE
  145 #define ELSE_WIN_OS_IS_ANSI
  146 #endif /* WINNT */
  147 
  148 #if defined(_MSC_VER) && !defined(_WIN32_WCE)
  149 #include "crtdbg.h"
  150 
  151 static APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename,
  152                                        int linenumber)
  153 {
  154     return _malloc_dbg(size, _CRT_BLOCK, filename, linenumber);
  155 }
  156 
  157 static APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize,
  158                                         const char* filename, int linenumber)
  159 {
  160     return _realloc_dbg(userData, newSize, _CRT_BLOCK, filename, linenumber);
  161 }
  162 
  163 #else
  164 
  165 static APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename,
  166                                        int linenumber)
  167 {
  168     return malloc(size);
  169 }
  170 
  171 static APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize,
  172                                         const char* filename, int linenumber)
  173 {
  174     return realloc(userData, newSize);
  175 }
  176 
  177 #endif  /* ! _MSC_VER */
  178 
  179 typedef enum {
  180     DLL_WINBASEAPI = 0,    /* kernel32 From WinBase.h       */
  181     DLL_WINADVAPI = 1,     /* advapi32 From WinBase.h       */
  182     DLL_WINSOCKAPI = 2,    /* mswsock  From WinSock.h       */
  183     DLL_WINSOCK2API = 3,   /* ws2_32   From WinSock2.h      */
  184     DLL_SHSTDAPI = 4,      /* shell32  From ShellAPI.h      */
  185     DLL_NTDLL = 5,         /* ntdll    From our real kernel */
  186     DLL_IPHLPAPI = 6,      /* Iphlpapi From Iphlpapi.h      */
  187     DLL_defined = 7        /* must define as last idx_ + 1  */
  188 } apr_dlltoken_e;
  189 
  190 FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal);
  191 
  192 /* The apr_load_dll_func call WILL return 0 set error to
  193  * ERROR_INVALID_FUNCTION if the function cannot be loaded
  194  */
  195 #define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
  196     typedef rettype (calltype *apr_winapi_fpt_##fn) args; \
  197     static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \
  198     static int apr_winapi_chk_##fn = 0; \
  199     static APR_INLINE int apr_winapi_ld_##fn(void) \
  200     {   if (apr_winapi_pfn_##fn) return 1; \
  201         if (apr_winapi_chk_##fn ++) return 0; \
  202         if (!apr_winapi_pfn_##fn) \
  203             apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \
  204                                       apr_load_dll_func(lib, #fn, ord); \
  205         if (apr_winapi_pfn_##fn) return 1; else return 0; }; \
  206     static APR_INLINE rettype apr_winapi_##fn args \
  207     {   if (apr_winapi_ld_##fn()) \
  208             return (*(apr_winapi_pfn_##fn)) names; \
  209         else { SetLastError(ERROR_INVALID_FUNCTION); return 0;} }; \
  210 
  211 #define APR_HAVE_LATE_DLL_FUNC(fn) apr_winapi_ld_##fn()
  212 
  213 /* Provide late bound declarations of every API function missing from
  214  * one or more supported releases of the Win32 API
  215  *
  216  * lib is the enumerated token from apr_dlltoken_e, and must correspond
  217  * to the string table entry in start.c used by the apr_load_dll_func().
  218  * Token names (attempt to) follow Windows.h declarations prefixed by DLL_
  219  * in order to facilitate comparison.  Use the exact declaration syntax
  220  * and names from Windows.h to prevent ambigutity and bugs.
  221  *
  222  * rettype and calltype follow the original declaration in Windows.h
  223  * fn is the true function name - beware Ansi/Unicode #defined macros
  224  * ord is the ordinal within the library, use 0 if it varies between versions
  225  * args is the parameter list following the original declaration, in parens
  226  * names is the parameter list sans data types, enclosed in parens
  227  *
  228  * #undef/re#define the Ansi/Unicode generic name to abate confusion
  229  * In the case of non-text functions, simply #define the original name
  230  */
  231 
  232 #if !defined(_WIN32_WCE) && !defined(WINNT)
  233 /* This group is available to all versions of WINNT 4.0 SP6 and later */
  234 
  235 #ifdef GetFileAttributesExA
  236 #undef GetFileAttributesExA
  237 #endif
  238 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, (
  239     IN LPCSTR lpFileName,
  240     IN GET_FILEEX_INFO_LEVELS fInfoLevelId,
  241     OUT LPVOID lpFileInformation),
  242     (lpFileName, fInfoLevelId, lpFileInformation));
  243 #define GetFileAttributesExA apr_winapi_GetFileAttributesExA
  244 #undef GetFileAttributesEx
  245 #define GetFileAttributesEx apr_winapi_GetFileAttributesExA
  246 
  247 #ifdef GetFileAttributesExW
  248 #undef GetFileAttributesExW
  249 #endif
  250 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExW, 0, (
  251     IN LPCWSTR lpFileName,
  252     IN GET_FILEEX_INFO_LEVELS fInfoLevelId,
  253     OUT LPVOID lpFileInformation),
  254     (lpFileName, fInfoLevelId, lpFileInformation));
  255 #define GetFileAttributesExW apr_winapi_GetFileAttributesExW
  256 
  257 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, (
  258     IN HANDLE hFile),
  259     (hFile));
  260 #define CancelIo apr_winapi_CancelIo
  261 
  262 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, TryEnterCriticalSection, 0, (
  263     LPCRITICAL_SECTION lpCriticalSection),
  264     (lpCriticalSection));
  265 #define TryEnterCriticalSection apr_winapi_TryEnterCriticalSection
  266 
  267 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SwitchToThread, 0, (
  268     void),
  269     ());
  270 #define SwitchToThread apr_winapi_SwitchToThread
  271 
  272 APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetEffectiveRightsFromAclW, 0, (
  273     IN PACL pacl,
  274     IN PTRUSTEE_W pTrustee,
  275     OUT PACCESS_MASK pAccessRights),
  276     (pacl, pTrustee, pAccessRights));
  277 #define GetEffectiveRightsFromAclW apr_winapi_GetEffectiveRightsFromAclW
  278 
  279 APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoW, 0, (
  280     IN LPWSTR pObjectName,
  281     IN SE_OBJECT_TYPE ObjectType,
  282     IN SECURITY_INFORMATION SecurityInfo,
  283     OUT PSID *ppsidOwner,
  284     OUT PSID *ppsidGroup,
  285     OUT PACL *ppDacl,
  286     OUT PACL *ppSacl,
  287     OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor),
  288     (pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup,
  289         ppDacl, ppSacl, ppSecurityDescriptor));
  290 #define GetNamedSecurityInfoW apr_winapi_GetNamedSecurityInfoW
  291 
  292 APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoA, 0, (
  293     IN LPSTR pObjectName,
  294     IN SE_OBJECT_TYPE ObjectType,
  295     IN SECURITY_INFORMATION SecurityInfo,
  296     OUT PSID *ppsidOwner,
  297     OUT PSID *ppsidGroup,
  298     OUT PACL *ppDacl,
  299     OUT PACL *ppSacl,
  300     OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor),
  301     (pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup,
  302         ppDacl, ppSacl, ppSecurityDescriptor));
  303 #define GetNamedSecurityInfoA apr_winapi_GetNamedSecurityInfoA
  304 #undef GetNamedSecurityInfo
  305 #define GetNamedSecurityInfo apr_winapi_GetNamedSecurityInfoA
  306 
  307 APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, (
  308     IN HANDLE handle,
  309     IN SE_OBJECT_TYPE ObjectType,
  310     IN SECURITY_INFORMATION SecurityInfo,
  311     OUT PSID *ppsidOwner,
  312     OUT PSID *ppsidGroup,
  313     OUT PACL *ppDacl,
  314     OUT PACL *ppSacl,
  315     OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor),
  316     (handle, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup,
  317         ppDacl, ppSacl, ppSecurityDescriptor));
  318 #define GetSecurityInfo apr_winapi_GetSecurityInfo
  319 
  320 APR_DECLARE_LATE_DLL_FUNC(DLL_SHSTDAPI, LPWSTR *, WINAPI, CommandLineToArgvW, 0, (
  321     LPCWSTR lpCmdLine,
  322     int *pNumArgs),
  323     (lpCmdLine, pNumArgs));
  324 #define CommandLineToArgvW apr_winapi_CommandLineToArgvW
  325 
  326 #endif /* !defined(_WIN32_WCE) && !defined(WINNT) */
  327 
  328 #if !defined(_WIN32_WCE)
  329 /* This group is NOT available to all versions of WinNT,
  330  * these we must always look up
  331  */
  332 
  333 #ifdef GetCompressedFileSizeA
  334 #undef GetCompressedFileSizeA
  335 #endif
  336 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, DWORD, WINAPI, GetCompressedFileSizeA, 0, (
  337     IN LPCSTR lpFileName,
  338     OUT LPDWORD lpFileSizeHigh),
  339     (lpFileName, lpFileSizeHigh));
  340 #define GetCompressedFileSizeA apr_winapi_GetCompressedFileSizeA
  341 #undef GetCompressedFileSize
  342 #define GetCompressedFileSize apr_winapi_GetCompressedFileSizeA
  343 
  344 #ifdef GetCompressedFileSizeW
  345 #undef GetCompressedFileSizeW
  346 #endif
  347 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, DWORD, WINAPI, GetCompressedFileSizeW, 0, (
  348     IN LPCWSTR lpFileName,
  349     OUT LPDWORD lpFileSizeHigh),
  350     (lpFileName, lpFileSizeHigh));
  351 #define GetCompressedFileSizeW apr_winapi_GetCompressedFileSizeW
  352 
  353 
  354 APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryTimerResolution, 0, (
  355     ULONG *pMaxRes,  /* Minimum NS Resolution */
  356     ULONG *pMinRes,  /* Maximum NS Resolution */
  357     ULONG *pCurRes), /* Current NS Resolution */
  358     (pMaxRes, pMinRes, pCurRes));
  359 #define QueryTimerResolution apr_winapi_NtQueryTimerResolution
  360 
  361 APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtSetTimerResolution, 0, (
  362     ULONG ReqRes,    /* Requested NS Clock Resolution */
  363     BOOL  Acquire,   /* Aquire (1) or Release (0) our interest */
  364     ULONG *pNewRes), /* The NS Clock Resolution granted */
  365     (ReqRes, Acquire, pNewRes));
  366 #define SetTimerResolution apr_winapi_NtSetTimerResolution
  367 
  368 typedef struct PBI {
  369     LONG      ExitStatus;
  370     PVOID     PebBaseAddress;
  371     apr_uintptr_t AffinityMask;
  372     LONG      BasePriority;
  373     apr_uintptr_t UniqueProcessId;
  374     apr_uintptr_t InheritedFromUniqueProcessId;
  375 } PBI, *PPBI;
  376 
  377 APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryInformationProcess, 0, (
  378     HANDLE hProcess,  /* Obvious */
  379     INT   info,       /* Use 0 for PBI documented above */
  380     PVOID pPI,        /* The PIB buffer */
  381     ULONG LenPI,      /* Use sizeof(PBI) */
  382     ULONG *pSizePI),  /* returns pPI buffer used (may pass NULL) */
  383     (hProcess, info, pPI, LenPI, pSizePI));
  384 #define QueryInformationProcess apr_winapi_NtQueryInformationProcess
  385 
  386 APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryObject, 0, (
  387     HANDLE hObject,   /* Obvious */
  388     INT   info,       /* Use 0 for PBI documented above */
  389     PVOID pOI,        /* The PIB buffer */
  390     ULONG LenOI,      /* Use sizeof(PBI) */
  391     ULONG *pSizeOI),  /* returns pPI buffer used (may pass NULL) */
  392     (hObject, info, pOI, LenOI, pSizeOI));
  393 #define QueryObject apr_winapi_NtQueryObject
  394 
  395 typedef struct IOSB {
  396     union {
  397     UINT Status;
  398     PVOID reserved;
  399     };
  400     apr_uintptr_t Information; /* Varies by op, consumed buffer size for FSI below */
  401 } IOSB, *PIOSB;
  402 
  403 typedef struct FSI {
  404     LONGLONG AllocationSize;
  405     LONGLONG EndOfFile;
  406     ULONG    NumberOfLinks;
  407     BOOL     DeletePending;
  408     BOOL     Directory;
  409 } FSI, *PFSI;
  410 
  411 APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, ZwQueryInformationFile, 0, (
  412     HANDLE hObject,    /* Obvious */
  413     PVOID  pIOSB,      /* Point to the IOSB buffer for detailed return results */
  414     PVOID  pFI,        /* The buffer, using FIB above */
  415     ULONG  LenFI,      /* Use sizeof(FI) */
  416     ULONG  info),      /* Use 5 for FSI documented above*/
  417     (hObject, pIOSB, pFI, LenFI, info));
  418 #define ZwQueryInformationFile apr_winapi_ZwQueryInformationFile
  419 
  420 #ifdef CreateToolhelp32Snapshot
  421 #undef CreateToolhelp32Snapshot
  422 #endif
  423 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, HANDLE, WINAPI, CreateToolhelp32Snapshot, 0, (
  424     DWORD dwFlags,
  425     DWORD th32ProcessID),
  426     (dwFlags, th32ProcessID));
  427 #define CreateToolhelp32Snapshot apr_winapi_CreateToolhelp32Snapshot
  428 
  429 #ifdef Process32FirstW
  430 #undef Process32FirstW
  431 #endif
  432 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, Process32FirstW, 0, (
  433     HANDLE hSnapshot,
  434     LPPROCESSENTRY32W lppe),
  435     (hSnapshot, lppe));
  436 #define Process32FirstW apr_winapi_Process32FirstW
  437 
  438 #ifdef Process32NextW
  439 #undef Process32NextW
  440 #endif
  441 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, Process32NextW, 0, (
  442     HANDLE hSnapshot,
  443     LPPROCESSENTRY32W lppe),
  444     (hSnapshot, lppe));
  445 #define Process32NextW apr_winapi_Process32NextW
  446 
  447 #if !defined(POLLERR)
  448 /* Event flag definitions for WSAPoll(). */
  449 #define POLLRDNORM  0x0100
  450 #define POLLRDBAND  0x0200
  451 #define POLLIN      (POLLRDNORM | POLLRDBAND)
  452 #define POLLPRI     0x0400
  453 
  454 #define POLLWRNORM  0x0010
  455 #define POLLOUT     (POLLWRNORM)
  456 #define POLLWRBAND  0x0020
  457 
  458 #define POLLERR     0x0001
  459 #define POLLHUP     0x0002
  460 #define POLLNVAL    0x0004
  461 
  462 typedef struct pollfd {
  463     SOCKET  fd;
  464     SHORT   events;
  465     SHORT   revents;
  466 
  467 } WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD;
  468 
  469 #endif /* !defined(POLLERR) */
  470 #ifdef WSAPoll
  471 #undef WSAPoll
  472 #endif
  473 APR_DECLARE_LATE_DLL_FUNC(DLL_WINSOCK2API, int, WSAAPI, WSAPoll, 0, (
  474     IN OUT LPWSAPOLLFD fdArray,
  475     IN ULONG fds,
  476     IN INT timeout),
  477     (fdArray, fds, timeout));
  478 #define WSAPoll apr_winapi_WSAPoll
  479 #define HAVE_POLL   1
  480 
  481 #ifdef SetDllDirectoryW
  482 #undef SetDllDirectoryW
  483 #endif
  484 APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SetDllDirectoryW, 0, (
  485     IN LPCWSTR lpPathName),
  486     (lpPathName));
  487 #define SetDllDirectoryW apr_winapi_SetDllDirectoryW
  488 
  489 #ifdef if_nametoindex
  490 #undef if_nametoindex
  491 #endif
  492 APR_DECLARE_LATE_DLL_FUNC(DLL_IPHLPAPI, NET_IFINDEX, WINAPI, if_nametoindex, 0, (
  493     IN PCSTR InterfaceName),
  494     (InterfaceName));
  495 #define if_nametoindex apr_winapi_if_nametoindex
  496 
  497 #ifdef if_indextoname
  498 #undef if_indextoname
  499 #endif
  500 APR_DECLARE_LATE_DLL_FUNC(DLL_IPHLPAPI, PCHAR, NETIOAPI_API_, if_indextoname, 0, (
  501     NET_IFINDEX InterfaceIndex,
  502     PCHAR       InterfaceName),
  503     (InterfaceIndex, InterfaceName));
  504 #define if_indextoname apr_winapi_if_indextoname
  505 
  506 #endif /* !defined(_WIN32_WCE) */
  507 
  508 #endif  /* ! MISC_H */
  509