[Mplayer-cvslog] CVS: main/loader/qtx qtxload.c,1.5,1.6
Arpi of Ize
arpi at mplayer.dev.hu
Sat Nov 10 19:06:49 CET 2001
Update of /cvsroot/mplayer/main/loader/qtx
In directory mplayer:/var/tmp.root/cvs-serv16614
Modified Files:
qtxload.c
Log Message:
still sig11
Index: qtxload.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/qtx/qtxload.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- qtxload.c 9 Nov 2001 03:26:48 -0000 1.5
+++ qtxload.c 10 Nov 2001 18:06:47 -0000 1.6
@@ -1,6 +1,9 @@
/* to compile: gcc -o qtxload qtxload.c ../libloader.a -lpthread -ldl -ggdb ../../cpudetect.o */
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "qtxsdk/components.h"
#include "qtxsdk/select.h"
@@ -19,54 +22,62 @@
return(0);
}
-char *get_path()
-{
- return(".");
-}
+char *get_path(char* x){ return strdup(x);}
-main(int argc, char *argv[])
-{
+void* expLoadLibraryA(char* name);
+void* GetProcAddress(void* handle,char* func);
+
+#define __stdcall __attribute__((__stdcall__))
+#define __cdecl __attribute__((__cdecl__))
+#define APIENTRY
+
+int main(int argc, char *argv[]){
void *handler;
- ComponentResult (*
dispatcher)(ComponentParameters *params, void* glob);
+ ComponentResult (APIENTRY *
dispatcher)(ComponentParameters *params, Globals glob);
+ ComponentResult ret;
+ ComponentParameters *params;
+ ComponentDescription desc;
+ void *globals=NULL;
+ unsigned int esp=0;
Setup_LDT_Keeper();
-
handler = expLoadLibraryA("/usr/lib/win32/QuickTime.qts");
dispatcher = GetProcAddress(handler, "SorensonYUV9Dispatcher");
+// handler = expLoadLibraryA("/usr/lib/win32/On2_VP3.qtx");
+// dispatcher = GetProcAddress(handler, "CDComponentDispatcher");
printf("handler: %p, dispatcher: %p\n", handler, dispatcher);
+
+ desc.componentType=0;
+ desc.componentSubType=0;
+ desc.componentManufacturer=0;
+ desc.componentFlags=0;
+ desc.componentFlagsMask=0;
- {
- ComponentResult ret;
- ComponentParameters *params;
- void *globals;
-
- globals = malloc(sizeof(long));
- (long)*(void **)globals = 0x2001;
-
- params = malloc(sizeof(ComponentParameters));
-
- params->flags = 0;
- params->paramSize = sizeof(params);
- params->what = kComponentVersionSelect;
- // params->what = kComponentRegisterSelect;
- // params->what = kComponentOpenSelect;
- // params->what = -5; //atoi(argv[1]);
-
- params->params[0] = 0x1984;
-
- printf("params: flags: %d, paramSize: %d, what: %d\n",
- params->flags, params->paramSize, params->what);
- printf("params[0] = %x\n", params->params[0]);
-
- ret = dispatcher(params, globals);
-
- printf("!!! CDComponentDispatch() => %x\n",ret);
-
-// printf("!!! CDComponentDispatch(%p, %p) => %x\n",
-// ¶ms, globals, ret);
-// free(globals);
-// free(params);
- }
+ params = malloc(sizeof(ComponentParameters)+2048);
+
+ params->flags = 0;
+ params->paramSize = sizeof(params->params[0]);
+ params->params[0] = 0x12345678;
+
+ // params->what = kComponentVersionSelect;
+ // params->what = kComponentRegisterSelect;
+ params->what = kComponentOpenSelect;
+ // params->what = kComponentCanDoSelect;
+
+ printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n",
+ params->flags, params->paramSize, params->what, params->params[0]);
+
+ __asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
+ printf("ESP=%p\n",esp);
+
+ ret = dispatcher(params, &globals);
+
+ __asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
+ printf("ESP=%p\n",esp);
+
+ printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals);
-// Restore_LDT_Keeper();
+ Restore_LDT_Keeper();
+ exit(0);
+ //return 0;
}
More information about the MPlayer-cvslog
mailing list