Do I really have to guess about the size of the buffer to pass? Wouldn't it be nice if, say, the size parameter was value-return? Then, instead of returning an error, do what is done now and update the size with the total length.
If the updated length is greater then what I passed in then I know:
a) The buffer has a truncated result
b) What the size of the buffer is that I need.
Because... Right now...
while (PWR_ObjGetName == PWR_RET_TRUNC)
double the buffer size
reallocate a bigger buffer
trim the buffer
...is awkward :(