+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
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
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. */