This should be ret by val. For instance, where the ref out param is located (either first or last argument) is not consistent with other functions that use the same paradigm.