"Erik de Castro Lopo" <mle+win(a)mega-nerd.com> wrote:
> - rc=(int)ShellExecute(NULL, operation, file, parameters, directory,
> - SW_SHOWNORMAL);
> + rc=LOWORD(ShellExecute(NULL, operation, file, parameters, directory,
> + SW_SHOWNORMAL));
>
> if (rc > 32)
> {
> @@ -167,7 +167,7 @@ static int shell_execute_ex(DWORD mask, LPCSTR operation, LPCSTR file,
> DeleteFile(child_file);
> SetLastError(0xcafebabe);
> success=ShellExecuteEx(&sei);
> - rc=(int)sei.hInstApp;
> + rc=LOWORD(sei.hInstApp);
> ok((success && rc > 32) || (!success && rc <= 32),
> "%s rc=%d and hInstApp=%d is not allowed\n", shell_call, success, rc);
>
> @@ -836,24 +836,24 @@ static void test_find_executable(void)
> /* Don't test FindExecutable(..., NULL), it always crashes */
>
> strcpy(command, "your word");
> - rc=(int)FindExecutableA(NULL, NULL, command);
> + rc=LOWORD(FindExecutableA(NULL, NULL, command));
> ok(rc == SE_ERR_FNF || rc > 32 /* nt4 */, "FindExecutable(NULL) returned %d\n", rc);
You need to change the type of rc to HINSTANCE and fix the comparisons instead.
What happens if the returned HINSTANCE has a value <= 32 in its low word?
--
Dmitry.