Mercurial > mplayer.hg
comparison loader/qtx/qtxload.c @ 2502:67d859e9c29e
fixed, rotfl :p
author | alex |
---|---|
date | Sat, 27 Oct 2001 18:05:29 +0000 |
parents | d12f90b7d773 |
children | 1616ad8fec1b |
comparison
equal
deleted
inserted
replaced
2501:d12f90b7d773 | 2502:67d859e9c29e |
---|---|
25 { | 25 { |
26 void *handler; | 26 void *handler; |
27 void *dispatcher; | 27 void *dispatcher; |
28 | 28 |
29 Setup_LDT_Keeper(); | 29 Setup_LDT_Keeper(); |
30 Setup_FS_Segment(); | |
31 | 30 |
32 handler = expLoadLibraryA("/usr/lib/win32/qtx/test.qtx"); | 31 handler = expLoadLibraryA("/usr/lib/win32/qtx/test.qtx"); |
33 dispatcher = GetProcAddress(handler, "CDComponentDispatch"); | 32 dispatcher = GetProcAddress(handler, "CDComponentDispatch"); |
34 printf("handler: %p, dispatcher: %p\n", handler, dispatcher); | 33 printf("handler: %p, dispatcher: %p\n", handler, dispatcher); |
35 | 34 |
36 { | 35 { |
37 ComponentResult ret; | 36 ComponentResult ret; |
38 int (*dispatcher_func)(void *, void *); | 37 int (*dispatcher_func)(void *, void *); |
39 struct ComponentParameters params; | 38 struct ComponentParameters *params; |
40 void *globals; | 39 void *globals; |
40 | |
41 dispatcher_func = dispatcher; | |
41 | 42 |
42 globals = malloc(sizeof(long)); | 43 globals = malloc(sizeof(long)); |
43 (long)*(void **)globals = 0x2001; | 44 (long)*(void **)globals = 0x2001; |
44 | 45 |
45 params.flags = 0; | 46 params = malloc(sizeof(struct ComponentParameters)); |
46 params.paramSize = sizeof(params); | 47 |
47 params.what = 2; /* probarly register :p */ | 48 params->flags = 0; |
48 params.params[0] = -1; | 49 params->paramSize = sizeof(params); |
49 params.params[1] = -1; | 50 params->what = 0x3f; /* probarly register :p */ |
50 memset(¶ms.params[0], 0x77, sizeof(params.params)*2); | 51 params->params[0] = 0x1984; |
51 // params.params[1] = 0x1000100f; | |
52 /* 0x1000100f will load QuickTime.qts */ | 52 /* 0x1000100f will load QuickTime.qts */ |
53 /* 0x10001014 will use SendMessageA */ | 53 /* 0x10001014 will use SendMessageA */ |
54 /* 0x10001019 returns 0 */ | 54 /* 0x10001019 returns 0 */ |
55 /* 0x1000101e will load QuickTime.qts */ | 55 /* 0x1000101e will load QuickTime.qts */ |
56 /* 0x10001028 returns params' addr */ | 56 /* 0x10001028 returns params' addr */ |
57 /* 0x1000102d is a dialog */ | 57 /* 0x1000102d is a dialog */ |
58 /* 0x10001032 returns 20001 => CDVersion */ | 58 /* 0x10001032 returns 20001 => CDVersion */ |
59 /* 0x10001069 returns 8a */ | 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", | 60 printf("params: flags: %d, paramSize: %d, what: %d\n", |
64 params.flags, params.paramSize, params.what); | 61 params->flags, params->paramSize, params->what); |
65 printf("params[0] = %x, params[1] = %x\n", params.params[0], | 62 printf("params[0] = %x\n", params->params[0]); |
66 params.params[1]); | |
67 ret = dispatcher_func(¶ms, globals); | 63 ret = dispatcher_func(¶ms, globals); |
68 printf("CDComponentDispatch(%p, %p) => %x\n", | 64 printf("CDComponentDispatch(%p, %p) => %x\n", |
69 ¶ms, globals, ret); | 65 ¶ms, globals, ret); |
70 free(globals); | 66 free(globals); |
71 printf("params: flags: %d, paramSize: %d, what: %d\n", | 67 free(params); |
72 params.flags, params.paramSize, params.what); | |
73 printf("params[0] = %x, params[1] = %x\n", params.params[0], | |
74 params.params[1]); | |
75 } | 68 } |
76 | 69 |
77 Restore_LDT_Keeper(); | 70 Restore_LDT_Keeper(); |
78 } | 71 } |