Out-Only Unique or Full Pointer Parameters Not Accepted

Unique or full pointers that are [ out]-only are not accepted by the MIDL compiler. Such specifications cause the MIDL compiler to generate an error message.

The automatically generated server stub has to allocate memory for the pointer referent so that the server application can store data in that memory area. According to the definition of an [out]-only parameter, no information about the parameter is transmitted from client to server. In the case of a unique pointer, which can take the value null, the server stub does not have enough information to correctly duplicate the unique pointer in the server's address space, nor does the stub have any information about whether the pointer should point to a valid address or whether it should be set to null. Therefore, this combination is not allowed.

Rather than [out, unique] or [out, ptr] pointers, use [in, out, unique] or [in, out, ptr] pointers, or use another level of indirection such as a reference pointer that points to the valid unique or full pointer.