Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
April 2002
- 132 participants
- 664 messages
[PATCH] NtQueryInformationProcess & ProcessDebugPort
by Laurent Pinchart
Hi,
Here's a small patch which implements NtQueryInformationProcess properly for
ProcessInformationClass set to ProcessDebugPort.
It fixes cases when ProcessInformationLength != 4, but doesn't check if a
debugger is present or not. Should it ? I don't expect that anyone would like
to run Visual Studio on Wine to debug a Win32 program :-)
Laurent Pinchart
April 2, 2002
Re: error: no implementation for WININET.dll.102(InternetGetConnectedState)
by Jason M Bell
okay - Alexandre's solution did it.
After turning on --debugmsg +loaddll, I noticed that wininet.dll was
being loaded from "c:\windows\system". I'm running wine from a UNIX
partition.
adding "wininet" = "builtin, native"
to config fixed the problem.
thanks,
Jason
April 2, 2002
Re: Unicode, i18n support
by Dmitry Timoshkov
"Waldek Hebisch" <hebisch(a)math.uni.wroc.pl> wrote:
> I think that the right way is to have code conversion option in
> wine.config, as one of Wine mount options. That way we will be able
> to handle most weird configuration (like UTF-8 on native Linux, cp 1251
> on removable media).
Wonderful. I like this idea. Thanks!
--
Dmitry.
April 2, 2002
Re: dynamic .fon conversion
by Dmitry Timoshkov
"Huw D M Davies" <h.davies1(a)physics.ox.ac.uk> wrote:
> > Now, IIRC (Huw will correct me if I'm wrong), it was said that
> > FreeType also supports Postscript fonts and .fon fonts. So the way to go
> > would be to extend Wine's FreeType support to .fon fonts.
>
> Yes, that's the idea. At the moment we ignore any font that isn't
> sfnt format (that's anything that isn't TT or OpenType). The issues
> are that we need to implement something sensible for GetGlyphOutline
> and GetOutlineTextMetrics for bitmap or Type1 fonts.
I would expect that for at least very first time that functions will
fail for bitmap fonts and return glyph data in GGO_BEZIER format for
Type1 fonts. Later we can add cubic <-> quadratic spline conversion
routines and some special handling for bitmap fonts. Most applications
don't use or provide advanced vector graphics at all. As a side effect
of adding support for bitmap fonts will be retired x11drv font support.
and a possibility for real WYSIWYG in printing.
--
Dmitry.
April 2, 2002
Re: Unicode, i18n support
by Waldek Hebisch
> misunderstood me and decided that I propose to use code page 20866
> instead of 1251 for russian locale under Wine. But that's not the case.
> I only proposed to create filenames on disk in encoding used natively
> in Linux.
I think that the right way is to have code conversion option in
wine.config, as one of Wine mount options. That way we will be able
to handle most weird configuration (like UTF-8 on native Linux, cp 1251
on removable media).
--
Waldek Hebisch
hebisch(a)math.uni.wroc.pl or hebisch(a)hera.math.uni.wroc.pl
April 2, 2002
wine/debugger/stabs.c patch breaks FreeBSD
by Gerald Pfeifer
The following patch to wine/debugger/stabs.c breaks FreeBSD:
revision 1.45
date: 2002/04/02 02:38:37; author: julliard; state: Exp; lines: +2 -0
Check ELF signature before processing file.
stabs.c: In function `DEBUG_ProcessElfFile':
stabs.c:1232: `ELFMAG' undeclared (first use in this function)
stabs.c:1232: (Each undeclared identifier is reported only once
stabs.c:1232: for each function it appears in.)
stabs.c:1232: `SELFMAG' undeclared (first use in this function)
In /usr/include/sys/elf_common FreeBSD has
/* Values for the magic number bytes. */
#define ELFMAG0 0x7f
#define ELFMAG1 'E'
#define ELFMAG2 'L'
#define ELFMAG3 'F'
but not ELFMAG and nothing similiar to SELFMAG.
Gerald
--
Gerald "Jerry" pfeifer(a)dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/
April 2, 2002
wine/dlls/winedos/dosvm.c breaks FreeBSD
by Gerald Pfeifer
The following patch breaks building on FreeBSD 4.5:
revision 1.15
date: 2002/04/01 20:56:15; author: julliard; state: Exp; lines: +15 -4
Jukka Heinonen <jhei(a)iki.fi>
Routine DOSVM_Wait now wakes up if new events are queued and it
returns if it processed any queued events.
with the following error:
/usr/bin/gcc -c -I. -I. -I../../include -I../../include -g -O2 -Wall
-mpreferred-stack-boundary=2 -fPIC -D__WINE__ -D_REENTRANT
-I/usr/X11R6/include -o dosvm.o dosvm.c
dosvm.c: In function `DOSVM_Init':
dosvm.c:687: `event_notifier' undeclared (first use in this function)
dosvm.c:687: (Each undeclared identifier is reported only once
dosvm.c:687: for each function it appears in.)
gmake: *** [dosvm.o] Error 1
because event_notifier is defined within an #ifdef MZ_SUPPORTED covering
most of this file which is not active on FreeBSD, but -- after this patch
-- referenced in code that *is* active on FreeBSD.
I'd appreciate could you have a look...
Gerald
--
Gerald "Jerry" pfeifer(a)dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/
April 2, 2002
ExitProcess crashes apps
by 520007368975-0001@t-online.de
Hi
After just compiling and installing current cvs wine I get an unhandled
exception every time an app closes.
The culprit seems to be somewhere in kernel32.ExitProcess:
Here is the relay output of the uninstaller that comes with wine (last 50
lines)
Enrico
farmboy1(a)subdimension.com
08070840:Ret x11drv.SelectPen() retval=000000e6 ret=4070c3e1
08070840:Call x11drv.SelectBrush(403b44b0,0000075a) ret=4070c3b2
08070840:Ret x11drv.SelectBrush() retval=0000075a ret=4070c3b2
08070840:Call x11drv.SelectPen(403b44b0,0000008a) ret=4070c3e1
08070840:Ret x11drv.SelectPen() retval=0000008a ret=4070c3e1
08070840:Call x11drv.SelectBrush(403b44b0,0000006e) ret=4070c3b2
08070840:Ret x11drv.SelectBrush() retval=0000006e ret=4070c3b2
08070840:Call x11drv.SetDeviceClipping(403b44b0) ret=406fecee
08070840:Ret x11drv.SetDeviceClipping() retval=00000000 ret=406fecee
08070840:Call x11drv.SelectBrush(403b44b0,0000006e) ret=4070c3b2
08070840:Ret x11drv.SelectBrush() retval=0000006e ret=4070c3b2
08070840:Call x11drv.GetDeviceCaps(403b44b0,00000022) ret=407019ed
08070840:Ret x11drv.GetDeviceCaps() retval=000079f7 ret=407019ed
08070840:Call x11drv.SelectFont(403b44b0,000000a2) ret=4070c24c
08070840:Ret x11drv.SelectFont() retval=00000001 ret=4070c24c
08070840:Call x11drv.SelectPen(403b44b0,0000008a) ret=4070c3e1
08070840:Ret x11drv.SelectPen() retval=0000008a ret=4070c3e1
08070840:Call x11drv.SetBkColor(403b44b0,00ffffff) ret=40701a8a
08070840:Ret x11drv.SetBkColor() retval=00ffffff ret=40701a8a
08070840:Call x11drv.SetTextColor(403b44b0,00000000) ret=40701b3a
08070840:Ret x11drv.SetTextColor() retval=00000000 ret=40701b3a
08070840:Ret window proc 0x405e96f4
(hwnd=00010025,msg=BM_SETSTATE,wp=00000000,lp=00000000) retval=00000000
08070840:Call window proc 0x405e96f4
(hwnd=00010025,msg=WM_CAPTURECHANGED,wp=00000000,lp=00000000)
08070840:Ret window proc 0x405e96f4
(hwnd=00010025,msg=WM_CAPTURECHANGED,wp=00000000,lp=00000000) retval=00000000
08070840:Call window proc 0x4001c7f8
(hwnd=00010021,msg=WM_COMMAND,wp=00000002,lp=00010025)
08070840:Call user32.PostQuitMessage(00000000) ret=4001ce19
08070840:Ret user32.PostQuitMessage() retval=00000001 ret=4001ce19
08070840:Ret window proc 0x4001c7f8
(hwnd=00010021,msg=WM_COMMAND,wp=00000002,lp=00010025) retval=00000000
08070840:Ret window proc 0x405e96f4
(hwnd=00010025,msg=WM_LBUTTONUP,wp=00000000,lp=000a0057) retval=00000000
08070840:Ret user32.DispatchMessageA() retval=00000000 ret=4001c311
08070840:Call user32.GetMessageA(40586e18,00000000,00000000,00000000)
ret=4001c31d
08070840:Call
x11drv.MsgWaitForMultipleObjectsEx(00000000,00000000,00000000,00000000,00000000)
ret=405deb9a
08070840:Ret x11drv.MsgWaitForMultipleObjectsEx() retval=00000102
ret=405deb9a
08070840:Ret user32.GetMessageA() retval=00000000 ret=4001c31d
08070840:Call kernel32.ExitProcess(00000000) ret=4001b07c
08070840:Call PE DLL (proc=0x405e5140,module=405c5000,type=0,res=0x1)
08070840:Ret PE DLL (proc=0x405e5140,module=405c5000,type=0,res=0x1) retval=1
08070840:Call PE DLL (proc=0x40829860,module=4081e000,type=0,res=0x1)
080a9e40:Ret x11drv.MsgWaitForMultipleObjectsEx() retval=00000001
ret=405deec9
080a9e40:Call
x11drv.MsgWaitForMultipleObjectsEx(00000000,00000000,00000000,00000000,00000000)
ret=405deb9a
080a9e40:Ret x11drv.MsgWaitForMultipleObjectsEx() retval=00000102
ret=405deb9a
080a9e40:Call
x11drv.MsgWaitForMultipleObjectsEx(00000001,403b3070,ffffffff,00000000,00000000)
ret=405deec9
08070840:Ret PE DLL (proc=0x40829860,module=4081e000,type=0,res=0x1) retval=1
08070840:Call PE DLL (proc=0x406ee894,module=406e1000,type=0,res=0x1)
08070840:Ret PE DLL (proc=0x406ee894,module=406e1000,type=0,res=0x1) retval=1
08070840:Call PE DLL (proc=0x407749e0,module=40764000,type=0,res=0x1)
08070840:Ret PE DLL (proc=0x407749e0,module=40764000,type=0,res=0x1) retval=1
wine: Unhandled exception, starting debugger...
err:win:WIN_FindWndPtr window 10021 belongs to other process
err:win:WIN_FindWndPtr window 10021 belongs to other process
April 2, 2002
Re: dynamic .fon conversion
by Huw D M Davies
On Sat, Mar 30, 2002 at 02:08:37AM -0800, Francois Gouget wrote:
> On Sat, 30 Mar 2002, David Chow wrote:
>
> > Hi,
> >
> > I am new to Wine develop, I wish to investigate and join, the following
> > is the topic I am interested in.
> >
> > Does Wine develpers planning to implement .fon files support? I mean
> > loading it dynamically? Since Xfree86 4 supports true type fonts, and
> > most of the Linux distribution are now using XFree86-4 . We can actually
> > load these fonts into the Xsever dynamically at run time providing we
> > have some dynamic conversion between the font files.
>
> This issue was raised during WineConf. Wine is now able to use
> FreeType to perform client-side rendering of TrueType fonts. This
> results in fonts that look really great, and you can even get
> anti-aliasing.
> Now, IIRC (Huw will correct me if I'm wrong), it was said that
> FreeType also supports Postscript fonts and .fon fonts. So the way to go
> would be to extend Wine's FreeType support to .fon fonts.
Yes, that's the idea. At the moment we ignore any font that isn't
sfnt format (that's anything that isn't TT or OpenType). The issues
are that we need to implement something sensible for GetGlyphOutline
and GetOutlineTextMetrics for bitmap or Type1 fonts.
Huw.
April 2, 2002
Where is "cprof"
by Luca Fini
I've seen that the Wine development team has also developed a profiler for
multi-threaded programs.
I'd be very interested in using it to profile an application which I'm
developing (with no connection with wine itlself).
Unfortunately the site which is suppose to be the cprof home is at Corel,
which I understand is no longer in business.
Where can I found a workable version of cprof?
Many thanks for any reoply.
l.f.
--
--------------------------------------------------------------------------
-- ) Luca Fini Tel: +39 055 2752 307
___ |\ Osservatorio Astrofisico di Arcetri Fax: +39 055 2752 292
/ | | |-_ L.go E.Fermi, 5 +-----------------------------------------
(___|___//___) 50125 Firenze / WWW: http://www.arcetri.astro.it/~lfini
(_) (_) Italia / e-mail: lfini(a)arcetri.astro.it
-----------------------------+--------------------------------------------
April 2, 2002
Re: Read of memory location 0x7ffe0000 in windows NT
by Laurent Pinchart
>
>
>>Hi everybody,
>>
>>I've stumbled accross some code which reads a dword at memory location
>>0x7ffe000, which causes the program to crash and the wine debugger to start.
>>
>>After some investigation, it seems that reading the memory location
>>0x7ffe0000 should return KeTickCount.LowPart to the user process. Has anyone
>>ever heard about that ? I was wondering if it was a native windows NT
>>behaviour, or if it was done by a special kernel-space exception handler
>>installed by the program.
>>
>It's a native NT thing; a page of memory at that address is shared
>between user and kernel space. The definition in the w2k ddk.
>
I found it, thank you very much.
BTW does anyone know where I can find information about KeTickCount ?
I'd like to understand the meaning and purpose of the 3 fields (LowPart,
High1Time, High2Time). There's nothing about it in the MSDN.
Laurent Pinchart
April 2, 2002
Re: Read of memory location 0x7ffe0000 in windows NT
by Marcus Meissner
On Tue, Apr 02, 2002 at 12:11:09AM +0200, Laurent Pinchart wrote:
> Hi everybody,
>
> I've stumbled accross some code which reads a dword at memory location
> 0x7ffe000, which causes the program to crash and the wine debugger to start.
>
> After some investigation, it seems that reading the memory location
> 0x7ffe0000 should return KeTickCount.LowPart to the user process. Has anyone
> ever heard about that ? I was wondering if it was a native windows NT
> behaviour, or if it was done by a special kernel-space exception handler
> installed by the program.
What program uses that code? Does it change the behaviour if run with
-winver win98 or similar?
Ciao, Marcus
April 2, 2002
[regression] crash in bitblt.c:87
by Thomas Duffy
This used to not happen. Now, I get a crash everytime I start up AOL
5.0 under recent (today) cvs. (cut an paste bug still exists, but you
can at least read the backtrace :)
Unhandled exception: page fault on read access to 0x00000010 in 32-bit code (0x40829fd4). In 32-bit mode. Symbol h_errno is invalid Symbol __strtol_internal is invalid 0x40829fd4 (BitBlt+0xb8 [bitblt.c:87] in libgdi32.dll.so): pushl 0x10(%esi) 87 ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height, Wine-dbg>bt Backtrace:
In 32-bit mode. Symbol h_errno is invalid Symbol __strtol_internal is invalid 0x40829fd4 (BitBlt+0xb8 [bitblt.c:87] in libgdi32.dll.so): pushl 0x10(%esi) 87 ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height, Wine-dbg>bt Backtrace: =>0 0x40829fd4 (BitBlt+0xb8(hdcDst=0x860, xDst=0x3, yDst=0x3, width=0x1, height=0x11, hdcSrc=0x0, xSrc=0x0, ySrc=0x0, rop=0xf
Symbol h_errno is invalid Symbol __strtol_internal is invalid 0x40829fd4 (BitBlt+0xb8 [bitblt.c:87] in libgdi32.dll.so): pushl 0x10(%esi) 87 ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height, Wine-dbg>bt Backtrace: =>0 0x40829fd4 (BitBlt+0xb8(hdcDst=0x860, xDst=0x3, yDst=0x3, width=0x1, height=0x11, hdcSrc=0x0, xSrc=0x0, ySrc=0x0, rop=0xf00021) [bitblt.c:87] in libgdi32.dll.so) (ebp=405c6328)
Symbol __strtol_internal is invalid 0x40829fd4 (BitBlt+0xb8 [bitblt.c:87] in libgdi32.dll.so): pushl 0x10(%esi) 87 ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height, Wine-dbg>bt Backtrace: =>0 0x40829fd4 (BitBlt+0xb8(hdcDst=0x860, xDst=0x3, yDst=0x3, width=0x1, height=0x11, hdcSrc=0x0, xSrc=0x0, ySrc=0x0, rop=0xf00021) [bitblt.c:87] in libgdi32.dll.so) (ebp=405c6328) 1 0x62a03f34 (OBJDRCT.DLL.ListDrawItem+0x2ac in C:\AMERICA ONLINE 5.0\OBJDRCT.DLL) (ebp=405c640c)
0x40829fd4 (BitBlt+0xb8 [bitblt.c:87] in libgdi32.dll.so): pushl 0x10(%esi) 87 ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height, Wine-dbg>bt Backtrace: =>0 0x40829fd4 (BitBlt+0xb8(hdcDst=0x860, xDst=0x3, yDst=0x3, width=0x1, height=0x11, hdcSrc=0x0, xSrc=0x0, ySrc=0x0, rop=0xf00021) [bitblt.c:87] in libgdi32.dll.so) (ebp=405c6328) 1 0x62a03f34 (OBJDRCT.DLL.ListDrawItem+0x2ac in C:\AMERICA ONLINE 5.0\OBJDRCT.DLL) (ebp=405c640c) 2 0x62210179 (MANAGER.TOL.FontComboClassProc+0xa6b in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c641c)
87 ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height, Wine-dbg>bt Backtrace: =>0 0x40829fd4 (BitBlt+0xb8(hdcDst=0x860, xDst=0x3, yDst=0x3, width=0x1, height=0x11, hdcSrc=0x0, xSrc=0x0, ySrc=0x0, rop=0xf00021) [bitblt.c:87] in libgdi32.dll.so) (ebp=405c6328) 1 0x62a03f34 (OBJDRCT.DLL.ListDrawItem+0x2ac in C:\AMERICA ONLINE 5.0\OBJDRCT.DLL) (ebp=405c640c) 2 0x62210179 (MANAGER.TOL.FontComboClassProc+0xa6b in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c641c) 3 0x62211770 (MANAGER.TOL.DisplayWindowProc+0x414 in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c6490)
Wine-dbg>bt Backtrace: =>0 0x40829fd4 (BitBlt+0xb8(hdcDst=0x860, xDst=0x3, yDst=0x3, width=0x1, height=0x11, hdcSrc=0x0, xSrc=0x0, ySrc=0x0, rop=0xf00021) [bitblt.c:87] in libgdi32.dll.so) (ebp=405c6328) 1 0x62a03f34 (OBJDRCT.DLL.ListDrawItem+0x2ac in C:\AMERICA ONLINE 5.0\OBJDRCT.DLL) (ebp=405c640c) 2 0x62210179 (MANAGER.TOL.FontComboClassProc+0xa6b in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c641c) 3 0x62211770 (MANAGER.TOL.DisplayWindowProc+0x414 in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c6490) 4 0x40767b83 (WINPROC_wrapper+0x17 in user32.dll.so) (ebp=405c64b4)
Backtrace: =>0 0x40829fd4 (BitBlt+0xb8(hdcDst=0x860, xDst=0x3, yDst=0x3, width=0x1, height=0x11, hdcSrc=0x0, xSrc=0x0, ySrc=0x0, rop=0xf00021) [bitblt.c:87] in libgdi32.dll.so) (ebp=405c6328) 1 0x62a03f34 (OBJDRCT.DLL.ListDrawItem+0x2ac in C:\AMERICA ONLINE 5.0\OBJDRCT.DLL) (ebp=405c640c) 2 0x62210179 (MANAGER.TOL.FontComboClassProc+0xa6b in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c641c) 3 0x62211770 (MANAGER.TOL.DisplayWindowProc+0x414 in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c6490) 4 0x40767b83 (WINPROC_wrapper+0x17 in user32.dll.so) (ebp=405c64b4) 5 0x40767c02 (WINPROC_CallWndProc+0x76(proc=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:1
=>0 0x40829fd4 (BitBlt+0xb8(hdcDst=0x860, xDst=0x3, yDst=0x3, width=0x1, height=0x11, hdcSrc=0x0, xSrc=0x0, ySrc=0x0, rop=0xf00021) [bitblt.c:87] in libgdi32.dll.so) (ebp=405c6328) 1 0x62a03f34 (OBJDRCT.DLL.ListDrawItem+0x2ac in C:\AMERICA ONLINE 5.0\OBJDRCT.DLL) (ebp=405c640c) 2 0x62210179 (MANAGER.TOL.FontComboClassProc+0xa6b in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c641c) 3 0x62211770 (MANAGER.TOL.DisplayWindowProc+0x414 in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c6490) 4 0x40767b83 (WINPROC_wrapper+0x17 in user32.dll.so) (ebp=405c64b4) 5 0x40767c02 (WINPROC_CallWndProc+0x76(proc=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:181] in user32.dll.so) (ebp=405c64e4)
[bitblt.c:87] in libgdi32.dll.so) (ebp=405c6328) 1 0x62a03f34 (OBJDRCT.DLL.ListDrawItem+0x2ac in C:\AMERICA ONLINE 5.0\OBJDRCT.DLL) (ebp=405c640c) 2 0x62210179 (MANAGER.TOL.FontComboClassProc+0xa6b in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c641c) 3 0x62211770 (MANAGER.TOL.DisplayWindowProc+0x414 in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c6490) 4 0x40767b83 (WINPROC_wrapper+0x17 in user32.dll.so) (ebp=405c64b4) 5 0x40767c02 (WINPROC_CallWndProc+0x76(proc=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:181] in user32.dll.so) (ebp=405c64e4) 6 0x4076d650 (CallWindowProcA+0xf8(func=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:2631]
1 0x62a03f34 (OBJDRCT.DLL.ListDrawItem+0x2ac in C:\AMERICA ONLINE 5.0\OBJDRCT.DLL) (ebp=405c640c) 2 0x62210179 (MANAGER.TOL.FontComboClassProc+0xa6b in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c641c) 3 0x62211770 (MANAGER.TOL.DisplayWindowProc+0x414 in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c6490) 4 0x40767b83 (WINPROC_wrapper+0x17 in user32.dll.so) (ebp=405c64b4) 5 0x40767c02 (WINPROC_CallWndProc+0x76(proc=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:181] in user32.dll.so) (ebp=405c64e4) 6 0x4076d650 (CallWindowProcA+0xf8(func=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:2631] in user32.dll.so) (ebp=405c6518)
2 0x62210179 (MANAGER.TOL.FontComboClassProc+0xa6b in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c641c) 3 0x62211770 (MANAGER.TOL.DisplayWindowProc+0x414 in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c6490) 4 0x40767b83 (WINPROC_wrapper+0x17 in user32.dll.so) (ebp=405c64b4) 5 0x40767c02 (WINPROC_CallWndProc+0x76(proc=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:181] in user32.dll.so) (ebp=405c64e4) 6 0x4076d650 (CallWindowProcA+0xf8(func=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:2631] in user32.dll.so) (ebp=405c6518) 7 0x64102027 (DRAGMAN.DLL..text+0x1027 in C:\AMERICA ONLINE 5.0\DRAGMAN.DLL) (ebp=405c6708)
3 0x62211770 (MANAGER.TOL.DisplayWindowProc+0x414 in C:\AMERICA ONLINE 5.0\TOOL\MANAGER.TOL) (ebp=405c6490) 4 0x40767b83 (WINPROC_wrapper+0x17 in user32.dll.so) (ebp=405c64b4) 5 0x40767c02 (WINPROC_CallWndProc+0x76(proc=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:181] in user32.dll.so) (ebp=405c64e4) 6 0x4076d650 (CallWindowProcA+0xf8(func=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:2631] in user32.dll.so) (ebp=405c6518) 7 0x64102027 (DRAGMAN.DLL..text+0x1027 in C:\AMERICA ONLINE 5.0\DRAGMAN.DLL) (ebp=405c6708)
4 0x40767b83 (WINPROC_wrapper+0x17 in user32.dll.so) (ebp=405c64b4) 5 0x40767c02 (WINPROC_CallWndProc+0x76(proc=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:181] in user32.dll.so) (ebp=405c64e4) 6 0x4076d650 (CallWindowProcA+0xf8(func=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:2631] in user32.dll.so) (ebp=405c6518) 7 0x64102027 (DRAGMAN.DLL..text+0x1027 in C:\AMERICA ONLINE 5.0\DRAGMAN.DLL) (ebp=405c6708) Wine-dbg>
5 0x40767c02 (WINPROC_CallWndProc+0x76(proc=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:181] in user32.dll.so) (ebp=405c64e4) 6 0x4076d650 (CallWindowProcA+0xf8(func=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:2631] in user32.dll.so) (ebp=405c6518) 7 0x64102027 (DRAGMAN.DLL..text+0x1027 in C:\AMERICA ONLINE 5.0\DRAGMAN.DLL) (ebp=405c6708) Wine-dbg>
user32.dll.so) (ebp=405c64e4) 6 0x4076d650 (CallWindowProcA+0xf8(func=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:2631] in user32.dll.so) (ebp=405c6518) 7 0x64102027 (DRAGMAN.DLL..text+0x1027 in C:\AMERICA ONLINE 5.0\DRAGMAN.DLL) (ebp=405c6708) Wine-dbg>
6 0x4076d650 (CallWindowProcA+0xf8(func=0x6221135c, hwnd=0x20026, msg=0x2b, wParam=0x0, lParam=0x405c6708) [winproc.c:2631] in user32.dll.so) (ebp=405c6518) 7 0x64102027 (DRAGMAN.DLL..text+0x1027 in C:\AMERICA ONLINE 5.0\DRAGMAN.DLL) (ebp=405c6708) Wine-dbg>
r32.dll.so) (ebp=405c6518) 7 0x64102027 (DRAGMAN.DLL..text+0x1027 in C:\AMERICA ONLINE 5.0\DRAGMAN.DLL) (ebp=405c6708) Wine-dbg>
7 0x64102027 (DRAGMAN.DLL..text+0x1027 in C:\AMERICA ONLINE 5.0\DRAGMAN.DLL) (ebp=405c6708) Wine-dbg>
Wine-dbg>
Wine-dbg>
--
YOO-ESS-AYE! YOO-ESS-AYE!
April 2, 2002
Re: Two fixes for the testing framework makefiles
by Alexandre Julliard
Francois Gouget <fgouget(a)codeweavers.com> writes:
> The first one, in Make.rules.in, makes sure that if you modify
> wtmain.o, then all tests will be rebuilt. You would think that the .c.o
> implicit rule should do that already, but this is not the case. I
> suppose it's because the file is not in the local directory.
Actually this should be done from the top-level makefile, rebuilding
from the sub-makefiles can cause trouble, particularly with parallel
makes.
> The second one, in winetest/Makefile.in, fixes out of tree builds
> (wine.xs may be in ../../../src/program/winetest).
VPATH should take care of that. Do you have a make that requires this?
If so there are many other places we need to fix too.
--
Alexandre Julliard
julliard(a)winehq.com
April 2, 2002
Re: Read of memory location 0x7ffe0000 in windows NT
by David Welch
On Tue, Apr 02, 2002 at 12:11:09AM +0200, Laurent Pinchart wrote:
> Hi everybody,
>
> I've stumbled accross some code which reads a dword at memory location
> 0x7ffe000, which causes the program to crash and the wine debugger to start.
>
> After some investigation, it seems that reading the memory location
> 0x7ffe0000 should return KeTickCount.LowPart to the user process. Has anyone
> ever heard about that ? I was wondering if it was a native windows NT
> behaviour, or if it was done by a special kernel-space exception handler
> installed by the program.
>
It's a native NT thing; a page of memory at that address is shared
between user and kernel space. The definition in the w2k ddk.
April 1, 2002
Read of memory location 0x7ffe0000 in windows NT
by Laurent Pinchart
Hi everybody,
I've stumbled accross some code which reads a dword at memory location
0x7ffe000, which causes the program to crash and the wine debugger to start.
After some investigation, it seems that reading the memory location
0x7ffe0000 should return KeTickCount.LowPart to the user process. Has anyone
ever heard about that ? I was wondering if it was a native windows NT
behaviour, or if it was done by a special kernel-space exception handler
installed by the program.
The assembly code which does the trick is
pusha
mov $0x7ffe0000,%edx
mov (%edx),%eax
mov %eax,0xfffffffc(%ebp)
popa
mov 0xfffffffc(%ebp),%eax
Any idea anyone ?
Thanks for your help.
Laurent Pinchart
April 1, 2002
Re: CreateProcess design
by Alexandre Julliard
Eric Pouech <eric.pouech(a)wanadoo.fr> writes:
> > The basic idea is to have two separate programs; a 'wine' that does
> > all the command-line processing, and a 'wineloader' that simply
> > executes a new process from CreateProcess. Then all the option
> > handling can be moved out of kernel and into that wine program.
> how would you pass info from the former to the later (and under which
> form) ?
Most likely a combination of environment variables and registry
keys. This may also require some restructuring of the configuration
file handling in the registry. The exact details are not really
defined yet.
--
Alexandre Julliard
julliard(a)winehq.com
April 1, 2002
Re: create process test (for review)
by Alexandre Julliard
Eric Pouech <eric.pouech(a)wanadoo.fr> writes:
> +static int get_file_name(char* buf, size_t len, const char* hint)
> +{
> + char* ptr;
> + if (strcmp(winetest_platform, "windows"))
> + {
> + sprintf(buf, "%s/%s", base, hint);
> + for (ptr = buf; *ptr; ptr++)
> + if (*ptr == '\\') *ptr = '/';
> + }
> + else
> + {
> + sprintf(buf, "%s\\%s", base, hint);
> + for (ptr = buf; *ptr; ptr++)
> + if (*ptr == '/') *ptr = '\\';
> + }
> + //fprintf(stderr, "resfile=%s\n", buf);
> + return 0;
> +}
You should never do that kind of things. The platform must be used
exclusively for todo tests, not for changing the test behavior. And
backslashes should work fine under Wine too.
--
Alexandre Julliard
julliard(a)winehq.com
April 1, 2002
File names and Wine.
by Insyde
Hi,
I was looking at th wine source and I couldn't find any support to long file
names under wine (yet).
I was reading the DOSFS part and there is a lot of code that handles 8.3
file names,
but wine support long file names. Can anyone show me where is it? or long
names
depend on Linux?
thanks,
Ricardo.
April 1, 2002
Re: CreateProcess design
by Eric Pouech
> The basic idea is to have two separate programs; a 'wine' that does
> all the command-line processing, and a 'wineloader' that simply
> executes a new process from CreateProcess. Then all the option
> handling can be moved out of kernel and into that wine program.
how would you pass info from the former to the later (and under which
form) ?
A+
April 1, 2002
Re: error: no implementation for WININET.dll.102(InternetGetConnectedState)
by Alexandre Julliard
Jason M Bell <bellj(a)MIT.EDU> writes:
> The source in dlls/wininet/internet.c clearly shows a (simple)
> implementation for InternetGetConnectedState, but Wine isn't importing
> it for some reason. I've turned on other debug traces, but haven't
> gotten any other useful information. What are some other ways of
> attacking the problem?
I'd suggest a -debugmsg +loaddll to see what version of wininet.dll is
getting loaded. I suspect Wine is loading a native one that doesn't
have InternetGetConnectedState.
--
Alexandre Julliard
julliard(a)winehq.com
April 1, 2002
Re: error: no implementation for WININET.dll.102(InternetGetConnectedState)
by Francois Gouget
On Mon, 1 Apr 2002, Jason M Bell wrote:
>
> > According to my files WININET.dll.102 is only present on Windows 95
> >and should be InternetFindNextFileA
>
> How do I fix this in wine? playing with "wine -winver winXX" doesn't
> help. Is there some other debugging trace I should turn on?
Well, this looks quite suspicious:
win95/nt4:
ordinals = 1
102 63 000273F9 InternetFindNextFileA
win98/winme/win2000:
ordinals = 101 -> 112 then 115+
102 0001EA2C [NONAME]
231 75 0002EFC7 InternetFindNextFileA
winxp:
ordinals = 101 -> 123
102 0001AA53 [NONAME]
241 7B 0003FE3E InternetFindNextFileA
Ok, here is my theory as to what happened. Some Win95 and NT4
applications import this API by ordinal (this was a tradition in Win16
and in the early days of win32). In later revisions of wininet MS
changed the numbering for some unknown reason (in XP it seems they added
APIs for instance). What they did then, is for the APIs that they know
to be imported by ordinal by some applications, they also created entry
points that are exported by ordinal only and that match the entry points
in the Win95 version of wininet. This strongly hints to windows
programmers that they should not import these by ordinal.
So we should add the same entries to our version of wininet (see
dlls/wininet/wininet.spec).
Here is the list of Win95 functions that are exported by ordinal in
WinXP:
101 62 00013D51 InternetErrorDlg
102 63 000273F9 InternetFindNextFileA
103 64 0003508D InternetFindNextFileW
104 65 00027055 InternetGetCertByURL
105 66 000100F9 InternetGetConnectedState
108 69 00027610 InternetGetLastResponseInfoA
109 6A 0004033D InternetGetLastResponseInfoW
110 6B 0002654E InternetGoOnline
111 6C 0002651B InternetHangUp
112 6E 0000E04C InternetLockRequestFile
116 72 0003509A InternetOpenUrlW
117 73 000350A7 InternetOpenW
118 74 0000E219 InternetQueryDataAvailable
120 76 00040330 InternetQueryOptionW
121 77 0000E3C4 InternetReadFile
122 78 0000D1F6 InternetReadFileExA
123 79 00040330 InternetReadFileExW
--
Francois Gouget fgouget(a)free.fr http://fgouget.free.fr/
"Lotto: A tax on people who are bad at math." -- unknown
"Windows: Microsoft's tax on computer illiterates." -- WE7U
April 1, 2002
Re: FreeBSD/Solaris and -lc
by Marcus Meissner
On Sun, Mar 31, 2002 at 07:47:18PM -0800, Francois Gouget wrote:
>
> When I compile Wine on FreeBSD and Solaris I keep getting 'undefined
> sybol' errors for all the C library symbols. So I usually add the
> following to 'configure.ac'.
>
> Index: configure.ac
> ===================================================================
> RCS file: /home/wine/wine/configure.ac,v
> retrieving revision 1.14
> diff -u -r1.14 configure.ac
> --- configure.ac 31 Mar 2002 19:23:41 -0000 1.14
> +++ configure.ac 31 Mar 2002 20:45:37 -0000
> @@ -77,6 +77,8 @@
>
> dnl **** Check for some libraries ****
>
> +dnl Check for -lc for FreeBSD and Solaris
> +AC_CHECK_LIB(c,getpid)
> dnl Check for -lm
> AC_CHECK_LIB(m,sqrt)
> dnl Check for -li386 for NetBSD and OpenBSD
>
>
> But is it the right eay to do things? What worries me is that I found
> some messages related to libtool that claim that -lc should not be
> explicitly linked in on FreeBSD (and OpenBSD):
> http://mail.gnu.org/pipermail/libtool/2001-November/005782.html
It should not be linked on Linux.
Hmm, what about something like:
AC_CHECK_FUNC(getpid,,AC_CHECK_LIB(c,getpid))
or similar?
Ciao, Marcus
April 1, 2002
create process test (for review)
by Eric Pouech
as already discussed a bit, here's a first shot at testing CreateProcess
patch is made of two parts:
- extension to existing C test framework to pass argc/argv to any test
function
- the test itself
any comments are welcome
A+
Name: test_arg
ChangeLog: now C tests are able to access argc/argv as passed to the program
License: X11
GenDate: 2002/04/01 15:49:15 UTC
ModifiedFiles: programs/winetest/wtmain.c include/wine/test.h
AddedFiles:
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/programs/winetest/wtmain.c,v
retrieving revision 1.4
diff -u -u -r1.4 wtmain.c
--- programs/winetest/wtmain.c 29 Mar 2002 18:05:17 -0000 1.4
+++ programs/winetest/wtmain.c 30 Mar 2002 06:55:02 -0000
@@ -31,6 +31,10 @@
/* current platform */
const char *winetest_platform = "windows";
+/* passing arguments around */
+static int winetest_argc;
+static char** winetest_argv;
+
struct test
{
const char *name;
@@ -153,6 +157,12 @@
todo_level--;
}
+int winetest_get_mainargs( char*** pargv )
+{
+ *pargv = winetest_argv;
+ return winetest_argc;
+}
+
/* Find a test by name */
static const struct test *find_test( const char *name )
{
@@ -205,6 +215,9 @@
int main( int argc, char **argv )
{
char *p;
+
+ winetest_argc = argc;
+ winetest_argv = argv;
if ((p = getenv( "WINETEST_PLATFORM" ))) winetest_platform = p;
if ((p = getenv( "WINETEST_DEBUG" ))) winetest_debug = atoi(p);
Index: include/wine/test.h
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/include/wine/test.h,v
retrieving revision 1.3
diff -u -u -r1.3 test.h
--- include/wine/test.h 22 Mar 2002 00:58:00 -0000 1.3
+++ include/wine/test.h 30 Mar 2002 06:50:53 -0000
@@ -38,6 +38,7 @@
extern void winetest_start_todo( const char* platform );
extern int winetest_loop_todo(void);
extern void winetest_end_todo( const char* platform );
+extern int winetest_get_mainargs( char*** pargv );
#define START_TEST(name) void func_##name(void)
Name: test_cp
ChangeLog: added a framework for testing CreateProcess and a few tests
License: X11
GenDate: 2002/04/01 16:32:58 UTC
ModifiedFiles: dlls/kernel/Makefile.in dlls/kernel/tests/.cvsignore
AddedFiles: dlls/kernel/tests/process.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/kernel/Makefile.in,v
retrieving revision 1.29
diff -u -u -r1.29 Makefile.in
--- dlls/kernel/Makefile.in 27 Mar 2002 21:03:50 -0000 1.29
+++ dlls/kernel/Makefile.in 28 Mar 2002 06:27:06 -0000
@@ -41,7 +41,8 @@
CTESTS = \
tests/alloc.c \
- tests/directory.c
+ tests/directory.c \
+ tests/process.c
PLTESTS = \
tests/atom.pl
Index: dlls/kernel/tests/.cvsignore
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/kernel/tests/.cvsignore,v
retrieving revision 1.3
diff -u -u -r1.3 .cvsignore
--- dlls/kernel/tests/.cvsignore 27 Mar 2002 21:18:02 -0000 1.3
+++ dlls/kernel/tests/.cvsignore 28 Mar 2002 06:27:19 -0000
@@ -2,4 +2,5 @@
atom.ok
directory.ok
kernel32_test.spec.c
+process.ok
testlist.c
--- /dev/null Thu Jan 1 01:00:00 1970
+++ dlls/kernel/tests/process.c Mon Apr 1 18:32:36 2002
@@ -0,0 +1,732 @@
+/*
+ * Unit test suite for CreateProcess function.
+ *
+ * Copyright 2002 Eric Pouech
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "winbase.h"
+#include "winuser.h"
+#include "wine/test.h"
+
+static char base[MAX_PATH];
+static char selfname[MAX_PATH];
+static char resfile[MAX_PATH];
+
+static int myARGC;
+static char** myARGV;
+
+/* ---------------- portable memory allocation thingie */
+
+static char memory[16384];
+static char* memory_index = memory;
+
+static char* grab_memory(size_t len)
+{
+ char* ret = memory_index;
+ /* align on dword */
+ len = (len + 3) & ~3;
+ memory_index += len;
+ assert(memory_index <= memory + sizeof(memory));
+ return ret;
+}
+
+static void release_memory(void)
+{
+ memory_index = memory;
+}
+
+/* ---------------- simplistic tool to encode/decode strings (to hide \ " ' and such) */
+
+static char* encodeA(const char* str)
+{
+ size_t len;
+ char* ptr;
+ int i;
+
+ if (!str) return "";
+ len = strlen(str) + 1;
+ ptr = grab_memory(len * 2 + 1);
+ for (i = 0; i < len; i++)
+ sprintf(&ptr[i * 2], "%02x", (unsigned char)str[i]);
+ ptr[2 * len] = '\0';
+ return ptr;
+}
+
+static char* encodeW(const WCHAR* str)
+{
+ size_t len;
+ char* ptr;
+ int i;
+
+ if (!str) return "";
+ len = lstrlenW(str) + 1;
+ ptr = grab_memory(len * 4 + 1);
+ assert(ptr);
+ for (i = 0; i < len; i++)
+ sprintf(&ptr[i * 4], "%04x", (unsigned int)(unsigned short)str[i]);
+ ptr[4 * len] = '\0';
+ return ptr;
+}
+
+static unsigned decode_char(char c)
+{
+ if (c >= '0' && c <= '9') return c - '0';
+ if (c >= 'a' && c <= 'f') return c - 'a' + 10;
+ assert(c >= 'A' && c <= 'F');
+ return c - 'A' + 10;
+}
+
+static char* decodeA(const char* str)
+{
+ size_t len;
+ char* ptr;
+ int i;
+
+ len = strlen(str) / 2;
+ if (!len--) return NULL;
+ ptr = grab_memory(len + 1);
+ for (i = 0; i < len; i++)
+ ptr[i] = (decode_char(str[2 * i]) << 4) | decode_char(str[2 * i + 1]);
+ ptr[len] = '\0';
+ return ptr;
+}
+
+static WCHAR* decodeW(const char* str)
+{
+ size_t len;
+ WCHAR* ptr;
+ int i;
+
+ len = strlen(str) / 4;
+ if (!len--) return NULL;
+ ptr = (WCHAR*)grab_memory(len * 2 + 1);
+ for (i = 0; i < len; i++)
+ ptr[i] = (decode_char(str[4 * i]) << 12) |
+ (decode_char(str[4 * i + 1]) << 8) |
+ (decode_char(str[4 * i + 2]) << 4) |
+ (decode_char(str[4 * i + 3]) << 0);
+ ptr[len] = '\0';
+ return ptr;
+}
+
+/******************************************************************
+ * init
+ *
+ * generates basic information like:
+ * base: top of wine tree on linux, curr dir on windows
+ * selfname: the way to reinvoke ourselves
+ */
+static int init(void)
+{
+ myARGC = winetest_get_mainargs( &myARGV );
+ if (strcmp(winetest_platform, "windows"))
+ {
+ char* ptr = getenv("WINELOADER");
+
+ if (!ptr) return 0;
+ strcpy(base, ptr);
+ ptr = strrchr(base, '/');
+ if (!ptr) return 0;
+ *ptr = '\0';
+ /* be sure to use absolute pathnames so we can change dirs whenever we want */
+ sprintf(selfname,
+ "%s/programs/winetest/runtest -q -P wine -M kernel32.dll -T %s -p %s/dlls/kernel/tests/kernel32_test",
+ base, base, base);
+ }
+ else
+ {
+ if (!GetCurrentDirectoryA(sizeof(base), base)) return 0;
+ strcpy(selfname, myARGV[0]);
+ }
+
+ return 1;
+}
+
+/******************************************************************
+ * get_file_name
+ *
+ * generates an absolute file_name for temporary file
+ *
+ */
+static int get_file_name(char* buf, size_t len, const char* hint)
+{
+ char* ptr;
+ if (strcmp(winetest_platform, "windows"))
+ {
+ sprintf(buf, "%s/%s", base, hint);
+ for (ptr = buf; *ptr; ptr++)
+ if (*ptr == '\\') *ptr = '/';
+ }
+ else
+ {
+ sprintf(buf, "%s\\%s", base, hint);
+ for (ptr = buf; *ptr; ptr++)
+ if (*ptr == '/') *ptr = '\\';
+ }
+ //fprintf(stderr, "resfile=%s\n", buf);
+ return 0;
+}
+
+/******************************************************************
+ * doChild
+ *
+ * output most of the information in the child process
+ */
+static void doChild(const char* file)
+{
+ FILE* f = fopen(file, "w+");
+ STARTUPINFOA siA;
+ STARTUPINFOW siW;
+ int i;
+ char* ptrA;
+ WCHAR* ptrW;
+ char bufA[MAX_PATH];
+ WCHAR bufW[MAX_PATH];
+
+ if (!f) return;
+
+ /* output of startup info (Ansi) */
+ GetStartupInfoA(&siA);
+ fprintf(f,
+ "[StartupInfoA]\ncb=%08ld\nlpDesktop=%s\nlpTitle=%s\n"
+ "dwX=%lu\ndwY=%lu\ndwXSize=%lu\ndwYSize=%lu\n"
+ "dwXCountChars=%lu\ndwYCountChars=%lu\ndwFillAttribute=%lu\n"
+ "dwFlags=%lu\nwShowWindow=%u\n"
+ "hStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n",
+ siA.cb, encodeA(siA.lpDesktop), encodeA(siA.lpTitle),
+ siA.dwX, siA.dwY, siA.dwXSize, siA.dwYSize,
+ siA.dwXCountChars, siA.dwYCountChars, siA.dwFillAttribute,
+ siA.dwFlags, siA.wShowWindow,
+ (DWORD)siA.hStdInput, (DWORD)siA.hStdOutput, (DWORD)siA.hStdError);
+
+ /* since GetStartupInfoW is only implemented in win2k,
+ * zero out before calling so we can notice the difference
+ */
+ memset(&siW, 0, sizeof(siW));
+ GetStartupInfoW(&siW);
+ fprintf(f,
+ "[StartupInfoW]\ncb=%08ld\nlpDesktop=%s\nlpTitle=%s\n"
+ "dwX=%lu\ndwY=%lu\ndwXSize=%lu\ndwYSize=%lu\n"
+ "dwXCountChars=%lu\ndwYCountChars=%lu\ndwFillAttribute=%lu\n"
+ "dwFlags=%lu\nwShowWindow=%u\n"
+ "hStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n",
+ siW.cb, encodeW(siW.lpDesktop), encodeW(siW.lpTitle),
+ siW.dwX, siW.dwY, siW.dwXSize, siW.dwYSize,
+ siW.dwXCountChars, siW.dwYCountChars, siW.dwFillAttribute,
+ siW.dwFlags, siW.wShowWindow,
+ (DWORD)siW.hStdInput, (DWORD)siW.hStdOutput, (DWORD)siW.hStdError);
+
+ /* Arguments */
+ fprintf(f, "[Arguments]\nargcA=%d\n", myARGC);
+ for (i = 0; i < myARGC; i++)
+ {
+ fprintf(f, "argvA%d=%s\n", i, encodeA(myARGV[i]));
+ }
+ fprintf(f, "CommandLineA=%s\n", encodeA(GetCommandLineA()));
+
+#if 0
+ int argcW;
+ WCHAR** argvW;
+
+ /* this is part of shell32... and should be tested there */
+ argvW = CommandLineToArgvW(GetCommandLineW(), &argcW);
+ for (i = 0; i < argcW; i++)
+ {
+ fprintf(f, "argvW%d=%s\n", i, encodeW(argvW[i]));
+ }
+#endif
+ fprintf(f, "CommandLineW=%s\n", encodeW(GetCommandLineW()));
+ fprintf(f, "\n");
+
+ /* output of environment (Ansi) */
+ ptrA = GetEnvironmentStringsA();
+ if (ptrA)
+ {
+ fprintf(f, "[EnvironmentA]\n");
+ i = 0;
+ while (*ptrA)
+ {
+ if (strlen(ptrA) < 128)
+ {
+ fprintf(f, "env%d=%s\n", i, encodeA(ptrA));
+ i++;
+ }
+ ptrA += strlen(ptrA) + 1;
+ }
+ fprintf(f, "\n");
+ }
+
+ /* output of environment (Unicode) */
+ ptrW = GetEnvironmentStringsW();
+ if (ptrW)
+ {
+ fprintf(f, "[EnvironmentW]\n");
+ i = 0;
+ while (*ptrW)
+ {
+ if (lstrlenW(ptrW) < 128)
+ {
+ fprintf(f, "env%d=%s\n", i, encodeW(ptrW));
+ i++;
+ }
+ ptrW += lstrlenW(ptrW) + 1;
+ }
+ fprintf(f, "\n");
+ }
+
+ fprintf(f, "[Misc]\n");
+ if (GetCurrentDirectoryA(sizeof(bufA), bufA))
+ fprintf(f, "cdirA=%s\n", encodeA(bufA));
+ if (GetCurrentDirectoryW(sizeof(bufW) / sizeof(bufW[0]), bufW))
+ fprintf(f, "cdirW=%s\n", encodeW(bufW));
+ fprintf(f, "\n");
+
+ fclose(f);
+}
+
+static char* getChildString(const char* sect, const char* key)
+{
+ char buf[1024];
+ char* ret;
+
+ GetPrivateProfileStringA(sect, key, "-", buf, sizeof(buf), resfile);
+ if (buf[0] == '\0' || (buf[0] == '-' && buf[1] == '\0')) return NULL;
+ assert(!(strlen(buf) & 1));
+ ret = decodeA(buf);
+ return ret;
+}
+
+static int cmpChildString(const char* sect, const char* key, const char* result)
+{
+ char* ptr = getChildString(sect, key);
+ int ret;
+
+ if (!ptr && !result) return 0;
+ if (!ptr) return -1;
+ if (!result) return 1;
+ if ((ret = strcmp(ptr, result)) == 0) return 0;
+ fprintf(stderr, "%s <> %s\n", ptr, result);
+ return ret;
+}
+
+/* FIXME: this may be moved to the wtmain.c file, because it may be needed by
+ * others... (windows uses stricmp while Un*x uses strcasecmp...)
+ */
+static int mystrcasecmp(const char* p1, const char* p2)
+{
+ char c1, c2;
+
+ c1 = c2 = '@';
+ while (c1 == c2 && c1)
+ {
+ c1 = *p1++; c2 = *p2++;
+ if (c1 != c2)
+ {
+ c1 = toupper(c1); c2 = toupper(c2);
+ }
+ }
+ return c1 - c2;
+}
+
+static int cmpiChildString(const char* sect, const char* key, const char* result)
+{
+ char* ptr = getChildString(sect, key);
+ int ret;
+
+ if (!ptr && !result) return 0;
+ if (!ptr) return -1;
+ if (!result) return 1;
+ if ((ret = mystrcasecmp(ptr, result)) == 0) return 0;
+ fprintf(stderr, "%s <I> %s\n", ptr, result);
+ return ret;
+}
+
+static int cmpChildInt(const char* sect, const char* key, int val)
+{
+ /* using !val insures that the test will fail if the sect/key isn't present
+ * in result file
+ */
+ return GetPrivateProfileIntA(sect, key, !val, resfile) == val;
+}
+
+static void test_Startup(void)
+{
+ char buffer[MAX_PATH];
+ PROCESS_INFORMATION info;
+ STARTUPINFOA startup;
+
+ /* let's start simplistic */
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+
+ get_file_name(resfile, sizeof(resfile), "foo.ini");
+ sprintf(buffer, "%s tests/process.c %s", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess");
+ /* wait for child to terminate */
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination");
+ /* child process has changed result file, so let profile functions know about it */
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+
+ ok(cmpChildInt("StartupInfoA", "cb", startup.cb), NULL);
+ ok(cmpChildString("StartupInfoA", "lpDesktop", startup.lpDesktop) == 0, NULL);
+ ok(cmpChildString("StartupInfoA", "lpTitle", startup.lpTitle) == 0, NULL);
+ ok(cmpChildInt("StartupInfoA", "dwX", startup.dwX), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwY", startup.dwY), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXSize", startup.dwXSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYSize", startup.dwYSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXCountChars", startup.dwXCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYCountChars", startup.dwYCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFillAttribute", startup.dwFillAttribute), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFlags", startup.dwFlags), NULL);
+ ok(cmpChildInt("StartupInfoA", "wShowWindow", startup.wShowWindow), NULL);
+ release_memory();
+ assert(unlink(resfile) == 0);
+
+ /* not so simplistic now */
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+ startup.lpTitle = "I'm the title string";
+ startup.lpDesktop = "I'm the desktop string";
+ startup.dwXCountChars = 0x12121212;
+ startup.dwYCountChars = 0x23232323;
+ startup.dwX = 0x34343434;
+ startup.dwY = 0x45454545;
+ startup.dwXSize = 0x56565656;
+ startup.dwYSize = 0x67676767;
+ startup.dwFillAttribute = 0xA55A;
+
+ get_file_name(resfile, sizeof(resfile), "foo.ini");
+ sprintf(buffer, "%s tests/process.c %s", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess");
+ /* wait for child to terminate */
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination");
+ /* child process has changed result file, so let profile functions know about it */
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+
+ ok(cmpChildInt("StartupInfoA", "cb", startup.cb), NULL);
+ ok(cmpChildString("StartupInfoA", "lpDesktop", startup.lpDesktop) == 0, NULL);
+ ok(cmpChildString("StartupInfoA", "lpTitle", startup.lpTitle) == 0, NULL);
+ ok(cmpChildInt("StartupInfoA", "dwX", startup.dwX), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwY", startup.dwY), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXSize", startup.dwXSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYSize", startup.dwYSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXCountChars", startup.dwXCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYCountChars", startup.dwYCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFillAttribute", startup.dwFillAttribute), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFlags", startup.dwFlags), NULL);
+ ok(cmpChildInt("StartupInfoA", "wShowWindow", startup.wShowWindow), NULL);
+ release_memory();
+ assert(unlink(resfile) == 0);
+
+ /* not so simplistic now */
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+ startup.lpTitle = "I'm the title string";
+ startup.lpDesktop = NULL;
+ startup.dwXCountChars = 0x12121212;
+ startup.dwYCountChars = 0x23232323;
+ startup.dwX = 0x34343434;
+ startup.dwY = 0x45454545;
+ startup.dwXSize = 0x56565656;
+ startup.dwYSize = 0x67676767;
+ startup.dwFillAttribute = 0xA55A;
+
+ get_file_name(resfile, sizeof(resfile), "foo.ini");
+ sprintf(buffer, "%s tests/process.c %s", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess");
+ /* wait for child to terminate */
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination");
+ /* child process has changed result file, so let profile functions know about it */
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+
+ ok(cmpChildInt("StartupInfoA", "cb", startup.cb), NULL);
+ ok(cmpChildString("StartupInfoA", "lpDesktop", startup.lpDesktop) == 0, NULL);
+ ok(cmpChildString("StartupInfoA", "lpTitle", startup.lpTitle) == 0, NULL);
+ ok(cmpChildInt("StartupInfoA", "dwX", startup.dwX), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwY", startup.dwY), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXSize", startup.dwXSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYSize", startup.dwYSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXCountChars", startup.dwXCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYCountChars", startup.dwYCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFillAttribute", startup.dwFillAttribute), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFlags", startup.dwFlags), NULL);
+ ok(cmpChildInt("StartupInfoA", "wShowWindow", startup.wShowWindow), NULL);
+ release_memory();
+ assert(unlink(resfile) == 0);
+
+ /* not so simplistic now */
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+ startup.lpTitle = "I'm the title string";
+ startup.lpDesktop = "";
+ startup.dwXCountChars = 0x12121212;
+ startup.dwYCountChars = 0x23232323;
+ startup.dwX = 0x34343434;
+ startup.dwY = 0x45454545;
+ startup.dwXSize = 0x56565656;
+ startup.dwYSize = 0x67676767;
+ startup.dwFillAttribute = 0xA55A;
+
+ get_file_name(resfile, sizeof(resfile), "foo.ini");
+ sprintf(buffer, "%s tests/process.c %s", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess");
+ /* wait for child to terminate */
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination");
+ /* child process has changed result file, so let profile functions know about it */
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+
+ ok(cmpChildInt("StartupInfoA", "cb", startup.cb), NULL);
+ todo_wine ok(cmpChildString("StartupInfoA", "lpDesktop", startup.lpDesktop) == 0, NULL);
+ ok(cmpChildString("StartupInfoA", "lpTitle", startup.lpTitle) == 0, NULL);
+ ok(cmpChildInt("StartupInfoA", "dwX", startup.dwX), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwY", startup.dwY), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXSize", startup.dwXSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYSize", startup.dwYSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXCountChars", startup.dwXCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYCountChars", startup.dwYCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFillAttribute", startup.dwFillAttribute), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFlags", startup.dwFlags), NULL);
+ ok(cmpChildInt("StartupInfoA", "wShowWindow", startup.wShowWindow), NULL);
+ release_memory();
+ assert(unlink(resfile) == 0);
+
+ /* not so simplistic now */
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+ startup.lpTitle = NULL;
+ startup.lpDesktop = "I'm the desktop string";
+ startup.dwXCountChars = 0x12121212;
+ startup.dwYCountChars = 0x23232323;
+ startup.dwX = 0x34343434;
+ startup.dwY = 0x45454545;
+ startup.dwXSize = 0x56565656;
+ startup.dwYSize = 0x67676767;
+ startup.dwFillAttribute = 0xA55A;
+
+ get_file_name(resfile, sizeof(resfile), "foo.ini");
+ sprintf(buffer, "%s tests/process.c %s", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess");
+ /* wait for child to terminate */
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination");
+ /* child process has changed result file, so let profile functions know about it */
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+
+ ok(cmpChildInt("StartupInfoA", "cb", startup.cb), NULL);
+ ok(cmpChildString("StartupInfoA", "lpDesktop", startup.lpDesktop) == 0, NULL);
+ ok(cmpChildString("StartupInfoA", "lpTitle", startup.lpTitle) == 0, NULL);
+ ok(cmpChildInt("StartupInfoA", "dwX", startup.dwX), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwY", startup.dwY), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXSize", startup.dwXSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYSize", startup.dwYSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXCountChars", startup.dwXCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYCountChars", startup.dwYCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFillAttribute", startup.dwFillAttribute), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFlags", startup.dwFlags), NULL);
+ ok(cmpChildInt("StartupInfoA", "wShowWindow", startup.wShowWindow), NULL);
+ release_memory();
+ assert(unlink(resfile) == 0);
+
+ /* not so simplistic now */
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+ startup.lpTitle = "";
+ startup.lpDesktop = "I'm the desktop string";
+ startup.dwXCountChars = 0x12121212;
+ startup.dwYCountChars = 0x23232323;
+ startup.dwX = 0x34343434;
+ startup.dwY = 0x45454545;
+ startup.dwXSize = 0x56565656;
+ startup.dwYSize = 0x67676767;
+ startup.dwFillAttribute = 0xA55A;
+
+ get_file_name(resfile, sizeof(resfile), "foo.ini");
+ sprintf(buffer, "%s tests/process.c %s", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess");
+ /* wait for child to terminate */
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination");
+ /* child process has changed result file, so let profile functions know about it */
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+
+ ok(cmpChildInt("StartupInfoA", "cb", startup.cb), NULL);
+ ok(cmpChildString("StartupInfoA", "lpDesktop", startup.lpDesktop) == 0, NULL);
+ todo_wine ok(cmpChildString("StartupInfoA", "lpTitle", startup.lpTitle) == 0, NULL);
+ ok(cmpChildInt("StartupInfoA", "dwX", startup.dwX), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwY", startup.dwY), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXSize", startup.dwXSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYSize", startup.dwYSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXCountChars", startup.dwXCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYCountChars", startup.dwYCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFillAttribute", startup.dwFillAttribute), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFlags", startup.dwFlags), NULL);
+ ok(cmpChildInt("StartupInfoA", "wShowWindow", startup.wShowWindow), NULL);
+ release_memory();
+ assert(unlink(resfile) == 0);
+
+ /* not so simplistic now */
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+ startup.lpTitle = "";
+ startup.lpDesktop = "";
+ startup.dwXCountChars = 0x12121212;
+ startup.dwYCountChars = 0x23232323;
+ startup.dwX = 0x34343434;
+ startup.dwY = 0x45454545;
+ startup.dwXSize = 0x56565656;
+ startup.dwYSize = 0x67676767;
+ startup.dwFillAttribute = 0xA55A;
+
+ get_file_name(resfile, sizeof(resfile), "foo.ini");
+ sprintf(buffer, "%s tests/process.c %s", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess");
+ /* wait for child to terminate */
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination");
+ /* child process has changed result file, so let profile functions know about it */
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+
+ ok(cmpChildInt("StartupInfoA", "cb", startup.cb), NULL);
+ todo_wine ok(cmpChildString("StartupInfoA", "lpDesktop", startup.lpDesktop) == 0, NULL);
+ todo_wine ok(cmpChildString("StartupInfoA", "lpTitle", startup.lpTitle) == 0, NULL);
+ ok(cmpChildInt("StartupInfoA", "dwX", startup.dwX), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwY", startup.dwY), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXSize", startup.dwXSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYSize", startup.dwYSize), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwXCountChars", startup.dwXCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwYCountChars", startup.dwYCountChars), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFillAttribute", startup.dwFillAttribute), NULL);
+ ok(cmpChildInt("StartupInfoA", "dwFlags", startup.dwFlags), NULL);
+ ok(cmpChildInt("StartupInfoA", "wShowWindow", startup.wShowWindow), NULL);
+ release_memory();
+ assert(unlink(resfile) == 0);
+
+ /* TODO: test for A/W and W/A and W/W */
+}
+
+static void test_CommandLine(void)
+{
+ char buffer[MAX_PATH];
+ PROCESS_INFORMATION info;
+ STARTUPINFOA startup;
+
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+
+ /* the basics */
+ get_file_name(resfile, sizeof(resfile), "foo.ini");
+ sprintf(buffer, "%s tests/process.c %s \"C:\\Program Files\\my nice app.exe\"", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess");
+ /* wait for child to terminate */
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination");
+ /* child process has changed result file, so let profile functions know about it */
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+
+ ok(cmpChildInt("Arguments", "argcA", 4), NULL);
+ ok(cmpChildString("Arguments", "argvA3", "C:\\Program Files\\my nice app.exe") == 0, NULL);
+ ok(cmpChildString("Arguments", "argvA4", NULL) == 0, NULL);
+ ok(cmpChildString("Arguments", "CommandLineA", buffer) == 0, NULL);
+ release_memory();
+ assert(unlink(resfile) == 0);
+
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+
+ /* from François */
+ get_file_name(resfile, sizeof(resfile), "foo.ini");
+ sprintf(buffer, "%s tests/process.c %s \"a\\\"b\\\\\" c\\\" d", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess");
+ /* wait for child to terminate */
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination");
+ /* child process has changed result file, so let profile functions know about it */
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+
+ ok(cmpChildInt("Arguments", "argcA", 6), NULL);
+ ok(cmpChildString("Arguments", "argvA3", "a\"b\\") == 0, NULL);
+ ok(cmpChildString("Arguments", "argvA4", "c\"") == 0, NULL);
+ ok(cmpChildString("Arguments", "argvA5", "d") == 0, NULL);
+ ok(cmpChildString("Arguments", "argvA6", NULL) == 0, NULL);
+ ok(cmpChildString("Arguments", "CommandLineA", buffer) == 0, NULL);
+ release_memory();
+ assert(unlink(resfile) == 0);
+}
+
+static void test_Directory(void)
+{
+ char buffer[MAX_PATH];
+ PROCESS_INFORMATION info;
+ STARTUPINFOA startup;
+
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+
+ /* the basics */
+ get_file_name(resfile, sizeof(resfile), "foo.ini");
+ sprintf(buffer, "%s tests/process.c %s", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, "C:\\Windows", &startup, &info), "CreateProcess");
+ /* wait for child to terminate */
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination");
+ /* child process has changed result file, so let profile functions know about it */
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+
+ ok(cmpiChildString("Misc", "cdirA", "C:\\Windows") == 0, NULL);
+ release_memory();
+ assert(unlink(resfile) == 0);
+}
+
+START_TEST(process)
+{
+ int b = init();
+ ok(b, "Basic init of CreateProcess test");
+ if (!b) return;
+
+ if (myARGC >= 3)
+ {
+ doChild(myARGV[2]);
+ return;
+ }
+ test_Startup();
+ test_CommandLine();
+ test_Directory();
+
+ /* things that can be tested:
+ * lookup: check the way program to be executed is searched
+ * environment: check environment string passing
+ * handles: check the handle inheritance stuff (+sec options)
+ * console: check if console creation parameters work
+ */
+}
April 1, 2002