GetExitCodeProcess always returns 1, nmake problem

Igor Sysoev is at rambler-co.ru
Wed Jun 4 04:13:38 CDT 2003


In the mail list archive I saw that some people use wine to run nmake.
I just wonder if they are able to build a complex ehough makefile without
nmake's switch "-i". In my wine enviroment every program that nmake
runs always returns exit code "1" and nmake terminates further building
something like:
---------
NMAKE : fatal error U1077: 'c:\vc\bin\cl.exe' : return code '0x1'
Stop.
---------
So to ignore exit codes I used to set nmake's switch "-i".

I made small test case that show that wine always set exit code to "1"
despite the passed value. Under Windows NT p1 outputs:
---------
executed
exit code: 0
---------
while under wine-20030508 on FreeBSD 4.3 p1 outputs:
---------
executed
exit code: 1
---------

p1:
---------
#include <windows.h>

main()
{
    int                  code;
    STARTUPINFO          si;
    PROCESS_INFORMATION  pi;

    ZeroMemory(&si, sizeof(si));
    si.cb = sizeof(si);

    if (!CreateProcess(NULL, "p2", NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
        printf("CreateProcess() failed: %d\n", GetLastError());
        exit(1);
    }

    if (WaitForSingleObject(pi.hProcess, INFINITE) == WAIT_FAILED) {
        printf("WaitForSingleObject() failed: %d\n", GetLastError());
        exit(1);
    }

    if (!(GetExitCodeProcess(pi.hProcess, &code))) {
        printf("GetExitCodeProcess() failed: %d\n", GetLastError());
        exit(1);
    }

    printf("exit code: %d\n", code);
    exit(0);
}
---------

p2:
---------
#include <windows.h>

main()
{
    printf("executed\n");
    ExitProcess(0);
}
---------


Igor Sysoev
http://sysoev.ru/en/




More information about the wine-devel mailing list