windows-nt/Source/XPSP1/NT/enduser/windows.com/wuau/wuaulib/aucompat.cpp

44 lines
974 B
C++
Raw Normal View History

2020-09-26 03:20:57 -05:00
/****************************************************************************
Copyright (c) 2001 Microsoft Corporation
Module Name:
aucompat.cpp
Revision History:
DerekM created 10/28/01
****************************************************************************/
#include "pch.h"
#pragma hdrstop
// **************************************************************************
BOOL AUIsTSRunning(void)
{
SC_HANDLE hsc;
BOOL fRet = FALSE;
hsc = OpenSCManager(NULL, NULL, GENERIC_READ);
if (hsc != NULL)
{
SC_HANDLE hsvcTS;
hsvcTS = OpenService(hsc, L"TermService", SERVICE_QUERY_STATUS);
if (hsvcTS != NULL)
{
SERVICE_STATUS ss;
if (QueryServiceStatus(hsvcTS, &ss))
fRet = (ss.dwCurrentState == SERVICE_RUNNING);
CloseServiceHandle(hsvcTS);
}
CloseServiceHandle(hsc);
}
return fRet;
}