diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-13 19:43:17 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-13 19:43:17 +0000 |
commit | c7eafc3610b65eafe408d4959ded4c1aab44157a (patch) | |
tree | 18e034fefe8c9e37af6f49a902ca3bfe887531c4 /loader/registry.c | |
parent | 0f6fe4b67312a11395c372831f7228fc78752714 (diff) | |
download | mpv-c7eafc3610b65eafe408d4959ded4c1aab44157a.tar.bz2 mpv-c7eafc3610b65eafe408d4959ded4c1aab44157a.tar.xz |
avifile sync - 95% cosmetics 5% bug
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7387 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader/registry.c')
-rw-r--r-- | loader/registry.c | 117 |
1 files changed, 59 insertions, 58 deletions
diff --git a/loader/registry.c b/loader/registry.c index 706b9d5d80..1fe90e0996 100644 --- a/loader/registry.c +++ b/loader/registry.c @@ -7,10 +7,10 @@ #include <pwd.h> #include <sys/types.h> -#include <wine/winbase.h> -#include <wine/winreg.h> -#include <wine/winnt.h> -#include <wine/winerror.h> +#include "wine/winbase.h" +#include "wine/winreg.h" +#include "wine/winnt.h" +#include "wine/winerror.h" #include "ext.h" #include "registry.h" @@ -210,7 +210,7 @@ static reg_handle_t* find_handle(int handle) } static int generate_handle() { - static int zz=249; + static unsigned int zz=249; zz++; while((zz==HKEY_LOCAL_MACHINE) || (zz==HKEY_CURRENT_USER)) zz++; @@ -281,6 +281,7 @@ static struct reg_value* insert_reg_value(int handle, const char* name, int type free(v->value); free(v->name); } + TRACE("RegInsert '%s' %p v:%d len:%d\n", name, value, *(int*)value, len); v->type=type; v->len=len; v->value=(char*)malloc(len); @@ -381,10 +382,10 @@ long RegOpenKeyExA(long key, const char* subkey, long reserved, long access, int } long RegCloseKey(long key) { - reg_handle_t *handle; - if(key==HKEY_LOCAL_MACHINE) + reg_handle_t *handle; + if(key==(long)HKEY_LOCAL_MACHINE) return 0; - if(key==HKEY_CURRENT_USER) + if(key==(long)HKEY_CURRENT_USER) return 0; handle=find_handle(key); if(handle==0) @@ -403,65 +404,65 @@ long RegCloseKey(long key) long RegQueryValueExA(long key, const char* value, int* reserved, int* type, int* data, int* count) { - struct reg_value* t; - char* c; - TRACE("Querying value %s\n", value); - if(!regs) - init_registry(); - - c=build_keyname(key, value); - if(c==NULL) - return 1; - t=find_value_by_name(c); - free(c); - if(t==0) - return 2; - if(type) - *type=t->type; - if(data) - { - memcpy(data, t->value, (t->len<*count)?t->len:*count); - TRACE("returning %d bytes: %d\n", t->len, *(int*)data); - } - if(*count<t->len) - { - *count=t->len; - return ERROR_MORE_DATA; + struct reg_value* t; + char* c; + TRACE("Querying value %s\n", value); + if(!regs) + init_registry(); + + c=build_keyname(key, value); + if (!c) + return 1; + t=find_value_by_name(c); + free(c); + if (t==0) + return 2; + if (type) + *type=t->type; + if (data) + { + memcpy(data, t->value, (t->len<*count)?t->len:*count); + TRACE("returning %d bytes: %d\n", t->len, *(int*)data); + } + if(*count<t->len) + { + *count=t->len; + return ERROR_MORE_DATA; } else { - *count=t->len; - } + *count=t->len; + } return 0; } long RegCreateKeyExA(long key, const char* name, long reserved, void* classs, long options, long security, void* sec_attr, int* newkey, int* status) { - reg_handle_t* t; - char* fullname; - struct reg_value* v; -// TRACE("Creating/Opening key %s\n", name); - TRACE("Creating/Opening key %s\n", name); - if(!regs) - init_registry(); - - fullname=build_keyname(key, name); - if(fullname==NULL) - return 1; - v=find_value_by_name(fullname); - if(v==0) - { - int qw=45708; - v=insert_reg_value(key, name, DIR, &qw, 4); - if (status) *status=REG_CREATED_NEW_KEY; -// return 0; - } + reg_handle_t* t; + char* fullname; + struct reg_value* v; + // TRACE("Creating/Opening key %s\n", name); + if(!regs) + init_registry(); - t=insert_handle(generate_handle(), fullname); - *newkey=t->handle; - free(fullname); - return 0; + fullname=build_keyname(key, name); + if (!fullname) + return 1; + TRACE("Creating/Opening key %s\n", fullname); + v=find_value_by_name(fullname); + if(v==0) + { + int qw=45708; + v=insert_reg_value(key, name, DIR, &qw, 4); + if (status) *status=REG_CREATED_NEW_KEY; + // return 0; + } + + t=insert_handle(generate_handle(), fullname); + *newkey=t->handle; + free(fullname); + return 0; } /* @@ -505,7 +506,7 @@ long RegSetValueExA(long key, const char* name, long v1, long v2, const void* da { struct reg_value* t; char* c; - TRACE("Request to set value %s\n", name); + TRACE("Request to set value %s %d\n", name, *(const int*)data); if(!regs) init_registry(); |