diff options
Diffstat (limited to 'src/libw32dll')
18 files changed, 62 insertions, 40 deletions
diff --git a/src/libw32dll/.cvsignore b/src/libw32dll/.hgignore index 7d926a554..7d926a554 100644 --- a/src/libw32dll/.cvsignore +++ b/src/libw32dll/.hgignore diff --git a/src/libw32dll/DirectShow/.cvsignore b/src/libw32dll/DirectShow/.hgignore index 7d926a554..7d926a554 100644 --- a/src/libw32dll/DirectShow/.cvsignore +++ b/src/libw32dll/DirectShow/.hgignore diff --git a/src/libw32dll/DirectShow/DS_VideoDecoder.c b/src/libw32dll/DirectShow/DS_VideoDecoder.c index e34659f91..44c6d26d7 100644 --- a/src/libw32dll/DirectShow/DS_VideoDecoder.c +++ b/src/libw32dll/DirectShow/DS_VideoDecoder.c @@ -110,6 +110,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD this->iv.m_bh = (BITMAPINFOHEADER*)malloc(bihs); memcpy(this->iv.m_bh, format, bihs); + this->iv.m_bh->biSize = bihs; this->iv.m_State = STOP; //this->iv.m_pFrame = 0; diff --git a/src/libw32dll/Makefile.am b/src/libw32dll/Makefile.am index aa42cd8e3..46027d0f1 100644 --- a/src/libw32dll/Makefile.am +++ b/src/libw32dll/Makefile.am @@ -16,21 +16,23 @@ lib_LTLIBRARIES = $(w32dll_codec) $(qt_codec) EXTRA_DIST = common.c xineplug_decode_w32dll_la_SOURCES = w32codec.c -xineplug_decode_w32dll_la_LDFLAGS = -avoid-version -module \ - @IMPURE_TEXT_LDFLAGS@ +xineplug_decode_w32dll_la_LDFLAGS = -avoid-version -module xineplug_decode_w32dll_la_LIBADD = \ $(top_builddir)/src/libw32dll/wine/libwine.la \ $(XINE_LIB) \ + $(PTHREAD_LIBS) \ + -lm \ $(top_builddir)/src/libw32dll/DirectShow/libds_filter.la \ $(top_builddir)/src/libw32dll/dmo/libdmo_filter.la \ @KSTAT_LIBS@ xineplug_decode_qt_la_SOURCES = qt_decoder.c -xineplug_decode_qt_la_LDFLAGS = -avoid-version -module \ - IMPURE_TEXT_LDFLAGS@ +xineplug_decode_qt_la_LDFLAGS = -avoid-version -module xineplug_decode_qt_la_LIBADD = \ $(top_builddir)/src/libw32dll/wine/libwine.la \ $(XINE_LIB) \ + $(PTHREAD_LIBS) \ + -lm \ @KSTAT_LIBS@ noinst_HEADERS = libwin32.h w32codec.h diff --git a/src/libw32dll/common.c b/src/libw32dll/common.c index 1f42288c2..35fe41941 100644 --- a/src/libw32dll/common.c +++ b/src/libw32dll/common.c @@ -13,7 +13,7 @@ static char *get_win32_codecs_path(config_values_t *cfg) { NULL }; int i = 0; - cfgpath = cfg->register_string (cfg, "decoder.external.win32_codecs_path", WIN32_PATH, + cfgpath = cfg->register_filename (cfg, "decoder.external.win32_codecs_path", WIN32_PATH, XINE_CONFIG_STRING_IS_DIRECTORY_NAME, _("path to Win32 codecs"), _("If you have the Windows or Apple Quicktime codec packs " "installed, specify the path the codec directory here. " diff --git a/src/libw32dll/dmo/.cvsignore b/src/libw32dll/dmo/.hgignore index 7d926a554..7d926a554 100644 --- a/src/libw32dll/dmo/.cvsignore +++ b/src/libw32dll/dmo/.hgignore diff --git a/src/libw32dll/dmo/DMO_VideoDecoder.c b/src/libw32dll/dmo/DMO_VideoDecoder.c index 564c26ec8..3ad85645a 100644 --- a/src/libw32dll/dmo/DMO_VideoDecoder.c +++ b/src/libw32dll/dmo/DMO_VideoDecoder.c @@ -118,6 +118,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE this->iv.m_bh = (BITMAPINFOHEADER*)malloc(bihs); memcpy(this->iv.m_bh, format, bihs); + this->iv.m_bh->biSize = bihs; this->iv.m_State = STOP; //this->iv.m_pFrame = 0; diff --git a/src/libw32dll/qtx/.cvsignore b/src/libw32dll/qtx/.hgignore index 22a4e7292..22a4e7292 100644 --- a/src/libw32dll/qtx/.cvsignore +++ b/src/libw32dll/qtx/.hgignore diff --git a/src/libw32dll/qtx/qtxsdk/.cvsignore b/src/libw32dll/qtx/qtxsdk/.hgignore index 282522db0..282522db0 100644 --- a/src/libw32dll/qtx/qtxsdk/.cvsignore +++ b/src/libw32dll/qtx/qtxsdk/.hgignore diff --git a/src/libw32dll/wine/.cvsignore b/src/libw32dll/wine/.hgignore index 7d926a554..7d926a554 100644 --- a/src/libw32dll/wine/.cvsignore +++ b/src/libw32dll/wine/.hgignore diff --git a/src/libw32dll/wine/ldt_keeper.c b/src/libw32dll/wine/ldt_keeper.c index 11711ce62..7f7169b86 100644 --- a/src/libw32dll/wine/ldt_keeper.c +++ b/src/libw32dll/wine/ldt_keeper.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: ldt_keeper.c,v 1.15 2006/05/07 09:31:57 valtri Exp $ + * $Id: ldt_keeper.c,v 1.16 2007/03/09 23:49:35 dgp85 Exp $ * * * contents: @@ -54,6 +54,7 @@ /* applied some modification to make make our xine friend more happy */ #include "ldt_keeper.h" +#include "config.h" #include <string.h> #include <stdlib.h> @@ -90,6 +91,7 @@ int modify_ldt(int func, void *ptr, unsigned long bytecount); #include <sys/sysi86.h> /* solaris x86: add missing prototype for sysi86() */ +#ifndef HAVE_SYSI86 #ifdef __cplusplus extern "C" { #endif @@ -97,6 +99,7 @@ int sysi86(int, void*); #ifdef __cplusplus } #endif +#endif #ifndef NUMSYSLDTS /* SunOS 2.5.1 does not define NUMSYSLDTS */ #define NUMSYSLDTS 6 /* Let's hope the SunOS 5.8 value is OK */ diff --git a/src/libw32dll/wine/module.c b/src/libw32dll/wine/module.c index 6e9235584..0331f141f 100644 --- a/src/libw32dll/wine/module.c +++ b/src/libw32dll/wine/module.c @@ -39,8 +39,8 @@ #ifdef EMU_QTX_API #include "wrapper.h" -static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags); -static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags); +int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags); +int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags); #endif //#undef TRACE @@ -389,9 +389,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) strncpy(path, libname, sizeof(path) - 1); } else { /* check default user path */ - strncpy(path, win32_def_path, sizeof(path) - 2); - strcat(path, "/"); - strncat(path, libname, sizeof(path) - strlen(libname)); + snprintf(path, sizeof(path), "%s/%s", win32_def_path, libname); } wm = MODULE_LoadLibraryExA( path, hfile, flags ); @@ -521,8 +519,6 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) printf ("wine/module: QuickTime.qts patched!!! old entry=%p\n",ptr[0]); #ifdef EMU_QTX_API - report_entry = report_func; - report_ret = report_func_ret; wrapper_target=ptr[0]; ptr[0]=wrapper; #endif @@ -685,7 +681,7 @@ static int dump_component(char* name,int type,void* _orig, ComponentParameters * static u_int32_t ret_array[4096]; static int ret_i=0; -static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags) +int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags) { #ifdef DEBUG_QTX_API int i; @@ -884,7 +880,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_ return 0; } -static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags) +int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags) { #ifdef DEBUG_QTX_API int i; @@ -999,8 +995,6 @@ FARPROC MODULE_GetProcAddress( // || !strcmp(function,"_CallComponent") ){ fprintf(stderr,"theQuickTimeDispatcher caught -> %p\n",retproc); - report_entry = report_func; - report_ret = report_func_ret; wrapper_target=(void *)retproc; retproc=(void *)wrapper; } diff --git a/src/libw32dll/wine/pe_image.c b/src/libw32dll/wine/pe_image.c index 92017f906..aa29098c1 100644 --- a/src/libw32dll/wine/pe_image.c +++ b/src/libw32dll/wine/pe_image.c @@ -47,6 +47,9 @@ #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif +#ifdef HAVE_ALLOCA_H +#include <alloca.h> +#endif #include "windef.h" #include "winbase.h" #include "winerror.h" diff --git a/src/libw32dll/wine/pshpack1.h b/src/libw32dll/wine/pshpack1.h index 659b2ed67..15876039c 100644 --- a/src/libw32dll/wine/pshpack1.h +++ b/src/libw32dll/wine/pshpack1.h @@ -2,7 +2,7 @@ #define __WINE_PSHPACK_H 1 #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__ICC) -//#pragma pack(1) +#pragma pack(1) #elif !defined(RC_INVOKED) #error "1 as alignment isn't supported by the compiler" #endif /* defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */ diff --git a/src/libw32dll/wine/pshpack2.h b/src/libw32dll/wine/pshpack2.h index a0830be0b..0145d8b13 100644 --- a/src/libw32dll/wine/pshpack2.h +++ b/src/libw32dll/wine/pshpack2.h @@ -2,7 +2,7 @@ #define __WINE_PSHPACK_H 2 #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__ICC) -//#pragma pack(2) +#pragma pack(2) #elif !defined(RC_INVOKED) #error "2 as alignment isn't supported by the compiler" #endif /* defined(__GNUC__) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */ diff --git a/src/libw32dll/wine/stubs.s b/src/libw32dll/wine/stubs.s index 6aa90ee9d..2c6270616 100644 --- a/src/libw32dll/wine/stubs.s +++ b/src/libw32dll/wine/stubs.s @@ -33,3 +33,6 @@ exp_EH_prolog: leal 12(%esp), %ebp pushl %eax ret + +.section .note.GNU-stack,"",@progbits + diff --git a/src/libw32dll/wine/wrapper.S b/src/libw32dll/wine/wrapper.S index fe2d85619..72b4dfe8f 100644 --- a/src/libw32dll/wine/wrapper.S +++ b/src/libw32dll/wine/wrapper.S @@ -1,17 +1,19 @@ .section .data -.globl caller_return caller_return: .long 0 -.globl report_entry -report_entry: - .long null_call -.globl report_ret -report_ret: - .long null_call .global wrapper_target wrapper_target: .long null_call +#undef __i686 /* gcc define gets in our way */ + .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits +.globl __i686.get_pc_thunk.bx + .hidden __i686.get_pc_thunk.bx + .type __i686.get_pc_thunk.bx,@function +__i686.get_pc_thunk.bx: + movl (%esp), %ebx + ret + .section .text .globl null_call .type null_call, @function @@ -22,46 +24,61 @@ null_call: .type wrapper, @function .balign 16,0x90 wrapper: + pushl $0 pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) pushf # store flags push %ebp # set up a stack frame movl %esp, %ebp + call __i686.get_pc_thunk.bx + addl $_GLOBAL_OFFSET_TABLE_, %ebx + leal 4(%ebp), %eax # push flags addr push %eax leal 8(%ebp), %eax # push registers addr push %eax - leal 40(%ebp), %edx + leal 44(%ebp), %edx movl (%ebp), %eax subl %edx, %eax push %eax push %edx - call *report_entry # report entry + call report_func@PLT # report entry test %eax, %eax jnz .Ldone + movl 44(%ebp), %eax # switch return addresses + movl %eax, caller_return@GOTOFF(%ebx) + leal .Lwrapper_return@GOTOFF(%ebx), %eax + movl %eax, 40(%ebp) + + movl wrapper_target@GOT(%ebx), %eax + movl (%eax), %eax + mov %eax, 40(%ebp) # wrapper_target should return at .Lwrapper_return + leave # restore %esp, %ebp popf # restore flags popa # restore registers - - popl caller_return # switch return addresses - pushl $.Lwrapper_return - - jmp *wrapper_target # wrapper_target should return at .Lwrapper_return + + ret # fake 'return' to wrapper_target actually .balign 16, 0x90 .Lwrapper_return: - pushl caller_return # restore the original return address + pushl $0 pusha # more for reference sake here pushf push %ebp # set up a stack frame movl %esp, %ebp + call __i686.get_pc_thunk.bx + addl $_GLOBAL_OFFSET_TABLE_, %ebx + movl caller_return@GOTOFF(%ebx), %eax + movl %eax, 40(%ebp) # restore the original return address + leal 4(%ebp), %eax # push flags addr push %eax leal 8(%ebp), %eax # push registers addr @@ -73,11 +90,13 @@ wrapper: push %eax push %edx - call *report_ret # report the return information (same args) + call report_func_ret@PLT# report the return information (same args) .Ldone: leave popf popa ret - + +.section .note.GNU-stack,"",@progbits + diff --git a/src/libw32dll/wine/wrapper.h b/src/libw32dll/wine/wrapper.h index a9943ce78..5e2cf804e 100644 --- a/src/libw32dll/wine/wrapper.h +++ b/src/libw32dll/wine/wrapper.h @@ -11,10 +11,6 @@ typedef struct { u_int32_t edi, esi, ebp, esp, ebx, edx, ecx, eax; } reg386_t; -typedef int (*wrapper_func_t)(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags); - -extern wrapper_func_t report_entry, report_ret; - extern void (*wrapper_target)(void); extern int wrapper(void); |
