Fixes load library failure due to comparison with HINSTANCE_ERROR. LoadLibrary NSPRPUB_WINCE_04122006_BRANCH
authordougt%meer.net
Thu, 08 Jun 2006 14:51:41 +0000
branchNSPRPUB_WINCE_04122006_BRANCH
changeset 3656 9135ec8e9230
parent 3643 5cce8b47f5de
push idunknown
push userunknown
push dateunknown
Fixes load library failure due to comparison with HINSTANCE_ERROR. LoadLibrary on failure will return NULL. Patch by zhaosw@cn.ibm.com & mxlee@nlsde.buaa.edu.cn.
pr/src/linking/prlink.c
--- a/pr/src/linking/prlink.c
+++ b/pr/src/linking/prlink.c
@@ -891,17 +891,17 @@ pr_LoadLibraryByPathname(const char *nam
     if (flags & PR_LD_PATHW)
         h = LoadLibraryW(wname);
     else
         h = LoadLibraryA(name);
 #endif /* WIN95 */
 #else 
     h = LoadLibrary(name);
 #endif
-    if (h < (HINSTANCE)HINSTANCE_ERROR) {
+    if (!h) {
         oserr = _MD_ERRNO();
         PR_DELETE(lm);
         goto unlock;
     }
 #ifdef WIN32
     lm->name = strdup(utf8name);
 #else
     lm->name = strdup(name);