The answer is no it is not save to return the struct. The struct itself is a copy so it it safe to return but in the struct is a PWSTR aka a char* and that pointer points to an area in the byte* (just after the array of structs) which is not valid after the function returns.