Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: checks.cpp
  8. //
  9. // Contents: Microsoft Internet Security Authenticode Policy Provider
  10. //
  11. // Functions: checkGetErrorBasedOnStepErrors
  12. //
  13. // History: 06-Jun-1997 pberkman created
  14. //
  15. //--------------------------------------------------------------------------
  16. #include "global.hxx"
  17. DWORD checkGetErrorBasedOnStepErrors(CRYPT_PROVIDER_DATA *pProvData)
  18. {
  19. //
  20. // initial allocation of the step errors?
  21. //
  22. if (!(pProvData->padwTrustStepErrors))
  23. {
  24. return(ERROR_NOT_ENOUGH_MEMORY);
  25. }
  26. // problem with file
  27. if ((pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FILEIO] != 0) ||
  28. (pProvData->padwTrustStepErrors[TRUSTERROR_STEP_CATALOGFILE] != 0))
  29. {
  30. return(CRYPT_E_FILE_ERROR);
  31. }
  32. //
  33. // did we fail in one of the last steps?
  34. //
  35. if (pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_INITPROV] != 0)
  36. {
  37. return(pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_INITPROV]);
  38. }
  39. if (pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] != 0)
  40. {
  41. return(pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV]);
  42. }
  43. if (pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_SIGPROV] != 0)
  44. {
  45. return(pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_SIGPROV]);
  46. }
  47. if (pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_CERTPROV] != 0)
  48. {
  49. return(pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_CERTPROV]);
  50. }
  51. if (pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_CERTCHKPROV] != 0)
  52. {
  53. return(pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_CERTCHKPROV]);
  54. }
  55. if (pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_POLICYPROV] != 0)
  56. {
  57. return(pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_POLICYPROV]);
  58. }
  59. return(ERROR_SUCCESS);
  60. }