diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-02-27 09:45:58 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-02-27 09:45:58 +0000 |
commit | 7b5dc6db8ed9e23c315d5ebb0dcbac1f13a847d0 (patch) | |
tree | 4ec781916861d4a24d103a98af0db990ed16ca45 /winsup/cygwin/autoload.cc | |
parent | a16b0549d49af27bb6e71e97f2b5b7c219bba0ca (diff) | |
download | cygnal-7b5dc6db8ed9e23c315d5ebb0dcbac1f13a847d0.tar.gz cygnal-7b5dc6db8ed9e23c315d5ebb0dcbac1f13a847d0.tar.bz2 cygnal-7b5dc6db8ed9e23c315d5ebb0dcbac1f13a847d0.zip |
* autoload.cc (dll_load): Only call LoadLibraryExW with
DONT_RESOLVE_DLL_REFERENCES if a normal LoadLibrary call failed with
ERROR_INVALID_ADDRESS.
(LsaRegisterLogonProcess): Align comment to previous change.
Diffstat (limited to 'winsup/cygwin/autoload.cc')
-rw-r--r-- | winsup/cygwin/autoload.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index d9732765b..f6e764851 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -215,7 +215,9 @@ union retchain static bool dll_load (HANDLE& handle, WCHAR *name) { - HANDLE h = LoadLibraryExW (name, NULL, (in_forkee && handle) ? DONT_RESOLVE_DLL_REFERENCES : 0); + 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; } @@ -405,7 +407,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 byte, see LoadDLLprime. + fit in a single word, 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. */ |