Mercurial > mplayer.hg
comparison loader/qtx/qtxload.c @ 2501:d12f90b7d773
devel
author | alex |
---|---|
date | Sat, 27 Oct 2001 17:45:27 +0000 |
parents | |
children | 67d859e9c29e |
comparison
equal
deleted
inserted
replaced
2500:8858ff8ab415 | 2501:d12f90b7d773 |
---|---|
1 #include <stdio.h> | |
2 #include "qtxsdk/components.h" | |
3 | |
4 #define DEF_DISPATCHER(name) ComponentResult (*##name)(struct ComponentParameters *, void **) | |
5 | |
6 /* ilyen egy sima komponens */ | |
7 ComponentResult ComponentDummy( | |
8 struct ComponentParameters *params, | |
9 void **globals, | |
10 DEF_DISPATCHER(ComponentDispatch)) | |
11 { | |
12 printf("ComponentDummy(params: %p, globals: %p, dispatcher: %p) called!\n", | |
13 params, globals, ComponentDispatch); | |
14 printf(" Dummy: global datas: %p\n", *globals); | |
15 printf(" Dummy: returning 0\n"); | |
16 return(0); | |
17 } | |
18 | |
19 char *get_path() | |
20 { | |
21 return("."); | |
22 } | |
23 | |
24 main() | |
25 { | |
26 void *handler; | |
27 void *dispatcher; | |
28 | |
29 Setup_LDT_Keeper(); | |
30 Setup_FS_Segment(); | |
31 | |
32 handler = expLoadLibraryA("/usr/lib/win32/qtx/test.qtx"); | |
33 dispatcher = GetProcAddress(handler, "CDComponentDispatch"); | |
34 printf("handler: %p, dispatcher: %p\n", handler, dispatcher); | |
35 | |
36 { | |
37 ComponentResult ret; | |
38 int (*dispatcher_func)(void *, void *); | |
39 struct ComponentParameters params; | |
40 void *globals; | |
41 | |
42 globals = malloc(sizeof(long)); | |
43 (long)*(void **)globals = 0x2001; | |
44 | |
45 params.flags = 0; | |
46 params.paramSize = sizeof(params); | |
47 params.what = 2; /* probarly register :p */ | |
48 params.params[0] = -1; | |
49 params.params[1] = -1; | |
50 memset(¶ms.params[0], 0x77, sizeof(params.params)*2); | |
51 // params.params[1] = 0x1000100f; | |
52 /* 0x1000100f will load QuickTime.qts */ | |
53 /* 0x10001014 will use SendMessageA */ | |
54 /* 0x10001019 returns 0 */ | |
55 /* 0x1000101e will load QuickTime.qts */ | |
56 /* 0x10001028 returns params' addr */ | |
57 /* 0x1000102d is a dialog */ | |
58 /* 0x10001032 returns 20001 => CDVersion */ | |
59 /* 0x10001069 returns 8a */ | |
60 // params.params[0] = 0x1984; | |
61 // params.params[1] = 0x1337; | |
62 // params.params[1] = ComponentDummy; | |
63 printf("params: flags: %d, paramSize: %d, what: %d\n", | |
64 params.flags, params.paramSize, params.what); | |
65 printf("params[0] = %x, params[1] = %x\n", params.params[0], | |
66 params.params[1]); | |
67 ret = dispatcher_func(¶ms, globals); | |
68 printf("CDComponentDispatch(%p, %p) => %x\n", | |
69 ¶ms, globals, ret); | |
70 free(globals); | |
71 printf("params: flags: %d, paramSize: %d, what: %d\n", | |
72 params.flags, params.paramSize, params.what); | |
73 printf("params[0] = %x, params[1] = %x\n", params.params[0], | |
74 params.params[1]); | |
75 } | |
76 | |
77 Restore_LDT_Keeper(); | |
78 } |