partial avifile-CVS merge

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1417 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2001-07-29 16:44:37 +00:00
parent 0ac4042c14
commit eb022882bf
2 changed files with 41 additions and 7 deletions

View File

@ -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;

View File

@ -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;
}