comparison loader/module.c @ 7386:174e2a58b4cd

avifile sync - 95% cosmetics 5% bug
author arpi
date Fri, 13 Sep 2002 19:43:17 +0000
parents 4b0dd1ff6a20
children 8b905703a450
comparison
equal deleted inserted replaced
7385:e2fcdd7608b1 7386:174e2a58b4cd
14 #include <unistd.h> 14 #include <unistd.h>
15 #include <sys/mman.h> 15 #include <sys/mman.h>
16 #include <sys/types.h> 16 #include <sys/types.h>
17 17
18 18
19 #include <wine/windef.h> 19 #include "wine/windef.h"
20 #include <wine/winerror.h> 20 #include "wine/winerror.h"
21 #include <wine/heap.h> 21 #include "wine/heap.h"
22 #include <wine/module.h> 22 #include "wine/module.h"
23 #include <wine/pe_image.h> 23 #include "wine/pe_image.h"
24 #include <wine/debugtools.h> 24 #include "wine/debugtools.h"
25 #ifdef HAVE_LIBDL 25 #ifdef HAVE_LIBDL
26 #include <dlfcn.h> 26 #include <dlfcn.h>
27 #include <wine/elfdll.h> 27 #include "wine/elfdll.h"
28 #endif 28 #endif
29 #include "win32.h" 29 #include "win32.h"
30 #include "module.h" 30 #include "driver.h"
31 //#include "driver.h"
32 31
33 //#undef TRACE 32 //#undef TRACE
34 //#define TRACE printf 33 //#define TRACE printf
35
36 struct modref_list_t;
37
38 typedef struct modref_list_t
39 {
40 WINE_MODREF* wm;
41 struct modref_list_t *next;
42 struct modref_list_t *prev;
43 } modref_list;
44 34
45 //WINE_MODREF *local_wm=NULL; 35 //WINE_MODREF *local_wm=NULL;
46 modref_list* local_wm=NULL; 36 modref_list* local_wm=NULL;
47 37
48 HANDLE SegptrHeap; 38 HANDLE SegptrHeap;
215 /* Call DLL entry point */ 205 /* Call DLL entry point */
216 206
217 //local_wm=wm; 207 //local_wm=wm;
218 if(local_wm) 208 if(local_wm)
219 { 209 {
220 local_wm->next=malloc(sizeof(modref_list)); 210 local_wm->next = (modref_list*) malloc(sizeof(modref_list));
221 local_wm->next->prev=local_wm; 211 local_wm->next->prev=local_wm;
222 local_wm->next->next=NULL; 212 local_wm->next->next=NULL;
223 local_wm->next->wm=wm; 213 local_wm->next->wm=wm;
224 local_wm=local_wm->next; 214 local_wm=local_wm->next;
225 } 215 }
226 else 216 else
227 { 217 {
228 local_wm=malloc(sizeof(modref_list)); 218 local_wm = (modref_list*)malloc(sizeof(modref_list));
229 local_wm->next=local_wm->prev=NULL; 219 local_wm->next=local_wm->prev=NULL;
230 local_wm->wm=wm; 220 local_wm->wm=wm;
231 } 221 }
232 /* Remove recursion flag */ 222 /* Remove recursion flag */
233 wm->flags &= ~WINE_MODREF_MARKER; 223 wm->flags &= ~WINE_MODREF_MARKER;
352 if(!libname) 342 if(!libname)
353 { 343 {
354 SetLastError(ERROR_INVALID_PARAMETER); 344 SetLastError(ERROR_INVALID_PARAMETER);
355 return 0; 345 return 0;
356 } 346 }
357 printf("Loading DLL: '%s'\n", libname);
358 // if(fs_installed==0) 347 // if(fs_installed==0)
359 // install_fs(); 348 // install_fs();
360 349
361 while (wm == 0 && listpath[++i]) 350 while (wm == 0 && listpath[++i])
362 { 351 {
404 } 393 }
405 } 394 }
406 395
407 if (!wm) 396 if (!wm)
408 printf("Win32 LoadLibrary failed to load: %s\n", checked); 397 printf("Win32 LoadLibrary failed to load: %s\n", checked);
409 else 398
410 {
411 extern char *win32_codec_name;
412 // printf("Loaded %s to address %p\n", libname, wm->module);
413 /* XXX: FIXME, _VERY_ UGLY HACK */
414 if (!strcmp(libname, "m3jpegdec.ax"))
415 win32_codec_name = strdup("m3jpeg32.dll");
416 }
417 399
418 return wm ? wm->module : 0; 400 return wm ? wm->module : 0;
419 } 401 }
420 402
421 403