DosWriteQueue adds an element to the specified queue. A client process must request access to the queue by calling DosOpenQueue before it can issue this function. The server process and its threads do not need to issue DosOpenQueue because they already have access to the queue.
If the queue was created as a priority-based queue (as specified in the priority parameter of DosCreateQueue), then the priority of the element that is being added must be specified.
If the server process has closed the queue before this request is issued, ERROR_QUE_INVALID_HANDLE is returned.