ReactOS 0.4.15-dev-8058-ga7cbb60
cicevent.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Cicero
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Cicero event object handling
5 * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#pragma once
9
10#include "cicbase.h"
11
13{
16
17public:
19 {
20 }
22 {
23 Close();
24 }
25
27 {
28 if (pszName)
29 m_pszName = pszName;
30 if (!m_pszName)
31 return FALSE;
33 return (m_hEvent != NULL);
34 }
35 BOOL Open(LPCTSTR pszName)
36 {
37 if (pszName)
38 m_pszName = pszName;
40 return (m_hEvent != NULL);
41 }
42 void Close()
43 {
44 if (m_hEvent)
45 {
47 m_hEvent = NULL;
48 }
49 }
50
51 BOOL Wait(DWORD dwMilliseconds)
52 {
53 return (::WaitForSingleObject(m_hEvent, dwMilliseconds) == WAIT_OBJECT_0);
54 }
55};
void Close()
Definition: cicevent.h:42
BOOL Wait(DWORD dwMilliseconds)
Definition: cicevent.h:51
LPCTSTR m_pszName
Definition: cicevent.h:15
HANDLE m_hEvent
Definition: cicevent.h:14
~CicEvent()
Definition: cicevent.h:21
BOOL Open(LPCTSTR pszName)
Definition: cicevent.h:35
CicEvent()
Definition: cicevent.h:18
BOOL Create(LPSECURITY_ATTRIBUTES lpSA, LPCTSTR pszName)
Definition: cicevent.h:26
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define EVENT_ALL_ACCESS
Definition: isotest.c:82
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define CreateEvent
Definition: winbase.h:3748
#define WAIT_OBJECT_0
Definition: winbase.h:406
#define OpenEvent
Definition: winbase.h:3885
const CHAR * LPCTSTR
Definition: xmlstorage.h:193