changeset 22476:50225df605b5

Support function lookup via ordinal
author reimar
date Thu, 08 Mar 2007 22:29:00 +0000
parents 9edc4cfaeaed
children e305132d083b
files loader/win32.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/loader/win32.c	Thu Mar 08 22:25:13 2007 +0000
+++ b/loader/win32.c	Thu Mar 08 22:29:00 2007 +0000
@@ -2435,7 +2435,10 @@
     default:
 	result=GetProcAddress(mod, name);
     }
-    dbgprintf("GetProcAddress(0x%x, '%s') => 0x%x\n", mod, name, result);
+    if((unsigned int)name > 0xffff)
+	dbgprintf("GetProcAddress(0x%x, '%s') => 0x%x\n", mod, name, result);
+    else
+	dbgprintf("GetProcAddress(0x%x, '%d') => 0x%x\n", mod, (int)name, result);
     return result;
 }
 
@@ -5419,10 +5422,9 @@
 	printf("ERROR: library=0\n");
 	return (void*)ext_unknown;
     }
-    if(name==0)
+    if((unsigned long)name<=0xffff)
     {
-	printf("ERROR: name=0\n");
-	return (void*)ext_unknown;
+	return LookupExternal(library, (int)name);
     }
     dbgprintf("External func %s:%s\n", library, name);
     for(i=0; i<sizeof(libraries)/sizeof(struct libs); i++)