Mercurial > mplayer.hg
comparison loader/win32.c @ 3457:ca39dc9f879b
do not crash with 3ivx and vivo
author | alex |
---|---|
date | Tue, 11 Dec 2001 14:56:21 +0000 |
parents | 9fec5bdfe06b |
children | 4dad31e655b6 |
comparison
equal
deleted
inserted
replaced
3456:ebab4801241f | 3457:ca39dc9f879b |
---|---|
1186 { | 1186 { |
1187 CRITICAL_SECTION *cs_win; | 1187 CRITICAL_SECTION *cs_win; |
1188 struct CRITSECT *cs_unix; | 1188 struct CRITSECT *cs_unix; |
1189 }; | 1189 }; |
1190 | 1190 |
1191 #undef CRITSECS_NEWTYPE | 1191 /* 'NEWTYPE' is working with VIVO and 3ivX dll (no more segfaults) -- alex */ |
1192 //#define CRITSECS_NEWTYPE 1 | 1192 //#undef CRITSECS_NEWTYPE |
1193 #define CRITSECS_NEWTYPE 1 | |
1193 | 1194 |
1194 #ifdef CRITSECS_NEWTYPE | 1195 #ifdef CRITSECS_NEWTYPE |
1195 #define CRITSECS_LIST_MAX 20 | 1196 #define CRITSECS_LIST_MAX 20 |
1196 static struct critsecs_list_t critsecs_list[CRITSECS_LIST_MAX]; | 1197 static struct critsecs_list_t critsecs_list[CRITSECS_LIST_MAX]; |
1197 | 1198 |
1248 if (i < 0) | 1249 if (i < 0) |
1249 { | 1250 { |
1250 printf("InitializeCriticalSection(%p) - no more space in list\n", c); | 1251 printf("InitializeCriticalSection(%p) - no more space in list\n", c); |
1251 return; | 1252 return; |
1252 } | 1253 } |
1253 printf("got unused space at %d\n", i); | 1254 // printf("got unused space at %d\n", i); |
1254 cs = expmalloc(sizeof(struct CRITSECT)); | 1255 cs = expmalloc(sizeof(struct CRITSECT)); |
1255 if (!cs) | 1256 if (!cs) |
1256 { | 1257 { |
1257 printf("InitializeCriticalSection(%p) - out of memory\n", c); | 1258 printf("InitializeCriticalSection(%p) - out of memory\n", c); |
1258 return; | 1259 return; |
2154 if(strncmp(name, ".\\", 2)==0) name += 2; | 2155 if(strncmp(name, ".\\", 2)==0) name += 2; |
2155 | 2156 |
2156 dbgprintf("Entering LoadLibraryA(%s)\n", name); | 2157 dbgprintf("Entering LoadLibraryA(%s)\n", name); |
2157 // PIMJ and VIVO audio are loading kernel32.dll | 2158 // PIMJ and VIVO audio are loading kernel32.dll |
2158 if (strcasecmp(name, "kernel32.dll") == 0 || strcasecmp(name, "kernel32") == 0) | 2159 if (strcasecmp(name, "kernel32.dll") == 0 || strcasecmp(name, "kernel32") == 0) |
2159 return MODULE_HANDLE_kernel32; | 2160 // return MODULE_HANDLE_kernel32; |
2161 return ERROR_SUCCESS; /* yeah, we have also the kernel32 calls */ | |
2162 /* exported -> do not return failed! */ | |
2160 | 2163 |
2161 result=LoadLibraryA(name); | 2164 result=LoadLibraryA(name); |
2162 dbgprintf("Returned LoadLibraryA(0x%x='%s'), def_path=%s => 0x%x\n", name, name, def_path, result); | 2165 dbgprintf("Returned LoadLibraryA(0x%x='%s'), def_path=%s => 0x%x\n", name, name, def_path, result); |
2163 | 2166 |
2164 return result; | 2167 return result; |
2678 dbgprintf("GetProcessVersion(%d)\n", pid); | 2681 dbgprintf("GetProcessVersion(%d)\n", pid); |
2679 return 1; | 2682 return 1; |
2680 } | 2683 } |
2681 int WINAPI expGetCurrentThread(void) | 2684 int WINAPI expGetCurrentThread(void) |
2682 { | 2685 { |
2683 dbgprintf("GetCurrentThread()\n"); | 2686 #warning FIXME! |
2687 dbgprintf("GetCurrentThread() => %x\n", 0xcfcf9898); | |
2684 return 0xcfcf9898; | 2688 return 0xcfcf9898; |
2685 } | 2689 } |
2686 int WINAPI expGetOEMCP(void) | 2690 int WINAPI expGetOEMCP(void) |
2687 { | 2691 { |
2688 dbgprintf("GetOEMCP()\n"); | 2692 dbgprintf("GetOEMCP()\n"); |
3205 { | 3209 { |
3206 printf("InitCommonControls called!\n"); | 3210 printf("InitCommonControls called!\n"); |
3207 return; | 3211 return; |
3208 } | 3212 } |
3209 | 3213 |
3214 /* alex: implement this call! needed for 3ivx */ | |
3210 HRESULT WINAPI expCoCreateFreeThreadedMarshaler(void *pUnkOuter, void **ppUnkInner) | 3215 HRESULT WINAPI expCoCreateFreeThreadedMarshaler(void *pUnkOuter, void **ppUnkInner) |
3211 { | 3216 { |
3212 printf("CoCreateFreeThreadedMarshaler(%p, %p) called!\n", | 3217 printf("CoCreateFreeThreadedMarshaler(%p, %p) called!\n", |
3213 pUnkOuter, ppUnkInner); | 3218 pUnkOuter, ppUnkInner); |
3214 return E_FAIL; | 3219 return ERROR_CALL_NOT_IMPLEMENTED; |
3215 // return S_OK; | |
3216 } | 3220 } |
3217 | 3221 |
3218 | 3222 |
3219 int WINAPI expDuplicateHandle( | 3223 int WINAPI expDuplicateHandle( |
3220 HANDLE hSourceProcessHandle, // handle to source process | 3224 HANDLE hSourceProcessHandle, // handle to source process |