An emulation of mkstemp() [ perhaps renamed ] would be my preference,
with the documentation promising that the new file has been created
and cannot be shared.
Having read the Microsoft documentation, it looks like their two
calls (one to get a path name, one to open it) are safe (security
wise) but not so safe functionality wise: someone may create the
file between the two calls. (My Windows programming skills are
rusty, for which I offer no apology.)
An atomic interface is much to be preferred over a two step
"get name, open file" type of deal.
Cheers,
Giles