Lines Matching defs:fFatal

252  * @returns VINF_SUCCESS on success, some error code on failure (fFatal
258 * @param fFatal Whether failures should be treated as fatal (true) or not (false).
260 static int supR3HardenedMakePath(SUPINSTDIR enmDir, char *pszDst, size_t cchDst, bool fFatal)
301 return supR3HardenedError(VERR_INTERNAL_ERROR, fFatal,
305 supR3HardenedError(rc, fFatal,
315 * @returns VINF_SUCCESS on success, some error code on failure (fFatal
322 * @param fFatal Whether failures should be treated as fatal (true) or not (false).
324 static int supR3HardenedMakeFilePath(PCSUPINSTFILE pFile, char *pszDst, size_t cchDst, bool fWithFilename, bool fFatal)
329 int rc = supR3HardenedMakePath(pFile->enmDir, pszDst, cchDst, fFatal);
340 rc = supR3HardenedError(VERR_BUFFER_OVERFLOW, fFatal,
352 * fFatal is clear and if it's set the function wont return.
354 * @param fFatal Whether validation failures should be treated as
357 DECLHIDDEN(int) supR3HardenedVerifyFixedDir(SUPINSTDIR enmDir, bool fFatal)
363 return supR3HardenedError(VERR_INTERNAL_ERROR, fFatal,
374 supR3HardenedError(VERR_INTERNAL_ERROR, fFatal,
384 int rc = supR3HardenedMakePath(enmDir, szPath, sizeof(szPath), fFatal);
414 rc = supR3HardenedError(VERR_PATH_NOT_FOUND, fFatal,
421 rc = supR3HardenedError(rc, fFatal,
446 rc = supR3HardenedError(VERR_NOT_A_DIRECTORY, fFatal,
450 rc = supR3HardenedError(VERR_ACCESS_DENIED, fFatal,
454 rc = supR3HardenedError(VERR_ACCESS_DENIED, fFatal,
463 rc = supR3HardenedError(VERR_ACCESS_DENIED, fFatal,
477 rc = supR3HardenedError(VERR_PATH_NOT_FOUND, fFatal,
493 * fFatal is clear and if it's set the function wont return.
495 * @param fFatal Whether validation failures should be treated as
501 static int supR3HardenedVerifyFileOpen(PCSUPINSTFILE pFile, bool fFatal, intptr_t *phFile)
506 int rc = supR3HardenedMakeFilePath(pFile, szPath, sizeof(szPath), true /*fWithFilename*/, fFatal);
531 rc = supR3HardenedError(VERR_PATH_NOT_FOUND, fFatal,
537 rc = supR3HardenedError(rc, fFatal, "supR3HardenedVerifyFileInternal: Failed to convert '%s' to UTF-16: %Rrc\n",
548 * fFatal is clear and if it's set the function wont return.
551 * @param fFatal Whether validation failures should be treated as
555 static int supR3HardenedVerifyFileSignature(PCSUPINSTFILE pFile, PSUPVERIFIEDFILE pVerified, bool fFatal, bool fLeaveFileOpen)
569 rc = supR3HardenedVerifyFileOpen(pFile, fFatal, &hFileOpened);
592 rc = supR3HardenedError(rc, fFatal, "supR3HardenedVerifyFileInternal: '%s': Image verify error rc=%Rrc: %s\n",
621 * fFatal is clear and if it's set the function wont return.
624 * @param fFatal Whether validation failures should be treated as
630 static int supR3HardenedVerifyFileInternal(int iFile, bool fFatal, bool fLeaveFileOpen, bool fVerifyAll)
643 return supR3HardenedVerifyFileSignature(pFile, pVerified, fFatal, fLeaveFileOpen);
651 supR3HardenedError(VERR_INTERNAL_ERROR, fFatal,
665 int rc = supR3HardenedVerifyFixedDir(pFile->enmDir, fFatal);
669 rc = supR3HardenedVerifyFileOpen(pFile, fFatal, &pVerified->hFile);
673 rc = supR3HardenedVerifyFileSignature(pFile, pVerified, fFatal, fLeaveFileOpen);
686 rc = supR3HardenedMakeFilePath(pFile, szPath, sizeof(szPath), true /*fWithFilename*/, fFatal);
713 rc = supR3HardenedError(VERR_IS_A_DIRECTORY, fFatal,
717 rc = supR3HardenedError(VERR_ACCESS_DENIED, fFatal,
721 rc = supR3HardenedError(VERR_ACCESS_DENIED, fFatal,
730 rc = supR3HardenedError(VERR_ACCESS_DENIED, fFatal,
740 rc = supR3HardenedError(VERR_PATH_NOT_FOUND, fFatal,
755 * @returns VINF_SUCCESS if matching. On mismatch fFatal indicates whether an
760 * @param fFatal Whether validation failures should be treated as
763 static int supR3HardenedVerifySameFile(int iFile, const char *pszFilename, bool fFatal)
772 int rc = supR3HardenedMakeFilePath(pFile, szName, sizeof(szName), true /*fWithFilename*/, fFatal);
799 supR3HardenedMakeFilePath(pFile, szName, sizeof(szName), true /*fWithFilename*/, fFatal);
800 return supR3HardenedError(rc, fFatal,
821 * On verification failure, an error code will be returned when fFatal is clear,
825 * @param fFatal Whether validation failures should be treated as
828 DECLHIDDEN(int) supR3HardenedVerifyFixedFile(const char *pszFilename, bool fFatal)
837 int rc = supR3HardenedVerifySameFile(iFile, pszFilename, fFatal);
839 rc = supR3HardenedVerifyFileInternal(iFile, fFatal, false /* fLeaveFileOpen */, false /* fVerifyAll */);
852 * @param fFatal See supR3HardenedVerifyAll.
856 static int supR3HardenedVerifyProgram(const char *pszProgName, bool fFatal, bool fLeaveOpen)
874 rc = supR3HardenedError(VERR_INTERNAL_ERROR, fFatal,
877 rc = supR3HardenedVerifyFileInternal(iFile, fFatal, fLeaveOpen,
887 rc = supR3HardenedError(VERR_INTERNAL_ERROR, fFatal,
890 rc = supR3HardenedVerifyFileInternal(iFile, fFatal, fLeaveOpen, false /* fVerifyAll */);
899 supR3HardenedVerifySameFile(iFile, szFilename, fFatal);
902 rc = supR3HardenedError(rc2, fFatal,
913 rc = supR3HardenedError(VERR_NOT_FOUND, fFatal,
916 rc = supR3HardenedError(VERR_NOT_FOUND, fFatal,
919 rc = supR3HardenedError(VERR_NOT_FOUND, fFatal,
930 * On verification failure, an error code will be returned when fFatal is clear,
933 * @param fFatal Whether validation failures should be treated as
939 DECLHIDDEN(int) supR3HardenedVerifyAll(bool fFatal, const char *pszProgName)
956 int rc2 = supR3HardenedVerifyFileInternal(iFile, fFatal, fLeaveOpen, true /* fVerifyAll */);
966 int rc2 = supR3HardenedVerifyProgram(pszProgName, fFatal, fLeaveOpen);