GetStdHandle Problem

Ignasi Villagrasa gri at
Tue Feb 19 04:11:12 CST 2002

Here is the .spec I'm using:

name    mcwine
type    win32
mode    cuiexe
init    main

I compile it using

winebuild -fPIC -o mcwine.c -spec mcwine.spec

It generates a mcwine.c file, that I include in my makefile. I add several wine libraries 
and create the executable without problems. When trying to execute, I get the following message:

wine client error:(nil): sendmsg: Descriptor de fichero err¾neo (In spanish, error in file handle)

If I run the program using gdb, I see the following:

(gdb) r
Starting program: /usr/client/mcc_gnu/cmpm/cmpmgnu /B100 /Oaaaa-1.ovl

Breakpoint 1, McConsole::Inicializar (this=0x80aa528)
    at /usr/comun/src/mc_vis32.cpp:429
429             conhanout = GetStdHandle(STD_OUTPUT_HANDLE);
1: conhanin = 0
(gdb) n
430             conhanin  = GetStdHandle(STD_INPUT_HANDLE);
1: conhanin = 0
(gdb) n
431             FlushConsoleInputBuffer(conhanin);
1: conhanin = 0
(gdb) n
wine client error:(nil): sendmsg: Descriptor de fichero err¾neo

Program exited with code 01.

So I know the problem comes from GetStdHandle, but I don't know why, 
because the program links properly, and I suppose GetStdHandle, a basic 
Win32 function,  should work.

Any hint ?  Perhaps the libraries I'm linking ?  Compiler/linker options ?

Thanks in advance, Ignasi Villagrasa.

More information about the wine-devel mailing list