Open wxMichael opened 5 days ago
The documentation is wrong for this but
Using waitForApplication with the returned handle will show the PID for MO2 and wait forever.
...is probably not true. The returned handle is INVALID_HANDLE_VALUE
, which is ((HANDLE)(LONG_PTR)-1)
, so you probably get UB or something close to that when trying to call waitForApplication
with it.
I will update the documentation and expose INVALID_HANDLE_VALUE
to Python so that developers can compare the returned value to something.
The problem:
The documentation states that startApplication returns "The handle to the started application, or 0 if the application failed to start." If the executable fails to launch, the handle for MO2 is returned instead of 0. Using waitForApplication with the returned handle will show the PID for MO2 and wait forever.
To Reproduce:
Run startApplication with a bogus string to trigger a failed start and check the return value. I created a simple plugin to reproduce the issue: https://gist.github.com/wxMichael/f8d05ab4b2f07a547d1e8c57060266d5 Compare the PID on the wait screen to the PID from the error message or Task Manager.
Environment:
USVFS:
https://gist.github.com/wxMichael/8a71088b7f5ad55961ce162529a45d19
MO Interface:
https://gist.github.com/wxMichael/29a4bd7fd1afa830a3333f15a3c040f2