[MPlayer-cvslog] r37419 - trunk/loader/win32.c

reimar subversion at mplayerhq.hu
Wed Jun 10 23:17:34 CEST 2015


Author: reimar
Date: Wed Jun 10 23:17:34 2015
New Revision: 37419

Log:
Support undefined (NULL) pure-ordinal-only exports.

Add UNDEFORD macro for them.

Modified:
   trunk/loader/win32.c

Modified: trunk/loader/win32.c
==============================================================================
--- trunk/loader/win32.c	Wed Jun 10 23:17:33 2015	(r37418)
+++ trunk/loader/win32.c	Wed Jun 10 23:17:34 2015	(r37419)
@@ -5177,6 +5177,9 @@ struct libs
 #define UNDEFF(X, Y) \
     {#X, Y, (void*)-1},
 
+#define UNDEFORD(Y) \
+    {NULL, Y, (void*)-1},
+
 static const struct exports exp_kernel32[]=
 {
     FF(GetVolumeInformationA,-1)
@@ -5751,6 +5754,8 @@ void* LookupExternal(const char* library
 	    if(ordinal!=libraries[i].exps[j].id)
 		continue;
 	    //printf("Hit: 0x%p\n", libraries[i].exps[j].func);
+	    if((unsigned int)(libraries[i].exps[j].func) == -1)
+		return NULL; //undefined func
 	    return libraries[i].exps[j].func;
 	}
     }
@@ -5813,7 +5818,7 @@ void* LookupExternalByName(const char* l
 	    continue;
 	for(j=0; j<libraries[i].length; j++)
 	{
-	    if(strcmp(name, libraries[i].exps[j].name))
+	    if(libraries[i].exps[j].name && strcmp(name, libraries[i].exps[j].name))
 		continue;
  	    if((unsigned int)(libraries[i].exps[j].func) == -1)
 		return NULL; //undefined func


More information about the MPlayer-cvslog mailing list