Question about contents of STARTUPINFO structure and non WinMain entry points

James Liggett jrliggett at
Tue Nov 8 00:00:56 CST 2005

First, apologies for the length. It's quite a complex issue:

A few days ago someone sent to the list asking why a program he'd
written on WinXP runs under WineDbg but not under plain wine. Over the
weekend I debugged the program and found out that his program doesn't
use the standard WinMain entrypoint function. As such, he was using
GetStartupInfo to get startup flags. He uses the wShowWindow flag to
control the showing of the program's main window. Trouble is, this value
is zero unless the program is started as a child process using
CreateProcess, given a STARTUPINFO with wShowWindow set to something
other than 0 (usually SW_SHOWNORMAL or SW_SHOW.) So my question is, how
does the information in STARTUPINFO get set initially? I looked through
the code for winecrt0 and found that before WinMain is called, the
wShowWindow flag is set to SW_SHOWNORMAL. But because this program does
not use WinMain, this value doesn't get set. However, the program works
fine on native Windows XP. I looked at ntdll and kernel32 dll code, but
I'm not sure I'm looking in the right place. Can someone give me some
hints as to how to attack this problem?

Thanks a lot,

More information about the wine-devel mailing list