On Fri May 16 18:47:49 2025 +0000, Lorenzo Ferrillo wrote:
it can technically be idempotent, it should be possible to just to return the same pointer. I'm not sure if it's needed at all considering it's never exposed outside shell and ole code
Necessary, no, but it's inconsistent. It's no more important than other code style issues, but still worth fixing.
Also idempotent means that if you do it twice, the result is the same as doing it once, for example ShowWindow(hwnd, SW_SHOW) or fflush(). QueryInterface is not idempotent, it changes the refcount.
...or, well, it should change the refcount. Looks like you forgot that.