windows-nt/Source/XPSP1/NT/shell/osshell/accessib/utilman/event.c
2020-09-26 16:20:57 +08:00

33 lines
824 B
C

// ----------------------------------------------------------------------------
//
// Event.c
//
//
// Author: Jost Eckhardt
//
// This code was written for ECO Kommunikation Insight
// (c) 1997-99 ECO Kommunikation
// ----------------------------------------------------------------------------
#include <windows.h>
#include <TCHAR.h>
#include <WinSvc.h>
#include "_UMTool.h"
// -----------------------
HANDLE BuildEvent(LPTSTR name,BOOL manualRest,BOOL initialState,BOOL inherit)
{
HANDLE ev;
LPSECURITY_ATTRIBUTES psa = NULL;
obj_sec_attr_ts sa;
if (!name)
return CreateEvent(NULL, manualRest, initialState, NULL);
if (inherit)
{
psa = &sa.sa;
InitSecurityAttributes(&sa);
}
ev = CreateEvent(psa, manualRest, initialState, name);
if (inherit)
ClearSecurityAttributes(&sa);
return ev;
}//BuildEvent