changeset 22475:9edc4cfaeaed

Allow declaring special undefined functions that will return NULL instead of a pointer to a stub.
author reimar
date Thu, 08 Mar 2007 22:25:13 +0000
parents f5c234c87e5f
children 50225df605b5
files loader/win32.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/loader/win32.c	Thu Mar 08 21:05:14 2007 +0000
+++ b/loader/win32.c	Thu Mar 08 22:25:13 2007 +0000
@@ -4859,6 +4859,9 @@
 #define FF(X,Y) \
     {#X, Y, (void*)exp##X},
 
+#define UNDEFF(X, Y) \
+    {#X, Y, (void*)-1},
+
 struct exports exp_kernel32[]=
 {
     FF(GetVolumeInformationA,-1)
@@ -5015,6 +5018,10 @@
     {"LoadLibraryExA", -1, (void*)&LoadLibraryExA},
     FF(SetThreadIdealProcessor,-1)
     FF(SetProcessAffinityMask, -1)
+    UNDEFF(FlsAlloc, -1)
+    UNDEFF(FlsGetValue, -1)
+    UNDEFF(FlsSetValue, -1)
+    UNDEFF(FlsFree, -1)
 };
 
 struct exports exp_msvcrt[]={
@@ -5426,6 +5433,8 @@
 	{
 	    if(strcmp(name, libraries[i].exps[j].name))
 		continue;
+ 	    if((unsigned int)(libraries[i].exps[j].func) == -1)
+		return NULL; //undefined func
 	    //	    printf("Hit: 0x%08X\n", libraries[i].exps[j].func);
 	    return libraries[i].exps[j].func;
 	}