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.

64 lines
1.6 KiB

  1. /****************************************************************************\
  2. TESTCERT.C / Factory Mode (FACTORY.EXE)
  3. Microsoft Confidential
  4. Copyright (c) Microsoft Corporation 2001
  5. All rights reserved
  6. Source file for Factory that contains the test certificate state
  7. functions.
  8. 05/2001 - Jason Cohen (JCOHEN)
  9. Added this new source file for factory for install a test
  10. certificate.
  11. \****************************************************************************/
  12. //
  13. // Include File(s):
  14. //
  15. #include "factoryp.h"
  16. //
  17. // External Function(s):
  18. //
  19. BOOL TestCert(LPSTATEDATA lpStateData)
  20. {
  21. BOOL bRet = TRUE;
  22. DWORD dwErr;
  23. LPTSTR lpszIniVal;
  24. TCHAR szTestCert[MAX_PATH];
  25. if ( lpszIniVal = IniGetString(lpStateData->lpszWinBOMPath, INI_SEC_WBOM_SETTINGS, INI_KEY_WBOM_TESTCERT, NULL) )
  26. {
  27. ExpandFullPath(lpszIniVal, szTestCert, AS(szTestCert));
  28. if ( szTestCert[0] && FileExists(szTestCert) )
  29. {
  30. if ( NO_ERROR != (dwErr = SetupAddOrRemoveTestCertificate(szTestCert, INVALID_HANDLE_VALUE)) )
  31. {
  32. FacLogFile(0 | LOG_ERR, IDS_ERR_ADDTESTCERT, szTestCert, dwErr);
  33. bRet = FALSE;
  34. }
  35. }
  36. else
  37. {
  38. FacLogFile(0 | LOG_ERR, IDS_ERR_NOTESTCERT, szTestCert);
  39. bRet = FALSE;
  40. }
  41. FREE(lpszIniVal);
  42. }
  43. return bRet;
  44. }
  45. BOOL DisplayTestCert(LPSTATEDATA lpStateData)
  46. {
  47. return IniSettingExists(lpStateData->lpszWinBOMPath, INI_SEC_WBOM_SETTINGS, INI_KEY_WBOM_TESTCERT, NULL);
  48. }