OSDN Git Service

* autoload.cc (dll_load): Make inline. Clarify logic.
authorcgf <cgf>
Tue, 1 Mar 2011 05:55:10 +0000 (05:55 +0000)
committercgf <cgf>
Tue, 1 Mar 2011 05:55:10 +0000 (05:55 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/autoload.cc

index 2ec23cf..a80a741 100644 (file)
@@ -1,3 +1,7 @@
+2011-02-28  Christopher Faylor  <me+cygwin@cgf.cx>
+
+       * autoload.cc (dll_load): Make inline.  Clarify logic.
+
 2011-02-27  Corinna Vinschen  <corinna@vinschen.de>
 
        * autoload.cc (dll_load): Only call LoadLibraryExW with
index f6e7648..e3c7191 100644 (file)
@@ -212,13 +212,16 @@ union retchain
 
   To wit: winmm.dll calls FreeLibrary in its DllMain and that can result
   in LoadLibraryExW returning an ERROR_INVALID_ADDRESS.  */
-static bool
+static __inline bool
 dll_load (HANDLE& handle, WCHAR *name)
 {
   HANDLE h = LoadLibraryW (name);
   if (!h && in_forkee && handle && GetLastError () == ERROR_INVALID_ADDRESS)
     h = LoadLibraryExW (name, NULL, DONT_RESOLVE_DLL_REFERENCES);
-  return h ? (handle = h) : 0;
+  if (!h)
+    return false;
+  handle = h;
+  return true;
 }
 
 #define RETRY_COUNT 10
@@ -407,7 +410,7 @@ LoadDLLfunc (LsaFreeReturnBuffer, 4, secur32)
 LoadDLLfunc (LsaLogonUser, 56, secur32)
 LoadDLLfunc (LsaLookupAuthenticationPackage, 12, secur32)
 /* secur32 functions return NTSTATUS values.  However, the error code must
-   fit in a single word, see LoadDLLprime.
+   fit in 16 bits , see LoadDLLprime.
    The calling function, lsaauth(), checks for STATUS_SUCCESS (0), so we
    simply return some arbitrary non-0 value (127 == ERROR_PROC_NOT_FOUND)
    from here, if the function can't be loaded. */