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.

43 lines
1017 B

  1. /****************************************************************************
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. aucompat.cpp
  5. Revision History:
  6. DerekM created 10/28/01
  7. ****************************************************************************/
  8. #include "pch.h"
  9. #pragma hdrstop
  10. // **************************************************************************
  11. BOOL AUIsTSRunning(void)
  12. {
  13. SC_HANDLE hsc;
  14. BOOL fRet = FALSE;
  15. hsc = OpenSCManager(NULL, NULL, GENERIC_READ);
  16. if (hsc != NULL)
  17. {
  18. SC_HANDLE hsvcTS;
  19. hsvcTS = OpenService(hsc, L"TermService", SERVICE_QUERY_STATUS);
  20. if (hsvcTS != NULL)
  21. {
  22. SERVICE_STATUS ss;
  23. if (QueryServiceStatus(hsvcTS, &ss))
  24. fRet = (ss.dwCurrentState == SERVICE_RUNNING);
  25. CloseServiceHandle(hsvcTS);
  26. }
  27. CloseServiceHandle(hsc);
  28. }
  29. return fRet;
  30. }