vinod

vinod

  • NA
  • 2
  • 0

Hw to secure Named Event is set from a single process.

Jun 19 2014 6:06 AM

Hi,

I have two process P1 & P2 on the same machine P2 is listening for a named event "Terminate" being set in P1.

EventWaitHandle watcherTerminationEvent = null;
WaitHandle[] waitHandles = new WaitHandle[1];
watcherTerminationEvent = new EventWaitHandle(false, EventResetMode.AutoReset,"Terminate");
waitHandles[0] = watcherTerminationEvent;
var exitcode = WaitHandle.WaitAny(waitHandles);


Now, there is a chance of setting this event by  any process in the system(P3,P5....), but i need to restrict this only to P1, how can i achieve that.

Thanks

Vinod