apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r648601 - /apr/apr/trunk/include/arch/win32/apr_arch_misc.h
Date Wed, 16 Apr 2008 07:51:52 GMT
Author: mturk
Date: Wed Apr 16 00:51:46 2008
New Revision: 648601

URL: http://svn.apache.org/viewvc?rev=648601&view=rev
Log:
Do not core if the optional function cannot be delay loaded. Return 0 and set last error to
ERROR_INVALID_FUNCTION instead

Modified:
    apr/apr/trunk/include/arch/win32/apr_arch_misc.h

Modified: apr/apr/trunk/include/arch/win32/apr_arch_misc.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/win32/apr_arch_misc.h?rev=648601&r1=648600&r2=648601&view=diff
==============================================================================
--- apr/apr/trunk/include/arch/win32/apr_arch_misc.h (original)
+++ apr/apr/trunk/include/arch/win32/apr_arch_misc.h Wed Apr 16 00:51:46 2008
@@ -182,7 +182,9 @@
 
 FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal);
 
-/* The apr_load_dll_func call WILL fault if the function cannot be loaded */
+/* The apr_load_dll_func call WILL return 0 set error to
+ * ERROR_INVALID_FUNCTION if the function cannot be loaded
+ */
 
 #define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
     typedef rettype (calltype *apr_winapi_fpt_##fn) args; \
@@ -191,7 +193,9 @@
     {   if (!apr_winapi_pfn_##fn) \
             apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \
                                       apr_load_dll_func(lib, #fn, ord); \
-        return (*(apr_winapi_pfn_##fn)) names; }; \
+        if (apr_winapi_pfn_##fn) \
+            return (*(apr_winapi_pfn_##fn)) names; \
+        else { SetLastError(ERROR_INVALID_FUNCTION); return 0;} }; \
 
 /* Provide late bound declarations of every API function missing from
  * one or more supported releases of the Win32 API



Mime
View raw message