GetStdHandle Problem

Ignasi Villagrasa gri at
Mon Feb 25 06:26:36 CST 2002

>> I notice there are things I haven't understood yet. Is there any Win32 console based Winlib example. Any simple one.
>> So I can see which process I should follow to get the program properly built.
>the debugger is a pure winelib app, which heavily uses the console, so
>you can copy the Makefiles from it
>(in debugger directory from the source)

I found a little application in wine directory, wcmd, that uses Win32 console functions, and specifically GetStdHandle. 
I though it will be easier to control that the debugger. I built the following makefile, based on the in wcmd 
source code directory:


DIRWINE = /opt/wine
INCL_WINE = -I$(DIRWINE)/include/wine

### Dependencies:

WCMD_dependencies =  \
	batch.obj \
	builtins.obj \
	directory.obj \

# Build

wcmd : $(WCMD_dependencies)
	c++ -o wcmd -L$(DIRWINE)/lib \
batch.obj \
builtins.obj \
directory.obj \
wcmdmain.obj \
-lkernel32 -lntdll -luser32 -lshell32

### Rules

batch.obj: batch.c
	gcc $(INCL_WINE) -c -o batch.obj batch.c

builtins.obj: builtins.c
	gcc $(INCL_WINE) -c -o builtins.obj builtins.c

directory.obj: directory.c
	gcc $(INCL_WINE) -c -o directory.obj directory.c

wcmdmain.obj: wcmdmain.c
	gcc $(INCL_WINE) -c -o wcmdmain.obj wcmdmain.c


It builds properly wcmd executable. But running it I get a Segmentation fault (core dumped). When running it using gdb, 
I find the exception before main in library.

What am I going wrong ?

Is it possible that I have a wrong or an outdated wine version ?

I took it from codeweavers.(codeweavers-wine-20011108-5.i386.rpm). If I have to get an update, I'd like to know if there's 
an already built version for RH6.2 to avoid rebuilding wine package, because Codeweavers hasn't refreshed wine versions and I 
don't find other built versions for RH6.2.

Many thanks for helping.

Ignasi Villagrasa.

More information about the wine-devel mailing list