Mercurial > mplayer.hg
comparison loader/win32.c @ 1543:228bb6a3e76d
UnregisterComClass added
author | arpi |
---|---|
date | Thu, 16 Aug 2001 00:43:28 +0000 |
parents | 8e841fe5668b |
children | 73c8f54305b1 |
comparison
equal
deleted
inserted
replaced
1542:b17f7f5765b5 | 1543:228bb6a3e76d |
---|---|
223 *(int*)(heap+heap_counter)=size; | 223 *(int*)(heap+heap_counter)=size; |
224 heap_counter+=4; | 224 heap_counter+=4; |
225 printf("Allocated %d bytes of memory: sys %d, user %d-%d\n", size, heap_counter-8, heap_counter, heap_counter+size); | 225 printf("Allocated %d bytes of memory: sys %d, user %d-%d\n", size, heap_counter-8, heap_counter, heap_counter+size); |
226 if(to_zero) | 226 if(to_zero) |
227 memset(heap+heap_counter, 0, size); | 227 memset(heap+heap_counter, 0, size); |
228 else | |
229 memset(heap+heap_counter, 0xcc, size); | |
228 heap_counter+=size; | 230 heap_counter+=size; |
229 return heap+heap_counter-size; | 231 return heap+heap_counter-size; |
230 } | 232 } |
231 int my_release(void* memory) | 233 int my_release(void* memory) |
232 { | 234 { |
2505 long retval; | 2507 long retval; |
2506 retval = *dest; | 2508 retval = *dest; |
2507 *dest = l; | 2509 *dest = l; |
2508 return retval; | 2510 return retval; |
2509 } | 2511 } |
2512 | |
2513 int WINAPI expUnknownMFC42_1176() /* exact number of arguments unknown */ | |
2514 { | |
2515 dbgprintf("MFC42:1176\n"); | |
2516 return 0; | |
2517 } | |
2518 | |
2519 int WINAPI expUnknownMFC42_1243() /* exact number of arguments unknown */ | |
2520 { | |
2521 dbgprintf("MFC42:1243\n"); | |
2522 return 0; | |
2523 } | |
2524 | |
2525 int UnregisterComClass(GUID* clsid, GETCLASSOBJECT gcs) | |
2526 { | |
2527 int found = 0; | |
2528 int i = 0; | |
2529 if(!clsid || !gcs) | |
2530 return -1; | |
2531 | |
2532 if (com_object_table == 0) | |
2533 printf("Warning: UnregisterComClass() called without any registered class\n"); | |
2534 while (i < com_object_size) | |
2535 { | |
2536 if (found && i > 0) | |
2537 { | |
2538 memcpy(&com_object_table[i - 1].clsid, | |
2539 &com_object_table[i].clsid, sizeof(GUID)); | |
2540 com_object_table[i - 1].GetClassObject = | |
2541 com_object_table[i].GetClassObject; | |
2542 } | |
2543 else if (memcmp(&com_object_table[i].clsid, clsid, sizeof(GUID)) == 0 | |
2544 && com_object_table[i].GetClassObject == gcs) | |
2545 { | |
2546 found++; | |
2547 } | |
2548 i++; | |
2549 } | |
2550 if (found) | |
2551 { | |
2552 if (--com_object_size == 0) | |
2553 { | |
2554 free(com_object_table); | |
2555 com_object_table = 0; | |
2556 } | |
2557 } | |
2558 return 0; | |
2559 } | |
2560 | |
2561 | |
2562 | |
2510 | 2563 |
2511 struct exports | 2564 struct exports |
2512 { | 2565 { |
2513 char name[64]; | 2566 char name[64]; |
2514 int id; | 2567 int id; |
2696 FF(CoTaskMemAlloc, -1) | 2749 FF(CoTaskMemAlloc, -1) |
2697 FF(CoTaskMemFree, -1) | 2750 FF(CoTaskMemFree, -1) |
2698 FF(CoCreateInstance, -1) | 2751 FF(CoCreateInstance, -1) |
2699 FF(StringFromGUID2, -1) | 2752 FF(StringFromGUID2, -1) |
2700 }; | 2753 }; |
2754 struct exports exp_mfc42[]={ | |
2755 FF(UnknownMFC42_1176, 1176) | |
2756 FF(UnknownMFC42_1243, 1243) | |
2757 }; | |
2701 struct exports exp_crtdll[]={ | 2758 struct exports exp_crtdll[]={ |
2702 FF(memcpy, -1) | 2759 FF(memcpy, -1) |
2703 }; | 2760 }; |
2704 | 2761 |
2705 #define LL(X) \ | 2762 #define LL(X) \ |
2712 LL(user32) | 2769 LL(user32) |
2713 LL(advapi32) | 2770 LL(advapi32) |
2714 LL(gdi32) | 2771 LL(gdi32) |
2715 LL(version) | 2772 LL(version) |
2716 LL(ole32) | 2773 LL(ole32) |
2774 LL(mfc42) | |
2717 LL(crtdll) | 2775 LL(crtdll) |
2718 }; | 2776 }; |
2719 | 2777 |
2720 void* LookupExternal(const char* library, int ordinal) | 2778 void* LookupExternal(const char* library, int ordinal) |
2721 { | 2779 { |