diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-02-17 03:18:02 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-02-17 03:18:02 +0000 |
commit | ff725d8f795ca9b9ee7166c11d109871f580c21e (patch) | |
tree | 64dda3dc1b9868886bda68ed11dda63c123c0e75 /src/libw32dll/wine/win32.c | |
parent | 6adf7f8e7f8b42b877eb8b97de028915985618cf (diff) | |
download | xine-lib-ff725d8f795ca9b9ee7166c11d109871f580c21e.tar.gz xine-lib-ff725d8f795ca9b9ee7166c11d109871f580c21e.tar.bz2 |
- fix LDT clash with linuxthreads
- comment useless calls. some people really don't know what this thing does,
they probably think that lots of Setup_FS_Segment() all over will make
win32 gods happy. :)
- fix vfw (indeo) and quicktime segfaults
in short: xine now plays indeo, animatrix and the hulk trailers.
CVS patchset: 4178
CVS date: 2003/02/17 03:18:02
Diffstat (limited to 'src/libw32dll/wine/win32.c')
-rw-r--r-- | src/libw32dll/wine/win32.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c index 8f4ca3ba1..88766dcc8 100644 --- a/src/libw32dll/wine/win32.c +++ b/src/libw32dll/wine/win32.c @@ -1423,10 +1423,9 @@ static int WINAPI expGetCurrentProcess() // this version is required for Quicktime codecs (.qtx/.qts) to work. // (they assume some pointers at FS: segment) -extern void* fs_seg; - //static int tls_count; static int tls_use_map[64]; +static void *tls_minus_one; static int WINAPI expTlsAlloc() { int i; @@ -1448,16 +1447,53 @@ static int WINAPI expTlsSetValue(int index, void* value) // if((index<0) || (index>64)) if((index>=64)) return 0; + + /* qt passes -1 here. probably a side effect of some bad patching */ + if( index < 0 ) { + tls_minus_one = value; + return 1; + } + +#if 0 *(void**)((char*)fs_seg+0x88+4*index) = value; +#else + /* does not require fs_seg memory, if everything is right + * we can access FS:xxxx like any win32 code would do. + */ + index = 0x88+4*index; + __asm__ __volatile__( + "movl %0,%%fs:(%1)" :: "r" (value), "r" (index) + ); +#endif return 1; } static void* WINAPI expTlsGetValue(DWORD index) { + void *ret; + dbgprintf("TlsGetValue(%d)\n",index); // if((index<0) || (index>64)) - if((index>=64)) return NULL; + if((index>=64)) + return NULL; + + /* qt passes -1 here. probably a side effect of some bad patching */ + if( index < 0 ) { + return tls_minus_one; + } + +#if 0 return *(void**)((char*)fs_seg+0x88+4*index); +#else + /* does not require fs_seg memory, if everything is right + * we can access FS:xxxx like any win32 code would do. + */ + index = 0x88+4*index; + __asm__ __volatile__( + "movl %%fs:(%1),%0" : "=r" (ret) : "r" (index) + ); + return ret; +#endif } static int WINAPI expTlsFree(int idx) |