On Mon Apr 3 19:09:38 2023 +0000, Esme Povirk wrote:
Technically, NOERROR is an HRESULT, NO_ERROR is Win32 error. This also doesn't make much sense to me. AFAICT GetWindowThreadProcessId in Wine should always set an error if it fails, and if it doesn't I'm not sure S_OK is an improvement.
Hm, I guess I hadn't considered a case where GetWindowThreadProcessId would return 0 without setting an error resulting in an S_OK return value.
I mainly did this to avoid accidentally running into a case where we're reusing an old error value (which is something we do in uia_client.c), but I guess in the case of GetWindowThreadProcessId, we can safely assume that a zero return value means the window is invalid and return `UIA_E_ELEMENTNOTAVAILABLE`