Mercurial > mplayer.hg
annotate loader/module.c @ 25817:883c6c3ae041
Add new command to switch between dvdnav titles
Based on parts of dvdnav monster patches from Otvos Attila
author | ben |
---|---|
date | Thu, 24 Jan 2008 19:14:05 +0000 |
parents | c8c9b4e89fb7 |
children | b70f5ac9c001 |
rev | line source |
---|---|
1 | 1 /* |
2 * Modules | |
3 * | |
4 * Copyright 1995 Alexandre Julliard | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13745
diff
changeset
|
5 * |
18783 | 6 * Modified for use with MPlayer, detailed changelog at |
7 * http://svn.mplayerhq.hu/mplayer/trunk/ | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13745
diff
changeset
|
8 * $Id$ |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13745
diff
changeset
|
9 * |
1 | 10 */ |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
11 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
12 // define for quicktime calls debugging and/or MacOS-level emulation: |
21290
efc774a1e5a4
fix compilation for win32 dll codec support for intel osx
nplourde
parents:
21261
diff
changeset
|
13 #ifndef __APPLE__ |
8286
1a9ea966d840
patching out threads ;) raw measure: 18% cpu instead 30%
alex
parents:
8277
diff
changeset
|
14 #define EMU_QTX_API |
21290
efc774a1e5a4
fix compilation for win32 dll codec support for intel osx
nplourde
parents:
21261
diff
changeset
|
15 #endif /* __APPLE__ */ |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
16 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
17 // define for quicktime debugging (verbose logging): |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
18 //#define DEBUG_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
19 |
3465 | 20 #include "config.h" |
21261
a2e02e6b6379
Rename config.h --> debug.h and include config.h explicitly.
diego
parents:
18878
diff
changeset
|
21 #include "debug.h" |
1 | 22 |
23 #include <assert.h> | |
24 #include <errno.h> | |
25 #include <fcntl.h> | |
26 #include <stdio.h> | |
27 #include <stdlib.h> | |
28 #include <string.h> | |
29 #include <unistd.h> | |
30 #include <sys/mman.h> | |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
31 #include <inttypes.h> |
1 | 32 |
7386 | 33 #include "wine/windef.h" |
34 #include "wine/winerror.h" | |
35 #include "wine/heap.h" | |
36 #include "wine/module.h" | |
37 #include "wine/pe_image.h" | |
38 #include "wine/debugtools.h" | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
39 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
40 #undef HAVE_LIBDL |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
41 |
2069 | 42 #ifdef HAVE_LIBDL |
43 #include <dlfcn.h> | |
7386 | 44 #include "wine/elfdll.h" |
2069 | 45 #endif |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
46 #include "win32.h" |
7386 | 47 #include "driver.h" |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
48 |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
49 #ifdef EMU_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
50 #include "wrapper.h" |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
51 static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags); |
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
52 static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
53 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
54 |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
55 //#undef TRACE |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
56 //#define TRACE printf |
1 | 57 |
58 //WINE_MODREF *local_wm=NULL; | |
59 modref_list* local_wm=NULL; | |
60 | |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
61 HANDLE SegptrHeap; |
2069 | 62 |
3465 | 63 WINE_MODREF* MODULE_FindModule(LPCSTR m) |
1 | 64 { |
65 modref_list* list=local_wm; | |
8277 | 66 TRACE("FindModule: Module %s request\n", m); |
1 | 67 if(list==NULL) |
68 return NULL; | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
69 // while(strcmp(m, list->wm->filename)) |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
70 while(!strstr(list->wm->filename, m)) |
1 | 71 { |
128 | 72 TRACE("%s: %x\n", list->wm->filename, list->wm->module); |
1 | 73 list=list->prev; |
74 if(list==NULL) | |
75 return NULL; | |
2069 | 76 } |
1 | 77 TRACE("Resolved to %s\n", list->wm->filename); |
78 return list->wm; | |
2069 | 79 } |
1 | 80 |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
81 static void MODULE_RemoveFromList(WINE_MODREF *mod) |
1 | 82 { |
83 modref_list* list=local_wm; | |
84 if(list==0) | |
85 return; | |
86 if(mod==0) | |
87 return; | |
88 if((list->prev==NULL)&&(list->next==NULL)) | |
89 { | |
90 free(list); | |
91 local_wm=NULL; | |
92 // uninstall_fs(); | |
93 return; | |
94 } | |
95 for(;list;list=list->prev) | |
96 { | |
97 if(list->wm==mod) | |
98 { | |
99 if(list->prev) | |
100 list->prev->next=list->next; | |
101 if(list->next) | |
102 list->next->prev=list->prev; | |
103 if(list==local_wm) | |
104 local_wm=list->prev; | |
105 free(list); | |
106 return; | |
107 } | |
108 } | |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
109 |
2069 | 110 } |
111 | |
1 | 112 WINE_MODREF *MODULE32_LookupHMODULE(HMODULE m) |
113 { | |
114 modref_list* list=local_wm; | |
8277 | 115 TRACE("LookupHMODULE: Module %X request\n", m); |
1 | 116 if(list==NULL) |
8277 | 117 { |
118 TRACE("LookupHMODULE failed\n"); | |
1 | 119 return NULL; |
8277 | 120 } |
1 | 121 while(m!=list->wm->module) |
122 { | |
123 // printf("Checking list %X wm %X module %X\n", | |
124 // list, list->wm, list->wm->module); | |
125 list=list->prev; | |
126 if(list==NULL) | |
8277 | 127 { |
128 TRACE("LookupHMODULE failed\n"); | |
1 | 129 return NULL; |
8277 | 130 } |
2069 | 131 } |
132 TRACE("LookupHMODULE hit %p\n", list->wm); | |
1 | 133 return list->wm; |
2069 | 134 } |
1 | 135 |
136 /************************************************************************* | |
137 * MODULE_InitDll | |
138 */ | |
139 static WIN_BOOL MODULE_InitDll( WINE_MODREF *wm, DWORD type, LPVOID lpReserved ) | |
140 { | |
141 WIN_BOOL retv = TRUE; | |
142 | |
25798
c8c9b4e89fb7
Surround variable declarations by preprocessor conditionals to avoid warnings:
diego
parents:
25794
diff
changeset
|
143 #ifdef DEBUG |
2069 | 144 static LPCSTR typeName[] = { "PROCESS_DETACH", "PROCESS_ATTACH", |
1 | 145 "THREAD_ATTACH", "THREAD_DETACH" }; |
25798
c8c9b4e89fb7
Surround variable declarations by preprocessor conditionals to avoid warnings:
diego
parents:
25794
diff
changeset
|
146 #endif |
c8c9b4e89fb7
Surround variable declarations by preprocessor conditionals to avoid warnings:
diego
parents:
25794
diff
changeset
|
147 |
1 | 148 assert( wm ); |
149 | |
150 | |
151 /* Skip calls for modules loaded with special load flags */ | |
152 | |
153 if ( ( wm->flags & WINE_MODREF_DONT_RESOLVE_REFS ) | |
154 || ( wm->flags & WINE_MODREF_LOAD_AS_DATAFILE ) ) | |
155 return TRUE; | |
156 | |
157 | |
158 TRACE("(%s,%s,%p) - CALL\n", wm->modname, typeName[type], lpReserved ); | |
159 | |
160 /* Call the initialization routine */ | |
161 switch ( wm->type ) | |
162 { | |
163 case MODULE32_PE: | |
164 retv = PE_InitDLL( wm, type, lpReserved ); | |
165 break; | |
166 | |
167 case MODULE32_ELF: | |
168 /* no need to do that, dlopen() already does */ | |
169 break; | |
170 | |
171 default: | |
172 ERR("wine_modref type %d not handled.\n", wm->type ); | |
173 retv = FALSE; | |
174 break; | |
175 } | |
176 | |
177 /* The state of the module list may have changed due to the call | |
178 to PE_InitDLL. We cannot assume that this module has not been | |
179 deleted. */ | |
180 TRACE("(%p,%s,%p) - RETURN %d\n", wm, typeName[type], lpReserved, retv ); | |
181 | |
182 return retv; | |
183 } | |
184 | |
185 /************************************************************************* | |
186 * MODULE_DllProcessAttach | |
2069 | 187 * |
1 | 188 * Send the process attach notification to all DLLs the given module |
189 * depends on (recursively). This is somewhat complicated due to the fact that | |
190 * | |
191 * - we have to respect the module dependencies, i.e. modules implicitly | |
192 * referenced by another module have to be initialized before the module | |
193 * itself can be initialized | |
2069 | 194 * |
1 | 195 * - the initialization routine of a DLL can itself call LoadLibrary, |
196 * thereby introducing a whole new set of dependencies (even involving | |
197 * the 'old' modules) at any time during the whole process | |
198 * | |
199 * (Note that this routine can be recursively entered not only directly | |
200 * from itself, but also via LoadLibrary from one of the called initialization | |
201 * routines.) | |
202 * | |
203 * Furthermore, we need to rearrange the main WINE_MODREF list to allow | |
204 * the process *detach* notifications to be sent in the correct order. | |
2069 | 205 * This must not only take into account module dependencies, but also |
1 | 206 * 'hidden' dependencies created by modules calling LoadLibrary in their |
207 * attach notification routine. | |
208 * | |
209 * The strategy is rather simple: we move a WINE_MODREF to the head of the | |
210 * list after the attach notification has returned. This implies that the | |
211 * detach notifications are called in the reverse of the sequence the attach | |
212 * notifications *returned*. | |
213 * | |
214 * NOTE: Assumes that the process critical section is held! | |
215 * | |
216 */ | |
3465 | 217 static WIN_BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved ) |
1 | 218 { |
219 WIN_BOOL retv = TRUE; | |
24382 | 220 //int i; |
1 | 221 assert( wm ); |
222 | |
223 /* prevent infinite recursion in case of cyclical dependencies */ | |
224 if ( ( wm->flags & WINE_MODREF_MARKER ) | |
225 || ( wm->flags & WINE_MODREF_PROCESS_ATTACHED ) ) | |
226 return retv; | |
227 | |
228 TRACE("(%s,%p) - START\n", wm->modname, lpReserved ); | |
229 | |
230 /* Tag current MODREF to prevent recursive loop */ | |
231 wm->flags |= WINE_MODREF_MARKER; | |
232 | |
233 /* Recursively attach all DLLs this one depends on */ | |
234 /* for ( i = 0; retv && i < wm->nDeps; i++ ) | |
235 if ( wm->deps[i] ) | |
236 retv = MODULE_DllProcessAttach( wm->deps[i], lpReserved ); | |
237 */ | |
238 /* Call DLL entry point */ | |
239 | |
240 //local_wm=wm; | |
241 if(local_wm) | |
242 { | |
7386 | 243 local_wm->next = (modref_list*) malloc(sizeof(modref_list)); |
1 | 244 local_wm->next->prev=local_wm; |
245 local_wm->next->next=NULL; | |
246 local_wm->next->wm=wm; | |
247 local_wm=local_wm->next; | |
248 } | |
249 else | |
250 { | |
18878 | 251 local_wm = malloc(sizeof(modref_list)); |
1 | 252 local_wm->next=local_wm->prev=NULL; |
253 local_wm->wm=wm; | |
2069 | 254 } |
1 | 255 /* Remove recursion flag */ |
256 wm->flags &= ~WINE_MODREF_MARKER; | |
2069 | 257 |
1 | 258 if ( retv ) |
259 { | |
260 retv = MODULE_InitDll( wm, DLL_PROCESS_ATTACH, lpReserved ); | |
261 if ( retv ) | |
262 wm->flags |= WINE_MODREF_PROCESS_ATTACHED; | |
263 } | |
264 | |
265 | |
266 TRACE("(%s,%p) - END\n", wm->modname, lpReserved ); | |
267 | |
268 return retv; | |
269 } | |
270 | |
271 /************************************************************************* | |
272 * MODULE_DllProcessDetach | |
2069 | 273 * |
274 * Send DLL process detach notifications. See the comment about calling | |
1 | 275 * sequence at MODULE_DllProcessAttach. Unless the bForceDetach flag |
276 * is set, only DLLs with zero refcount are notified. | |
277 */ | |
3465 | 278 static void MODULE_DllProcessDetach( WINE_MODREF* wm, WIN_BOOL bForceDetach, LPVOID lpReserved ) |
1 | 279 { |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
280 // WINE_MODREF *wm=local_wm; |
24382 | 281 //modref_list* l = local_wm; |
1 | 282 wm->flags &= ~WINE_MODREF_PROCESS_ATTACHED; |
283 MODULE_InitDll( wm, DLL_PROCESS_DETACH, lpReserved ); | |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
284 /* while (l) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
285 { |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
286 modref_list* f = l; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
287 l = l->next; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
288 free(f); |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
289 } |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
290 local_wm = 0;*/ |
1 | 291 } |
292 | |
3465 | 293 /*********************************************************************** |
294 * MODULE_LoadLibraryExA (internal) | |
295 * | |
296 * Load a PE style module according to the load order. | |
297 * | |
298 * The HFILE parameter is not used and marked reserved in the SDK. I can | |
299 * only guess that it should force a file to be mapped, but I rather | |
300 * ignore the parameter because it would be extremely difficult to | |
301 * integrate this with different types of module represenations. | |
302 * | |
303 */ | |
304 static WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags ) | |
305 { | |
306 DWORD err = GetLastError(); | |
307 WINE_MODREF *pwm; | |
308 // module_loadorder_t *plo; | |
309 | |
310 SetLastError( ERROR_FILE_NOT_FOUND ); | |
311 TRACE("Trying native dll '%s'\n", libname); | |
312 pwm = PE_LoadLibraryExA(libname, flags); | |
313 #ifdef HAVE_LIBDL | |
314 if(!pwm) | |
315 { | |
316 TRACE("Trying ELF dll '%s'\n", libname); | |
317 pwm=(WINE_MODREF*)ELFDLL_LoadLibraryExA(libname, flags); | |
318 } | |
319 #endif | |
320 // printf("0x%08x\n", pwm); | |
321 // break; | |
322 if(pwm) | |
323 { | |
324 /* Initialize DLL just loaded */ | |
325 TRACE("Loaded module '%s' at 0x%08x, \n", libname, pwm->module); | |
326 /* Set the refCount here so that an attach failure will */ | |
327 /* decrement the dependencies through the MODULE_FreeLibrary call. */ | |
328 pwm->refCount++; | |
329 | |
330 SetLastError( err ); /* restore last error */ | |
331 return pwm; | |
332 } | |
333 | |
334 | |
335 WARN("Failed to load module '%s'; error=0x%08lx, \n", libname, GetLastError()); | |
336 return NULL; | |
337 } | |
338 | |
339 /*********************************************************************** | |
340 * MODULE_FreeLibrary | |
341 * | |
342 * NOTE: Assumes that the process critical section is held! | |
343 */ | |
344 static WIN_BOOL MODULE_FreeLibrary( WINE_MODREF *wm ) | |
345 { | |
346 TRACE("(%s) - START\n", wm->modname ); | |
347 | |
348 /* Recursively decrement reference counts */ | |
349 //MODULE_DecRefCount( wm ); | |
350 | |
351 /* Call process detach notifications */ | |
352 MODULE_DllProcessDetach( wm, FALSE, NULL ); | |
353 | |
354 PE_UnloadLibrary(wm); | |
355 | |
356 TRACE("END\n"); | |
357 | |
358 return TRUE; | |
359 } | |
1 | 360 |
361 /*********************************************************************** | |
362 * LoadLibraryExA (KERNEL32) | |
363 */ | |
364 HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) | |
365 { | |
2069 | 366 WINE_MODREF *wm = 0; |
367 char* listpath[] = { "", "", "/usr/lib/win32", "/usr/local/lib/win32", 0 }; | |
368 extern char* def_path; | |
369 char path[512]; | |
370 char checked[2000]; | |
371 int i = -1; | |
1 | 372 |
2069 | 373 checked[0] = 0; |
1 | 374 if(!libname) |
375 { | |
376 SetLastError(ERROR_INVALID_PARAMETER); | |
377 return 0; | |
378 } | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
379 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
380 wm=MODULE_FindModule(libname); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
381 if(wm) return wm->module; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
382 |
3465 | 383 // if(fs_installed==0) |
384 // install_fs(); | |
2069 | 385 |
386 while (wm == 0 && listpath[++i]) | |
387 { | |
388 if (i < 2) | |
389 { | |
390 if (i == 0) | |
391 /* check just original file name */ | |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
392 strncpy(path, libname, 511); |
2069 | 393 else |
394 /* check default user path */ | |
395 strncpy(path, def_path, 300); | |
396 } | |
397 else if (strcmp(def_path, listpath[i])) | |
398 /* path from the list */ | |
399 strncpy(path, listpath[i], 300); | |
400 else | |
401 continue; | |
1 | 402 |
2069 | 403 if (i > 0) |
404 { | |
405 strcat(path, "/"); | |
406 strncat(path, libname, 100); | |
407 } | |
408 path[511] = 0; | |
409 wm = MODULE_LoadLibraryExA( path, hfile, flags ); | |
410 | |
411 if (!wm) | |
412 { | |
413 if (checked[0]) | |
414 strcat(checked, ", "); | |
415 strcat(checked, path); | |
416 checked[1500] = 0; | |
417 | |
418 } | |
419 } | |
1 | 420 if ( wm ) |
421 { | |
422 if ( !MODULE_DllProcessAttach( wm, NULL ) ) | |
423 { | |
424 WARN_(module)("Attach failed for module '%s', \n", libname); | |
425 MODULE_FreeLibrary(wm); | |
426 SetLastError(ERROR_DLL_INIT_FAILED); | |
427 MODULE_RemoveFromList(wm); | |
428 wm = NULL; | |
429 } | |
430 } | |
431 | |
25418
0cc73d213160
Stop MPlayer from complaining about bogus AviSynth DLL load failures.
diego
parents:
24382
diff
changeset
|
432 if (!wm && !strstr(checked, "avisynth.dll")) |
2069 | 433 printf("Win32 LoadLibrary failed to load: %s\n", checked); |
7386 | 434 |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
435 #define RVA(x) ((char *)wm->module+(unsigned int)(x)) |
13621
8c6b747eeacf
runtime patching vp31vfw.dll, so non-patched dlls can be used aswell. note: this does not breaks if the dll is already patched
alex
parents:
13182
diff
changeset
|
436 if (strstr(libname,"vp31vfw.dll") && wm) |
8c6b747eeacf
runtime patching vp31vfw.dll, so non-patched dlls can be used aswell. note: this does not breaks if the dll is already patched
alex
parents:
13182
diff
changeset
|
437 { |
8c6b747eeacf
runtime patching vp31vfw.dll, so non-patched dlls can be used aswell. note: this does not breaks if the dll is already patched
alex
parents:
13182
diff
changeset
|
438 int i; |
8c6b747eeacf
runtime patching vp31vfw.dll, so non-patched dlls can be used aswell. note: this does not breaks if the dll is already patched
alex
parents:
13182
diff
changeset
|
439 |
8c6b747eeacf
runtime patching vp31vfw.dll, so non-patched dlls can be used aswell. note: this does not breaks if the dll is already patched
alex
parents:
13182
diff
changeset
|
440 // sse hack moved from patch dll into runtime patching |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
441 if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x1000)) { |
13621
8c6b747eeacf
runtime patching vp31vfw.dll, so non-patched dlls can be used aswell. note: this does not breaks if the dll is already patched
alex
parents:
13182
diff
changeset
|
442 fprintf(stderr, "VP3 DLL found\n"); |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
443 for (i=0;i<18;i++) RVA(0x4bd6)[i]=0x90; |
13621
8c6b747eeacf
runtime patching vp31vfw.dll, so non-patched dlls can be used aswell. note: this does not breaks if the dll is already patched
alex
parents:
13182
diff
changeset
|
444 } |
8c6b747eeacf
runtime patching vp31vfw.dll, so non-patched dlls can be used aswell. note: this does not breaks if the dll is already patched
alex
parents:
13182
diff
changeset
|
445 } |
8c6b747eeacf
runtime patching vp31vfw.dll, so non-patched dlls can be used aswell. note: this does not breaks if the dll is already patched
alex
parents:
13182
diff
changeset
|
446 |
12042 | 447 // remove a few divs in the VP codecs that make trouble |
448 if (strstr(libname,"vp5vfw.dll") && wm) | |
449 { | |
450 int i; | |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
451 if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3930)) { |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
452 for (i=0;i<3;i++) RVA(0x4e86)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
453 for (i=0;i<3;i++) RVA(0x5a23)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
454 for (i=0;i<3;i++) RVA(0x5bff)[i]=0x90; |
12042 | 455 } else { |
456 fprintf(stderr, "Unsupported VP5 version\n"); | |
457 return 0; | |
458 } | |
459 } | |
460 | |
461 if (strstr(libname,"vp6vfw.dll") && wm) | |
462 { | |
463 int i; | |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
464 if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3ef0)) { |
12042 | 465 // looks like VP 6.1.0.2 |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
466 for (i=0;i<6;i++) RVA(0x7268)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
467 for (i=0;i<6;i++) RVA(0x7e83)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
468 for (i=0;i<6;i++) RVA(0x806a)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
469 } else if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x4120)) { |
12042 | 470 // looks like VP 6.2.0.10 |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
471 for (i=0;i<6;i++) RVA(0x7688)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
472 for (i=0;i<6;i++) RVA(0x82c3)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
473 for (i=0;i<6;i++) RVA(0x84aa)[i]=0x90; |
18628
ff4455b0bd7c
Nop some instructions causing the vfwvp6 dll encoder to crash.
banan
parents:
18617
diff
changeset
|
474 for (i=0;i<6;i++) RVA(0x1d2cc)[i]=0x90; |
ff4455b0bd7c
Nop some instructions causing the vfwvp6 dll encoder to crash.
banan
parents:
18617
diff
changeset
|
475 for (i=0;i<6;i++) RVA(0x2179d)[i]=0x90; |
ff4455b0bd7c
Nop some instructions causing the vfwvp6 dll encoder to crash.
banan
parents:
18617
diff
changeset
|
476 for (i=0;i<6;i++) RVA(0x1977f)[i]=0x90; |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
477 } else if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3e70)) { |
12422 | 478 // looks like VP 6.0.7.3 |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
479 for (i=0;i<6;i++) RVA(0x7559)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
480 for (i=0;i<6;i++) RVA(0x81c3)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
481 for (i=0;i<6;i++) RVA(0x839e)[i]=0x90; |
12042 | 482 } else { |
483 fprintf(stderr, "Unsupported VP6 version\n"); | |
484 return 0; | |
485 } | |
486 } | |
487 | |
13745
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
488 // Windows Media Video 9 Advanced |
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
489 if (strstr(libname,"wmvadvd.dll") && wm) |
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
490 { |
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
491 // The codec calls IsRectEmpty with coords 0,0,0,0 => result is 0 |
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
492 // but it really wants the rectangle to be not empty |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
493 if (PE_FindExportedFunction(wm, "CreateInstance", TRUE)==RVA(0xb812)) { |
13745
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
494 // Dll version is 10.0.0.3645 |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
495 *RVA(0x8b0f)=0xeb; // Jump always, ignoring IsRectEmpty result |
13745
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
496 } else { |
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
497 fprintf(stderr, "Unsupported WMVA version\n"); |
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
498 return 0; |
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
499 } |
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
500 } |
3db10035d297
Windows media video advanced profile (wmva) support via binary codec
rtognimp
parents:
13622
diff
changeset
|
501 |
8318
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
502 if (strstr(libname,"QuickTime.qts") && wm) |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
503 { |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
504 void** ptr; |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
505 void *dispatch_addr; |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
506 int i; |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
507 |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
508 // dispatch_addr = GetProcAddress(wm->module, "theQuickTimeDispatcher", TRUE); |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
509 dispatch_addr = PE_FindExportedFunction(wm, "theQuickTimeDispatcher", TRUE); |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
510 if (dispatch_addr == RVA(0x124c30)) |
8318
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
511 { |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
512 fprintf(stderr, "QuickTime5 DLLs found\n"); |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
513 ptr = (void **)RVA(0x375ca4); // dispatch_ptr |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
514 for (i=0;i<5;i++) RVA(0x19e842)[i]=0x90; // make_new_region ? |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
515 for (i=0;i<28;i++) RVA(0x19e86d)[i]=0x90; // call__call_CreateCompatibleDC ? |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
516 for (i=0;i<5;i++) RVA(0x19e898)[i]=0x90; // jmp_to_call_loadbitmap ? |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
517 for (i=0;i<9;i++) RVA(0x19e8ac)[i]=0x90; // call__calls_OLE_shit ? |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
518 for (i=0;i<106;i++) RVA(0x261b10)[i]=0x90; // disable threads |
8318
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
519 #if 0 |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
520 /* CreateThread callers */ |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
521 for (i=0;i<5;i++) RVA(0x1487c5)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
522 for (i=0;i<5;i++) RVA(0x14b275)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
523 for (i=0;i<5;i++) RVA(0x1a24b1)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
524 for (i=0;i<5;i++) RVA(0x1afc5a)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
525 for (i=0;i<5;i++) RVA(0x2f799c)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
526 for (i=0;i<5;i++) RVA(0x2f7efe)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
527 for (i=0;i<5;i++) RVA(0x2fa33e)[i]=0x90; |
8318
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
528 #endif |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
529 |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
530 #if 0 |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
531 /* TerminateQTML fix */ |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
532 for (i=0;i<47;i++) RVA(0x2fa3b8)[i]=0x90; // terminate thread |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
533 for (i=0;i<47;i++) RVA(0x2f7f78)[i]=0x90; // terminate thread |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
534 for (i=0;i<77;i++) RVA(0x1a13d5)[i]=0x90; |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
535 RVA(0x08e0ae)[0] = 0xc3; // font/dc remover |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
536 for (i=0;i<24;i++) RVA(0x07a1ad)[i]=0x90; // destroy window |
8318
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
537 #endif |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
538 } else if (dispatch_addr == RVA(0x13b330)) |
8318
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
539 { |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
540 fprintf(stderr, "QuickTime6 DLLs found\n"); |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
541 ptr = (void **)RVA(0x3b9524); // dispatcher_ptr |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
542 for (i=0;i<5;i++) RVA(0x2730cc)[i]=0x90; // make_new_region |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
543 for (i=0;i<28;i++) RVA(0x2730f7)[i]=0x90; // call__call_CreateCompatibleDC |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
544 for (i=0;i<5;i++) RVA(0x273122)[i]=0x90; // jmp_to_call_loadbitmap |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
545 for (i=0;i<9;i++) RVA(0x273131)[i]=0x90; // call__calls_OLE_shit |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
546 for (i=0;i<96;i++) RVA(0x2ac852)[i]=0x90; // disable threads |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
547 } else if (dispatch_addr == RVA(0x13c3e0)) |
10795
2ab9ab4f07b4
Support for QuickTime6.3 DLLs. Patch by Dima K. <dimakar@yahoo.com>
mosu
parents:
8451
diff
changeset
|
548 { |
2ab9ab4f07b4
Support for QuickTime6.3 DLLs. Patch by Dima K. <dimakar@yahoo.com>
mosu
parents:
8451
diff
changeset
|
549 fprintf(stderr, "QuickTime6.3 DLLs found\n"); |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
550 ptr = (void **)RVA(0x3ca01c); // dispatcher_ptr |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
551 for (i=0;i<5;i++) RVA(0x268f6c)[i]=0x90; // make_new_region |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
552 for (i=0;i<28;i++) RVA(0x268f97)[i]=0x90; // call__call_CreateCompatibleDC |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
553 for (i=0;i<5;i++) RVA(0x268fc2)[i]=0x90; // jmp_to_call_loadbitmap |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
554 for (i=0;i<9;i++) RVA(0x268fd1)[i]=0x90; // call__calls_OLE_shit |
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
555 for (i=0;i<96;i++) RVA(0x2b4722)[i]=0x90; // disable threads |
8318
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
556 } else |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
557 { |
8451 | 558 fprintf(stderr, "Unsupported QuickTime version (%p)\n", |
8318
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
559 dispatch_addr); |
8451 | 560 return 0; |
8318
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
561 } |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
562 |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
563 fprintf(stderr,"QuickTime.qts patched!!! old entry=%p\n",ptr[0]); |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
564 |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
565 #ifdef EMU_QTX_API |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
566 report_entry = report_func; |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
567 report_ret = report_func_ret; |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
568 wrapper_target=ptr[0]; |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
569 ptr[0]=wrapper; |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
570 #endif |
1ed329d61051
both qt5 and qt6 patching support (qt6 addresses found by arpi)
alex
parents:
8286
diff
changeset
|
571 } |
18617
8a1439ab0d51
Fix runtime-patching code to take into account the address when the codec is loaded.
reimar
parents:
15166
diff
changeset
|
572 #undef RVA |
2069 | 573 |
1 | 574 return wm ? wm->module : 0; |
575 } | |
576 | |
577 | |
578 /*********************************************************************** | |
579 * LoadLibraryA (KERNEL32) | |
580 */ | |
581 HMODULE WINAPI LoadLibraryA(LPCSTR libname) { | |
582 return LoadLibraryExA(libname,0,0); | |
583 } | |
584 | |
585 /*********************************************************************** | |
586 * FreeLibrary | |
587 */ | |
588 WIN_BOOL WINAPI FreeLibrary(HINSTANCE hLibModule) | |
589 { | |
590 WIN_BOOL retv = FALSE; | |
591 WINE_MODREF *wm; | |
592 | |
593 wm=MODULE32_LookupHMODULE(hLibModule); | |
594 | |
595 if ( !wm || !hLibModule ) | |
596 { | |
597 SetLastError( ERROR_INVALID_HANDLE ); | |
598 return 0; | |
2069 | 599 } |
1 | 600 else |
601 retv = MODULE_FreeLibrary( wm ); | |
2069 | 602 |
1 | 603 MODULE_RemoveFromList(wm); |
604 | |
128 | 605 /* garbage... */ |
606 if (local_wm == NULL) my_garbagecollection(); | |
607 | |
1 | 608 return retv; |
609 } | |
610 | |
611 /*********************************************************************** | |
612 * MODULE_DecRefCount | |
613 * | |
614 * NOTE: Assumes that the process critical section is held! | |
615 */ | |
616 static void MODULE_DecRefCount( WINE_MODREF *wm ) | |
617 { | |
618 int i; | |
619 | |
620 if ( wm->flags & WINE_MODREF_MARKER ) | |
621 return; | |
622 | |
623 if ( wm->refCount <= 0 ) | |
624 return; | |
625 | |
626 --wm->refCount; | |
627 TRACE("(%s) refCount: %d\n", wm->modname, wm->refCount ); | |
628 | |
629 if ( wm->refCount == 0 ) | |
630 { | |
631 wm->flags |= WINE_MODREF_MARKER; | |
632 | |
633 for ( i = 0; i < wm->nDeps; i++ ) | |
634 if ( wm->deps[i] ) | |
635 MODULE_DecRefCount( wm->deps[i] ); | |
636 | |
637 wm->flags &= ~WINE_MODREF_MARKER; | |
638 } | |
639 } | |
640 | |
641 /*********************************************************************** | |
642 * GetProcAddress (KERNEL32.257) | |
643 */ | |
644 FARPROC WINAPI GetProcAddress( HMODULE hModule, LPCSTR function ) | |
645 { | |
646 return MODULE_GetProcAddress( hModule, function, TRUE ); | |
647 } | |
648 | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
649 #ifdef DEBUG_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
650 |
13622 | 651 /* |
652 http://lists.apple.com/archives/quicktime-api/2003/Jan/msg00278.html | |
653 */ | |
654 | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
655 struct ComponentParameters { |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
656 unsigned char flags; /* call modifiers: sync/async, deferred, immed, etc */ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
657 unsigned char paramSize; /* size in bytes of actual parameters passed to this call */ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
658 short what; /* routine selector, negative for Component management calls */ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
659 long params[1]; /* actual parameters for the indicated routine */ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
660 }; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
661 typedef struct ComponentParameters ComponentParameters; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
662 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
663 static char* component_func(int what){ |
13622 | 664 if (what < 0) // Range 0: Standard Component Calls |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
665 switch(what){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
666 case -1: return "kComponentOpenSelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
667 case -2: return "kComponentCloseSelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
668 case -3: return "kComponentCanDoSelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
669 case -4: return "kComponentVersionSelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
670 case -5: return "kComponentRegisterSelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
671 case -6: return "kComponentTargetSelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
672 case -7: return "kComponentUnregisterSelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
673 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
674 |
13622 | 675 if (what >= 0 && what <= 0xff) // Range 1: Generic codecs |
676 switch(what & 0xff){ | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
677 case 0: return "kImageCodecGetCodecInfoSelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
678 case 1: return "kImageCodecGetCompressionTimeSelect"; |
13622 | 679 case 2: return "kImageCodecGetMaxCompressionSizeSelect"; |
680 case 3: return "kImageCodecPreCompressSelect"; | |
681 case 4: return "kImageCodecBandCompressSelect"; | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
682 case 5: return "kImageCodecPreDecompressSelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
683 case 6: return "kImageCodecBandDecompressSelect"; |
13622 | 684 case 7: return "kImageCodecBusySelect"; |
685 // finish this list from the above URL | |
686 case 0x10: return "kImageCodecIsImageDescriptionEquivalentSelect"; | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
687 case 0x12: return "kImageCodecDisposeMemorySelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
688 case 0x14: return "kImageCodecNewImageBufferMemorySelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
689 case 0x28: return "kImageCodecRequestGammaLevelSelect"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
690 } |
13622 | 691 |
692 //if (what >= 0x100 && what <= 0x1ff) // Range 2: Specific to QT Photo JPEG codecs | |
693 | |
694 if (what >= 0x200 && what <= 0x2ff) // Range 3: Base Decompressor | |
695 switch(what & 0xff){ | |
696 case 0: return "Preflight"; | |
697 case 1: return "Initialize"; | |
698 case 2: return "BeginBand"; | |
699 case 3: return "DrawBand"; | |
700 case 4: return "EndBand"; | |
701 case 5: return "QueueStarting"; | |
702 case 6: return "QueueStopping"; | |
703 } | |
704 | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
705 return "???"; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
706 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
707 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
708 static int c_level=0; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
709 |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
25418
diff
changeset
|
710 static int dump_component(char* name, int type, void* orig, ComponentParameters *params,void** glob){ |
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
25418
diff
changeset
|
711 int ( *orig)(ComponentParameters *params, void** glob) = orig; |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
712 int ret,i; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
713 |
13622 | 714 fprintf(stderr,"%*sComponentCall: %s flags=0x%X size=%d what=0x%X %s\n",3*c_level,"",name,params->flags, params->paramSize, params->what, component_func(params->what)); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
715 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
716 for(i=0;i<params->paramSize/4;i++) |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
717 fprintf(stderr,"%*s param[%d] = 0x%X\n",3*c_level,"",i,params->params[i]); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
718 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
719 ++c_level; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
720 ret=orig(params,glob); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
721 --c_level; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
722 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
723 if(ret>=0x1000) |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
724 fprintf(stderr,"%*s return=0x%X\n",3*c_level,"",ret); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
725 else |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
726 fprintf(stderr,"%*s return=%d\n",3*c_level,"",ret); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
727 return ret; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
728 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
729 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
730 #define DECL_COMPONENT(sname,name,type) \ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
731 static void* real_ ## sname = NULL; \ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
732 static int fake_ ## sname(ComponentParameters *params,void** glob){ \ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
733 return dump_component(name,type,real_ ## sname, params, glob); \ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
734 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
735 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
736 #include "qt_comp.h" |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
737 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
738 #undef DECL_COMPONENT |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
739 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
740 #include "qt_fv.h" |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
741 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
742 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
743 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
744 #ifdef EMU_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
745 |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
746 static uint32_t ret_array[4096]; |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
747 static int ret_i=0; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
748 |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
749 static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags) |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
750 { |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
751 #ifdef DEBUG_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
752 int i; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
753 int* dptr; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
754 void* pwrapper=NULL; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
755 void* pptr=NULL; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
756 char* pname=NULL; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
757 int plen=-1; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
758 // find the code: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
759 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
760 dptr=0x62b67ae0;dptr+=2*((reg->eax>>16)&255); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
761 // printf("FUNC: flag=%d ptr=%p\n",dptr[0],dptr[1]); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
762 if(dptr[0]&255){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
763 dptr=dptr[1];dptr+=4*(reg->eax&65535); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
764 // printf("FUNC: ptr2=%p eax=%p edx=%p\n",dptr[1],dptr[0],dptr[2]); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
765 pwrapper=dptr[1]; pptr=dptr[0]; plen=dptr[2]; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
766 } else { |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
767 pwrapper=0x62924910; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
768 switch(dptr[1]){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
769 case 0x629248d0: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
770 dptr=0x62b672c0;dptr+=2*(reg->eax&65535); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
771 // printf("FUNC: ptr2=%p eax=%p edx=%p\n",0x62924910,dptr[0],dptr[1]); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
772 pptr=dptr[0]; plen=dptr[1]; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
773 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
774 case 0x62924e40: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
775 dptr=0x62b67c70;dptr+=2*(reg->eax&65535); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
776 // printf("FUNC: ptr2=%p eax=%p edx=%p\n",0x62924910,dptr[0],dptr[1]); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
777 pptr=dptr[0]; plen=dptr[1]; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
778 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
779 case 0x62924e60: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
780 dptr=0x62b68108;if(reg->eax&0x8000) dptr+=2*(reg->eax|0xffff0000); else dptr+=2*(reg->eax&65535); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
781 // printf("FUNC: ptr2=%p eax=%p edx=%p\n",0x62924910,dptr[0],dptr[1]); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
782 pptr=dptr[0]; plen=dptr[1]; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
783 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
784 case 0x62924e80: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
785 dptr=0x62b68108;if(reg->eax&0x8000) dptr+=2*(reg->eax|0xffff0000); else dptr+=2*(reg->eax&65535); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
786 // printf("FUNC: ptr2=%p eax=%p edx=%p\n",0x62924910,dptr[0],dptr[1]); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
787 pptr=dptr[0]; plen=dptr[1]; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
788 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
789 default: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
790 printf("FUNC: unknown ptr & psize!\n"); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
791 pwrapper=dptr[1]; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
792 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
793 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
794 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
795 for(i=0;qt_fv_list[i].name;i++){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
796 if(qt_fv_list[i].id==reg->eax){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
797 pname=qt_fv_list[i].name; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
798 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
799 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
800 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
801 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
802 printf("FUNC[%X/%s]: wrapper=%p func=%p len=%d\n",reg->eax, |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
803 pname?pname:"???",pwrapper,pptr,plen); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
804 |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
805 printf("FUNC: caller=%p ebx=%p\n",((uint32_t *)stack_base)[0],reg->ebx); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
806 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
807 if(pname) |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
808 printf("%*sENTER(%d): %s(",ret_i*2,"",ret_i,pname); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
809 else |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
810 printf("%*sENTER(%d): %X(",ret_i*2,"",ret_i,reg->eax); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
811 for (i=0;i<plen/4;i++){ |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
812 unsigned int val=((uint32_t *)stack_base)[1+i]; |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
813 unsigned char* fcc=&val; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
814 printf("%s0x%X", i?", ":"",val); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
815 if(fcc[0]>=0x20 && fcc[0]<128 && |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
816 fcc[1]>=0x20 && fcc[1]<128 && |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
817 fcc[2]>=0x20 && fcc[2]<128 && |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
818 fcc[3]>=0x20 && fcc[3]<128) printf("='%c%c%c%c'",fcc[3],fcc[2],fcc[1],fcc[0]); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
819 else if(val>=8 && val<65536) printf("=%d",val); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
820 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
821 printf(")\n"); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
822 fflush(stdout); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
823 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
824 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
825 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
826 #if 1 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
827 // emulate some functions: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
828 switch(reg->eax){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
829 // memory management: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
830 case 0x150011: //NewPtrClear |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
831 case 0x150012: //NewPtrSysClear |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
832 reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]); |
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
833 memset((void *)reg->eax,0,((uint32_t *)stack_base)[1]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
834 #ifdef DEBUG_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
835 printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
836 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
837 return 1; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
838 case 0x15000F: //NewPtr |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
839 case 0x150010: //NewPtrSys |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
840 reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
841 #ifdef DEBUG_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
842 printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
843 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
844 return 1; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
845 case 0x15002f: //DisposePtr |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
846 if(((uint32_t *)stack_base)[1]>=0x60000000) |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
847 printf("WARNING! Invalid Ptr handle!\n"); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
848 else |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
849 free((void *)((uint32_t *)stack_base)[1]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
850 reg->eax=0; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
851 #ifdef DEBUG_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
852 printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
853 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
854 return 1; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
855 // mutexes: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
856 case 0x1d0033: //QTMLCreateMutex |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
857 reg->eax=0xdeadbabe; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
858 #ifdef DEBUG_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
859 printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
860 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
861 return 1; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
862 case 0x1d0034: //QTMLDestroyMutex |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
863 case 0x1d0035: //QTMLGrabMutex |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
864 case 0x1d0036: //QTMLReturnMutex |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
865 case 0x1d003d: //QTMLTryGrabMutex |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
866 reg->eax=0; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
867 #ifdef DEBUG_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
868 printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
869 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
870 return 1; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
871 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
872 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
873 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
874 #if 0 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
875 switch(reg->eax){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
876 // case 0x00010000: |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
877 // printf("FUNC: ImageCodecInitialize/ImageCodecGetCodecInfo(ci=%p,&icap=%p)\n",((uint32_t *)stack_base)[1],((uint32_t *)stack_base)[4]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
878 // break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
879 case 0x00010003: |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
880 printf("FUNC: CountComponents(&desc=%p)\n",((uint32_t *)stack_base)[1]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
881 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
882 case 0x00010004: |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
883 printf("FUNC: FindNextComponent(prev=%p,&desc=%p)\n",((uint32_t *)stack_base)[1],((uint32_t *)stack_base)[2]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
884 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
885 case 0x00010007: |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
886 printf("FUNC: OpenComponent(prev=%p)\n",((uint32_t *)stack_base)[1]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
887 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
888 case 0x0003008b: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
889 printf("FUNC: QTNewGWorldFromPtr(&pts=%p,fourcc=%.4s,&rect=%p,x1=%p,x2=%p,x3=%p,plane=%p,stride=%d)\n", |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
890 ((uint32_t *)stack_base)[1], |
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
891 &(((uint32_t *)stack_base)[2]), |
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
892 ((uint32_t *)stack_base)[3], |
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
893 ((uint32_t *)stack_base)[4], |
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
894 ((uint32_t *)stack_base)[5], |
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
895 ((uint32_t *)stack_base)[6], |
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
896 ((uint32_t *)stack_base)[7], |
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
897 ((uint32_t *)stack_base)[8]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
898 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
899 case 0x001c0018: |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
900 printf("FUNC: GetGWorldPixMap(gworld=%p)\n",((uint32_t *)stack_base)[1]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
901 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
902 case 0x00110001: |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
903 printf("FUNC: Gestalt(fourcc=%.4s, &ret=%p)\n",&(((uint32_t *)stack_base)[1]),((uint32_t *)stack_base)[2]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
904 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
905 default: { |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
906 int i; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
907 for(i=0;qt_fv_list[i].name;i++){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
908 if(qt_fv_list[i].id==reg->eax){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
909 printf("FUNC: %s\n",qt_fv_list[i].name); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
910 break; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
911 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
912 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
913 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
914 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
915 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
916 // print stack/reg information |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
917 printf("ENTER(%d) stack = %d bytes @ %p\n" |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
918 "eax = 0x%08x edx = 0x%08x ebx = 0x%08x ecx = 0x%08x\n" |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
919 "esp = 0x%08x ebp = 0x%08x esi = 0x%08x edi = 0x%08x\n" |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
920 "flags = 0x%08x\n", ret_i, |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
921 stack_size, stack_base, |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
922 reg->eax, reg->edx, reg->ebx, reg->ecx, |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
923 reg->esp, reg->ebp, reg->esi, reg->edi, |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
924 *flags); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
925 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
926 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
927 // save ret addr: |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
928 ret_array[ret_i]=((uint32_t *)stack_base)[0]; |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
929 ++ret_i; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
930 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
931 #if 0 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
932 // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
933 printf("stack[] = { "); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
934 for (i=0;i<7;i++) { |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
935 printf("%08x ", ((uint32_t *)stack_base)[i]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
936 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
937 printf("}\n\n"); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
938 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
939 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
940 // // mess with function parameters |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
941 // ((uint32_t *)stack_base)[1] = 0x66554433; |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
942 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
943 // // mess with return address... |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
944 // reg->eax = 0x11223344; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
945 return 0; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
946 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
947 |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
948 static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags) |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
949 { |
24382 | 950 //int i; |
25798
c8c9b4e89fb7
Surround variable declarations by preprocessor conditionals to avoid warnings:
diego
parents:
25794
diff
changeset
|
951 #ifdef DEBUG_QTX_API |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
952 short err; |
25798
c8c9b4e89fb7
Surround variable declarations by preprocessor conditionals to avoid warnings:
diego
parents:
25794
diff
changeset
|
953 #endif |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
954 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
955 // restore ret addr: |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
956 --ret_i; |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
957 ((uint32_t *)stack_base)[0]=ret_array[ret_i]; |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
958 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
959 #ifdef DEBUG_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
960 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
961 #if 1 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
962 printf("%*sLEAVE(%d): 0x%X",ret_i*2,"",ret_i, reg->eax); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
963 err=reg->eax; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
964 if(err && (reg->eax>>16)==0) printf(" = %d",err); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
965 printf("\n"); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
966 fflush(stdout); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
967 #else |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
968 // print stack/reg information |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
969 printf("LEAVE(%d) stack = %d bytes @ %p\n" |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
970 "eax = 0x%08x edx = 0x%08x ebx = 0x%08x ecx = 0x%08x\n" |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
971 "esp = 0x%08x ebp = 0x%08x esi = 0x%08x edi = 0x%08x\n" |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
972 "flags = 0x%08x\n", ret_i, |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
973 stack_size, stack_base, |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
974 reg->eax, reg->edx, reg->ebx, reg->ecx, |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
975 reg->esp, reg->ebp, reg->esi, reg->edi, |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
976 *flags); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
977 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
978 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
979 #if 0 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
980 // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
981 printf("stack[] = { "); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
982 for (i=0;i<7;i++) { |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
983 printf("%08x ", ((uint32_t *)stack_base)[i]); |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
984 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
985 printf("}\n\n"); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
986 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
987 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
988 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
989 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
990 // // mess with function parameters |
11868
711e584107af
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
alex
parents:
10795
diff
changeset
|
991 // ((uint32_t *)stack_base)[1] = 0x66554433; |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
992 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
993 // // mess with return address... |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
994 // reg->eax = 0x11223344; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
995 return 0; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
996 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
997 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
998 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
999 |
1 | 1000 /*********************************************************************** |
1001 * MODULE_GetProcAddress (internal) | |
1002 */ | |
2069 | 1003 FARPROC MODULE_GetProcAddress( |
1 | 1004 HMODULE hModule, /* [in] current module handle */ |
1005 LPCSTR function, /* [in] function to be looked up */ | |
1006 WIN_BOOL snoop ) | |
1007 { | |
1008 WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule ); | |
2069 | 1009 // WINE_MODREF *wm=local_wm; |
1 | 1010 FARPROC retproc; |
1011 | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1012 #ifdef DEBUG_QTX_API |
1 | 1013 if (HIWORD(function)) |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1014 fprintf(stderr,"XXX GetProcAddress(%08lx,%s)\n",(DWORD)hModule,function); |
1 | 1015 else |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1016 fprintf(stderr,"XXX GetProcAddress(%08lx,%p)\n",(DWORD)hModule,function); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1017 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1018 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1019 // TRACE_(win32)("(%08lx,%s)\n",(DWORD)hModule,function); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1020 // else |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1021 // TRACE_(win32)("(%08lx,%p)\n",(DWORD)hModule,function); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1022 |
1 | 1023 if (!wm) { |
1024 SetLastError(ERROR_INVALID_HANDLE); | |
1025 return (FARPROC)0; | |
1026 } | |
1027 switch (wm->type) | |
1028 { | |
1029 case MODULE32_PE: | |
1030 retproc = PE_FindExportedFunction( wm, function, snoop ); | |
1031 if (!retproc) SetLastError(ERROR_PROC_NOT_FOUND); | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1032 break; |
2069 | 1033 #ifdef HAVE_LIBDL |
1 | 1034 case MODULE32_ELF: |
2069 | 1035 retproc = (FARPROC) dlsym( (void*) wm->module, function); |
1 | 1036 if (!retproc) SetLastError(ERROR_PROC_NOT_FOUND); |
1037 return retproc; | |
1038 #endif | |
1039 default: | |
1040 ERR("wine_modref type %d not handled.\n",wm->type); | |
1041 SetLastError(ERROR_INVALID_HANDLE); | |
1042 return (FARPROC)0; | |
1043 } | |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1044 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1045 #ifdef EMU_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1046 if (HIWORD(function) && retproc){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1047 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1048 #ifdef DEBUG_QTX_API |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1049 #define DECL_COMPONENT(sname,name,type) \ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1050 if(!strcmp(function,name)){ \ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1051 fprintf(stderr,name "dispatcher catched -> %p\n",retproc); \ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1052 real_ ## sname = retproc; retproc = fake_ ## sname; \ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1053 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1054 #include "qt_comp.h" |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1055 #undef DECL_COMPONENT |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1056 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1057 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1058 if(!strcmp(function,"theQuickTimeDispatcher") |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
25418
diff
changeset
|
1059 // || !strcmp(function,"CallComponentFunctionWithStorage") |
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
25418
diff
changeset
|
1060 // || !strcmp(function,"CallComponent") |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1061 ){ |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1062 fprintf(stderr,"theQuickTimeDispatcher catched -> %p\n",retproc); |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1063 report_entry = report_func; |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1064 report_ret = report_func_ret; |
13182 | 1065 wrapper_target=(void(*)(void))retproc; |
8451 | 1066 retproc=(FARPROC)wrapper; |
8269
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1067 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1068 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1069 } |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1070 #endif |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1071 |
8b905703a450
- qtx (quicktime's macos emulation layer) debugging/emulation environment :)
arpi
parents:
7386
diff
changeset
|
1072 return retproc; |
1 | 1073 } |
1074 | |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1075 static int acounter = 0; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1076 void CodecAlloc(void) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1077 { |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1078 acounter++; |
3465 | 1079 //printf("**************CODEC ALLOC %d\n", acounter); |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1080 } |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1081 |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1082 void CodecRelease(void) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1083 { |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1084 acounter--; |
3465 | 1085 //printf("**************CODEC RELEASE %d\n", acounter); |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1086 if (acounter == 0) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1087 { |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1088 for (;;) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1089 { |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1090 modref_list* list = local_wm; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1091 if (!local_wm) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1092 break; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1093 //printf("CODECRELEASE %p\n", list); |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1094 MODULE_FreeLibrary(list->wm); |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1095 MODULE_RemoveFromList(list->wm); |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1096 if (local_wm == NULL) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1097 my_garbagecollection(); |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1098 } |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1099 } |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
1100 } |