DWORD status; ... GetExitCodeProcess(ProcessInformation.hProcess, &status); ret = (int)status; #### if (status < 0) { if (ckWARN(WARN_EXEC)) Perl_warner(aTHX_ packWARN(WARN_EXEC), "Can't spawn \"%s\": %s", argv[0], strerror(errno)); status = 255 * 256; } else status *= 256; <---- coercion into 8 bits PL_statusvalue = status; }