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.

35 lines
1.7 KiB

  1. /************************************************************************************************
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name: ServiceSetup.h
  4. Abstract: Defines the CServiceSetup class. See description below.
  5. Notes:
  6. History: 01/24/2001 - created, Luciano Passuello (lucianop).
  7. ************************************************************************************************/
  8. #pragma once
  9. #define TSZ_NETWORK_SERVICE_ACCOUNT_NAME TEXT("NT AUTHORITY\\NetworkService")
  10. #define TSZ_DEPENDENCIES TEXT("IISADMIN\0")
  11. /************************************************************************************************
  12. Class: CServiceSetup
  13. Purpose: Encapsulates the logic for service installation, removal and configuration.
  14. Notes: Class design based on the CService class described in the book:
  15. Professional NT Services, by Kevin Miller.
  16. History: 01/24/2001 - created, Luciano Passuello (lucianop)
  17. ************************************************************************************************/
  18. class CServiceSetup
  19. {
  20. public:
  21. CServiceSetup(LPCTSTR szServiceName, LPCTSTR szDisplay);
  22. void Install(LPCTSTR szDescription = NULL, DWORD dwType = SERVICE_WIN32_OWN_PROCESS,
  23. DWORD dwStart = SERVICE_DEMAND_START, LPCTSTR lpDepends = TSZ_DEPENDENCIES, LPCTSTR lpName = TSZ_NETWORK_SERVICE_ACCOUNT_NAME,
  24. LPCTSTR lpPassword = NULL);
  25. void Remove(bool bForce = false);
  26. bool IsInstalled();
  27. DWORD ErrorPrinter(LPCTSTR pszFcn, DWORD dwErr = GetLastError());
  28. private:
  29. TCHAR m_szServiceName[_MAX_PATH];
  30. TCHAR m_szDisplayName[_MAX_PATH];
  31. };
  32. // End of file ServiceSetup.h.