Changeset 24602 in vbox for trunk/src/VBox/Main
- Timestamp:
- Nov 12, 2009 5:54:18 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r24599 r24602 930 930 } 931 931 932 933 934 932 STDMETHODIMP 935 VirtualBox::CheckFirmwarePresent(FirmwareType_T aFirmwareType, 936 IN_BSTR aVersion, 937 BSTR *aUrl, 933 VirtualBox::CheckFirmwarePresent(FirmwareType_T aFirmwareType, 934 IN_BSTR aVersion, 935 BSTR *aUrl, 938 936 BOOL *aResult) 939 937 { 940 ReturnComNotImplemented(); 938 CheckComArgNotNull(aResult); 939 940 AutoCaller autoCaller(this); 941 CheckComRCReturnRC(autoCaller.rc()); 942 943 const char * url = NULL; 944 945 static const struct { 946 FirmwareType_T type; 947 const char* fileName; 948 const char* url; 949 } firmwareDesc[] = { 950 { 951 /* compiled-in firmware */ 952 FirmwareType_BIOS, NULL, NULL 953 }, 954 { 955 FirmwareType_EFI, "vboxefi.fv", "http://virtualbox.org/firmware/32/vboxefi.fv" 956 }, 957 { 958 FirmwareType_EFI64, "vboxefi64.fv", "http://virtualbox.org/firmware/64/vboxefi.fv" 959 }, 960 { 961 FirmwareType_EFIDUAL, "vboxefidual.fv", "http://virtualbox.org/firmware/dual/vboxefi.fv" 962 } 963 }; 964 965 for (size_t i = 0; i < sizeof(firmwareDesc) / sizeof(firmwareDesc[0]); i++) 966 { 967 if (aFirmwareType != firmwareDesc[i].type) 968 continue; 969 970 /* compiled-in firmware */ 971 if (firmwareDesc[i].fileName == NULL) 972 { 973 *aResult = TRUE; 974 break; 975 } 976 977 Utf8Str shortName, fullName; 978 int rc; 979 980 shortName = Utf8StrFmt("Firmware%c%s", 981 RTPATH_DELIMITER, 982 firmwareDesc[i].fileName); 983 rc = calculateFullPath(shortName, fullName); AssertRCReturn(rc, rc); 984 if (RTFileExists(fullName.raw())) 985 { 986 *aResult = TRUE; 987 break; 988 } 989 990 char pszVBoxPath[RTPATH_MAX]; 991 rc = RTPathExecDir(pszVBoxPath, RTPATH_MAX); AssertRCReturn(rc, rc); 992 fullName = Utf8StrFmt("%s%c%s", 993 pszVBoxPath, 994 RTPATH_DELIMITER, 995 firmwareDesc[i].fileName); 996 if (RTFileExists(fullName.raw())) 997 { 998 *aResult = TRUE; 999 break; 1000 } 1001 1002 url = firmwareDesc[i].url; 1003 /** @todo: account for version in the URL */ 1004 if (aUrl != NULL) 1005 Utf8Str(firmwareDesc[i].url).cloneTo(aUrl); 1006 *aResult = FALSE; 1007 1008 /* Assume single record per firmware type */ 1009 break; 1010 } 1011 1012 return S_OK; 941 1013 } 942 1014 // IVirtualBox methods
Note:
See TracChangeset
for help on using the changeset viewer.