Source code of Windows XP (NT5)
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.

32 lines
824 B

  1. // ----------------------------------------------------------------------------
  2. //
  3. // Event.c
  4. //
  5. //
  6. // Author: Jost Eckhardt
  7. //
  8. // This code was written for ECO Kommunikation Insight
  9. // (c) 1997-99 ECO Kommunikation
  10. // ----------------------------------------------------------------------------
  11. #include <windows.h>
  12. #include <TCHAR.h>
  13. #include <WinSvc.h>
  14. #include "_UMTool.h"
  15. // -----------------------
  16. HANDLE BuildEvent(LPTSTR name,BOOL manualRest,BOOL initialState,BOOL inherit)
  17. {
  18. HANDLE ev;
  19. LPSECURITY_ATTRIBUTES psa = NULL;
  20. obj_sec_attr_ts sa;
  21. if (!name)
  22. return CreateEvent(NULL, manualRest, initialState, NULL);
  23. if (inherit)
  24. {
  25. psa = &sa.sa;
  26. InitSecurityAttributes(&sa);
  27. }
  28. ev = CreateEvent(psa, manualRest, initialState, name);
  29. if (inherit)
  30. ClearSecurityAttributes(&sa);
  31. return ev;
  32. }//BuildEvent