diff --git a/include/wine/msacm.h b/include/wine/msacm.h index 18f1d855c7..b76c1095a8 100644 --- a/include/wine/msacm.h +++ b/include/wine/msacm.h @@ -13,7 +13,7 @@ extern "C" { #endif /* defined(__cplusplus) */ -typedef WORD VERSION; /* major (high byte), minor (low byte) */ +//typedef WORD VERSION; /* major (high byte), minor (low byte) */ typedef UINT16 MMVERSION16; typedef UINT MMVERSION; diff --git a/libs/winloader/Makefile.am b/libs/winloader/Makefile.am index 75d0f2b16f..37362114e4 100644 --- a/libs/winloader/Makefile.am +++ b/libs/winloader/Makefile.am @@ -3,12 +3,12 @@ filterdir = $(libdir)/gst filter_LTLIBRARIES = libwinloader.la # compiler manages to screw something up here... must reduce optimizations -CFLAGS += -O2 +CFLAGS += -O0 -funroll-loops -libwinloader_la_SOURCES = driver.c elfdll.c ext.c externals.c module.c \ +libwinloader_la_SOURCES = win32.c driver.c elfdll.c ext.c module.c \ pe_image.c pe_resource.c registry.c resource.c stubs.s vfl.c afl.c -noinst_HEADERS = externals.h wineacm.h +noinst_HEADERS = wineacm.h DEFINES=-rdynamic -fPIC -D__WINE__ -Ddbg_printf=__vprintf -DTRACE=__vprintf CFLAGS += $(DEFINES) diff --git a/libs/winloader/afl.c b/libs/winloader/afl.c index 72546f3b49..df4187f6d8 100644 --- a/libs/winloader/afl.c +++ b/libs/winloader/afl.c @@ -304,6 +304,7 @@ void MSACM_RegisterAllDrivers(void) MSACM_RegisterDriver("divxa32", (LPSTR)0x161, 0); MSACM_RegisterDriver("msadp32", (LPSTR)0x2, 0); + MSACM_RegisterDriver("l3codeca", (LPSTR)0x55, 0); } /*********************************************************************** diff --git a/libs/winloader/driver.c b/libs/winloader/driver.c index 8fdb435e42..a753aa5b64 100644 --- a/libs/winloader/driver.c +++ b/libs/winloader/driver.c @@ -6,8 +6,6 @@ #include #include -#include - #define STORE_ALL \ __asm__ ( \ "push %%ebx\n\t" \ @@ -25,6 +23,7 @@ "pop %%ebx\n\t"::) +#define WIN32_PATH "/usr/lib/win32" typedef struct { UINT uDriverSignature; @@ -86,18 +85,21 @@ typedef struct int usage; }codec_t; -//#define Win32Path "/usr/lib/win32/" -#define Win32Path GST_WIN32_LIBDIR static codec_t avi_codecs[]={ - {0, Win32Path"/divxc32.dll", 0}, //0 - {0, Win32Path"/ir50_32.dll", 0}, - {0, Win32Path"/ir41_32.dll", 0}, - {0, Win32Path"/ir32_32.dll", 0}, - {0, Win32Path"/mpg4c32.dll", 0}, - {0, Win32Path"/iccvid.dll", 0}, //5 - {0, Win32Path"/libvideodll.so", 0}, - {0, Win32Path"/divxa32.acm", 0}, //7 - {0, Win32Path"/msadp32.acm", 0}, + {0, WIN32_PATH"/divxc32.dll", 0}, //0 + {0, WIN32_PATH"/ir50_32.dll", 0}, + {0, WIN32_PATH"/ir41_32.dll", 0}, + {0, WIN32_PATH"/ir32_32.dll", 0}, + {0, WIN32_PATH"/mpg4c32.dll", 0}, + {0, WIN32_PATH"/iccvid.dll", 0}, //5 + {0, WIN32_PATH"/libvideodll.so", 0}, + {0, WIN32_PATH"/divxa32.acm", 0}, + {0, WIN32_PATH"/msadp32.acm", 0}, + {0, WIN32_PATH"/ativcr1.dll", 0}, + {0, WIN32_PATH"/ativcr2.dll", 0}, //10 + {0, WIN32_PATH"/i263_32.drv", 0}, + {0, WIN32_PATH"/l3codeca.acm", 0}, +// {0, WIN32_PATH"/atiyvu9.dll", 0}, }; @@ -155,6 +157,9 @@ DrvOpen(LPARAM lParam2) case mmioFOURCC('D', 'I', 'V', '4'): case mmioFOURCC('d', 'i', 'v', '3'): case mmioFOURCC('d', 'i', 'v', '4'): + case mmioFOURCC('M', 'P', '4', '1'): + case mmioFOURCC('M', 'P', '4', '2'): + case mmioFOURCC('M', 'P', '4', '3'): printf("Video in DivX ;-) format\n"); drv_id=0; break; @@ -178,9 +183,6 @@ DrvOpen(LPARAM lParam2) case mmioFOURCC('m', 'p', '4', '2'): case mmioFOURCC('m', 'p', '4', '3'): case mmioFOURCC('M', 'P', 'G', '4'): - case mmioFOURCC('M', 'P', '4', '1'): - case mmioFOURCC('M', 'P', '4', '2'): - case mmioFOURCC('M', 'P', '4', '3'): printf("Video in Microsoft MPEG-4 format\n"); drv_id=4; break; @@ -188,6 +190,19 @@ DrvOpen(LPARAM lParam2) printf("Video in Cinepak format\n"); drv_id=5; break; + case mmioFOURCC('V', 'C', 'R', '1'): + drv_id=9; + break; + case mmioFOURCC('V', 'C', 'R', '2'): + drv_id=10; + break; + case mmioFOURCC('i', '2', '6', '3'): + case mmioFOURCC('I', '2', '6', '3'): + drv_id=11; + break; +// case mmioFOURCC('Y', 'V', 'U', '9'): +// drv_id=12; +// break; default: printf("Unknown codec %X='%c%c%c%c'\n", fccHandler, fccHandler&0xFF, (fccHandler&0xFF00)>>8, @@ -204,6 +219,10 @@ DrvOpen(LPARAM lParam2) case 0x2://MS ADPCM drv_id=8; break; + case 0x55://MPEG Layer 3 + printf("MPEG Layer 3 ( 0x55 )\n"); + drv_id=12; + break; default: printf("Unknown ACM codec 0x%X\n", fccHandler); return (HDRVR)0; diff --git a/libs/winloader/elfdll.c b/libs/winloader/elfdll.c index f78ad8ca36..b65e2287c2 100644 --- a/libs/winloader/elfdll.c +++ b/libs/winloader/elfdll.c @@ -45,8 +45,7 @@ extern DWORD fixup_imports(WINE_MODREF *wm); extern void dump_exports(HMODULE hModule); /*---------------- END HACKS ---------------*/ -//char *extra_ld_library_path = "/usr/lib/win32"; -char *extra_ld_library_path = GST_WIN32_LIBDIR; +char *extra_ld_library_path = "/usr/lib/win32"; struct elfdll_image { diff --git a/libs/winloader/module.c b/libs/winloader/module.c index eda45d13ea..945c5b5083 100644 --- a/libs/winloader/module.c +++ b/libs/winloader/module.c @@ -14,7 +14,7 @@ #include #include - +/* #ifdef __linux__ #include #include @@ -40,7 +40,7 @@ struct modify_ldt_ldt_s { #define __NR_modify_ldt 123 #endif - +*/ #include #include #include @@ -64,7 +64,7 @@ modref_list; * * Convert an ldt_entry structure to the raw bytes of the descriptor. */ -static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content ) +/*static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content ) { *buffer++ = ((content->base_addr & 0x0000ffff) << 16) | (content->limit & 0x0ffff); @@ -77,7 +77,7 @@ static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt ((content->limit_in_pages != 0) << 23) | 0xf000; } - +*/ // // funcs: @@ -86,6 +86,7 @@ static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt // 1 write old mode // 0x11 write // +/* static int modify_ldt( int func, struct modify_ldt_ldt_s *ptr, unsigned long count ) { @@ -107,7 +108,7 @@ static int modify_ldt( int func, struct modify_ldt_ldt_s *ptr, "b" (func), "c" (ptr), "d" (sizeof(struct modify_ldt_ldt_s)*count) ); -#endif /* __PIC__ */ +#endif if (res >= 0) return res; errno = -res; return -1; @@ -147,7 +148,7 @@ static int install_fs() perror("install_fs"); MESSAGE("Couldn't install fs segment, expect segfault\n"); } -#endif /*linux*/ +#endif #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) { @@ -161,11 +162,11 @@ static int install_fs() MESSAGE("Did you reconfigure the kernel with \"options USER_LDT\"?\n"); } } -#endif /* __NetBSD__ || __FreeBSD__ || __OpenBSD__ */ +#endif __asm__ ( "movl $0xf,%eax\n\t" - "pushw %ax\n\t" +// "pushw %ax\n\t" "movw %ax, %fs\n\t" ); prev_struct=malloc(8); @@ -178,13 +179,15 @@ static int install_fs() }; static int uninstall_fs() { + printf("Uninstalling FS segment\n"); if(fs_seg==0) return -1; munmap(fs_seg, 0x30000); + fs_installed=0; return 0; } - +*/ //WINE_MODREF *local_wm=NULL; modref_list* local_wm=NULL; @@ -216,7 +219,7 @@ void MODULE_RemoveFromList(WINE_MODREF *mod) { free(list); local_wm=NULL; - uninstall_fs(); +// uninstall_fs(); return; } for(;list;list=list->prev) @@ -412,8 +415,8 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) SetLastError(ERROR_INVALID_PARAMETER); return 0; } - if(fs_installed==0) - install_fs(); +// if(fs_installed==0) +// install_fs(); wm = MODULE_LoadLibraryExA( libname, hfile, flags ); diff --git a/libs/winloader/pe_image.c b/libs/winloader/pe_image.c index a98529a2cc..6342d1f15e 100644 --- a/libs/winloader/pe_image.c +++ b/libs/winloader/pe_image.c @@ -55,7 +55,7 @@ #include #include -#include "externals.h" +#include "win32.h" #define RVA(x) ((void *)((char *)load_addr+(unsigned int)(x))) diff --git a/libs/winloader/vfl.c b/libs/winloader/vfl.c index b6e26a4d8b..c0b17d107a 100644 --- a/libs/winloader/vfl.c +++ b/libs/winloader/vfl.c @@ -338,6 +338,13 @@ ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) { // printf("private=%x\n", whic->private); __asm__ __volatile__ ("fsave (%0)\n\t": :"r"(&qw)); STORE_ALL; + /*__asm__ + ( + "pushl %eax\n\t" + "movl $0xf,%eax\n\t" + "movw %ax, %fs\n\t" + "popl %eax\n\t" + );*/ ret = whic->driverproc(whic->private,1,msg,lParam1,lParam2); REST_ALL; __asm__ __volatile__ ("frstor (%0)\n\t": :"r"(&qw));