apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/dso/win32 dso.c
Date Tue, 12 Feb 2002 01:14:15 GMT
wrowe       02/02/11 17:14:15

  Modified:    dso/win32 dso.c
  Log:
    I'm still drudging through the 36 files for WCE... sorry they are slow
    in coming :)
  
  Submitted by:	Mladen Turk <mturk@mappingsoft.com>
  
  Revision  Changes    Path
  1.28      +26 -2     apr/dso/win32/dso.c
  
  Index: dso.c
  ===================================================================
  RCS file: /home/cvs/apr/dso/win32/dso.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- dso.c	28 Jan 2002 15:56:08 -0000	1.27
  +++ dso.c	12 Feb 2002 01:14:15 -0000	1.28
  @@ -56,6 +56,7 @@
   #include "apr_strings.h"
   #include "apr_private.h"
   #include "fileio.h"
  +#include "i18n.h"
   
   #if APR_HAS_DSO
   
  @@ -86,7 +87,9 @@
   {
       HINSTANCE os_handle;
       apr_status_t rv;
  +#ifndef _WIN32_WCE
       UINT em;
  +#endif
   
   #if APR_HAS_UNICODE_FS
       IF_WIN_OS_IS_UNICODE 
  @@ -99,15 +102,19 @@
               return ((*res_handle)->load_error = rv);
           }
           /* Prevent ugly popups from killing our app */
  +#ifndef _WIN32_WCE
           em = SetErrorMode(SEM_FAILCRITICALERRORS);
  +#endif
           os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
           if (!os_handle)
               os_handle = LoadLibraryExW(wpath, NULL, 0);
           if (!os_handle)
               rv = apr_get_os_error();
  +#ifndef _WIN32_WCE
           SetErrorMode(em);
  -    }
   #endif
  +    }
  +#endif /* APR_HAS_UNICODE_FS */
   #if APR_HAS_ANSI_FS
       ELSE_WIN_OS_IS_ANSI
       {
  @@ -134,6 +141,7 @@
           SetErrorMode(em);
       }
   #endif
  +
       *res_handle = apr_pcalloc(ctx, sizeof(**res_handle));
       (*res_handle)->cont = ctx;
   
  @@ -158,8 +166,24 @@
                            struct apr_dso_handle_t *handle, 
                            const char *symname)
   {
  -    *ressym = (apr_dso_handle_sym_t)GetProcAddress(handle->handle, symname);
  +#ifdef _WIN32_WCE
  +    apr_size_t symlen = strlen(symname) + 1;
  +    apr_size_t wsymlen = 256;
  +    apr_wchar_t wsymname[256];
  +    apr_status_t rv;
  +
  +    rv = apr_conv_utf8_to_ucs2(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();
       }
  
  
  

Mime
View raw message