Source code of Windows XP (NT5)
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.

60 lines
1.5 KiB

  1. /****************************************************************************\
  2. OCMGR.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 Optional Components state
  7. functions.
  8. 07/2001 - Jason Cohen (JCOHEN)
  9. Added this new source file for factory to be able to install/unintall
  10. optional components in the Winbom.
  11. \****************************************************************************/
  12. //
  13. // Include File(s):
  14. //
  15. #include "factoryp.h"
  16. //
  17. // Internal Define(s):
  18. //
  19. #define FILE_SYSOCMGR_EXE _T("sysocmgr.exe")
  20. #define CMDLINE_SYSOCMGR _T("/i:sysoc.inf /u:\"%s\" /r /x /q")
  21. //
  22. // External Function(s):
  23. //
  24. BOOL OCManager(LPSTATEDATA lpStateData)
  25. {
  26. BOOL bRet = TRUE;
  27. if ( DisplayOCManager(lpStateData) )
  28. {
  29. TCHAR szCommand[MAX_PATH * 2];
  30. DWORD dwExitCode;
  31. if ( FAILED ( StringCchPrintf ( szCommand, AS ( szCommand ), CMDLINE_SYSOCMGR, lpStateData->lpszWinBOMPath) ) )
  32. {
  33. FacLogFileStr(3, _T("StringCchPrintf failed %s %s" ), szCommand, lpStateData->lpszWinBOMPath );
  34. }
  35. bRet = InvokeExternalApplicationEx(FILE_SYSOCMGR_EXE, szCommand, &dwExitCode, INFINITE, TRUE);
  36. }
  37. return bRet;
  38. }
  39. BOOL DisplayOCManager(LPSTATEDATA lpStateData)
  40. {
  41. return IniSettingExists(lpStateData->lpszWinBOMPath, INI_SEC_WBOM_COMPONENTS, NULL, NULL);
  42. }