*/
LONG rc;
DWORD type;
- DWORD size = 0;
+ apr_size_t size = 0;
#if APR_HAS_UNICODE_FS
IF_WIN_OS_IS_UNICODE
else if (valuelen)
return APR_ENAMETOOLONG;
/* Read to NULL buffer to determine value size */
- rc = RegQueryValueExW(key->hkey, wvalname, 0, &type, NULL, &size);
+ rc = RegQueryValueExW(key->hkey, wvalname, 0, &type, NULL, (DWORD *)&size);
if (rc != ERROR_SUCCESS) {
return APR_FROM_OS_ERROR(rc);
}
wvalue = apr_palloc(pool, size);
/* Read value based on size query above */
rc = RegQueryValueExW(key->hkey, wvalname, 0, &type,
- (LPBYTE)wvalue, &size);
+ (LPBYTE)wvalue, (DWORD *)&size);
if (rc != ERROR_SUCCESS) {
return APR_FROM_OS_ERROR(rc);
}
apr_wchar_t *tmp = wvalue;
/* The size returned by ExpandEnvironmentStringsW is wchars */
wvalue = apr_palloc(pool, size * 2);
- size = ExpandEnvironmentStringsW(tmp, wvalue, size);
+ size = ExpandEnvironmentStringsW(tmp, wvalue, (DWORD)size);
}
}
else {
ELSE_WIN_OS_IS_ANSI
{
/* Read to NULL buffer to determine value size */
- rc = RegQueryValueEx(key->hkey, valuename, 0, &type, NULL, &size);
+ rc = RegQueryValueEx(key->hkey, valuename, 0, &type, NULL, (DWORD *)&size);
if (rc != ERROR_SUCCESS)
return APR_FROM_OS_ERROR(rc);
*result = apr_palloc(pool, size);
/* Read value based on size query above */
- rc = RegQueryValueEx(key->hkey, valuename, 0, &type, *result, &size);
+ rc = RegQueryValueEx(key->hkey, valuename, 0, &type, *result, (DWORD *)&size);
if (rc != ERROR_SUCCESS)
return APR_FROM_OS_ERROR(rc);
if (size) {
char *tmp = *result;
*result = apr_palloc(pool, size);
- size = ExpandEnvironmentStrings(tmp, *result, size);
+ size = ExpandEnvironmentStrings(tmp, *result, (DWORD)size);
}
}
}
* that the system has configured (e.g. %SystemRoot%/someapp.exe)
*/
LONG rc;
- DWORD size = strlen(value) + 1;
+ apr_size_t size = strlen(value) + 1;
DWORD type = (flags & AP_REGKEY_EXPAND) ? REG_EXPAND_SZ : REG_SZ;
#if APR_HAS_UNICODE_FS
*/
size = (alloclen - wvallen) * 2;
rc = RegSetValueExW(key->hkey, wvalname, 0, type,
- (LPBYTE)wvalue, size);
+ (LPBYTE)wvalue, (DWORD)size);
if (rc != ERROR_SUCCESS)
return APR_FROM_OS_ERROR(rc);
}
#if APR_HAS_ANSI_FS
ELSE_WIN_OS_IS_ANSI
{
- rc = RegSetValueEx(key->hkey, valuename, 0, type, value, size);
+ rc = RegSetValueEx(key->hkey, valuename, 0, type, value, (DWORD)size);
if (rc != ERROR_SUCCESS)
return APR_FROM_OS_ERROR(rc);
}
return APR_ENAMETOOLONG;
/* Read to NULL buffer to determine value size */
rc = RegQueryValueExW(key->hkey, wvalname, 0, resulttype,
- NULL, resultsize);
+ NULL, (LPDWORD)resultsize);
if (rc != ERROR_SUCCESS) {
return APR_FROM_OS_ERROR(rc);
}
/* Read value based on size query above */
*result = apr_palloc(pool, *resultsize);
rc = RegQueryValueExW(key->hkey, wvalname, 0, resulttype,
- (LPBYTE)*result, resultsize);
+ (LPBYTE)*result, (LPDWORD)resultsize);
}
#endif /* APR_HAS_UNICODE_FS */
#if APR_HAS_ANSI_FS
{
/* Read to NULL buffer to determine value size */
rc = RegQueryValueEx(key->hkey, valuename, 0, resulttype,
- NULL, resultsize);
+ NULL, (LPDWORD)resultsize);
if (rc != ERROR_SUCCESS)
return APR_FROM_OS_ERROR(rc);
/* Read value based on size query above */
*result = apr_palloc(pool, *resultsize);
rc = RegQueryValueEx(key->hkey, valuename, 0, resulttype,
- (LPBYTE)*result, resultsize);
+ (LPBYTE)*result, (LPDWORD)resultsize);
if (rc != ERROR_SUCCESS)
return APR_FROM_OS_ERROR(rc);
}
return APR_ENAMETOOLONG;
rc = RegSetValueExW(key->hkey, wvalname, 0, valuetype,
- (LPBYTE)value, valuesize);
+ (LPBYTE)value, (DWORD)valuesize);
}
#endif /* APR_HAS_UNICODE_FS */
#if APR_HAS_ANSI_FS
ELSE_WIN_OS_IS_ANSI
{
rc = RegSetValueEx(key->hkey, valuename, 0, valuetype,
- (LPBYTE)value, valuesize);
+ (LPBYTE)value, (DWORD)valuesize);
}
#endif
if (rc != ERROR_SUCCESS) {
char *buf;
char *tmp;
DWORD type;
- DWORD size = 0;
+ apr_size_t size = 0;
rv = ap_regkey_value_raw_get(&value, &size, &type, key, valuename, pool);
if (rv != APR_SUCCESS) {
}
}
- *result = apr_array_make(pool, size, sizeof(char *));
+ *result = apr_array_make(pool, (int)size, sizeof(char *));
for (tmp = buf; *tmp; ++tmp) {
char **newelem = (char **) apr_array_push(*result);
*newelem = tmp;
{
int rc;
DWORD BytesRead;
- DWORD CompKey;
LPOVERLAPPED pol;
+#ifdef _WIN64
+ ULONG_PTR CompKey;
+#else
+ DWORD CompKey;
+#endif
mpm_recycle_completion_context(context);
* Main entry point for the worker threads. Worker threads block in
* win*_get_connection() awaiting a connection to service.
*/
-static void worker_main(long thread_num)
+static void worker_main(long *thread_num_)
{
static int requests_this_child = 0;
PCOMP_CONTEXT context = NULL;
+ long thread_num = *thread_num_;
ap_sb_handle_t *sbh;
ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, ap_server_conf,
HANDLE *child_handles;
int rv;
time_t end_time;
- int i;
+ long i;
int cld;
apr_pool_create(&pchild, pconf);
*/
ap_log_error(APLOG_MARK,APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
"Child %d: Starting %d worker threads.", my_pid, ap_threads_per_child);
- child_handles = (HANDLE) apr_pcalloc(pchild, ap_threads_per_child * sizeof(int));
+ child_handles = (HANDLE) apr_pcalloc(pchild, ap_threads_per_child * sizeof(HANDLE));
apr_thread_mutex_create(&child_lock, APR_THREAD_MUTEX_DEFAULT, pchild);
while (1) {
ap_update_child_status_from_indexes(0, i, SERVER_STARTING, NULL);
child_handles[i] = (HANDLE) _beginthreadex(NULL, (unsigned)ap_thread_stacksize,
(LPTHREAD_START_ROUTINE) worker_main,
- (void *) i, 0, &tid);
+ (void *) &i, 0, &tid);
if (child_handles[i] == 0) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf,
"Child %d: _beginthreadex failed. Unable to create all worker threads. "
"Child %d: Waiting for %d worker threads to exit.", my_pid, threads_created);
end_time = time(NULL) + 180;
while (threads_created) {
- rv = wait_for_many_objects(threads_created, child_handles, end_time - time(NULL));
+ rv = wait_for_many_objects(threads_created, child_handles, (DWORD)(end_time - time(NULL)));
if (rv != WAIT_TIMEOUT) {
rv = rv - WAIT_OBJECT_0;
ap_assert((rv >= 0) && (rv < threads_created));