Fixed is_valid_winproc to avoid being optimized out by recent gcc