Mercurial > mplayer.hg
annotate loader/module.c @ 3754:174e473f582d
-alang/-slang options (audio/sub selection by language code)
author | arpi |
---|---|
date | Wed, 26 Dec 2001 00:16:59 +0000 |
parents | 4dad31e655b6 |
children | c6a76d35f3b1 |
rev | line source |
---|---|
1 | 1 /* |
2 * Modules | |
3 * | |
4 * Copyright 1995 Alexandre Julliard | |
5 */ | |
3465 | 6 #include "config.h" |
1 | 7 |
8 #include <assert.h> | |
9 #include <errno.h> | |
10 #include <fcntl.h> | |
11 #include <stdio.h> | |
12 #include <stdlib.h> | |
13 #include <string.h> | |
14 #include <unistd.h> | |
15 #include <sys/mman.h> | |
16 #include <sys/types.h> | |
17 | |
18 | |
19 #include <wine/windef.h> | |
20 #include <wine/winerror.h> | |
21 #include <wine/heap.h> | |
22 #include <wine/module.h> | |
23 #include <wine/pe_image.h> | |
24 #include <wine/debugtools.h> | |
2069 | 25 #ifdef HAVE_LIBDL |
26 #include <dlfcn.h> | |
27 #include <wine/elfdll.h> | |
28 #endif | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
29 #include "win32.h" |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
30 //#include "driver.h" |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
31 |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
32 //#undef TRACE |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
33 //#define TRACE printf |
1 | 34 |
35 struct modref_list_t; | |
36 | |
37 typedef struct modref_list_t | |
38 { | |
39 WINE_MODREF* wm; | |
40 struct modref_list_t *next; | |
2069 | 41 struct modref_list_t *prev; |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
42 } modref_list; |
1 | 43 |
44 //WINE_MODREF *local_wm=NULL; | |
45 modref_list* local_wm=NULL; | |
46 | |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
47 HANDLE SegptrHeap; |
2069 | 48 |
3465 | 49 WINE_MODREF* MODULE_FindModule(LPCSTR m) |
1 | 50 { |
51 modref_list* list=local_wm; | |
52 TRACE("Module %s request\n", m); | |
53 if(list==NULL) | |
54 return NULL; | |
55 while(strcmp(m, list->wm->filename)) | |
56 { | |
128 | 57 TRACE("%s: %x\n", list->wm->filename, list->wm->module); |
1 | 58 list=list->prev; |
59 if(list==NULL) | |
60 return NULL; | |
2069 | 61 } |
1 | 62 TRACE("Resolved to %s\n", list->wm->filename); |
63 return list->wm; | |
2069 | 64 } |
1 | 65 |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
66 static void MODULE_RemoveFromList(WINE_MODREF *mod) |
1 | 67 { |
68 modref_list* list=local_wm; | |
69 if(list==0) | |
70 return; | |
71 if(mod==0) | |
72 return; | |
73 if((list->prev==NULL)&&(list->next==NULL)) | |
74 { | |
75 free(list); | |
76 local_wm=NULL; | |
77 // uninstall_fs(); | |
78 return; | |
79 } | |
80 for(;list;list=list->prev) | |
81 { | |
82 if(list->wm==mod) | |
83 { | |
84 if(list->prev) | |
85 list->prev->next=list->next; | |
86 if(list->next) | |
87 list->next->prev=list->prev; | |
88 if(list==local_wm) | |
89 local_wm=list->prev; | |
90 free(list); | |
91 return; | |
92 } | |
93 } | |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
94 |
2069 | 95 } |
96 | |
1 | 97 WINE_MODREF *MODULE32_LookupHMODULE(HMODULE m) |
98 { | |
99 modref_list* list=local_wm; | |
100 TRACE("Module %X request\n", m); | |
101 if(list==NULL) | |
102 return NULL; | |
103 while(m!=list->wm->module) | |
104 { | |
105 // printf("Checking list %X wm %X module %X\n", | |
106 // list, list->wm, list->wm->module); | |
107 list=list->prev; | |
108 if(list==NULL) | |
109 return NULL; | |
2069 | 110 } |
111 TRACE("LookupHMODULE hit %p\n", list->wm); | |
1 | 112 return list->wm; |
2069 | 113 } |
1 | 114 |
115 /************************************************************************* | |
116 * MODULE_InitDll | |
117 */ | |
118 static WIN_BOOL MODULE_InitDll( WINE_MODREF *wm, DWORD type, LPVOID lpReserved ) | |
119 { | |
120 WIN_BOOL retv = TRUE; | |
121 | |
2069 | 122 static LPCSTR typeName[] = { "PROCESS_DETACH", "PROCESS_ATTACH", |
1 | 123 "THREAD_ATTACH", "THREAD_DETACH" }; |
124 assert( wm ); | |
125 | |
126 | |
127 /* Skip calls for modules loaded with special load flags */ | |
128 | |
129 if ( ( wm->flags & WINE_MODREF_DONT_RESOLVE_REFS ) | |
130 || ( wm->flags & WINE_MODREF_LOAD_AS_DATAFILE ) ) | |
131 return TRUE; | |
132 | |
133 | |
134 TRACE("(%s,%s,%p) - CALL\n", wm->modname, typeName[type], lpReserved ); | |
135 | |
136 /* Call the initialization routine */ | |
137 switch ( wm->type ) | |
138 { | |
139 case MODULE32_PE: | |
140 retv = PE_InitDLL( wm, type, lpReserved ); | |
141 break; | |
142 | |
143 case MODULE32_ELF: | |
144 /* no need to do that, dlopen() already does */ | |
145 break; | |
146 | |
147 default: | |
148 ERR("wine_modref type %d not handled.\n", wm->type ); | |
149 retv = FALSE; | |
150 break; | |
151 } | |
152 | |
153 /* The state of the module list may have changed due to the call | |
154 to PE_InitDLL. We cannot assume that this module has not been | |
155 deleted. */ | |
156 TRACE("(%p,%s,%p) - RETURN %d\n", wm, typeName[type], lpReserved, retv ); | |
157 | |
158 return retv; | |
159 } | |
160 | |
161 /************************************************************************* | |
162 * MODULE_DllProcessAttach | |
2069 | 163 * |
1 | 164 * Send the process attach notification to all DLLs the given module |
165 * depends on (recursively). This is somewhat complicated due to the fact that | |
166 * | |
167 * - we have to respect the module dependencies, i.e. modules implicitly | |
168 * referenced by another module have to be initialized before the module | |
169 * itself can be initialized | |
2069 | 170 * |
1 | 171 * - the initialization routine of a DLL can itself call LoadLibrary, |
172 * thereby introducing a whole new set of dependencies (even involving | |
173 * the 'old' modules) at any time during the whole process | |
174 * | |
175 * (Note that this routine can be recursively entered not only directly | |
176 * from itself, but also via LoadLibrary from one of the called initialization | |
177 * routines.) | |
178 * | |
179 * Furthermore, we need to rearrange the main WINE_MODREF list to allow | |
180 * the process *detach* notifications to be sent in the correct order. | |
2069 | 181 * This must not only take into account module dependencies, but also |
1 | 182 * 'hidden' dependencies created by modules calling LoadLibrary in their |
183 * attach notification routine. | |
184 * | |
185 * The strategy is rather simple: we move a WINE_MODREF to the head of the | |
186 * list after the attach notification has returned. This implies that the | |
187 * detach notifications are called in the reverse of the sequence the attach | |
188 * notifications *returned*. | |
189 * | |
190 * NOTE: Assumes that the process critical section is held! | |
191 * | |
192 */ | |
3465 | 193 static WIN_BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved ) |
1 | 194 { |
195 WIN_BOOL retv = TRUE; | |
196 int i; | |
197 assert( wm ); | |
198 | |
199 /* prevent infinite recursion in case of cyclical dependencies */ | |
200 if ( ( wm->flags & WINE_MODREF_MARKER ) | |
201 || ( wm->flags & WINE_MODREF_PROCESS_ATTACHED ) ) | |
202 return retv; | |
203 | |
204 TRACE("(%s,%p) - START\n", wm->modname, lpReserved ); | |
205 | |
206 /* Tag current MODREF to prevent recursive loop */ | |
207 wm->flags |= WINE_MODREF_MARKER; | |
208 | |
209 /* Recursively attach all DLLs this one depends on */ | |
210 /* for ( i = 0; retv && i < wm->nDeps; i++ ) | |
211 if ( wm->deps[i] ) | |
212 retv = MODULE_DllProcessAttach( wm->deps[i], lpReserved ); | |
213 */ | |
214 /* Call DLL entry point */ | |
215 | |
216 //local_wm=wm; | |
217 if(local_wm) | |
218 { | |
219 local_wm->next=malloc(sizeof(modref_list)); | |
220 local_wm->next->prev=local_wm; | |
221 local_wm->next->next=NULL; | |
222 local_wm->next->wm=wm; | |
223 local_wm=local_wm->next; | |
224 } | |
225 else | |
226 { | |
227 local_wm=malloc(sizeof(modref_list)); | |
228 local_wm->next=local_wm->prev=NULL; | |
229 local_wm->wm=wm; | |
2069 | 230 } |
1 | 231 /* Remove recursion flag */ |
232 wm->flags &= ~WINE_MODREF_MARKER; | |
2069 | 233 |
1 | 234 if ( retv ) |
235 { | |
236 retv = MODULE_InitDll( wm, DLL_PROCESS_ATTACH, lpReserved ); | |
237 if ( retv ) | |
238 wm->flags |= WINE_MODREF_PROCESS_ATTACHED; | |
239 } | |
240 | |
241 | |
242 TRACE("(%s,%p) - END\n", wm->modname, lpReserved ); | |
243 | |
244 return retv; | |
245 } | |
246 | |
247 /************************************************************************* | |
248 * MODULE_DllProcessDetach | |
2069 | 249 * |
250 * Send DLL process detach notifications. See the comment about calling | |
1 | 251 * sequence at MODULE_DllProcessAttach. Unless the bForceDetach flag |
252 * is set, only DLLs with zero refcount are notified. | |
253 */ | |
3465 | 254 static void MODULE_DllProcessDetach( WINE_MODREF* wm, WIN_BOOL bForceDetach, LPVOID lpReserved ) |
1 | 255 { |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
256 // WINE_MODREF *wm=local_wm; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
257 modref_list* l = local_wm; |
1 | 258 wm->flags &= ~WINE_MODREF_PROCESS_ATTACHED; |
259 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
|
260 /* while (l) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
261 { |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
262 modref_list* f = l; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
263 l = l->next; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
264 free(f); |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
265 } |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
266 local_wm = 0;*/ |
1 | 267 } |
268 | |
3465 | 269 /*********************************************************************** |
270 * MODULE_LoadLibraryExA (internal) | |
271 * | |
272 * Load a PE style module according to the load order. | |
273 * | |
274 * The HFILE parameter is not used and marked reserved in the SDK. I can | |
275 * only guess that it should force a file to be mapped, but I rather | |
276 * ignore the parameter because it would be extremely difficult to | |
277 * integrate this with different types of module represenations. | |
278 * | |
279 */ | |
280 static WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags ) | |
281 { | |
282 DWORD err = GetLastError(); | |
283 WINE_MODREF *pwm; | |
284 int i; | |
285 // module_loadorder_t *plo; | |
286 | |
287 SetLastError( ERROR_FILE_NOT_FOUND ); | |
288 TRACE("Trying native dll '%s'\n", libname); | |
289 pwm = PE_LoadLibraryExA(libname, flags); | |
290 #ifdef HAVE_LIBDL | |
291 if(!pwm) | |
292 { | |
293 TRACE("Trying ELF dll '%s'\n", libname); | |
294 pwm=(WINE_MODREF*)ELFDLL_LoadLibraryExA(libname, flags); | |
295 } | |
296 #endif | |
297 // printf("0x%08x\n", pwm); | |
298 // break; | |
299 if(pwm) | |
300 { | |
301 /* Initialize DLL just loaded */ | |
302 TRACE("Loaded module '%s' at 0x%08x, \n", libname, pwm->module); | |
303 /* Set the refCount here so that an attach failure will */ | |
304 /* decrement the dependencies through the MODULE_FreeLibrary call. */ | |
305 pwm->refCount++; | |
306 | |
307 SetLastError( err ); /* restore last error */ | |
308 return pwm; | |
309 } | |
310 | |
311 | |
312 WARN("Failed to load module '%s'; error=0x%08lx, \n", libname, GetLastError()); | |
313 return NULL; | |
314 } | |
315 | |
316 /*********************************************************************** | |
317 * MODULE_FreeLibrary | |
318 * | |
319 * NOTE: Assumes that the process critical section is held! | |
320 */ | |
321 static WIN_BOOL MODULE_FreeLibrary( WINE_MODREF *wm ) | |
322 { | |
323 TRACE("(%s) - START\n", wm->modname ); | |
324 | |
325 /* Recursively decrement reference counts */ | |
326 //MODULE_DecRefCount( wm ); | |
327 | |
328 /* Call process detach notifications */ | |
329 MODULE_DllProcessDetach( wm, FALSE, NULL ); | |
330 | |
331 PE_UnloadLibrary(wm); | |
332 | |
333 TRACE("END\n"); | |
334 | |
335 return TRUE; | |
336 } | |
1 | 337 |
338 /*********************************************************************** | |
339 * LoadLibraryExA (KERNEL32) | |
340 */ | |
341 HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) | |
342 { | |
2069 | 343 WINE_MODREF *wm = 0; |
344 char* listpath[] = { "", "", "/usr/lib/win32", "/usr/local/lib/win32", 0 }; | |
345 extern char* def_path; | |
346 char path[512]; | |
347 char checked[2000]; | |
348 int i = -1; | |
1 | 349 |
2069 | 350 checked[0] = 0; |
1 | 351 if(!libname) |
352 { | |
353 SetLastError(ERROR_INVALID_PARAMETER); | |
354 return 0; | |
355 } | |
2069 | 356 printf("Loading DLL: '%s'\n", libname); |
3465 | 357 // if(fs_installed==0) |
358 // install_fs(); | |
2069 | 359 |
360 while (wm == 0 && listpath[++i]) | |
361 { | |
362 if (i < 2) | |
363 { | |
364 if (i == 0) | |
365 /* 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
|
366 strncpy(path, libname, 511); |
2069 | 367 else |
368 /* check default user path */ | |
369 strncpy(path, def_path, 300); | |
370 } | |
371 else if (strcmp(def_path, listpath[i])) | |
372 /* path from the list */ | |
373 strncpy(path, listpath[i], 300); | |
374 else | |
375 continue; | |
1 | 376 |
2069 | 377 if (i > 0) |
378 { | |
379 strcat(path, "/"); | |
380 strncat(path, libname, 100); | |
381 } | |
382 path[511] = 0; | |
383 wm = MODULE_LoadLibraryExA( path, hfile, flags ); | |
384 | |
385 if (!wm) | |
386 { | |
387 if (checked[0]) | |
388 strcat(checked, ", "); | |
389 strcat(checked, path); | |
390 checked[1500] = 0; | |
391 | |
392 } | |
393 } | |
1 | 394 if ( wm ) |
395 { | |
396 if ( !MODULE_DllProcessAttach( wm, NULL ) ) | |
397 { | |
398 WARN_(module)("Attach failed for module '%s', \n", libname); | |
399 MODULE_FreeLibrary(wm); | |
400 SetLastError(ERROR_DLL_INIT_FAILED); | |
401 MODULE_RemoveFromList(wm); | |
402 wm = NULL; | |
403 } | |
404 } | |
405 | |
2069 | 406 if (!wm) |
407 printf("Win32 LoadLibrary failed to load: %s\n", checked); | |
408 | |
409 | |
1 | 410 return wm ? wm->module : 0; |
411 } | |
412 | |
413 | |
414 /*********************************************************************** | |
415 * LoadLibraryA (KERNEL32) | |
416 */ | |
417 HMODULE WINAPI LoadLibraryA(LPCSTR libname) { | |
418 return LoadLibraryExA(libname,0,0); | |
419 } | |
420 | |
421 /*********************************************************************** | |
422 * FreeLibrary | |
423 */ | |
424 WIN_BOOL WINAPI FreeLibrary(HINSTANCE hLibModule) | |
425 { | |
426 WIN_BOOL retv = FALSE; | |
427 WINE_MODREF *wm; | |
428 | |
429 wm=MODULE32_LookupHMODULE(hLibModule); | |
430 | |
431 if ( !wm || !hLibModule ) | |
432 { | |
433 SetLastError( ERROR_INVALID_HANDLE ); | |
434 return 0; | |
2069 | 435 } |
1 | 436 else |
437 retv = MODULE_FreeLibrary( wm ); | |
2069 | 438 |
1 | 439 MODULE_RemoveFromList(wm); |
440 | |
128 | 441 /* garbage... */ |
442 if (local_wm == NULL) my_garbagecollection(); | |
443 | |
1 | 444 return retv; |
445 } | |
446 | |
447 /*********************************************************************** | |
448 * MODULE_DecRefCount | |
449 * | |
450 * NOTE: Assumes that the process critical section is held! | |
451 */ | |
452 static void MODULE_DecRefCount( WINE_MODREF *wm ) | |
453 { | |
454 int i; | |
455 | |
456 if ( wm->flags & WINE_MODREF_MARKER ) | |
457 return; | |
458 | |
459 if ( wm->refCount <= 0 ) | |
460 return; | |
461 | |
462 --wm->refCount; | |
463 TRACE("(%s) refCount: %d\n", wm->modname, wm->refCount ); | |
464 | |
465 if ( wm->refCount == 0 ) | |
466 { | |
467 wm->flags |= WINE_MODREF_MARKER; | |
468 | |
469 for ( i = 0; i < wm->nDeps; i++ ) | |
470 if ( wm->deps[i] ) | |
471 MODULE_DecRefCount( wm->deps[i] ); | |
472 | |
473 wm->flags &= ~WINE_MODREF_MARKER; | |
474 } | |
475 } | |
476 | |
477 /*********************************************************************** | |
478 * GetProcAddress (KERNEL32.257) | |
479 */ | |
480 FARPROC WINAPI GetProcAddress( HMODULE hModule, LPCSTR function ) | |
481 { | |
482 return MODULE_GetProcAddress( hModule, function, TRUE ); | |
483 } | |
484 | |
485 /*********************************************************************** | |
486 * MODULE_GetProcAddress (internal) | |
487 */ | |
2069 | 488 FARPROC MODULE_GetProcAddress( |
1 | 489 HMODULE hModule, /* [in] current module handle */ |
490 LPCSTR function, /* [in] function to be looked up */ | |
491 WIN_BOOL snoop ) | |
492 { | |
493 WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule ); | |
2069 | 494 // WINE_MODREF *wm=local_wm; |
1 | 495 FARPROC retproc; |
496 | |
497 if (HIWORD(function)) | |
498 TRACE_(win32)("(%08lx,%s)\n",(DWORD)hModule,function); | |
499 else | |
500 TRACE_(win32)("(%08lx,%p)\n",(DWORD)hModule,function); | |
501 if (!wm) { | |
502 SetLastError(ERROR_INVALID_HANDLE); | |
503 return (FARPROC)0; | |
504 } | |
505 switch (wm->type) | |
506 { | |
507 case MODULE32_PE: | |
508 retproc = PE_FindExportedFunction( wm, function, snoop ); | |
509 if (!retproc) SetLastError(ERROR_PROC_NOT_FOUND); | |
510 return retproc; | |
2069 | 511 #ifdef HAVE_LIBDL |
1 | 512 case MODULE32_ELF: |
2069 | 513 retproc = (FARPROC) dlsym( (void*) wm->module, function); |
1 | 514 if (!retproc) SetLastError(ERROR_PROC_NOT_FOUND); |
515 return retproc; | |
516 #endif | |
517 default: | |
518 ERR("wine_modref type %d not handled.\n",wm->type); | |
519 SetLastError(ERROR_INVALID_HANDLE); | |
520 return (FARPROC)0; | |
521 } | |
522 } | |
523 | |
2651
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
524 static int acounter = 0; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
525 void CodecAlloc(void) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
526 { |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
527 acounter++; |
3465 | 528 //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
|
529 } |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
530 |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
531 void CodecRelease(void) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
532 { |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
533 acounter--; |
3465 | 534 //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
|
535 if (acounter == 0) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
536 { |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
537 for (;;) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
538 { |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
539 modref_list* list = local_wm; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
540 if (!local_wm) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
541 break; |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
542 //printf("CODECRELEASE %p\n", list); |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
543 MODULE_FreeLibrary(list->wm); |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
544 MODULE_RemoveFromList(list->wm); |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
545 if (local_wm == NULL) |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
546 my_garbagecollection(); |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
547 } |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
548 } |
958d10763c34
partially synced with avifile... (TODO: migrate to new registry.c and driver.c)
arpi
parents:
2069
diff
changeset
|
549 } |