[Mplayer-cvslog] CVS: main/loader registry.c,1.6,1.7 win32.c,1.15,1.16

Arpi of Ize arpi at mplayer.dev.hu
Sun Jul 29 18:44:39 CEST 2001


Update of /cvsroot/mplayer/main/loader
In directory mplayer:/var/tmp.root/cvs-serv26170

Modified Files:
	registry.c win32.c 
Log Message:
partial avifile-CVS merge

Index: registry.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/registry.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- registry.c	12 Jul 2001 15:27:47 -0000	1.6
+++ registry.c	29 Jul 2001 16:44:37 -0000	1.7
@@ -405,13 +405,43 @@
 //		return 0;
 	}
 	else
-		if (status) *status=REG_OPENED_EXISTING_KEY;
+	{
+            // this is a hack as I don't know how RegEnumValueA works
+	    if (strstr(fullname, "zlib") || strstr(fullname, "mszh"))
+                return 1;
+	    if (status) *status=REG_OPENED_EXISTING_KEY;
+	}
 
 	t=insert_handle(generate_handle(), fullname);
 	*newkey=t->handle;
 	free(fullname);
 	return 0;
 }
+
+long RegEnumValueA(HKEY hkey, DWORD index, LPSTR value, LPDWORD val_count,
+		   LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count)
+{
+    // have no idea how this should work
+    //printf("Reg Enum 0x%x %d  %p %d   data: %p %d  %d >%s<\n", hkey, index, value, *val_count, data, *count, reg_size, data);
+    {
+	reg_handle_t* t = find_handle(hkey);
+	if (t)
+	{
+	    struct reg_value* v=find_value_by_name(t->name);
+            *count = v->len;
+	    memcpy(data, v->value, *count);
+            *val_count = v->len;
+	    memcpy(value, v->value, *val_count);
+            if (type)
+		*type = v->type;
+	    //printf("Found handle  %s\n", v->name);
+            return 0;
+	}
+    }
+
+    return -1;
+}
+
 long RegSetValueExA(long key, const char* name, long v1, long v2, const void* data, long size)
 {
     struct reg_value* t;

Index: win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- win32.c	12 Jul 2001 15:27:47 -0000	1.15
+++ win32.c	29 Jul 2001 16:44:37 -0000	1.16
@@ -43,6 +43,9 @@
 #include <loader.h>
 #include <com.h>
 
+long RegEnumValueA(HKEY hkey, DWORD index, LPSTR value, LPDWORD val_count,
+		   LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count);
+
 char* def_path=WIN32_PATH;
 
 static void do_cpuid(unsigned int *regs)
@@ -1664,14 +1667,12 @@
 //    printf("LoadLibrary wants: %s/%s\n", def_path, name);
 
     if(strncmp(name, "c:\\windows\\", 11)==0)name+=11;
+    if(strncmp(name, ".\\", 2)==0) name += 2;
     if(name[0]!='/')
     {
 	strcpy(qq, def_path);
 	strcat(qq, "/");
-	if(strncmp(name, ".\\", 2)==0)
-	    strcat(qq, name+2);
-	else
-	    strcat(qq, name);
+	strcat(qq, name);
     }
     printf("Loading DLL: %s", qq);fflush(stdout);
 //    printf("Entering LoadLibraryA(%s)\n", name);
@@ -2011,7 +2012,7 @@
 
 int WINAPI expIsBadStringPtrA(const char* string, int nchars)
 {
-    int result;
+    int result=0;
 //    if(string==0)result=1; else result=0;
 //    dbgprintf("IsBadStringPtrW(0x%x, %d) => %d", string, nchars, result);
 //    if(string)wch_print(string);
@@ -2447,8 +2448,11 @@
  
 // printf("RegEnumValueA(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
 //   hkey, index, value, val_count, reserved, type, data, count );
+// return -1;
+
+ return RegEnumValueA(hkey, index, value, val_count,
+			 reserved, type, data, count);
 
- return -1;
 }
  
 




More information about the MPlayer-cvslog mailing list