summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/autoload.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/autoload.cc')
-rw-r--r--winsup/cygwin/autoload.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index f6e764851..e3c719176 100644
--- a/winsup/cygwin/autoload.cc
+++ b/winsup/cygwin/autoload.cc
@@ -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. */