- Timestamp:
- Oct 9, 2014 1:10:20 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r53002 r53004 119 119 typedef FNRTR3INITEX *PFNRTR3INITEX; 120 120 121 /** @see RTLogRelPrintf */ 122 typedef DECLCALLBACK(void) FNRTLOGRELPRINTF(const char *pszFormat, ...); 123 typedef FNRTLOGRELPRINTF *PFNRTLOGRELPRINTF; 124 121 125 122 126 /******************************************************************************* … … 160 164 SUPR3HARDENEDMAINSTATE g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_NOT_YET_CALLED; 161 165 AssertCompileSize(g_enmSupR3HardenedMainState, sizeof(uint32_t)); 166 167 #ifdef RT_OS_WINDOWS 168 /** Pointer to VBoxRT's RTLogRelPrintf function so we can write errors to the 169 * release log at runtime. */ 170 static PFNRTLOGRELPRINTF g_pfnRTLogRelPrintf = NULL; 171 #endif 162 172 163 173 … … 1066 1076 va_end(vaCopy); 1067 1077 1078 #ifdef RT_OS_WINDOWS 1079 /* 1080 * The release log. 1081 */ 1082 if (g_pfnRTLogRelPrintf) 1083 { 1084 va_copy(vaCopy, va); 1085 g_pfnRTLogRelPrintf("supR3HardenedFatalMsgV: %s enmWhat=%d rc=%Rrc (%#x)\n", pszWhere, enmWhat, rc); 1086 g_pfnRTLogRelPrintf("supR3HardenedFatalMsgV: %N\n", pszMsgFmt, &vaCopy); 1087 va_end(vaCopy); 1088 } 1089 #endif 1090 1068 1091 /* 1069 1092 * Then to the console. … … 1101 1124 1102 1125 /* 1103 * Don't call TrustedError if it's too early.1126 * Finally, TrustedError if appropriate. 1104 1127 */ 1105 1128 if (g_enmSupR3HardenedMainState >= SUPR3HARDENEDMAINSTATE_WIN_IMPORTS_RESOLVED) … … 1180 1203 #endif 1181 1204 { 1205 #ifdef RT_OS_WINDOWS 1206 if (g_pfnRTLogRelPrintf) 1207 { 1208 va_copy(vaCopy, va); 1209 g_pfnRTLogRelPrintf("supR3HardenedFatalV: %N", pszFormat, &vaCopy); 1210 va_end(vaCopy); 1211 } 1212 #endif 1213 1182 1214 suplibHardenedPrintPrefix(); 1183 1215 suplibHardenedPrintFV(pszFormat, va); … … 1208 1240 va_end(vaCopy); 1209 1241 1242 #ifdef RT_OS_WINDOWS 1243 if (g_pfnRTLogRelPrintf) 1244 { 1245 va_copy(vaCopy, va); 1246 g_pfnRTLogRelPrintf("supR3HardenedErrorV: %N", pszFormat, &vaCopy); 1247 va_end(vaCopy); 1248 } 1249 #endif 1250 1210 1251 suplibHardenedPrintPrefix(); 1211 1252 suplibHardenedPrintFV(pszFormat, va); 1253 1212 1254 return rc; 1213 1255 } … … 1526 1568 szPath, RtlGetLastWin32Error()); 1527 1569 1570 g_pfnRTLogRelPrintf = (PFNRTLOGRELPRINTF)GetProcAddress(hMod, SUP_HARDENED_SYM("RTLogRelPrintf")); 1571 Assert(g_pfnRTLogRelPrintf); /* Not fatal in non-strict builds. */ 1572 1528 1573 #else 1529 1574 /* the dlopen crowd */
Note:
See TracChangeset
for help on using the changeset viewer.