The MIDL compiler offers three different default cases for pointers that do not have pointer attributes at definition time:
A pointer returned by a function must be a unique or full pointer. The MIDL compiler reports an error if a function result is, either explicitly or by default, a reference pointer. The returned pointer always indicates new storage because there is not enough information for the stubs to determine whether there is existing storage in the caller address space for pointer-valued function results.
Functions that return a pointer value can specify a pointer attribute as a function attribute. If a pointer attribute is not present, the function return pointer uses the value provided by the pointer_default attribute.
Note To ensure unambiguous pointer-attribute behavior, always use explicit pointer attributes when defining a pointer.