Changeset 63495 in vbox for trunk/src/VBox/Storage/VD.cpp
- Timestamp:
- Aug 15, 2016 5:19:46 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VD.cpp
r62873 r63495 659 659 /** Array of pointers to the filters backends. */ 660 660 static PCVDFILTERBACKEND *g_apFilterBackends = NULL; 661 #ifndef VBOX_HDD_NO_DYNAMIC_BACKENDS 661 662 /** Array of handles to the corresponding plugin. */ 662 static RTLDRMOD *g_ahFilterBackendPlugins = NULL; 663 static PRTLDRMOD g_pahFilterBackendPlugins = NULL; 664 #endif 663 665 664 666 /** Forward declaration of the async discard helper. */ … … 692 694 } 693 695 696 #ifndef VBOX_HDD_NO_DYNAMIC_BACKENDS 694 697 /** 695 698 * internal: add single backend. … … 699 702 return vdAddBackends(hPlugin, &pBackend, 1); 700 703 } 704 #endif 701 705 702 706 /** … … 723 727 } 724 728 729 #ifndef VBOX_HDD_NO_DYNAMIC_BACKENDS 730 725 731 /** 726 732 * internal: add single cache backend. … … 730 736 return vdAddCacheBackends(hPlugin, &pBackend, 1); 731 737 } 738 732 739 733 740 /** … … 747 754 g_apFilterBackends = pTmp; 748 755 749 RTLDRMOD *pTmpPlugins = (RTLDRMOD*)RTMemRealloc(g_ahFilterBackendPlugins,750 (g_cFilterBackends + cBackends) * sizeof(RTLDRMOD));756 PRTLDRMOD pTmpPlugins = (PRTLDRMOD)RTMemRealloc(g_pahFilterBackendPlugins, 757 (g_cFilterBackends + cBackends) * sizeof(RTLDRMOD)); 751 758 if (RT_UNLIKELY(!pTmpPlugins)) 752 759 return VERR_NO_MEMORY; 753 760 754 g_ ahFilterBackendPlugins = pTmpPlugins;761 g_pahFilterBackendPlugins = pTmpPlugins; 755 762 memcpy(&g_apFilterBackends[g_cFilterBackends], ppBackends, cBackends * sizeof(PCVDFILTERBACKEND)); 756 763 for (unsigned i = g_cFilterBackends; i < g_cFilterBackends + cBackends; i++) 757 g_ ahFilterBackendPlugins[i] = hPlugin;764 g_pahFilterBackendPlugins[i] = hPlugin; 758 765 g_cFilterBackends += cBackends; 759 766 return VINF_SUCCESS; 760 767 } 768 761 769 762 770 /** … … 771 779 return vdAddFilterBackends(hPlugin, &pBackend, 1); 772 780 } 781 782 #endif /* VBOX_HDD_NO_DYNAMIC_BACKENDS*/ 773 783 774 784 /** … … 3647 3657 for (unsigned i = 0; i < g_cFilterBackends; i++) 3648 3658 { 3649 while (i < g_cFilterBackends && g_ ahFilterBackendPlugins[i] == pIt->hPlugin)3659 while (i < g_cFilterBackends && g_pahFilterBackendPlugins[i] == pIt->hPlugin) 3650 3660 { 3651 3661 memcpy(&g_apFilterBackends[i], &g_apFilterBackends[i + 1], (g_cFilterBackends - i - 1) * sizeof(PCVBOXHDDBACKEND)); 3652 memcpy(&g_ ahFilterBackendPlugins[i], &g_ahFilterBackendPlugins[i + 1], (g_cFilterBackends - i - 1) * sizeof(RTLDRMOD));3662 memcpy(&g_pahFilterBackendPlugins[i], &g_pahFilterBackendPlugins[i + 1], (g_cFilterBackends - i - 1) * sizeof(RTLDRMOD)); 3653 3663 /** @todo for now skip reallocating, doesn't save much */ 3654 3664 g_cFilterBackends--;
Note:
See TracChangeset
for help on using the changeset viewer.