I'd avoid unnecessary local variables and compare
Sure, it was just meant as a quick proof of concept. I pushed a new and more compact version.
You should also probably do:
`if (!(ref = InterlockedOr(&impl->ref_public, 0)))`
Maybe, although I currently don't see how a lack of interlocked would hurt. Would you mind explaining what might go wrong? Maybe because the value could be cached by the compiler or something? I'm not sure.