Commit 30b5874f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Remove loader

parent 7e19e888
......@@ -189,6 +189,7 @@ Removed modules:
* Switcher module
* OSD parser and menu
* Xscreensaver: use xdg-screensaver
* Removed DLL loader for non-Windows Operating Systems
Changes between 2.0.4 and 2.0.5:
......
......@@ -4004,20 +4004,7 @@ AC_SUBST(soliddatadir)
AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
dnl
dnl DLL loader copied from MPlayer copied from somewhere else (WINE ?)
dnl
loader=false
AC_ARG_ENABLE(loader,
AS_HELP_STRING([--enable-loader],[build DLL loader for ELF i386 platforms
(default disabled)]))
AM_CONDITIONAL(LOADER, [test "${enable_loader}" = "yes"])
AS_IF([test "${enable_loader}" = "yes"],
[ VLC_ADD_PLUGIN([dmo])
VLC_ADD_CPPFLAGS([dmo quicktime ],[-I\\\$(srcdir)/loader])
VLC_ADD_LIBS([dmo quicktime ],[libloader.la])
VLC_ADD_LIBS([dmo quicktime], [-lpthread])
])
dnl DMO codec
AS_IF([test "${SYS}" = "mingw32"], [VLC_ADD_PLUGIN([dmo]) VLC_ADD_LIBS([dmo],[-lole32 -luuid]) ])
EXTEND_HELP_STRING([Components:])
......
......@@ -207,34 +207,3 @@ if HAVE_ANDROID
libvlc_LTLIBRARIES += libiomx_plugin.la libmediacodec_plugin.la
endif
### Windows DLL loader ###
# TODO: real check for vsscanf() and <sys/mmap.h>
noinst_HEADERS += loader/com.h loader/driver.h loader/ext.h loader/ldt_keeper.h
loader/loader.h loader/registry.h \
loader/win32.h loader/wineacm.h loader/wrapper.h \
loader/qtx/qtxsdk/components.h \
loader/wine/avifmt.h loader/wine/basetsd.h loader/wine/debugtools.h \
loader/wine/driver.h loader/wine/heap.h loader/wine/mmreg.h \
loader/wine/module.h loader/wine/msacmdrv.h loader/wine/msacm.h \
loader/wine/pe_image.h loader/wine/poppack.h loader/wine/pshpack1.h \
loader/wine/pshpack2.h loader/wine/vfw.h loader/wine/winbase.h \
loader/wine/windef.h loader/wine/winerror.h \
loaeder/wine/winestring.h loader/wine/winnt.h loader/wine/winreg.h \
loader/wine/winuser.h
libloader_la_CPPFLAGS = -D__WINE__ -DHAVE_SYS_MMAN_H=1 -DHAVE_VSSCANF=1 \
-DWIN32_PATH=\"\" -DTRACE\(...\)=\(void\)0
libloader_la_CFLAGS = -fno-PIC -U_FILE_OFFSET_BITS \
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
libloader_la_SOURCES = loader/ldt_keeper.c loader/pe_image.c loader/module.c \
loader/ext.c loader/win32.c loader/driver.c loader/pe_resource.c \
loader/resource.c loader/registry.c loader/afl.c loader/vfl.c \
loader/wrapper.S loader/stubs.s loader/kludge.c
libloader_la_LIBADD = -lpthread
libloader_la_LDFLAGS = -static
if LOADER
noinst_LTLIBRARIES = libloader.la
libdmo_plugin_la_DEPENDENCIES = libloader.la
libquicktime_plugin_la_DEPENDENCIES = libloader.la
endif
This diff is collapsed.
/*
* Modified for use with MPlayer, detailed CVS changelog at
* http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
* $Id$
*/
#ifndef AVIFILE_COM_H
#define AVIFILE_COM_H
#include "config.h"
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#include <inttypes.h>
#endif
/**
* Internal functions and structures for COM emulation code.
*/
#if !defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
#ifdef __cplusplus
extern "C" {
#endif
void* CoTaskMemAlloc(unsigned long cb);
void CoTaskMemFree(void* cb);
#ifndef GUID_TYPE
#define GUID_TYPE
typedef struct
{
uint32_t f1;
uint16_t f2;
uint16_t f3;
uint8_t f4[8];
} GUID;
#endif
extern const GUID IID_IUnknown;
extern const GUID IID_IClassFactory;
typedef long (*GETCLASSOBJECT) (GUID* clsid, const GUID* iid, void** ppv);
int RegisterComClass(const GUID* clsid, GETCLASSOBJECT gcs);
int UnregisterComClass(const GUID* clsid, GETCLASSOBJECT gcs);
#ifndef STDCALL
#define STDCALL __attribute__((__stdcall__))
#endif
struct IUnknown;
struct IClassFactory;
struct IUnknown_vt
{
long STDCALL (*QueryInterface)(struct IUnknown* _this, const GUID* iid, void** ppv);
long STDCALL (*AddRef)(struct IUnknown* _this) ;
long STDCALL (*Release)(struct IUnknown* _this) ;
} ;
typedef struct IUnknown
{
struct IUnknown_vt* vt;
} IUnknown;
struct IClassFactory_vt
{
long STDCALL (*QueryInterface)(struct IUnknown* _this, const GUID* iid, void** ppv);
long STDCALL (*AddRef)(struct IUnknown* _this) ;
long STDCALL (*Release)(struct IUnknown* _this) ;
long STDCALL (*CreateInstance)(struct IClassFactory* _this, struct IUnknown* pUnkOuter, const GUID* riid, void** ppvObject);
};
struct IClassFactory
{
struct IClassFactory_vt* vt;
};
long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
long dwClsContext, const GUID* riid, void** ppv);
#ifdef __cplusplus
};
#endif /* __cplusplus */
#endif /* WIN32 */
#endif /* AVIFILE_COM_H */
/*
* $Id$
*
* Copyright 1993, 1994 Martin Ayotte
* Copyright 1998 Marcus Meissner
* Copyright 1999 Eric Pouech
*
* Originally distributed under LPGL 2.1 (or later) by the Wine project.
*
* Modified for use with MPlayer, detailed CVS changelog at
* http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
*
* File now distributed as part of VLC media player with no modifications.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*/
#include "config.h"
#include <stdio.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#include <stdlib.h>
#ifdef __FreeBSD__
#include <sys/time.h>
#endif
#include "win32.h"
#include "wine/driver.h"
#include "wine/pe_image.h"
#include "wine/winreg.h"
#include "wine/vfw.h"
#include "registry.h"
#ifdef WIN32_LOADER
#include "ldt_keeper.h"
#endif
#include "driver.h"
#ifndef __MINGW32__
#include "ext.h"
#endif
#ifndef WIN32_LOADER
char* def_path=WIN32_PATH;
#else
extern char* def_path;
#endif
#if 1
/*
* STORE_ALL/REST_ALL seems like an attempt to workaround problems due to
* WINAPI/no-WINAPI bustage.
*
* There should be no need for the STORE_ALL/REST_ALL hack once all
* function definitions agree with their prototypes (WINAPI-wise) and
* we make sure, that we do not call these functions without a proper
* prototype in scope.
*/
#define STORE_ALL
#define REST_ALL
#else
// this asm code is no longer needed
#define STORE_ALL \
__asm__ __volatile__ ( \
"push %%ebx\n\t" \
"push %%ecx\n\t" \
"push %%edx\n\t" \
"push %%esi\n\t" \
"push %%edi\n\t"::)
#define REST_ALL \
__asm__ __volatile__ ( \
"pop %%edi\n\t" \
"pop %%esi\n\t" \
"pop %%edx\n\t" \
"pop %%ecx\n\t" \
"pop %%ebx\n\t"::)
#endif
static int needs_free=0;
void SetCodecPath(const char* path)
{
if(needs_free)free(def_path);
if(path==NULL)
{
def_path=WIN32_PATH;
needs_free=0;
return;
}
def_path = (char*) malloc(strlen(path)+1);
strcpy(def_path, path);
needs_free=1;
}
static DWORD dwDrvID = 0;
LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT message,
LPARAM lParam1, LPARAM lParam2)
{
DRVR* module=(DRVR*)hDriver;
int result;
#ifndef __svr4__
char qw[300];
#endif
#ifdef DETAILED_OUT
printf("SendDriverMessage: driver %X, message %X, arg1 %X, arg2 %X\n", hDriver, message, lParam1, lParam2);
#endif
if (!module || !module->hDriverModule || !module->DriverProc) return -1;
#ifndef __svr4__
__asm__ __volatile__ ("fsave (%0)\n\t": :"r"(&qw));
#endif
#ifdef WIN32_LOADER
Setup_FS_Segment();
#endif
STORE_ALL;
result=module->DriverProc(module->dwDriverID, hDriver, message, lParam1, lParam2);
REST_ALL;
#ifndef __svr4__
__asm__ __volatile__ ("frstor (%0)\n\t": :"r"(&qw));
#endif
#ifdef DETAILED_OUT
printf("\t\tResult: %X\n", result);
#endif
return result;
}
void DrvClose(HDRVR hDriver)
{
if (hDriver)
{
DRVR* d = (DRVR*)hDriver;
if (d->hDriverModule)
{
#ifdef WIN32_LOADER
Setup_FS_Segment();
#endif
if (d->DriverProc)
{
SendDriverMessage(hDriver, DRV_CLOSE, 0, 0);
d->dwDriverID = 0;
SendDriverMessage(hDriver, DRV_FREE, 0, 0);
}
FreeLibrary(d->hDriverModule);
}
free(d);
}
#ifdef WIN32_LOADER
CodecRelease();
#endif
}
//DrvOpen(LPCSTR lpszDriverName, LPCSTR lpszSectionName, LPARAM lParam2)
HDRVR DrvOpen(LPARAM lParam2)
{
NPDRVR hDriver;
int i;
char unknown[0x124];
const char* filename = (const char*) ((ICOPEN*) lParam2)->pV1Reserved;
#ifdef MPLAYER
#ifdef WIN32_LOADER
Setup_LDT_Keeper();
#endif
printf("Loading codec DLL: '%s'\n",filename);
#endif
hDriver = (NPDRVR) malloc(sizeof(DRVR));
if (!hDriver)
return ((HDRVR) 0);
memset((void*)hDriver, 0, sizeof(DRVR));
#ifdef WIN32_LOADER
CodecAlloc();
Setup_FS_Segment();
#endif
hDriver->hDriverModule = LoadLibraryA(filename);
if (!hDriver->hDriverModule)
{
printf("Can't open library %s\n", filename);
DrvClose((HDRVR)hDriver);
return ((HDRVR) 0);
}
hDriver->DriverProc = (DRIVERPROC) GetProcAddress(hDriver->hDriverModule,
"DriverProc");
if (!hDriver->DriverProc)
{
printf("Library %s is not a valid VfW/ACM codec\n", filename);
DrvClose((HDRVR)hDriver);
return ((HDRVR) 0);
}
TRACE("DriverProc == %X\n", hDriver->DriverProc);
SendDriverMessage((HDRVR)hDriver, DRV_LOAD, 0, 0);
TRACE("DRV_LOAD Ok!\n");
SendDriverMessage((HDRVR)hDriver, DRV_ENABLE, 0, 0);
TRACE("DRV_ENABLE Ok!\n");
hDriver->dwDriverID = ++dwDrvID; // generate new id
// open driver and remmeber proper DriverID
hDriver->dwDriverID = SendDriverMessage((HDRVR)hDriver, DRV_OPEN, (LPARAM) unknown, lParam2);
TRACE("DRV_OPEN Ok!(%X)\n", hDriver->dwDriverID);
printf("Loaded DLL driver %s at %x\n", filename, hDriver->hDriverModule);
return (HDRVR)hDriver;
}
/*
* Modified for use with MPlayer, detailed CVS changelog at
* http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
* $Id$
*/
#ifndef loader_driver_h
#define loader_driver_h
#ifdef __cplusplus
extern "C" {
#endif
#include "wine/windef.h"
#include "wine/driver.h"
void SetCodecPath(const char* path);
void CodecAlloc(void);
void CodecRelease(void);
HDRVR DrvOpen(LPARAM lParam2);
void DrvClose(HDRVR hdrvr);
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
/*
* Modified for use with MPlayer, detailed CVS changelog at
* http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
* $Id$
*/
#ifndef loader_ext_h
#define loader_ext_h
#include "wine/windef.h"
extern LPVOID FILE_dommap( int unix_handle, LPVOID start,
DWORD size_high, DWORD size_low,
DWORD offset_high, DWORD offset_low,
int prot, int flags );
extern int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low );
extern int wcsnicmp(const unsigned short* s1, const unsigned short* s2, int n);
extern int __vprintf( const char *format, ... );
#endif
/*****************************************************************************
* kludge.c
*****************************************************************************
* Copyright (C) 2005 Rémi Denis-Courmont
* $Id$
*
* Authors: Rémi Denis-Courmont <rem # videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
int dbg_printf(const char *format, ...)
{
return 0;
}
/*
* $Id$
*
* Copyright 1993 Robert J. Amstadt
* Copyright 1995 Alexandre Julliard
*
* Originally distributed under LPGL 2.1 (or later) by the Wine project.
*
* Modified for use with MPlayer, detailed CVS changelog at
* http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
*
* File now distributed as part of VLC media player with no modifications.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*/
/**
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* This file MUST be in main library because LDT must
* be modified before program creates first thread
* - avifile includes this file from C++ code
* and initializes it at the start of player!
* it might sound like a hack and it really is - but
* as aviplay is deconding video with more than just one
* thread currently it's necessary to do it this way
* this might change in the future
*/
/* applied some modification to make make our xine friend more happy */
#include "ldt_keeper.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#ifdef __linux__
#include <asm/unistd.h>
#include <asm/ldt.h>
// 2.5.xx+ calls this user_desc:
#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,47)
#define modify_ldt_ldt_s user_desc
#endif
/* prototype it here, so we won't depend on kernel headers */
#ifdef __cplusplus
extern "C" {
#endif
/// declare modify_ldt with the _syscall3 macro for older glibcs
#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0))
_syscall3( int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount );
#else
int modify_ldt(int func, void *ptr, unsigned long bytecount);
#endif
#ifdef __cplusplus
}
#endif
#else
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#include <machine/segments.h>
#include <machine/sysarch.h>
#endif
#ifdef __svr4__
#include <sys/segment.h>
#include <sys/sysi86.h>
/* solaris x86: add missing prototype for sysi86() */
#ifdef __cplusplus
extern "C" {
#endif
int sysi86(int, void*);
#ifdef __cplusplus
}
#endif
#ifndef NUMSYSLDTS /* SunOS 2.5.1 does not define NUMSYSLDTS */
#define NUMSYSLDTS 6 /* Let's hope the SunOS 5.8 value is OK */
#endif
#define TEB_SEL_IDX NUMSYSLDTS
#endif
#define LDT_ENTRIES 8192
#define LDT_ENTRY_SIZE 8
#pragma pack(4)
struct modify_ldt_ldt_s {
unsigned int entry_number;
unsigned long base_addr;
unsigned int limit;
unsigned int seg_32bit:1;
unsigned int contents:2;
unsigned int read_exec_only:1;
unsigned int limit_in_pages:1;
unsigned int seg_not_present:1;
unsigned int useable:1;
};
#define MODIFY_LDT_CONTENTS_DATA 0
#define MODIFY_LDT_CONTENTS_STACK 1
#define MODIFY_LDT_CONTENTS_CODE 2
#endif
/* user level (privilege level: 3) ldt (1<<2) segment selector */
#define LDT_SEL(idx) ((idx) << 3 | 1 << 2 | 3)
/* i got this value from wine sources, it's the first free LDT entry */
#if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)
#define TEB_SEL_IDX LDT_AUTO_ALLOC
#endif
#ifndef TEB_SEL_IDX
#define TEB_SEL_IDX 17
#endif
static unsigned int fs_ldt = TEB_SEL_IDX;
/**
* here is a small logical problem with Restore for multithreaded programs -
* in C++ we use static class for this...
*/
#ifdef __cplusplus
extern "C"
#endif
void Setup_FS_Segment(void)
{
unsigned int ldt_desc = LDT_SEL(fs_ldt);
__asm__ __volatile__(
"movl %0,%%eax; movw %%ax, %%fs" : : "r" (ldt_desc)
:"eax"
);
}
/* we don't need this - use modify_ldt instead */
#if 0
#ifdef __linux__
/* XXX: why is this routine from libc redefined here? */
/* NOTE: the redefined version ignores the count param, count is hardcoded as 16 */
static int LDT_Modify( int func, struct modify_ldt_ldt_s *ptr,
unsigned long count )
{
int res;
#ifdef __PIC__
__asm__ __volatile__( "pushl %%ebx\n\t"
"movl %2,%%ebx\n\t"
"int $0x80\n\t"
"popl %%ebx"
: "=a" (res)
: "0" (__NR_modify_ldt),
"r" (func),
"c" (ptr),
"d"(16)//sizeof(*ptr) from kernel point of view
:"esi" );
#else
__asm__ __volatile__("int $0x80"
: "=a" (res)
: "0" (__NR_modify_ldt),
"b" (func),
"c" (ptr),
"d"(16)
:"esi");
#endif /* __PIC__ */
if (res >= 0) return res;
errno = -res;
return -1;
}
#endif
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content )
{
*buffer++ = ((content->base_addr & 0x0000ffff) << 16) |
(content->limit & 0x0ffff);
*buffer = (content->base_addr & 0xff000000) |
((content->base_addr & 0x00ff0000)>>16) |
(content->limit & 0xf0000) |
(content->contents << 10) |
((content->read_exec_only == 0) << 9) |
((content->seg_32bit != 0) << 22) |
((content->limit_in_pages != 0) << 23) |
0xf000;
}
#endif
void* fs_seg=0;
ldt_fs_t* Setup_LDT_Keeper(void)
{
struct modify_ldt_ldt_s array;
int ret;
ldt_fs_t* ldt_fs = (ldt_fs_t*) malloc(sizeof(ldt_fs_t));
if (!ldt_fs)
return NULL;
ldt_fs->fd = open("/dev/zero", O_RDWR);
if(ldt_fs->fd<0){
perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: ");
free(ldt_fs);
return NULL;
}
fs_seg=
ldt_fs->fs_seg = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE,
ldt_fs->fd, 0);
if (ldt_fs->fs_seg == (void*)-1)
{
perror("ERROR: Couldn't allocate memory for fs segment");
close(ldt_fs->fd);
free(ldt_fs);
return NULL;
}
*(void**)((char*)ldt_fs->fs_seg+0x18) = ldt_fs->fs_seg;
memset(&array, 0, sizeof(array));
array.base_addr=(int)ldt_fs->fs_seg;
array.entry_number=TEB_SEL_IDX;
array.limit=array.base_addr+getpagesize()-1;
array.seg_32bit=1;
array.read_exec_only=0;
array.seg_not_present=0;
array.contents=MODIFY_LDT_CONTENTS_DATA;
array.limit_in_pages=0;
#ifdef __linux__
//ret=LDT_Modify(0x1, &array, sizeof(struct modify_ldt_ldt_s));
ret=modify_ldt(0x1, &array, sizeof(struct modify_ldt_ldt_s));
if(ret<0)
{
perror("install_fs");
printf("Couldn't install fs segment, expect segfault\n");
}
#endif /*linux*/
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
{
unsigned long d[2];
LDT_EntryToBytes( d, &array );
#if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)
ret = i386_set_ldt(LDT_AUTO_ALLOC, (union descriptor *)d, 1);
array.entry_number = ret;
fs_ldt = ret;
#else
ret = i386_set_ldt(array.entry_number, (union descriptor *)d, 1);
#endif
if (ret < 0)
{
perror("install_fs");
printf("Couldn't install fs segment, expect segfault\n");
printf("Did you reconfigure the kernel with \"options USER_LDT\"?\n");
}
}
#endif /* __NetBSD__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ */
#if defined(__svr4__)
{
struct ssd ssd;
ssd.sel = LDT_SEL(TEB_SEL_IDX);
ssd.bo = array.base_addr;
ssd.ls = array.limit - array.base_addr;
ssd.acc1 = ((array.read_exec_only == 0) << 1) |
(array.contents << 2) |
0xf0; /* P(resent) | DPL3 | S */
ssd.acc2 = 0x4; /* byte limit, 32-bit segment */
if (sysi86(SI86DSCR, &ssd) < 0) {
perror("sysi86(SI86DSCR)");
printf("Couldn't install fs segment, expect segfault\n");
}
}
#endif
Setup_FS_Segment();
ldt_fs->prev_struct = (char*)malloc(sizeof(char) * 8);
*(void**)array.base_addr = ldt_fs->prev_struct;
return ldt_fs;
}
void Restore_LDT_Keeper(ldt_fs_t* ldt_fs)
{
if (ldt_fs == NULL || ldt_fs->fs_seg == NULL)
return;
free(ldt_fs->prev_struct);
munmap((char*)ldt_fs->fs_seg, getpagesize());
ldt_fs->fs_seg = 0;
close(ldt_fs->fd);
free(ldt_fs);
}
#ifndef LDT_KEEPER_H
#define LDT_KEEPER_H
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct {
void* fs_seg;
char* prev_struct;
int fd;
} ldt_fs_t;
void Setup_FS_Segment(void);
ldt_fs_t* Setup_LDT_Keeper(void);
void Restore_LDT_Keeper(ldt_fs_t* ldt_fs);
#ifdef __cplusplus
}
#endif
#endif /* LDT_KEEPER_H */
/*
* Win32 binary loader interface
* $Id$
*
* Copyright 2000 Eugene Kuznetsov (divx@euro.ru)
* Copyright (C) the Wine project
*
* Originally distributed under LPGL 2.1 (or later) by the Wine project.
*
* Modified for use with MPlayer, detailed CVS changelog at
* http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
*
* File now distributed as part of VLC media player with no modifications.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*/
#ifndef _LOADER_H
#define _LOADER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "wine/windef.h"
#include "wine/driver.h"
#include "wine/mmreg.h"
#include "wine/vfw.h"
#include "wine/msacm.h"
unsigned int _GetPrivateProfileIntA(const char* appname, const char* keyname, int default_value, const char* filename);
int _GetPrivateProfileStringA(const char* appname, const char* keyname,
const char* def_val, char* dest, unsigned int len, const char* filename);
int _WritePrivateProfileStringA(const char* appname, const char* keyname,
const char* string, const char* filename);
INT WINAPI LoadStringA( HINSTANCE instance, UINT resource_id,
LPSTR buffer, INT buflen );
#ifdef __cplusplus
}
#endif
#endif /* __LOADER_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef AVIFILE_REGISTRY_H
#define AVIFILE_REGISTRY_H
/********************************************************
*
* Declaration of registry access functions
* Copyright 2000 Eugene Kuznetsov (divx@euro.ru)
*
********************************************************/
/*
* Modified for use with MPlayer, detailed CVS changelog at
* http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
* $Id$
*/
#ifdef __cplusplus
extern "C" {
#endif
void free_registry(void);
long __stdcall RegOpenKeyExA(long key, const char* subkey, long reserved,
long access, int* newkey);
long __stdcall RegCloseKey(long key);
long __stdcall RegQueryValueExA(long key, const char* value, int* reserved,
int* type, int* data, int* count);
long __stdcall RegCreateKeyExA(long key, const char* name, long reserved,
void* classs, long options, long security,
void* sec_attr, int* newkey, int* status);
long __stdcall RegSetValueExA(long key, const char* name, long v1, long v2,
const void* data, long size);
#ifdef __WINE_WINERROR_H
long __stdcall RegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcbName,
LPDWORD lpReserved, LPSTR lpClass, LPDWORD lpcbClass,
LPFILETIME lpftLastWriteTime);
long __stdcall RegEnumValueA(HKEY hkey, DWORD index, LPSTR value, LPDWORD val_count,
LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count);
#endif
#ifdef __cplusplus
};
#endif
#endif // AVIFILE_REGISTRY_H
This diff is collapsed.
.data
.LC0: .string "Called unk_%s\n"
.balign 4
.globl unk_exp1
unk_exp1:
pushl %ebp
movl %esp,%ebp
subl $4,%esp
movl $1,-4(%ebp)
movl -4(%ebp),%eax
movl %eax,%ecx
movl %ecx,%edx
sall $4,%edx
subl %eax,%edx
leal 0(,%edx,2),%eax
movl %eax,%edx
addl $export_names,%edx
pushl %edx
pushl $.LC0
call printf
addl $8,%esp
xorl %eax,%eax
leave
ret
.globl exp_EH_prolog
exp_EH_prolog:
pushl $0xff
pushl %eax
pushl %fs:0
movl %esp, %fs:0
movl 12(%esp), %eax
movl %ebp, 12(%esp)
leal 12(%esp), %ebp
pushl %eax
ret
This diff is collapsed.
This diff is collapsed.
/*
* Modified for use with MPlayer, detailed CVS changelog at
* http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
* $Id$
*/
#ifndef loader_win32_h
#define loader_win32_h
#include <time.h>
#include "wine/windef.h"
#include "wine/winbase.h"
#include "com.h"
#ifdef AVIFILE
#ifdef __GNUC__
#include "avm_output.h"
#ifndef __cplusplus
#define printf(a, ...) avm_printf("Win32 plugin", a, ## __VA_ARGS__)
#endif
#endif
#endif
extern void my_garbagecollection(void);
typedef struct {
UINT uDriverSignature;
HINSTANCE hDriverModule;
DRIVERPROC DriverProc;
DWORD dwDriverID;
} DRVR;
typedef DRVR *PDRVR;
typedef DRVR *NPDRVR;
typedef DRVR *LPDRVR;
typedef struct tls_s tls_t;
extern void* LookupExternal(const char* library, int ordinal);
extern void* LookupExternalByName(const char* library, const char* name);
#endif
This diff is collapsed.
This diff is collapsed.
#ifndef __WINE_DEBUGTOOLS_H
#define __WINE_DEBUGTOOLS_H
#ifdef __WINE__ /* Debugging interface is internal to Wine */
#include <stdarg.h>
#include "config.h"
#include "windef.h"
struct _GUID;
/* Internal definitions (do not use these directly) */
enum __DEBUG_CLASS { __DBCL_FIXME, __DBCL_ERR, __DBCL_WARN, __DBCL_TRACE, __DBCL_COUNT };
#ifndef NO_TRACE_MSGS
# define __GET_DEBUGGING_trace(dbch) ((dbch)[0] & (1 << __DBCL_TRACE))
#else
# define __GET_DEBUGGING_trace(dbch) 0
#endif
#ifndef NO_DEBUG_MSGS
# define __GET_DEBUGGING_warn(dbch) ((dbch)[0] & (1 << __DBCL_WARN))
# define __GET_DEBUGGING_fixme(dbch) ((dbch)[0] & (1 << __DBCL_FIXME))
#else
# define __GET_DEBUGGING_warn(dbch) 0
# define __GET_DEBUGGING_fixme(dbch) 0
#endif
/* define error macro regardless of what is configured */
#define __GET_DEBUGGING_err(dbch) ((dbch)[0] & (1 << __DBCL_ERR))
#define __GET_DEBUGGING(dbcl,dbch) __GET_DEBUGGING_##dbcl(dbch)
#define __SET_DEBUGGING(dbcl,dbch,on) \
((on) ? ((dbch)[0] |= 1 << (dbcl)) : ((dbch)[0] &= ~(1 << (dbcl))))
#ifndef __GNUC__
#define __FUNCTION__ ""
#endif
#define __DPRINTF(dbcl,dbch) \
(!__GET_DEBUGGING(dbcl,(dbch)) || (dbg_header_##dbcl((dbch),__FUNCTION__),0)) ? \
(void)0 : (void)dbg_printf
/* Exported definitions and macros */
/* These function return a printable version of a string, including
quotes. The string will be valid for some time, but not indefinitely
as strings are re-used. */
extern LPCSTR debugstr_an (LPCSTR s, int n);
extern LPCSTR debugstr_wn (LPCWSTR s, int n);
extern LPCSTR debugres_a (LPCSTR res);
extern LPCSTR debugres_w (LPCWSTR res);
extern LPCSTR debugstr_guid( const struct _GUID *id );
extern LPCSTR debugstr_hex_dump (const void *ptr, int len);
extern int dbg_header_err( const char *dbg_channel, const char *func );
extern int dbg_header_warn( const char *dbg_channel, const char *func );
extern int dbg_header_fixme( const char *dbg_channel, const char *func );
extern int dbg_header_trace( const char *dbg_channel, const char *func );
extern int dbg_vprintf( const char *format, va_list args );
static inline LPCSTR debugstr_a( LPCSTR s ) { return debugstr_an( s, 80 ); }
static inline LPCSTR debugstr_w( LPCWSTR s ) { return debugstr_wn( s, 80 ); }
#ifdef __GNUC__
extern int dbg_printf(const char *format, ...) __attribute__((format (printf,1,2)));
#else
extern int dbg_printf(const char *format, ...);
#endif
#define TRACE_(X) TRACE
#define WARN_(X) TRACE
#define WARN TRACE
#define ERR_(X) printf
#define ERR printf
#define FIXME_(X) TRACE
#define FIXME TRACE
#define TRACE_ON(X) 1
#define ERR_ON(X) 1
#define DECLARE_DEBUG_CHANNEL(ch) \
extern char dbch_##ch[];
#define DEFAULT_DEBUG_CHANNEL(ch) \
extern char dbch_##ch[]; static char * const __dbch_default = dbch_##ch;
#define DPRINTF dbg_printf
#define MESSAGE dbg_printf
#endif /* __WINE__ */
#endif /* __WINE_DEBUGTOOLS_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
extras/misc/mpris.xml
modules/codec/loader/driver.c
modules/codec/loader/ldt_keeper.c
modules/codec/wmafixed/bswap.h
modules/access/dvb/scan.c
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment