Changeset 107060 in vbox for trunk/src/VBox/GuestHost
- Timestamp:
- Nov 20, 2024 2:14:22 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/installation/VBoxWinDrvCommon.cpp
r107057 r107060 82 82 83 83 /* Sorted by most likely-ness. */ 84 static PRTUTF16 s_apws zSections[] =84 static PRTUTF16 s_apwsManufacturerSections[] = 85 85 { 86 86 /* Most likely (and doesn't have a decoration). */ … … 93 93 INFCONTEXT InfCtx; 94 94 size_t i; 95 for (i = 0; i < RT_ELEMENTS(s_apwszSections); i++) 96 { 97 PRTUTF16 const pwszSection = s_apwszSections[i]; 98 rc = vboxWinDrvInfQueryContext(hInf, pwszSection, NULL, &InfCtx); 95 96 PCRTUTF16 pwszManufacturerSection = NULL; 97 for (i = 0; i < RT_ELEMENTS(s_apwsManufacturerSections); i++) 98 { 99 rc = vboxWinDrvInfQueryContext(hInf, s_apwsManufacturerSections[i], NULL, &InfCtx); 99 100 if (RT_SUCCESS(rc)) 101 { 102 pwszManufacturerSection = s_apwsManufacturerSections[i]; 100 103 break; 101 } 102 103 if (RT_SUCCESS(rc)) 104 { 105 if (ppwszSection) 106 *ppwszSection = RTUtf16Dup(s_apwszSections[i]); 107 108 return VBOXWINDRVINFTYPE_NORMAL; 104 } 109 105 } 110 106 … … 122 118 }; 123 119 120 PCRTUTF16 pwszPrimitiveSection = NULL; 124 121 for (i = 0; i < RT_ELEMENTS(s_apwszPrimitiveSections); i++) 125 122 { 126 PRTUTF16 const pwszSection = s_apwszPrimitiveSections[i]; 127 rc = vboxWinDrvInfQueryContext(hInf, pwszSection, NULL, &InfCtx); 123 rc = vboxWinDrvInfQueryContext(hInf, s_apwszPrimitiveSections[i], NULL, &InfCtx); 128 124 if (RT_SUCCESS(rc)) 125 { 126 pwszPrimitiveSection = s_apwszPrimitiveSections[i]; 129 127 break; 130 } 131 132 if (RT_SUCCESS(rc)) 128 } 129 } 130 131 /* If both sections are present, consider this INF file as being invalid. 132 * Only one or the other has to be present. */ 133 if ( pwszManufacturerSection 134 && pwszPrimitiveSection) 135 { 136 return VBOXWINDRVINFTYPE_INVALID; 137 } 138 else if (pwszManufacturerSection) 133 139 { 134 140 if (ppwszSection) 135 *ppwszSection = RTUtf16Dup(s_apwszPrimitiveSections[i]); 141 *ppwszSection = RTUtf16Dup(pwszManufacturerSection); 142 143 return VBOXWINDRVINFTYPE_NORMAL; 144 } 145 else if (pwszPrimitiveSection) 146 { 147 if (ppwszSection) 148 *ppwszSection = RTUtf16Dup(pwszPrimitiveSection); 136 149 137 150 return VBOXWINDRVINFTYPE_PRIMITIVE;
Note:
See TracChangeset
for help on using the changeset viewer.