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.
67 lines
1.6 KiB
67 lines
1.6 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: LgWatchDog.h
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of LgWatchDog.h
|
|
//----------------------------------------------------------------------------
|
|
#ifndef __LG__WATCH__DOG__H__INCLUDED__
|
|
#define __LG__WATCH__DOG__H__INCLUDED__
|
|
|
|
#include "..\LgLib\Thread.h"
|
|
#include "..\LgLib\Templ.h"
|
|
|
|
class CLgWatchDog
|
|
{
|
|
public:
|
|
CLgWatchDog();
|
|
virtual ~CLgWatchDog();
|
|
|
|
public:
|
|
BOOL Create( LPCTSTR pCommandLine );
|
|
void Destroy();
|
|
|
|
public:
|
|
BOOL Register( LPCTSTR pRecipientName, DWORD dwRecipientID, DWORD dwRecipientTimeout );
|
|
BOOL Unregister( DWORD dwRecipientID );
|
|
void Update( DWORD dwRecipientID );
|
|
|
|
protected:
|
|
virtual void OnTimeout( LPCTSTR pRecipientName, LPCTSTR pCommandLine ) = 0;
|
|
|
|
private:
|
|
typedef struct WATCHDOG_RECIPIENT
|
|
{
|
|
DWORD dwID;
|
|
TCHAR pName[MAX_PATH];
|
|
LARGE_INTEGER liTimeout;
|
|
LARGE_INTEGER liTime;
|
|
}WATCHDOG_RECIPIENT, *PWATCHDOG_RECIPIENT;
|
|
|
|
CLgArrayP<WATCHDOG_RECIPIENT> m_RecipientArray;
|
|
|
|
private:
|
|
class CLgWatchDogThread : public CLgThread
|
|
{
|
|
public:
|
|
void SetWatchDog( CLgWatchDog *pWatchDog ) { m_pWatchDog = pWatchDog; }
|
|
private:
|
|
virtual DWORD ThreadProc() { return m_pWatchDog->WatchDogThreadProc(); }
|
|
private:
|
|
CLgWatchDog *m_pWatchDog;
|
|
}m_Thread;
|
|
|
|
public:
|
|
DWORD WatchDogThreadProc();
|
|
|
|
private:
|
|
TCHAR m_pCommandLine[MAX_PATH];
|
|
};
|
|
|
|
#endif
|