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