diff options
author | Mladen Turk <mturk@apache.org> | 2021-12-02 21:21:18 +0000 |
---|---|---|
committer | Mladen Turk <mturk@apache.org> | 2021-12-02 21:21:18 +0000 |
commit | 6487330c38e3c0430782a5ceca674b94398f347f (patch) | |
tree | ededff55d7051624a164926ea86ad603d6776026 | |
parent | 2520ce23f2830c59cfc2786effbbe72903c49ad5 (diff) | |
download | apr-6487330c38e3c0430782a5ceca674b94398f347f.tar.gz |
Stage 3 in dismantling _WIN32_WCE ... cleanup code
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895508 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | dso/win32/dso.c | 27 | ||||
-rw-r--r-- | file_io/win32/filedup.c | 8 | ||||
-rw-r--r-- | file_io/win32/flock.c | 9 | ||||
-rw-r--r-- | file_io/win32/open.c | 16 | ||||
-rw-r--r-- | file_io/win32/pipe.c | 4 | ||||
-rw-r--r-- | locks/win32/proc_mutex.c | 9 | ||||
-rw-r--r-- | misc/unix/errorcodes.c | 26 | ||||
-rw-r--r-- | misc/win32/charset.c | 4 | ||||
-rw-r--r-- | misc/win32/env.c | 14 | ||||
-rw-r--r-- | misc/win32/misc.c | 19 | ||||
-rw-r--r-- | misc/win32/start.c | 6 | ||||
-rw-r--r-- | network_io/unix/sockaddr.c | 10 | ||||
-rw-r--r-- | network_io/win32/sendrecv.c | 21 | ||||
-rw-r--r-- | passwd/apr_getpass.c | 4 | ||||
-rw-r--r-- | shmem/win32/shm.c | 26 | ||||
-rw-r--r-- | threadproc/win32/thread.c | 13 | ||||
-rw-r--r-- | time/win32/time.c | 19 | ||||
-rw-r--r-- | time/win32/timestr.c | 8 | ||||
-rw-r--r-- | user/win32/groupinfo.c | 10 | ||||
-rw-r--r-- | user/win32/userinfo.c | 23 |
20 files changed, 6 insertions, 270 deletions
diff --git a/dso/win32/dso.c b/dso/win32/dso.c index ca010fdff..5193c8553 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -56,9 +56,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, { HINSTANCE os_handle; apr_status_t rv; -#ifndef _WIN32_WCE DWORD em; -#endif apr_wchar_t wpath[APR_PATH_MAX]; if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath) @@ -68,30 +66,22 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, return ((*res_handle)->load_error = rv); } /* Prevent ugly popups from killing our app */ -#ifndef _WIN32_WCE if (!SetThreadErrorMode(SEM_FAILCRITICALERRORS, &em)) { *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); return ((*res_handle)->load_error = apr_get_os_error()); } -#endif os_handle = LoadLibraryExW(wpath, NULL, 0); if (!os_handle) os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!os_handle) { -#ifndef _WIN32_WCE rv = apr_get_os_error(); os_handle = LoadLibraryExW(wpath, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR); if (os_handle) { rv = APR_SUCCESS; } -#else - rv = apr_get_os_error(); -#endif } -#ifndef _WIN32_WCE SetThreadErrorMode(em, NULL); -#endif *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); (*res_handle)->cont = ctx; @@ -117,24 +107,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, struct apr_dso_handle_t *handle, const char *symname) { -#ifdef _WIN32_WCE - apr_size_t symlen = strlen(symname) + 1; - apr_size_t wsymlen = symlen; - apr_wchar_t wsymname[wsymlen]; - apr_status_t rv; - - rv = apr_conv_utf8_to_utf16(wsymname, &wsymlen, symname, &symlen); - if (rv != APR_SUCCESS) { - return rv; - } - else if (symlen) { - return APR_ENAMETOOLONG; - } - - *ressym = (apr_dso_handle_sym_t)GetProcAddressW(handle->handle, wsymname); -#else *ressym = (apr_dso_handle_sym_t)GetProcAddress(handle->handle, symname); -#endif if (!*ressym) { return apr_get_os_error(); } diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 662786421..4e885fddc 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -26,9 +26,6 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else HANDLE hproc = GetCurrentProcess(); HANDLE newhand = NULL; @@ -63,15 +60,11 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); #endif return APR_SUCCESS; -#endif /* !defined(_WIN32_WCE) */ } APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else HANDLE hproc = GetCurrentProcess(); HANDLE newhand = NULL; apr_int32_t newflags; @@ -183,7 +176,6 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, #endif return APR_SUCCESS; -#endif /* !defined(_WIN32_WCE) */ } APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index e08e08a7a..708099a91 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -18,10 +18,6 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) { -#ifdef _WIN32_WCE - /* The File locking is unsuported on WCE */ - return APR_ENOTIMPL; -#else const DWORD len = 0xffffffff; DWORD flags; @@ -59,14 +55,10 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) } return APR_SUCCESS; -#endif /* !defined(_WIN32_WCE) */ } APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else DWORD len = 0xffffffff; if (apr_os_level >= APR_WIN_NT) { @@ -82,5 +74,4 @@ APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) } return APR_SUCCESS; -#endif /* !defined(_WIN32_WCE) */ } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index cf95567e1..864af587c 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -543,12 +543,8 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, topath))) { return rv; } -#ifndef _WIN32_WCE if (MoveFileExW(wfrompath, wtopath, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) -#else - if (MoveFileW(wfrompath, wtopath)) -#endif return APR_SUCCESS; #else if (MoveFileEx(frompath, topath, MOVEFILE_REPLACE_EXISTING | @@ -675,9 +671,6 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, apr_int32_t flags, apr_pool_t *pool) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else apr_os_file_t file_handle; apr_set_os_error(APR_SUCCESS); @@ -687,16 +680,12 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, return apr_os_file_put(thefile, &file_handle, flags | APR_FOPEN_WRITE | APR_STDERR_FLAG, pool); -#endif } APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, apr_int32_t flags, apr_pool_t *pool) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else apr_os_file_t file_handle; apr_set_os_error(APR_SUCCESS); @@ -706,16 +695,12 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, return apr_os_file_put(thefile, &file_handle, flags | APR_FOPEN_WRITE | APR_STDOUT_FLAG, pool); -#endif } APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, apr_int32_t flags, apr_pool_t *pool) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else apr_os_file_t file_handle; apr_set_os_error(APR_SUCCESS); @@ -725,7 +710,6 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, return apr_os_file_put(thefile, &file_handle, flags | APR_FOPEN_READ | APR_STDIN_FLAG, pool); -#endif } APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 16bb58665..46dd74924 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -69,9 +69,6 @@ static apr_status_t file_pipe_create(apr_file_t **in, apr_pool_t *pool_in, apr_pool_t *pool_out) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else SECURITY_ATTRIBUTES sa; static unsigned long id = 0; DWORD dwPipeMode; @@ -211,7 +208,6 @@ static apr_status_t file_pipe_create(apr_file_t **in, apr_pool_cleanup_register((*out)->pool, (void *)(*out), file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; -#endif /* _WIN32_WCE */ } APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index c43377e74..8c8b2a543 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -102,14 +102,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, */ mutexkey = res_name_from_filename(fname, 1, pool); -#if defined(_WIN32_WCE) - hMutex = CreateMutex(NULL, FALSE, mutexkey); - if (hMutex && ERROR_ALREADY_EXISTS != GetLastError()) { - CloseHandle(hMutex); - hMutex = NULL; - SetLastError(ERROR_FILE_NOT_FOUND); - } -#else #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { @@ -122,7 +114,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, hMutex = OpenMutexA(MUTEX_ALL_ACCESS, FALSE, mutexkey); } #endif -#endif if (!hMutex) { return apr_get_os_error(); diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index f106cde28..08c7a31b7 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -267,7 +267,6 @@ static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode apr_size_t len=0, i; #ifndef NETWARE -#ifndef _WIN32_WCE len = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, @@ -276,25 +275,6 @@ static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode buf, (DWORD)bufsize, NULL); -#else /* _WIN32_WCE speaks unicode */ - LPTSTR msg = (LPTSTR) buf; - len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM - | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - errcode, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ - msg, - (DWORD) (bufsize/sizeof(TCHAR)), - NULL); - /* in-place convert to US-ASCII, substituting '?' for non ASCII */ - for(i = 0; i <= len; i++) { - if (msg[i] < 0x80 && msg[i] >= 0) { - buf[i] = (char) msg[i]; - } else { - buf[i] = '?'; - } - } -#endif #endif if (!len) { @@ -410,11 +390,6 @@ static char *native_strerror(apr_status_t statcode, char *buf, static char *native_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) { -#ifdef _WIN32_WCE - static char err[32]; - sprintf(err, "Native Error #%d", statcode); - return stuffbuffer(buf, bufsize, err); -#else const char *err = strerror(statcode); if (err) { return stuffbuffer(buf, bufsize, err); @@ -422,7 +397,6 @@ static char *native_strerror(apr_status_t statcode, char *buf, return stuffbuffer(buf, bufsize, "APR does not understand this error code"); } -#endif } #endif diff --git a/misc/win32/charset.c b/misc/win32/charset.c index 41135b25d..a09914a00 100644 --- a/misc/win32/charset.c +++ b/misc/win32/charset.c @@ -30,11 +30,7 @@ APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) #ifdef _UNICODE int i; #endif -#if defined(_WIN32_WCE) - LCID locale = GetUserDefaultLCID(); -#else LCID locale = GetThreadLocale(); -#endif int len = GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, NULL, 0); char *cp = apr_palloc(pool, (len * sizeof(TCHAR)) + 2); if (0 < GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, (TCHAR*) (cp + 2), len)) diff --git a/misc/win32/env.c b/misc/win32/env.c index 39af0878e..3712309b9 100644 --- a/misc/win32/env.c +++ b/misc/win32/env.c @@ -24,7 +24,7 @@ #include "apr_pools.h" #include "apr_strings.h" -#if APR_HAS_UNICODE_FS && !defined(_WIN32_WCE) +#if APR_HAS_UNICODE_FS static apr_status_t widen_envvar_name (apr_wchar_t *buffer, apr_size_t bufflen, const char *envvar) @@ -46,9 +46,6 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar, apr_pool_t *pool) { -#if defined(_WIN32_WCE) - return APR_ENOTIMPL; -#else char *val = NULL; DWORD size; @@ -114,7 +111,6 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, *value = val; return APR_SUCCESS; -#endif } @@ -122,9 +118,6 @@ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, const char *value, apr_pool_t *pool) { -#if defined(_WIN32_WCE) - return APR_ENOTIMPL; -#else #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { @@ -156,15 +149,11 @@ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, #endif return APR_SUCCESS; -#endif } APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool) { -#if defined(_WIN32_WCE) - return APR_ENOTIMPL; -#else #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { @@ -188,5 +177,4 @@ APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool) #endif return APR_SUCCESS; -#endif } diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 5631d2c9e..295a08fb0 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -104,17 +104,6 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) apr_os_level = APR_WIN_10; } } -#ifdef _WIN32_WCE - else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_CE) - { - if (oslev.dwMajorVersion < 3) { - apr_os_level = APR_WIN_UNSUP; - } - else { - apr_os_level = APR_WIN_CE_3; - } - } -#endif else { apr_os_level = APR_WIN_UNSUP; } @@ -187,19 +176,11 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) return NULL; } -#if defined(_WIN32_WCE) - if (ordinal) - return GetProcAddressA(cached_dll_handle, - (const char *) (apr_ssize_t)ordinal); - else - return GetProcAddressA(cached_dll_handle, fnName); -#else if (ordinal) return GetProcAddress(cached_dll_handle, (const char *) (apr_ssize_t)ordinal); else return GetProcAddress(cached_dll_handle, fnName); -#endif } DWORD apr_wait_for_single_object(HANDLE handle, apr_interval_time_t timeout) diff --git a/misc/win32/start.c b/misc/win32/start.c index df60283e1..1def000ae 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -30,7 +30,6 @@ */ int APR_DECLARE_DATA apr_app_init_complete = 0; -#if !defined(_WIN32_WCE) /* Used by apr_app_initialize to reprocess the environment * * An internal apr function to convert a double-null terminated set @@ -91,7 +90,6 @@ static int warrsztoastr(const char * const * *retarr, return args; } -#endif /* Reprocess the arguments to main() for a completely apr-ized application */ @@ -106,9 +104,7 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, return rv; } -#if defined(_WIN32_WCE) - apr_app_init_complete = 1; -#elif APR_HAS_UNICODE_FS +#if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { apr_wchar_t **wstrs; diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 1c807a10b..5cee61933 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -75,16 +75,6 @@ struct apr_ipsubnet_t { #define AIX_SERVNAME_HACK 0 #endif -#ifdef _WIN32_WCE -/* XXX: BS solution. Need an HAVE_GETSERVBYNAME and actually - * do something here, to provide the obvious proto mappings. - */ -static void *getservbyname(const char *name, const char *proto) -{ - return NULL; -} -#endif - static apr_status_t get_local_addr(apr_socket_t *sock) { sock->local_addr->salen = sizeof(sock->local_addr->sa); diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index ccae8c6a2..20d802042 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -47,12 +47,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, wsaData.len = (u_long)*len; wsaData.buf = (char*) buf; -#ifndef _WIN32_WCE rv = WSASend(sock->socketdes, &wsaData, 1, &dwBytes, 0, NULL, NULL); -#else - rv = send(sock->socketdes, wsaData.buf, wsaData.len, 0); - dwBytes = rv; -#endif if (rv == SOCKET_ERROR) { lasterror = apr_get_netos_error(); *len = 0; @@ -77,12 +72,7 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, wsaData.len = (u_long)*len; wsaData.buf = (char*) buf; -#ifndef _WIN32_WCE rv = WSARecv(sock->socketdes, &wsaData, 1, &dwBytes, &flags, NULL, NULL); -#else - rv = recv(sock->socketdes, wsaData.buf, wsaData.len, 0); - dwBytes = rv; -#endif if (rv == SOCKET_ERROR) { lasterror = apr_get_netos_error(); *len = 0; @@ -140,21 +130,10 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, } while (cur_len > 0); } -#ifndef _WIN32_WCE rv = WSASend(sock->socketdes, pWsaBuf, nvec, &dwBytes, 0, NULL, NULL); if (rv == SOCKET_ERROR) { rc = apr_get_netos_error(); } -#else - for (i = 0; i < nvec; i++) { - rv = send(sock->socketdes, pWsaBuf[i].buf, pWsaBuf[i].len, 0); - if (rv == SOCKET_ERROR) { - rc = apr_get_netos_error(); - break; - } - dwBytes += rv; - } -#endif if (nvec > WSABUF_ON_STACK) free(pWsaBuf); diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 6e4cbef3a..5426b8a36 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -113,9 +113,6 @@ static char *get_password(const char *prompt) * The only way is to use the GUI so the getpass should be implemented * on per-application basis. */ -#ifdef _WIN32_WCE - return NULL; -#else static char password[128]; int n = 0; int ch; @@ -169,7 +166,6 @@ static char *get_password(const char *prompt) fputc('\n', stderr); password[n] = '\0'; return password; -#endif } #elif defined (HAVE_TERMIOS_H) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 0ca8247f9..48b33b8b8 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -153,9 +153,7 @@ APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m, if (!file) { /* Do Anonymous, which must be passed as a duplicated handle */ -#ifndef _WIN32_WCE hFile = INVALID_HANDLE_VALUE; -#endif mapkey = NULL; } else { @@ -293,15 +291,7 @@ static apr_status_t shm_attach_internal(apr_shm_t **m, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { -#ifndef _WIN32_WCE hMap = OpenFileMappingW(FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapkey); -#else - /* The WCE 3.0 lacks OpenFileMapping. So we emulate one with - * opening the existing shmem and reading its size from the header - */ - hMap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, - PAGE_READWRITE, 0, sizeof(apr_shm_t), mapkey); -#endif } #endif #if APR_HAS_ANSI_FS @@ -326,22 +316,6 @@ static apr_status_t shm_attach_internal(apr_shm_t **m, (*m)->memblk = base; /* Real (*m)->mem->size could be recovered with VirtualQuery */ (*m)->size = (*m)->memblk->size; -#if _WIN32_WCE - /* Reopen with real size */ - UnmapViewOfFile(base); - CloseHandle(hMap); - - hMap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, - PAGE_READWRITE, 0, (*m)->size, mapkey); - if (!hMap) { - return apr_get_os_error(); - } - base = MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); - if (!base) { - CloseHandle(hMap); - return apr_get_os_error(); - } -#endif (*m)->hMap = hMap; (*m)->length = (*m)->memblk->length; (*m)->usrmem = (char*)base + sizeof(memblock_t); diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index b5a6f1722..3f9880b6a 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -138,21 +138,12 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, /* Use 0 for default Thread Stack Size, because that will * default the stack to the same size as the calling thread. */ -#ifndef _WIN32_WCE if ((handle = (HANDLE)_beginthreadex(NULL, (DWORD) (attr ? attr->stacksize : 0), (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, (*new), 0, &temp)) == 0) { return APR_FROM_OS_ERROR(_doserrno); } -#else - if ((handle = CreateThread(NULL, - attr && attr->stacksize > 0 ? attr->stacksize : 0, - (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, - (*new), 0, &temp)) == 0) { - return apr_get_os_error(); - } -#endif if (attr && attr->detach) { CloseHandle(handle); } @@ -169,11 +160,7 @@ APR_DECLARE(void) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) if (!thd->td) { /* detached? */ apr_pool_destroy(thd->pool); } -#ifndef _WIN32_WCE _endthreadex(0); -#else - ExitThread(0); -#endif } APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, diff --git a/time/win32/time.c b/time/win32/time.c index ac75b7b6f..b83b64eb5 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -91,13 +91,8 @@ APR_DECLARE(apr_time_t) apr_time_now(void) { LONGLONG aprtime = 0; FILETIME time; -#ifndef _WIN32_WCE + GetSystemTimeAsFileTime(&time); -#else - SYSTEMTIME st; - GetSystemTime(&st); - SystemTimeToFileTime(&st, &time); -#endif FileTimeToAprTime(&aprtime, &time); return aprtime; } @@ -144,7 +139,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, AprTimeToFileTime(&ft, input); -#if APR_HAS_UNICODE_FS && !defined(_WIN32_WCE) +#if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { TIME_ZONE_INFORMATION *tz; @@ -184,7 +179,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, - (-(tz->Bias + tz->StandardBias) / 60); } #endif -#if APR_HAS_ANSI_FS || defined(_WIN32_WCE) +#if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { TIME_ZONE_INFORMATION tz; @@ -317,13 +312,6 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t) Sleep((DWORD)(t / 1000)); } -#if defined(_WIN32_WCE) -/* A noop on WinCE, like Unix implementation */ -APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) -{ - return; -} -#else static apr_status_t clock_restore(void *unsetres) { ULONG newRes; @@ -343,4 +331,3 @@ APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) apr_pool_cleanup_null); } } -#endif diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 138412352..4fbdf825f 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -122,8 +122,6 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t) } -#ifndef _WIN32_WCE - static apr_size_t win32_strftime_extra(char *s, size_t max, const char *format, const struct tm *tm) { @@ -193,16 +191,11 @@ static apr_size_t win32_strftime_extra(char *s, size_t max, const char *format, return return_value; } -#endif - APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_time_exp_t *xt) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else struct tm tm; memset(&tm, 0, sizeof tm); tm.tm_sec = xt->tm_sec; @@ -216,5 +209,4 @@ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, tm.tm_isdst = xt->tm_isdst; (*retsize) = win32_strftime_extra(s, max, format, &tm); return APR_SUCCESS; -#endif } diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index b53656962..115e8e956 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -25,9 +25,6 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *gid, const char *groupname, apr_pool_t *p) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else SID_NAME_USE sidtype; char anydomain[256]; char *domain; @@ -63,14 +60,10 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *gid, return apr_get_os_error(); } return APR_SUCCESS; -#endif } APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) { -#ifdef _WIN32_WCE - *groupname = apr_pstrdup(p, "Administrators"); -#else SID_NAME_USE type; char name[MAX_PATH], domain[MAX_PATH]; DWORD cbname = sizeof(name), cbdomain = sizeof(domain); @@ -82,7 +75,6 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, && type != SidTypeAlias) return APR_EINVAL; *groupname = apr_pstrdup(p, name); -#endif return APR_SUCCESS; } @@ -90,11 +82,9 @@ APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right) { if (!left || !right) return APR_EINVAL; -#ifndef _WIN32_WCE if (!IsValidSid(left) || !IsValidSid(right)) return APR_EINVAL; if (!EqualSid(left, right)) return APR_EMISMATCH; -#endif return APR_SUCCESS; } diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 89f9b8cf0..ad8d85952 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -23,7 +23,6 @@ #include <sys/types.h> #endif -#ifndef _WIN32_WCE /* Internal sid binary to string translation, see MSKB Q131320. * Several user related operations require our SID to access * the registry, but in a string format. All error handling @@ -60,7 +59,7 @@ static void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id) *GetSidSubAuthority(id, sa)); } } -#endif + /* Query the ProfileImagePath from the version-specific branch, where the * regkey uses the user's name on 9x, and user's sid string on NT. */ @@ -68,10 +67,6 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, const char *username, apr_pool_t *p) { -#ifdef _WIN32_WCE - *dirname = apr_pstrdup(p, "/My Documents"); - return APR_SUCCESS; -#else apr_status_t rv; char regkey[MAX_PATH * 2]; char *fixch; @@ -157,16 +152,12 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, if (*fixch == '\\') *fixch = '/'; return APR_SUCCESS; -#endif /* _WIN32_WCE */ } APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, apr_gid_t *gid, apr_pool_t *p) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else HANDLE threadtok; DWORD needed; TOKEN_USER *usr; @@ -205,15 +196,11 @@ APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, CloseHandle(threadtok); return APR_SUCCESS; -#endif } APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, const char *username, apr_pool_t *p) { -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else SID_NAME_USE sidtype; char anydomain[256]; char *domain; @@ -252,16 +239,11 @@ APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, */ *gid = NULL; return APR_SUCCESS; -#endif } APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, apr_pool_t *p) { -#ifdef _WIN32_WCE - *username = apr_pstrdup(p, "Administrator"); - return APR_SUCCESS; -#else SID_NAME_USE type; char name[MAX_PATH], domain[MAX_PATH]; DWORD cbname = sizeof(name), cbdomain = sizeof(domain); @@ -273,19 +255,16 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, return APR_EINVAL; *username = apr_pstrdup(p, name); return APR_SUCCESS; -#endif } APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right) { if (!left || !right) return APR_EINVAL; -#ifndef _WIN32_WCE if (!IsValidSid(left) || !IsValidSid(right)) return APR_EINVAL; if (!EqualSid(left, right)) return APR_EMISMATCH; -#endif return APR_SUCCESS; } |