Changeset 11781 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Aug 28, 2008 6:34:38 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp
r11484 r11781 182 182 if (!pBackend) 183 183 { 184 char szSharedLibPath[RTPATH_MAX]; 184 185 char *pszPluginName; 185 186 187 rc = RTPathSharedLibs(szSharedLibPath, sizeof(szSharedLibPath)); 188 if (RT_FAILURE(rc)) 189 return rc; 190 186 191 /* HDD Format Plugins have VBoxHDD as prefix, prepend it. */ 187 RTStrAPrintf(&pszPluginName, "%s %s",188 VBOX_HDDFORMAT_PLUGIN_PREFIX, pszBackend);192 RTStrAPrintf(&pszPluginName, "%s/%s%s", 193 szSharedLibPath, VBOX_HDDFORMAT_PLUGIN_PREFIX, pszBackend); 189 194 if (!pszPluginName) 190 195 { … … 193 198 } 194 199 195 /* Try to load the plugin (RT ldrLoad takes care of the suffix). */200 /* Try to load the plugin (RTLdrLoad takes care of the suffix). */ 196 201 rc = RTLdrLoad(pszPluginName, &hPlugin); 197 202 if (RT_SUCCESS(rc)) … … 699 704 PFNVBOXHDDFORMATLOAD pfnHDDFormatLoad = NULL; 700 705 PVBOXHDDBACKEND pBackend = NULL; 706 char *pszPluginPath = NULL; 701 707 702 708 if (rc == VERR_BUFFER_OVERFLOW) … … 717 723 continue; 718 724 719 rc = RTLdrLoad(pPluginDirEntry->szName, &hPlugin); 725 /* Prepend the path to the libraries. */ 726 rc = RTStrAPrintf(&pszPluginPath, "%s/%s", szPath, pPluginDirEntry->szName); 727 if (RT_FAILURE(rc)) 728 { 729 rc = VERR_NO_MEMORY; 730 break; 731 } 732 733 rc = RTLdrLoad(pszPluginPath, &hPlugin); 720 734 if (RT_SUCCESS(rc)) 721 735 { … … 757 771 RTLdrClose(hPlugin); 758 772 } 773 RTStrFree(pszPluginPath); 759 774 } 760 775 if (rc == VERR_NO_MORE_FILES) … … 947 962 PFNVBOXHDDFORMATLOAD pfnHDDFormatLoad = NULL; 948 963 PVBOXHDDBACKEND pBackend = NULL; 964 char *pszPluginPath = NULL; 949 965 950 966 if (rc == VERR_BUFFER_OVERFLOW) … … 965 981 continue; 966 982 967 rc = RTLdrLoad(pPluginDirEntry->szName, &hPlugin); 983 /* Prepend the path to the libraries. */ 984 rc = RTStrAPrintf(&pszPluginPath, "%s/%s", szPath, pPluginDirEntry->szName); 985 if (RT_FAILURE(rc)) 986 { 987 rc = VERR_NO_MEMORY; 988 break; 989 } 990 991 rc = RTLdrLoad(pszPluginPath, &hPlugin); 968 992 if (RT_SUCCESS(rc)) 969 993 { … … 1009 1033 RTLdrClose(hPlugin); 1010 1034 } 1035 RTStrFree(pszPluginPath); 1011 1036 1012 1037 /*
Note:
See TracChangeset
for help on using the changeset viewer.