Search code examples
c#.netevent-wait-handle

.NET system-wide EventWaitHandle name allowed characters


I'm just curious off hand, are there any restrictions on the naming of a system-wide EventWaitHandle? I want to use a URL as the name for one, but it could have a great deal of odd characters, I don't want it to silently fail or some other such, so just checking up on here if there are any known illegal characters for the names of these.

I tried finding this myself, but my google-fu wasn't up to snuff.


Solution

  • Here it is. See the CreateEvent function documentation.

    The name can have a "Global\" or "Local\" prefix to explicitly create the object in the global or session namespace. The remainder of the name can contain any character except the backslash character (\).

    Also see Kernel Object Namespaces.

    The "Session\" prefix is reserved for system use and you should not use it in names of kernel objects.