diff options
author | Christopher Faylor <me@cgf.cx> | 2011-02-28 20:55:10 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-02-28 20:55:10 +0000 |
commit | 8ceb4854b6d0382aabd9a31daf1896be84fb9004 (patch) | |
tree | c886bde4302ae400508bf628fa46ed1f78e11c97 /winsup/cygwin/autoload.cc | |
parent | 87cd8d6d9d2a4acdfe3bcdffb0960dd887ecd199 (diff) | |
download | cygnal-8ceb4854b6d0382aabd9a31daf1896be84fb9004.tar.gz cygnal-8ceb4854b6d0382aabd9a31daf1896be84fb9004.tar.bz2 cygnal-8ceb4854b6d0382aabd9a31daf1896be84fb9004.zip |
* autoload.cc (dll_load): Make inline. Clarify logic.
Diffstat (limited to 'winsup/cygwin/autoload.cc')
-rw-r--r-- | winsup/cygwin/autoload.cc | 9 |
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. */ |