aboutsummaryrefslogtreecommitdiffhomepage
path: root/loader
diff options
context:
space:
mode:
authorGravatar arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-07-29 16:44:37 +0000
committerGravatar arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-07-29 16:44:37 +0000
commiteb022882bf9c7beb4fb6c4cb7d19074c5b9cc13e (patch)
treeeb9f36cf81a7f924c26ffed5bbd1acd61d0dcbdc /loader
parent0ac4042c147d2a5148c3aafef3564f8fc1206200 (diff)
partial avifile-CVS merge
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1417 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader')
-rw-r--r--loader/registry.c32
-rw-r--r--loader/win32.c16
2 files changed, 41 insertions, 7 deletions
diff --git a/loader/registry.c b/loader/registry.c
index 9c6b0a6450..b2234c9119 100644
--- a/loader/registry.c
+++ b/loader/registry.c
@@ -405,13 +405,43 @@ long RegCreateKeyExA(long key, const char* name, long reserved,
// 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;
diff --git a/loader/win32.c b/loader/win32.c
index 848616b2a0..833a6e9339 100644
--- a/loader/win32.c
+++ b/loader/win32.c
@@ -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 @@ int WINAPI expLoadLibraryA(char* name)
// 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 expIsBadStringPtrW(const short* string, int nchars)
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);
@@ -2451,8 +2452,11 @@ WIN_BOOL
// 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;
}