00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00028 #ifdef WIN32
00029
00030 #ifndef AP_OS_H
00031 #define AP_OS_H
00032
00033
00034
00035
00036 #include "apr_pools.h"
00037
00038 #include <io.h>
00039 #include <fcntl.h>
00040
00041 #define PLATFORM "Win32"
00042
00043
00044 #define HAVE_DRIVE_LETTERS
00045 #define HAVE_UNC_PATHS
00046 #define CASE_BLIND_FILESYSTEM
00047
00048 #define APACHE_MPM_DIR "server/mpm/winnt"
00049
00050 #include <stddef.h>
00051
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055
00056
00057
00058
00059
00060
00061
00062
00063 AP_DECLARE_DATA extern int ap_real_exit_code;
00064
00065 #define exit(status) ((exit)((ap_real_exit_code==2) \
00066 ? (ap_real_exit_code = (status)) \
00067 : ((ap_real_exit_code = 0), (status))))
00068
00069 #ifdef AP_DECLARE_EXPORT
00070
00071
00072
00073
00074
00075 AP_DECLARE(apr_status_t) ap_os_proc_filepath(char **binpath, apr_pool_t *p);
00076
00077 typedef enum {
00078 AP_DLL_WINBASEAPI = 0,
00079 AP_DLL_WINADVAPI = 1,
00080 AP_DLL_WINSOCKAPI = 2,
00081 AP_DLL_WINSOCK2API = 3,
00082 AP_DLL_defined = 4
00083 } ap_dlltoken_e;
00084
00085 FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char* fnName, int ordinal);
00086
00087 PSECURITY_ATTRIBUTES GetNullACL();
00088 void CleanNullACL(void *sa);
00089
00090 DWORD wait_for_many_objects(DWORD nCount, CONST HANDLE *lpHandles,
00091 DWORD dwSeconds);
00092
00093 int set_listeners_noninheritable(apr_pool_t *p);
00094
00095
00096 #define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
00097 typedef rettype (calltype *ap_winapi_fpt_##fn) args; \
00098 static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \
00099 __inline rettype ap_winapi_##fn args \
00100 { if (!ap_winapi_pfn_##fn) \
00101 ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \
00102 return (*(ap_winapi_pfn_##fn)) names; }; \
00103
00104
00105 AP_DECLARE_LATE_DLL_FUNC(AP_DLL_WINADVAPI, BOOL, WINAPI, ChangeServiceConfig2A, 0, (
00106 SC_HANDLE hService,
00107 DWORD dwInfoLevel,
00108 LPVOID lpInfo),
00109 (hService, dwInfoLevel, lpInfo));
00110 #undef ChangeServiceConfig2
00111 #define ChangeServiceConfig2 ap_winapi_ChangeServiceConfig2A
00112
00113
00114 AP_DECLARE_LATE_DLL_FUNC(AP_DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, (
00115 IN HANDLE hFile),
00116 (hFile));
00117 #undef CancelIo
00118 #define CancelIo ap_winapi_CancelIo
00119
00120
00121 AP_DECLARE_LATE_DLL_FUNC(AP_DLL_WINBASEAPI, DWORD, WINAPI, RegisterServiceProcess, 0, (
00122 DWORD dwProcessId,
00123 DWORD dwType),
00124 (dwProcessId, dwType));
00125 #define RegisterServiceProcess ap_winapi_RegisterServiceProcess
00126
00127 #endif
00128
00129 #ifdef __cplusplus
00130 }
00131 #endif
00132
00133 #endif
00134 #endif
00135