The server process and its threads have certain queue-managing privileges. Only the server process and its threads can:
Client processes can query the queue (DosQueryQueue) and add elements to it (DosWriteQueue), but they must first gain access to the queue by calling DosOpenQueue. When a client process is finished with a queue, it ends its access to the queue by calling DosCloseQueue. (Note that, unlike the server process and its threads, a client process cannot use DosCloseQueue to delete a queue.)
When a queue is opened by a client process, an access count is set to 1. Each client process has its own access count. The access count is incremented whenever a thread in a process opens the queue and decremented whenever a thread in the process closes the queue. Access to the queue by the client process ends when the access count for the process reaches 0. When the server process closes the queue, the queue is terminated and removed from the system.