diff -urN wine-20050830/ANNOUNCE wine-20050930/ANNOUNCE --- wine-20050830/ANNOUNCE 2005-08-30 12:58:41.000000000 +0200 +++ wine-20050930/ANNOUNCE 2005-09-30 14:02:38.000000000 +0200 @@ -1,16 +1,15 @@ -This is release 20050830 of Wine, a free implementation of Windows on +This is release 20050930 of Wine, a free implementation of Windows on Unix. This is still a developers only release. There are many bugs and unimplemented features. Most applications still do not work correctly. -WHAT'S NEW with Wine-20050830: (see ChangeLog for details) - - A lot more theming support. - - Many improvements to the various crypto dlls. - - More LDAP support. - - Beginnings of an MSXML implementation. - - Better MSHTML support. - - Emulated version now set to Windows 2000 by default. - - Direct3D fixes and improvements. +WHAT'S NEW with Wine-20050930: (see ChangeLog for details) + - Joystick force feedback support. + - Beginnings of Win64 support. + - Many MSI fixes and cleanups. + - Font linking support. + - Several OLE fixes. + - Some fixes for MacOS/x86. - Lots of bug fixes. See the README file in the distribution for installation instructions. @@ -19,8 +18,8 @@ the release is available at the ftp sites. The sources will be available from the following locations: - http://www.ibiblio.org/pub/Linux/ALPHA/wine/development/Wine-20050830.tar.gz - http://prdownloads.sourceforge.net/wine/Wine-20050830.tar.gz + http://www.ibiblio.org/pub/Linux/ALPHA/wine/development/Wine-20050930.tar.gz + http://prdownloads.sourceforge.net/wine/Wine-20050930.tar.gz It should also be available from any other site that mirrors ibiblio.org. These locations also hold pre-built documentation packages in various diff -urN wine-20050830/ChangeLog wine-20050930/ChangeLog --- wine-20050830/ChangeLog 2005-08-30 12:58:41.000000000 +0200 +++ wine-20050930/ChangeLog 2005-09-30 14:02:38.000000000 +0200 @@ -1,4 +1,2737 @@ ---------------------------------------------------------------- +2005-09-30 Alexandre Julliard + + * dlls/crypt32/encode.c, dlls/crypt32/tests/encode.c: + Juan Lang + Make CryptImport/ExportPublicKeyInfoEx behave the way MSDN describes + them, and a couple of tests. + + * include/wincrypt.h: Juan Lang + Add defines needed for installable OID functions. + + * include/dplay8.h: Robert Reif + Added missing error code. + + * dlls/winedos/dosvm.c: Gerald Pfeifer + We only need the relay debug channel on MZ_SUPPORTED platforms. + + * dlls/urlmon/sec_mgr.c, dlls/urlmon/tests/misc.c: + Jacek Caban + Added GetZoneActionPolicy implementation. + + * programs/uninstaller/Fi.rc, programs/uninstaller/rsrc.rc: + Kimmo Myllyvirta + Finnish resources for uninstaller. + + * dlls/ntdll/tests/.cvsignore, dlls/ntdll/tests/Makefile.in, + dlls/ntdll/tests/om.c: + Vitaliy Margolen + Add a few tests for object manager. + + * dlls/kernel/sync.c, dlls/kernel/virtual.c: + Vitaliy Margolen + Add brackets around (a)?b:c construct. + + * dlls/msi/action.c, dlls/msi/helpers.c, dlls/msi/msi.c, + dlls/msi/msipriv.h: + Mike McCormack + Rename ACTION_DoTopLevelINSTALL to MSI_InstallPackage, remove its + duplicate 4th parameter. + Split the code to copy a package into a separate function. + +2005-09-29 Alexandre Julliard + + * tools/winebuild/build.h, tools/winebuild/main.c, + tools/winebuild/parser.c, tools/winebuild/spec32.c, + tools/winebuild/winebuild.man.in: + Get rid of the debug channels support. + + * dlls/user/defwnd.c, dlls/user/tests/win.c: + Jason Edmeades + Always return MA_ACTIVATE for WM_MOUSEACTIVATE in DefWindowProc. + + * dlls/winspool/info.c, dlls/wldap32/ber.c: + Kevin Koltzau + Fix warnings in 64bit. + + * dlls/wininet/internet.c: Denis Lukianov + Use ICU_BROWSER_MODE in InternetCanonicalizeUrl. + + * include/wine/debug.h, libs/wine/debug.c, libs/wine/wine.def, + libs/wine/wine.map: + Export the get_channel_flags function avoid warnings when passing a + NULL format to wine_dbg_log. + Removed a few no longer used functions. + + * dlls/msi/dialog.c: Mike McCormack + Avoid UpdateWindow, it causes trouble with WS_EX_TRANSPARENT. + + * dlls/wined3d/device.c: Vincent Béron + Don't define some functions/variables if they won't be used after in + wined3d. + + * tools/winemaker: Removed rules for .dbg.c files. + + * dlls/activeds/.cvsignore, dlls/advapi32/.cvsignore, + dlls/advpack/.cvsignore, dlls/amstream/.cvsignore, + dlls/atl/.cvsignore, dlls/avicap32/.cvsignore, + dlls/avifil32/.cvsignore, dlls/cabinet/.cvsignore, + dlls/capi2032/.cvsignore, dlls/cards/.cvsignore, + dlls/cfgmgr32/.cvsignore, dlls/comcat/.cvsignore, + dlls/comctl32/.cvsignore, dlls/commdlg/.cvsignore, + dlls/crtdll/.cvsignore, dlls/crypt32/.cvsignore, + dlls/cryptdll/.cvsignore, dlls/ctl3d/.cvsignore, + dlls/d3d8/.cvsignore, dlls/d3d9/.cvsignore, dlls/d3dim/.cvsignore, + dlls/d3drm/.cvsignore, dlls/d3dx8/.cvsignore, dlls/d3dxof/.cvsignore, + dlls/dbghelp/.cvsignore, dlls/dciman32/.cvsignore, + dlls/ddraw/.cvsignore, dlls/devenum/.cvsignore, + dlls/dinput/.cvsignore, dlls/dinput8/.cvsignore, + dlls/dmband/.cvsignore, dlls/dmcompos/.cvsignore, + dlls/dmime/.cvsignore, dlls/dmloader/.cvsignore, + dlls/dmscript/.cvsignore, dlls/dmstyle/.cvsignore, + dlls/dmsynth/.cvsignore, dlls/dmusic/.cvsignore, + dlls/dmusic32/.cvsignore, dlls/dplay/.cvsignore, + dlls/dplayx/.cvsignore, dlls/dpnet/.cvsignore, + dlls/dpnhpast/.cvsignore, dlls/dsound/.cvsignore, + dlls/dswave/.cvsignore, dlls/dxdiagn/.cvsignore, + dlls/dxerr8/.cvsignore, dlls/dxerr9/.cvsignore, dlls/gdi/.cvsignore, + dlls/glu32/.cvsignore, dlls/glut32/.cvsignore, + dlls/hhctrl.ocx/.cvsignore, dlls/iccvid/.cvsignore, + dlls/icmp/.cvsignore, dlls/ifsmgr.vxd/.cvsignore, + dlls/imagehlp/.cvsignore, dlls/imm32/.cvsignore, + dlls/iphlpapi/.cvsignore, dlls/itss/.cvsignore, + dlls/kernel/.cvsignore, dlls/lzexpand/.cvsignore, + dlls/mapi32/.cvsignore, dlls/mciavi32/.cvsignore, + dlls/mcicda/.cvsignore, dlls/mciseq/.cvsignore, + dlls/midimap/.cvsignore, dlls/mlang/.cvsignore, + dlls/mmdevldr.vxd/.cvsignore, dlls/monodebg.vxd/.cvsignore, + dlls/mpr/.cvsignore, dlls/msacm/.cvsignore, + dlls/msacm/imaadp32/.cvsignore, dlls/msacm/msadp32/.cvsignore, + dlls/msacm/msg711/.cvsignore, dlls/msacm/winemp3/.cvsignore, + dlls/mscms/.cvsignore, dlls/msdmo/.cvsignore, dlls/mshtml/.cvsignore, + dlls/msi/.cvsignore, dlls/msimg32/.cvsignore, dlls/msisys/.cvsignore, + dlls/msnet32/.cvsignore, dlls/msrle32/.cvsignore, + dlls/msvcrt/.cvsignore, dlls/msvcrt20/.cvsignore, + dlls/msvcrt40/.cvsignore, dlls/msvcrtd/.cvsignore, + dlls/msvidc32/.cvsignore, dlls/msvideo/.cvsignore, + dlls/mswsock/.cvsignore, dlls/msxml3/.cvsignore, + dlls/netapi32/.cvsignore, dlls/newdev/.cvsignore, + dlls/ntdll/.cvsignore, dlls/objsel/.cvsignore, + dlls/odbc32/.cvsignore, dlls/odbccp32/.cvsignore, + dlls/ole32/.cvsignore, dlls/oleacc/.cvsignore, + dlls/oleaut32/.cvsignore, dlls/olecli/.cvsignore, + dlls/oledlg/.cvsignore, dlls/olepro32/.cvsignore, + dlls/olesvr/.cvsignore, dlls/opengl32/.cvsignore, + dlls/powrprof/.cvsignore, dlls/psapi/.cvsignore, + dlls/qcap/.cvsignore, dlls/quartz/.cvsignore, + dlls/rasapi32/.cvsignore, dlls/riched20/.cvsignore, + dlls/richedit/.cvsignore, dlls/rpcrt4/.cvsignore, + dlls/rsabase/.cvsignore, dlls/rsaenh/.cvsignore, + dlls/secur32/.cvsignore, dlls/sensapi/.cvsignore, + dlls/serialui/.cvsignore, dlls/setupapi/.cvsignore, + dlls/shdocvw/.cvsignore, dlls/shell32/.cvsignore, + dlls/shfolder/.cvsignore, dlls/shlwapi/.cvsignore, + dlls/snmpapi/.cvsignore, dlls/stdole2.tlb/.cvsignore, + dlls/stdole32.tlb/.cvsignore, dlls/sti/.cvsignore, + dlls/tapi32/.cvsignore, dlls/ttydrv/.cvsignore, + dlls/twain/.cvsignore, dlls/unicows/.cvsignore, dlls/url/.cvsignore, + dlls/urlmon/.cvsignore, dlls/user/.cvsignore, dlls/usp10/.cvsignore, + dlls/uxtheme/.cvsignore, dlls/vdhcp.vxd/.cvsignore, + dlls/vdmdbg/.cvsignore, dlls/version/.cvsignore, + dlls/vmm.vxd/.cvsignore, dlls/vnbt.vxd/.cvsignore, + dlls/vnetbios.vxd/.cvsignore, dlls/vtdapi.vxd/.cvsignore, + dlls/vwin32.vxd/.cvsignore, dlls/win32s/.cvsignore, + dlls/winaspi/.cvsignore, dlls/wined3d/.cvsignore, + dlls/winedos/.cvsignore, dlls/wineps/.cvsignore, + dlls/wininet/.cvsignore, dlls/winmm/.cvsignore, + dlls/winmm/joystick/.cvsignore, dlls/winmm/mciwave/.cvsignore, + dlls/winmm/wavemap/.cvsignore, dlls/winmm/winealsa/.cvsignore, + dlls/winmm/winearts/.cvsignore, dlls/winmm/wineaudioio/.cvsignore, + dlls/winmm/wineesd/.cvsignore, dlls/winmm/winejack/.cvsignore, + dlls/winmm/winenas/.cvsignore, dlls/winmm/wineoss/.cvsignore, + dlls/winnls/.cvsignore, dlls/winsock/.cvsignore, + dlls/winspool/.cvsignore, dlls/wintab32/.cvsignore, + dlls/wintrust/.cvsignore, dlls/wldap32/.cvsignore, + dlls/wow32/.cvsignore, dlls/wsock32/.cvsignore, + dlls/wtsapi32/.cvsignore, dlls/x11drv/.cvsignore, + programs/clock/.cvsignore, programs/cmdlgtst/.cvsignore, + programs/control/.cvsignore, programs/expand/.cvsignore, + programs/hh/.cvsignore, programs/msiexec/.cvsignore, + programs/notepad/.cvsignore, programs/progman/.cvsignore, + programs/regedit/.cvsignore, programs/regsvr32/.cvsignore, + programs/rpcss/.cvsignore, programs/rundll32/.cvsignore, + programs/start/.cvsignore, programs/taskmgr/.cvsignore, + programs/uninstaller/.cvsignore, programs/view/.cvsignore, + programs/wcmd/.cvsignore, programs/wineboot/.cvsignore, + programs/winebrowser/.cvsignore, programs/winecfg/.cvsignore, + programs/wineconsole/.cvsignore, programs/winedbg/.cvsignore, + programs/winefile/.cvsignore, programs/winemenubuilder/.cvsignore, + programs/winemine/.cvsignore, programs/winepath/.cvsignore, + programs/winetest/.cvsignore, programs/winevdm/.cvsignore, + programs/winhelp/.cvsignore, programs/winver/.cvsignore: + We are no longer generating .dbg.c files. + + * dlls/commdlg/cdlg_Fi.rc: + Kimmo Myllyvirta + Bring Finnish resources up to date. + + * programs/regedit/treeview.c: + Vincent Béron + Remove unused function from regedit/treeview.c. + + * dlls/wininet/tests/http.c: + Vincent Béron + Cast the result of strlen() to DWORD and print it via %ld to get rid + of warnings with gcc 3.2. + + * tools/winapi/winapi_check: + Vincent Béron + Update winapi_check for "false" HAVE_* macros. + + * tools/winapi/win32.api: Vincent Béron + Update win32.api to current CVS. + + * dlls/msi/action.c: Mike McCormack + Create a function to read a property as an integer. + + * dlls/wined3d/surface.c: Oliver Stieber + Added support for backbuffer with the formats A1R5G5B5 and X1R5G5B5. + + * dlls/d3d8/surface.c, dlls/d3d8/utils.c: + H. Verbeet + Fix DXT2 & DXT4 support for d3d8. + + * dlls/riched20/editor.c, dlls/riched20/editor.h, + dlls/riched20/editstr.h, dlls/riched20/row.c: + Krzysztof Foltman + - Reimplementation of EM_LINELENGTH. + - Some attempt at documentation of double-linked list of + ME_DisplayItem's. + + * dlls/urlmon/urlmon.inf: Jacek Caban + Register zones. + + * dlls/urlmon/sec_mgr.c, dlls/urlmon/tests/misc.c: + Jacek Caban + Added MapUrlToZone implementation. + + * dlls/ole32/defaulthandler.c: Robert Shearman + Add a stubbed out implementation of IAdviseSink and advise the + delegate object to use it. + +2005-09-28 Alexandre Julliard + + * Make.rules.in, Makefile.in, dlls/Makedll.rules.in, + dlls/dxerr8/Makefile.in, dlls/dxerr9/Makefile.in, + dlls/kernel/process.c, dlls/ntdll/debugtools.c, include/wine/debug.h, + programs/Makeprog.rules.in: + Declare debug channels as static variables so that we don't need to + generate an external .dbg.c file to define them. + + * dlls/ole32/defaulthandler.c: Robert Shearman + - Make the interfaces that should be supported by the data cache + explicit so their is no confusion in this file as to what it should + be implementing and what this object should implement. + - Delegate some IOleObject methods to the server IOleObject if it is + running. + + * dlls/ntdll/critsection.c: + Use Linux futexes instead of semaphores if possible for critical + section waits. + + * Make.rules.in, libs/wpp/.cvsignore, libs/wpp/Makefile.in, + libs/wpp/ppl.l, programs/winedbg/.cvsignore, + programs/winedbg/Makefile.in, programs/winedbg/debug.l, + tools/makedep.c, tools/widl/.cvsignore, tools/widl/Makefile.in, + tools/widl/parser.l, tools/wmc/.cvsignore, tools/wmc/Makefile.in, + tools/wmc/mcl.c, tools/wrc/.cvsignore, tools/wrc/Makefile.in, + tools/wrc/parser.l: + Now that we are requiring bison anyway, make the .tab.c file use the + same base name as the .y file, so that we can generate correct + dependencies in all cases. + + * dlls/ole32/datacache.c: + Alex Villacís Lasso + Add NULL check for sinkInterface in DataCache_GetAdvise. + + * dlls/ole32/defaulthandler.c: + Alex Villacís Lasso + Add missing ! to fix a reversed condition check in + OleCreateDefaultHandler, in order to match intent in comment. + + * dlls/crypt32/encode.c, dlls/crypt32/tests/encode.c: + Juan Lang + Encode RSA public key modulus as unsigned integer, with tests. + + * dlls/d3d8/d3d8_private.h, dlls/opengl32/opengl_ext.h, + include/wine/wined3d_gl.h: + H. Verbeet + Fix missing prototypes when using nVidia OpenGL headers. + + * dlls/user/tests/msg.c: Dmitry Timoshkov + Explicitly ignore WM_GETICON message in the message tests. + + * dlls/x11drv/opengl.c: Gerald Pfeifer + Use 0 instead of NULL in create_glxpixmap(). + + * dlls/msi/action.c: Mike McCormack + Add some more action stubs, remove forward declarations. + + * include/wine/debug.h, libs/wine/debug.c, libs/wine/loader.c, + libs/wine/wine.def, libs/wine/wine.map, programs/taskmgr/dbgchnl.c, + programs/winedbg/info.c: + New scheme for keeping track of debug channels that doesn't require + maintaining a list of all loaded dlls. + + * dlls/user/tests/msg.c, dlls/x11drv/winpos.c: + Dmitry Timoshkov + Make DrawMenuBar and SetMenu tests pass under Wine. + + * dlls/msi/action.c: Mike McCormack + Split command line parsing from MSI_InstallPackage into a separate + function. + + * dlls/msi/dialog.c: Mike McCormack + Add the progress control. + + * server/object.c: Vitaliy Margolen + Fix refcount leak and return correct error in create_named_object. + + * dlls/msi/msipriv.h, dlls/msi/msiquery.c, dlls/msi/sql.y, + dlls/msi/table.c, dlls/msi/tests/db.c: + Mike McCormack + Fix and test MsiViewGetColumnInfo and binary fields. + + * dlls/msi/custom.c: Mike McCormack + Don't quote numbers in a query, as it doesn't parse correctly. + + * dlls/advapi32/crypt.c, dlls/advapi32/tests/crypt.c: + Vincent Béron + Remove some Unicode->ANSI cross-calls in crypt functions. + + * dlls/mlang/mlang.c, dlls/mlang/tests/mlang.c: + Aric Stewart + Implement a basic beginning for fnIMLangFontLink_CodePageToCodePages, + fnIMLangFontLink_CodePagesToCodePage and + fnIMLangFontLink_GetFontCodePages. + Also some tests for the new functions. + + * dlls/kernel/tests/atom.c: Eric Pouech + Added a bunch of test cases for atoms. + + * dlls/user/misc.c, dlls/user/tests/.cvsignore, + dlls/user/tests/Makefile.in, dlls/user/tests/monitor.c, + include/winuser.h: + Huw Davies + EnumDisplayDevices and GetMonitorInfo should return the same device + name for the primary device. + Make both EnumDisplayDevicesA and GetMonitorInfoA call their unicode + counterparts. + Update prototype of EnumDisplayDevices. + Add some tests. + + * dlls/setupapi/Sv.rc, dlls/setupapi/setupapi.rc: + Anders Bergh + Added Swedish translation. + + * dlls/hhctrl.ocx/help.c: James Hawkins + - Store the HHInfo struct in the SizeBar hwnd. + - Set the default navigation pane width if no width provided. + - Handle dragging of the SizeBar. + + * tools/winapi/winapi_check: + Vincent Béron + Don't treat absence of conditional as config.h being useless if + wine/port.h is included, as it's necessary in that case. + + * dlls/crypt32/crypt32.spec, dlls/crypt32/encode.c, + dlls/crypt32/tests/encode.c: + Juan Lang + Implement CryptImport/ExportPublicKeyInfo. + + * include/wincrypt.h: Juan Lang + Add a few more missing prototypes. + + * dlls/gdi/font.c: Dmitry Timoshkov + Draw underline and strikeout for ExtTextOut on an open path using + Polygon to more closely mimic what Windows does. + + * dlls/Makedll.rules.in: Mike McCormack + Make sure to build the def file after a make clean in a module + subdir. + + * dlls/msi/custom.c, dlls/msi/handle.c, dlls/msi/msi.c, dlls/msi/msipriv.h: + Mike McCormack + Don't create MSI handles unless we have to pass one through the API. + + * dlls/wined3d/device.c, dlls/wined3d/stateblock.c, + dlls/wined3d/wined3d_private.h: + Oliver Stieber + Implement state tracking for pixel shader constants. + +2005-09-27 Alexandre Julliard + + * dlls/kernel/ne_segment.c: + Don't apply relocations a second time to self loaded segments. + Fixed messed up indentation in NE_FixupSegmentPrologs. + + * server/.cvsignore, server/Makefile.in, server/wineserver.man.in: + Initial version of a wineserver man page. + + * dlls/msvcrt/msvcrt.spec, dlls/msvcrt/time.c, include/msvcrt/time.h: + Added implementation of _dstbias and __p__dstbias. + Added macros for _dstbias, _daylight, _timezone and _tzname. + + * dlls/kernel/process.c, dlls/ntdll/process.c, include/winbase.h, + include/wine/server_protocol.h, server/process.c, + server/protocol.def, server/trace.c: + Eric Pouech + Implemented kernel32 process affinity handling on top on ntdll. + + * dlls/wined3d/drawprim.c, dlls/wined3d/surface.c: + Oliver Stieber + Change the format of surface_SaveSnapshot to TGA from PPM and add + support for compressed textures and an alpha channel. + + * server/handle.c: + Use the proper format to print handles in handle_table_dump. + + * dlls/ntdll/signal_i386.c: Fixed exception handling on MacOS. + + * dlls/ddraw/clipper.c: + The clip list is in screen coordinates so we need to map the result of + GetRandomRgn if the Windows version is win9x. + + * programs/winedbg/memory.c: + Fixed disassembling functions to handle 16-bit code segments properly. + + * dlls/msvideo/msvideo16.c, dlls/ole32/ole2nls.c: + Vincent Béron + Use the proper calling convention for 2 16-bit functions. + + * dlls/wined3d/surface.c: Oliver Stieber + Correct a problem with locking nonpower 2 back and front buffers. + + * dlls/kernel/comm.c: Alex Villacís Lasso + Tolerate ioctl failure in GetCommState() in order to be capable to use + softmodems. + +2005-09-26 Alexandre Julliard + + * dlls/user/tests/win.c: + Added a test to confirm the behavior of GetRandomRgn. + + * dlls/ntdll/debugtools.c, include/wine/debug.h, libs/wine/debug.c: + Export the temp buffer functionality in the debug functions interface + to allow sharing more code between libwine and ntdll. + + * dlls/activeds/activeds.spec, dlls/activeds/activeds_main.c, + include/.cvsignore, include/Makefile.in, include/adshlp.h, + include/iads.idl, tools/winapi/win32.api: + Francois Gouget + Add iads.idl to define the IADsContainer interface. + Add adshlp.h to declare the ADs* functions. + Fix the ADsOpenObject() prototype. + Update win32.api to match. + + * dlls/riched20/editor.c: Rein Klazes + When scrolling, first update the new position of the control before + calling UpdateWindow(). + + * programs/regedit/De.rc: Henning Gerhardt + Update German regedit resource file. + + * dlls/d3dxof/d3dxof.spec: Francois Gouget + Export the Dll(Un)RegisterServer() functions to make d3dxof.dll a + self-registering dll. + + * dlls/dxguid/dxguid.c, include/d3drm.h: + Francois Gouget + Define the Direct3DRM GUIDs in d3drm.h. + Include d3drm.h in dxguid. + + * dlls/kernel/sync.c, dlls/ntdll/critsection.c, include/wine/port.h, + libs/port/interlocked.c, libs/wine/debug.c, loader/kthread.c, + server/change.c: + Use int instead of long in interlocked_* functions for 64-bit + compatibility. + + * dlls/kernel/path.c: + Use a larger buffer in CopyFileW now that the file handle may not + always be cached. + + * dlls/msi/table.c: Mike McCormack + Create a function to determine the table's row size and use it. + Fix a memory leak in the table code. + + * tools/winapi/c_parser.pm: Francois Gouget + volatile is valid everywhere const is valid. + + * programs/wcmd/No.rc, programs/wcmd/wcmdrc.rc, + programs/wineconsole/wineconsole_No.rc, + programs/wineconsole/wineconsole_res.rc: + Alexander N. Sørnes + Norwegian translation of wcmd and wineconsole. + + * dlls/x11drv/bitmap.c, dlls/x11drv/init.c, dlls/x11drv/opengl.c, + dlls/x11drv/x11drv.h: + Huw Davies + Add an x11drv escape that returns a glx drawable. + + * programs/cmdlgtst/No.rc, programs/cmdlgtst/cmdlgr.rc, + programs/progman/No.rc, programs/progman/rsrc.rc, + programs/regedit/No.rc, programs/regedit/rsrc.rc, + programs/start/No.rc, programs/start/rsrc.rc, programs/view/No.rc, + programs/view/viewrc.rc: + Alexander N. Sørnes + Added Norwegian translation of some programs. + + * dlls/kernel/sync.c, dlls/ntdll/file.c, + include/wine/server_protocol.h, server/named_pipe.c, + server/protocol.def, server/trace.c: + Eric Pouech + - now passing access rights when creating a named pipe in NTDLL + - reimplemented Kernel32.CreatePipe purely on top of NTDLL APIs + - anonymous pipe handles should have the SYNCHRONIZE bit set + + * dlls/ntdll/heap.c, dlls/ole32/defaulthandler.c, + dlls/wined3d/device.c, dlls/wined3d/vertexshader.c, + dlls/wined3d/wined3d_private.h: + Francois Gouget + Assorted spelling fixes. + + * dlls/mpr/mpr.rc, dlls/mpr/mpr_No.rc, dlls/msacm/msacm.rc, + dlls/msacm/msacm_No.rc, dlls/msrle32/msrle_No.rc, + dlls/msrle32/rsrc.rc, dlls/oledlg/oledlg_No.rc, dlls/oledlg/rsrc.rc, + dlls/shdocvw/No.rc, dlls/shdocvw/shdocvw.rc, dlls/shlwapi/shlwapi.rc, + dlls/shlwapi/shlwapi_No.rc, dlls/user/resources/user32_No.rc, + dlls/wineps/rsrc.rc, dlls/wineps/wps_No.rc, dlls/wininet/rsrc.rc, + dlls/wininet/wininet_No.rc, dlls/winmm/winmm_No.rc, + dlls/winmm/winmm_res.rc, dlls/wldap32/wldap32.rc, + dlls/wldap32/wldap32_No.rc: + Alexander N. Sørnes + Added Norwegian translations. + + * dlls/msi/package.c, dlls/msi/select.c, dlls/msi/sql.y, + dlls/msi/update.c, dlls/msi/where.c: + Mike McCormack + Fix various query related memory leaks. + + * programs/winefile/De.rc: Henning Gerhardt + Update German resource file. + + * programs/regedit/En.rc, programs/regedit/Nl.rc, + programs/regedit/Pl.rc, programs/regedit/Pt.rc, + programs/regedit/childwnd.c, programs/regedit/framewnd.c, + programs/regedit/main.h, programs/regedit/resource.h, + programs/regedit/treeview.c: + Krzysztof Foltman + - Copy key name works. + - Favorites (adding, removing, going to) work. + - Added context sensitive graying to some menu options. + - Cleanup of status bar update. + + * dlls/ntdll/virtual.c, dlls/user/menu.c: + Francois Gouget + Replace the 'if (!cond) ; else code' construct with the standard 'do { + code } while (0)' construct combined with a regular 'if'. + + * dlls/ole32/ole2.spec, dlls/ole32/storage.spec, + dlls/oleaut32/oleaut32.spec, dlls/shlwapi/shlwapi.spec: + Francois Gouget + Fix .spec declarations for functinos with 64bit arguments (reported by + winapi_check). + + * dlls/msi/action.c: Mike McCormack + Make a macro function for unimplemented actions. + Add some more unimplemented action stubs. + + * dlls/ntdll/time.c: Vijay Kiran Kamuju + Add MYT (Malaysian Time) and NOVST (Novosibirsk Summer Time). + + * dlls/msi/msiquery.c: Mike McCormack + Fill out the stubs for MsiApplyTransformA/W a bit more. + + * dlls/user/tests/dde.c: Dmitry Timoshkov + Calling DdeUninitialize hangs DDE test on XP SP1, so remove that call, + and add a comment explaining it. + + * dlls/msi/tests/format.c, dlls/msi/tests/package.c: + Mike McCormack + Fix handle leaks in the test cases. + + * dlls/msi/string.c: Mike McCormack + Make sure to set the minimum size before allocating string table + memory. + + * dlls/msvcrt/file.c: Francois Gouget + Make it clear the empty body sections are not accidental. + + * tools/winapi/win16.api: Francois Gouget + HOLEMENU is a 'long' as far as winapi_check is concerned. + + * dlls/shell32/shell32_Fi.rc: + Kimmo Myllyvirta + Update Finnish resources. + + * dlls/riched20/reader.c: Krzysztof Foltman + - Optional destinations in stylesheets are now skipped properly (and + not treated as the "proper" styles as they were before). + - EOF condition in the middle of the stylesheet is no longer putting + the reader into infinite loop, + - Half-full input buffers don't trigger EOF anymore (although it + could, in theory, break some apps, I find it unlikely - and the + change makes Out from Boneville installer display license properly). + + * tools/winapi/win32.api: Francois Gouget + Update win32.api to match the current sources. + Fix the usp10.dll name. + Fix PBERVAL alphabetical order. + + * dlls/d3d8/shader.c, dlls/d3d9/d3d9_main.c: + Francois Gouget + Documentation tweaks to make winapi_check happy. + + * include/vfw.h: Francois Gouget + Add AVISTREAMREAD_CONVENIENT. + + * dlls/oleaut32/tests/olefont.c, dlls/secur32/tests/main.c: + Francois Gouget + Add trailing '\n's to ok() calls. + + * tools/winapi/winapi_function.pm, tools/winapi/winapi_local.pm: + Francois Gouget + Update winapi_check so it considers 'longlong' (win*.api files) as + compatible with 'double' (spec files). + + * programs/winecfg/x11drvdlg.c: + Christian Costa + Screen depth cannot be selected when double buffering is enabled. + Disable depth selection when it's the case. + +2005-09-25 Alexandre Julliard + + * dlls/kernel/instr.c, dlls/kernel/local16.c, dlls/kernel/ne_module.c, + dlls/kernel/version.c, dlls/msvcrt/cppexcept.c, dlls/ntdll/virtual.c, + dlls/opengl32/wgl.c, dlls/quartz/dsoundrender.c, + dlls/quartz/transform.c, dlls/quartz/videorenderer.c, + dlls/user/menu.c, dlls/x11drv/opengl.c: + Replace DPRINTF by TRACE in a few places. + + * dlls/mshtml/No.rc, dlls/mshtml/rsrc.rc: + Alexander N. Sørnes + Norwegian translation of mshtml. + + * dlls/avifil32/avifile_No.rc, dlls/avifil32/rsrc.rc, + dlls/hhctrl.ocx/No.rc, dlls/hhctrl.ocx/hhctrl.rc, + dlls/serialui/No.rc, dlls/serialui/serialui_rc.rc, + dlls/setupapi/No.rc, dlls/setupapi/setupapi.rc: + Alexander N. Sørnes + Added Norwegian translations. + + * dlls/ddraw/d3d_private.h, dlls/ddraw/device_main.c, + dlls/ddraw/device_opengl.c: + Christian Costa + Implement Begin/Vertex/End rendering functions. + + * dlls/hhctrl.ocx/help.c: James Hawkins + Correctly resize the child windows. + + * dlls/quartz/filtergraph.c: Christian Costa + Fix function names. + + * dlls/ole32/bindctx.c, dlls/ole32/clipboard.c, dlls/ole32/compobj.c, + dlls/ole32/moniker.c, dlls/ole32/ole16.c, dlls/ole32/ole2.c, + dlls/ole32/ole2_16.c, dlls/ole32/ole2stubs.c: + Robert Shearman + Move all 16-bit functions to an appropriate 16-bit file. + + * programs/winefile/No.rc, programs/winefile/rsrc.rc, + programs/winhelp/No.rc, programs/winhelp/rsrc.rc: + Alexander N. Sørnes + Added Norwegian translations. + + * dlls/user/resources/user32_Fi.rc, dlls/wininet/rsrc.rc, + dlls/wininet/wininet_Fi.rc: + Kimmo Myllyvirta + Update Finnish resources. + + * dlls/msi/msi.c, dlls/msi/package.c: + Mike McCormack + Handle copying of the install package to a temporary file in one place + only. + + * dlls/msi/files.c: Mike McCormack + Fix another memory leak. + + * dlls/msi/action.c: Mike McCormack + Stub implementation of the IsolateComponents action. + +2005-09-23 Alexandre Julliard + + * include/Makefile.in, include/ddk/wdm.h: + Ivan Leo Puoti + Added ddk/wdm.h. + + * dlls/msi/custom.c: Mike McCormack + Fix a memory leak. + + * dlls/x11drv/x11drv_main.c: Huw Davies + Move desktop_vi inside process_attach and remember to free it. + + * dlls/msi/action.c: Mike McCormack + Add a stub implementation of the BindImage action. + + * dlls/wined3d/device.c, dlls/wined3d/surface.c, + dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h: + Oliver Stieber + Optionally repack nonpower 2 textures to the expected span length when + a textures is locked. This is necessary for buggy games like Warhammer + 40k that don't work with the odd span sizes produce by default + nonpower 2 support. + + * dlls/msi/action.c: Mike McCormack + Stub implementation of the PatchFiles action. + + * dlls/ntdll/debugtools.c, include/wine/debug.h, + include/wine/library.h, libs/wine/debug.c, libs/wine/wine.def, + libs/wine/wine.map, tools/winebuild/spec32.c: + Defined a proper structure for debug channels. + Also put all the function pointers inside a structure and added + __wine_dbg_set_functions to change them instead of exporting the + pointers directly. + + * dlls/msi/msi.c: Mike McCormack + Implement MsiGetShortcutTargetA. + + * dlls/msi/action.c: Mike McCormack + Stub implementation of the MoveFiles action. + + * dlls/wined3d/device.c: Oliver Stieber + Enable dxt2 and dxt4 compressed textures to be created via + Device_CreateSurface. + + * dlls/msi/dialog.c: Dmitry Timoshkov + COLOR_3DFACE is a better choice for the dialog background. + + * dlls/setupapi/stringtable.c, dlls/setupapi/tests/stringtable.c: + Eric Kohl + - String id 0 becomes a reserved (invalid) id. + - StringTableStringFromId returns a pointer to an empty string if the + string id is invalid. + + * programs/winefile/En.rc: Steven Edwards + Set text of help menu to Help. + + * dlls/msi/action.c: Mike McCormack + Stub implementation of the RemoveIniValues action. + + * include/dinput.h, include/vfwmsgs.h: Robert Reif + Add some missing error codes. + + * dlls/dxerr8/errors.awk, dlls/dxerr9/errors.awk: + Robert Reif + Fix dxerr awk scripts to output single quotes properly. + + * dlls/ole32/defaulthandler.c: Robert Shearman + Implement some IRunningObject functions that actually start the server + and initialize it. + + * dlls/ole32/ole2.c, dlls/ole32/ole2stubs.c: + Robert Shearman + Implement OleRegEnumVerbs. + + * dlls/ole32/compobj.c: Robert Shearman + Don't fail in CoRegisterClassObject if the class already exists and + the REGCLS_MULTIPLEUSE flag is specified. + + * include/winver.h: Detlef Riekenberg + Definition added for VFT2_DRV_VERSIONED_PRINTER. + + * dlls/wined3d/device.c: Oliver Stieber + Clean up all the objects bound to the device when the device is + destroyed as a result of its ref count reaching zero. + + * dlls/msvcrt/heap.c, dlls/msvcrt/msvcrt.spec, include/msvcrt/malloc.h: + Vijay Kiran Kamuju + Implementation of _get_sbh_threshold and _set_sbh_threshold + functions. + + * dlls/x11drv/xrender.c: Richard Cohen + Fix compile without XRender. + + * dlls/dsound/tests/capture.c: Robert Reif + Fix capture test to not fail when IDirectSoundCapture class is not + registered. + + * dlls/msi/dialog.c: Mike McCormack + Take advantage of the msi_get_deformatted_field function to simplify + some code. + + * dlls/msi/files.c: Mike McCormack + Avoid using static variables in the InstallFiles action. + +2005-09-22 Alexandre Julliard + + * include/basetsd.h, include/windef.h, include/winnt.h: + Define data types to the correct size on 64-bit platforms. + + * dlls/msi/action.c, dlls/msi/cond.y, dlls/msi/custom.c, + dlls/msi/files.c, dlls/msi/helpers.c: + Mike McCormack + Fix various memory leaks. + + * dlls/msi/dialog.c: Mike McCormack + Skip the first character of a font identifier if it's \ or &. + + * programs/winhelp/.cvsignore, programs/winhelp/Makefile.in, + programs/winhelp/hlp2sgml.c: + Get rid of the hlp2sgml hack. + + * tools/wineinstall: + Leave creation of the drive symlinks to wineprefixcreate. + + * dlls/msi/dialog.c: Mike McCormack + Fix an error introduced when converting dialog lists to standard + lists. + + * dlls/msi/action.c: Mike McCormack + Simplify the ProcessComponents action a little. + + * dlls/oleaut32/vartype.c: + Alex Villacís Lasso + Fix a scaling error in VarR4FromDec() and VarR8FromDec() that + incorrectly multiplies the high 32 bits of the DECIMAL by 1e64 instead + of the correct 2^64. + + * dlls/dmcompos/chordmaptrack.c, dlls/dmcompos/signposttrack.c, + dlls/dmime/dmime_main.c, dlls/dmime/lyricstrack.c, + dlls/dmime/markertrack.c, dlls/dmime/paramcontroltrack.c, + dlls/dmime/seqtrack.c, dlls/dmime/sysextrack.c, + dlls/dmime/timesigtrack.c, dlls/dmime/wavetrack.c, + dlls/dmscript/scripttrack.c, dlls/dmstyle/auditiontrack.c, + dlls/dmstyle/motiftrack.c, dlls/dmstyle/mutetrack.c, + dlls/kernel/module.c, dlls/kernel/task.c, dlls/ole32/ole2_16.c, + dlls/oleaut32/dispatch.c, dlls/shell32/shell.c, + dlls/user/nonclient.c, dlls/user/win.c, dlls/wined3d/device.c, + dlls/x11drv/dib.c, dlls/x11drv/wintab.c: + Removed unused debug channels. + + * dlls/oleaut32/variant.c: + Alex Villacís Lasso + Modify VarDiv() and VarSub() to use the existing VarDecSub() and + VarDecDiv() for DECIMAL. + + * documentation/README.no: + Alexander N. Sørnes + Norwegian translation of readme file. + + * dlls/ole32/storage32.c: Robert Shearman + - Initialize out pointer to NULL before access check in + IStorage_CreateStorage. + - WriteClassStg should return E_INVALIDARG if pstg is NULL instead of + asserting. + - ReadClassStg should return E_INVALIDARG if pstg is NULL instead of + crashing and a NULL pclsid should cause it to return the same + value. + + * dlls/msi/table.c: Mike McCormack + Load a table's column information separately from the table itself. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/classes.c, + dlls/msi/helpers.c: + Mike McCormack + Make build_icon_path return the path directly. + +2005-09-21 Alexandre Julliard + + * dlls/avifil32/.cvsignore, dlls/commdlg/.cvsignore, + dlls/ctl3d/.cvsignore, dlls/gdi/.cvsignore, dlls/imm32/.cvsignore, + dlls/kernel/.cvsignore, dlls/lzexpand/.cvsignore, + dlls/msacm/.cvsignore, dlls/msvideo/.cvsignore, + dlls/ntdll/.cvsignore, dlls/ole32/.cvsignore, + dlls/oleaut32/.cvsignore, dlls/olecli/.cvsignore, + dlls/olesvr/.cvsignore, dlls/rasapi32/.cvsignore, + dlls/setupapi/.cvsignore, dlls/shell32/.cvsignore, + dlls/twain/.cvsignore, dlls/user/.cvsignore, dlls/version/.cvsignore, + dlls/win32s/.cvsignore, dlls/winaspi/.cvsignore, + dlls/winedos/.cvsignore, dlls/wineps/.cvsignore, + dlls/winmm/.cvsignore, dlls/winnls/.cvsignore, + dlls/winsock/.cvsignore, dlls/wintab32/.cvsignore: + We are no longer generating .spec.c files. + + * Make.rules.in, Makefile.in, dlls/Makedll.rules.in, + dlls/gdi/Makefile.in, dlls/kernel/Makefile.in, + dlls/ntdll/Makefile.in, dlls/shell32/Makefile.in, + dlls/user/Makefile.in, tools/winebuild/build.h, + tools/winebuild/res16.c, tools/winebuild/spec16.c: + Generate 16-bit spec files as assembly code too. + + * configure, configure.ac, dlls/setupapi/tests/.cvsignore, + dlls/setupapi/tests/Makefile.in, dlls/setupapi/tests/stringtable.c: + Steven Edwards + Added stringtable regression test. + + * include/setupapi.h, dlls/setupapi/Makefile.in, + dlls/setupapi/setupapi.spec, dlls/setupapi/stringtable.c: + Eric Kohl + Implement setupapi stringtable functions. + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/relay.c, tools/winebuild/res32.c, + tools/winebuild/utils.c: + Factor out a couple of useful helper functions. + + * dlls/secur32/Makefile.in, dlls/secur32/base64_codec.c, + dlls/secur32/secur32_priv.h: + Kai Blin + Added base64 codec for communication with ntlm_auth. + + * dlls/comctl32/comctl_No.rc, dlls/comctl32/rsrc.rc, + dlls/shell32/shell32_No.rc: + Alexander N. Sørnes + Added Norwegian translation of comctl32 and shell32. + + * dlls/hhctrl.ocx/help.c: James Hawkins + Add the SizeBar. + + * dlls/kernel/sync.c, dlls/kernel/virtual.c: + Vitaliy Margolen + Specify flag OBJ_CASE_INSENSITIVE when calling appropriate Ntxx + functions creating/opening named objects. + + * tools/winebuild/build.h, tools/winebuild/parser.c: + Make sure that values of absolute symbols fit in 16 bits. + + * tools/winegcc/winegcc.c: + Let winebuild take care of calling the assembler. + Pass -v and -save-temps options through to winebuild too. + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/spec32.c, tools/winebuild/utils.c: + Moved stub function generation to import.c. Added a get_stub_name + function to ensure naming consistency. + + * dlls/msi/action.c, dlls/msi/install.c, dlls/msi/msipriv.h: + Mike McCormack + Implement MsiSequenceA/W. + + * dlls/wined3d/device.c, dlls/wined3d/directx.c, + dlls/wined3d/wined3d_private.h: + Oliver Stieber + Start to implement TestCooperativeLevel. + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/main.c, tools/winebuild/utils.c, + tools/winebuild/winebuild.man.in: + Now that we have to be able to run the assembler from winebuild, added + an option to generate a .spec.o file in a single step. + Added --save-temps and --verbose options for easier debugging. + + * dlls/msi/msipriv.h, dlls/msi/table.c: + Mike McCormack + Don't refcount tables. + + * dlls/msi/action.c, dlls/msi/msiquery.c: + Mike McCormack + Simplify the InstallValidate action a little. + + * dlls/msi/dialog.c: Mike McCormack + Make sure not to free a a pointer that has been modified. + Check that the text identifier doesn't contain invalid characters. + + * dlls/wined3d/device.c, dlls/wined3d/stateblock.c, + dlls/wined3d/wined3d_private.h: + Oliver Stieber + Added support for state management of vertex shader constants via + stateblocks. + + * dlls/ntdll/virtual.c: Ignore relocations for unmapped pages. + + * dlls/ntdll/time.c, dlls/oleaut32/typelib.c, dlls/user/text.c, + programs/winemenubuilder/winemenubuilder.c: + Mike McCormack + Fix "empty body in an if/else-statement" warnings. + + * dlls/comctl32/comboex.c: Jason Edmeades + Fix some off by one calculations in the comboboxex functions, and + handle an out of range positive index the same as windows + unit test + case. + + * dlls/msi/create.c, dlls/msi/dialog.c, dlls/msi/format.c, + dlls/msi/helpers.c: + Mike McCormack + Fix some simple memory leaks. + + * dlls/wined3d/device.c, dlls/wined3d/directx.c, + dlls/wined3d/wined3d_private.h, include/wine/wined3d_gl.h: + Oliver Stieber + Implemented occlusion queries using either GL_ARB_occlusion_query or + GL_NV_occlusion_query. + + * dlls/d3d8/d3d8.spec, dlls/d3d8/shader.c: + Oliver Stieber + Correct the number of parameters (and partly their names) for the + undocumented functions ValidatePixelShader and ValidateVertexShader. + + * dlls/comctl32/tests/.cvsignore, dlls/comctl32/tests/Makefile.in, + dlls/comctl32/tests/comboex.c: + Jason Edmeades + Fix some off by one calculations in the comboboxex functions, and + handle an out of range positive index the same as windows + unit test + case. + + * include/ws2tcpip.h: Vijay Kiran Kamuju + Added addrinfo structures. + + * dlls/gdi/font.c: Huw Davies + Release the dc before drawing the underline and strikeout lines. + +2005-09-20 Alexandre Julliard + + * dlls/msi/dialog.c, dlls/shlwapi/ordinal.c, programs/notepad/main.c: + Dmitry Timoshkov + Fix the usage of COLOR_xxx constants in the place of the window's + class hbrBackground. + + * dlls/hhctrl.ocx/help.c: James Hawkins + Correctly draw the navigation pane. + + * programs/clock/No.rc, programs/clock/rsrc.rc, programs/taskmgr/No.rc, + programs/taskmgr/taskmgr.rc: + Alexander N. Sørnes + Added Norwegian translations. + + * dlls/msi/action.c, dlls/msi/appsearch.c, dlls/msi/classes.c, + dlls/msi/cond.y, dlls/msi/custom.c, dlls/msi/database.c, + dlls/msi/dialog.c, dlls/msi/files.c, dlls/msi/format.c, + dlls/msi/helpers.c, dlls/msi/install.c, dlls/msi/msi.c, + dlls/msi/msiquery.c, dlls/msi/table.c: + Mike McCormack + Added memory allocation inline functions (part 2). + + * dlls/msi/create.c, dlls/msi/delete.c, dlls/msi/distinct.c, + dlls/msi/events.c, dlls/msi/handle.c, dlls/msi/insert.c, + dlls/msi/msipriv.h, dlls/msi/order.c, dlls/msi/package.c, + dlls/msi/preview.c, dlls/msi/record.c, dlls/msi/registry.c, + dlls/msi/select.c, dlls/msi/source.c, dlls/msi/sql.y, + dlls/msi/string.c, dlls/msi/suminfo.c, dlls/msi/update.c, + dlls/msi/upgrade.c, dlls/msi/where.c: + Mike McCormack + Added memory allocation inline functions (part 1). + + * dlls/unicows/Makefile.in, dlls/unicows/main.c: + Exported symbols now get resolved properly so we no longer need the + list of dummy references. + + * dlls/user/dde_misc.c, dlls/user/dde_private.h: + Added a magic number to the WDML_CONV structure to fix some failing + tests. + + * tools/winebuild/relay.c: Fixed stack offset of %eax register. + + * dlls/comctl32/rebar.c, dlls/msi/custom.c: + Mike McCormack + Fix if's that are followed by semicolons. + + * dlls/msi/install.c, dlls/msi/msi.spec, include/msiquery.h: + Jan Van Buggenhout + implement stubs for MsiSequence[AW]. + + * include/msi.h: Mike McCormack + Add INSTALLSTATE_NOTUSED to the INSTALLSTATE enumeration. + + * dlls/ole32/ole2.c, dlls/ole32/ole2stubs.c: + Robert Shearman + Implement OleIsRunning. + + * dlls/ole32/marshal.c: Robert Shearman + - Fix a trace to refer to the object ID rather than the legacy MID. + - Fix the error case of CoMarshalInterThreadInterface to release the + stream. + +2005-09-19 Alexandre Julliard + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/main.c, tools/winebuild/parser.c, + tools/winebuild/spec32.c, tools/winebuild/winebuild.man.in, + tools/winegcc/winegcc.c: + Create an assembly file with all undefined symbols and add it to the + link command so that the symbols show up in the final undefined list. + Use that list to create thunks for all exported but undefined symbols, + to make sure all export RVAs point somewhere inside the module. + + * dlls/comctl32/comctl_Bg.rc, dlls/comctl32/rsrc.rc, + dlls/commdlg/cdlg_Bg.rc, dlls/commdlg/rsrc.rc, dlls/mpr/mpr.rc, + dlls/mpr/mpr_Bg.rc, dlls/mshtml/Bg.rc, dlls/mshtml/rsrc.rc, + dlls/msi/msi.rc, dlls/msi/msi_Bg.rc, dlls/msrle32/msrle_Bg.rc, + dlls/msrle32/rsrc.rc, dlls/oleaut32/oleaut32.rc, + dlls/oleaut32/oleaut32_Bg.rc, dlls/serialui/Bg.rc, + dlls/serialui/serialui_rc.rc, dlls/setupapi/Bg.rc, + dlls/setupapi/setupapi.rc, dlls/shdocvw/Bg.rc, + dlls/shdocvw/shdocvw.rc, dlls/shell32/shell32_Bg.rc, + dlls/shell32/shres.rc, dlls/user/resources/user32.rc, + dlls/user/resources/user32_Bg.rc, dlls/wineps/rsrc.rc, + dlls/wineps/wps_Bg.rc, dlls/wininet/rsrc.rc, + dlls/wininet/wininet_Bg.rc, dlls/winspool/Bg.rc, + dlls/winspool/winspool.rc, programs/notepad/Bg.rc, + programs/notepad/rsrc.rc, programs/regedit/Bg.rc, + programs/regedit/rsrc.rc, programs/uninstaller/Bg.rc, + programs/uninstaller/rsrc.rc, programs/winecfg/Bg.rc, + programs/winecfg/winecfg.rc, programs/winhelp/Bg.rc, + programs/winhelp/rsrc.rc: + Milko Krachounov + Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw, + shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui, + setupapi, wininet, regedit, uninstaller, notepad, winecfg and + winhelp. + + * dlls/x11drv/winpos.c: Dmitry Timoshkov + Use the event's width and height not the translated window rect to + recognize a zero sized window in the ConfigureNotify handler. + + * include/hlink.idl: Aric Stewart + Add the IHlinkFrame interface to hlink.idl. + + * dlls/hhctrl.ocx/help.c: James Hawkins + Add initial toolbar button handling. + + * dlls/wined3d/directx.c: Oliver Stieber + Return the adaptor mode as X8R8G8B8 when BPP is 24 or 32 bits. + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/utils.c: + Don't remove ignored symbols from the undefined list, simply skip them + when resolving imports. + Added get_temp_file_name utility function. + + * include/winsock2.h: + Use the default structure packing like Windows does. + + * include/thread.h: + Fixed the structure layout to be identical to the public one also on + 64-bit platforms. + + * libs/wine/ldt.c: Removed sysi86 prototype that is causing conflicts. + + * dlls/shdocvw/shdocvw.spec, dlls/shlwapi/shlwapi.spec, + tools/winebuild/parser.c: + Take into account -noname functions when checking for duplicate export + names. Fixed a couple of issues found by the stricter check. + + * dlls/ole32/defaulthandler.c: Robert Shearman + - Remove redunant braces. + - Compact multi-line comments that fit into one line. + - Remove comments that state the obvious. + - Remove extra brackets that are redundant because the -> operator + binds tighter than &. + - Change "this" to "This" to make code more like other interface + implementations. + - Remove redundant comparisons with NULL for pointers. + + * dlls/msvcrt/heap.c, dlls/msvcrt/msvcrt.spec, include/msvcrt/malloc.h: + Vijay Kiran Kamuju + Added __p__amblksiz implementation. + + * dlls/x11drv/xrender.c: + Uwe Bonnes + Don't free a modified pointer. + + * dlls/gdi/font.c: Huw Davies + Fix a problem with handling ETO_GLPYH_INDEX. Spotted by Rob + Shearman. + + * dlls/ole32/marshal.c: Robert Shearman + Fix the return codes during unmarshaling so that it returns failure + codes instead of S_FALSE returned from IStream_Read. + + * dlls/hhctrl.ocx/help.c: James Hawkins + Check for an empty string not a NULL pointer. + + * dlls/mciavi32/mmoutput.c: Dmitry Timoshkov + Directly copy DIB bits into destination DC. + + * dlls/wined3d/directx.c: Oliver Stieber + Prevent CheckDepthStencilMatch from causing problems if there is a + current active OpenGL context. + + * dlls/wined3d/device.c, dlls/wined3d/stateblock.c: + Oliver Stieber + Stop vertex shader constants from being set at the same time as the + vertex shader when a stateblock is applied. + + * dlls/mshtml/Fi.rc, dlls/mshtml/rsrc.rc, dlls/msi/msi.rc, + dlls/msi/msi_Fi.rc: + Kimmo Myllyvirta + Added Finnish resources. + + * dlls/oleaut32/typelib.c: Marcus Meissner + Support more arguments in _invoke(). + + * dlls/urlmon/session.c, include/urlmon.idl: + Jacek Caban + - Added IHttpNegotiate2 interface. + - Update BINDSTRING and IInternetSession. + +2005-09-18 Alexandre Julliard + + * dlls/comctl32/header.c: Ge van Geldorp + Do some bounds checking on iOrder. + + * dlls/commdlg/cdlg_No.rc, dlls/msi/msi.rc, dlls/msi/msi_No.rc, + programs/uninstaller/No.rc, programs/uninstaller/rsrc.rc: + Alexander N. Sørnes + Added Norwegian translations. + + * dlls/kernel/kernel16_private.h, dlls/kernel/kernel32.spec, + dlls/kernel/ne_module.c, dlls/kernel/relay16.c, dlls/winedos/relay.c, + include/wine/winbase16.h, tools/winebuild/import.c, + tools/winebuild/relay.c, tools/winebuild/spec16.c: + Moved return value handling to the individual relay thunks so that we + only need one version of wine_call_from_16. + Patch the wine_call_from_16 address along with the cs value directly + in the 16-bit code segment to avoid the need for special magic in the + import thunks. + + * dlls/ntdll/heap.c: + Fixed some trace format strings (reported by Gerald Pfeifer). + + * dlls/ntdll/relay.c, include/wine/port.h, tools/winebuild/import.c, + tools/winebuild/relay.c, tools/winebuild/spec32.c: + Make the users of wine_call_from_32_regs save %eax so that we don't + need a special hack in the import thunk. + Added a get_pc_thunk_eax function to simplify the code a bit. + + * dlls/comctl32/animate.c: Dmitry Timoshkov + Call SetDIBits with a proper DC in order to set bitmap bits. + + * dlls/user/sysparams.c: Kimmo Myllyvirta + If HKCU\Software\Wine does not yet exist, create it as non-volatile + key, instead of volatile. + + * dlls/winedos/int21.c: + Christian Lupien + Avoid overflow in the read file limit check. + + * dlls/ole32/marshal.c, dlls/ole32/oleproxy.c, + dlls/ole32/tests/marshal.c, dlls/oleaut32/tmarshal.c, + dlls/rpcrt4/cproxy.c: + Robert Shearman + Fix ref-counting rules to match native DCOM Dlls. + +2005-09-17 Alexandre Julliard + + * libs/wine/loader.c, tools/winebuild/import.c, + tools/winebuild/res32.c, tools/winebuild/spec32.c: + Store RVAs instead of pointers wherever possible in the generated NT + header and directories. + + * programs/notepad/No.rc, programs/notepad/rsrc.rc: + Alexander N. Sørnes + Added Norwegian translation. + + * dlls/avifil32/avifile.c: Dmitry Timoshkov + Revert previous change, it should not be needed anymore since a + proper fix for mmioDescend regression has been committed. + + * dlls/msi/msipriv.h, dlls/msi/table.c: + Mike McCormack + Fix memory leaks in the table code. + + * dlls/msi/dialog.c: Mike McCormack + Read the MaskEdit template from the correct db field. + + * dlls/ole32/defaulthandler.c: Robert Shearman + Re-arrange some functions and vtables so we don't have declarations + for all of the functions in the file. + + * dlls/comctl32/comctl32undoc.c: Ge van Geldorp + Buffer size needs to be specified in bytes on input. + + * dlls/user/user_main.c: Robert Shearman + GetDesktopWindow can now potentially create a thread, so we shouldn't + call this function from DllMain otherwise it is possible to cause a + deadlock. + +2005-09-16 Alexandre Julliard + + * dlls/ntdll/Makefile.in, dlls/ntdll/signal_x86_64.c: + Preliminary implementation of signal handling for x86-64. + + * dlls/winmm/mmio.c, dlls/winmm/tests/.cvsignore, + dlls/winmm/tests/Makefile.in, dlls/winmm/tests/mmio.c, + include/mmsystem.h: + Dmitry Timoshkov + Add a test for mmioDescend, make it pass under Wine. + + * dlls/msi/dialog.c: Mike McCormack + Convert the list of dialog controls to a standard list. + + * tools/winebuild/import.c: Implemented import thunks for x86-64. + + * dlls/msi/database.c, dlls/msi/msipriv.h, dlls/msi/table.c: + Mike McCormack + Make load_string_table return the string table. + + * dlls/msi/dialog.c: Mike McCormack + Deformat all dialog text strings before using them. + + * server/Makefile.in, server/context_x86_64.c: + Preliminary version of the context support for x86-64. + + * dlls/ntdll/heap.c, dlls/ntdll/virtual.c: + Fixed a few pointer truncation bugs for 64-bit platforms. + + * dlls/ntdll/server.c, server/request.c: + Use the proper size for the cmsg_fd structure on 64-bit plaforms. + + * dlls/msvcrtd/msvcrtd.spec: + Forward all functions to msvcrt instead of having them link directly + to libc. + + * dlls/gdi/freetype.c: Huw Davies + Order the bitmap font list by the ansi codepage bit position. + Fix a few comments. + + * dlls/urlmon/tests/url.c: Jacek Caban + More tests of URLMoniker. + + * fonts/.cvsignore, fonts/Makefile.in: Huw Davies + Generate Greek, Turkish, Hebrew, Arabic, Baltic and Thai versions of + MS Sans Serif. + + * tools/sfnt2fnt.c: Huw Davies + Update sfnt2fnt hack, now that Wine Courier is known as Courier. + + * dlls/msi/dialog.c: Mike McCormack + Load riched20.dll on demand, and unload it after it's used (based on a + patch by Rob Shearman). + + * dlls/msi/action.c: Mike McCormack + Fix a bug in a previous patch spotted by Dieter Komendera. + + * dlls/msi/msi.c, dlls/msi/msi.spec, include/msi.h: + Mike McCormack + Fix the stub for MsiConfigureFeature. + + * dlls/shdocvw/oleobject.c, dlls/shdocvw/shdocvw.h: + Jacek Caban + Added SetClientSite implementation. + + * dlls/wintrust/wintrust.spec, dlls/wintrust/wintrust_main.c: + Stefan Leichter + Added stubs for DllRegisterServer, DllUnregisterServer and + WintrustSetRegPolicyFlags. + + * dlls/advapi32/security.c: Robert Shearman + Fix String SID parsing. + +2005-09-15 Alexandre Julliard + + * programs/winetest/main.c: Ivan Leo Puoti + Get winetest to detect windows server 2003 R2. + + * dlls/urlmon/session.c: Fixed a compiler warning. + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/relay.c, tools/winebuild/spec32.c, + tools/winebuild/utils.c: + Added a common function to declare global symbols, and make them + hidden on platforms that support it. + + * fonts/.cvsignore, fonts/Makefile.in: Huw Davies + Generate Greek, Turkish, Hebrew, Arabic and Baltic versions of + Courier. + + * dlls/urlmon/Makefile.in, dlls/urlmon/session.c, dlls/urlmon/umon.c: + Jacek Caban + Added CoInternetGetSession implementation. + + * libs/wine/loader.c: + Use the NT descriptor address as start of the data section, since the + BaseOfData field isn't present in Win64. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/custom.c, + dlls/msi/dialog.c, dlls/msi/events.c, dlls/msi/files.c, + dlls/msi/format.c, dlls/msi/helpers.c, dlls/msi/install.c, + dlls/msi/upgrade.c: + Mike McCormack + Rename load_dynamic_property and remove its unused 3rd argument. + + * dlls/Makedll.rules.in, tools/winebuild/import.c, + tools/winebuild/res32.c, tools/winebuild/spec32.c, + tools/winegcc/Makefile.in, tools/winegcc/winegcc.c: + Now that everything is done in assembly in the spec file, directly + generate a .s file to bypass gcc inefficiency with large data + structures. + + * fonts/.cvsignore, fonts/Makefile.in: Huw Davies + Generate Greek, Turkish, Hebrew, Arabic, Baltic, Thai, Japanese and + Korean versions of the System font. All the non-latin glyphs are + still blanks. + + * dlls/msi/action.c, dlls/msi/msipriv.h: + Mike McCormack + Use the new msi_reg_set* macros where possible. + + * dlls/x11drv/dib.c: Fixed gcc 4.0 warnings. + + * configure, configure.ac: + Set the proper build flags for Darwin based on the CPU type instead of + assuming PowerPC. + + * tools/winebuild/build.h, tools/winebuild/res32.c, + tools/winebuild/spec32.c: + Output the resource data in assembly too. + + * configure, configure.ac, include/config.h.in: + Vincent Béron + Tweak the test for detecting libxslt as it didn't work correctly on + RH8. + + * programs/taskmgr/De.rc: Henning Gerhardt + Update the German resource file. + + * dlls/msi/classes.c: Mike McCormack + Create a macro to write a value to a subkey. + + * dlls/hhctrl.ocx/help.c: James Hawkins + Embed the browser object in the HTML window. Spotted by Jacek Caban. + + * dlls/crypt32/cert.c, dlls/crypt32/crypt32.spec: + Stefan Leichter + Added stubs for CryptInitOIDFunctionSet and + CryptUnregisterDefaultOIDFunction. + + * dlls/advapi32/registry.c, dlls/advapi32/service.c, + dlls/advapi32/tests/registry.c: + Rein Klazes + - Set the LastError in OpenSCManager in case of errors; + - Accept machine names without a '\\' prefix in OpenSCManager and + RegConnectRegistry. + - Add a regression test for that. + + * dlls/gdi/freetype.c: Huw Davies + Remember to remove a child font from the child font list. + +2005-09-14 Alexandre Julliard + + * tools/winebuild/build.h, tools/winebuild/spec32.c, + tools/winebuild/utils.c: + Output constant strings in a more appropriate section than .text. + + * programs/taskmgr/En.rc, programs/taskmgr/optnmenu.c, + programs/taskmgr/taskmgr.c, programs/taskmgr/taskmgr.h, + programs/taskmgr/trayicon.c: + Thomas Weidenmueller + Hook up "Hide on Minimize" & Add context menu to the tray icon. + + * dlls/gdi/freetype.c: Huw Davies + Only add Tahoma to the System font's link list if we can actually find + it. + + * dlls/hhctrl.ocx/webbrowser.c: James Hawkins + - Zero the WBInfo struct to get rid of invalid pointers. + - Store object pointers in the WBInfo struct as they're created. + + * dlls/comctl32/toolbar.c, include/commctrl.h: + Robert Shearman + - Add support for navigating a toolbar with the arrow keys. + - Fix WrapToolbar in the case of no parent window. + - Use the newly added NMTBINITCUSTOMIZE for sending the + TBN_INITCUSTOMIZE so that it is safe on 64-bit platforms. + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/parser.c, tools/winebuild/spec32.c, + tools/winebuild/utils.c: + Generate stub functions directly in assembly. + + * server/thread.c: + Remove an exiting thread from the process only after thread cleanup to + avoid accessing freed window classes. + + * dlls/msi/classes.c: Mike McCormack + Create a macro function to write registry values. + + * dlls/gdi/freetype.c: Dmitry Timoshkov + Perform automatic bitmap font configuration based on the current + locale. + + * dlls/urlmon/Makefile.in, dlls/urlmon/ftp.c, dlls/urlmon/http.c, + dlls/urlmon/urlmon_main.c, dlls/urlmon/urlmon_main.h: + Jacek Caban + Added http and ftp protocol stub implementation. + + * programs/taskmgr/taskmgr.c: Filip Navara + Don't kill non-existing timers. Use EndDialog to close the dialog. + + * programs/taskmgr/procpage.c: Michael Fritscher + Hook up "End Process" button. + + * dlls/x11drv/x11drv.h: + Avoid a redefinition warning on 64-bit platforms. + + * dlls/setupapi/install.c, tools/wine.inf: + Ge van Geldorp + Base of REG_DWORD entries must be auto-detected. + + * dlls/msi/msipriv.h: Mike McCormack + Remove some unused values in the object header. + + * dlls/gdi/freetype.c: Huw Davies + Cope with OpenFontFile failing. + + * configure.ac: Vincent Béron + Require autoconf 2.53b as AC_PROG_EGREP is only defined since that + version. + + * dlls/ntdll/ntdll_misc.h, dlls/ntdll/signal_i386.c, + dlls/ntdll/signal_powerpc.c, dlls/ntdll/signal_sparc.c, + dlls/ntdll/thread.c, dlls/ntdll/virtual.c: + Support arbitrary sizes for the thread signal stack, and set the + default size from the MINSIGSTKSZ constant. + + * dlls/quartz/memallocator.c: Get rid of another long long constant. + + * dlls/urlmon/file.c, dlls/urlmon/tests/protocol.c: + Jacek Caban + Added MIME type checking to FileProtocol::Start. + + * programs/taskmgr/applpage.c, programs/taskmgr/perfpage.c, + programs/taskmgr/procpage.c: + Thomas Weidenmueller + Use anonymous events for synchronization. + + * dlls/msi/database.c, dlls/msi/msipriv.h, dlls/msi/table.c: + Mike McCormack + Convert the list of tables to a standard list. + + * dlls/crypt32/tests/encode.c: Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/ole32/compobj.c, dlls/ole32/compobj_private.h, dlls/ole32/rpc.c: + Robert Shearman + Add exception handling for stubs. + + * include/wine/rpcfc.h: Robert Shearman + Define RPC_FC_RANGE. + + * dlls/mshtml/protocol.c, dlls/mshtml/tests/protocol.c: + Jacek Caban + Added MIME type checking to ResProtocol::Start. + + * dlls/setupapi/diskspace.c: Filip Navara + Fix a couple of prototypes. + + * programs/taskmgr/about.c, programs/taskmgr/affinity.c, + programs/taskmgr/applpage.c, programs/taskmgr/column.c, + programs/taskmgr/dbgchnl.c, programs/taskmgr/graph.c, + programs/taskmgr/graphctl.c, programs/taskmgr/graphctl.h, + programs/taskmgr/perfpage.c, programs/taskmgr/proclist.c, + programs/taskmgr/procpage.c, programs/taskmgr/taskmgr.c, + programs/taskmgr/taskmgr.h: + Thomas Weidenmueller + Filip Navara + DLGPROCs return INT_PTR. + +2005-09-13 Alexandre Julliard + + * include/winbase.h: Implemented InterlockedCompareExchangePointer and + InterlockedExchangePointer for x86-64. + + * dlls/gdi/gdiobj.c, dlls/kernel/local16.c, dlls/kernel/process.c, + dlls/kernel/tests/mailslot.c, dlls/kernel/tests/thread.c, + dlls/ntdll/rtlbitmap.c, dlls/oleaut32/tests/vartest.c, + dlls/shlwapi/clist.c, dlls/shlwapi/tests/clist.c, + dlls/version/install.c, dlls/version/tests/info.c, + dlls/wininet/http.c, include/urlmon.idl, include/wincrypt.h, + include/winerror.h: + Remove the 'L' suffix on a number of constants to avoid comparison + errors on 64-bit platforms. + + * dlls/user/message.c, dlls/user/tests/msg.c, server/queue.c: + Timeout 0 means infinite wait for SendMessageTimeout. + Remove the message from the receiver queue if it times out before + being received. + + * programs/taskmgr/applpage.c, programs/taskmgr/graph.c, + programs/taskmgr/graphctl.c, programs/taskmgr/graphctl.h, + programs/taskmgr/perfpage.c, programs/taskmgr/proclist.c, + programs/taskmgr/procpage.c, programs/taskmgr/taskmgr.h: + Richard Cohen + Jim Tabor, Thomas Weidenmueller + 64 bit fixes -- Store Window procs as WNDPROC, cast to DWORD_PTR in + SendMessageTimeout. + + * dlls/comctl32/listview.c: Michael Jung + Fixed inconsistency in LISTVIEW_DUMP macro. + + * dlls/urlmon/internet.c: Jacek Caban + Added PARSE_SECURITY_DOMAIN action implementation. + + * dlls/msi/msipriv.h, programs/rpcss/rpcss_main.c, + programs/taskmgr/procpage.c: + Get rid of a couple of non-portable long long constants. + + * dlls/msi/install.c, dlls/msi/tests/package.c: + Mike McCormack + Fix the handling of MsiGetTargetPath args (with test case). + + * dlls/msi/dialog.c: Mike McCormack + Make sure to release the package we grabbed on the error path. + + * dlls/shell32/iconcache.c: Ge van Geldorp + Save a few megabytes of memory by loading the default icon only once + into the image lists. + + * include/wine/library.h, include/wine/pthread.h, + libs/unicode/cptable.c, libs/wine/ldt.c, loader/kthread.c, + loader/pthread.c: + Avoid some warnings on 64-bit platforms. + + * dlls/msi/install.c, dlls/msi/tests/package.c: + Mike McCormack + Fix the handling of MsiDoAction args (with test case). + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/helpers.c: + Mike McCormack + Eliminate fixed length buffers from the MSIFEATURE structure. + + * dlls/oleaut32/olefont.c, dlls/oleaut32/tests/olefont.c: + Walt Ogburn + Get IFontDisp type information from stdole2.tlb, instead of IDispatch + information from stdole32.tlb. + + * dlls/crypt32/tests/encode.c: Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/msi/dialog.c: Mike McCormack + Skip dash characters in the PIDMask for a MaskedEdit control. + + * dlls/hhctrl.ocx/Makefile.in, dlls/hhctrl.ocx/help.c, + dlls/hhctrl.ocx/webbrowser.c, dlls/hhctrl.ocx/webbrowser.h: + James Hawkins + - Add the WebBrowser implementation. + - Load the default Url in the HTML Pane. + + * dlls/winspool/info.c: Detlef Riekenberg + Let EnumPrinterDrivers return the number of drivers. + +2005-09-12 Alexandre Julliard + + * dlls/comctl32/comctl32undoc.c, dlls/comctl32/propsheet.c, + dlls/comctl32/toolbar.c, dlls/comctl32/treeview.c, + dlls/dbghelp/minidump.c, dlls/dinput/effect_linuxinput.c, + dlls/dsound/propset.c, dlls/gdi/freetype.c, + dlls/oleaut32/tests/vartest.c, dlls/oleaut32/tests/vartype.c, + dlls/riched20/reader.c, dlls/riched20/style.c, dlls/secur32/thunks.c, + dlls/setupapi/parser.c, dlls/shlwapi/reg.c, dlls/shlwapi/string.c, + dlls/winmm/message16.c, dlls/winmm/winmm.c, dlls/winsock/socket.c, + dlls/x11drv/xim.c, programs/winemenubuilder/winemenubuilder.c: + Marcus Meissner + The last argument to MultiByteToWideChar is wide character count and + not the buffer size in bytes. Fixed all places where it was wrong. + + * dlls/urlmon/urlmon.inf: Jacek Caban + Register ZoneMap. + + * dlls/kernel/thread.c, dlls/ntdll/thread.c: + Eric Pouech + Implemented kernel32.GetThreadTimes on top of ntdll's equivalent + function. + + * dlls/comctl32/tests/updown.c, dlls/kernel/locale.c, + dlls/kernel/module.c, dlls/kernel/resource16.c, + dlls/kernel/selector.c, dlls/user/dialog.c, dlls/user/menu.c, + dlls/user/message.c, dlls/user/winproc.c, include/win.h, + include/winnt.h: + Fixed a few more pointer to integer typecast issues for 64-bit + platforms. + + * dlls/riched20/editor.c, dlls/riched20/editstr.h, + dlls/riched20/writer.c: + Fixed gcc 4.0 warnings. + + * dlls/shdocvw/shdocvw.h, dlls/shdocvw/webbrowser.c: + Jacek Caban + Added IWebBrowser2 stub implementation. + + * dlls/ole32/tests/marshal.c, dlls/user/message.c, + dlls/user/user_main.c: + SendMessageTimeout takes a DWORD_PTR not a DWORD. + + * tools/winegcc/utils.c: + Properly handle the case where vsnprintf returns -1. + + * dlls/avifil32/acmstream.c: Fixed gcc 4.0 warnings. + + * dlls/user/controls.h, dlls/user/nonclient.c: + Make the non-client message handling functions return an LRESULT. + + * dlls/atl/registrar.c, dlls/kernel/locale.c, dlls/kernel/resource16.c, + dlls/oleaut32/vartype.c, dlls/user/dialog.c, dlls/user/dialog16.c: + Use MAKEINTRESOURCE instead of casts where appropriate. + + * dlls/avifil32/avifile.c: + Alex Villacís Lasso + Initialize structs for mmioDescend and FindChunkAndKeepExtras - fixes + AVI file recognition. + + * tools/widl/header.c, tools/widl/header.h, tools/widl/parser.l, + tools/widl/parser.y, tools/widl/widl.c, tools/widl/widltypes.h: + Robert Shearman + - Output prototypes for user marshal functions at the end of the + header and by use. + - Add support for range and ptr attributes and for the "small" base + type. + + * dlls/mshtml/protocol.c: Jacek Caban + Encode URL in ResProtocol::Start. + + * dlls/urlmon/tests/misc.c, dlls/urlmon/umon.c, + dlls/urlmon/urlmon_main.c: + Jacek Caban + Rewrote FindMimeFromData to pass tests. + + * dlls/ddraw/surface_wndproc.c: + Use Get/SetWindowLongPtr to access pointers in the window extra + bytes. + + * dlls/user/listbox.c: + Avoid truncating the item data to 32 bits in LB_SETITEMDATA. + + * dlls/kernel/process.c: + Parameters to virtual memory functions need to be SIZE_T. + + * dlls/kernel/locale.c: Dmitry Timoshkov + strcpynAtoW takes number of characters, not bytes. + + * dlls/avicap32/avicap32_main.c: Fixed gcc 4.0 warnings. + + * include/wingdi.h: Dmitry Timoshkov + EXTLOGPEN.elpHatch can contain a handle as well. + + * dlls/crypt32/tests/encode.c: Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/msi/action.h, dlls/msi/classes.c, dlls/msi/helpers.c: + Mike McCormack + Eliminate yet more fixed length buffers. + + * dlls/advapi32/registry.c, dlls/avifil32/getframe.c, + dlls/dbghelp/coff.c, dlls/dsound/capture.c, dlls/dsound/dsound.c, + dlls/dsound/dsound_main.c, dlls/dsound/primary.c, + dlls/dsound/propset.c, dlls/kernel/dosmem.c, + dlls/kernel/kernel_private.h, dlls/msacm/format.c, + dlls/msacm/stream.c, dlls/msvcrt/cppexcept.c, dlls/msvcrt/locale.c, + dlls/ntdll/directory.c, dlls/ntdll/exception.c, dlls/ntdll/sec.c, + dlls/ntdll/virtual.c, dlls/opengl32/wgl.c, dlls/setupapi/queue.c, + dlls/user/caret.c, dlls/user/exticon.c, dlls/user/spy.c, + dlls/version/info.c, dlls/x11drv/event.c, dlls/x11drv/keyboard.c, + include/windowsx.h, tools/winebuild/res32.c, tools/winedump/debug.c, + tools/wrc/newstruc.c: + Fixed a number of pointer to integer conversions that wouldn't work + right on a 64-bit platform. + + * dlls/msi/msiquery.c: Fixed memory leak introduced in previous change. + + * dlls/ddraw/ddraw_main.c, dlls/ddraw/surface_main.c, + dlls/dsound/capture.c, dlls/dsound/dsound.c, dlls/kernel/instr.c, + dlls/kernel/local16.c, dlls/kernel/ne_module.c, + dlls/kernel/resource16.c, dlls/kernel/task.c, dlls/kernel/thunk.c, + dlls/msacm/driver.c, dlls/msacm/msadp32/msadp32.c, + dlls/msacm/msg711/msg711.c, dlls/msacm/pcmconverter.c, + dlls/msacm/tests/msacm.c, dlls/quartz/filtergraph.c, + dlls/user/driver16.c, dlls/user/message.c, dlls/user/resource.c, + dlls/version/resource.c, dlls/vmm.vxd/vmm.c, + dlls/winaspi/winaspi32.c, dlls/wined3d/swapchain.c, + dlls/wininet/utility.c, dlls/winmm/driver.c, + dlls/winmm/winealsa/audio.c, dlls/winsock/socket.c, + dlls/wintab32/context.c: + Fixed some more traces to use the right printf format and avoid + typecasts. + + * dlls/user/button.c, dlls/user/combo.c, dlls/user/edit.c, + dlls/user/listbox.c, dlls/user/menu.c: + Use Get/SetWindowLongPtr when accessing pointers in the window extra + bytes. + + * dlls/shell32/cpanelfolder.c, dlls/shell32/shlexec.c, + dlls/shell32/tests/shlexec.c: + Ge van Geldorp + Fix execution of Control Panel items. + + * include/winuser.h: Ivan Leo Puoti + Added a missing define. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/helpers.c: + Mike McCormack + Fix more fixed length buffers. + + * dlls/user/tests/class.c: + Use Get/SetClassLongPtr to access the module handle. + + * dlls/user/listbox.c: The item user data has to be a ULONG_PTR. + + * libs/wine/loader.c: + Only add the default dlldir to the search path if that's where ntdll + is found. + + * dlls/gdi/brush.c, dlls/gdi/enhmetafile.c, + dlls/gdi/enhmfdrv/objects.c, dlls/gdi/tests/metafile.c, + include/wingdi.h: + LOGBRUSH.lbHatch must be a ULONG_PTR since it can contain a handle. + + * dlls/msi/msiquery.c: Avoid non-portable va_list manipulations. + + * dlls/x11drv/xrender.c: Huw Davies + Use the gasp table to check whether we should trigger antialiasing. + + * dlls/urlmon/file.c: Jacek Caban + Encode URL in file protocol. + + * dlls/comctl32/comctl32.h, dlls/comctl32/commctrl.c, + dlls/comctl32/theming.c: + Frank Richter + Unregister theming subclasses at comctl32 shutdown; should fix + reported re-registration errors. + + * dlls/urlmon/tests/protocol.c: Jacek Caban + Fix protocol test. + + * dlls/hhctrl.ocx/Fi.rc, dlls/hhctrl.ocx/hhctrl.rc, + dlls/serialui/Fi.rc, dlls/serialui/serialui_rc.rc, + dlls/shdocvw/Fi.rc, dlls/shdocvw/shdocvw.rc, dlls/winspool/Fi.rc, + dlls/winspool/winspool.rc, programs/winemine/Fi.rc, + programs/winemine/rsrc.rc: + Kimmo Myllyvirta + Added Finnish resources. + + * include/exdisp.idl: Jacek Caban + Added missing attributes. + + * include/exdispid.h: Jacek Caban + Added more definitions. + + * dlls/msi/helpers.c: Mike McCormack + Make sure not to access invalid components or features. + + * dlls/urlmon/Makefile.in: Jacek Caban + Added urlmon.inf as dependency of rsrc.res. + + * include/shlobj.h: + Fixed the binary layout gcc hacks to do the right thing for gcc 4.0. + + * dlls/winedos/int21.c, dlls/winmm/mci.c, dlls/winmm/message16.c, + dlls/winmm/winemm.h: + Fixed gcc 4.0 warnings. + + * dlls/ntdll/env.c, dlls/ntdll/handletable.c, dlls/ntdll/loader.c, + dlls/ntdll/server.c, dlls/ntdll/thread.c: + Use SIZE_T instead of ULONG for the size arguments of the virtual + memory functions. + + * dlls/dinput/device.c, dlls/dinput/dinput_main.c, + dlls/dinput/joystick_linux.c, dlls/dinput/joystick_linuxinput.c, + dlls/dinput/keyboard.c, dlls/dinput/mouse.c, dlls/dsound/buffer.c, + dlls/dsound/duplex.c, dlls/dsound/tests/ds3d.c, + dlls/dsound/tests/ds3d8.c, dlls/dsound/tests/dsound.c, + dlls/dsound/tests/dsound8.c, dlls/gdi/printdrv.c, dlls/imm32/imm.c, + dlls/iphlpapi/iphlpapi_main.c, dlls/kernel/change.c, + dlls/kernel/except.c, dlls/msrle32/msrle32.c, dlls/ntdll/cdrom.c, + dlls/ole32/ole2.c, dlls/user/cursoricon.c, dlls/x11drv/clipboard.c, + dlls/x11drv/xim.c: + Fixed some traces to use the right printf format and avoid typecasts. + + * configure, configure.ac: + Only try to set -mpreferred-stack-boundary on i386. + Add -Wdeclaration-after-statement warning if supported. + + * dlls/msi/dialog.c: Mike McCormack + Fix an uninitialized variable problem. + + * dlls/urlmon/internet.c, dlls/urlmon/tests/misc.c: + Jacek Caban + Added PARSE_SECURITY_URL action implementation. + + * dlls/wintrust/wintrust_main.c: Paul Vriens + Return ERROR_SUCCESS as default and TRUST_E_PROVIDER_UNKNOWN if asked + for WINTRUST_ACTION_GENERIC_VERIFY_V2. + + * dlls/mshtml/protocol.c, dlls/mshtml/tests/protocol.c: + Jacek Caban + Added *ProtocolInfo::ParseUrl implementation. + + * dlls/shdocvw/events.c, dlls/shdocvw/shdocvw.h, + dlls/shdocvw/webbrowser.c: + Jacek Caban + Make IConnectionPointContainer interface heap based. + + * dlls/shell32/tests/shellpath.c: Juan Lang + Remove an annoying dialog when trying to clean up a directory. + + * dlls/user/tests/msg.c, dlls/x11drv/winpos.c: + Dmitry Timoshkov + Add a test for ShowWindow(SW_SHOWMAXIMIZED) called for a not visible + overlapped window, which shows that WM_SHOWWINDOW is not sent in that + case and that it should activate a window and bring it to top. + + * dlls/crypt32/cert.c, dlls/crypt32/tests/cert.c: + Juan Lang + When decoding a signed cert, make sure it's really a cert. + +2005-09-09 Alexandre Julliard + + * dlls/comctl32/tests/subclass.c, dlls/gdi/tests/bitmap.c, + dlls/user/tests/class.c, dlls/user/tests/menu.c, + dlls/user/tests/msg.c, dlls/user/tests/win.c, + programs/taskmgr/graph.c, programs/taskmgr/perfpage.c, + programs/taskmgr/procpage.c, programs/wineconsole/dialog.c, + programs/winedbg/gdbproxy.c, programs/winedbg/info.c, + programs/winefile/winefile.c, programs/winhelp/winhelp.c: + Use Get/SetWindowLongPtr instead of Get/SetWindowLong where + appropriate. + + * dlls/comctl32/comctl32.spec, dlls/dbghelp/dbghelp.spec, + dlls/kernel/kernel32.spec, dlls/mapi32/mapi32.spec, + dlls/msvcrt/msvcrt.spec, dlls/ntdll/ntdll.spec, + dlls/oleaut32/oleaut32.spec, dlls/shell32/shell32.spec, + dlls/shlwapi/shlwapi.spec, dlls/user/user32.spec, + dlls/uxtheme/uxtheme.spec, dlls/wininet/wininet.spec: + Specify 64-bit integers as double instead of long long in spec files + so that we get the correct number of arguments. + + * dlls/oleaut32/tests/vartype.c, dlls/oleaut32/vartype.c: + Alex Villacís Lasso + Make Single|Double->BSTR conversion use the specified locale for the + decimal point even without the LOCALE_USE_NLS flag. Test supplied. + + * dlls/d3d8/vshaderdeclaration.c: Mike McCormack + Fix gcc 4.0 warning. + + * dlls/msi/action.h, dlls/msi/classes.c, dlls/msi/helpers.c: + Mike McCormack + Move a fixed size buffer to the heap. + + * dlls/msi/action.c: Mike McCormack + Reduce the indent level of a function. + + * dlls/ntdll/virtual.c: + Added descriptions for a few more machine types. + + * dlls/user/user_main.c: Francois Gouget + If given the EWX_FORCE flag, ExitWindowsEx() should not send the + WM_{QUERY}ENDSESSION messages. + Add support for EWX_FORCEIFHUNG. + ExitWindowsEx() should return true if it succeeds, even if the user + cancels the shutdown. + + * dlls/advapi32/service.c, dlls/dinput/joystick_linux.c, + dlls/dinput/keyboard.c, dlls/dsound/buffer.c, dlls/dsound/capture.c, + dlls/dsound/dsound.c, dlls/dsound/duplex.c, dlls/gdi/driver.c, + dlls/gdi/gdiobj.c, dlls/kernel/console.c, dlls/kernel/kernel_main.c, + dlls/kernel/lcformat.c, dlls/kernel/module.c, dlls/kernel/profile.c, + dlls/kernel/syslevel.c, dlls/kernel/vxd.c, dlls/mscms/handle.c, + dlls/msi/handle.c, dlls/ntdll/cdrom.c, dlls/ntdll/critsection.c, + dlls/ntdll/directory.c, dlls/ntdll/exception.c, dlls/ntdll/heap.c, + dlls/ntdll/loader.c, dlls/ntdll/rtl.c, dlls/ntdll/time.c, + dlls/ntdll/virtual.c, dlls/ole32/compobj.c, + dlls/ole32/compobj_private.h, dlls/ole32/git.c, dlls/ole32/ifs.c, + dlls/ole32/rpc.c, dlls/oleaut32/typelib.c, dlls/rpcrt4/rpc_server.c, + dlls/rpcrt4/rpcrt4_main.c, dlls/shell32/changenotify.c, + dlls/shell32/iconcache.c, dlls/user/cursoricon.c, + dlls/user/dde_misc.c, dlls/user/message.c, dlls/user/user_main.c, + dlls/user/winproc.c, dlls/winaspi/winaspi32.c, dlls/winedos/dosvm.c, + dlls/winedos/vga.c, dlls/wininet/internet.c, + dlls/winmm/winealsa/midi.c, dlls/winmm/wineoss/audio.c, + dlls/winmm/wineoss/midi.c, dlls/winmm/winmm.c, dlls/winsock/async.c, + dlls/winspool/info.c, dlls/x11drv/dce.c, dlls/x11drv/dib.c, + dlls/x11drv/x11drv_main.c, dlls/x11drv/xdnd.c, dlls/x11drv/xfont.c, + dlls/x11drv/xrender.c, include/winnt.h: + Use a more portable scheme for storing the name of a critical + section. + + * dlls/shdocvw/misc.c, dlls/shdocvw/shdocvw.h, dlls/shdocvw/webbrowser.c: + Jacek Caban + Make IQuickActivate interface heap based. + + * dlls/winmm/playsound.c: Ulrich Czekalla + Display fccType as hex instead of characters in trace output. + + * configure, configure.ac: Added a define check for __x86_64__. + + * tools/winedump/dump.c: + Fixed get_time_str definition to match the prototype. + + * tools/winapi/win32.api: Vincent Béron + Update the win32.api file to current CVS. + + * dlls/dinput/effect_linuxinput.c: + Vincent Béron + Use proper ifdefs around unistd.h. + + * dlls/crypt32/cert.c, dlls/crypt32/tests/cert.c: + Juan Lang + - call CertFreeCertificateContext from CertDeleteCertificateFromStore + - fix some ref counting problems + + * dlls/urlmon/regsvr.c, dlls/urlmon/tests/protocol.c, + dlls/urlmon/urlmon_main.h, include/urlmon.idl: + Jacek Caban + Move protocol's CLSIDs to urlmon.idl. + + * dlls/urlmon/internet.c, dlls/urlmon/tests/misc.c: + Jacek Caban + Added PARSE_PATH_FROM_URL action implementation. + + * dlls/urlmon/rsrc.rc, dlls/urlmon/version.rc: + Stefan Leichter + Added version resource to urlmon.dll. + +2005-09-08 Alexandre Julliard + + * dlls/ntdll/exception.c: Define GET_IP for x86_64. + + * libs/wine/port.c: Implemented wine_switch_to_stack for x86_64. + + * dlls/winmm/driver.c, dlls/winmm/lolvldrv.c: + Avoid 'clobbered by longjmp' warnings. + + * fonts/.cvsignore, fonts/Makefile.in, fonts/courier.sfd, + fonts/marlett.sfd, fonts/ms_sans_serif.sfd, fonts/system.sfd, + fonts/wine_courier.sfd, fonts/wine_marlett.sfd, + fonts/wine_sans_serif.sfd, fonts/wine_system.sfd: + Dmitry Timoshkov + Rename Wine fonts to match Windows font names. + + * dlls/wldap32/control.c, dlls/wldap32/winldap_private.h, + dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_create_sort_control*. + + * dlls/crypt32/cert.c, dlls/crypt32/tests/cert.c: + Juan Lang + - implement system stores + - remove an intermittently failing registry test + + * dlls/shdocvw/classinfo.c, dlls/shdocvw/shdocvw.h, + dlls/shdocvw/webbrowser.c: + Jacek Caban + Make IProvideClassInfo2 interface heap based. + + * dlls/winmm/mmio.c: Ulrich Czekalla + ckid not fccType specifies the form type to search for. + + * dlls/mshtml/protocol.c: Jacek Caban + Release BINDINFO in *Protocol::Start. + + * dlls/gdi/font.c: Huw Davies + Fix return value of ExtTextOut in the case when count == 0. + + * dlls/shell32/shlexec.c: Dmitry Timoshkov + Pass a locally modified version of SHELLEXECUTEINFO to + IShellExecuteHookW_Execute, this should pass through at least + sei_tmp.nShow retrieved from an .lnk file (fStartup). + + * tools/winedump/lnk.c: Dmitry Timoshkov + Dump more .lnk file header fields. + + * dlls/shell32/debughlp.c: Dmitry Timoshkov + - Stop using a not initialized variable szTemp in + _dbg_ILSimpleGetText, make _dbg_ILSimpleGetText return no value since + nobody is using it. + - Stop dereferencing a possible NULL in pdump since + _dbg_ILGetDataPointer can potentially return NULL (for instance for + root or desktop pidl). + - Make shdebugstr_guid use standard wine_dbg_sprintf instead of the + handmade solution. + + * dlls/ntdll/version.c: Fixed a comment. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/helpers.c: + Mike McCormack + Allocate memory rather than using fixed length buffers. + + * dlls/msi/custom.c, dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + Convert RunningActions array into a list. + + * dlls/kernel/ne_module.c: Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/gdi/font.c, dlls/gdi/freetype.c: + Huw Davies + Have ExtTextOut call into the font linking mechanism. + GetCharWidth, GetCharABCWidths and GetTextExtentPoint should return + the widths of a linked font's glyphs. + + * include/sqltypes.h: Phil Krylov + Added typedefs SQLWCHAR and SQLTCHAR. + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/parser.c, tools/winebuild/spec32.c: + Added support for 64-bit format NT header and export/import tables. + + * dlls/crypt32/cert.c, dlls/crypt32/encode.c: + Avoid a couple of 'clobbered by longjmp' warnings. + + * dlls/avifil32/api.c, dlls/cards/cards.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/ntdll/server.c: + Fix a file descriptor leak when opening the first file on a removable + device. + + * dlls/msi/format.c: Mike McCormack + Improve a fixme message a little. + + * dlls/msi/classes.c: Mike McCormack + - fix a bug introduced by the progid list conversion + - make a fixme a little less alarmist + + * dlls/msi/events.c, dlls/msi/helpers.c: + Mike McCormack + Fix memory leaks. + + * dlls/msi/action.c: Mike McCormack + Remove an unnecessary level of indent. + + * dlls/msi/custom.c: Mike McCormack + Fix memory leaks in custom actions. + + * dlls/winmm/winealsa/midi.c: Christian Costa + Improve midi trace. + + * dlls/rpcrt4/ndr_marshall.c, include/rpcndr.h: + Ge van Geldorp + Fix NdrServerContextMarshall prototype. + + * dlls/winmm/mmio.c: Ulrich Czekalla + Remove redundant check. + + * dlls/shdocvw/persist.c, dlls/shdocvw/shdocvw.h, + dlls/shdocvw/webbrowser.c: + Jacek Caban + Make IPersist* interfaces heap based. + + * dlls/urlmon/umon.c, dlls/urlmon/urlmon_main.c: + Jacek Caban + Added ReleaseBindInfo implementation. + + * dlls/mpr/mpr_main.c: Ge van Geldorp + Fix DllCanUnloadNow prototype. + + * dlls/wldap32/Makefile.in, dlls/wldap32/control.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_control_free*, ldap_controls_free* and + ldap_free_controls*. + + * dlls/crypt32/cert.c, dlls/crypt32/tests/cert.c: + Juan Lang + Implement system registry stores. + + * dlls/crypt32/tests/encode.c: Juan Lang + Convert a few more constants from strings to byte arrays. + +2005-09-07 Alexandre Julliard + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/main.c, tools/winebuild/spec32.c, + tools/winebuild/utils.c: + Added a bit of framework for future x86_64 support. + + * dlls/shell32/tests/shlfolder.c: + Michael Jung + Removed two todo_wine's around tests that meanwhile succeed on wine. + + * dlls/shell32/shfldr_unixfs.c: + Michael Jung + Pass correct pointer to SHFree in case of failure in + UNIXFS_path_to_pidl. + Return E_FAIL if we can't get the unix path in + IPersistFolder3::InitializeEx. + Return E_NOAGGREGATION if non-NULL pUnkOuter is given to the + constructor. + + * dlls/dsound/tests/propset.c, programs/winecfg/driveui.c, + programs/winefile/winefile.c: + Replace a few more direct lpVtbl accesses by the proper macros. + + * dlls/gdi/freetype.c, dlls/gdi/gdi32.spec, dlls/gdi/gdi_private.h: + Huw Davies + Implement FontIsLinked. + + * tools/wine.inf: Christoph Frick + Fake directx 9c instead of 9b. + + * dlls/msi/msi.c: Aric Stewart + Implement MsiReinstallFeature. + + * dlls/crypt32/Makefile.in, dlls/crypt32/cert.c, + dlls/crypt32/tests/Makefile.in, dlls/crypt32/tests/cert.c: + Juan Lang + Implement registry stores. + + * dlls/kernel/thread.c, dlls/ntdll/thread.c: + Eric Pouech + Implemented kernel32:SetThreadPriority on top of ntdll's equivalent + functions. + + * dlls/dinput/joystick_linuxinput.c: + Use the COM macros instead of accessing lpVtbl directly. + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/res32.c, tools/winebuild/spec32.c: + Generate the NT header in assembly instead of using a C structure. + + * dlls/commdlg/printdlg.c, dlls/crypt32/tests/encode.c, + dlls/mlang/mlang.c, dlls/mlang/tests/mlang.c, + dlls/quartz/filtergraph.c, dlls/quartz/filtermapper.c, + dlls/winmm/winmm.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/urlmon/Makefile.in, dlls/urlmon/internet.c, + dlls/urlmon/tests/misc.c, dlls/urlmon/urlmon.spec: + Jacek Caban + Added CoInternetParseUrl implementation. + + * dlls/gdi/freetype.c: Huw Davies + get_glyph_index should return the nonexistent glyph for bitmap fonts + when a unicode character cannot be represented as a single byte in the + font's codepage. + + * programs/winecfg/Ja.rc: Vikram Kumar + Update Japanese resource file to include the Theme tab. + + * dlls/wininet/http.c: + Wrong flags were being tested for INTERNET_FLAG_NO_AUTO_REDIRECT. + + * include/oleidl.idl: Mike McCormack + Fix a typo. + + * dlls/dinput/joystick_linuxinput.c: + Mike McCormack + Fix warnings for no force feedback case. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/files.c, + dlls/msi/helpers.c, dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + Keep temporary files in a seperate list. + + * dlls/user/win.c: + Don't fallback to LoadMenu16 when the window is created with a null + instance. + + * dlls/user/edit.c: Only access 16-bit stack if really necessary. + + * dlls/wined3d/directx.c, dlls/wined3d/surface.c, dlls/wined3d/utils.c: + Karsten Elfenbein + Added A2R10G10B10 and D3DFMT_D24FS8 modes to all other functions. + + * dlls/wldap32/misc.c, dlls/wldap32/winldap_private.h, + dlls/wldap32/wldap32.spec, include/winldap.h: + Hans Leidekker + Implement ldap_escape_filter_element*. + + * dlls/hhctrl.ocx/help.c: James Hawkins + Call CHM_CloseCHM to avoid a memory leak. + + * dlls/msi/suminfo.c: Mike McCormack + Don't include the terminating nul in the length in + MsiSummaryInfoGetPropertyW. + + * dlls/msi/tests/package.c: Mike McCormack + - add test for MsiGetSourcePath + - don't specify drive for package path + + * dlls/shdocvw/oleobject.c, dlls/shdocvw/shdocvw.h, + dlls/shdocvw/webbrowser.c: + Jacek Caban + Make IOleControl and IOleInPlaceObject interface heap based. + + * dlls/kernel/path.c: Aric Stewart + Fix the translation of dest to DestW, having it be NULL vs "" has + different meanings for MoveFileEx. + + * dlls/urlmon/sec_mgr.c: Jacek Caban + - Added IInternetSecurityManager::[SG]etSecuritySite implementation. + - Forward IInternetSecurityManager calls to custom manager. + + * dlls/oleaut32/tmarshal.c: Marcus Meissner + VT_PTR->VT_USERDEFINED chains depend on the TKIND of the userdefined + type due to our handling of COM interfaces in there. + + * dlls/shell32/pidl.c, dlls/shell32/tests/shlfolder.c: + Michael Jung + Don't clone pidlLast in SHBindToParent. + + * dlls/ole32/storage32.c, dlls/ole32/tests/storage32.c: + Richard Cohen + Relax the share mode validation for transacted storage, with a test. + + * dlls/gdi/freetype.c, dlls/gdi/gdi_private.h: + Huw Davies + Add infrastructure for font linking. WineEngGetLinkedHFont will be + used by ExtTextOut to provide an HFONT that will contain a valid + glyph. + + * documentation/PACKAGING: Marcus Meissner + Remove ETCDIR mention. + +2005-09-06 Alexandre Julliard + + * dlls/gdi/gdi16.c, dlls/wineps/escape.c, dlls/wineps/psdrv.h, + include/wine/wingdi16.h, include/wingdi.h: + Marcus Meissner + Added DRAWPATTERNRECT Escape() 16<->32 mapper and stub in WINEPS. + + * include/wine/server_protocol.h, server/named_pipe.c, + server/protocol.def, server/trace.c, dlls/kernel/sync.c, + dlls/ntdll/file.c: + Ivan Leo Puoti + Added FSCTL_PIPE_LISTEN support. + + * dlls/shell32/tests/shlfolder.c: + Saulius Krasuckas + SHELL32.ILFindLastID is exported by ordinal. + + * dlls/msi/msi.c: Aric Stewart + Be sure to null terminate the string in MsiGetProductInfoA after the + W->A conversion using MsiGetProductInfoW if there is space. + + * dlls/gdi/freetype.c: Huw Davies + Store the selected ppem in the GdiFont. + + * dlls/kernel/Makefile.in: Marcus Meissner + Remove -DETCDIR (unused). + + * dlls/cfgmgr32/main.c, dlls/setupapi/devinst.c, include/Makefile.in, + include/cfgmgr32.h, include/ddk/cfgmgr32.h: + Detlef Riekenberg + Moved cfgmgr32.h to include/ddk/. + + * dlls/comctl32/comctl32undoc.c: Aric Stewart + Reading the MRUlist using the W functions we need to divide the size + by sizeof(WCHAR) to get the count of characters. + + * dlls/msvcrt/tests/string.c: Vijay Kiran Kamuju + Added a test for failing _ismbblead. + + * dlls/shdocvw/factory.c, dlls/shdocvw/oleobject.c, + dlls/shdocvw/shdocvw.h, dlls/shdocvw/webbrowser.c: + Jacek Caban + - Make WebBrowser heap based object. + - Improve stubs. + + * dlls/kernel/ne_module.c: + Alex Villacís Lasso + Check against NULL libname in LoadModule16. + + * dlls/user/edit.c, dlls/user/tests/edit.c: + Michael Kaufmann + - Fix text placement. + - Paint the border correctly if its size is bigger than 1 pixel. + - Don't paint text over the border. + - Fix the edit control placement tests: Put the edit box in a parent + window. + - Tidied up the edit control tests. + + * dlls/msi/tests/.cvsignore, dlls/msi/tests/Makefile.in, + dlls/msi/tests/package.c: + Mike McCormack + Aric Stewart + Test creating a package. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/helpers.c: + Mike McCormack + Avoid fixed length buffers for conditions. + + * dlls/msi/install.c, dlls/msi/msipriv.h, dlls/msi/suminfo.c: + Mike McCormack + Fixes for MsiGetSourcePath parameter handling. + + * dlls/msi/msi.c, dlls/msi/msi.spec, include/msi.h: + Aric Stewart + Added stub implementations for MsiEnumPatchesA/W. + + * dlls/shlwapi/shlwapi.rc, dlls/shlwapi/version.rc: + Stefan Leichter + Added version resource to shlwapi.dll. + + * dlls/dinput/effect_linuxinput.c, dlls/dinput/joystick_linuxinput.c: + Daniel Remenak + - Allow the creation of an FF effect while the joystick is not + acquired. + - Failing to download an effect after setting parameters is not a + fatal error. + + * dlls/crypt32/encode.c, dlls/crypt32/tests/encode.c, + dlls/rpcrt4/ndr_ole.c, dlls/rpcrt4/rpc_binding.c, + dlls/rpcrt4/tests/rpc.c, dlls/uxtheme/system.c, + programs/winhelp/hlpfile.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/kernel/process.c, dlls/kernel/toolhelp.c, dlls/ntdll/process.c, + include/winternl.h, server/process.c: + Eric Pouech + - rewrite kernel32:{Set|Get}PriorityClass on top of ntdll equivalent + - priority for process in wineserver is now the NTDLL form (no longer + the kernel32 one) + + * dlls/msi/helpers.c: Mike McCormack + Remove an unnecessary level of indent. + + * include/msi.h: Mike McCormack + Add the INSTALLMODE enumeration. + + * dlls/msi/suminfo.c, dlls/msi/tests/suminfo.c: + Mike McCormack + - fix MsiSummaryInfoGetProperty to return ERROR_MORE_DATA if the + buffer is too small (based on a patch by Aric Stewart) + - add a test case to show correct behaviour + + * dlls/commdlg/printdlg16.c: Marcus Meissner + PrintDlg16: Copy back the Flags, nFromPage, nToPage and nCopies struct + members after the print dialog finishes. + + * dlls/dinput/joystick_linuxinput.c: + Daniel Remenak + - Allow enumeration of objects when the device is not yet acquired. + - Flag FF-capable axes during enumeration. + + * dlls/kernel/thunk.c, dlls/msvcrt/misc.c, dlls/ole32/errorinfo.c, + include/dbghelp.h, include/sqlext.h: + Eric Pouech + Fixes for function prototypes without arguments. + + * dlls/urlmon/Makefile.in, dlls/urlmon/file.c, + dlls/urlmon/tests/.cvsignore, dlls/urlmon/tests/Makefile.in, + dlls/urlmon/tests/protocol.c, dlls/urlmon/urlmon_main.c, + dlls/urlmon/urlmon_main.h: + Jacek Caban + Added file protocol implementation. + + * dlls/ntdll/atom.c, include/winternl.h: + James Hawkins + Correct third parameter of NtQueryInformationAtom. + + * fonts/wine_marlett.sfd: Richard Cohen + Redraw "Restore window" without overlapping splines. + + * dlls/msi/action.h, dlls/msi/classes.c, dlls/msi/helpers.c, + dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + Convert progids to a standard list. + + * programs/winecfg/Ru.rc: Yuri Kozlov + Updated Russian resources. + + * dlls/advpack/advpack.c, dlls/advpack/advpack.spec: + Markus Amsler + Add a stub for IsNtAdmin. + + * dlls/kernel/process.c: Ivan Leo Puoti + Get ExitProcess to call NtTerminateProcess. + + * dlls/msi/database.c: Aric Stewart + Add the GUID for Patch files so that they can be opened as well. Looks + like the database structure is pretty much the same. + + * dlls/gdi/freetype.c: Huw Davies + Build a list of font links read in from the registry. + + * tools/winapi/winapi_module_user.pm, tools/winapi/winapi_parser.pm: + Francois Gouget + 'volatile' is valid everywhere where 'const' is valid. This fixes + parsing of the new InterlockedExchange() prototype. + + * dlls/twain/dsm_ctrl.c: Mike McCormack + Don't crash if the twain device name is null. + + * dlls/msi/action.c, dlls/msi/source.c: + Mike McCormack + Make some fixme messages less alarmist. + + * dlls/setupapi/Fi.rc, dlls/setupapi/setupapi.rc, + programs/winecfg/Fi.rc, programs/winecfg/winecfg.rc: + Kimmo Myllyvirta + Added Finnish resources. + + * dlls/kernel/instr.c: Phil Krylov + Fixed compilation of kernel32.dll.so on non-x86 processors. + + * include/urlmon.idl: Jacek Caban + - Update GetSecurityId declaration. + - Add declaration of CoInternetParseUrl and INET_E_DEFAULT_ACTION. + + * dlls/msi/tests/db.c: Saulius Krasuckas + Older platforms choke on a NULL as the third parameter to + MsiViewGetError. + + * dlls/hhctrl.ocx/Makefile.in, dlls/hhctrl.ocx/chm.c, + dlls/hhctrl.ocx/chm.h, dlls/hhctrl.ocx/help.c: + James Hawkins + - Add the CHM Utility API. + - Load help window values from the CHM file. + + * dlls/wintrust/.cvsignore, dlls/wintrust/Makefile.in, + dlls/wintrust/version.rc: + Stefan Leichter + Added version resource to wintrust.dll. + + * dlls/dinput/joystick_linuxinput.c: + Daniel Remenak + Protect FF_STATUS usage to avoid compile errors on machines with old + linux/input.h. + + * dlls/uxtheme/msstyles.c: Gerald Pfeifer + #include to get abs() prototype. + +2005-09-03 Alexandre Julliard + + * configure, configure.ac: + We shouldn't use flat namespace for dlls on Mac OS. Also don't hide + undefined symbol errors. + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/spec32.c: + Output the delayed import table using assembly too. + + * tools/winegcc/winegcc.c: Implemented --image-base support for Mac OS. + + * dlls/kernel/pthread.c, dlls/kernel/thread.c, dlls/ntdll/server.c, + dlls/ntdll/thread.c, include/wine/pthread.h, libs/wine/port.c, + libs/wine/wine.def, libs/wine/wine.map, loader/kthread.c, + loader/main.c, loader/main.h, loader/pthread.c: + Use explicit function pointers for pthread support instead of relying + on ELF symbol overriding. + + * dlls/winecrt0/dll_entry.c: + Make sure to always call the destructors when the constructors have + been called from the dll entry point. + + * programs/winecfg/Nl.rc: Paul Vriens + Update for the 'Install theme' button. + + * dlls/urlmon/format.c, dlls/urlmon/tests/misc.c, + dlls/urlmon/urlmon.spec: + Jacek Caban + Added RegisterFormatEnumerator and RevokeFormatEnumerator + implementation. + + * dlls/crypt32/cert.c, dlls/crypt32/tests/cert.c: + Juan Lang + Correct a test that incorrectly showed signed certs couldn't be added + to a mem store. + Support signed certs in mem stores. + Correct use of a freed pointer. + + * dlls/dinput/joystick_linuxinput.c: + Daniel Remenak + Implement EnumEffects, CreateEffect, EnumCreatedEffects, + SendForceFeedbackCommand, and GetForceFeedbackStatus for linux input + joysticks. + + * configure, configure.ac, dlls/msxml3/Makefile.in, + dlls/msxml3/msxml_private.h, dlls/msxml3/node.c, + dlls/msxml3/nodelist.c, include/config.h.in: + Mike McCormack + Implemented IXMLDOMNode::selectNodes. + + * dlls/winecrt0/drv_entry.c: + There's no way to properly unload a driver, so don't try. + + * dlls/shell32/tests/shellpath.c: Juan Lang + Fix a test failing on Windows. Reported by Katerina Nizhnik. + + * dlls/crypt32/main.c, dlls/crypt32/tests/main.c: + Juan Lang + Improve CryptAlgIdToOID/CryptOIDToAlgId tests, and prevent a crash in + CryptOIDToAlgId. + + * dlls/wined3d/device.c: Oliver Stieber + Implemented point sprites using ARB_POINT_SPRITE extension. + + * dlls/urlmon/tests/Makefile.in, dlls/urlmon/tests/url.c, + dlls/urlmon/umon.c: + Jacek Caban + Added CreateAsyncBindCtxEx implementation. + + * dlls/crypt32/encode.c, dlls/crypt32/tests/encode.c: + Juan Lang + Correct a bunch of lurking asn.1 decode bugs. + +2005-09-02 Alexandre Julliard + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/spec32.c: + Output the import directory using assembly instead of C structures. + + * dlls/winecrt0/Makefile.in, dlls/winecrt0/drv_entry.c, + tools/winebuild/import.c: + Added an entry point routine for native drivers. + + * dlls/atl/registrar.c, dlls/atl/rsrc.rc: + Stefan Leichter + Fixed id of the REGISTRY resource. + + * dlls/dinput/Makefile.in, dlls/dinput/effect_linuxinput.c: + Daniel Remenak + Added a linux input system force feedback effect implementation. + + * dlls/mshtml/nsembed.c: Fixed C99 declaration. + + * dlls/dbghelp/elf_module.c, dlls/dbghelp/msc.c, + dlls/dbghelp/mscvpdb.h, dlls/dbghelp/pe_module.c, dlls/ntdll/cdrom.c, + dlls/ntdll/loader.c, dlls/ntdll/nt.c, dlls/ntdll/tests/rtl.c, + dlls/ntdll/time.c, programs/progman/grpfile.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/winecrt0/Makefile.in, dlls/winecrt0/crt0_private.h, + dlls/winecrt0/dll_entry.c, dlls/winecrt0/exe_entry.c, + dlls/winecrt0/exe_wentry.c, dlls/winecrt0/init.c, + include/wine/library.h, tools/winebuild/spec32.c: + Moved the spec file init function and constructor to winecrt0. + + * dlls/msi/action.h, dlls/msi/classes.c, dlls/msi/helpers.c, + dlls/msi/msipriv.h: + Mike McCormack + - convert verbs into a standard list + - remove limitation of 100 verbs + - use pointers to verbs rather than indexes + + * dlls/crypt32/encode.c, dlls/crypt32/tests/encode.c: + Juan Lang + Implement encoding/decoding RSA public keys. + + * dlls/crypt32/cert.c, dlls/crypt32/tests/cert.c: + Juan Lang + Implement CertAddSerializedElementToStore. + + * dlls/ntdll/server.c: Fixed a file descriptor leak. + + * dlls/uxtheme/Makefile.in, dlls/uxtheme/msstyles.c, + dlls/uxtheme/system.c: + Frank Richter + Remove shlwapi dependency. + + * Makefile.in: Clean Makeimplib.rules too. + + * dlls/dsound/tests/ds3d.c, dlls/dsound/tests/ds3d8.c, + dlls/mapi32/tests/prop.c, dlls/msvcrt/data.c, dlls/msvcrt/file.c, + dlls/msvcrt/msvcrt.h, dlls/qcap/v4l.c, dlls/winmm/wavemap/wavemap.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/crypt32/encode.c, dlls/crypt32/protectdata.c, + include/commctrl.h: + Kevin Koltzau + Fix warnings in 64bit. + + * dlls/mshtml/mshtml_private.h, dlls/mshtml/nsembed.c, + dlls/mshtml/nsiface.idl, dlls/mshtml/persist.c: + Jacek Caban + Beginning implementation of onload routine. + + * include/.cvsignore, include/Makefile.in, include/objsafe.idl: + Troy Rollo + Added objsafe.idl for IObjectSafety interface. + + * include/guiddef.h: Troy Rollo + For C++, declare initialised GUIDs to be "extern const" rather than + just "const" to ensure that the initialised GUID is visible to other + modules, and use EXTERN_C rather than just "extern" for the benefit of + MSVC++, which does name mangling on global variables. + + * dlls/urlmon/Makefile.in, dlls/urlmon/format.c, + dlls/urlmon/urlmon.spec, dlls/urlmon/tests/.cvsignore, + dlls/urlmon/tests/Makefile.in, dlls/urlmon/tests/misc.c, + include/urlmon.idl: + Jacek Caban + Added CreateFormatEnumerator implementation. + + * dlls/commdlg/cdlg32.c, dlls/commdlg/colordlg.c, + dlls/commdlg/filedlg.c, dlls/commdlg/fontdlg.c, + dlls/commdlg/printdlg.c, include/shobjidl.idl, + dlls/shell32/brsfolder.c, dlls/shell32/control.c, dlls/shell32/dde.c, + dlls/shell32/shell32_main.c, dlls/shell32/shell32_main.h, + dlls/shell32/shelllink.c, dlls/shell32/shellord.c, + dlls/shell32/shellpath.c, dlls/shell32/shlexec.c, + dlls/shell32/shlmenu.c, dlls/shell32/shv_bg_cmenu.c, + dlls/shell32/shv_item_cmenu.c, include/shellapi.h: + Kevin Koltzau + Fix warnings in 64bit. + + * dlls/msi/classes.c: Mike McCormack + Add objects to lists at the right time. + + * include/wincrypt.h: Juan Lang + More definitions and prototypes. + + * include/dinput.h: Daniel Remenak + Add definitions for force feedback command and status flags. + + * dlls/quartz/filtergraph.c: Christian Costa + Forward calls of IBasic* and IVideoWindow interfaces of the + filtergraph to the right filter. + + * programs/winecfg/theme.c: Frank Richter + Since uxtheme also returns a friendly display name from + EnumThemeColors() and EnumThemeSizes() use that in the color/size + combos. + + * dlls/rpcrt4/ndr_marshall.c: Robert Shearman + - Implement most of the details around unmarshalling of an object + pointer. + - Fix allocation scheme in NdrConformantArrayUnmarshal to allocate if + *ppMemory is NULL, like complex struct and user type unmarshalling. + + * dlls/ole32/dcom.idl: Robert Shearman + The [string] attribute is only valid on byte, char and wchar_t types, + so replace "unsigned short" by "WCHAR". + + * dlls/oleaut32/usrmarshal.c: Robert Shearman + Add VT_UNKNOWN support for VARIANT marshaling by generalising the + existing VT_DISPATCH code. + + * dlls/ole32/compobj_private.h, dlls/ole32/marshal.c, + dlls/ole32/stubmanager.c: + Mike Hearn + Robert Shearman + Change stub manager to track the number of normal marshals instead of + using the state machine so that multiple marshals of the same object + and interface work correctly. + + * dlls/mshtml/olewnd.c: Jacek Caban + Make OleInPlaceObjectWindowlessVtbl const. + + * dlls/shell32/shfldr_unixfs.c: + Dmitry Timoshkov + Translate file name from unix to ANSI encoding in + UnixFolder_IShellFolder2_GetDisplayNameOf. + + * dlls/wined3d/device.c: Oliver Stieber + Added the tracking of stream frequency and flags. Stream flags and + frequency aren't handled at the moment. + + * dlls/mshtml/oleobj.c, dlls/mshtml/tests/htmldoc.c: + Jacek Caban + Added exec_on_unload implementation. + + * dlls/wldap32/misc.c, dlls/wldap32/winldap_private.h: + Hans Leidekker + Fix the build without openldap headers. + +2005-08-30 Alexandre Julliard + + * ANNOUNCE, ChangeLog, VERSION, configure: Release 20050830. + +---------------------------------------------------------------- 2005-08-30 Alexandre Julliard * dlls/comctl32/animate.c, dlls/comctl32/comboex.c, diff -urN wine-20050830/Make.rules.in wine-20050930/Make.rules.in --- wine-20050830/Make.rules.in 2005-08-11 19:12:19.000000000 +0200 +++ wine-20050930/Make.rules.in 2005-09-28 20:34:01.000000000 +0200 @@ -27,7 +27,6 @@ CPPFLAGS = @CPPFLAGS@ LIBS = @LIBS@ BISON = @BISON@ -YACC = $(BISON) -y LEX = @LEX@ LEXLIB = @LEXLIB@ EXEEXT = @EXEEXT@ @@ -59,6 +58,7 @@ ALLCFLAGS = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS) ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS) IDLFLAGS = $(INCLUDES) $(DEFS) $(EXTRAIDLFLAGS) +WINEBUILDFLAGS = $(DLLFLAGS) --as-cmd "$(AS)" MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi/winapi_check WINEWRAPPER = $(TOPSRCDIR)/tools/winewrapper @@ -107,7 +107,7 @@ api_manext = 3w conf_manext = 5 CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \ - *.flc *.spec.c *.dbg.c *.tab.c *.tab.h @LEX_OUTPUT_ROOT@.c core + *.flc *.tab.c *.tab.h @LEX_OUTPUT_ROOT@.c core OBJS = $(C_SRCS:.c=.o) $(EXTRA_OBJS) @@ -116,7 +116,7 @@ # Implicit rules -.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .idl .tlb .h .ok .sfd .ttf +.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.o .idl .tlb .h .ok .sfd .ttf .c.o: $(CC) -c $(ALLCFLAGS) -o $@ $< @@ -133,8 +133,8 @@ .res.res.o: $(WINDRES) -i $< -o $@ -.spec.spec.c: - $(WINEBUILD) $(DEFS) --dll -o $@ --main-module $(MODULE) --export $< +.spec.spec.o: + $(WINEBUILD) $(WINEBUILDFLAGS) --dll -o $@ --main-module $(MODULE) --export $< .idl.h: $(WIDL) $(IDLFLAGS) -h -H $@ $< @@ -167,11 +167,6 @@ $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res): $(WRC) $(RC_BINARIES) $(RC_TLB) -# Rule for main module debug channels - -$(MODULE).dbg.c: $(C_SRCS) $(C_SRCS16) $(WINEBUILD) - $(WINEBUILD) $(DEFS) -o $@ --debug -C$(SRCDIR) $(C_SRCS) $(C_SRCS16) - # Rules for makefile Makefile: Makefile.in $(TOPSRCDIR)/configure diff -urN wine-20050830/Makefile.in wine-20050930/Makefile.in --- wine-20050830/Makefile.in 2005-08-03 21:15:03.000000000 +0200 +++ wine-20050930/Makefile.in 2005-09-28 20:34:01.000000000 +0200 @@ -136,10 +136,10 @@ # Misc rules TAGS etags: - find $(TOPSRCDIR) -name '*.[ch]' -a -not -name '*.spec.c' -a -not -name '*.dbg.c' -print | etags - + find $(TOPSRCDIR) -name '*.[ch]' -print | etags - tags ctags: - find $(TOPSRCDIR) -name '*.[ch]' -a -not -name '*.spec.c' -a -not -name '*.dbg.c' -print | ctags --c-types=+px -L - + find $(TOPSRCDIR) -name '*.[ch]' -print | ctags --c-types=+px -L - manpages htmlpages sgmlpages: cd documentation && $(MAKE) $@ @@ -148,7 +148,7 @@ $(RM) wine distclean: clean - $(RM) config.* configure.lineno TAGS tags Make.rules dlls/Makedll.rules dlls/Maketest.rules programs/Makeprog.rules libs/Makelib.rules include/config.h + $(RM) config.* configure.lineno TAGS tags Make.rules dlls/Makedll.rules dlls/Makeimplib.rules dlls/Maketest.rules programs/Makeprog.rules libs/Makelib.rules include/config.h $(RM) -r autom4te.cache $(RM) `find . \( -name Makefile -o -size 0 \) -print` diff -urN wine-20050830/VERSION wine-20050930/VERSION --- wine-20050830/VERSION 2005-08-30 12:58:42.000000000 +0200 +++ wine-20050930/VERSION 2005-09-30 14:02:39.000000000 +0200 @@ -1 +1 @@ -Wine version 20050830 +Wine version 20050930 diff -urN wine-20050830/configure wine-20050930/configure --- wine-20050830/configure 2005-08-30 12:58:42.000000000 +0200 +++ wine-20050930/configure 2005-09-30 14:02:39.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for Wine 20050830. +# Generated by GNU Autoconf 2.59 for Wine 20050930. # # Report bugs to . # @@ -269,8 +269,8 @@ # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='20050830' -PACKAGE_STRING='Wine 20050830' +PACKAGE_VERSION='20050930' +PACKAGE_STRING='Wine 20050930' PACKAGE_BUGREPORT='wine-devel@winehq.org' ac_unique_file="server/atom.c" @@ -311,7 +311,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DLLDEFS build build_cpu build_vendor build_os host host_cpu host_vendor host_os WIN16_FILES WIN16_INSTALL SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPPBIN ac_ct_CPPBIN TOOLSDIR CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LEX LEXLIB LEX_OUTPUT_ROOT XLEX BISON AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN EGREP LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS FONTFORGE PKG_CONFIG PRELINK LIBPTHREAD XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS GLUT_LIBS GLUT32FILES NASLIBS XML2LIBS XML2INCL CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS LCMSLIBS LDAPLIBS FREETYPELIBS FREETYPEINCL ft_devel ft_devel2 FONTSSUBDIRS ARTSCCONFIG ARTSLIBS ARTSINCL ESDCONFIG ESDLIBS ESDINCL ALSALIBS AUDIOIOLIBS EXTRACFLAGS BUILTINFLAG DLLEXT DLLFLAGS DLLIBS LDSHARED LDDLLFLAGS LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS LDLIBWINEFLAGS COREFOUNDATIONLIB IOKITLIB CROSSTEST CROSSCC CROSSWINDRES LDPATH CRTLIBS SOCKETLIBS WINE_BINARIES MAIN_BINARY LDD LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DLLDEFS build build_cpu build_vendor build_os host host_cpu host_vendor host_os WIN16_FILES WIN16_INSTALL SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPPBIN ac_ct_CPPBIN TOOLSDIR CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LEX LEXLIB LEX_OUTPUT_ROOT XLEX BISON AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN EGREP LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS FONTFORGE PKG_CONFIG PRELINK LIBPTHREAD XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS GLUT_LIBS GLUT32FILES NASLIBS XML2LIBS XML2INCL XSLTLIBS XSLTINCL CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS LCMSLIBS LDAPLIBS FREETYPELIBS FREETYPEINCL ft_devel ft_devel2 FONTSSUBDIRS ARTSCCONFIG ARTSLIBS ARTSINCL ESDCONFIG ESDLIBS ESDINCL ALSALIBS AUDIOIOLIBS EXTRACFLAGS BUILTINFLAG DLLEXT DLLFLAGS DLLIBS LDSHARED LDDLLFLAGS LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS COREFOUNDATIONLIB IOKITLIB LDLIBWINEFLAGS CROSSTEST CROSSCC CROSSWINDRES LDPATH CRTLIBS SOCKETLIBS WINE_BINARIES MAIN_BINARY LDD LIBOBJS LTLIBOBJS' ac_subst_files='MAKE_RULES MAKE_DLL_RULES MAKE_IMPLIB_RULES MAKE_TEST_RULES MAKE_LIB_RULES MAKE_PROG_RULES' # Initialize some variables set by options. @@ -788,7 +788,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Wine 20050830 to adapt to many kinds of systems. +\`configure' configures Wine 20050930 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -853,7 +853,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 20050830:";; + short | recursive ) echo "Configuration of Wine 20050930:";; esac cat <<\_ACEOF @@ -984,7 +984,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -Wine configure 20050830 +Wine configure 20050930 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -998,7 +998,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Wine $as_me 20050830, which was +It was created by Wine $as_me 20050930, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -8597,6 +8597,10 @@ XML2INCL="" +XSLTLIBS="" + +XSLTINCL="" + if test "$PKG_CONFIG" != "false" then ac_save_CPPFLAGS="$CPPFLAGS" @@ -8826,7 +8830,7 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lxml2 $LIBS" +LIBS="-lxml2 $ac_xml_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8897,6 +8901,146 @@ done CPPFLAGS="$ac_save_CPPFLAGS" + ac_xslt_libs="`$PKG_CONFIG --libs libxslt`" + ac_xslt_cflags="`$PKG_CONFIG --cflags libxslt`" + CPPFLAGS="$CPPFLAGS $ac_xslt_cflags" + + +for ac_header in libxslt/pattern.h libxslt/transform.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_LIBXSLT_PATTERN_H +# include +#endif + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + echo "$as_me:$LINENO: checking for xsltCompilePattern in -lxslt" >&5 +echo $ECHO_N "checking for xsltCompilePattern in -lxslt... $ECHO_C" >&6 +if test "${ac_cv_lib_xslt_xsltCompilePattern+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxslt $ac_xslt_libs $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char xsltCompilePattern (); +int +main () +{ +xsltCompilePattern (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_xslt_xsltCompilePattern=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_xslt_xsltCompilePattern=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_xslt_xsltCompilePattern" >&5 +echo "${ECHO_T}$ac_cv_lib_xslt_xsltCompilePattern" >&6 +if test $ac_cv_lib_xslt_xsltCompilePattern = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBXSLT 1 +_ACEOF + + XSLTLIBS="$ac_xslt_libs" + XSLTINCL="$ac_xslt_cflags" +fi + + +fi + +done + + CPPFLAGS="$ac_save_CPPFLAGS" fi CURSESLIBS="" @@ -11125,7 +11269,9 @@ fi - echo "$as_me:$LINENO: checking for gcc -mpreferred-stack-boundary=2 support" >&5 + case $host_cpu in + *i[3456789]86*) + echo "$as_me:$LINENO: checking for gcc -mpreferred-stack-boundary=2 support" >&5 echo $ECHO_N "checking for gcc -mpreferred-stack-boundary=2 support... $ECHO_C" >&6 if test "${ac_cv_c_gcc_stack_boundary+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11181,10 +11327,12 @@ fi echo "$as_me:$LINENO: result: $ac_cv_c_gcc_stack_boundary" >&5 echo "${ECHO_T}$ac_cv_c_gcc_stack_boundary" >&6 - if test "$ac_cv_c_gcc_stack_boundary" = "yes" - then - EXTRACFLAGS="$EXTRACFLAGS -mpreferred-stack-boundary=2" - fi + if test "$ac_cv_c_gcc_stack_boundary" = "yes" + then + EXTRACFLAGS="$EXTRACFLAGS -mpreferred-stack-boundary=2" + fi + ;; + esac echo "$as_me:$LINENO: checking for gcc -fno-strict-aliasing support" >&5 echo $ECHO_N "checking for gcc -fno-strict-aliasing support... $ECHO_C" >&6 @@ -11308,6 +11456,67 @@ EXTRACFLAGS="$EXTRACFLAGS -gstabs+" fi + echo "$as_me:$LINENO: checking for gcc -Wdeclaration-after-statement support" >&5 +echo $ECHO_N "checking for gcc -Wdeclaration-after-statement support... $ECHO_C" >&6 +if test "${ac_cv_c_gcc_decl_after_statement+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -Wdeclaration-after-statement" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_gcc_decl_after_statement="yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_gcc_decl_after_statement="no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +fi +echo "$as_me:$LINENO: result: $ac_cv_c_gcc_decl_after_statement" >&5 +echo "${ECHO_T}$ac_cv_c_gcc_decl_after_statement" >&6 + if test "$ac_cv_c_gcc_decl_after_statement" = "yes" + then + EXTRACFLAGS="$EXTRACFLAGS -Wdeclaration-after-statement" + fi + saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wpointer-arith -Werror" echo "$as_me:$LINENO: checking for broken string.h that generates warnings" >&5 @@ -12511,19 +12720,28 @@ if test "$ac_cv_c_dll_macho" = "yes" then LIBEXT="dylib" - LDDLLFLAGS="-bundle -flat_namespace -undefined suppress -read_only_relocs warning" + LDDLLFLAGS="-bundle" LDSHARED="\$(CC) -dynamiclib" - CFLAGS="$CFLAGS -ffixed-r13 -no-cpp-precomp" STRIP="$STRIP -u -r" - LDEXECFLAGS="-seg1addr 0x120000" + COREFOUNDATIONLIB="-framework CoreFoundation" + + IOKITLIB="-framework IOKit -framework CoreFoundation" - LDLIBWINEFLAGS="-seg1addr 0x140000" + case $host_cpu in + *i[3456789]86*) + LDEXECFLAGS="-image_base 0x7bf00000" - COREFOUNDATIONLIB="-framework CoreFoundation" + ;; + *powerpc*) + CFLAGS="$CFLAGS -ffixed-r13" + LDDLLFLAGS="$LDDLLFLAGS -read_only_relocs warning" + LDEXECFLAGS="-seg1addr 0x120000" - IOKITLIB="-framework IOKit" + LDLIBWINEFLAGS="-seg1addr 0x140000" + + ;; + esac - IOKITLIB="$IOKITLIB $COREFOUNDATIONLIB" else echo "$as_me:$LINENO: checking whether we can build an HP-UX dll" >&5 echo $ECHO_N "checking whether we can build an HP-UX dll... $ECHO_C" >&6 @@ -18180,6 +18398,37 @@ LINTFLAGS="$LINTFLAGS -D__i386__" fi ;; + *x86_64*) echo "$as_me:$LINENO: checking whether we need to define __x86_64__" >&5 +echo $ECHO_N "checking whether we need to define __x86_64__... $ECHO_C" >&6 +if test "${ac_cv_cpp_def___x86_64__+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __x86_64__ +yes +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + ac_cv_cpp_def___x86_64__=yes +else + ac_cv_cpp_def___x86_64__=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $ac_cv_cpp_def___x86_64__" >&5 +echo "${ECHO_T}$ac_cv_cpp_def___x86_64__" >&6 +if test $ac_cv_cpp_def___x86_64__ = yes; then + CFLAGS="$CFLAGS -D__x86_64__" + LINTFLAGS="$LINTFLAGS -D__x86_64__" +fi + ;; *alpha*) echo "$as_me:$LINENO: checking whether we need to define __ALPHA__" >&5 echo $ECHO_N "checking whether we need to define __ALPHA__... $ECHO_C" >&6 if test "${ac_cv_cpp_def___ALPHA__+set}" = set; then @@ -18344,7 +18593,7 @@ MAKE_PROG_RULES=programs/Makeprog.rules - ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Makeimplib.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/activeds/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/advpack/Makefile dlls/advpack/tests/Makefile dlls/amstream/Makefile dlls/atl/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cards/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/crypt32/tests/Makefile dlls/cryptdll/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3drm/Makefile dlls/d3dx8/Makefile dlls/d3dxof/Makefile dlls/dbghelp/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput/tests/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnet/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/dswave/Makefile dlls/dxdiagn/Makefile dlls/dxerr8/Makefile dlls/dxerr9/Makefile dlls/dxguid/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/glut32/Makefile dlls/hhctrl.ocx/Makefile dlls/iccvid/Makefile dlls/icmp/Makefile dlls/ifsmgr.vxd/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/iphlpapi/tests/Makefile dlls/itss/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/lzexpand/tests/Makefile dlls/mapi32/Makefile dlls/mapi32/tests/Makefile dlls/mciavi32/Makefile dlls/mcicda/Makefile dlls/mciseq/Makefile dlls/midimap/Makefile dlls/mlang/Makefile dlls/mlang/tests/Makefile dlls/mmdevldr.vxd/Makefile dlls/monodebg.vxd/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/tests/Makefile dlls/msacm/winemp3/Makefile dlls/mscms/Makefile dlls/mscms/tests/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/mshtml/tests/Makefile dlls/msi/Makefile dlls/msi/tests/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msrle32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrt40/Makefile dlls/msvcrtd/Makefile dlls/msvcrtd/tests/Makefile dlls/msvidc32/Makefile dlls/msvideo/Makefile dlls/mswsock/Makefile dlls/msxml3/Makefile dlls/msxml3/tests/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/objsel/Makefile dlls/odbc32/Makefile dlls/odbccp32/Makefile dlls/ole32/Makefile dlls/ole32/tests/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/powrprof/Makefile dlls/psapi/Makefile dlls/psapi/tests/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/quartz/tests/Makefile dlls/rasapi32/Makefile dlls/riched20/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/rsabase/Makefile dlls/rsabase/tests/Makefile dlls/rsaenh/Makefile dlls/rsaenh/tests/Makefile dlls/secur32/Makefile dlls/secur32/tests/Makefile dlls/sensapi/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/stdole2.tlb/Makefile dlls/stdole32.tlb/Makefile dlls/sti/Makefile dlls/strmiids/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/usp10/Makefile dlls/uuid/Makefile dlls/uxtheme/Makefile dlls/vdhcp.vxd/Makefile dlls/vdmdbg/Makefile dlls/version/Makefile dlls/version/tests/Makefile dlls/vmm.vxd/Makefile dlls/vnbt.vxd/Makefile dlls/vnetbios.vxd/Makefile dlls/vtdapi.vxd/Makefile dlls/vwin32.vxd/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winecrt0/Makefile dlls/wined3d/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/wineesd/Makefile dlls/winmm/winejack/Makefile dlls/winmm/winenas/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wldap32/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/wtsapi32/Makefile dlls/x11drv/Makefile documentation/Makefile fonts/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/hh/Makefile programs/msiexec/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/taskmgr/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winebrowser/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile" + ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Makeimplib.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/activeds/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/advpack/Makefile dlls/advpack/tests/Makefile dlls/amstream/Makefile dlls/atl/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cards/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/crypt32/tests/Makefile dlls/cryptdll/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3drm/Makefile dlls/d3dx8/Makefile dlls/d3dxof/Makefile dlls/dbghelp/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput/tests/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnet/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/dswave/Makefile dlls/dxdiagn/Makefile dlls/dxerr8/Makefile dlls/dxerr9/Makefile dlls/dxguid/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/glut32/Makefile dlls/hhctrl.ocx/Makefile dlls/iccvid/Makefile dlls/icmp/Makefile dlls/ifsmgr.vxd/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/iphlpapi/tests/Makefile dlls/itss/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/lzexpand/tests/Makefile dlls/mapi32/Makefile dlls/mapi32/tests/Makefile dlls/mciavi32/Makefile dlls/mcicda/Makefile dlls/mciseq/Makefile dlls/midimap/Makefile dlls/mlang/Makefile dlls/mlang/tests/Makefile dlls/mmdevldr.vxd/Makefile dlls/monodebg.vxd/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/tests/Makefile dlls/msacm/winemp3/Makefile dlls/mscms/Makefile dlls/mscms/tests/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/mshtml/tests/Makefile dlls/msi/Makefile dlls/msi/tests/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msrle32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrt40/Makefile dlls/msvcrtd/Makefile dlls/msvcrtd/tests/Makefile dlls/msvidc32/Makefile dlls/msvideo/Makefile dlls/mswsock/Makefile dlls/msxml3/Makefile dlls/msxml3/tests/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/objsel/Makefile dlls/odbc32/Makefile dlls/odbccp32/Makefile dlls/ole32/Makefile dlls/ole32/tests/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/powrprof/Makefile dlls/psapi/Makefile dlls/psapi/tests/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/quartz/tests/Makefile dlls/rasapi32/Makefile dlls/riched20/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/rsabase/Makefile dlls/rsabase/tests/Makefile dlls/rsaenh/Makefile dlls/rsaenh/tests/Makefile dlls/secur32/Makefile dlls/secur32/tests/Makefile dlls/sensapi/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/setupapi/tests/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/stdole2.tlb/Makefile dlls/stdole32.tlb/Makefile dlls/sti/Makefile dlls/strmiids/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/usp10/Makefile dlls/uuid/Makefile dlls/uxtheme/Makefile dlls/vdhcp.vxd/Makefile dlls/vdmdbg/Makefile dlls/version/Makefile dlls/version/tests/Makefile dlls/vmm.vxd/Makefile dlls/vnbt.vxd/Makefile dlls/vnetbios.vxd/Makefile dlls/vtdapi.vxd/Makefile dlls/vwin32.vxd/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winecrt0/Makefile dlls/wined3d/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/wineesd/Makefile dlls/winmm/winejack/Makefile dlls/winmm/winenas/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wldap32/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/wtsapi32/Makefile dlls/x11drv/Makefile documentation/Makefile fonts/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/hh/Makefile programs/msiexec/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/taskmgr/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winebrowser/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile" cat >confcache <<\_ACEOF @@ -18709,7 +18958,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by Wine $as_me 20050830, which was +This file was extended by Wine $as_me 20050930, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18772,7 +19021,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Wine config.status 20050830 +Wine config.status 20050930 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -19033,6 +19282,7 @@ "dlls/sensapi/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/sensapi/Makefile" ;; "dlls/serialui/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/serialui/Makefile" ;; "dlls/setupapi/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/setupapi/Makefile" ;; + "dlls/setupapi/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/setupapi/tests/Makefile" ;; "dlls/shdocvw/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/shdocvw/Makefile" ;; "dlls/shell32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/shell32/Makefile" ;; "dlls/shell32/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/shell32/tests/Makefile" ;; @@ -19309,6 +19559,8 @@ s,@NASLIBS@,$NASLIBS,;t t s,@XML2LIBS@,$XML2LIBS,;t t s,@XML2INCL@,$XML2INCL,;t t +s,@XSLTLIBS@,$XSLTLIBS,;t t +s,@XSLTINCL@,$XSLTINCL,;t t s,@CURSESLIBS@,$CURSESLIBS,;t t s,@sane_devel@,$sane_devel,;t t s,@SANELIBS@,$SANELIBS,;t t @@ -19343,9 +19595,9 @@ s,@DLLWRAP@,$DLLWRAP,;t t s,@ac_ct_DLLWRAP@,$ac_ct_DLLWRAP,;t t s,@LDEXECFLAGS@,$LDEXECFLAGS,;t t -s,@LDLIBWINEFLAGS@,$LDLIBWINEFLAGS,;t t s,@COREFOUNDATIONLIB@,$COREFOUNDATIONLIB,;t t s,@IOKITLIB@,$IOKITLIB,;t t +s,@LDLIBWINEFLAGS@,$LDLIBWINEFLAGS,;t t s,@CROSSTEST@,$CROSSTEST,;t t s,@CROSSCC@,$CROSSCC,;t t s,@CROSSWINDRES@,$CROSSWINDRES,;t t diff -urN wine-20050830/configure.ac wine-20050930/configure.ac --- wine-20050830/configure.ac 2005-08-25 14:14:13.000000000 +0200 +++ wine-20050930/configure.ac 2005-09-21 16:16:05.000000000 +0200 @@ -4,7 +4,7 @@ m4_define(WINE_VERSION,regexp(m4_include(VERSION),[version \([-.0-9A-Za-z]+\)],[\1])) -AC_PREREQ(2.53) +AC_PREREQ(2.53b) AC_INIT([Wine],WINE_VERSION,[wine-devel@winehq.org]) AC_CONFIG_SRCDIR(server/atom.c) AC_CONFIG_HEADERS(include/config.h) @@ -442,6 +442,8 @@ AC_SUBST(XML2LIBS,"") AC_SUBST(XML2INCL,"") +AC_SUBST(XSLTLIBS,"") +AC_SUBST(XSLTINCL,"") if test "$PKG_CONFIG" != "false" then ac_save_CPPFLAGS="$CPPFLAGS" @@ -454,9 +456,22 @@ XML2LIBS="$ac_xml_libs" XML2INCL="$ac_xml_cflags"],,$ac_xml_libs) AC_CHECK_LIB(xml2, xmlReadMemory, - [AC_DEFINE(HAVE_XMLREADMEMORY,1,[Define if libxml2 has the xmlReadMemory function])]) + [AC_DEFINE(HAVE_XMLREADMEMORY,1,[Define if libxml2 has the xmlReadMemory function])],,$ac_xml_libs) ]) CPPFLAGS="$ac_save_CPPFLAGS" + ac_xslt_libs="`$PKG_CONFIG --libs libxslt`" + ac_xslt_cflags="`$PKG_CONFIG --cflags libxslt`" + CPPFLAGS="$CPPFLAGS $ac_xslt_cflags" + AC_CHECK_HEADERS([libxslt/pattern.h libxslt/transform.h], + [AC_CHECK_LIB(xslt, xsltCompilePattern, + [AC_DEFINE(HAVE_LIBXSLT, 1, [Define if you have the libxslt library]) + XSLTLIBS="$ac_xslt_libs" + XSLTINCL="$ac_xslt_cflags"],,$ac_xslt_libs) + ],, +[#ifdef HAVE_LIBXSLT_PATTERN_H +# include +#endif]) + CPPFLAGS="$ac_save_CPPFLAGS" fi dnl **** Check which curses lib to use *** @@ -785,13 +800,17 @@ fi dnl Check for -mpreferred-stack-boundary - AC_CACHE_CHECK([for gcc -mpreferred-stack-boundary=2 support], ac_cv_c_gcc_stack_boundary, - [WINE_TRY_CFLAGS([-mpreferred-stack-boundary=2], - ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")]) - if test "$ac_cv_c_gcc_stack_boundary" = "yes" - then - EXTRACFLAGS="$EXTRACFLAGS -mpreferred-stack-boundary=2" - fi + case $host_cpu in + *i[[3456789]]86*) + AC_CACHE_CHECK([for gcc -mpreferred-stack-boundary=2 support], ac_cv_c_gcc_stack_boundary, + [WINE_TRY_CFLAGS([-mpreferred-stack-boundary=2], + ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")]) + if test "$ac_cv_c_gcc_stack_boundary" = "yes" + then + EXTRACFLAGS="$EXTRACFLAGS -mpreferred-stack-boundary=2" + fi + ;; + esac dnl Check for -fno-strict-aliasing AC_CACHE_CHECK([for gcc -fno-strict-aliasing support], ac_cv_c_gcc_no_strict_aliasing, @@ -810,6 +829,14 @@ EXTRACFLAGS="$EXTRACFLAGS -gstabs+" fi + dnl Check for -Wdeclaration-after-statement option + AC_CACHE_CHECK([for gcc -Wdeclaration-after-statement support], ac_cv_c_gcc_decl_after_statement, + [WINE_TRY_CFLAGS([-Wdeclaration-after-statement],ac_cv_c_gcc_decl_after_statement="yes", ac_cv_c_gcc_decl_after_statement="no")]) + if test "$ac_cv_c_gcc_decl_after_statement" = "yes" + then + EXTRACFLAGS="$EXTRACFLAGS -Wdeclaration-after-statement" + fi + dnl Check for noisy string.h saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wpointer-arith -Werror" @@ -991,19 +1018,25 @@ if test "$ac_cv_c_dll_macho" = "yes" then LIBEXT="dylib" - LDDLLFLAGS="-bundle -flat_namespace -undefined suppress -read_only_relocs warning" + LDDLLFLAGS="-bundle" LDSHARED="\$(CC) -dynamiclib" - CFLAGS="$CFLAGS -ffixed-r13 -no-cpp-precomp" STRIP="$STRIP -u -r" - dnl Relocate wine executable - AC_SUBST(LDEXECFLAGS,"-seg1addr 0x120000") - dnl Relocate libwine.dyld too - AC_SUBST(LDLIBWINEFLAGS,"-seg1addr 0x140000") - dnl declare needed frameworks - AC_SUBST(COREFOUNDATIONLIB,"-framework CoreFoundation") - AC_SUBST(IOKITLIB,"-framework IOKit") - dnl using IOKit imply we use CoreFoundation too - IOKITLIB="$IOKITLIB $COREFOUNDATIONLIB" + dnl declare needed frameworks + AC_SUBST(COREFOUNDATIONLIB,"-framework CoreFoundation") + AC_SUBST(IOKITLIB,"-framework IOKit -framework CoreFoundation") + case $host_cpu in + *i[[3456789]]86*) + AC_SUBST(LDEXECFLAGS,"-image_base 0x7bf00000") + ;; + *powerpc*) + CFLAGS="$CFLAGS -ffixed-r13" + LDDLLFLAGS="$LDDLLFLAGS -read_only_relocs warning" + dnl Relocate wine executable (FIXME: is this really needed?) + AC_SUBST(LDEXECFLAGS,"-seg1addr 0x120000") + AC_SUBST(LDLIBWINEFLAGS,"-seg1addr 0x140000") + ;; + esac + else AC_CACHE_CHECK(whether we can build an HP-UX dll, ac_cv_c_dll_hpux, [WINE_TRY_SHLIB_FLAGS([-shared], ac_cv_c_dll_hpux="yes", ac_cv_c_dll_hpux="no")]) @@ -1421,6 +1454,7 @@ case $host_cpu in *i[[3456789]]86*) WINE_CHECK_DEFINE([__i386__]) ;; + *x86_64*) WINE_CHECK_DEFINE([__x86_64__]) ;; *alpha*) WINE_CHECK_DEFINE([__ALPHA__]) ;; *sparc*) WINE_CHECK_DEFINE([__sparc__]) ;; *powerpc*) WINE_CHECK_DEFINE([__powerpc__]) ;; @@ -1618,6 +1652,7 @@ dlls/sensapi/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile +dlls/setupapi/tests/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile diff -urN wine-20050830/dlls/Makedll.rules.in wine-20050930/dlls/Makedll.rules.in --- wine-20050830/dlls/Makedll.rules.in 2005-08-27 12:33:27.000000000 +0200 +++ wine-20050930/dlls/Makedll.rules.in 2005-09-28 20:34:00.000000000 +0200 @@ -18,7 +18,7 @@ MAINSPEC = $(BASEMODULE).spec SPEC_DEF = lib$(BASEMODULE).def WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16) -ALL_OBJS = @WIN16_FILES@ $(OBJS) $(MODULE).dbg.o $(RC_SRCS:.rc=.res) +ALL_OBJS = @WIN16_FILES@ $(OBJS) $(RC_SRCS:.rc=.res) ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS) ALL_IMPORTS = $(DELAYIMPORTS) $(IMPORTS) IMPLIB_OBJS = $(IMPLIB_SRCS:.c=.o) @@ -36,12 +36,12 @@ # Rules for .dll files -$(MODULE): $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) Makefile.in - $(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(DLL_LDPATH) $(ALL_IMPORTS:%=-l%) $(ALL_LIBS) +$(MODULE): $(RCOBJS) $(OBJS) $(SPEC_DEF) Makefile.in + $(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(DLL_LDPATH) $(ALL_IMPORTS:%=-l%) $(ALL_LIBS) # Rules for import libraries -.PHONY: implib static_implib $(IMPLIB_OBJS:%=__static_implib__%) +.PHONY: implib $(IMPLIB_OBJS:%=__static_implib__%) all implib: $(IMPORTLIB) $(IMPLIB_OBJS:%=__static_implib__%) @@ -60,14 +60,16 @@ $(AR) $@ $(IMPLIB_OBJS) $(RANLIB) $@ +$(SUBDIRS): implib + # Rules for checking that no imports are missing .PHONY: checklink16 $(WIN16_FILES:%=__checklink16__%) $(WIN16_FILES:%=__checklink16__%): checklink16 -checklink16:: $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o dummy - $(CC) -o checklink -Wl,-rpath,$(TOPOBJDIR)/libs $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(ALL_LIBS) -lwinecrt0 -lm && $(RM) checklink $(MAINSPEC).c $(MAINSPEC).o +checklink16:: $(MAINSPEC).o $(OBJS) dummy + $(CC) -o checklink -Wl,-rpath,$(TOPOBJDIR)/libs $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) -L$(DLLDIR) $(ALL_LIBS) -lwinecrt0 -lm && $(RM) checklink $(MAINSPEC).o checklink:: $(WIN16_FILES:%=__checklink16__%) @@ -77,10 +79,10 @@ crosstest:: $(SUBDIRS:%=%/__crosstest__) -# Rule to explicitly generate the .spec.c for debugging +# Rule to explicitly generate the .spec.s for debugging -$(MAINSPEC).c: $(MAINSPEC) $(ALL_OBJS) - $(WINEBUILD) $(DEFS) $(DLLFLAGS) --dll -o $@ --export $(SRCDIR)/$(MAINSPEC) $(SUBSYSTEM:%=--subsystem %) $(ALL_OBJS) $(DLL_LDPATH) $(ALL_IMPORTS:%=-l%) $(DELAYIMPORTS:%=-d%) $(DLLDIR)/libwinecrt0.a +$(MAINSPEC).s $(MAINSPEC).o: $(MAINSPEC) $(ALL_OBJS) + $(WINEBUILD) $(WINEBUILDFLAGS) --dll -o $@ --export $(SRCDIR)/$(MAINSPEC) $(SUBSYSTEM:%=--subsystem %) $(ALL_OBJS) $(DLL_LDPATH) $(ALL_IMPORTS:%=-l%) $(DELAYIMPORTS:%=-d%) $(DLLDIR)/libwinecrt0.a # Rules for auto documentation @@ -137,6 +139,6 @@ clean:: $(RM) $(SPEC_DEF) -$(SPEC_DEF) $(SPEC_SRCS16:.spec=.spec.c): $(WINEBUILD) +$(SPEC_DEF) $(SPEC_SRCS16:.spec=.spec.o): $(WINEBUILD) # End of global dll rules diff -urN wine-20050830/dlls/activeds/.cvsignore wine-20050930/dlls/activeds/.cvsignore --- wine-20050830/dlls/activeds/.cvsignore 2005-06-13 13:47:46.000000000 +0200 +++ wine-20050930/dlls/activeds/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -activeds.dll.dbg.c libactiveds.def diff -urN wine-20050830/dlls/activeds/activeds.spec wine-20050930/dlls/activeds/activeds.spec --- wine-20050830/dlls/activeds/activeds.spec 2005-06-13 13:47:46.000000000 +0200 +++ wine-20050930/dlls/activeds/activeds.spec 2005-09-26 18:43:21.000000000 +0200 @@ -4,7 +4,7 @@ 6 stdcall ADsEnumerateNext(ptr long ptr ptr) 7 stub ADsBuildVarArrayStr 8 stub ADsBuildVarArrayInt -9 stdcall ADsOpenObject(wstr ptr ptr) +9 stdcall ADsOpenObject(wstr wstr wstr long ptr ptr) 12 stub ADsSetLastError 13 stub ADsGetLastError 14 stub AllocADsMem diff -urN wine-20050830/dlls/activeds/activeds_main.c wine-20050930/dlls/activeds/activeds_main.c --- wine-20050830/dlls/activeds/activeds_main.c 2005-06-17 22:56:21.000000000 +0200 +++ wine-20050930/dlls/activeds/activeds_main.c 2005-09-26 18:43:21.000000000 +0200 @@ -33,6 +33,10 @@ #include "winver.h" #include "winnls.h" +#include "objbase.h" +#include "iads.h" +#include "adshlp.h" + #include "wine/unicode.h" #include "wine/debug.h" @@ -41,7 +45,6 @@ /***************************************************** * DllMain */ - BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { TRACE("(%p, %ld, %p)\n",hinstDLL, fdwReason, lpvReserved); @@ -52,8 +55,7 @@ /***************************************************** * ADsGetObject [ACTIVEDS.3] */ - -HRESULT WINAPI ADsGetObject(LPWSTR lpszPathName, REFIID riid, VOID** ppObject) +HRESULT WINAPI ADsGetObject(LPCWSTR lpszPathName, REFIID riid, VOID** ppObject) { FIXME("(%s)->(%s,%p)!stub\n",debugstr_w(lpszPathName), debugstr_guid(riid), ppObject); return E_NOTIMPL; @@ -62,9 +64,7 @@ /***************************************************** * ADsBuildEnumerator [ACTIVEDS.4] */ - -/* HRESULT WINAPI ADsBuildEnumerator(IADsContainer * pADsContainer, IEnumVariant ** ppEnumVariant) */ -HRESULT WINAPI ADsBuildEnumerator(LPVOID * pADsContainer, LPVOID ** ppEnumVariant) +HRESULT WINAPI ADsBuildEnumerator(IADsContainer * pADsContainer, IEnumVARIANT** ppEnumVariant) { FIXME("(%p)->(%p)!stub\n",pADsContainer, ppEnumVariant); return E_NOTIMPL; @@ -73,9 +73,7 @@ /***************************************************** * ADsEnumerateNext [ACTIVEDS.6] */ - -/* HRESULT WINAPI ADsEnumerateNext(IEnumVariant * pEnumVariant, ULONG cElements, VARIANT * pvar, ULONG * pcElementsFetched) */ -HRESULT WINAPI ADsEnumerateNext(LPVOID * pEnumVariant, ULONG cElements, LPVOID * pvar, ULONG * pcElementsFetched) +HRESULT WINAPI ADsEnumerateNext(IEnumVARIANT* pEnumVariant, ULONG cElements, VARIANT* pvar, ULONG * pcElementsFetched) { FIXME("(%p)->(%lu, %p, %p)!stub\n",pEnumVariant, cElements, pvar, pcElementsFetched); return E_NOTIMPL; @@ -84,10 +82,10 @@ /***************************************************** * ADsOpenObject [ACTIVEDS.9] */ - -HRESULT WINAPI ADsOpenObject(LPWSTR lpszPathName, REFIID riid, VOID** ppObject) +HRESULT WINAPI ADsOpenObject(LPCWSTR lpszPathName, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwReserved, REFIID riid, VOID** ppObject) { - FIXME("(%s)->(%s,%p)!stub\n",debugstr_w(lpszPathName), debugstr_guid(riid), ppObject); + FIXME("(%s,%s,%lu,%p,%p)!stub\n", debugstr_w(lpszPathName), + debugstr_w(lpszUserName), dwReserved, debugstr_guid(riid), ppObject); return E_NOTIMPL; } diff -urN wine-20050830/dlls/advapi32/.cvsignore wine-20050930/dlls/advapi32/.cvsignore --- wine-20050830/dlls/advapi32/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050930/dlls/advapi32/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -advapi32.dll.dbg.c libadvapi32.def diff -urN wine-20050830/dlls/advapi32/crypt.c wine-20050930/dlls/advapi32/crypt.c --- wine-20050830/dlls/advapi32/crypt.c 2005-08-15 11:44:34.000000000 +0200 +++ wine-20050930/dlls/advapi32/crypt.c 2005-09-28 13:59:04.000000000 +0200 @@ -43,6 +43,7 @@ #include "winnls.h" #include "winreg.h" #include "wine/debug.h" +#include "wine/unicode.h" #include "winternl.h" #include "ntstatus.h" @@ -50,38 +51,56 @@ HWND crypt_hWindow = 0; -#define CRYPT_ReturnLastError(err) {SetLastError(err); return FALSE;} +#define CRYPT_ReturnLastError(err) do {SetLastError(err); return FALSE;} while(0) #define CRYPT_Alloc(size) ((LPVOID)LocalAlloc(LMEM_ZEROINIT, size)) #define CRYPT_Free(buffer) (LocalFree((HLOCAL)buffer)) -static inline PSTR CRYPT_GetProvKeyName(PCSTR pProvName) +static inline PWSTR CRYPT_GetProvKeyName(PCWSTR pProvName) { - PCSTR KEYSTR = "Software\\Microsoft\\Cryptography\\Defaults\\Provider\\"; - PSTR keyname; + static const WCHAR KEYSTR[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'C','r','y','p','t','o','g','r','a','p','h','y','\\', + 'D','e','f','a','u','l','t','s','\\', + 'P','r','o','v','i','d','e','r','\\',0 + }; + PWSTR keyname; - keyname = CRYPT_Alloc(strlen(KEYSTR) + strlen(pProvName) +1); + keyname = CRYPT_Alloc((strlenW(KEYSTR) + strlenW(pProvName) +1)*sizeof(WCHAR)); if (keyname) { - strcpy(keyname, KEYSTR); - strcpy(keyname + strlen(KEYSTR), pProvName); + strcpyW(keyname, KEYSTR); + strcpyW(keyname + strlenW(KEYSTR), pProvName); } else SetLastError(ERROR_NOT_ENOUGH_MEMORY); return keyname; } -static inline PSTR CRYPT_GetTypeKeyName(DWORD dwType, BOOL user) +static inline PWSTR CRYPT_GetTypeKeyName(DWORD dwType, BOOL user) { - PCSTR MACHINESTR = "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types\\Type XXX"; - PCSTR USERSTR = "Software\\Microsoft\\Cryptography\\Provider Type XXX"; - PSTR keyname; - PSTR ptr; + static const WCHAR MACHINESTR[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'C','r','y','p','t','o','g','r','a','p','h','y','\\', + 'D','e','f','a','u','l','t','s','\\', + 'P','r','o','v','i','d','e','r',' ','T','y','p','e','s','\\', + 'T','y','p','e',' ','X','X','X',0 + }; + static const WCHAR USERSTR[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'C','r','y','p','t','o','g','r','a','p','h','y','\\', + 'P','r','o','v','i','d','e','r',' ','T','y','p','e',' ','X','X','X',0 + }; + PWSTR keyname; + PWSTR ptr; - keyname = CRYPT_Alloc( (user ? strlen(USERSTR) : strlen(MACHINESTR)) +1); + keyname = CRYPT_Alloc( ((user ? strlenW(USERSTR) : strlenW(MACHINESTR)) +1)*sizeof(WCHAR)); if (keyname) { - user ? strcpy(keyname, USERSTR) : strcpy(keyname, MACHINESTR); - ptr = keyname + strlen(keyname); + user ? strcpyW(keyname, USERSTR) : strcpyW(keyname, MACHINESTR); + ptr = keyname + strlenW(keyname); *(--ptr) = (dwType % 10) + '0'; *(--ptr) = ((dwType / 10) % 10) + '0'; *(--ptr) = (dwType / 100) + '0'; @@ -175,7 +194,7 @@ if ( !(provider->pFuncs->p##name = (void*)GetProcAddress(provider->hModule, #name)) ) goto error #define CRYPT_GetProvFuncOpt(name) \ provider->pFuncs->p##name = (void*)GetProcAddress(provider->hModule, #name) -static PCRYPTPROV CRYPT_LoadProvider(PSTR pImage) +static PCRYPTPROV CRYPT_LoadProvider(PWSTR pImage) { PCRYPTPROV provider; DWORD errorcode = ERROR_NOT_ENOUGH_MEMORY; @@ -183,10 +202,10 @@ if ( !(provider = CRYPT_Alloc(sizeof(CRYPTPROV))) ) goto error; if ( !(provider->pFuncs = CRYPT_Alloc(sizeof(PROVFUNCS))) ) goto error; if ( !(provider->pVTable = CRYPT_Alloc(sizeof(VTableProvStruc))) ) goto error; - if ( !(provider->hModule = LoadLibraryA(pImage)) ) + if ( !(provider->hModule = LoadLibraryW(pImage)) ) { errorcode = (GetLastError() == ERROR_FILE_NOT_FOUND) ? NTE_PROV_DLL_NOT_FOUND : NTE_PROVIDER_DLL_FAIL; - FIXME("Failed to load dll %s\n", debugstr_a(pImage)); + FIXME("Failed to load dll %s\n", debugstr_w(pImage)); goto error; } provider->dwMagic = MAGIC_CRYPTPROV; @@ -249,7 +268,7 @@ /****************************************************************************** - * CryptAcquireContextA (ADVAPI32.@) + * CryptAcquireContextW (ADVAPI32.@) * Acquire a crypto provider context handle. * * PARAMS @@ -261,17 +280,21 @@ * * RETURNS TRUE on success, FALSE on failure. */ -BOOL WINAPI CryptAcquireContextA (HCRYPTPROV *phProv, LPCSTR pszContainer, - LPCSTR pszProvider, DWORD dwProvType, DWORD dwFlags) +BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *phProv, LPCWSTR pszContainer, + LPCWSTR pszProvider, DWORD dwProvType, DWORD dwFlags) { PCRYPTPROV pProv = NULL; HKEY key; - PSTR imagepath = NULL, keyname = NULL, provname = NULL, temp = NULL; + PWSTR imagepath = NULL, keyname = NULL, provname = NULL, temp = NULL; + PSTR provnameA = NULL, pszContainerA = NULL; DWORD keytype, type, len; ULONG r; + static const WCHAR nameW[] = {'N','a','m','e',0}; + static const WCHAR typeW[] = {'T','y','p','e',0}; + static const WCHAR imagepathW[] = {'I','m','a','g','e',' ','P','a','t','h',0}; - TRACE("(%p, %s, %s, %ld, %08lx)\n", phProv, pszContainer, - pszProvider, dwProvType, dwFlags); + TRACE("(%p, %s, %s, %ld, %08lx)\n", phProv, debugstr_w(pszContainer), + debugstr_w(pszProvider), dwProvType, dwFlags); if (dwProvType < 1 || dwProvType > MAXPROVTYPES) { @@ -295,7 +318,7 @@ SetLastError(NTE_PROV_TYPE_NOT_DEF); return FALSE; } - if (RegOpenKeyA(HKEY_CURRENT_USER, keyname, &key)) + if (RegOpenKeyW(HKEY_CURRENT_USER, keyname, &key)) { CRYPT_Free(keyname); if ( !(keyname = CRYPT_GetTypeKeyName(dwProvType, FALSE)) ) { @@ -304,8 +327,8 @@ SetLastError(NTE_PROV_TYPE_NOT_DEF); goto error; } - if (RegOpenKeyA(HKEY_LOCAL_MACHINE, keyname, &key)) { - TRACE("Did not find registry entry of crypto provider for %s.\n", debugstr_a(keyname)); + if (RegOpenKeyW(HKEY_LOCAL_MACHINE, keyname, &key)) { + TRACE("Did not find registry entry of crypto provider for %s.\n", debugstr_w(keyname)); CRYPT_Free(keyname); RegCloseKey(key); SetLastError(NTE_PROV_TYPE_NOT_DEF); @@ -313,7 +336,7 @@ } } CRYPT_Free(keyname); - r = RegQueryValueExA(key, "Name", NULL, &keytype, NULL, &len); + r = RegQueryValueExW(key, nameW, NULL, &keytype, NULL, &len); if( r != ERROR_SUCCESS || !len || keytype != REG_SZ) { TRACE("error %ld reading size of 'Name' from registry\n", r ); @@ -327,7 +350,7 @@ SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto error; } - r = RegQueryValueExA(key, "Name", NULL, NULL, (LPBYTE)provname, &len); + r = RegQueryValueExW(key, nameW, NULL, NULL, (LPBYTE)provname, &len); if( r != ERROR_SUCCESS ) { TRACE("error %ld reading 'Name' from registry\n", r ); @@ -337,16 +360,16 @@ } RegCloseKey(key); } else { - if ( !(provname = CRYPT_Alloc(strlen(pszProvider) +1)) ) + if ( !(provname = CRYPT_Alloc((strlenW(pszProvider) +1)*sizeof(WCHAR))) ) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto error; } - strcpy(provname, pszProvider); + strcpyW(provname, pszProvider); } keyname = CRYPT_GetProvKeyName(provname); - r = RegOpenKeyA(HKEY_LOCAL_MACHINE, keyname, &key); + r = RegOpenKeyW(HKEY_LOCAL_MACHINE, keyname, &key); CRYPT_Free(keyname); if (r != ERROR_SUCCESS) { @@ -354,7 +377,7 @@ goto error; } len = sizeof(DWORD); - r = RegQueryValueExA(key, "Type", NULL, NULL, (BYTE*)&type, &len); + r = RegQueryValueExW(key, typeW, NULL, NULL, (BYTE*)&type, &len); if (r != ERROR_SUCCESS) { SetLastError(NTE_PROV_TYPE_ENTRY_BAD); @@ -367,7 +390,7 @@ goto error; } - r = RegQueryValueExA(key, "Image Path", NULL, &keytype, NULL, &len); + r = RegQueryValueExW(key, imagepathW, NULL, &keytype, NULL, &len); if ( r != ERROR_SUCCESS || keytype != REG_SZ) { TRACE("error %ld reading size of 'Image Path' from registry\n", r ); @@ -381,7 +404,7 @@ SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto error; } - r = RegQueryValueExA(key, "Image Path", NULL, NULL, (LPBYTE)temp, &len); + r = RegQueryValueExW(key, imagepathW, NULL, NULL, (LPBYTE)temp, &len); if( r != ERROR_SUCCESS ) { TRACE("error %ld reading 'Image Path' from registry\n", r ); @@ -390,13 +413,13 @@ goto error; } RegCloseKey(key); - len = ExpandEnvironmentStringsA(temp, NULL, 0); - if ( !(imagepath = CRYPT_Alloc(len)) ) + len = ExpandEnvironmentStringsW(temp, NULL, 0); + if ( !(imagepath = CRYPT_Alloc(len*sizeof(WCHAR))) ) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto error; } - if (!ExpandEnvironmentStringsA(temp, imagepath, len)) + if (!ExpandEnvironmentStringsW(temp, imagepath, len)) { /* ExpandEnvironmentStrings will call SetLastError */ goto error; @@ -407,8 +430,18 @@ goto error; } pProv->pVTable->dwProvType = dwProvType; - pProv->pVTable->pszProvName = provname; - if (pProv->pFuncs->pCPAcquireContext(&pProv->hPrivate, (CHAR*)pszContainer, dwFlags, pProv->pVTable)) + if(!CRYPT_UnicodeToANSI(provname, &provnameA, -1)) + { + /* CRYPT_UnicodeToANSI calls SetLastError */ + goto error; + } + pProv->pVTable->pszProvName = provnameA; + if(!CRYPT_UnicodeToANSI(pszContainer, &pszContainerA, -1)) + { + /* CRYPT_UnicodeToANSI calls SetLastError */ + goto error; + } + if (pProv->pFuncs->pCPAcquireContext(&pProv->hPrivate, pszContainerA, dwFlags, pProv->pVTable)) { /* MSDN: When this flag is set, the value returned in phProv is undefined, * and thus, the CryptReleaseContext function need not be called afterwards. @@ -418,12 +451,15 @@ { pProv->dwMagic = 0; FreeLibrary(pProv->hModule); - CRYPT_Free(provname); + CRYPT_Free(provnameA); + CRYPT_Free(pProv->pVTable); CRYPT_Free(pProv->pFuncs); CRYPT_Free(pProv); } else { *phProv = (HCRYPTPROV)pProv; } + CRYPT_Free(pszContainerA); + CRYPT_Free(provname); CRYPT_Free(temp); CRYPT_Free(imagepath); return TRUE; @@ -441,6 +477,10 @@ CRYPT_Free(pProv->pFuncs); CRYPT_Free(pProv); } + if (pszContainerA) + CRYPT_Free(pszContainerA); + if (provnameA) + CRYPT_Free(provnameA); if (provname) CRYPT_Free(provname); if (temp) @@ -451,28 +491,28 @@ } /****************************************************************************** - * CryptAcquireContextW (ADVAPI32.@) + * CryptAcquireContextA (ADVAPI32.@) * - * see CryptAcquireContextA + * see CryptAcquireContextW */ -BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *phProv, LPCWSTR pszContainer, - LPCWSTR pszProvider, DWORD dwProvType, DWORD dwFlags) +BOOL WINAPI CryptAcquireContextA (HCRYPTPROV *phProv, LPCSTR pszContainer, + LPCSTR pszProvider, DWORD dwProvType, DWORD dwFlags) { - PSTR pProvider = NULL, pContainer = NULL; + PWSTR pProvider = NULL, pContainer = NULL; BOOL ret = FALSE; - TRACE("(%p, %s, %s, %ld, %08lx)\n", phProv, debugstr_w(pszContainer), - debugstr_w(pszProvider), dwProvType, dwFlags); + TRACE("(%p, %s, %s, %ld, %08lx)\n", phProv, pszContainer, + pszProvider, dwProvType, dwFlags); - if ( !CRYPT_UnicodeToANSI(pszContainer, &pContainer, -1) ) + if ( !CRYPT_ANSIToUnicode(pszContainer, &pContainer, -1) ) CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); - if ( !CRYPT_UnicodeToANSI(pszProvider, &pProvider, -1) ) + if ( !CRYPT_ANSIToUnicode(pszProvider, &pProvider, -1) ) { CRYPT_Free(pContainer); CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); } - ret = CryptAcquireContextA(phProv, pContainer, pProvider, dwProvType, dwFlags); + ret = CryptAcquireContextW(phProv, pContainer, pProvider, dwProvType, dwFlags); if (pContainer) CRYPT_Free(pContainer); @@ -955,7 +995,6 @@ DWORD dwFlags, DWORD *pdwProvType, LPWSTR pszProvName, DWORD *pcbProvName) { HKEY hKey; - static const WCHAR providerW[] = { 'S','o','f','t','w','a','r','e','\\', 'M','i','c','r','o','s','o','f','t','\\', @@ -963,7 +1002,6 @@ 'D','e','f','a','u','l','t','s','\\', 'P','r','o','v','i','d','e','r',0 }; - static const WCHAR typeW[] = {'T','y','p','e',0}; TRACE("(%ld, %p, %ld, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, @@ -987,11 +1025,10 @@ CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); RegEnumKeyExW(hKey, dwIndex, provNameW, pcbProvName, NULL, NULL, NULL, NULL); + CRYPT_Free(provNameW); (*pcbProvName)++; *pcbProvName *= sizeof(WCHAR); - - CRYPT_Free(provNameW); - + if (dwIndex >= numkeys) CRYPT_ReturnLastError(ERROR_NO_MORE_ITEMS); } else { @@ -1027,21 +1064,24 @@ TRACE("(%ld, %p, %08lx, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, pdwProvType, pszProvName, pcbProvName); - strlen = *pcbProvName * sizeof(WCHAR); + CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, NULL, &strlen); if ( pszProvName && !(str = CRYPT_Alloc(strlen)) ) CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); ret = CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &strlen); if (str) - { CRYPT_UnicodeToANSI(str, &pszProvName, *pcbProvName); + *pcbProvName = strlen / sizeof(WCHAR); /* FIXME: not correct */ + if (str) + { CRYPT_Free(str); + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + CRYPT_ReturnLastError(ERROR_MORE_DATA); } - *pcbProvName = strlen / sizeof(WCHAR); /* FIXME: not correct */ return ret; } /****************************************************************************** - * CryptEnumProviderTypesA (ADVAPI32i.@) + * CryptEnumProviderTypesW (ADVAPI32i.@) * * Retrieves the next type of CSP supported. * @@ -1059,16 +1099,24 @@ * Failure: FALSE * * NOTES - * If pszTypeName is NULL, CryptEnumProviderTypesA sets the size of the name + * If pszTypeName is NULL, CryptEnumProviderTypesW sets the size of the name * for memory allocation purposes. */ -BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved, - DWORD dwFlags, DWORD *pdwProvType, LPSTR pszTypeName, DWORD *pcbTypeName) +BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved, + DWORD dwFlags, DWORD *pdwProvType, LPWSTR pszTypeName, DWORD *pcbTypeName) { HKEY hKey, hSubkey; DWORD keylen, numkeys, dwType; - PSTR keyname, ch; + PWSTR keyname, ch; DWORD result; + static const WCHAR KEYSTR[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'C','r','y','p','t','o','g','r','a','p','h','y','\\', + 'D','e','f','a','u','l','t','s','\\', + 'P','r','o','v','i','d','e','r',' ','T','y','p','e','s',0 + }; + static const WCHAR typenameW[] = {'T','y','p','e','N','a','m','e',0}; TRACE("(%ld, %p, %08lx, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, pdwProvType, pszTypeName, pcbTypeName); @@ -1077,28 +1125,28 @@ CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); if (dwFlags) CRYPT_ReturnLastError(NTE_BAD_FLAGS); - if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types", &hKey)) + if (RegOpenKeyW(HKEY_LOCAL_MACHINE, KEYSTR, &hKey)) return FALSE; - RegQueryInfoKeyA(hKey, NULL, NULL, NULL, &numkeys, &keylen, NULL, NULL, NULL, NULL, NULL, NULL); + RegQueryInfoKeyW(hKey, NULL, NULL, NULL, &numkeys, &keylen, NULL, NULL, NULL, NULL, NULL, NULL); if (dwIndex >= numkeys) CRYPT_ReturnLastError(ERROR_NO_MORE_ITEMS); keylen++; - if ( !(keyname = CRYPT_Alloc(keylen)) ) + if ( !(keyname = CRYPT_Alloc(keylen*sizeof(WCHAR))) ) CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); - if ( RegEnumKeyA(hKey, dwIndex, keyname, keylen) ) { + if ( RegEnumKeyW(hKey, dwIndex, keyname, keylen) ) { CRYPT_Free(keyname); return FALSE; } - RegOpenKeyA(hKey, keyname, &hSubkey); - ch = keyname + strlen(keyname); + RegOpenKeyW(hKey, keyname, &hSubkey); + ch = keyname + strlenW(keyname); /* Convert "Type 000" to 0, etc/ */ *pdwProvType = *(--ch) - '0'; *pdwProvType += (*(--ch) - '0') * 10; *pdwProvType += (*(--ch) - '0') * 100; CRYPT_Free(keyname); - result = RegQueryValueExA(hSubkey, "TypeName", NULL, &dwType, (LPBYTE)pszTypeName, pcbTypeName); + result = RegQueryValueExW(hSubkey, typenameW, NULL, &dwType, (LPBYTE)pszTypeName, pcbTypeName); if (result) CRYPT_ReturnLastError(result); @@ -1108,29 +1156,33 @@ } /****************************************************************************** - * CryptEnumProviderTypesW (ADVAPI32.@) + * CryptEnumProviderTypesA (ADVAPI32.@) * - * see CryptEnumProviderTypesA + * see CryptEnumProviderTypesW */ -BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved, - DWORD dwFlags, DWORD *pdwProvType, LPWSTR pszTypeName, DWORD *pcbTypeName) +BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved, + DWORD dwFlags, DWORD *pdwProvType, LPSTR pszTypeName, DWORD *pcbTypeName) { - PSTR str = NULL; + PWSTR str = NULL; DWORD strlen; BOOL ret; TRACE("(%ld, %p, %08lx, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, pdwProvType, pszTypeName, pcbTypeName); - strlen = *pcbTypeName / sizeof(WCHAR); + + CryptEnumProviderTypesW(dwIndex, pdwReserved, dwFlags, pdwProvType, NULL, &strlen); if ( pszTypeName && !(str = CRYPT_Alloc(strlen)) ) CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); - ret = CryptEnumProviderTypesA(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &strlen); + ret = CryptEnumProviderTypesW(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &strlen); + if (str) + CRYPT_UnicodeToANSI(str, &pszTypeName, *pcbTypeName); + *pcbTypeName = strlen / sizeof(WCHAR); if (str) { - CRYPT_ANSIToUnicode(str, &pszTypeName, *pcbTypeName); CRYPT_Free(str); + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + CRYPT_ReturnLastError(ERROR_MORE_DATA); } - *pcbTypeName = strlen * sizeof(WCHAR); return ret; } @@ -1214,7 +1266,7 @@ } /****************************************************************************** - * CryptGetDefaultProviderA (ADVAPI32.@) + * CryptGetDefaultProviderW (ADVAPI32.@) * * Finds the default CSP of a certain provider type. * @@ -1233,12 +1285,13 @@ * If pszProvName is NULL, pcbProvName will hold the size of the buffer for * memory allocation purposes on return. */ -BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved, - DWORD dwFlags, LPSTR pszProvName, DWORD *pcbProvName) +BOOL WINAPI CryptGetDefaultProviderW (DWORD dwProvType, DWORD *pdwReserved, + DWORD dwFlags, LPWSTR pszProvName, DWORD *pcbProvName) { HKEY hKey; - PSTR keyname; + PWSTR keyname; DWORD result; + static const WCHAR nameW[] = {'N','a','m','e',0}; if (pdwReserved || !pcbProvName) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1248,14 +1301,14 @@ CRYPT_ReturnLastError(NTE_BAD_PROV_TYPE); if ( !(keyname = CRYPT_GetTypeKeyName(dwProvType, dwFlags & CRYPT_USER_DEFAULT)) ) CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); - if (RegOpenKeyA((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE ,keyname, &hKey)) + if (RegOpenKeyW((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE ,keyname, &hKey)) { CRYPT_Free(keyname); CRYPT_ReturnLastError(NTE_PROV_TYPE_NOT_DEF); } CRYPT_Free(keyname); - result = RegQueryValueExA(hKey, "Name", NULL, NULL, (LPBYTE)pszProvName, pcbProvName); + result = RegQueryValueExW(hKey, nameW, NULL, NULL, (LPBYTE)pszProvName, pcbProvName); if (result) { if (result != ERROR_MORE_DATA) @@ -1271,29 +1324,32 @@ } /****************************************************************************** - * CryptGetDefaultProviderW (ADVAPI32.@) + * CryptGetDefaultProviderA (ADVAPI32.@) * - * see CryptGetDefaultProviderA + * see CryptGetDefaultProviderW */ -BOOL WINAPI CryptGetDefaultProviderW (DWORD dwProvType, DWORD *pdwReserved, - DWORD dwFlags, LPWSTR pszProvName, DWORD *pcbProvName) +BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved, + DWORD dwFlags, LPSTR pszProvName, DWORD *pcbProvName) { - PSTR str = NULL; + PWSTR str = NULL; DWORD strlen; BOOL ret = FALSE; TRACE("(%ld, %p, %08lx, %p, %p)\n", dwProvType, pdwReserved, dwFlags, pszProvName, pcbProvName); - strlen = *pcbProvName / sizeof(WCHAR); + CryptGetDefaultProviderW(dwProvType, pdwReserved, dwFlags, NULL, &strlen); if ( pszProvName && !(str = CRYPT_Alloc(strlen)) ) CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); - ret = CryptGetDefaultProviderA(dwProvType, pdwReserved, dwFlags, str, &strlen); + ret = CryptGetDefaultProviderW(dwProvType, pdwReserved, dwFlags, str, &strlen); + if (str) + CRYPT_UnicodeToANSI(str, &pszProvName, *pcbProvName); + *pcbProvName = strlen / sizeof(WCHAR); if (str) { - CRYPT_ANSIToUnicode(str, &pszProvName, *pcbProvName); CRYPT_Free(str); + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + CRYPT_ReturnLastError(ERROR_MORE_DATA); } - *pcbProvName = strlen * sizeof(WCHAR); return ret; } @@ -1696,7 +1752,7 @@ } /****************************************************************************** - * CryptSetProviderExA (ADVAPI32.@) + * CryptSetProviderExW (ADVAPI32.@) * * Specifies the default CSP. * @@ -1710,12 +1766,13 @@ * Success: TRUE * Failure: FALSE */ -BOOL WINAPI CryptSetProviderExA (LPCSTR pszProvName, DWORD dwProvType, DWORD *pdwReserved, DWORD dwFlags) +BOOL WINAPI CryptSetProviderExW (LPCWSTR pszProvName, DWORD dwProvType, DWORD *pdwReserved, DWORD dwFlags) { HKEY hProvKey, hTypeKey; - PSTR keyname; + PWSTR keyname; + static const WCHAR nameW[] = {'N','a','m','e',0}; - TRACE("(%s, %ld, %p, %08lx)\n", pszProvName, dwProvType, pdwReserved, dwFlags); + TRACE("(%s, %ld, %p, %08lx)\n", debugstr_w(pszProvName), dwProvType, pdwReserved, dwFlags); if (!pszProvName || pdwReserved) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1727,7 +1784,7 @@ if (!(keyname = CRYPT_GetTypeKeyName(dwProvType, dwFlags & CRYPT_USER_DEFAULT))) CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); - if (RegOpenKeyA((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, + if (RegOpenKeyW((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, keyname, &hTypeKey)) { CRYPT_Free(keyname); @@ -1737,7 +1794,7 @@ if (dwFlags & CRYPT_DELETE_DEFAULT) { - RegDeleteValueA(hTypeKey, "Name"); + RegDeleteValueW(hTypeKey, nameW); } else { @@ -1746,7 +1803,7 @@ RegCloseKey(hTypeKey); CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); } - if (RegOpenKeyA((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, + if (RegOpenKeyW((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, keyname, &hProvKey)) { CRYPT_Free(keyname); @@ -1755,7 +1812,7 @@ } CRYPT_Free(keyname); - if (RegSetValueExA(hTypeKey, "Name", 0, REG_SZ, (LPBYTE)pszProvName, strlen(pszProvName) + 1)) + if (RegSetValueExW(hTypeKey, nameW, 0, REG_SZ, (LPBYTE)pszProvName, (strlenW(pszProvName) + 1)*sizeof(WCHAR))) { RegCloseKey(hTypeKey); RegCloseKey(hProvKey); @@ -1770,20 +1827,20 @@ } /****************************************************************************** - * CryptSetProviderExW (ADVAPI32.@) + * CryptSetProviderExA (ADVAPI32.@) * - * See CryptSetProviderExA + * See CryptSetProviderExW */ -BOOL WINAPI CryptSetProviderExW (LPCWSTR pszProvName, DWORD dwProvType, DWORD *pdwReserved, DWORD dwFlags) +BOOL WINAPI CryptSetProviderExA (LPCSTR pszProvName, DWORD dwProvType, DWORD *pdwReserved, DWORD dwFlags) { BOOL ret = FALSE; - PSTR str = NULL; + PWSTR str = NULL; - TRACE("(%s, %ld, %p, %08lx)\n", debugstr_w(pszProvName), dwProvType, pdwReserved, dwFlags); + TRACE("(%s, %ld, %p, %08lx)\n", pszProvName, dwProvType, pdwReserved, dwFlags); - if (CRYPT_UnicodeToANSI(pszProvName, &str, -1)) + if (CRYPT_ANSIToUnicode(pszProvName, &str, -1)) { - ret = CryptSetProviderExA(str, dwProvType, pdwReserved, dwFlags); + ret = CryptSetProviderExW(str, dwProvType, pdwReserved, dwFlags); CRYPT_Free(str); } return ret; diff -urN wine-20050830/dlls/advapi32/registry.c wine-20050930/dlls/advapi32/registry.c --- wine-20050830/dlls/advapi32/registry.c 2005-08-27 12:00:39.000000000 +0200 +++ wine-20050930/dlls/advapi32/registry.c 2005-09-15 11:31:05.000000000 +0200 @@ -100,7 +100,7 @@ static HKEY create_special_root_hkey( HANDLE hkey, DWORD access ) { HKEY ret = 0; - int idx = (UINT)hkey - (UINT)HKEY_SPECIAL_ROOT_FIRST; + int idx = (UINT_PTR)hkey - (UINT_PTR)HKEY_SPECIAL_ROOT_FIRST; if (hkey == HKEY_CURRENT_USER) { @@ -135,7 +135,7 @@ if ((hkey >= HKEY_SPECIAL_ROOT_FIRST) && (hkey <= HKEY_SPECIAL_ROOT_LAST)) { - if (!(ret = special_root_keys[(UINT)hkey - (UINT)HKEY_SPECIAL_ROOT_FIRST])) + if (!(ret = special_root_keys[(UINT_PTR)hkey - (UINT_PTR)HKEY_SPECIAL_ROOT_FIRST])) ret = create_special_root_hkey( hkey, KEY_ALL_ACCESS ); } return ret; @@ -2223,20 +2223,20 @@ /* Use the local machine name */ ret = RegOpenKeyW( hKey, NULL, phkResult ); } - else if (lpMachineName[0] != '\\' || lpMachineName[1] != '\\') - ret = ERROR_BAD_NETPATH; - else - { + else { WCHAR compName[MAX_COMPUTERNAME_LENGTH + 1]; DWORD len = sizeof(compName) / sizeof(WCHAR); + /* MSDN says lpMachineName must start with \\ : not so */ + if( lpMachineName[0] == '\\' && lpMachineName[1] == '\\') + lpMachineName += 2; if (GetComputerNameW(compName, &len)) { - if (!strcmpiW(lpMachineName + 2, compName)) + if (!strcmpiW(lpMachineName, compName)) ret = RegOpenKeyW(hKey, NULL, phkResult); else { - FIXME("Cannot connect to %s\n",debugstr_w(lpMachineName)); + FIXME("Connect to %s is not supported.\n",debugstr_w(lpMachineName)); ret = ERROR_BAD_NETPATH; } } diff -urN wine-20050830/dlls/advapi32/security.c wine-20050930/dlls/advapi32/security.c --- wine-20050830/dlls/advapi32/security.c 2005-08-22 11:18:48.000000000 +0200 +++ wine-20050930/dlls/advapi32/security.c 2005-09-16 20:44:17.000000000 +0200 @@ -3135,7 +3135,7 @@ return TRUE; } - if (*StringSid != 'S' || *StringSid != '-') /* S-R-I-S-S */ + if (StringSid[0] == 'S' && StringSid[1] == '-') /* S-R-I-S-S */ { DWORD i = 0, identAuth; DWORD csubauth = ((*cBytes - sizeof(SID)) / sizeof(DWORD)) + 1; diff -urN wine-20050830/dlls/advapi32/service.c wine-20050930/dlls/advapi32/service.c --- wine-20050830/dlls/advapi32/service.c 2005-08-27 12:00:39.000000000 +0200 +++ wine-20050930/dlls/advapi32/service.c 2005-09-15 11:31:05.000000000 +0200 @@ -75,7 +75,7 @@ 0, 0, &service_cs, { &service_cs_debug.ProcessLocksList, &service_cs_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": service_cs") } + 0, 0, { (DWORD_PTR)(__FILE__ ": service_cs") } }; static CRITICAL_SECTION service_cs = { &service_cs_debug, -1, 0, 0, 0, 0 }; @@ -1000,6 +1000,7 @@ error: sc_handle_free( &manager->hdr ); + SetLastError( r); return NULL; } diff -urN wine-20050830/dlls/advapi32/tests/crypt.c wine-20050930/dlls/advapi32/tests/crypt.c --- wine-20050830/dlls/advapi32/tests/crypt.c 2005-07-07 14:08:43.000000000 +0200 +++ wine-20050930/dlls/advapi32/tests/crypt.c 2005-09-28 13:59:04.000000000 +0200 @@ -384,7 +384,7 @@ DWORD providerLen; DWORD type; DWORD count; - BOOL result; + DWORD result; DWORD notNull = 5; DWORD notZeroFlags = 5; @@ -395,7 +395,10 @@ } if (!FindProvRegVals(dwIndex, &dwType, &pszProvName, &cbName, &provCount)) - return; + { + trace("could not find providers in registry, skipping the test\n"); + return; + } /* check pdwReserved flag for NULL */ result = pCryptEnumProvidersA(dwIndex, ¬Null, 0, &type, NULL, &providerLen); @@ -439,12 +442,13 @@ if (!(provider = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, providerLen)))) return; + providerLen = 0xdeadbeef; result = pCryptEnumProvidersA(dwIndex, NULL, 0, &type, provider, &providerLen); - ok(result && type==dwType, "expected %ld, got %ld\n", - dwType, type); - ok(result && !strcmp(pszProvName, provider), "expected %s, got %s\n", pszProvName, provider); - ok(result && cbName==providerLen, "expected %ld, got %ld\n", - cbName, providerLen); + ok(result, "expected TRUE, got %ld\n", result); + ok(type==dwType, "expected %ld, got %ld\n", dwType, type); + if (pszProvName) + ok(!strcmp(pszProvName, provider), "expected %s, got %s\n", pszProvName, provider); + ok(cbName==providerLen, "expected %ld, got %ld\n", cbName, providerLen); LocalFree(provider); } @@ -656,7 +660,11 @@ return; } - FindDfltProvRegVals(dwProvType, dwFlags, &pszProvName, &cbProvName); + if(!FindDfltProvRegVals(dwProvType, dwFlags, &pszProvName, &cbProvName)) + { + trace("could not find default provider in registry, skipping the test\n"); + return; + } /* check pdwReserved for NULL */ result = pCryptGetDefaultProviderA(provType, ¬Null, flags, provName, &provNameSize); @@ -701,9 +709,12 @@ if (!(provName = LocalAlloc(LMEM_ZEROINIT, provNameSize))) return; + provNameSize = 0xdeadbeef; result = pCryptGetDefaultProviderA(provType, NULL, flags, provName, &provNameSize); - ok(result && !strcmp(pszProvName, provName), "expected %s, got %s\n", pszProvName, provName); - ok(result && provNameSize==cbProvName, "expected %ld, got %ld\n", cbProvName, provNameSize); + ok(result, "expected TRUE, got %ld\n", result); + if(pszProvName) + ok(!strcmp(pszProvName, provName), "expected %s, got %s\n", pszProvName, provName); + ok(provNameSize==cbProvName, "expected %ld, got %ld\n", cbProvName, provNameSize); LocalFree(provName); } diff -urN wine-20050830/dlls/advapi32/tests/registry.c wine-20050930/dlls/advapi32/tests/registry.c --- wine-20050830/dlls/advapi32/tests/registry.c 2005-07-18 12:30:51.000000000 +0200 +++ wine-20050930/dlls/advapi32/tests/registry.c 2005-09-15 11:31:05.000000000 +0200 @@ -24,6 +24,7 @@ #include "windef.h" #include "winbase.h" #include "winreg.h" +#include "winsvc.h" #include "winerror.h" static HKEY hkey_main; @@ -593,6 +594,32 @@ return TRUE; } +/* tests that show that RegConnectRegistry and + OpenSCManager accept computer names without the + \\ prefix (what MSDN says). */ +static void test_regconnectregistry( void) +{ + CHAR compName[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD len = sizeof(compName) ; + BOOL ret; + LONG retl; + HKEY hkey; + SC_HANDLE schnd; + + ret = GetComputerNameA(compName, &len); + ok( ret, "GetComputerName failed err = %ld\n", GetLastError()); + if( !ret) return; + + retl = RegConnectRegistryA( compName, HKEY_LOCAL_MACHINE, &hkey); + ok( !retl, "RegConnectRegistryA failed err = %ld\n", retl); + if( !retl) RegCloseKey( hkey); + + schnd = OpenSCManagerA( compName, NULL, GENERIC_READ); + ok( schnd != NULL, "OpenSCManagerA failed err = %ld\n", GetLastError()); + CloseServiceHandle( schnd); + +} + START_TEST(registry) { setup_main_key(); @@ -619,4 +646,6 @@ /* cleanup */ delete_key( hkey_main ); + + test_regconnectregistry(); } diff -urN wine-20050830/dlls/advpack/.cvsignore wine-20050930/dlls/advpack/.cvsignore --- wine-20050830/dlls/advpack/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050930/dlls/advpack/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -advpack.dll.dbg.c libadvpack.def diff -urN wine-20050830/dlls/advpack/advpack.c wine-20050930/dlls/advpack/advpack.c --- wine-20050830/dlls/advpack/advpack.c 2005-07-11 20:01:48.000000000 +0200 +++ wine-20050930/dlls/advpack/advpack.c 2005-09-06 11:25:25.000000000 +0200 @@ -144,6 +144,15 @@ } /*********************************************************************** + * IsNTAdmin (ADVPACK.@) + */ +BOOL WINAPI IsNTAdmin( DWORD reserved, PDWORD pReserved ) +{ + FIXME("(0x%08lx, %p): stub\n", reserved, pReserved); + return TRUE; +} + +/*********************************************************************** * NeedRebootInit (ADVPACK.@) */ DWORD WINAPI NeedRebootInit(VOID) diff -urN wine-20050830/dlls/advpack/advpack.spec wine-20050930/dlls/advpack/advpack.spec --- wine-20050830/dlls/advpack/advpack.spec 2005-08-09 12:31:35.000000000 +0200 +++ wine-20050930/dlls/advpack/advpack.spec 2005-09-06 11:25:25.000000000 +0200 @@ -12,7 +12,7 @@ @ stub FileSaveRestoreOnINF @ stdcall GetVersionFromFile(str ptr ptr long) @ stdcall GetVersionFromFileEx(str ptr ptr long) -@ stub IsNTAdmin +@ stdcall IsNTAdmin(long ptr) @ stdcall LaunchINFSection(ptr ptr str long) @ stdcall LaunchINFSectionEx(ptr ptr str long) @ stdcall NeedReboot(long) diff -urN wine-20050830/dlls/amstream/.cvsignore wine-20050930/dlls/amstream/.cvsignore --- wine-20050830/dlls/amstream/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/amstream/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -amstream.dll.dbg.c version.res diff -urN wine-20050830/dlls/atl/.cvsignore wine-20050930/dlls/atl/.cvsignore --- wine-20050830/dlls/atl/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050930/dlls/atl/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,5 +1,4 @@ Makefile -atl.dll.dbg.c atliface.h libatl.def rsrc.res diff -urN wine-20050830/dlls/atl/registrar.c wine-20050930/dlls/atl/registrar.c --- wine-20050830/dlls/atl/registrar.c 2005-08-22 12:20:23.000000000 +0200 +++ wine-20050930/dlls/atl/registrar.c 2005-09-12 22:29:16.000000000 +0200 @@ -783,8 +783,7 @@ static HRESULT do_register_server(BOOL do_register) { static const WCHAR wszDll[] = {'a','t','l','.','d','l','l',0}; - UINT nID = 1; - return do_register_dll_server(wszDll, (LPCOLESTR) nID, do_register); + return do_register_dll_server(wszDll, MAKEINTRESOURCEW(101), do_register); } /*********************************************************************** diff -urN wine-20050830/dlls/atl/rsrc.rc wine-20050930/dlls/atl/rsrc.rc --- wine-20050830/dlls/atl/rsrc.rc 2005-03-16 20:53:41.000000000 +0100 +++ wine-20050930/dlls/atl/rsrc.rc 2005-09-02 17:19:06.000000000 +0200 @@ -16,4 +16,4 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -1 REGISTRY atl.rgs +101 REGISTRY atl.rgs diff -urN wine-20050830/dlls/avicap32/.cvsignore wine-20050930/dlls/avicap32/.cvsignore --- wine-20050830/dlls/avicap32/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050930/dlls/avicap32/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -avicap32.dll.dbg.c libavicap32.def diff -urN wine-20050830/dlls/avicap32/avicap32_main.c wine-20050930/dlls/avicap32/avicap32_main.c --- wine-20050830/dlls/avicap32/avicap32_main.c 2005-08-03 23:25:11.000000000 +0200 +++ wine-20050930/dlls/avicap32/avicap32_main.c 2005-09-12 17:32:50.000000000 +0200 @@ -138,8 +138,8 @@ #ifdef HAVE_V4L2 memset(&caps, 0, sizeof(caps)); if (xioctl(fd, VIDIOC_QUERYCAP, &caps) != -1) { - lstrcpynA(name, caps.card, namesize); - snprintf(version, versionsize, "%s v%u.%u.%u", caps.driver, (caps.version >> 16) & 0xFF, + lstrcpynA(name, (char *)caps.card, namesize); + snprintf(version, versionsize, "%s v%u.%u.%u", (char *)caps.driver, (caps.version >> 16) & 0xFF, (caps.version >> 8) & 0xFF, caps.version & 0xFF); close(fd); return TRUE; diff -urN wine-20050830/dlls/avifil32/.cvsignore wine-20050930/dlls/avifil32/.cvsignore --- wine-20050830/dlls/avifil32/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050930/dlls/avifil32/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,5 +1,3 @@ Makefile -avifil32.dll.dbg.c -avifile.spec.c libavifil32.def rsrc.res diff -urN wine-20050830/dlls/avifil32/acmstream.c wine-20050930/dlls/avifil32/acmstream.c --- wine-20050830/dlls/avifil32/acmstream.c 2005-07-05 18:19:13.000000000 +0200 +++ wine-20050930/dlls/avifil32/acmstream.c 2005-09-12 22:30:37.000000000 +0200 @@ -93,14 +93,17 @@ /***********************************************************************/ -#define CONVERT_STREAM_to_THIS(a) { \ - acmStreamSize(This->has,(a)*This->lpInFormat->nBlockAlign,\ - &(a), ACM_STREAMSIZEF_SOURCE); \ - (a) /= This->lpOutFormat->nBlockAlign; } -#define CONVERT_THIS_to_STREAM(a) { \ - acmStreamSize(This->has,(a)*This->lpOutFormat->nBlockAlign,\ - &(a), ACM_STREAMSIZEF_DESTINATION); \ - (a) /= This->lpInFormat->nBlockAlign; } +#define CONVERT_STREAM_to_THIS(a) do { \ + DWORD __bytes; \ + acmStreamSize(This->has,*(a) * This->lpInFormat->nBlockAlign,\ + &__bytes, ACM_STREAMSIZEF_SOURCE); \ + *(a) = __bytes / This->lpOutFormat->nBlockAlign; } while(0) + +#define CONVERT_THIS_to_STREAM(a) do { \ + DWORD __bytes; \ + acmStreamSize(This->has,*(a) * This->lpOutFormat->nBlockAlign,\ + &__bytes, ACM_STREAMSIZEF_DESTINATION); \ + *(a) = __bytes / This->lpInFormat->nBlockAlign; } while(0) static HRESULT AVIFILE_OpenCompressor(IAVIStreamImpl *This); @@ -304,7 +307,7 @@ } /* convert pos from our 'space' to This->pStream's one */ - CONVERT_THIS_to_STREAM(pos); + CONVERT_THIS_to_STREAM(&pos); /* ask stream */ pos = IAVIStream_FindSample(This->pStream, pos, flags); @@ -312,7 +315,7 @@ if (pos != -1) { /* convert pos back to our 'space' if it's no size or physical pos */ if ((flags & FIND_RET) == 0) - CONVERT_STREAM_to_THIS(pos); + CONVERT_STREAM_to_THIS(&pos); } return pos; @@ -391,7 +394,7 @@ if (FAILED(hr)) return hr; - CONVERT_THIS_to_STREAM(pos); + CONVERT_THIS_to_STREAM(&pos); /* tell the nested stream the new format */ return IAVIStream_SetFormat(This->pStream, pos, This->lpOutFormat, @@ -453,7 +456,7 @@ } /* map our positions to pStream positions */ - CONVERT_THIS_to_STREAM(start); + CONVERT_THIS_to_STREAM(&start); /* our needed internal buffersize */ size = samples * This->lpInFormat->nBlockAlign; @@ -486,7 +489,7 @@ /* read source data */ hr = IAVIStream_Read(This->pStream, start, -1, This->acmStreamHdr.pbSrc, This->acmStreamHdr.cbSrcLength, - &This->acmStreamHdr.cbSrcLength, NULL); + (LONG *)&This->acmStreamHdr.cbSrcLength, NULL); if (FAILED(hr) || This->acmStreamHdr.cbSrcLength == 0) return hr; @@ -553,8 +556,8 @@ /* map our sizes to pStream sizes */ size = buffersize; - CONVERT_THIS_to_STREAM(size); - CONVERT_THIS_to_STREAM(start); + CONVERT_THIS_to_STREAM(&size); + CONVERT_THIS_to_STREAM(&start); /* no bytes to write? -- short circuit */ if (size == 0) { @@ -644,8 +647,8 @@ return AVIERR_NOCOMPRESSOR; /* map our positions to pStream positions */ - CONVERT_THIS_to_STREAM(start); - CONVERT_THIS_to_STREAM(samples); + CONVERT_THIS_to_STREAM(&start); + CONVERT_THIS_to_STREAM(&samples); return IAVIStream_Delete(This->pStream, start, samples); } @@ -736,9 +739,9 @@ SetRectEmpty(&This->sInfo.rcFrame); /* convert positions ansd sizes to output format */ - CONVERT_STREAM_to_THIS(This->sInfo.dwStart); - CONVERT_STREAM_to_THIS(This->sInfo.dwLength); - CONVERT_STREAM_to_THIS(This->sInfo.dwSuggestedBufferSize); + CONVERT_STREAM_to_THIS(&This->sInfo.dwStart); + CONVERT_STREAM_to_THIS(&This->sInfo.dwLength); + CONVERT_STREAM_to_THIS(&This->sInfo.dwSuggestedBufferSize); return AVIERR_OK; } diff -urN wine-20050830/dlls/avifil32/api.c wine-20050930/dlls/avifil32/api.c --- wine-20050830/dlls/avifil32/api.c 2005-07-02 12:49:39.000000000 +0200 +++ wine-20050930/dlls/avifil32/api.c 2005-09-08 13:04:53.000000000 +0200 @@ -72,31 +72,33 @@ */ static HRESULT AVIFILE_CLSIDFromString(LPCSTR idstr, LPCLSID id) { - BYTE const *s = (BYTE const*)idstr; + BYTE const *s; BYTE *p; INT i; BYTE table[256]; - if (!s) { + if (!idstr) { memset(id, 0, sizeof(CLSID)); return S_OK; - } else { /* validate the CLSID string */ - if (lstrlenA(s) != 38) - return CO_E_CLASSSTRING; + } - if ((s[0]!='{') || (s[9]!='-') || (s[14]!='-') || (s[19]!='-') || - (s[24]!='-') || (s[37]!='}')) + /* validate the CLSID string */ + if (lstrlenA(idstr) != 38) + return CO_E_CLASSSTRING; + + s = (BYTE const*)idstr; + if ((s[0]!='{') || (s[9]!='-') || (s[14]!='-') || (s[19]!='-') || + (s[24]!='-') || (s[37]!='}')) + return CO_E_CLASSSTRING; + + for (i = 1; i < 37; i++) { + if ((i == 9) || (i == 14) || (i == 19) || (i == 24)) + continue; + if (!(((s[i] >= '0') && (s[i] <= '9')) || + ((s[i] >= 'a') && (s[i] <= 'f')) || + ((s[i] >= 'A') && (s[i] <= 'F'))) + ) return CO_E_CLASSSTRING; - - for (i = 1; i < 37; i++) { - if ((i == 9) || (i == 14) || (i == 19) || (i == 24)) - continue; - if (!(((s[i] >= '0') && (s[i] <= '9')) || - ((s[i] >= 'a') && (s[i] <= 'f')) || - ((s[i] >= 'A') && (s[i] <= 'F'))) - ) - return CO_E_CLASSSTRING; - } } TRACE("%s -> %p\n", s, id); diff -urN wine-20050830/dlls/avifil32/avifile_No.rc wine-20050930/dlls/avifil32/avifile_No.rc --- wine-20050830/dlls/avifil32/avifile_No.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/avifil32/avifile_No.rc 2005-09-25 17:18:38.000000000 +0200 @@ -0,0 +1,50 @@ +/* + * Copyright 2005 Alexander N. Sørnes + * + * 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 + */ + +LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL + +IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Komprimeringsinnstillinger" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&Velg en strøm:",-1,2,5,114,10 + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP + PUSHBUTTON "I&nnstillinger . . .",IDC_OPTIONS,145,17,45,14 + AUTOCHECKBOX "Sett &inn for hver",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP + EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL + LTEXT "bilde",-1,104,43,36,9 + LTEXT "Gjeldende format:",-1,3,56,53,9 + LTEXT "Denne plassen er til leie",IDC_FORMATTEXT,55,56,90,26 + DEFPUSHBUTTON "OK",IDOK,145,42,45,14 + PUSHBUTTON "Avbryt",IDCANCEL,145,61,45,14 +END + +STRINGTABLE DISCARDABLE +{ + IDS_WAVESTREAMFORMAT "Lydformat: %s" + IDS_WAVEFILETYPE "Lydformat" + IDS_ALLMULTIMEDIA "Alle multimedia-filer" + IDS_ALLFILES "Alle filer (*.*)@*.*" + IDS_VIDEO "video" + IDS_AUDIO "lyd" + IDS_AVISTREAMFORMAT "%s %s #%d" + IDS_AVIFILETYPE "Wine standardfilhåndterer for AVI" + IDS_UNCOMPRESSED "ukomprimert" +} diff -urN wine-20050830/dlls/avifil32/getframe.c wine-20050930/dlls/avifil32/getframe.c --- wine-20050830/dlls/avifil32/getframe.c 2005-07-05 18:19:13.000000000 +0200 +++ wine-20050930/dlls/avifil32/getframe.c 2005-09-12 17:14:07.000000000 +0200 @@ -341,7 +341,7 @@ if (This->pStream == NULL) return AVIERR_ERROR; - if ((LONG)lpbiWanted == AVIGETFRAMEF_BESTDISPLAYFMT) { + if (lpbiWanted == (LPBITMAPINFOHEADER)AVIGETFRAMEF_BESTDISPLAYFMT) { lpbi = NULL; bBestDisplay = TRUE; } diff -urN wine-20050830/dlls/avifil32/rsrc.rc wine-20050930/dlls/avifil32/rsrc.rc --- wine-20050830/dlls/avifil32/rsrc.rc 2004-09-10 21:37:28.000000000 +0200 +++ wine-20050930/dlls/avifil32/rsrc.rc 2005-09-25 17:18:38.000000000 +0200 @@ -46,6 +46,7 @@ #include "avifile_It.rc" #include "avifile_Ja.rc" #include "avifile_Nl.rc" +#include "avifile_No.rc" #include "avifile_Pl.rc" #include "avifile_Pt.rc" #include "avifile_Ru.rc" diff -urN wine-20050830/dlls/cabinet/.cvsignore wine-20050930/dlls/cabinet/.cvsignore --- wine-20050830/dlls/cabinet/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050930/dlls/cabinet/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -cabinet.dll.dbg.c cabinet.res libcabinet.def diff -urN wine-20050830/dlls/capi2032/.cvsignore wine-20050930/dlls/capi2032/.cvsignore --- wine-20050830/dlls/capi2032/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050930/dlls/capi2032/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -capi2032.dll.dbg.c libcapi2032.def diff -urN wine-20050830/dlls/cards/.cvsignore wine-20050930/dlls/cards/.cvsignore --- wine-20050830/dlls/cards/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050930/dlls/cards/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -11,7 +11,6 @@ c7.bmp c8.bmp c9.bmp -cards.dll.dbg.c cards.res cj.bmp ck.bmp diff -urN wine-20050830/dlls/cards/cards.c wine-20050930/dlls/cards/cards.c --- wine-20050830/dlls/cards/cards.c 2004-03-29 22:26:21.000000000 +0200 +++ wine-20050930/dlls/cards/cards.c 2005-09-08 13:04:53.000000000 +0200 @@ -72,6 +72,12 @@ return TRUE; } +static DWORD do_blt(HDC hdc, int x, int y, int dx, int dy, HDC hMemoryDC, DWORD rasterOp ) +{ + if((cardWidth == dx) && (cardHeight == dy)) + return BitBlt(hdc, x, y, cardWidth, cardHeight, hMemoryDC, 0, 0, rasterOp); + return StretchBlt(hdc, x, y, dx, dy, hMemoryDC, 0, 0, cardWidth, cardHeight, rasterOp); +} /*********************************************************************** * Draw a card. Unlike cdtDrawCard, this version allows you to stretch @@ -85,7 +91,6 @@ HGDIOBJ result; DWORD rasterOp = SRCCOPY; BOOL roundCornersFlag; - COLORREF savedPixels[12]; BOOL eraseFlag = FALSE; BOOL drawFlag = TRUE; @@ -170,6 +175,8 @@ if(roundCornersFlag) { + COLORREF savedPixels[12]; + savedPixels[0] = GetPixel(hdc, x, y); savedPixels[1] = GetPixel(hdc, x + 1, y); savedPixels[2] = GetPixel(hdc, x, y + 1); @@ -182,15 +189,9 @@ savedPixels[9] = GetPixel(hdc, x + dx - 1, y + dy - 1); savedPixels[10] = GetPixel(hdc, x + dx - 2, y + dy - 1); savedPixels[11] = GetPixel(hdc, x + dx - 1, y + dy - 2); - } - if((cardWidth == dx) && (cardHeight == dy)) - BitBlt(hdc, x, y, cardWidth, cardHeight, hMemoryDC, 0, 0, rasterOp); - else - StretchBlt(hdc, x, y, dx, dy, hMemoryDC, 0, 0, cardWidth, cardHeight, rasterOp); + do_blt(hdc, x, y, dx, dy, hMemoryDC, rasterOp); - if(roundCornersFlag) - { SetPixel(hdc, x, y, savedPixels[0]); SetPixel(hdc, x + 1, y, savedPixels[1]); SetPixel(hdc, x, y + 1, savedPixels[2]); @@ -204,6 +205,8 @@ SetPixel(hdc, x + dx - 2, y + dy - 1, savedPixels[10]); SetPixel(hdc, x + dx - 1, y + dy - 2, savedPixels[11]); } + else + do_blt(hdc, x, y, dx, dy, hMemoryDC, rasterOp); } DeleteDC(hMemoryDC); diff -urN wine-20050830/dlls/cfgmgr32/.cvsignore wine-20050930/dlls/cfgmgr32/.cvsignore --- wine-20050830/dlls/cfgmgr32/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050930/dlls/cfgmgr32/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -cfgmgr32.dll.dbg.c libcfgmgr32.def diff -urN wine-20050830/dlls/cfgmgr32/main.c wine-20050930/dlls/cfgmgr32/main.c --- wine-20050830/dlls/cfgmgr32/main.c 2005-01-20 11:37:08.000000000 +0100 +++ wine-20050930/dlls/cfgmgr32/main.c 2005-09-06 13:42:51.000000000 +0200 @@ -23,7 +23,7 @@ #include "windef.h" #include "winbase.h" #include "winnt.h" -#include "cfgmgr32.h" +#include "ddk/cfgmgr32.h" #include "wine/debug.h" diff -urN wine-20050830/dlls/comcat/.cvsignore wine-20050930/dlls/comcat/.cvsignore --- wine-20050830/dlls/comcat/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/comcat/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -comcat.dll.dbg.c version.res diff -urN wine-20050830/dlls/comctl32/.cvsignore wine-20050930/dlls/comctl32/.cvsignore --- wine-20050830/dlls/comctl32/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/comctl32/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,6 +1,4 @@ Makefile -comctl32.dll -comctl32.dll.dbg.c idb_hist_large.bmp idb_hist_small.bmp idb_std_large.bmp diff -urN wine-20050830/dlls/comctl32/animate.c wine-20050930/dlls/comctl32/animate.c --- wine-20050830/dlls/comctl32/animate.c 2005-08-30 12:07:18.000000000 +0200 +++ wine-20050930/dlls/comctl32/animate.c 2005-09-18 13:12:00.000000000 +0200 @@ -252,15 +252,12 @@ static BOOL ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC) { - void* pBitmapData = NULL; - LPBITMAPINFO pBitmapInfo = NULL; - + void *pBitmapData; + LPBITMAPINFO pBitmapInfo; HDC hdcMem; HBITMAP hbmOld; - int nOffsetX = 0; int nOffsetY = 0; - int nWidth; int nHeight; @@ -289,11 +286,11 @@ infoPtr->hbmPrevFrame=CreateCompatibleBitmap(hDC, nWidth,nHeight ); } - SetDIBits(hDC, infoPtr->hbmPrevFrame, 0, nHeight, pBitmapData, (LPBITMAPINFO)pBitmapInfo, DIB_RGB_COLORS); - hdcMem = CreateCompatibleDC(hDC); hbmOld = SelectObject(hdcMem, infoPtr->hbmPrevFrame); + SetDIBits(hdcMem, infoPtr->hbmPrevFrame, 0, nHeight, pBitmapData, pBitmapInfo, DIB_RGB_COLORS); + /* * we need to get the transparent color even without ACS_TRANSPARENT, * because the style can be changed later on and the color should always diff -urN wine-20050830/dlls/comctl32/comboex.c wine-20050930/dlls/comctl32/comboex.c --- wine-20050830/dlls/comctl32/comboex.c 2005-08-30 12:07:18.000000000 +0200 +++ wine-20050930/dlls/comctl32/comboex.c 2005-09-21 11:45:09.000000000 +0200 @@ -473,7 +473,7 @@ CBE_ITEMDATA *item; INT i; - if ((index > infoPtr->nb_items) || (index < -1)) + if ((index >= infoPtr->nb_items) || (index < -1)) return 0; if (index == -1) return infoPtr->edit; @@ -509,7 +509,7 @@ TRACE("(index=%d)\n", index); /* if item number requested does not exist then return failure */ - if ((index > infoPtr->nb_items) || (index < 0)) return CB_ERR; + if ((index >= infoPtr->nb_items) || (index < 0)) return CB_ERR; if (!(item = COMBOEX_FindItem(infoPtr, index))) return CB_ERR; /* doing this will result in WM_DELETEITEM being issued */ @@ -527,7 +527,7 @@ TRACE("(...)\n"); /* if item number requested does not exist then return failure */ - if ((index > infoPtr->nb_items) || (index < -1)) return FALSE; + if ((index >= infoPtr->nb_items) || (index < -1)) return FALSE; /* if the item is the edit control and there is no edit control, skip */ if ((index == -1) && !COMBOEX_HasEdit(infoPtr)) return FALSE; @@ -587,7 +587,7 @@ /* get real index of item to insert */ index = cit->iItem; if (index == -1) index = infoPtr->nb_items; - if (index > infoPtr->nb_items) index = infoPtr->nb_items; + if (index > infoPtr->nb_items) return -1; /* get zero-filled space and chain it in */ if(!(item = (CBE_ITEMDATA *)Alloc (sizeof(*item)))) return -1; @@ -740,7 +740,7 @@ if (TRACE_ON(comboex)) COMBOEX_DumpInput (cit); /* if item number requested does not exist then return failure */ - if ((index > infoPtr->nb_items) || (index < -1)) return FALSE; + if ((index >= infoPtr->nb_items) || (index < -1)) return FALSE; /* if the item is the edit control and there is no edit control, skip */ if ((index == -1) && !COMBOEX_HasEdit(infoPtr)) return FALSE; diff -urN wine-20050830/dlls/comctl32/comctl32.h wine-20050930/dlls/comctl32/comctl32.h --- wine-20050830/dlls/comctl32/comctl32.h 2005-07-27 12:54:49.000000000 +0200 +++ wine-20050930/dlls/comctl32/comctl32.h 2005-09-12 13:10:58.000000000 +0200 @@ -250,6 +250,7 @@ } extern void THEMING_Initialize(void); +extern void THEMING_Uninitialize(void); extern LRESULT THEMING_CallOriginalClass(HWND, UINT, WPARAM, LPARAM); extern void THEMING_SetSubclassData(HWND, ULONG_PTR); diff -urN wine-20050830/dlls/comctl32/comctl32.spec wine-20050930/dlls/comctl32/comctl32.spec --- wine-20050830/dlls/comctl32/comctl32.spec 2005-08-08 19:35:29.000000000 +0200 +++ wine-20050930/dlls/comctl32/comctl32.spec 2005-09-09 17:05:02.000000000 +0200 @@ -15,7 +15,7 @@ 11 stdcall -noname DPA_Merge(ptr ptr long ptr ptr long) #12 stub Cctl1632_ThunkData32 13 stdcall MakeDragList(long) - 14 stdcall LBItemFromPt(long long long long) + 14 stdcall LBItemFromPt(long double long) 15 stdcall DrawInsert(long long long) 16 stdcall CreateUpDownControl(long long long long long long long long long long long long) 17 stdcall InitCommonControls() diff -urN wine-20050830/dlls/comctl32/comctl32undoc.c wine-20050930/dlls/comctl32/comctl32undoc.c --- wine-20050830/dlls/comctl32/comctl32undoc.c 2005-08-30 12:07:18.000000000 +0200 +++ wine-20050930/dlls/comctl32/comctl32undoc.c 2005-09-17 16:29:01.000000000 +0200 @@ -579,7 +579,7 @@ if (!stringW) return -1; - MultiByteToWideChar(CP_ACP, 0, lpszString, -1, stringW, len); + MultiByteToWideChar(CP_ACP, 0, lpszString, -1, stringW, len/sizeof(WCHAR)); ret = AddMRUData(hList, stringW, len); Free(stringW); return ret; @@ -682,13 +682,15 @@ /* get values from key 'MRUList' */ if (newkey) { - datasize = mp->extview.nMaxItems + 1; + datasize = (mp->extview.nMaxItems + 1) * sizeof(WCHAR); if((err=RegQueryValueExW( newkey, strMRUList, 0, &type, (LPBYTE)mp->realMRU, &datasize))) { /* not present - set size to 1 (will become 0 later) */ datasize = 1; *mp->realMRU = 0; } + else + datasize /= sizeof(WCHAR); TRACE("MRU list = %s, datasize = %ld\n", debugstr_w(mp->realMRU), datasize); diff -urN wine-20050830/dlls/comctl32/comctl_Bg.rc wine-20050930/dlls/comctl32/comctl_Bg.rc --- wine-20050830/dlls/comctl32/comctl_Bg.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/comctl32/comctl_Bg.rc 2005-09-19 19:00:59.000000000 +0200 @@ -0,0 +1,89 @@ +/* + * comctl (Bulgarian resource) + * + * Copyright 2005 Milko Krachounov + * + * 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 + */ + +LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT + +IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140 +STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +CAPTION "Ñâîéñòâà íà " +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + PUSHBUTTON "Îòìåíè", IDCANCEL,58,122,50,14 + PUSHBUTTON "&Ïîòâúðäè", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED + PUSHBUTTON "Ïîìîù", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP + CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 +END + + +IDD_WIZARD DIALOG DISCARDABLE 0, 0, 290, 159 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +CAPTION "Wizard" +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "< Íà&çàä", IDC_BACK_BUTTON,71,138,50,14 + DEFPUSHBUTTON "Íà&ïðåä >", IDC_NEXT_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Ïðèêëþ÷è", IDC_FINISH_BUTTON,121,138,50,14 + PUSHBUTTON "Îòìåíè", IDCANCEL,178,138,50,14 + PUSHBUTTON "Ïîìîù", IDHELP,235,138,50,14,WS_GROUP + LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN + CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 + LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE +END + + +IDD_TBCUSTOMIZE DIALOG DISCARDABLE 10, 20, 407, 125 /* 357 -> 407 ? */ +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Ïåðñîíàëèçèðàíå íà ëåíòàòà ñ èíñòðóìåíòè" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "&Çàòâîðè", IDCANCEL,318,6,84,14 /* 44 -> 84; 308 -> 318 ? */ + PUSHBUTTON "&Âúçñòàíîâè", IDC_RESET_BTN,318,23,84,14 /* 44 -> 84 ? */ + PUSHBUTTON "&Ïîìîù", IDC_HELP_BTN,318,40,84,14 /* 44 -> 84 ? */ + PUSHBUTTON "Ïðåìåñòè íà&ãîðå", IDC_MOVEUP_BTN,318,74,84,14 /* 44 -> 84 ? */ + PUSHBUTTON "Ïðåìåñòè íà&äîëó", IDC_MOVEDN_BTN,318,91,84,14 /* 44 -> 84 ? */ + LTEXT "&Íàëè÷íè áóòîíè:", -1,4,5,84,10 + LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP + PUSHBUTTON "Äî&áàâè ->", IDOK, 131, 42, 54, 14 /* 44 -> 54 ? */ + PUSHBUTTON "<- Ïðå&ìàõíè", IDC_REMOVE_BTN,131,62,54,14 /* 44 -> 54 ? */ + LTEXT "&Áóòîíè íà ëåíòàòà ñ èíñòðóìåíòè:", -1,192,5,78,10 /* 182 -> 192 ? */ + LISTBOX IDC_TOOLBARBTN_LBOX, 192,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP /* 182 -> 192 ? */ +END + +STRINGTABLE DISCARDABLE +{ + IDS_CLOSE "Çàòâîðè" +} + +STRINGTABLE DISCARDABLE +{ + IDM_TODAY "Äíåñ:" + IDM_GOTODAY "Èäè íà äíåñ" +} + +STRINGTABLE DISCARDABLE +{ + IDS_SEPARATOR "Ðàçäåëèòåë" +} + +STRINGTABLE DISCARDABLE +{ + HKY_NONE "Íèùî" +} diff -urN wine-20050830/dlls/comctl32/comctl_No.rc wine-20050930/dlls/comctl32/comctl_No.rc --- wine-20050830/dlls/comctl32/comctl_No.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/comctl32/comctl_No.rc 2005-09-21 13:43:31.000000000 +0200 @@ -0,0 +1,87 @@ +/* + * Copyright 2005 Alexander N. Sørnes + * + * 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 + */ + +LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL + +IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140 +STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +CAPTION "Egenskaper for " +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + PUSHBUTTON "Avbryt", IDCANCEL,58,122,50,14 + PUSHBUTTON "&Bruk", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED + PUSHBUTTON "Hjelp", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP + CONTROL "Fane", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 +END + + +IDD_WIZARD DIALOG DISCARDABLE 0, 0, 290, 159 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +CAPTION "Veiviser" +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "< Til&bake", IDC_BACK_BUTTON,71,138,50,14 + DEFPUSHBUTTON "&Neste >", IDC_NEXT_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Fullfør", IDC_FINISH_BUTTON,121,138,50,14 + PUSHBUTTON "Avbryt", IDCANCEL,178,138,50,14 + PUSHBUTTON "Hjelp", IDHELP,235,138,50,14,WS_GROUP + LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN + CONTROL "Fane", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 + LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE +END + + +IDD_TBCUSTOMIZE DIALOG DISCARDABLE 10, 20, 357, 125 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Tilpass verktøylinje" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "&Lukk", IDCANCEL,308,6,44,14 + PUSHBUTTON "Tilbak&estill", IDC_RESET_BTN,308,23,44,14 + PUSHBUTTON "&Hjelp", IDC_HELP_BTN,308,40,44,14 + PUSHBUTTON "Flytt &opp", IDC_MOVEUP_BTN,308,74,44,14 + PUSHBUTTON "Flytt ne&d", IDC_MOVEDN_BTN,308,91,44,14 + LTEXT "Tilgjengelige &knapper:", -1,4,5,84,10 + LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP + PUSHBUTTON "Le&gg til ->", IDOK, 131, 42, 44, 14 + PUSHBUTTON "<- Fje&rn", IDC_REMOVE_BTN,131,62,44,14 + LTEXT "Verk&tøylinje-knapper:", -1,182,5,78,10 + LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP +END + +STRINGTABLE DISCARDABLE +{ + IDS_CLOSE "Lukk" +} + +STRINGTABLE DISCARDABLE +{ + IDM_TODAY "Idag:" + IDM_GOTODAY "Gå til idag" +} + +STRINGTABLE DISCARDABLE +{ + IDS_SEPARATOR "Adskiller" +} + +STRINGTABLE DISCARDABLE +{ + HKY_NONE "Ingen" +} diff -urN wine-20050830/dlls/comctl32/commctrl.c wine-20050930/dlls/comctl32/commctrl.c --- wine-20050830/dlls/comctl32/commctrl.c 2005-08-30 12:07:18.000000000 +0200 +++ wine-20050930/dlls/comctl32/commctrl.c 2005-09-12 13:10:58.000000000 +0200 @@ -150,6 +150,9 @@ break; case DLL_PROCESS_DETACH: + /* clean up subclassing */ + THEMING_Uninitialize(); + /* unregister all common control classes */ ANIMATE_Unregister (); COMBOEX_Unregister (); diff -urN wine-20050830/dlls/comctl32/header.c wine-20050930/dlls/comctl32/header.c --- wine-20050830/dlls/comctl32/header.c 2005-08-30 12:07:18.000000000 +0200 +++ wine-20050930/dlls/comctl32/header.c 2005-09-18 14:29:35.000000000 +0200 @@ -930,6 +930,10 @@ nItem = infoPtr->uNumItem; iOrder = (phdi->mask & HDI_ORDER) ? phdi->iOrder : nItem; + if (iOrder < 0) + iOrder = 0; + else if (infoPtr->uNumItem < iOrder) + iOrder = infoPtr->uNumItem; if (infoPtr->uNumItem == 0) { infoPtr->items = Alloc (sizeof (HEADER_ITEM)); diff -urN wine-20050830/dlls/comctl32/listview.c wine-20050930/dlls/comctl32/listview.c --- wine-20050830/dlls/comctl32/listview.c 2005-08-30 12:07:17.000000000 +0200 +++ wine-20050930/dlls/comctl32/listview.c 2005-09-13 16:30:53.000000000 +0200 @@ -389,7 +389,7 @@ #define LISTVIEW_DUMP(iP) do { \ TRACE("hwndSelf=%p, clrBk=0x%06lx, clrText=0x%06lx, clrTextBk=0x%06lx, ItemHeight=%d, ItemWidth=%d, Style=0x%08lx\n", \ iP->hwndSelf, iP->clrBk, iP->clrText, iP->clrTextBk, \ - iP->nItemHeight, iP->nItemWidth, infoPtr->dwStyle); \ + iP->nItemHeight, iP->nItemWidth, iP->dwStyle); \ TRACE("hwndSelf=%p, himlNor=%p, himlSml=%p, himlState=%p, Focused=%d, Hot=%d, exStyle=0x%08lx, Focus=%d\n", \ iP->hwndSelf, iP->himlNormal, iP->himlSmall, iP->himlState, \ iP->nFocusedItem, iP->nHotItem, iP->dwLvExStyle, iP->bFocus ); \ diff -urN wine-20050830/dlls/comctl32/propsheet.c wine-20050930/dlls/comctl32/propsheet.c --- wine-20050830/dlls/comctl32/propsheet.c 2005-08-30 12:07:17.000000000 +0200 +++ wine-20050930/dlls/comctl32/propsheet.c 2005-09-13 00:07:54.000000000 +0200 @@ -2161,7 +2161,7 @@ { WCHAR szTitle[256]; MultiByteToWideChar(CP_ACP, 0, lpszText, -1, - szTitle, sizeof(szTitle)); + szTitle, sizeof(szTitle)/sizeof(WCHAR)); PROPSHEET_SetTitleW(hwndDlg, dwStyle, szTitle); } else diff -urN wine-20050830/dlls/comctl32/rebar.c wine-20050930/dlls/comctl32/rebar.c --- wine-20050830/dlls/comctl32/rebar.c 2005-08-27 12:00:39.000000000 +0200 +++ wine-20050930/dlls/comctl32/rebar.c 2005-09-20 13:37:58.000000000 +0200 @@ -366,7 +366,7 @@ { if( !TRACE_ON(rebar) ) return; TRACE("band info: "); - if (pB->fMask & RBBIM_ID); + if (pB->fMask & RBBIM_ID) TRACE("ID=%u, ", pB->wID); TRACE("size=%u, child=%p", pB->cbSize, pB->hwndChild); if (pB->fMask & RBBIM_COLORS) @@ -415,7 +415,7 @@ for (i = 0; i < iP->uNumBands; i++) { pB = &iP->bands[i]; TRACE("band # %u:", i); - if (pB->fMask & RBBIM_ID); + if (pB->fMask & RBBIM_ID) TRACE(" ID=%u", pB->wID); if (pB->fMask & RBBIM_CHILD) TRACE(" child=%p", pB->hwndChild); diff -urN wine-20050830/dlls/comctl32/rsrc.rc wine-20050930/dlls/comctl32/rsrc.rc --- wine-20050830/dlls/comctl32/rsrc.rc 2005-04-13 13:04:49.000000000 +0200 +++ wine-20050930/dlls/comctl32/rsrc.rc 2005-09-21 13:43:31.000000000 +0200 @@ -1192,6 +1192,7 @@ * get localized bitmaps for example. */ +#include "comctl_Bg.rc" #include "comctl_Cn.rc" #include "comctl_Cs.rc" #include "comctl_De.rc" @@ -1202,6 +1203,7 @@ #include "comctl_Ja.rc" #include "comctl_Ko.rc" #include "comctl_Nl.rc" +#include "comctl_No.rc" #include "comctl_Pl.rc" #include "comctl_Pt.rc" #include "comctl_Ru.rc" diff -urN wine-20050830/dlls/comctl32/tests/.cvsignore wine-20050930/dlls/comctl32/tests/.cvsignore --- wine-20050830/dlls/comctl32/tests/.cvsignore 2005-08-23 12:02:25.000000000 +0200 +++ wine-20050930/dlls/comctl32/tests/.cvsignore 2005-09-21 11:41:44.000000000 +0200 @@ -1,4 +1,5 @@ Makefile +comboex.ok dpa.ok imagelist.ok mru.ok diff -urN wine-20050830/dlls/comctl32/tests/Makefile.in wine-20050930/dlls/comctl32/tests/Makefile.in --- wine-20050830/dlls/comctl32/tests/Makefile.in 2005-08-27 11:27:10.000000000 +0200 +++ wine-20050930/dlls/comctl32/tests/Makefile.in 2005-09-21 11:41:44.000000000 +0200 @@ -6,6 +6,7 @@ IMPORTS = comctl32 ole32 shlwapi user32 gdi32 advapi32 kernel32 CTESTS = \ + comboex.c \ dpa.c \ imagelist.c \ mru.c \ diff -urN wine-20050830/dlls/comctl32/tests/comboex.c wine-20050930/dlls/comctl32/tests/comboex.c --- wine-20050830/dlls/comctl32/tests/comboex.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/comctl32/tests/comboex.c 2005-09-21 11:41:44.000000000 +0200 @@ -0,0 +1,236 @@ +/* Unit test suite for comboex control. + * + * Copyright 2005 Jason Edmeades + * + * 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 +#include +#include + +#include "wine/test.h" + +static HWND hComboExParentWnd; +static HINSTANCE hMainHinst; +static char ComboExTestClass[] = "ComboExTestClass"; + +#define MAX_CHARS 100 +static char *textBuffer = NULL; + +static HWND createComboEx(DWORD style) { + return CreateWindowExA(0, WC_COMBOBOXEXA, NULL, style, 0, 0, 300, 300, + hComboExParentWnd, NULL, hMainHinst, NULL); +} + +static LONG addItem(HWND cbex, int idx, LPTSTR text) { + COMBOBOXEXITEM cbexItem; + memset(&cbexItem, 0x00, sizeof(cbexItem)); + cbexItem.mask = CBEIF_TEXT; + cbexItem.iItem = idx; + cbexItem.pszText = text; + cbexItem.cchTextMax = 0; + return (LONG)SendMessage(cbex, CBEM_INSERTITEM, 0,(LPARAM)&cbexItem); +} + +static LONG setItem(HWND cbex, int idx, LPTSTR text) { + COMBOBOXEXITEM cbexItem; + memset(&cbexItem, 0x00, sizeof(cbexItem)); + cbexItem.mask = CBEIF_TEXT; + cbexItem.iItem = idx; + cbexItem.pszText = text; + cbexItem.cchTextMax = 0; + return (LONG)SendMessage(cbex, CBEM_SETITEM, 0,(LPARAM)&cbexItem); +} + +static LONG delItem(HWND cbex, int idx) { + return (LONG)SendMessage(cbex, CBEM_DELETEITEM, (LPARAM)idx, 0); +} + +static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEM *cbItem) { + memset(cbItem, 0x00, sizeof(COMBOBOXEXITEM)); + cbItem->mask = CBEIF_TEXT; + cbItem->pszText = textBuffer; + cbItem->iItem = idx; + cbItem->cchTextMax = 100; + return (LONG)SendMessage(cbex, CBEM_GETITEM, 0, (LPARAM)cbItem); +} + +static void test_comboboxex() { + HWND myHwnd = 0; + LONG res = -1; + COMBOBOXEXITEM cbexItem; + + #define FIRST_ITEM "First Item" + #define SECOND_ITEM "Second Item" + #define THIRD_ITEM "Third Item" + #define MIDDLE_ITEM "Between First and Second Items" + #define REPLACEMENT_ITEM "Between First and Second Items" + + /* Allocate space for result */ + textBuffer = malloc(MAX_CHARS); + + /* Basic comboboxex test */ + myHwnd = createComboEx(WS_BORDER | WS_VISIBLE | WS_CHILD | CBS_DROPDOWN); + + /* Add items onto the end of the combobox */ + res = addItem(myHwnd, -1, FIRST_ITEM); + ok(res == 0, "Adding simple item failed (%ld)\n", res); + res = addItem(myHwnd, -1, SECOND_ITEM); + ok(res == 1, "Adding simple item failed (%ld)\n", res); + res = addItem(myHwnd, 2, THIRD_ITEM); + ok(res == 2, "Adding simple item failed (%ld)\n", res); + res = addItem(myHwnd, 1, MIDDLE_ITEM); + ok(res == 1, "Inserting simple item failed (%ld)\n", res); + + /* Add an item completely out of range */ + res = addItem(myHwnd, 99, "Out Of Range Item"); + ok(res == -1, "Adding using out of range index worked unexpectedly (%ld)\n", res); + res = addItem(myHwnd, 5, "Out Of Range Item"); + ok(res == -1, "Adding using out of range index worked unexpectedly (%ld)\n", res); + /* Removed: Causes traps on Windows XP + res = addItem(myHwnd, -2, "Out Of Range Item"); + ok(res == -1, "Adding out of range worked unexpectedly (%ld)\n", res); + */ + + /* Get an item completely out of range */ + res = getItem(myHwnd, 99, &cbexItem); + ok(res == 0, "Getting item using out of range index worked unexpectedly (%ld, %s)\n", res, cbexItem.pszText); + res = getItem(myHwnd, 4, &cbexItem); + ok(res == 0, "Getting item using out of range index worked unexpectedly (%ld, %s)\n", res, cbexItem.pszText); + res = getItem(myHwnd, -2, &cbexItem); + ok(res == 0, "Getting item using out of range index worked unexpectedly (%ld, %s)\n", res, cbexItem.pszText); + + /* Get an item in range */ + res = getItem(myHwnd, 0, &cbexItem); + ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res); + ok(strcmp(FIRST_ITEM, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText); + + res = getItem(myHwnd, 1, &cbexItem); + ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res); + ok(strcmp(MIDDLE_ITEM, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText); + + res = getItem(myHwnd, 2, &cbexItem); + ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res); + ok(strcmp(SECOND_ITEM, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText); + + res = getItem(myHwnd, 3, &cbexItem); + ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res); + ok(strcmp(THIRD_ITEM, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText); + + /* Set an item completely out of range */ + res = setItem(myHwnd, 99, REPLACEMENT_ITEM); + ok(res == 0, "Setting item using out of range index worked unexpectedly (%ld)\n", res); + res = setItem(myHwnd, 4, REPLACEMENT_ITEM); + ok(res == 0, "Setting item using out of range index worked unexpectedly (%ld)\n", res); + res = setItem(myHwnd, -2, REPLACEMENT_ITEM); + ok(res == 0, "Setting item using out of range index worked unexpectedly (%ld)\n", res); + + /* Set an item in range */ + res = setItem(myHwnd, 0, REPLACEMENT_ITEM); + ok(res != 0, "Setting first item failed (%ld)\n", res); + res = setItem(myHwnd, 3, REPLACEMENT_ITEM); + ok(res != 0, "Setting last item failed (%ld)\n", res); + + /* Remove items completely out of range (4 items in control at this point) */ + res = delItem(myHwnd, -1); + ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%ld)\n", res); + res = delItem(myHwnd, 4); + ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%ld)\n", res); + + /* Remove items in range (4 items in control at this point) */ + res = delItem(myHwnd, 3); + ok(res == 3, "Deleting using out of range index failed (%ld)\n", res); + res = delItem(myHwnd, 0); + ok(res == 2, "Deleting using out of range index failed (%ld)\n", res); + res = delItem(myHwnd, 0); + ok(res == 1, "Deleting using out of range index failed (%ld)\n", res); + res = delItem(myHwnd, 0); + ok(res == 0, "Deleting using out of range index failed (%ld)\n", res); + + /* Remove from an empty box */ + res = delItem(myHwnd, 0); + ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%ld)\n", res); + + + /* Cleanup */ + free(textBuffer); + +} + +LRESULT CALLBACK ComboExTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) { + + case WM_DESTROY: + PostQuitMessage(0); + break; + + default: + return DefWindowProcA(hWnd, msg, wParam, lParam); + } + + return 0L; +} + +static void init(void) { + WNDCLASSA wc; + INITCOMMONCONTROLSEX icex; + + icex.dwSize = sizeof(INITCOMMONCONTROLSEX); + icex.dwICC = ICC_USEREX_CLASSES; + InitCommonControlsEx(&icex); + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = GetModuleHandleA(NULL); + wc.hIcon = NULL; + wc.hCursor = LoadCursorA(NULL, MAKEINTRESOURCEA(IDC_ARROW)); + wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); + wc.lpszMenuName = NULL; + wc.lpszClassName = ComboExTestClass; + wc.lpfnWndProc = ComboExTestWndProc; + RegisterClassA(&wc); + + hComboExParentWnd = CreateWindowExA(0, ComboExTestClass, "ComboEx test", WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, 680, 260, NULL, NULL, GetModuleHandleA(NULL), 0); + assert(hComboExParentWnd != NULL); + + hMainHinst = GetModuleHandleA(NULL); + +} + +static void cleanup(void) +{ + MSG msg; + + PostMessageA(hComboExParentWnd, WM_CLOSE, 0, 0); + while (GetMessageA(&msg,0,0,0)) { + TranslateMessage(&msg); + DispatchMessageA(&msg); + } + + UnregisterClassA(ComboExTestClass, GetModuleHandleA(NULL)); +} + +START_TEST(comboex) +{ + init(); + + test_comboboxex(); + + cleanup(); +} diff -urN wine-20050830/dlls/comctl32/tests/subclass.c wine-20050930/dlls/comctl32/tests/subclass.c --- wine-20050830/dlls/comctl32/tests/subclass.c 2005-06-21 22:53:14.000000000 +0200 +++ wine-20050930/dlls/comctl32/tests/subclass.c 2005-09-09 17:20:05.000000000 +0200 @@ -234,7 +234,7 @@ ok_sequence(Sub_AfterDeletedTest, "After Deleted"); pSetWindowSubclass(hwnd, WndProcSub, 2, 0); - origProc3 = (WNDPROC)SetWindowLong(hwnd, GWL_WNDPROC, (LONG)WndProc3); + origProc3 = (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG)WndProc3); SendMessage(hwnd, WM_USER, 1, 0); SendMessage(hwnd, WM_USER, 2, 0); ok_sequence(Sub_OldAfterNewTest, "Old after New"); diff -urN wine-20050830/dlls/comctl32/tests/updown.c wine-20050930/dlls/comctl32/tests/updown.c --- wine-20050830/dlls/comctl32/tests/updown.c 2005-06-09 11:50:56.000000000 +0200 +++ wine-20050930/dlls/comctl32/tests/updown.c 2005-09-12 23:22:32.000000000 +0200 @@ -59,7 +59,7 @@ NULL, NULL, hinst, NULL); assert (hWndUpDown); /* set the buddy. */ - SendMessage (hWndUpDown, UDM_SETBUDDY, (LONG)hWndEdit, 0L ); + SendMessage (hWndUpDown, UDM_SETBUDDY, (WPARAM)hWndEdit, 0L ); /* set the range. */ SendMessage (hWndUpDown, UDM_SETRANGE, 0L, (LPARAM) MAKELONG(32000, 0)); /* maybe show it. */ diff -urN wine-20050830/dlls/comctl32/theming.c wine-20050930/dlls/comctl32/theming.c --- wine-20050830/dlls/comctl32/theming.c 2005-08-30 12:07:17.000000000 +0200 +++ wine-20050930/dlls/comctl32/theming.c 2005-09-12 13:10:58.000000000 +0200 @@ -147,6 +147,20 @@ } /*********************************************************************** + * THEMING_Uninitialize + * + * Unregister shadow classes for standard controls. + */ +void THEMING_Uninitialize (void) +{ + int i; + for (i = 0; i < NUM_SUBCLASSES; i++) + { + UnregisterClassW (subclasses[i].className, NULL); + } +} + +/*********************************************************************** * THEMING_CallOriginalClass * * Determines the original window proc and calls it. diff -urN wine-20050830/dlls/comctl32/toolbar.c wine-20050930/dlls/comctl32/toolbar.c --- wine-20050830/dlls/comctl32/toolbar.c 2005-08-30 12:07:17.000000000 +0200 +++ wine-20050930/dlls/comctl32/toolbar.c 2005-09-14 21:16:04.000000000 +0200 @@ -41,7 +41,6 @@ * - WM_WININICHANGE * - Notifications: * - NM_CHAR - * - NM_KEYDOWN * - TBN_GETOBJECT * - TBN_SAVE * - Button wrapping (under construction). @@ -1278,12 +1277,21 @@ btnPtr = infoPtr->buttons; x = infoPtr->nIndent; - /* this can get the parents width, to know how far we can extend - * this toolbar. We cannot use its height, as there may be multiple - * toolbars in a rebar control - */ - GetClientRect( GetParent(hwnd), &rc ); - infoPtr->nWidth = rc.right - rc.left; + if (GetParent(hwnd)) + { + /* this can get the parents width, to know how far we can extend + * this toolbar. We cannot use its height, as there may be multiple + * toolbars in a rebar control + */ + GetClientRect( GetParent(hwnd), &rc ); + infoPtr->nWidth = rc.right - rc.left; + } + else + { + GetWindowRect( hwnd, &rc ); + infoPtr->nWidth = rc.right - rc.left; + } + bButtonWrap = FALSE; TRACE("start ButtonWidth=%d, BitmapWidth=%d, nWidth=%d, nIndent=%d\n", @@ -2193,6 +2201,7 @@ WCHAR Buffer[256]; int i = 0; int index; + NMTBINITCUSTOMIZE nmtbic; infoPtr = custInfo->tbInfo; @@ -2202,10 +2211,9 @@ if (!TOOLBAR_SendNotify(&nmtb.hdr, infoPtr, TBN_QUERYINSERT)) return FALSE; - /* UNDOCUMENTED: dialog hwnd immediately follows NMHDR */ - memcpy(&nmtb.iItem, &hwnd, sizeof(hwnd)); + nmtbic.hwndDialog = hwnd; /* Send TBN_INITCUSTOMIZE notification */ - if (TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_INITCUSTOMIZE) == + if (TOOLBAR_SendNotify (&nmtbic.hdr, infoPtr, TBN_INITCUSTOMIZE) == TBNRF_HIDEHELP) { TRACE("TBNRF_HIDEHELP requested\n"); @@ -5783,6 +5791,77 @@ } +static void +TOOLBAR_SetRelativeHotItem(TOOLBAR_INFO *infoPtr, INT iDirection, DWORD dwReason) +{ + INT i; + INT nNewHotItem = infoPtr->nHotItem; + + for (i = 0; i < infoPtr->nNumButtons; i++) + { + /* did we wrap? */ + if ((nNewHotItem + iDirection < 0) || + (nNewHotItem + iDirection >= infoPtr->nNumButtons)) + { + NMTBWRAPHOTITEM nmtbwhi; + nmtbwhi.idNew = infoPtr->buttons[nNewHotItem].idCommand; + nmtbwhi.iDirection = iDirection; + nmtbwhi.dwReason = dwReason; + + if (TOOLBAR_SendNotify(&nmtbwhi.hdr, infoPtr, TBN_WRAPHOTITEM)) + return; + } + + nNewHotItem += iDirection; + nNewHotItem = (nNewHotItem + infoPtr->nNumButtons) % infoPtr->nNumButtons; + + if ((infoPtr->buttons[nNewHotItem].fsState & TBSTATE_ENABLED) && + !(infoPtr->buttons[nNewHotItem].fsStyle & BTNS_SEP)) + { + TOOLBAR_SetHotItemEx(infoPtr, nNewHotItem, dwReason); + break; + } + } +} + +static LRESULT +TOOLBAR_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam) +{ + TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); + NMKEY nmkey; + + nmkey.nVKey = (UINT)wParam; + nmkey.uFlags = HIWORD(lParam); + + if (TOOLBAR_SendNotify(&nmkey.hdr, infoPtr, NM_KEYDOWN)) + return DefWindowProcW(hwnd, WM_KEYDOWN, wParam, lParam); + + switch ((UINT)wParam) + { + case VK_LEFT: + case VK_UP: + TOOLBAR_SetRelativeHotItem(infoPtr, -1, HICF_ARROWKEYS); + break; + case VK_RIGHT: + case VK_DOWN: + TOOLBAR_SetRelativeHotItem(infoPtr, 1, HICF_ARROWKEYS); + break; + case VK_SPACE: + case VK_RETURN: + if ((infoPtr->nHotItem >= 0) && + (infoPtr->buttons[infoPtr->nHotItem].fsState & TBSTATE_ENABLED)) + { + SendMessageW (infoPtr->hwndNotify, WM_COMMAND, + MAKEWPARAM(infoPtr->buttons[infoPtr->nHotItem].idCommand, BN_CLICKED), + (LPARAM)hwnd); + } + break; + } + + return 0; +} + + static LRESULT TOOLBAR_LButtonDblClk (HWND hwnd, WPARAM wParam, LPARAM lParam) { @@ -6080,7 +6159,7 @@ if (btnPtr->fsState & TBSTATE_ENABLED) { SendMessageW (infoPtr->hwndNotify, WM_COMMAND, - MAKEWPARAM(infoPtr->buttons[nHit].idCommand, 0), (LPARAM)hwnd); + MAKEWPARAM(infoPtr->buttons[nHit].idCommand, BN_CLICKED), (LPARAM)hwnd); } } @@ -6320,6 +6399,7 @@ /* paranoid!! */ infoPtr->dwStructSize = sizeof(TBBUTTON); infoPtr->nRows = 1; + infoPtr->nWidth = 0; /* fix instance handle, if the toolbar was created by CreateToolbarEx() */ if (!GetWindowLongPtrW (hwnd, GWLP_HINSTANCE)) { @@ -6483,23 +6563,24 @@ TRACE("TBN_GETINFOTIPA - got string %s\n", debugstr_a(tbgit.pszText)); - len = -1 + MultiByteToWideChar(CP_ACP, 0, tbgit.pszText, -1, NULL, 0); - if (len > sizeof(lpnmtdi->szText)/sizeof(lpnmtdi->szText[0])-1) + len = MultiByteToWideChar(CP_ACP, 0, tbgit.pszText, -1, NULL, 0); + if (len > sizeof(lpnmtdi->szText)/sizeof(lpnmtdi->szText[0])) { /* need to allocate temporary buffer in infoPtr as there * isn't enough space in buffer passed to us by the * tooltip control */ - infoPtr->pszTooltipText = Alloc((len+1)*sizeof(WCHAR)); + infoPtr->pszTooltipText = Alloc(len*sizeof(WCHAR)); if (infoPtr->pszTooltipText) { - MultiByteToWideChar(CP_ACP, 0, tbgit.pszText, len+1, infoPtr->pszTooltipText, (len+1)*sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, tbgit.pszText, -1, infoPtr->pszTooltipText, len); lpnmtdi->lpszText = infoPtr->pszTooltipText; return 0; } } else if (len > 0) { - MultiByteToWideChar(CP_ACP, 0, tbgit.pszText, len+1, lpnmtdi->lpszText, (len+1)*sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, tbgit.pszText, -1, + lpnmtdi->lpszText, sizeof(lpnmtdi->szText)/sizeof(lpnmtdi->szText[0])); return 0; } } @@ -6639,6 +6720,21 @@ static LRESULT +TOOLBAR_SetFocus (HWND hwnd, WPARAM wParam) +{ + TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); + + TRACE("nHotItem = %d\n", infoPtr->nHotItem); + + /* make first item hot */ + if (infoPtr->nNumButtons > 0) + TOOLBAR_SetHotItemEx(infoPtr, 0, HICF_OTHER); + + return 0; +} + + +static LRESULT TOOLBAR_SetRedraw (HWND hwnd, WPARAM wParam, LPARAM lParam) /***************************************************** * @@ -7091,7 +7187,9 @@ case WM_GETFONT: return TOOLBAR_GetFont (hwnd, wParam, lParam); -/* case WM_KEYDOWN: */ + case WM_KEYDOWN: + return TOOLBAR_KeyDown (hwnd, wParam, lParam); + /* case WM_KILLFOCUS: */ case WM_LBUTTONDBLCLK: @@ -7139,6 +7237,9 @@ case WM_PAINT: return TOOLBAR_Paint (hwnd, wParam); + case WM_SETFOCUS: + return TOOLBAR_SetFocus (hwnd, wParam); + case WM_SETREDRAW: return TOOLBAR_SetRedraw (hwnd, wParam, lParam); diff -urN wine-20050830/dlls/comctl32/treeview.c wine-20050930/dlls/comctl32/treeview.c --- wine-20050830/dlls/comctl32/treeview.c 2005-08-30 12:07:17.000000000 +0200 +++ wine-20050930/dlls/comctl32/treeview.c 2005-09-13 00:07:53.000000000 +0200 @@ -775,8 +775,8 @@ wineItem->pszText = newText; MultiByteToWideChar( CP_ACP, 0, (LPSTR)callback.item.pszText, -1, - wineItem->pszText, buflen); - wineItem->cchTextMax = buflen; + wineItem->pszText, buflen/sizeof(WCHAR)); + wineItem->cchTextMax = buflen/sizeof(WCHAR); } /* If ReAlloc fails we have nothing to do, but keep original text */ } @@ -818,8 +818,8 @@ wineItem->pszText = newText; MultiByteToWideChar( CP_ACP, 0, (LPSTR)callback.item.pszText, -1, - wineItem->pszText, buflen); - wineItem->cchTextMax = buflen; + wineItem->pszText, buflen/sizeof(WCHAR)); + wineItem->cchTextMax = buflen/sizeof(WCHAR); if (oldText) Free(oldText); } diff -urN wine-20050830/dlls/commdlg/.cvsignore wine-20050930/dlls/commdlg/.cvsignore --- wine-20050830/dlls/commdlg/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/commdlg/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,8 +1,6 @@ 800.bmp Makefile cdrom.ico -comdlg32.dll.dbg.c -commdlg.spec.c floppy.ico folder.ico folder2.ico diff -urN wine-20050830/dlls/commdlg/cdlg32.c wine-20050930/dlls/commdlg/cdlg32.c --- wine-20050830/dlls/commdlg/cdlg32.c 2005-08-15 12:48:51.000000000 +0200 +++ wine-20050930/dlls/commdlg/cdlg32.c 2005-09-02 13:33:51.000000000 +0200 @@ -158,7 +158,7 @@ if (COMDLG32_TlsIndex == TLS_OUT_OF_INDEXES) COMDLG32_TlsIndex = TlsAlloc(); if (COMDLG32_TlsIndex != TLS_OUT_OF_INDEXES) - TlsSetValue(COMDLG32_TlsIndex, (void *)err); + TlsSetValue(COMDLG32_TlsIndex, (LPVOID)(DWORD_PTR)err); else FIXME("No Tls Space\n"); } @@ -176,7 +176,7 @@ DWORD WINAPI CommDlgExtendedError(void) { if (COMDLG32_TlsIndex != TLS_OUT_OF_INDEXES) - return (DWORD)TlsGetValue(COMDLG32_TlsIndex); + return (DWORD_PTR)TlsGetValue(COMDLG32_TlsIndex); else return 0; /* we never set an error, so there isn't one */ } diff -urN wine-20050830/dlls/commdlg/cdlg_Bg.rc wine-20050930/dlls/commdlg/cdlg_Bg.rc --- wine-20050830/dlls/commdlg/cdlg_Bg.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/commdlg/cdlg_Bg.rc 2005-09-19 19:00:59.000000000 +0200 @@ -0,0 +1,472 @@ +/* + * Copyright 2005 Milko Krachounov + * + * 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 + */ + +/* + * Òóê èçðè÷íî ïèøåøå äà íå ïèïàì íåùî, àìà àç ãî ïèïíàõ. + * Àêî èìà ïðîáëåìè íÿêîé äà ãè îïðàâè. + */ + +LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT + +OPEN_FILE DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Îòâîðè" +FONT 8, "MS Shell Dlg" +{ + LTEXT "&Èìå íà ôàéë:", 1090, 6, 6, 76, 9 + EDITTEXT edt1, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP + LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "&Äèðåêòîðèè:", -1, 110, 6, 92, 9 + LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP + LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "&Òèï ôàéëîâå:", 1089, 6, 104, 90, 9 + COMBOBOX cmb1, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + LTEXT "&Óñòðîéñòâà:", 1091, 110, 104, 92, 9 + COMBOBOX cmb2, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Îòâîðè", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Îòìåíè", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Ïîìîù", pshHelp, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "Ñàìî çà &÷åòåíå", chx1, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +} + + +SAVE_FILE DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ñúõðàíè êàòî ..." +FONT 8, "MS Shell Dlg" +{ + LTEXT "&Èìå íà ôàéë:", 1090, 6, 6, 76, 9 + EDITTEXT edt1, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP + LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "&Äèðåêòîðèè:", -1, 110, 6, 92, 9 + LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP + LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "&Òèï ôàéëîâå:", 1089, 6, 104, 90, 9 + COMBOBOX cmb1, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + LTEXT "&Óñòðîéñòâà:", 1091, 110, 104, 92, 9 + COMBOBOX cmb2, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Ñúõðàíè", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Îòìåíè", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Ïîìîù", pshHelp, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "Ñàìî çà &÷åòåíå", chx1, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +} + + +PRINT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ïå÷àò" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Ïðèíòåð:", 1088, 6, 6, 40, 9 + LTEXT "", 1089, 60, 6, 150, 9 + GROUPBOX "Ðàçïå÷àòàé", grp1, 6, 30, 160, 65, BS_GROUPBOX + RADIOBUTTON "&Âñè÷êî", rad1, 16, 45, 60, 12 + RADIOBUTTON "&Èçáðàíîòî", rad2, 16, 60, 60, 12 + RADIOBUTTON "&Ñòðàíèöè", rad3, 16, 75, 60, 12 + DEFPUSHBUTTON "Ðàçïå÷àòàé", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Îòìåíè", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Íàñòðîéêè", psh1, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP + LTEXT "&Îò:", 1090, 60, 80, 30, 9 + LTEXT "&Äî:", 1091, 120, 80, 30, 9 + LTEXT "&Êà÷åñòâî:", 1092, 6, 100, 76, 9 + COMBOBOX cmb1, 80, 100, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + CHECKBOX "Ïå÷àò âúâ &ôàéë", chx1, 20, 100, 60, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Ñãúñòåíî", chx2, 160, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +} + + +PRINT_SETUP DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Íàñòðîéêè íà ïå÷àòàíåòî" +FONT 8, "MS Shell Dlg" +{ + GROUPBOX "Ïðèíòåð", grp1, 6, 10, 180, 65, BS_GROUPBOX + RADIOBUTTON "Ïðèíòåð ïî ïîä&ðàçáèðàíå", rad1, 16, 20, 80, 12 + LTEXT "[íÿìà]", 1088, 35, 35, 120, 9 + RADIOBUTTON "Äðóã &ïðèíòåð", rad2, 16, 50, 80, 12 + COMBOBOX cmb1, 35, 65, 149, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Îòìåíè", IDCANCEL, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Íàñòðîéêè", psh1, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP + GROUPBOX "Îðèåíòàöèÿ", grp2, 6, 85, 100, 50, BS_GROUPBOX + RADIOBUTTON "Ïîð&òðåò", rad3, 50, 100, 40, 12 + RADIOBUTTON "Ïåéçà&æ", rad4, 50, 115, 40, 12 + ICON "LANDSCAP", stc10, 10, 95, 32, 32 + ICON "PORTRAIT", stc11, 10, 95, 32, 32 + GROUPBOX "Paper", grp3, 120, 85, 180, 50, BS_GROUPBOX + LTEXT "Ðàç&ìåð", 1089, 130, 95, 30, 9 + LTEXT "&Èçòî÷íèê", 1090, 130, 110, 30, 9 + COMBOBOX cmb2, 155, 95, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + COMBOBOX cmb3, 155, 110, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP +} + + +CHOOSE_FONT DIALOG DISCARDABLE 13, 54, 264, 147 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Øðèôò" +FONT 8, "MS Shell Dlg" +{ + LTEXT "&Øðèôò:",stc1 ,6,3,40,9 + COMBOBOX cmb1, 6,13,94,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | + CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE + LTEXT "&Ñòèë:",stc2 ,108,3,44,9 + COMBOBOX cmb2,108,13,64,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | + WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE + LTEXT "Ðà&çìåð:",stc3,179,3,30,9 + COMBOBOX cmb3,179,13,32,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | + WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE | CBS_SORT + DEFPUSHBUTTON "OK",IDOK,218,6,40,14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "Îòìåíè",IDCANCEL,218,23,40,14,WS_GROUP | WS_TABSTOP + PUSHBUTTON "Ïðè&ëîæè", psh3,218,40,40,14,WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Ïîìîù" , pshHelp,218,57,40,14,WS_GROUP | WS_TABSTOP + GROUPBOX "Åôåêòè",grp1,6,72,84,34,WS_GROUP + CHECKBOX "&Çà÷åðòàí", chx1, 10,82,50,10, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "Ïîä&÷åðòàí", chx2, 10,94,50,10, BS_AUTOCHECKBOX + LTEXT "&Öâÿò:", stc4 ,6,110,30,9 + COMBOBOX cmb4,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | + CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Ïðèìåð",grp2,98,72,120,36,WS_GROUP + CTEXT "AaBbYyZz",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE + LTEXT "&Àçáóêà:",stc7 ,98,114,40,9 + COMBOBOX cmb5,98,124,120,10,CBS_DROPDOWNLIST |CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | + CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP +} + + +CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 314, 185 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Öâÿò" +FONT 8, "MS Shell Dlg" +{ + LTEXT "&Îñíîâíè öâåòîâå:", 1088, 4, 4, 140, 10 + LTEXT "&Ïîòðåáèòåëñêè öâåòîâå:", 1089, 4, 106, 140, 10 + LTEXT "Öâÿò|&Ïëúòåí", 1090, 150, 151, 48, 10 + LTEXT "&×åðâåíî:", 726 /*1094*/,261,126,32,10 + EDITTEXT 706, 295,124,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Çåëåíî:",727/*1095*/,261,140,32,10 + EDITTEXT 707, 295,138,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Ñèíüî:",728 /*1096*/,261,154,32,10 + EDITTEXT 708, 295,152,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Òîí:" ,723 /*1091*/,197,126,42,10 + EDITTEXT 703, 241,124,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Íàñèòåíîñò:" ,724 /*1092*/,197,140,42,10 + EDITTEXT 704, 241,138,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Îñâåòåíîñò:" ,725 /*1093*/,197,154,42,10 + EDITTEXT 705, 241,152,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP + CONTROL "" ,720,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP,4,14,140,86 + CONTROL "" ,721,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP,4,116,140,28 + CONTROL "" ,710,"STATIC",WS_BORDER|SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,4,118,116 + CONTROL "" ,702,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 278,4,8,116 + CONTROL "" ,709,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,124,40,26 + DEFPUSHBUTTON "OK", 1, 4, 166, 44, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Îòìåíè", 2, 52, 166, 44, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Ïîìîù", pshHelp,100,166, 44, 14 + PUSHBUTTON "&Äîáàâè ïîòðåáèòåëñêè öâÿò", 712/*1024*/, 152, 166, 142, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Îïðåäåëè öâåòîâå >>", 719/*1025*/, 4, 150, 142, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Ï",713,300,200,4,14 /* just a dummy: 'Ï' is like &Ï in "&Ïëúòåí" */ +} + + +FINDDLGORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 281, 62 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Òúðñåíå" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Òúðñè &çà:", -1, 4, 8, 42, 8 + EDITTEXT edt1, 47, 7, 158, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP + CHECKBOX "&Ñàìî öåëè äóìè", chx1, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&×óâñòâèòåëåí ðåãèñòúð", chx2, 4, 42, 96, 12, BS_AUTOCHECKBOX | WS_TABSTOP + GROUPBOX "Ïîñîêà", grp1, 107, 26, 98, 28 + CONTROL "Íà&ãîðå", rad1, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 40, 12 + CONTROL "Íà&äîëó", rad2, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 158, 38, 40, 12 + + DEFPUSHBUTTON "&Íàìåðè ñëåäâàù", IDOK, 212, 5, 65, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "Îòìåíè", IDCANCEL , 212, 23, 65, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Ïîìîù", pshHelp , 212, 45, 65, 14, WS_GROUP | WS_TABSTOP +} + + +REPLACEDLGORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 281, 94 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Çàìÿíà" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Òúðñè &çà:", -1, 4, 9, 48, 8 + EDITTEXT edt1, 47, 7, 158, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "Çà&ìÿíà ñ:", -1, 4, 26, 48, 8 + EDITTEXT edt2, 47, 24, 158, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP + CHECKBOX "&Ñàìî öåëè äóìè", chx1, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&×óâñòâèòåëåí ðåãèñòúð", chx2, 5, 62, 100, 12, BS_AUTOCHECKBOX | WS_TABSTOP + + DEFPUSHBUTTON "&Íàìåðè ñëåäâàù", IDOK, 212, 4, 65, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "&Çàìåíè", psh1 , 212, 21, 65, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Çàìåíè &âñè÷êè", psh2 , 212, 38, 65, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Îòìÿíà", IDCANCEL , 212, 55, 65, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Ïîìîù", pshHelp , 212, 75, 65, 14, WS_GROUP | WS_TABSTOP +} + + +PRINT32 DIALOG LOADONCALL MOVEABLE DISCARDABLE 32, 32, 321, 186 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | + DS_CONTEXTHELP | DS_3DLOOK +CAPTION "Ïå÷àò" +FONT 8, "MS Shell Dlg" +{ + DEFPUSHBUTTON "OK", IDOK, 180,164, 48,14, WS_GROUP | BS_DEFPUSHBUTTON + PUSHBUTTON "Îòìåíè", IDCANCEL, 232,164, 48,14, WS_GROUP + PUSHBUTTON "&Ïîìîù", pshHelp, 50, 161, 48,14, WS_GROUP + + GROUPBOX "Ïðèíòåð", grp4, 8, 4, 305,84, WS_GROUP + CONTROL "Ïå÷àò âúâ &ôàéë", chx1, "Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,217,70,74,12 + PUSHBUTTON "Ñâî&éñòâà", psh2, 212, 17, 60,14, WS_GROUP + LTEXT "&Èìå:", stc6, 16, 20, 36,8 + COMBOBOX cmb4, 52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "Ñúñòîÿíèå:", stc8, 16, 36, 36,10, SS_NOPREFIX + LTEXT "Òåêñò", stc12, 57, 36, 219,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Òèï:", stc7, 16, 48, 36,10, SS_NOPREFIX + LTEXT "Òåêñò", stc11, 57, 48, 219,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Ìÿñòî:", stc10, 16, 60, 36,10, SS_NOPREFIX + LTEXT "Òåêñò", stc14, 57, 60, 219,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Êîìåíòàð:", stc9, 16, 72, 36,10, SS_NOPREFIX + LTEXT "Òåêñò", stc13, 57, 72, 152,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + + GROUPBOX "Êîïèÿ", grp2, 172, 92, 141,64, WS_GROUP + LTEXT "Áðîé &êîïèÿ:",stc5,180,108,68,8 + ICON "", ico3, 174,124, 76,24, WS_GROUP | SS_CENTERIMAGE + CONTROL "Ïîä&ðåæäàíå", chx2,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,252,130,57,12 + EDITTEXT edt3, 252,106, 32,12, WS_GROUP | ES_NUMBER + + GROUPBOX "Ðàçïå÷àòàé", grp1, 8,92, 156,64, WS_GROUP + CONTROL "&Âñè÷êî", rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,16,106,64,12 + CONTROL "&Ñòðàíèöè", rad3,"Button",BS_AUTORADIOBUTTON,16,122,48,12 + CONTROL "&Èçáðàíîòî", rad2,"Button",BS_AUTORADIOBUTTON,16,138,64,12 + EDITTEXT edt1, 86,122, 26,12, WS_GROUP | ES_NUMBER + EDITTEXT edt2, 130,122, 26,12, WS_GROUP | ES_NUMBER + RTEXT "&îò:", stc2, 64,124, 20,8 + RTEXT "&äî:", stc3, 112,124, 16,8 +} + +PRINT32_SETUP DIALOG LOADONCALL MOVEABLE DISCARDABLE 32, 32, 288, 178 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | + DS_CONTEXTHELP | DS_3DLOOK +CAPTION "Íàñòðîéêè íà ïå÷àòàíåòî" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,180,156,48,14,WS_GROUP + PUSHBUTTON "Îòìåíè",IDCANCEL,232,156,48,14 +/* PUSHBUTTON "Ìðåæà...", psh5, 284,156,48,14 */ + + GROUPBOX "Ïðèíòåð", grp4, 8, 4, 272,84, WS_GROUP + PUSHBUTTON "Ñâî&éñòâà", psh2, 212, 17, 60,14, WS_GROUP + LTEXT "&Èìå:", stc6, 16, 20, 36,8 + COMBOBOX cmb1, 52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "Ñúñòîÿíèå:", stc8, 16, 36, 36,10, SS_NOPREFIX + LTEXT "Òåêñò", stc12, 57, 36, 219,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Òèï:", stc7, 16, 48, 36,10, SS_NOPREFIX + LTEXT "Òåêñò", stc11, 57, 48, 219,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Ìÿñòî:", stc10, 16, 60, 36,10, SS_NOPREFIX + LTEXT "Òåêñò", stc14, 57, 60, 219,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Êîìåíòàð:", stc9, 16, 72, 36,10, SS_NOPREFIX + LTEXT "Òåêñò", stc13, 57, 72, 219,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + + GROUPBOX "Õàðòèÿ", grp2, 8, 92, 164,56, WS_GROUP + LTEXT "Ðàç&ìåð:", stc2, 16,108, 36, 8 + COMBOBOX cmb2, 52,106, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "&Èçòî÷íèê:", stc3, 16,128, 36, 8 + COMBOBOX cmb3, 52,126, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + + GROUPBOX "Îðèåíòàöèÿ", grp1, 180, 92, 100,56, WS_GROUP + ICON "", ico1, 195,112, 18,20, WS_GROUP + CONTROL "Ïîð&òðåò", rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP |WS_TABSTOP,224,106,52,12 + CONTROL "Ïåéçà&æ", rad2,"Button",BS_AUTORADIOBUTTON,224,126,52,12 +END + +PAGESETUPDLGORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 32, 32, 240, 240 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Íàñòðîéêè íà ñòðàíèöàòà" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80 + CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80 + CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4 + GROUPBOX "Õàðòèÿ", grp2, 8, 96, 224, 56, BS_GROUPBOX + LTEXT "Ðàç&ìåð:", stc2, 16, 112, 36, 8 + COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL + LTEXT "&Êîíòåéíåð:", stc3, 16, 132, 36, 8 + COMBOBOX cmb3, 64, 130, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL + GROUPBOX "Îðèåíòàöèÿ", grp1, 8, 156, 64, 56, BS_GROUPBOX + AUTORADIOBUTTON "Ïîð&òðåò", rad1, 16, 170, 52, 12, BS_AUTORADIOBUTTON + AUTORADIOBUTTON "Ïåéçà&æ", rad2, 16, 190, 52, 12, BS_AUTORADIOBUTTON + GROUPBOX "Ðàìêè", grp4, 80, 156, 152, 56, BS_GROUPBOX + LTEXT "&Ëÿâà:", stc15, 88, 172, 21, 8 + EDITTEXT edt4, 111, 170, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + LTEXT "&Äÿñíà:", stc16, 159, 172, 27, 8 + EDITTEXT edt6, 187, 170, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + LTEXT "&Ãîðíà:", stc17, 88, 192, 21, 8 + EDITTEXT edt5, 111, 190, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + LTEXT "Ä&îëíà:", stc18, 159, 192, 23, 8 + EDITTEXT edt7, 187, 190, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + DEFPUSHBUTTON "OK", IDOK, 71, 220, 50, 14, BS_PUSHBUTTON + PUSHBUTTON "Îòìåíè", IDCANCEL, 126, 220, 50, 14 + PUSHBUTTON "&Ïðèíòåð...", psh3, 184, 220, 48, 14 +END + +NEWFILEOPENORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 280, 164 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN +CAPTION "Îòâîðè" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Ì&ÿñòî:",IDC_LOOKINSTATIC,4,6,43,8, SS_NOTIFY + COMBOBOX IDC_LOOKIN,49,3,132,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + + LTEXT "" , IDC_TOOLBARSTATIC, 181, 2, 102, 17, NOT WS_GROUP | NOT WS_VISIBLE + LISTBOX IDC_SHELLSTATIC,4,20,272,85, LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | WS_HSCROLL | NOT WS_VISIBLE + + LTEXT "&Èìå íà ôàéë:",IDC_FILENAMESTATIC,5,112,46,8, SS_NOTIFY + EDITTEXT IDC_FILENAME,54,110,155,12,ES_AUTOHSCROLL + + LTEXT "&Òèï ôàéëîâå:",IDC_FILETYPESTATIC,5,128,42,8, SS_NOTIFY + COMBOBOX IDC_FILETYPE,54,126,155,53,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + CONTROL "Ñàìî çà &÷åòåíå",IDC_OPENREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,145,100,10 + + DEFPUSHBUTTON "&Îòâîðè", IDOK,222,110,50,14 + PUSHBUTTON "Îòìåíè", IDCANCEL,222,128,50,14 + PUSHBUTTON "&Ïîìîù", pshHelp,222,145,50,14 +} + +STRINGTABLE DISCARDABLE +{ + IDS_ABOUTBOX "&Îòíîñíî FolderPicker òåñòà" + IDS_DOCUMENTFOLDERS "Ïàïêè ñ äîêóìåíòè" + IDS_PERSONAL "Ìîèòå äîêóìåíòè" + IDS_FAVORITES "Îòìåòêè" + IDS_PATH "Ñèñòåìåí ïúò" + IDS_DESKTOP "Ðàáîòåí ïëîò" + IDS_FONTS "Øðèôòîâå" + IDS_MYCOMPUTER "Ìîÿ êîìïþòúð" +} + +STRINGTABLE DISCARDABLE +{ + IDS_SYSTEMFOLDERS "Ñèñòåìíè ïàïêè" + IDS_LOCALHARDRIVES "Ëîêàëíè óñòðîéñòâà" + IDS_FILENOTFOUND "Ôàéëúò íå å íàìåðåí" + IDS_VERIFYFILE "Ïðîâåðåòå äàëè ñòå âúâåëè ïðàâèëíî èìåòî íà ôàéëà" + IDS_CREATEFILE "Ôàéëúò íå ñúùåñòâóâà.\nÈñêàòå ëè äà ãî ñúçäàäåòå?" + IDS_OVERWRITEFILE "Ôàéëúò âå÷å ñúùåñòâóâà.\nÈñêàòå ëè äà ãî çàìåíèòå?" + IDS_INVALID_FILENAME_TITLE "Íåâàëèäíè çíàöè â ïúòÿ" + IDS_INVALID_FILENAME "Èìåòî íà ôàéëà íå ìîæå äà ñúäúðæà ñëåäíèòå ñèìâîëè: \n / : < > |" + IDS_PATHNOTEXISTING "Ïúòÿò íå ñúùåñòâóâà" + IDS_FILENOTEXISTING "Ôàéëúò íå ñúùåñòâóâà" +} + +STRINGTABLE DISCARDABLE +{ + IDS_UPFOLDER "Åäíî íèâî íàãîðå" + IDS_NEWFOLDER "Ñúçäàé íîâà ïàïêà" + IDS_LISTVIEW "Ñïèñúê" + IDS_REPORTVIEW "Ïîäðîáíîñòè" + IDS_TODESKTOP "Ïðåìèíè êúì ðàáîòíèÿ ïëîò" +} + +STRINGTABLE DISCARDABLE +{ + PD32_PRINT_TITLE "Ïå÷àò" + + PD32_VALUE_UREADABLE "Íå÷åòèì åëåìåíò" + PD32_INVALID_PAGE_RANGE "Íåâàëèäåí íîìåð íà ñòðàíèöà.\n\ +Èçïîëçâàéòå ñòîéíîñòè ìåæäó %d è %d." + PD32_FROM_NOT_ABOVE_TO "Ñòîéíîñòòà 'îò' íå ìîæå äà å ïî-ãîëÿìà îò \ +ñòîéíîñòòà 'äî'." + PD32_MARGINS_OVERLAP "Ãðàíèöèòå ñå ïðåïîêðèâàò èëè èçëèçàò èçâúí \ +êðàÿ íà ñòðàíèöàòà.\nÊîðèãèðàéòå ãè." + PD32_NR_OF_COPIES_EMPTY "Òðÿáâà äà âúâåäåòå áðîé êîïèÿ, êîèòî \ +äà áúäàò îòïå÷àòàíè." + PD32_TOO_LARGE_COPIES "Âúâåëè ñòå ïî-ãîëÿì áðîé êîïèÿ, îòêîëêîòî \ +âàøèÿò ïðèíòåð ïîääúðæà.\nÂúâåäåòå ÷èñëî ìåæäó 1 è %d." + PD32_PRINT_ERROR "Ïîÿâè ñå ãðåøêà ïðè ïå÷àòàíåòî." + PD32_NO_DEFAULT_PRINTER "Íå å çàäàäåí ïðèíòåð ïî ïîäðàçáèðàíå." + PD32_CANT_FIND_PRINTER "Ïðèíòåðúò íå ìîæå äà áúäå íàìåðåí." + PD32_OUT_OF_MEMORY "Íåäîñòèã íà ïàìåò." + PD32_GENERIC_ERROR "Ïîÿâè ñå ãðåøêà." + PD32_DRIVER_UNKNOWN "Íåïîçíàò äðàéâåð çà ïðèíòåðà." + + PD32_DEFAULT_PRINTER "Ïðèíòåð ïî ïîäðàçáèðàíå; " + PD32_NR_OF_DOCUMENTS_IN_QUEUE "Èìà %d äîêóìåíòà â îïàøêàòà" + PD32_MARGINS_IN_INCHES "Ãðàíèöè [èí÷îâå]" + PD32_MARGINS_IN_MILIMETERS "Ãðàíèöè [ìì]" + PD32_MILIMETERS "ìì" + + PD32_PRINTER_STATUS_READY "Ãîòîâî" + PD32_PRINTER_STATUS_PAUSED "Ïðåóñòàíîâåíî; " + PD32_PRINTER_STATUS_ERROR "Ãðåøêà; " + PD32_PRINTER_STATUS_PENDING_DELETION "Ïðåäñòîÿùî èçòðèâàíå; " + PD32_PRINTER_STATUS_PAPER_JAM "Çàäðúñòâàíå íà õàðòèÿòà; " + PD32_PRINTER_STATUS_PAPER_OUT "Íÿìà õàðòèÿ; " + PD32_PRINTER_STATUS_MANUAL_FEED "Ïîñòàâåòå õàðòèÿ ðú÷íî; " + PD32_PRINTER_STATUS_PAPER_PROBLEM "Ïðîáëåì ñ õàðòèÿòà; " + PD32_PRINTER_STATUS_OFFLINE "Ïðèíòåðà èçêëþ÷åí; " + PD32_PRINTER_STATUS_IO_ACTIVE "Âõîä/Èçõîä àêòèâåí; " + PD32_PRINTER_STATUS_BUSY "Çàåò; " + PD32_PRINTER_STATUS_PRINTING "Ïå÷àòè; " + PD32_PRINTER_STATUS_OUTPUT_BIN_FULL "Èçõîäíèÿ êîíòåéíåð å ïúëåí; " + PD32_PRINTER_STATUS_NOT_AVAILABLE "Íå å íàëè÷åí; " + PD32_PRINTER_STATUS_WAITING "Èç÷àêâàíå; " + PD32_PRINTER_STATUS_PROCESSING "Îáðàáîòêà; " + PD32_PRINTER_STATUS_INITIALIZING "Ïîäãîòîâêà; " + PD32_PRINTER_STATUS_WARMING_UP "Çàãðÿâàíå; " + PD32_PRINTER_STATUS_TONER_LOW "Òîíåðà íà ïðèâúðøâàíå; " + PD32_PRINTER_STATUS_NO_TONER "Íÿìà òîíåð; " + PD32_PRINTER_STATUS_PAGE_PUNT "Ïîäàâàíå íà õàðòèÿòà; " + PD32_PRINTER_STATUS_USER_INTERVENTION "Ïðåêúñíàòî îò ïîòðåáèòåëÿ; " + PD32_PRINTER_STATUS_OUT_OF_MEMORY "Íåäîñòèã íà ïàìåò; " + PD32_PRINTER_STATUS_DOOR_OPEN "Êàïàêà íà ïðèíòåðà å îòâîðåí; " + PD32_PRINTER_STATUS_SERVER_UNKNOWN "Íåèçâåñòåí ïðèíòåð ñúðâúð; " + PD32_PRINTER_STATUS_POWER_SAVE "Ðåæèì íà ïåñòåíå íà åíåðãèÿ; " +} + +STRINGTABLE DISCARDABLE /* Color names */ +{ + IDS_COLOR_BLACK "×åðíî" + IDS_COLOR_MAROON "Øàòåí" /* Maroon? ×åðâåíèêàâî êàôÿâ? */ + IDS_COLOR_GREEN "Çåëåí" + IDS_COLOR_OLIVE "Ìàñëèíåí" + IDS_COLOR_NAVY "Òúìíîñèí" + IDS_COLOR_PURPLE "Ìîðàâ" + IDS_COLOR_TEAL "Ñèíüîçåëåí" + IDS_COLOR_GRAY "Ñèâ" + IDS_COLOR_SILVER "Ñðåáúðåí" + IDS_COLOR_RED "×åðâåí" + IDS_COLOR_LIME "Æúëòîçåëåí" /* Áÿõ ãî êðúñòèë Ëèìîíåí, íî ìè óáèõà äåòñêèòå ìå÷òè, ëèìîíà íå áèë æúëòîçåëåí */ + IDS_COLOR_YELLOW "Æúëò" + IDS_COLOR_BLUE "Ñèí" + IDS_COLOR_FUCHSIA "Ïóðïóðåí" /* Áàõ'ìààìó */ + IDS_COLOR_AQUA "Àêâàìàðèí" /* Çåëåíîñèí */ + IDS_COLOR_WHITE "Áÿëî" +} + +STRINGTABLE DISCARDABLE +{ + IDS_FONT_SIZE "Èçáåðåòå ðàçìåð íà øðèôòà ìåæäó %d è %d ïóíêòà." + IDS_SAVE_BUTTON "&Ñúõðàíè" + IDS_SAVE_IN "Ñúõðàíè &â:" + IDS_SAVE "Ñúõðàíè" + IDS_SAVE_AS "Ñúõðàíè êàòî" + IDS_OPEN_FILE "Îòâîðè ôàéë" +} diff -urN wine-20050830/dlls/commdlg/cdlg_Fi.rc wine-20050930/dlls/commdlg/cdlg_Fi.rc --- wine-20050830/dlls/commdlg/cdlg_Fi.rc 2004-08-24 20:33:03.000000000 +0200 +++ wine-20050930/dlls/commdlg/cdlg_Fi.rc 2005-09-29 12:33:55.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright 1995 Jukka Iivonen + * Copyright 2005 Kimmo Myllyvirta * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,19 +29,19 @@ FONT 8, "MS Shell Dlg" { LTEXT "Tiedosto&nimi:", 1090, 6, 6, 76, 9 - EDITTEXT 1152, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP + EDITTEXT edt1, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP LTEXT "&Hakemistot:", -1, 110, 6, 92, 9 LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP LTEXT "&Luettele tiedostot tyypeittäin:", 1089, 6, 104, 90, 9 - COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + COMBOBOX cmb1, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP LTEXT "&Asemat:", 1091, 110, 104, 92, 9 - COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Avaa", IDOK, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Peruuta", IDCANCEL, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Ohje", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP - CHECKBOX "&Vain luku", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + COMBOBOX cmb2, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Avaa", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Peruuta", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Ohje", pshHelp, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "&Vain luku", chx1, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP } @@ -50,19 +51,19 @@ FONT 8, "MS Shell Dlg" { LTEXT "Tiedosto&nimi:", 1090, 6, 6, 76, 9 - EDITTEXT 1152, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP + EDITTEXT edt1, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP LTEXT "&Hakemistot:", -1, 110, 6, 92, 9 LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP LTEXT "Tallenna tiedosto &muodossa:", 1089, 6, 104, 90, 9 - COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + COMBOBOX cmb1, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP LTEXT "&Asemat:", 1091, 110, 104, 92, 9 - COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Tallenna", IDOK, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Peruuta", IDCANCEL, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Ohje", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP - CHECKBOX "&Vain luku", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + COMBOBOX cmb2, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Tallenna", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Peruuta", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Ohje", pshHelp, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "&Vain luku", chx1, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP } @@ -73,19 +74,19 @@ { LTEXT "Kirjoitin:", 1088, 6, 6, 40, 9 LTEXT "", 1089, 60, 6, 150, 9 - GROUPBOX "Tulostusalue", 1072, 6, 30, 160, 65, BS_GROUPBOX - RADIOBUTTON "&Kaikki", 1056, 16, 45, 60, 12 - RADIOBUTTON "&Valinta", 1057, 16, 60, 60, 12 - RADIOBUTTON "&Sivut", 1058, 16, 75, 60, 12 - DEFPUSHBUTTON "Tulosta", IDOK, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Peruuta", IDCANCEL, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Asetukset", 1024, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP + GROUPBOX "Tulostusalue", grp1, 6, 30, 160, 65, BS_GROUPBOX + RADIOBUTTON "&Kaikki", rad1, 16, 45, 60, 12 + RADIOBUTTON "&Valinta", rad2, 16, 60, 60, 12 + RADIOBUTTON "&Sivut", rad3, 16, 75, 60, 12 + DEFPUSHBUTTON "Tulosta", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Peruuta", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Asetukset", psh1, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP LTEXT "&Mistä:", 1090, 60, 80, 30, 9 LTEXT "Mi&hin:", 1091, 120, 80, 30, 9 LTEXT "&Tulostustarkkuus:", 1092, 6, 100, 76, 9 - COMBOBOX 1136, 80, 100, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - CHECKBOX "Tulosta t&iedostoon", 1040, 20, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "Tiivistetty", 1041, 160, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + COMBOBOX cmb1, 80, 100, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + CHECKBOX "Tulosta t&iedostoon", chx1, 20, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Tiivistetty", chx2, 160, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP } @@ -94,24 +95,24 @@ CAPTION "Kirjoittimen asetukset" FONT 8, "MS Shell Dlg" { - GROUPBOX "Kirjoitin", 1072, 6, 10, 180, 65, BS_GROUPBOX - RADIOBUTTON "O&letuskirjoitin", 1056, 16, 20, 80, 12 + GROUPBOX "Kirjoitin", grp1, 6, 10, 180, 65, BS_GROUPBOX + RADIOBUTTON "O&letuskirjoitin", rad1, 16, 20, 80, 12 LTEXT "[ei valittu]", 1088, 35, 35, 120, 9 - RADIOBUTTON "&Erityinen kirjoitin", 1057, 16, 50, 80, 12 - COMBOBOX 1136, 35, 65, 149, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + RADIOBUTTON "&Erityinen kirjoitin", rad2, 16, 50, 80, 12 + COMBOBOX cmb1, 35, 65, 149, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP PUSHBUTTON "Peruuta", IDCANCEL, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Asetukset...", 1024, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP - GROUPBOX "Suunta", 1073, 6, 85, 100, 50, BS_GROUPBOX - RADIOBUTTON "&Pysty", 1058, 50, 100, 40, 12 - RADIOBUTTON "&Vaaka", 1059, 50, 115, 40, 12 - ICON "LANDSCAP", 1097, 10, 95, 32, 32 - ICON "PORTRAIT", 1098, 10, 95, 32, 32 - GROUPBOX "Paperi", 1074, 120, 85, 180, 50, BS_GROUPBOX + PUSHBUTTON "&Asetukset...", psh1, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP + GROUPBOX "Suunta", grp2, 6, 85, 100, 50, BS_GROUPBOX + RADIOBUTTON "&Pysty", rad3, 50, 100, 40, 12 + RADIOBUTTON "&Vaaka", rad4, 50, 115, 40, 12 + ICON "LANDSCAP", stc10, 10, 95, 32, 32 + ICON "PORTRAIT", stc11, 10, 95, 32, 32 + GROUPBOX "Paperi", grp3, 120, 85, 180, 50, BS_GROUPBOX LTEXT "&Koko:", 1089, 130, 95, 30, 9 LTEXT "Lä&hde:", 1090, 130, 110, 30, 9 - COMBOBOX 1137, 155, 95, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - COMBOBOX 1138, 155, 110, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + COMBOBOX cmb2, 155, 95, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + COMBOBOX cmb3, 155, 110, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP } @@ -120,24 +121,24 @@ CAPTION "Fontit" FONT 8, "MS Shell Dlg" { - LTEXT "&Fontti:",1088 ,6,3,40,9 - COMBOBOX 1136 ,6,13,94,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | + LTEXT "&Fontti:", stc1 ,6,3,40,9 + COMBOBOX cmb1,6,13,94,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE - LTEXT "Fonttit&yyli:",1089 ,108,3,44,9 - COMBOBOX 1137,108,13,64,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | + LTEXT "Fonttit&yyli:", stc2 ,108,3,44,9 + COMBOBOX cmb2,108,13,64,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE - LTEXT "&Koko:",1090,179,3,30,9 - COMBOBOX 1138,179,13,32,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | + LTEXT "&Koko:", stc3,179,3,30,9 + COMBOBOX cmb3,179,13,32,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE | CBS_SORT DEFPUSHBUTTON "OK",IDOK,218,6,40,14,WS_GROUP - PUSHBUTTON "Peruuta",IDCANCEL,218,23,40,14,WS_GROUP - PUSHBUTTON "&Sovella", 1026,218,40,40,14,WS_GROUP - PUSHBUTTON "&Ohje" , 1038,218,57,40,14,WS_GROUP - GROUPBOX "Efektit",1072,6,72,84,34,WS_GROUP - CHECKBOX "Yli&viivattu", 1040, 10,82,50,10, BS_AUTOCHECKBOX | WS_TABSTOP - CHECKBOX "A&lleviivattu", 1041, 10,94,50,10, BS_AUTOCHECKBOX - LTEXT "V&äri:", 1091 ,6,110,30,9 - COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | + PUSHBUTTON "Peruuta", IDCANCEL,218,23,40,14,WS_GROUP + PUSHBUTTON "&Ota käyttöön", psh3,218,40,40,14,WS_GROUP + PUSHBUTTON "&Ohje" , pshHelp,218,57,40,14,WS_GROUP + GROUPBOX "Efektit", grp1,6,72,84,34,WS_GROUP + CHECKBOX "Yli&viivattu", chx1, 10,82,50,10, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "A&lleviivattu", chx2, 10,94,50,10, BS_AUTOCHECKBOX + LTEXT "V&äri:", stc4 ,6,110,30,9 + COMBOBOX cmb4,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP GROUPBOX "Näyte",grp2,98,72,120,36,WS_GROUP CTEXT "AaBbYyZz",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE @@ -152,9 +153,9 @@ CAPTION "Väri" FONT 8, "MS Shell Dlg" { - LTEXT "Pe&rusvärit:", 1088, 4, 4, 140, 10 + LTEXT "Pe&rusvärit:", 1088, 4, 4, 140, 10 LTEXT "&Muokatut värit:", 1089, 4, 106, 140, 10 - LTEXT "Väri|&Tasainen", 1090, 150, 151, 48, 10 + LTEXT "Väri|&Tasainen", 1090, 150, 151, 48, 10 LTEXT "&Pun:", 726 /*1094*/,249,126,24,10 EDITTEXT 706, 275,124,18,12, WS_BORDER | WS_GROUP | WS_TABSTOP LTEXT "&Vihr:",727/*1095*/,249,140,24,10 @@ -172,11 +173,11 @@ CONTROL "" ,710,"STATIC",WS_BORDER|SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,4,118,116 CONTROL "" ,702,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 278,4,8,116 CONTROL "" ,709,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,124,40,26 - DEFPUSHBUTTON "Ok", IDOK, 4, 166, 44, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "S&ulje", IDCANCEL, 52, 166, 44, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "O&hje", 1038,100,166, 44, 14 - PUSHBUTTON "&Lisää väri", 712/*1024*/, 152, 166, 142, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "M&äärittele väri >>", 719/*1025*/, 4, 150, 142, 14, WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "Ok", 1, 4, 166, 44, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "S&ulje", 2, 52, 166, 44, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "O&hje", pshHelp,100,166, 44, 14 + PUSHBUTTON "&Lisää väri", 712/*1024*/, 152, 166, 142, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "M&äärittele väri >>", 719/*1025*/, 4, 150, 142, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&i",713,300,200,4,14 /* just a dummy: 'i' is like &i in "sol&id" */ } @@ -187,15 +188,16 @@ FONT 8, "MS Shell Dlg" { LTEXT "&Etsittävä:", -1, 4, 8, 42, 8 - EDITTEXT 1152, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP - CHECKBOX "&Koko sana", 1040, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "Kirjaink&oko", 1041, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP - GROUPBOX "Suunta", 1072, 107, 26, 68, 28 - CONTROL "&Ylös", 1056, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12 - CONTROL "&Alas", 1057, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12 + EDITTEXT edt1, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP + CHECKBOX "&Koko sana", chx1, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Kirjaink&oko", chx2, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP + GROUPBOX "Suunta", grp1, 107, 26, 68, 28 + CONTROL "&Ylös", rad1, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 30, 12 + CONTROL "&Alas", rad2, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 148, 38, 30, 12 + DEFPUSHBUTTON "Etsi &seuraava", IDOK, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "Peruuta", IDCANCEL, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "O&hje", 1038, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Peruuta", IDCANCEL, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "O&hje", pshHelp, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP } @@ -205,14 +207,260 @@ FONT 8, "MS Shell Dlg" { LTEXT "&Etsittävä:", -1, 4, 9, 48, 8 - EDITTEXT 1152, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP + EDITTEXT edt1, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP LTEXT "Ko&rvattava:", -1, 4, 26, 48, 8 - EDITTEXT 1153, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP - CHECKBOX "&Koko sana", 1040, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "Kirjaink&oko", 1041, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_TABSTOP + EDITTEXT edt2, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP + CHECKBOX "&Koko sana", chx1, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Kirjaink&oko", chx2, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_TABSTOP + DEFPUSHBUTTON "Etsi &seuraava", IDOK, 174, 4, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Korv&aa", 1024, 174, 21, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "Korvaa ka&ikki", 1025, 174, 38, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "S&ulje", IDCANCEL, 174, 55, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "O&hje", 1038, 174, 75, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Korv&aa", psh1 , 174, 21, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Korvaa ka&ikki", psh2 , 174, 38, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "S&ulje", IDCANCEL , 174, 55, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "O&hje", pshHelp , 174, 75, 50, 14, WS_GROUP | WS_TABSTOP +} + +PRINT32 DIALOG LOADONCALL MOVEABLE DISCARDABLE 32, 32, 288, 186 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | + DS_CONTEXTHELP | DS_3DLOOK +CAPTION "Tulosta" +FONT 8, "MS Shell Dlg" +{ + DEFPUSHBUTTON "OK", IDOK, 180,164, 48,14, WS_GROUP | BS_DEFPUSHBUTTON + PUSHBUTTON "Peruuta", IDCANCEL, 232,164, 48,14, WS_GROUP + PUSHBUTTON "Oh&je", pshHelp, 50, 161, 48,14, WS_GROUP + + GROUPBOX "Tulostin", grp4, 8, 4, 272,84, WS_GROUP + CONTROL "&Tulosta tiedostoon", chx1, "Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,207,70,70,12 + PUSHBUTTON "&Ominaisuudet", psh2, 212, 17, 60,14, WS_GROUP + LTEXT "&Nimi:", stc6, 16, 20, 36,8 + COMBOBOX cmb4, 52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "Tila:", stc8, 16, 36, 36,10, SS_NOPREFIX + LTEXT "Dummy State", stc12, 52, 36, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Tyyppi:", stc7, 16, 48, 36,10, SS_NOPREFIX + LTEXT "Dummy Type", stc11, 52, 48, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Sijainti:", stc10, 16, 60, 36,10, SS_NOPREFIX + LTEXT "Dummy Location", stc14, 52, 60, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Kommentti:", stc9, 16, 72, 36,10, SS_NOPREFIX + LTEXT "Dummy Remark", stc13, 52, 72, 152,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + + GROUPBOX "Kopioita", grp2, 160, 92, 120,64, WS_GROUP + LTEXT "Kopioiden &määrä:", stc5,168,108,68,8 + ICON "", ico3, 162,124, 76,24, WS_GROUP | SS_CENTERIMAGE + CONTROL "&Kokoa", chx2,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,240,130,36,12 + EDITTEXT edt3, 240,106, 32,12, WS_GROUP | ES_NUMBER + + GROUPBOX "Tulosta alueelta", grp1, 8,92, 144,64, WS_GROUP + CONTROL "K&aikki", rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,16,106,64,12 + CONTROL "&Sivut", rad3,"Button",BS_AUTORADIOBUTTON,16,122,36,12 + CONTROL "&Valinta", rad2,"Button",BS_AUTORADIOBUTTON,16,138,64,12 + EDITTEXT edt1, 70,122, 26,12, WS_GROUP | ES_NUMBER + EDITTEXT edt2, 118,122, 26,12, WS_GROUP | ES_NUMBER + RTEXT "M&istä:", stc2, 48,124, 20,8 + RTEXT "Mi&hin:", stc3, 98,124, 20,8 +} + +PRINT32_SETUP DIALOG LOADONCALL MOVEABLE DISCARDABLE 32, 32, 288, 178 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | + DS_CONTEXTHELP | DS_3DLOOK +CAPTION "Tulostuksen Asetukset" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,180,156,48,14,WS_GROUP + PUSHBUTTON "Peruuta",IDCANCEL,232,156,48,14 +/* PUSHBUTTON "Verkko...", psh5, 284,156,48,14 */ + + GROUPBOX "Tulostin", grp4, 8, 4, 272,84, WS_GROUP + PUSHBUTTON "&Ominaisuudet", psh2, 212, 17, 60,14, WS_GROUP + LTEXT "&Nimi:", stc6, 16, 20, 36,8 + COMBOBOX cmb1, 52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "Tila:", stc8, 16, 36, 36,10, SS_NOPREFIX + LTEXT "Dummy State", stc12, 52, 36, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Tyyppi:", stc7, 16, 48, 36,10, SS_NOPREFIX + LTEXT "Dummy Type", stc11, 52, 48, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Sijainti:", stc10, 16, 60, 36,10, SS_NOPREFIX + LTEXT "Dummy Location", stc14, 52, 60, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Kommentti:", stc9, 16, 72, 36,10, SS_NOPREFIX + LTEXT "Dummy Remark", stc13, 52, 72, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + + GROUPBOX "Paperi", grp2, 8, 92, 164,56, WS_GROUP + LTEXT "&Koko:", stc2, 16,108, 36, 8 + COMBOBOX cmb2, 52,106, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "&Lähde:", stc3, 16,128, 36, 8 + COMBOBOX cmb3, 52,126, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + + GROUPBOX "Suunta", grp1, 180, 92, 100,56, WS_GROUP + ICON "", ico1, 195,112, 18,20, WS_GROUP + CONTROL "&Pysty", rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP |WS_TABSTOP,224,106,52,12 + CONTROL "V&aaka", rad2,"Button",BS_AUTORADIOBUTTON,224,126,52,12 +END + +PAGESETUPDLGORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 32, 32, 240, 240 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Sivun Asetukset" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80 + CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80 + CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4 + GROUPBOX "Paperi", grp2, 8, 96, 224, 56, BS_GROUPBOX + LTEXT "&Koko:", stc2, 16, 112, 36, 8 + COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL + LTEXT "&Syöttö:", stc3, 16, 132, 36, 8 + COMBOBOX cmb3, 64, 130, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL + GROUPBOX "Asento", grp1, 8, 156, 64, 56, BS_GROUPBOX + AUTORADIOBUTTON "P&ysty", rad1, 16, 170, 52, 12, BS_AUTORADIOBUTTON + AUTORADIOBUTTON "V&aaka", rad2, 16, 190, 52, 12, BS_AUTORADIOBUTTON + GROUPBOX "Reunat", grp4, 80, 156, 152, 56, BS_GROUPBOX + LTEXT "&Vasen:", stc15, 88, 172, 21, 8 + EDITTEXT edt4, 111, 170, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + LTEXT "&Oikea:", stc16, 159, 172, 27, 8 + EDITTEXT edt6, 187, 170, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + LTEXT "&Vasen:", stc17, 88, 192, 21, 8 + EDITTEXT edt5, 111, 190, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + LTEXT "&Pohja:", stc18, 159, 192, 23, 8 + EDITTEXT edt7, 187, 190, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + DEFPUSHBUTTON "OK", IDOK, 71, 220, 50, 14, BS_PUSHBUTTON + PUSHBUTTON "Peruuta", IDCANCEL, 126, 220, 50, 14 + PUSHBUTTON "T&ulostin...", psh3, 184, 220, 48, 14 +END + +NEWFILEOPENORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 280, 164 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN +CAPTION "Avaa" +FONT 8, "MS Shell Dlg" +{ + LTEXT "&Kansiosta:",IDC_LOOKINSTATIC,4,6,43,8, SS_NOTIFY + COMBOBOX IDC_LOOKIN,49,3,132,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + + LTEXT "" , IDC_TOOLBARSTATIC, 181, 2, 102, 17, NOT WS_GROUP | NOT WS_VISIBLE + LISTBOX IDC_SHELLSTATIC,4,20,272,85, LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | WS_HSCROLL | NOT WS_VISIBLE + + LTEXT "&Nimi:",IDC_FILENAMESTATIC,5,112,46,8, SS_NOTIFY + EDITTEXT IDC_FILENAME,54,110,155,12,ES_AUTOHSCROLL + + LTEXT "&Tyyppi:",IDC_FILETYPESTATIC,5,128,42,8, SS_NOTIFY + COMBOBOX IDC_FILETYPE,54,126,155,53,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + CONTROL "Avaa vain &lukuoikeuksilla",IDC_OPENREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,145,100,10 + + DEFPUSHBUTTON "&Avaa", IDOK,222,110,50,14 + PUSHBUTTON "Peruuta", IDCANCEL,222,128,50,14 + PUSHBUTTON "&Ohje", pshHelp,222,145,50,14 +} + +STRINGTABLE DISCARDABLE +{ + IDS_ABOUTBOX "&Tietoja FolderPicker Test:stä" + IDS_DOCUMENTFOLDERS "Dokumenttikansiot" + IDS_PERSONAL "Omat Dokumentit" + IDS_FAVORITES "Suosikit" + IDS_PATH "Järjestelmäkansio" + IDS_DESKTOP "Työpöytä" + IDS_FONTS "Fontit" + IDS_MYCOMPUTER "Oma Tietokone" +} + +STRINGTABLE DISCARDABLE +{ + IDS_SYSTEMFOLDERS "Järjestemäkansiot" + IDS_LOCALHARDRIVES "Paikalliset kiintolevyt" + IDS_FILENOTFOUND "Tiedostoa ei löydy" + IDS_VERIFYFILE "Varmista, että tiedoston nimi on oikein" + IDS_CREATEFILE "Tiedostoa ei ole olemassa\nHaluatko luoda tiedoston" + IDS_OVERWRITEFILE "Tiedosto on jo olemassa.\nHaluatko ylikirjoitaa sen?" + IDS_INVALID_FILENAME_TITLE "Kansio sisältää epäkelpoja merkkejä" + IDS_INVALID_FILENAME "Tiedoston nimi ei voi sisältää näitä merkkejä: \n / : < > |" + IDS_PATHNOTEXISTING "Kansiota ei ole" + IDS_FILENOTEXISTING "Tiedostoa ei ole" +} + +STRINGTABLE DISCARDABLE +{ + IDS_UPFOLDER "Kansio Ylöspäin" + IDS_NEWFOLDER "Luo Uusi Kansio" + IDS_LISTVIEW "Lista" + IDS_REPORTVIEW "Tiedot" + IDS_TODESKTOP "Selaa Työpöytää" +} + +STRINGTABLE DISCARDABLE +{ + PD32_PRINT_TITLE "Tulosta" + + PD32_VALUE_UREADABLE "Lukukelvoton merkintä" + PD32_INVALID_PAGE_RANGE "Arvo ei ole paperien määrän alueella.\nAnna arvo väliltä %d ja %d." + PD32_FROM_NOT_ABOVE_TO "Alukuarvo ei voi olla suurempi kuin loppuarvo." + PD32_MARGINS_OVERLAP "Marginaalit ovat päällekäin tai ulkona paperin alueelta.\nMääritä marginaalit uudestaan." + PD32_NR_OF_COPIES_EMPTY "Kopioiden määrä täytyy antaa." + PD32_TOO_LARGE_COPIES "Tulostin ei tue näin montaa kopiota. \nValitse arvo väliltä 1 ja %d." + PD32_PRINT_ERROR "Tulostinvirhe." + PD32_NO_DEFAULT_PRINTER "Oletustulostinta ei ole määritetty." + PD32_CANT_FIND_PRINTER "Tulostinta ei löydy." + PD32_OUT_OF_MEMORY "Muisti loppu." + PD32_GENERIC_ERROR "Virhe." + PD32_DRIVER_UNKNOWN "Tuntematon tulostinajuri." + + PD32_DEFAULT_PRINTER "Oletustulostin; " + PD32_NR_OF_DOCUMENTS_IN_QUEUE "Jonossa on %d dokumenttia" + PD32_MARGINS_IN_INCHES "Marginaalit [inches]" + PD32_MARGINS_IN_MILIMETERS "Marginaalit [mm]" + PD32_MILIMETERS "mm" + + PD32_PRINTER_STATUS_READY "Valmis" + PD32_PRINTER_STATUS_PAUSED "Pysäytetty; " + PD32_PRINTER_STATUS_ERROR "Virhe; " + PD32_PRINTER_STATUS_PENDING_DELETION "Tuhoutumassa; " + PD32_PRINTER_STATUS_PAPER_JAM "Paperitukos; " + PD32_PRINTER_STATUS_PAPER_OUT "Paperi loppu; " + PD32_PRINTER_STATUS_MANUAL_FEED "Syötä paperi käsin; " + PD32_PRINTER_STATUS_PAPER_PROBLEM "Ongelma paperin kanssa; " + PD32_PRINTER_STATUS_OFFLINE "Ei yhteyttä tulostimeen; " + PD32_PRINTER_STATUS_IO_ACTIVE "I/O Toiminnassa; " + PD32_PRINTER_STATUS_BUSY "Varattu; " + PD32_PRINTER_STATUS_PRINTING "Tulostaa; " + PD32_PRINTER_STATUS_OUTPUT_BIN_FULL "Output tray is full; " + PD32_PRINTER_STATUS_NOT_AVAILABLE "Ei saatavilla; " + PD32_PRINTER_STATUS_WAITING "Odottaa; " + PD32_PRINTER_STATUS_PROCESSING "Käsitellään; " + PD32_PRINTER_STATUS_INITIALIZING "Alustetaan; " + PD32_PRINTER_STATUS_WARMING_UP "Lämmitetään; " + PD32_PRINTER_STATUS_TONER_LOW "Väriaine vähissä; " + PD32_PRINTER_STATUS_NO_TONER "Ei väriäainetta; " + PD32_PRINTER_STATUS_PAGE_PUNT "Page punt; " + PD32_PRINTER_STATUS_USER_INTERVENTION "Käyttäjän keskeyttämä; " + PD32_PRINTER_STATUS_OUT_OF_MEMORY "Muisti loppu; " + PD32_PRINTER_STATUS_DOOR_OPEN "Tulostimen kansi on auki; " + PD32_PRINTER_STATUS_SERVER_UNKNOWN "Tulostinpalvelin tuntematon; " + PD32_PRINTER_STATUS_POWER_SAVE "Virransäästötila; " +} + +STRINGTABLE DISCARDABLE /* Color names */ +{ + IDS_COLOR_BLACK "Musta" + IDS_COLOR_MAROON "Kastanjanruskea" + IDS_COLOR_GREEN "Vihreä" + IDS_COLOR_OLIVE "Oliivinvihreä" + IDS_COLOR_NAVY "Laivastonsininen" + IDS_COLOR_PURPLE "Purppura" + IDS_COLOR_TEAL "Turkoosi" + IDS_COLOR_GRAY "Harmaa" + IDS_COLOR_SILVER "Hopea" + IDS_COLOR_RED "Punainen" + IDS_COLOR_LIME "Vaaleanvihreä" + IDS_COLOR_YELLOW "Keltainen" + IDS_COLOR_BLUE "Sininen" + IDS_COLOR_FUCHSIA "Tummanpunainen" + IDS_COLOR_AQUA "Vaaleanturkoosi" + IDS_COLOR_WHITE "Valkoinen" +} + +STRINGTABLE DISCARDABLE +{ + IDS_FONT_SIZE "Valitse fontin koko väliltä %d ja %d pistettä." + IDS_SAVE_BUTTON "&Tallenna" + IDS_SAVE_IN "&Kansioon:" + IDS_SAVE "Tallenna" + IDS_SAVE_AS "Tallenna nimellä" + IDS_OPEN_FILE "Avaa Tiedosto" } diff -urN wine-20050830/dlls/commdlg/cdlg_No.rc wine-20050930/dlls/commdlg/cdlg_No.rc --- wine-20050830/dlls/commdlg/cdlg_No.rc 2004-08-24 20:33:03.000000000 +0200 +++ wine-20050930/dlls/commdlg/cdlg_No.rc 2005-09-18 14:26:22.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright 1994 Dag Asheim + * Copyright 2005 Alexander N. Sørnes * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,131 +20,164 @@ * WARNING: DO NOT CHANGE THE SIZE OF THE STANDARD DIALOG TEMPLATES. */ -LANGUAGE LANG_NORWEGIAN, SUBLANG_DEFAULT +LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL OPEN_FILE DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Åpne" FONT 8, "MS Shell Dlg" { - LTEXT "&Filnavn:", 1090, 6, 6, 76, 9 - EDITTEXT 1152, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP + LTEXT "Fil&navn:", 1090, 6, 6, 76, 9 + EDITTEXT edt1, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "&Kataloger:", -1, 110, 6, 92, 9 + LTEXT "&Kateloger:", -1, 110, 6, 92, 9 LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "Liste over filer av &type:", 1089, 6, 104, 90, 9 - COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP - LTEXT "&Kataloger:", 1091, 110, 104, 92, 9 - COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Åpne", IDOK, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Avbryt", IDCANCEL, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Hjelp", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP - CHECKBOX "&Skrivebeskyttet", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + LTEXT "Vis filer av &typen:", 1089, 6, 104, 90, 9 + COMBOBOX cmb1, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + LTEXT "&Stasjoner:", 1091, 110, 104, 92, 9 + COMBOBOX cmb2, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Åpne", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Avbryt", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Hjelp", pshHelp, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "Sk&rivebeskyttet", chx1, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP } SAVE_FILE DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Lagre som ..." +CAPTION "Lagre som . . ." FONT 8, "MS Shell Dlg" { - LTEXT "&Filnavn:", 1090, 6, 6, 76, 9 - EDITTEXT 1152, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP + LTEXT "Fil&navn:", 1090, 6, 6, 76, 9 + EDITTEXT edt1, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP LTEXT "&Kataloger:", -1, 110, 6, 92, 9 LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "Liste over filer av &type:", 1089, 6, 104, 90, 9 - COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP - LTEXT "&Kataloger:", 1091, 110, 104, 92, 9 - COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Lagre som", IDOK, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Avbryt", IDCANCEL, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Hjelp", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP - CHECKBOX "&Skrivebeskyttet", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + LTEXT "Vis filer av &typen:", 1089, 6, 104, 90, 9 + COMBOBOX cmb1, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + LTEXT "&Stasjoner:", 1091, 110, 104, 92, 9 + COMBOBOX cmb2, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Lagre som", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Avbryt", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Hjelp", pshHelp, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "Sk&rivebeskyttet", chx1, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP } PRINT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Skriv" +CAPTION "Skriv ut" FONT 8, "MS Shell Dlg" { LTEXT "Skriver:", 1088, 6, 6, 40, 9 LTEXT "", 1089, 60, 6, 150, 9 - GROUPBOX "Skriv del", 1072, 6, 30, 160, 65, BS_GROUPBOX - RADIOBUTTON "&Alle", 1056, 16, 45, 60, 12 - RADIOBUTTON "&Markert", 1057, 16, 60, 60, 12 - RADIOBUTTON "&Sider", 1058, 16, 75, 60, 12 - DEFPUSHBUTTON "Skriv", IDOK, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Avbryt", IDCANCEL, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Oppsett", 1024, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP + GROUPBOX "Utskriftsområde", grp1, 6, 30, 160, 65, BS_GROUPBOX + RADIOBUTTON "&Alt", rad1, 16, 45, 60, 12 + RADIOBUTTON "M&erket område", rad2, 16, 60, 60, 12 + RADIOBUTTON "&Sider", rad3, 16, 75, 60, 12 + DEFPUSHBUTTON "Skriv ut", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Avbryt", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Opp&sett", psh1, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP LTEXT "&Fra:", 1090, 60, 80, 30, 9 LTEXT "&Til:", 1091, 120, 80, 30, 9 LTEXT "&Utskriftskvalitet:", 1092, 6, 100, 76, 9 - COMBOBOX 1136, 80, 100, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - CHECKBOX "&Skriv til fil", 1040, 20, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "Sammentrykket", 1041, 160, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + COMBOBOX cmb1, 80, 100, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + CHECKBOX "Skriv til fi&l", chx1, 20, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Kondensert", chx2, 160, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP } PRINT_SETUP DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Skriveoppsett" +CAPTION "Utskriftsinnstillinger" FONT 8, "MS Shell Dlg" { - GROUPBOX "Skriver", 1072, 6, 10, 180, 65, BS_GROUPBOX - RADIOBUTTON "&Standardskriver", 1056, 16, 20, 80, 12 - LTEXT "[ingen]", 1088, 35, 35, 120, 9 - RADIOBUTTON "Spesifikk &skriver", 1057, 16, 50, 80, 12 - COMBOBOX 1136, 35, 65, 149, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Ok", IDOK, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + GROUPBOX "Skriver", grp1, 6, 10, 180, 65, BS_GROUPBOX + RADIOBUTTON "Stan&dardskriver", rad1, 16, 20, 80, 12 + LTEXT "(Ingen)", 1088, 35, 35, 120, 9 + RADIOBUTTON "S&pesifik skriver", rad2, 16, 50, 80, 12 + COMBOBOX cmb1, 35, 65, 149, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP PUSHBUTTON "Avbryt", IDCANCEL, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Oppsett", 1024, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP - GROUPBOX "Orientering", 1073, 6, 85, 100, 50, BS_GROUPBOX - RADIOBUTTON "&Portrett", 1058, 50, 100, 40, 12 - RADIOBUTTON "&Landskap", 1059, 50, 115, 40, 12 - ICON "LANDSCAP", 1097, 10, 95, 32, 32 - ICON "PORTRAIT", 1098, 10, 95, 32, 32 - GROUPBOX "Papir", 1074, 120, 85, 180, 50, BS_GROUPBOX - LTEXT "&Størrelse", 1089, 130, 95, 30, 9 + PUSHBUTTON "Opp&sett", psh1, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP + GROUPBOX "Orientering", grp2, 6, 85, 100, 50, BS_GROUPBOX + RADIOBUTTON "&Stående", rad3, 50, 100, 40, 12 + RADIOBUTTON "&Liggende", rad4, 50, 115, 40, 12 + ICON "LANDSCAP", stc10, 10, 95, 32, 32 + ICON "PORTRAIT", stc11, 10, 95, 32, 32 + GROUPBOX "Papir", grp3, 120, 85, 180, 50, BS_GROUPBOX + LTEXT "Størr&else", 1089, 130, 95, 30, 9 LTEXT "&Kilde", 1090, 130, 110, 30, 9 - COMBOBOX 1137, 155, 95, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - COMBOBOX 1138, 155, 110, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + COMBOBOX cmb2, 155, 95, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + COMBOBOX cmb3, 155, 110, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP } -CHOOSE_FONT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 +CHOOSE_FONT DIALOG DISCARDABLE 13, 54, 264, 147 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Font" +CAPTION "Skrift" FONT 8, "MS Shell Dlg" { - LTEXT "Font:", 1088, 6, 6, 40, 9 - LTEXT "", 1089, 60, 6, 150, 9 - DEFPUSHBUTTON "Ok", IDOK, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Avbryt", IDCANCEL, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP + LTEXT "&Skrift:",stc1 ,6,3,40,9 + COMBOBOX cmb1, 6,13,94,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | + CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE + LTEXT "Skriftst&il:",stc2 ,108,3,44,9 + COMBOBOX cmb2,108,13,64,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | + WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE + LTEXT "&Størrelse:",stc3,179,3,30,9 + COMBOBOX cmb3,179,13,32,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | + WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE | CBS_SORT + DEFPUSHBUTTON "OK",IDOK,218,6,40,14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "Avbryt",IDCANCEL,218,23,40,14,WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Bruk", psh3,218,40,40,14,WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Hjelp" , pshHelp,218,57,40,14,WS_GROUP | WS_TABSTOP + GROUPBOX "Effekter",grp1,6,72,84,34,WS_GROUP + CHECKBOX "Gjennomstre&ket", chx1, 10,82,50,10, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "&Understreket", chx2, 10,94,50,10, BS_AUTOCHECKBOX + LTEXT "&Farge:", stc4 ,6,110,30,9 + COMBOBOX cmb4,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | + CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Forhåndsvisning",grp2,98,72,120,36,WS_GROUP + CTEXT "AaBbYyZz",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE + LTEXT "Skr&ipt:",stc7 ,98,114,40,9 + COMBOBOX cmb5,98,124,120,10,CBS_DROPDOWNLIST |CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | + CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP } -CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 185 +CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Farge" FONT 8, "MS Shell Dlg" { - LTEXT "&Grunnleggende farger:", 1088, 6, 6, 40, 9 - LTEXT "&Egendefinerte farger:", 1089, 6, 126, 40, 9 - LTEXT "&Ensfarget", 1090, 100, 146, 40, 9 - LTEXT "&Int:", 1091, 150, 126, 40, 9 - LTEXT "&Met:", 1092, 150, 146, 40, 9 - LTEXT "&Lum:", 1093, 150, 166, 40, 9 - LTEXT "&Rød:", 1094, 150, 126, 40, 9 - LTEXT "&Grønn:", 1095, 150, 146, 40, 9 - LTEXT "&Blå:", 1096, 150, 166, 40, 9 - DEFPUSHBUTTON "Ok", IDOK, 6, 182, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Legg til egendefinert farge", 1024, 120, 182, 100, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Fjern egendefinerte farger", 1025, 6, 164, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "Avbryt", IDCANCEL, 76, 182, 56, 14, WS_GROUP | WS_TABSTOP + LTEXT "&Basisfarger:", 1088, 4, 4, 140, 10 + LTEXT "&Egendefinerte farger:", 1089, 4, 106, 140, 10 + LTEXT "Farge | Sol&id", 1090, 150, 151, 48, 10 + LTEXT "&Rød:", 726 /*1094*/,249,126,24,10 + EDITTEXT 706, 275,124,21,12, WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Grønn:",727/*1095*/,249,140,24,10 + EDITTEXT 707, 275,138,21,12, WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Blå:",728 /*1096*/,249,154,24,10 + EDITTEXT 708, 275,152,21,12, WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Nyanse:" ,723 /*1091*/,202,126,22,10 + EDITTEXT 703, 226,124,21,12, WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Metning:" ,724 /*1092*/,202,140,22,10 + EDITTEXT 704, 226,138,21,12, WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Lum:" ,725 /*1093*/,202,154,22,10 + EDITTEXT 705, 226,152,21,12, WS_BORDER | WS_GROUP | WS_TABSTOP + CONTROL "" ,720,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP,4,14,140,86 + CONTROL "" ,721,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP,4,116,140,28 + CONTROL "" ,710,"STATIC",WS_BORDER|SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,4,118,116 + CONTROL "" ,702,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 278,4,8,116 + CONTROL "" ,709,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,124,40,26 + DEFPUSHBUTTON "OK", 1, 4, 166, 44, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Avbryt", 2, 52, 166, 44, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Hjelp", pshHelp,100,166, 44, 14 + PUSHBUTTON "Legg til i egendefinerte f&arger", 712/*1024*/, 152, 166, 142, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Definer egendefinerte farger >>", 719/*1025*/, 4, 150, 142, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&i",713,300,200,4,14 /* just a dummy: 'i' is like &i in "sol&id" */ } @@ -153,33 +186,282 @@ CAPTION "Finn" FONT 8, "MS Shell Dlg" { - LTEXT "&Finn hva:", -1, 4, 8, 42, 8 - EDITTEXT 1152, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP - CHECKBOX "&Kun hele ord", 1040, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "&Skill på store/små bokstaver", 1041, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP - GROUPBOX "Retning", 1072, 107, 26, 68, 28 - CONTROL "&Opp", 1056, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12 - CONTROL "&Ned", 1057, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12 - DEFPUSHBUTTON "&Finn neste", IDOK, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "Avbryt", IDCANCEL, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Hjelp", 1038, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP + LTEXT "Fi&nn:", -1, 4, 8, 42, 8 + EDITTEXT edt1, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP + CHECKBOX "Finn &kun hele ord", chx1, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Skill &mellom store/små bokstaver", chx2, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP + GROUPBOX "Retning", grp1, 107, 26, 68, 28 + CONTROL "&Opp", rad1, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12 + CONTROL "&Ned", rad2, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12 + + DEFPUSHBUTTON "&Finn neste", IDOK, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "Avbryt", IDCANCEL , 182, 23, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Hjelp", pshHelp , 182, 45, 50, 14, WS_GROUP | WS_TABSTOP } REPLACEDLGORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 230, 94 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Bytt" +CAPTION "Erstatt" FONT 8, "MS Shell Dlg" { - LTEXT "&Finn hva:", -1, 4, 9, 48, 8 - EDITTEXT 1152, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP - LTEXT "&Bytt med:", -1, 4, 26, 48, 8 - EDITTEXT 1153, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP - CHECKBOX "&Kun hele ord", 1040, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "&Skill på store/små bokstaver", 1041, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - DEFPUSHBUTTON "&Finn neste", IDOK, 174, 4, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Bytt", 1024, 174, 21, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Bytt alt", 1025, 174, 38, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "Avbryt", IDCANCEL, 174, 55, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Hjelp", 1038, 174, 75, 50, 14, WS_GROUP | WS_TABSTOP + LTEXT "Fi&nn:", -1, 4, 9, 48, 8 + EDITTEXT edt1, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP + LTEXT "&Erstatt med:", -1, 4, 26, 48, 8 + EDITTEXT edt2, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP + CHECKBOX "Finn kun &hele ord", chx1, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Skill mellom store og små bokstaver", chx2, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_TABSTOP + + DEFPUSHBUTTON "&Finn neste", IDOK, 174, 4, 50, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "E&rsatt", psh1 , 174, 21, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Erstatt &alle", psh2 , 174, 38, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Avbryt", IDCANCEL , 174, 55, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Hjelp", pshHelp , 174, 75, 50, 14, WS_GROUP | WS_TABSTOP +} + + +PRINT32 DIALOG LOADONCALL MOVEABLE DISCARDABLE 32, 32, 288, 186 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | + DS_CONTEXTHELP | DS_3DLOOK +CAPTION "Skriv ut" +FONT 8, "MS Shell Dlg" +{ + DEFPUSHBUTTON "OK", IDOK, 180,164, 48,14, WS_GROUP | BS_DEFPUSHBUTTON + PUSHBUTTON "Avbryt", IDCANCEL, 232,164, 48,14, WS_GROUP + PUSHBUTTON "&Hjelp", pshHelp, 50, 161, 48,14, WS_GROUP + + GROUPBOX "Skriver", grp4, 8, 4, 272,84, WS_GROUP + CONTROL "Skriv ti&l fil", chx1, "Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,212,70,64,12 + PUSHBUTTON "&Egenskaper", psh2, 212, 17, 60,14, WS_GROUP + LTEXT "&Navn:", stc6, 16, 20, 36,8 + COMBOBOX cmb4, 52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "Status:", stc8, 16, 36, 36,10, SS_NOPREFIX + LTEXT "Tullestatus", stc12, 52, 36, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Type:", stc7, 16, 48, 36,10, SS_NOPREFIX + LTEXT "Tulletype", stc11, 52, 48, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Hvor:", stc10, 16, 60, 36,10, SS_NOPREFIX + LTEXT "Tulleplassering", stc14, 52, 60, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Kommentar:", stc9, 16, 72, 36,10, SS_NOPREFIX + LTEXT "Tullekommentar", stc13, 52, 72, 152,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + + GROUPBOX "Kopier", grp2, 160, 92, 120,64, WS_GROUP + LTEXT "Antall &kopier:",stc5,168,108,68,8 + ICON "", ico3, 162,124, 76,24, WS_GROUP | SS_CENTERIMAGE + CONTROL "S&orter", chx2,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,240,130,36,12 + EDITTEXT edt3, 240,106, 32,12, WS_GROUP | ES_NUMBER + + GROUPBOX "Utskriftsområde", grp1, 8,92, 144,64, WS_GROUP + CONTROL "&Alt", rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,16,106,64,12 + CONTROL "&Sider", rad3,"Button",BS_AUTORADIOBUTTON,16,122,36,12 + CONTROL "&Merket område", rad2,"Button",BS_AUTORADIOBUTTON,16,138,64,12 + EDITTEXT edt1, 74,122, 26,12, WS_GROUP | ES_NUMBER + EDITTEXT edt2, 118,122, 26,12, WS_GROUP | ES_NUMBER + RTEXT "&Fra:", stc2, 52,124, 20,8 + RTEXT "&Til:", stc3, 100,124, 16,8 +} + +PRINT32_SETUP DIALOG LOADONCALL MOVEABLE DISCARDABLE 32, 32, 288, 178 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | + DS_CONTEXTHELP | DS_3DLOOK +CAPTION "Utskriftoppsett" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,180,156,48,14,WS_GROUP + PUSHBUTTON "Avbryt",IDCANCEL,232,156,48,14 +/* PUSHBUTTON "Nettverk . . .", psh5, 284,156,48,14 */ + + GROUPBOX "Skriver", grp4, 8, 4, 272,84, WS_GROUP + PUSHBUTTON "&Egenskaper", psh2, 212, 17, 60,14, WS_GROUP + LTEXT "&Navn:", stc6, 16, 20, 36,8 + COMBOBOX cmb1, 52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "Status:", stc8, 16, 36, 36,10, SS_NOPREFIX + LTEXT "Tullestatus", stc12, 52, 36, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Type:", stc7, 16, 48, 36,10, SS_NOPREFIX + LTEXT "Tulletype", stc11, 52, 48, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Plassering:", stc10, 16, 60, 36,10, SS_NOPREFIX + LTEXT "Tulleplassering", stc14, 52, 60, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + LTEXT "Kommentar:", stc9, 16, 72, 36,10, SS_NOPREFIX + LTEXT "Tullekommentar", stc13, 52, 72, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP + + GROUPBOX "Papir", grp2, 8, 92, 164,56, WS_GROUP + LTEXT "&Størrelse:", stc2, 16,108, 36, 8 + COMBOBOX cmb2, 52,106, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "&Kilde:", stc3, 16,128, 36, 8 + COMBOBOX cmb3, 52,126, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + + GROUPBOX "Orientering", grp1, 180, 92, 100,56, WS_GROUP + ICON "", ico1, 195,112, 18,20, WS_GROUP + CONTROL "S&tående", rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP |WS_TABSTOP,224,106,52,12 + CONTROL "&Liggende", rad2,"Button",BS_AUTORADIOBUTTON,224,126,52,12 +END + +PAGESETUPDLGORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 32, 32, 240, 240 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Sideoppsett" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80 + CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80 + CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4 + GROUPBOX "Paper", grp2, 8, 96, 224, 56, BS_GROUPBOX + LTEXT "&Størrelse:", stc2, 16, 112, 36, 8 + COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL + LTEXT "Sku&ff:", stc3, 16, 132, 36, 8 + COMBOBOX cmb3, 64, 130, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL + GROUPBOX "Orientering", grp1, 8, 156, 64, 56, BS_GROUPBOX + AUTORADIOBUTTON "S&tående", rad1, 16, 170, 52, 12, BS_AUTORADIOBUTTON + AUTORADIOBUTTON "&Liggende", rad2, 16, 190, 52, 12, BS_AUTORADIOBUTTON + GROUPBOX "Rammer", grp4, 80, 156, 152, 56, BS_GROUPBOX + LTEXT "V&enstre:", stc15, 88, 172, 21, 8 + EDITTEXT edt4, 111, 170, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + LTEXT "Høy&re:", stc16, 159, 172, 27, 8 + EDITTEXT edt6, 187, 170, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + LTEXT "T&opp:", stc17, 88, 192, 21, 8 + EDITTEXT edt5, 111, 190, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + LTEXT "&Bunn:", stc18, 159, 192, 23, 8 + EDITTEXT edt7, 187, 190, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER + DEFPUSHBUTTON "OK", IDOK, 71, 220, 50, 14, BS_PUSHBUTTON + PUSHBUTTON "Avbryt", IDCANCEL, 126, 220, 50, 14 + PUSHBUTTON "Sk&river . . .", psh3, 184, 220, 48, 14 +END + +NEWFILEOPENORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 280, 164 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN +CAPTION "Åpne" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Se &i:",IDC_LOOKINSTATIC,4,6,43,8, SS_NOTIFY + COMBOBOX IDC_LOOKIN,49,3,132,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + + LTEXT "" , IDC_TOOLBARSTATIC, 181, 2, 102, 17, NOT WS_GROUP | NOT WS_VISIBLE + LISTBOX IDC_SHELLSTATIC,4,20,272,85, LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | WS_HSCROLL | NOT WS_VISIBLE + + LTEXT "Fil&navn:",IDC_FILENAMESTATIC,5,112,46,8, SS_NOTIFY + EDITTEXT IDC_FILENAME,54,110,155,12,ES_AUTOHSCROLL + + LTEXT "Fil&type:",IDC_FILETYPESTATIC,5,128,42,8, SS_NOTIFY + COMBOBOX IDC_FILETYPE,54,126,155,53,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + CONTROL "Åpne som sk&rivebeskyttet",IDC_OPENREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,145,100,10 + + DEFPUSHBUTTON "&Åpne", IDOK,222,110,50,14 + PUSHBUTTON "Avbryt", IDCANCEL,222,128,50,14 + PUSHBUTTON "&Hjelp", pshHelp,222,145,50,14 +} + +STRINGTABLE DISCARDABLE +{ + IDS_ABOUTBOX "Om k&atalogvelger-test" + IDS_DOCUMENTFOLDERS "Dokumentmapper" + IDS_PERSONAL "Mine dokumenter" + IDS_FAVORITES "Mine favoritter" + IDS_PATH "Systemsti" + IDS_DESKTOP "Skrivebord" + IDS_FONTS "Skrifter" + IDS_MYCOMPUTER "Min datamaskin" +} + +STRINGTABLE DISCARDABLE +{ + IDS_SYSTEMFOLDERS "Systemkataloger" + IDS_LOCALHARDRIVES "Lokale harddisker" + IDS_FILENOTFOUND "Fant ikke filen" + IDS_VERIFYFILE "Kontroller at filnavnet som ble oppgitt er korrekt" + IDS_CREATEFILE "Filen finnes ikke.\nSkal den opprettes?" + IDS_OVERWRITEFILE "Filen finnes fra før.\nSkal den overskrives?" + IDS_INVALID_FILENAME_TITLE "Ugyldige tegn i filnavnet" + IDS_INVALID_FILENAME "Et filnavn kan ikke inneholder følgende tegn:\n / : < > |" + IDS_PATHNOTEXISTING "Stien finnes ikke" + IDS_FILENOTEXISTING "Filen finnes ikke" +} + +STRINGTABLE DISCARDABLE +{ + IDS_UPFOLDER "Opp ett nivå" + IDS_NEWFOLDER "Lag ny katalog" + IDS_LISTVIEW "Liste" + IDS_REPORTVIEW "Detaljer" + IDS_TODESKTOP "Bla til skrivebordet" +} + +STRINGTABLE DISCARDABLE +{ + PD32_PRINT_TITLE "Skriv ut" + + PD32_VALUE_UREADABLE "Uleselig oppføring" + PD32_INVALID_PAGE_RANGE "Denne verdien er ikke innenfor antall sider.\n\ +Oppgi en verdi mellom %d og %d." + PD32_FROM_NOT_ABOVE_TO "'Fra'-verdien kan ikke være større en 'til'-verdien." + PD32_MARGINS_OVERLAP "Margene overlapper hverandre eller faller utenfor siden.\nSkriv inn andre verdier." + PD32_NR_OF_COPIES_EMPTY "Feltet 'Antall kopier' kan ikke være tomt." + PD32_TOO_LARGE_COPIES "Et så høyt antall kopier støttes ikke av den valgte skriveren.\nVelg en verdi mellom 1 og %d." + PD32_PRINT_ERROR "En skriverfeil har oppstått." + PD32_NO_DEFAULT_PRINTER "Ingen standardskriver er definert." + PD32_CANT_FIND_PRINTER "Kunne ikke finne skriveren." + PD32_OUT_OF_MEMORY "Ikke mer minne." + PD32_GENERIC_ERROR "En feil har oppstått." + PD32_DRIVER_UNKNOWN "Ukjent skriverdriver." + + PD32_DEFAULT_PRINTER "Standardskriver; " + PD32_NR_OF_DOCUMENTS_IN_QUEUE "Det er %d dokumenter i køen" + PD32_MARGINS_IN_INCHES "Marger (tommer)" + PD32_MARGINS_IN_MILIMETERS "Marger (mm)" + PD32_MILIMETERS "mm" + + PD32_PRINTER_STATUS_READY "Klar" + PD32_PRINTER_STATUS_PAUSED "Satt på pause; " + PD32_PRINTER_STATUS_ERROR "Feil; " + PD32_PRINTER_STATUS_PENDING_DELETION "Venter på sletting; " + PD32_PRINTER_STATUS_PAPER_JAM "Papir sitter fast; " + PD32_PRINTER_STATUS_PAPER_OUT "Tom for papir; " + PD32_PRINTER_STATUS_MANUAL_FEED "Fyll på papir manuelt; " + PD32_PRINTER_STATUS_PAPER_PROBLEM "Papirproblem; " + PD32_PRINTER_STATUS_OFFLINE "Skriver frakoblet; " + PD32_PRINTER_STATUS_IO_ACTIVE "Inn/Ut aktiv; " + PD32_PRINTER_STATUS_BUSY "Opptatt; " + PD32_PRINTER_STATUS_PRINTING "Skriver ut; " + PD32_PRINTER_STATUS_OUTPUT_BIN_FULL "Utskuffen er full; " + PD32_PRINTER_STATUS_NOT_AVAILABLE "Ikke tilgjengelig; " + PD32_PRINTER_STATUS_WAITING "Venter; " + PD32_PRINTER_STATUS_PROCESSING "Behandler; " + PD32_PRINTER_STATUS_INITIALIZING "Initaliserer; " + PD32_PRINTER_STATUS_WARMING_UP "Varmer opp; " + PD32_PRINTER_STATUS_TONER_LOW "Toner lav; " + PD32_PRINTER_STATUS_NO_TONER "Ingen toner; " + PD32_PRINTER_STATUS_PAGE_PUNT "Page punt; " + PD32_PRINTER_STATUS_USER_INTERVENTION "Avbrutt av bruker; " + PD32_PRINTER_STATUS_OUT_OF_MEMORY "Ikke mer minne; " + PD32_PRINTER_STATUS_DOOR_OPEN "Skriverdøren er åpen; " + PD32_PRINTER_STATUS_SERVER_UNKNOWN "Ukjent skrivertjener; " + PD32_PRINTER_STATUS_POWER_SAVE "Strømsparingsmodus; " +} + +STRINGTABLE DISCARDABLE /* Color names */ +{ + IDS_COLOR_BLACK "Svart" + IDS_COLOR_MAROON "Rødbrun" + IDS_COLOR_GREEN "Grønn" + IDS_COLOR_OLIVE "Oliven" + IDS_COLOR_NAVY "Marineblå" + IDS_COLOR_PURPLE "Purpur" + IDS_COLOR_TEAL "Teal" + IDS_COLOR_GRAY "Grå" + IDS_COLOR_SILVER "Sølv" + IDS_COLOR_RED "Rød" + IDS_COLOR_LIME "Lime-grønn" + IDS_COLOR_YELLOW "Gul" + IDS_COLOR_BLUE "Blå" + IDS_COLOR_FUCHSIA "Fuchsia" + IDS_COLOR_AQUA "Aqua" + IDS_COLOR_WHITE "Hvit" +} + +STRINGTABLE DISCARDABLE +{ + IDS_FONT_SIZE "Velg en skriftstørrelse mellom %d og %d punkter." + IDS_SAVE_BUTTON "&Lagre" + IDS_SAVE_IN "Lagre &i:" + IDS_SAVE "Lagre" + IDS_SAVE_AS "Lagre som" + IDS_OPEN_FILE "Åpne fil" } diff -urN wine-20050830/dlls/commdlg/colordlg.c wine-20050930/dlls/commdlg/colordlg.c --- wine-20050830/dlls/commdlg/colordlg.c 2005-06-28 21:19:07.000000000 +0200 +++ wine-20050930/dlls/commdlg/colordlg.c 2005-09-02 13:33:51.000000000 +0200 @@ -1303,7 +1303,7 @@ } bRet = DialogBoxIndirectParamW(COMDLG32_hInstance, template, lpChCol->hwndOwner, - ColorDlgProc, (DWORD)lpChCol); + ColorDlgProc, (LPARAM)lpChCol); return bRet; } diff -urN wine-20050830/dlls/commdlg/filedlg.c wine-20050930/dlls/commdlg/filedlg.c --- wine-20050830/dlls/commdlg/filedlg.c 2005-08-12 12:33:06.000000000 +0200 +++ wine-20050930/dlls/commdlg/filedlg.c 2005-09-02 13:33:51.000000000 +0200 @@ -1091,7 +1091,7 @@ stringId = 0; } lpdi->hinst = COMDLG32_hInstance; - lpdi->lpszText = (LPSTR) stringId; + lpdi->lpszText = MAKEINTRESOURCEA(stringId); } return FALSE; } @@ -2378,7 +2378,7 @@ lpstrFilter = (LPWSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilterIndexCB); - if ((INT)lpstrFilter == CB_ERR) /* control is empty */ + if ((INT_PTR)lpstrFilter == CB_ERR) /* control is empty */ lpstrFilter = NULL; if(lpstrFilter) @@ -2423,7 +2423,7 @@ lpstrFilter = (LPWSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, iItem); - if((int)lpstrFilter != CB_ERR) + if((INT_PTR)lpstrFilter != CB_ERR) { DWORD len; CharLowerW(lpstrFilter); /* lowercase */ diff -urN wine-20050830/dlls/commdlg/fontdlg.c wine-20050930/dlls/commdlg/fontdlg.c --- wine-20050830/dlls/commdlg/fontdlg.c 2005-07-05 16:11:04.000000000 +0200 +++ wine-20050930/dlls/commdlg/fontdlg.c 2005-09-02 13:33:51.000000000 +0200 @@ -670,7 +670,7 @@ if (lpcf->Flags & CF_INITTOLOGFONTSTRUCT) { /* look for fitting font name in combobox1 */ - j=SendDlgItemMessageW(hDlg,cmb1,CB_FINDSTRING,-1,(LONG)lpxx->lfFaceName); + j=SendDlgItemMessageW(hDlg,cmb1,CB_FINDSTRING,-1,(LPARAM)lpxx->lfFaceName); if (j!=CB_ERR) { INT height = lpxx->lfHeight < 0 ? -lpxx->lfHeight : @@ -699,7 +699,7 @@ } if ((lpcf->Flags & CF_USESTYLE) && lpcf->lpszStyle) { - j=SendDlgItemMessageW(hDlg,cmb2,CB_FINDSTRING,-1,(LONG)lpcf->lpszStyle); + j=SendDlgItemMessageW(hDlg,cmb2,CB_FINDSTRING,-1,(LPARAM)lpcf->lpszStyle); if (j!=CB_ERR) { j=SendDlgItemMessageW(hDlg,cmb2,CB_SETCURSEL,j,0); diff -urN wine-20050830/dlls/commdlg/printdlg.c wine-20050930/dlls/commdlg/printdlg.c --- wine-20050830/dlls/commdlg/printdlg.c 2005-08-25 21:23:43.000000000 +0200 +++ wine-20050930/dlls/commdlg/printdlg.c 2005-09-07 13:31:18.000000000 +0200 @@ -900,8 +900,8 @@ dmSize = DocumentPropertiesA(0, 0, name, PrintStructures->lpDevMode, NULL, DM_OUT_BUFFER); if(lppd->hDevMode && (lpdm = GlobalLock(lppd->hDevMode)) && - !lstrcmpA(lpdm->dmDeviceName, - PrintStructures->lpDevMode->dmDeviceName)) { + !lstrcmpA( (LPSTR) lpdm->dmDeviceName, + (LPSTR) PrintStructures->lpDevMode->dmDeviceName)) { /* Supplied devicemode matches current printer so try to use it */ DocumentPropertiesA(0, 0, name, PrintStructures->lpDevMode, lpdm, DM_OUT_BUFFER | DM_IN_BUFFER); @@ -3157,7 +3157,7 @@ pda->curdlg.ptPaperSize.x = tmp; } } else - WARN("GlobalLock(pda->pdlg.hDevMode) fail? hDevMode=%ld", (DWORD)pda->pdlg.hDevMode); + WARN("GlobalLock(pda->pdlg.hDevMode) fail? hDevMode=%p", pda->pdlg.hDevMode); /* Drawing paper prev */ PRINTDLG_PS_ChangePaperPrev(pda); return TRUE; diff -urN wine-20050830/dlls/commdlg/printdlg16.c wine-20050930/dlls/commdlg/printdlg16.c --- wine-20050830/dlls/commdlg/printdlg16.c 2005-07-05 16:11:04.000000000 +0200 +++ wine-20050930/dlls/commdlg/printdlg16.c 2005-09-06 12:22:43.000000000 +0200 @@ -493,6 +493,14 @@ pi->pPortName ); GlobalUnlock16(lppd->hDevMode); + /* Copy back the [out] integer parameters */ +#define CVAL(x) lppd->x = PrintStructures->lpPrintDlg->x; + CVAL(Flags); + CVAL(nFromPage); + CVAL(nToPage); + CVAL(nCopies); +#undef CVAL + } if (!(lppd->Flags & (PD_ENABLESETUPTEMPLATEHANDLE | PD_ENABLESETUPTEMPLATE))) GlobalFree16(hDlgTmpl); /* created from the 32 bits resource */ diff -urN wine-20050830/dlls/commdlg/rsrc.rc wine-20050930/dlls/commdlg/rsrc.rc --- wine-20050830/dlls/commdlg/rsrc.rc 2004-04-27 01:35:17.000000000 +0200 +++ wine-20050930/dlls/commdlg/rsrc.rc 2005-09-19 19:00:59.000000000 +0200 @@ -41,6 +41,7 @@ * which also have a neutral version. This is to * get localized bitmaps for example. */ +#include "cdlg_Bg.rc" #include "cdlg_Ca.rc" #include "cdlg_Cn.rc" #include "cdlg_Cs.rc" diff -urN wine-20050830/dlls/crtdll/.cvsignore wine-20050930/dlls/crtdll/.cvsignore --- wine-20050830/dlls/crtdll/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/crtdll/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -crtdll.dll.dbg.c libcrtdll.def diff -urN wine-20050830/dlls/crypt32/.cvsignore wine-20050930/dlls/crypt32/.cvsignore --- wine-20050830/dlls/crypt32/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/crypt32/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -crypt32.dll.dbg.c libcrypt32.def diff -urN wine-20050830/dlls/crypt32/Makefile.in wine-20050930/dlls/crypt32/Makefile.in --- wine-20050830/dlls/crypt32/Makefile.in 2005-08-18 12:59:47.000000000 +0200 +++ wine-20050930/dlls/crypt32/Makefile.in 2005-09-07 15:25:56.000000000 +0200 @@ -5,7 +5,7 @@ VPATH = @srcdir@ MODULE = crypt32.dll IMPORTLIB = libcrypt32.$(IMPLIBEXT) -IMPORTS = advapi32 kernel32 ntdll +IMPORTS = user32 advapi32 kernel32 ntdll C_SRCS = \ cert.c \ diff -urN wine-20050830/dlls/crypt32/cert.c wine-20050930/dlls/crypt32/cert.c --- wine-20050830/dlls/crypt32/cert.c 2005-08-30 11:59:03.000000000 +0200 +++ wine-20050930/dlls/crypt32/cert.c 2005-09-15 11:31:20.000000000 +0200 @@ -27,13 +27,18 @@ * registering and enumerating physical stores and locations.) * - Many flags, options and whatnot are unimplemented. */ +#include #include #include "windef.h" #include "winbase.h" +#include "winnls.h" #include "winreg.h" +#include "winuser.h" #include "wincrypt.h" #include "wine/debug.h" #include "wine/list.h" +#include "excpt.h" +#include "wine/exception.h" #include "crypt32_private.h" WINE_DEFAULT_DEBUG_CHANNEL(crypt); @@ -44,6 +49,77 @@ #define CERT_CRL_PROP_ID 33 #define CERT_CTL_PROP_ID 34 +/* Some typedefs that make it easier to abstract which type of context we're + * working with. + */ +typedef const void *(WINAPI *CreateContextFunc)(DWORD dwCertEncodingType, + const BYTE *pbCertEncoded, DWORD cbCertEncoded); +typedef BOOL (WINAPI *AddContextToStoreFunc)(HCERTSTORE hCertStore, + const void *context, DWORD dwAddDisposition, const void **ppStoreContext); +typedef BOOL (WINAPI *AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore, + DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded, + DWORD dwAddDisposition, const void **ppContext); +typedef const void *(WINAPI *EnumContextsInStoreFunc)(HCERTSTORE hCertStore, + const void *pPrevContext); +typedef BOOL (WINAPI *GetContextPropertyFunc)(const void *context, + DWORD dwPropID, void *pvData, DWORD *pcbData); +typedef BOOL (WINAPI *SetContextPropertyFunc)(const void *context, + DWORD dwPropID, DWORD dwFlags, const void *pvData); +typedef BOOL (WINAPI *SerializeElementFunc)(const void *context, DWORD dwFlags, + BYTE *pbElement, DWORD *pcbElement); +typedef BOOL (WINAPI *FreeContextFunc)(const void *context); +typedef BOOL (WINAPI *DeleteContextFunc)(const void *context); + +/* An abstract context (certificate, CRL, or CTL) interface */ +typedef struct _WINE_CONTEXT_INTERFACE +{ + CreateContextFunc create; + AddContextToStoreFunc addContextToStore; + AddEncodedContextToStoreFunc addEncodedToStore; + EnumContextsInStoreFunc enumContextsInStore; + GetContextPropertyFunc getProp; + SetContextPropertyFunc setProp; + SerializeElementFunc serialize; + FreeContextFunc free; + DeleteContextFunc deleteFromStore; +} WINE_CONTEXT_INTERFACE, *PWINE_CONTEXT_INTERFACE; + +static const WINE_CONTEXT_INTERFACE gCertInterface = { + (CreateContextFunc)CertCreateCertificateContext, + (AddContextToStoreFunc)CertAddCertificateContextToStore, + (AddEncodedContextToStoreFunc)CertAddEncodedCertificateToStore, + (EnumContextsInStoreFunc)CertEnumCertificatesInStore, + (GetContextPropertyFunc)CertGetCertificateContextProperty, + (SetContextPropertyFunc)CertSetCertificateContextProperty, + (SerializeElementFunc)CertSerializeCertificateStoreElement, + (FreeContextFunc)CertFreeCertificateContext, + (DeleteContextFunc)CertDeleteCertificateFromStore, +}; + +static const WINE_CONTEXT_INTERFACE gCRLInterface = { + (CreateContextFunc)CertCreateCRLContext, + (AddContextToStoreFunc)CertAddCRLContextToStore, + (AddEncodedContextToStoreFunc)CertAddEncodedCRLToStore, + (EnumContextsInStoreFunc)CertEnumCRLsInStore, + (GetContextPropertyFunc)CertGetCRLContextProperty, + (SetContextPropertyFunc)CertSetCRLContextProperty, + (SerializeElementFunc)CertSerializeCRLStoreElement, + (FreeContextFunc)CertFreeCRLContext, + (DeleteContextFunc)CertDeleteCRLFromStore, +}; + +static const WINE_CONTEXT_INTERFACE gCTLInterface = { + (CreateContextFunc)CertCreateCTLContext, + (AddContextToStoreFunc)CertAddCTLContextToStore, + (AddEncodedContextToStoreFunc)CertAddEncodedCTLToStore, + (EnumContextsInStoreFunc)CertEnumCTLsInStore, + (GetContextPropertyFunc)CertGetCTLContextProperty, + (SetContextPropertyFunc)CertSetCTLContextProperty, + (SerializeElementFunc)CertSerializeCTLStoreElement, + (FreeContextFunc)CertFreeCTLContext, + (DeleteContextFunc)CertDeleteCTLFromStore, +}; + struct WINE_CRYPTCERTSTORE; typedef struct WINE_CRYPTCERTSTORE * (*StoreOpenFunc)(HCRYPTPROV hCryptProv, @@ -161,6 +237,29 @@ struct list certs; } WINE_MEMSTORE, *PWINE_MEMSTORE; +typedef struct _WINE_HASH_TO_DELETE +{ + BYTE hash[20]; + struct list entry; +} WINE_HASH_TO_DELETE, *PWINE_HASH_TO_DELETE; + +/* Returned by a reg store during enumeration. */ +typedef struct _WINE_REG_CERT_CONTEXT +{ + WINE_CERT_CONTEXT_REF cert; + PWINE_CERT_CONTEXT_REF childContext; +} WINE_REG_CERT_CONTEXT, *PWINE_REG_CERT_CONTEXT; + +typedef struct _WINE_REGSTORE +{ + WINECRYPT_CERTSTORE hdr; + PWINECRYPT_CERTSTORE memStore; + HKEY key; + BOOL dirty; + CRITICAL_SECTION cs; + struct list certsToDelete; +} WINE_REGSTORE, *PWINE_REGSTORE; + typedef struct _WINE_STORE_LIST_ENTRY { PWINECRYPT_CERTSTORE store; @@ -205,6 +304,23 @@ static BOOL WINAPI CRYPT_SetCertificateContextProperty( PWINE_CERT_CONTEXT context, DWORD dwPropId, DWORD dwFlags, const void *pvData); +/* Helper function for store reading functions and + * CertAddSerializedElementToStore. Returns a context of the appropriate type + * if it can, or NULL otherwise. Doesn't validate any of the properties in + * the serialized context (for example, bad hashes are retained.) + * *pdwContentType is set to the type of the returned context. + */ +static const void * WINAPI CRYPT_ReadSerializedElement(const BYTE *pbElement, + DWORD cbElement, DWORD dwContextTypeFlags, DWORD *pdwContentType); + +/* filter for page-fault exceptions */ +static WINE_EXCEPTION_FILTER(page_fault) +{ + if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) + return EXCEPTION_EXECUTE_HANDLER; + return EXCEPTION_CONTINUE_SEARCH; +} + static void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, HCRYPTPROV hCryptProv, DWORD dwFlags, CertStoreType type) { @@ -407,7 +523,6 @@ */ list_remove(&cert->entry); cert->entry.prev = cert->entry.next = &store->certs; - CertFreeCertificateContext((PCCERT_CONTEXT)cert); break; } } @@ -668,10 +783,7 @@ ret = CertDeleteCertificateFromStore((PCCERT_CONTEXT)context->childContext); if (ret) - { context->childContext = NULL; - CertFreeCertificateContext((PCCERT_CONTEXT)context); - } return ret; } @@ -716,59 +828,789 @@ return (PWINECRYPT_CERTSTORE)store; } -static void WINAPI CRYPT_DummyCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) +static void CRYPT_HashToStr(LPBYTE hash, LPWSTR asciiHash) +{ + static const WCHAR fmt[] = { '%','0','2','X',0 }; + DWORD i; + + assert(hash); + assert(asciiHash); + + for (i = 0; i < 20; i++) + wsprintfW(asciiHash + i * 2, fmt, hash[i]); +} + +static const WCHAR CertsW[] = { 'C','e','r','t','i','f','i','c','a','t','e','s', + 0 }; +static const WCHAR CRLsW[] = { 'C','R','L','s',0 }; +static const WCHAR CTLsW[] = { 'C','T','L','s',0 }; +static const WCHAR BlobW[] = { 'B','l','o','b',0 }; + +static void CRYPT_RegReadSerializedFromReg(PWINE_REGSTORE store, HKEY key, + DWORD contextType) +{ + LONG rc; + DWORD index = 0; + WCHAR subKeyName[MAX_PATH]; + + do { + DWORD size = sizeof(subKeyName) / sizeof(WCHAR); + + rc = RegEnumKeyExW(key, index++, subKeyName, &size, NULL, NULL, NULL, + NULL); + if (!rc) + { + HKEY subKey; + + rc = RegOpenKeyExW(key, subKeyName, 0, KEY_READ, &subKey); + if (!rc) + { + LPBYTE buf = NULL; + + size = 0; + rc = RegQueryValueExW(subKey, BlobW, NULL, NULL, NULL, &size); + if (!rc) + buf = HeapAlloc(GetProcessHeap(), 0, size); + if (buf) + { + rc = RegQueryValueExW(subKey, BlobW, NULL, NULL, buf, + &size); + if (!rc) + { + const void *context; + DWORD addedType; + + TRACE("Adding cert with hash %s\n", + debugstr_w(subKeyName)); + context = CRYPT_ReadSerializedElement(buf, size, + contextType, &addedType); + if (context) + { + const WINE_CONTEXT_INTERFACE *contextInterface; + BYTE hash[20]; + + switch (addedType) + { + case CERT_STORE_CERTIFICATE_CONTEXT: + contextInterface = &gCertInterface; + break; + case CERT_STORE_CRL_CONTEXT: + contextInterface = &gCRLInterface; + break; + case CERT_STORE_CTL_CONTEXT: + contextInterface = &gCTLInterface; + break; + default: + contextInterface = NULL; + } + if (contextInterface) + { + size = sizeof(hash); + if (contextInterface->getProp(context, + CERT_HASH_PROP_ID, hash, &size)) + { + WCHAR asciiHash[20 * 2 + 1]; + + CRYPT_HashToStr(hash, asciiHash); + TRACE("comparing %s\n", + debugstr_w(asciiHash)); + TRACE("with %s\n", debugstr_w(subKeyName)); + if (!lstrcmpW(asciiHash, subKeyName)) + { + TRACE("hash matches, adding\n"); + contextInterface->addContextToStore( + store, context, + CERT_STORE_ADD_REPLACE_EXISTING, NULL); + } + else + { + TRACE("hash doesn't match, ignoring\n"); + contextInterface->free(context); + } + } + } + } + } + HeapFree(GetProcessHeap(), 0, buf); + } + RegCloseKey(subKey); + } + /* Ignore intermediate errors, continue enumerating */ + rc = ERROR_SUCCESS; + } + } while (!rc); +} + +static void CRYPT_RegReadFromReg(PWINE_REGSTORE store) +{ + static const WCHAR *subKeys[] = { CertsW, CRLsW, CTLsW }; + static const DWORD contextFlags[] = { CERT_STORE_CERTIFICATE_CONTEXT_FLAG, + CERT_STORE_CRL_CONTEXT_FLAG, CERT_STORE_CTL_CONTEXT_FLAG }; + DWORD i; + + for (i = 0; i < sizeof(subKeys) / sizeof(subKeys[0]); i++) + { + HKEY key; + LONG rc; + + rc = RegCreateKeyExW(store->key, subKeys[i], 0, NULL, 0, KEY_READ, NULL, + &key, NULL); + if (!rc) + { + CRYPT_RegReadSerializedFromReg(store, key, contextFlags[i]); + RegCloseKey(key); + } + } +} + +/* Hash is assumed to be 20 bytes in length (a SHA-1 hash) */ +static BOOL CRYPT_WriteSerializedToReg(HKEY key, LPBYTE hash, LPBYTE buf, + DWORD len) { - HeapFree(GetProcessHeap(), 0, (PWINECRYPT_CERTSTORE)hCertStore); + WCHAR asciiHash[20 * 2 + 1]; + LONG rc; + HKEY subKey; + BOOL ret; + + CRYPT_HashToStr(hash, asciiHash); + rc = RegCreateKeyExW(key, asciiHash, 0, NULL, 0, KEY_ALL_ACCESS, NULL, + &subKey, NULL); + if (!rc) + { + rc = RegSetValueExW(subKey, BlobW, 0, REG_BINARY, buf, len); + RegCloseKey(subKey); + } + if (!rc) + ret = TRUE; + else + { + SetLastError(rc); + ret = FALSE; + } + return ret; } -static BOOL WINAPI CRYPT_DummyAddCert(HCERTSTORE store, PCCERT_CONTEXT pCert, +static BOOL CRYPT_SerializeContextsToReg(HKEY key, + const WINE_CONTEXT_INTERFACE *contextInterface, HCERTSTORE memStore) +{ + const void *context = NULL; + BOOL ret; + + do { + context = contextInterface->enumContextsInStore(memStore, context); + if (context) + { + BYTE hash[20]; + DWORD hashSize = sizeof(hash); + + ret = contextInterface->getProp(context, CERT_HASH_PROP_ID, hash, + &hashSize); + if (ret) + { + DWORD size = 0; + LPBYTE buf = NULL; + + ret = contextInterface->serialize(context, 0, NULL, &size); + if (size) + buf = HeapAlloc(GetProcessHeap(), 0, size); + if (buf) + { + ret = contextInterface->serialize(context, 0, buf, &size); + if (ret) + ret = CRYPT_WriteSerializedToReg(key, hash, buf, size); + } + HeapFree(GetProcessHeap(), 0, buf); + } + } + else + ret = TRUE; + } while (ret && context != NULL); + if (context) + contextInterface->free(context); + return ret; +} + +static BOOL CRYPT_RegWriteToReg(PWINE_REGSTORE store) +{ + static const WCHAR *subKeys[] = { CertsW, CRLsW, CTLsW }; + static const WINE_CONTEXT_INTERFACE *interfaces[] = { &gCertInterface, + &gCRLInterface, &gCTLInterface }; + struct list *listToDelete[] = { &store->certsToDelete, NULL, NULL }; + BOOL ret = TRUE; + DWORD i; + + for (i = 0; ret && i < sizeof(subKeys) / sizeof(subKeys[0]); i++) + { + HKEY key; + LONG rc = RegCreateKeyExW(store->key, subKeys[i], 0, NULL, 0, + KEY_ALL_ACCESS, NULL, &key, NULL); + + if (!rc) + { + if (listToDelete[i]) + { + PWINE_HASH_TO_DELETE toDelete, next; + WCHAR asciiHash[20 * 2 + 1]; + + EnterCriticalSection(&store->cs); + LIST_FOR_EACH_ENTRY_SAFE(toDelete, next, listToDelete[i], + WINE_HASH_TO_DELETE, entry) + { + LONG rc; + + CRYPT_HashToStr(toDelete->hash, asciiHash); + TRACE("Removing %s\n", debugstr_w(asciiHash)); + rc = RegDeleteKeyW(key, asciiHash); + if (rc != ERROR_SUCCESS && rc != ERROR_FILE_NOT_FOUND) + { + SetLastError(rc); + ret = FALSE; + } + list_remove(&toDelete->entry); + HeapFree(GetProcessHeap(), 0, toDelete); + } + LeaveCriticalSection(&store->cs); + } + ret = CRYPT_SerializeContextsToReg(key, interfaces[i], + store->memStore); + RegCloseKey(key); + } + else + { + SetLastError(rc); + ret = FALSE; + } + } + return ret; +} + +/* If force is true or the registry store is dirty, writes the contents of the + * store to the registry. + */ +static BOOL CRYPT_RegFlushStore(PWINE_REGSTORE store, BOOL force) +{ + BOOL ret; + + if (store->dirty || force) + ret = CRYPT_RegWriteToReg(store); + else + ret = TRUE; + return ret; +} + +static void WINAPI CRYPT_RegCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) +{ + PWINE_REGSTORE store = (PWINE_REGSTORE)hCertStore; + + TRACE("(%p, %08lx)\n", store, dwFlags); + if (dwFlags) + FIXME("Unimplemented flags: %08lx\n", dwFlags); + + CRYPT_RegFlushStore(store, FALSE); + /* certsToDelete should already be cleared by this point */ + store->memStore->closeStore(store->memStore, 0); + RegCloseKey(store->key); + DeleteCriticalSection(&store->cs); + HeapFree(GetProcessHeap(), 0, store); +} + +static BOOL WINAPI CRYPT_RegAddCert(HCERTSTORE hCertStore, PCCERT_CONTEXT cert, DWORD dwAddDisposition) { - return FALSE; + PWINE_REGSTORE store = (PWINE_REGSTORE)hCertStore; + BOOL ret; + + TRACE("(%p, %p, %ld)\n", hCertStore, cert, dwAddDisposition); + + if (store->hdr.dwOpenFlags & CERT_STORE_READONLY_FLAG) + { + SetLastError(ERROR_ACCESS_DENIED); + ret = FALSE; + } + else + { + ret = store->memStore->addCert(store->memStore, cert, dwAddDisposition); + if (ret) + store->dirty = TRUE; + } + return ret; +} + +static PWINE_CERT_CONTEXT_REF CRYPT_RegCreateCertRef( + PWINE_CERT_CONTEXT context, HCERTSTORE store) +{ + PWINE_REG_CERT_CONTEXT ret = HeapAlloc(GetProcessHeap(), 0, + sizeof(WINE_REG_CERT_CONTEXT)); + + if (ret) + { + CRYPT_InitCertRef((PWINE_CERT_CONTEXT_REF)ret, context, store); + ret->childContext = NULL; + } + return (PWINE_CERT_CONTEXT_REF)ret; } -static PWINE_CERT_CONTEXT_REF CRYPT_DummyEnumCert(PWINECRYPT_CERTSTORE store, +static PWINE_CERT_CONTEXT_REF CRYPT_RegEnumCert(PWINECRYPT_CERTSTORE store, PWINE_CERT_CONTEXT_REF pPrev) { - return NULL; + PWINE_REGSTORE rs = (PWINE_REGSTORE)store; + PWINE_CERT_CONTEXT_REF child; + PWINE_REG_CERT_CONTEXT prev = (PWINE_REG_CERT_CONTEXT)pPrev, ret = NULL; + + TRACE("(%p, %p)\n", store, pPrev); + + if (pPrev) + { + child = rs->memStore->enumCert(rs->memStore, prev->childContext); + if (child) + { + ret = (PWINE_REG_CERT_CONTEXT)pPrev; + memcpy(&ret->cert, child, sizeof(WINE_CERT_CONTEXT_REF)); + ret->cert.cert.hCertStore = (HCERTSTORE)store; + ret->childContext = child; + } + } + else + { + child = rs->memStore->enumCert(rs->memStore, NULL); + if (child) + { + ret = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_REG_CERT_CONTEXT)); + + if (ret) + { + memcpy(&ret->cert, child, sizeof(WINE_CERT_CONTEXT_REF)); + ret->cert.cert.hCertStore = (HCERTSTORE)store; + ret->childContext = child; + } + else + CertFreeCertificateContext((PCCERT_CONTEXT)child); + } + } + return (PWINE_CERT_CONTEXT_REF)ret; } -static BOOL WINAPI CRYPT_DummyDeleteCert(HCERTSTORE hCertStore, +static BOOL WINAPI CRYPT_RegDeleteCert(HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwFlags) { - return TRUE; + PWINE_REGSTORE store = (PWINE_REGSTORE)hCertStore; + BOOL ret; + + TRACE("(%p, %p, %08lx)\n", store, pCertContext, dwFlags); + + if (store->hdr.dwOpenFlags & CERT_STORE_READONLY_FLAG) + { + SetLastError(ERROR_ACCESS_DENIED); + ret = FALSE; + } + else + { + PWINE_HASH_TO_DELETE toDelete = + HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_HASH_TO_DELETE)); + + if (toDelete) + { + DWORD size = sizeof(toDelete->hash); + + ret = CertGetCertificateContextProperty(pCertContext, + CERT_HASH_PROP_ID, toDelete->hash, &size); + if (ret) + { + list_init(&toDelete->entry); + EnterCriticalSection(&store->cs); + list_add_tail(&store->certsToDelete, &toDelete->entry); + LeaveCriticalSection(&store->cs); + ret = store->memStore->deleteCert(store->memStore, pCertContext, + dwFlags); + } + else + HeapFree(GetProcessHeap(), 0, toDelete); + } + else + ret = FALSE; + if (ret) + store->dirty = TRUE; + } + return ret; } -static WINECRYPT_CERTSTORE *CRYPT_DummyOpenStore(HCRYPTPROV hCryptProv, +static void CRYPT_RegFreeCert(PWINE_CERT_CONTEXT_REF ref) +{ + PWINE_REG_CERT_CONTEXT context = (PWINE_REG_CERT_CONTEXT)ref; + + TRACE("(%p)\n", ref); + + if (context->childContext) + CertFreeCertificateContext((PCCERT_CONTEXT)context->childContext); +} + +static BOOL WINAPI CRYPT_RegControl(HCERTSTORE hCertStore, DWORD dwFlags, + DWORD dwCtrlType, void const *pvCtrlPara) +{ + PWINE_REGSTORE store = (PWINE_REGSTORE)hCertStore; + BOOL ret; + + switch (dwCtrlType) + { + case CERT_STORE_CTRL_RESYNC: + CRYPT_RegFlushStore(store, FALSE); + store->memStore->closeStore(store->memStore, 0); + store->memStore = CRYPT_MemOpenStore(store->hdr.cryptProv, + store->hdr.dwOpenFlags, NULL); + if (store->memStore) + { + CRYPT_RegReadFromReg(store); + ret = TRUE; + } + else + ret = FALSE; + break; + case CERT_STORE_CTRL_COMMIT: + ret = CRYPT_RegFlushStore(store, + dwFlags & CERT_STORE_CTRL_COMMIT_FORCE_FLAG); + break; + default: + FIXME("%ld: stub\n", dwCtrlType); + ret = FALSE; + } + return ret; +} + +/* Copied from shlwapi's SHDeleteKeyW, and reformatted to match this file. */ +static DWORD CRYPT_RecurseDeleteKey(HKEY hKey, LPCWSTR lpszSubKey) +{ + DWORD dwRet, dwKeyCount = 0, dwMaxSubkeyLen = 0, dwSize, i; + WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf; + HKEY hSubKey = 0; + + TRACE("(hkey=%p,%s)\n", hKey, debugstr_w(lpszSubKey)); + + dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey); + if (!dwRet) + { + /* Find how many subkeys there are */ + dwRet = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, &dwKeyCount, + &dwMaxSubkeyLen, NULL, NULL, NULL, NULL, NULL, NULL); + if (!dwRet) + { + dwMaxSubkeyLen++; + if (dwMaxSubkeyLen > sizeof(szNameBuf)/sizeof(WCHAR)) + { + /* Name too big: alloc a buffer for it */ + lpszName = HeapAlloc(GetProcessHeap(), 0, + dwMaxSubkeyLen*sizeof(WCHAR)); + } + + if (!lpszName) + dwRet = ERROR_NOT_ENOUGH_MEMORY; + else + { + /* Recursively delete all the subkeys */ + for (i = 0; i < dwKeyCount && !dwRet; i++) + { + dwSize = dwMaxSubkeyLen; + dwRet = RegEnumKeyExW(hSubKey, i, lpszName, &dwSize, NULL, + NULL, NULL, NULL); + if (!dwRet) + dwRet = CRYPT_RecurseDeleteKey(hSubKey, lpszName); + } + + if (lpszName != szNameBuf) + { + /* Free buffer if allocated */ + HeapFree(GetProcessHeap(), 0, lpszName); + } + } + } + + RegCloseKey(hSubKey); + if (!dwRet) + dwRet = RegDeleteKeyW(hKey, lpszSubKey); + } + return dwRet; +} + +static WINECRYPT_CERTSTORE *CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara) { - PWINECRYPT_CERTSTORE store; + PWINE_REGSTORE store = NULL; TRACE("(%ld, %08lx, %p)\n", hCryptProv, dwFlags, pvPara); if (dwFlags & CERT_STORE_DELETE_FLAG) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - store = NULL; + DWORD rc = CRYPT_RecurseDeleteKey((HKEY)pvPara, CertsW); + + if (rc == ERROR_SUCCESS || rc == ERROR_NO_MORE_ITEMS) + rc = CRYPT_RecurseDeleteKey((HKEY)pvPara, CRLsW); + if (rc == ERROR_SUCCESS || rc == ERROR_NO_MORE_ITEMS) + rc = CRYPT_RecurseDeleteKey((HKEY)pvPara, CTLsW); + if (rc == ERROR_NO_MORE_ITEMS) + rc = ERROR_SUCCESS; + SetLastError(rc); } else { - store = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(WINECRYPT_CERTSTORE)); - if (store) + HKEY key; + + if (DuplicateHandle(GetCurrentProcess(), (HANDLE)pvPara, + GetCurrentProcess(), (LPHANDLE)&key, + dwFlags & CERT_STORE_READONLY_FLAG ? KEY_READ : KEY_ALL_ACCESS, + TRUE, 0)) { - CRYPT_InitStore(store, hCryptProv, dwFlags, StoreTypeDummy); - store->closeStore = CRYPT_DummyCloseStore; - store->addCert = CRYPT_DummyAddCert; - store->createCertRef = CRYPT_CreateCertRef; - store->enumCert = CRYPT_DummyEnumCert; - store->deleteCert = CRYPT_DummyDeleteCert; - store->freeCert = NULL; + PWINECRYPT_CERTSTORE memStore; + + memStore = CRYPT_MemOpenStore(hCryptProv, dwFlags, NULL); + if (memStore) + { + store = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(WINE_REGSTORE)); + if (store) + { + CRYPT_InitStore(&store->hdr, hCryptProv, dwFlags, + StoreTypeReg); + store->hdr.closeStore = CRYPT_RegCloseStore; + store->hdr.addCert = CRYPT_RegAddCert; + store->hdr.createCertRef = CRYPT_RegCreateCertRef; + store->hdr.enumCert = CRYPT_RegEnumCert; + store->hdr.deleteCert = CRYPT_RegDeleteCert; + store->hdr.freeCert = CRYPT_RegFreeCert; + store->hdr.control = CRYPT_RegControl; + store->memStore = memStore; + store->key = key; + InitializeCriticalSection(&store->cs); + list_init(&store->certsToDelete); + CRYPT_RegReadFromReg(store); + store->dirty = FALSE; + } + } + } + } + TRACE("returning %p\n", store); + return (WINECRYPT_CERTSTORE *)store; +} + +/* FIXME: this isn't complete for the Root store, in which the top-level + * self-signed CA certs reside. Adding a cert to the Root store should present + * the user with a dialog indicating the consequences of doing so, and asking + * the user to confirm whether the cert should be added. + */ +static PWINECRYPT_CERTSTORE CRYPT_SysRegOpenStoreW(HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara) +{ + static const WCHAR fmt[] = { '%','s','\\','%','s',0 }; + LPCWSTR storeName = (LPCWSTR)pvPara; + LPWSTR storePath; + PWINECRYPT_CERTSTORE store = NULL; + HKEY root; + LPCWSTR base; + BOOL ret; + + TRACE("(%ld, %08lx, %s)\n", hCryptProv, dwFlags, + debugstr_w((LPCWSTR)pvPara)); + + if (!pvPara) + { + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return NULL; + } + + ret = TRUE; + switch (dwFlags & CERT_SYSTEM_STORE_LOCATION_MASK) + { + case CERT_SYSTEM_STORE_LOCAL_MACHINE: + root = HKEY_LOCAL_MACHINE; + base = CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH; + break; + case CERT_SYSTEM_STORE_CURRENT_USER: + root = HKEY_CURRENT_USER; + base = CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH; + break; + case CERT_SYSTEM_STORE_CURRENT_SERVICE: + /* hklm\Software\Microsoft\Cryptography\Services\servicename\ + * SystemCertificates + */ + FIXME("CERT_SYSTEM_STORE_CURRENT_SERVICE, %s: stub\n", + debugstr_w(storeName)); + return NULL; + case CERT_SYSTEM_STORE_SERVICES: + /* hklm\Software\Microsoft\Cryptography\Services\servicename\ + * SystemCertificates + */ + FIXME("CERT_SYSTEM_STORE_SERVICES, %s: stub\n", + debugstr_w(storeName)); + return NULL; + case CERT_SYSTEM_STORE_USERS: + /* hku\user sid\Software\Microsoft\SystemCertificates */ + FIXME("CERT_SYSTEM_STORE_USERS, %s: stub\n", + debugstr_w(storeName)); + return NULL; + case CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY: + root = HKEY_CURRENT_USER; + base = CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH; + break; + case CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY: + root = HKEY_LOCAL_MACHINE; + base = CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH; + break; + case CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE: + /* hklm\Software\Microsoft\EnterpriseCertificates */ + FIXME("CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE, %s: stub\n", + debugstr_w(storeName)); + return NULL; + default: + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return NULL; + } + + storePath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(base) + + lstrlenW(storeName) + 2) * sizeof(WCHAR)); + if (storePath) + { + LONG rc; + HKEY key; + REGSAM sam = dwFlags & CERT_STORE_READONLY_FLAG ? KEY_READ : + KEY_ALL_ACCESS; + + wsprintfW(storePath, fmt, base, storeName); + if (dwFlags & CERT_STORE_OPEN_EXISTING_FLAG) + rc = RegOpenKeyExW(root, storePath, 0, sam, &key); + else + { + DWORD disp; + + rc = RegCreateKeyExW(root, storePath, 0, NULL, 0, sam, NULL, + &key, &disp); + if (!rc && dwFlags & CERT_STORE_CREATE_NEW_FLAG && + disp == REG_OPENED_EXISTING_KEY) + { + RegCloseKey(key); + rc = ERROR_FILE_EXISTS; + } + } + if (!rc) + { + store = CRYPT_RegOpenStore(hCryptProv, dwFlags, key); + RegCloseKey(key); + } + else + SetLastError(rc); + HeapFree(GetProcessHeap(), 0, storePath); + } + return store; +} + +static PWINECRYPT_CERTSTORE CRYPT_SysRegOpenStoreA(HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara) +{ + int len; + PWINECRYPT_CERTSTORE ret = NULL; + + TRACE("(%ld, %08lx, %s)\n", hCryptProv, dwFlags, + debugstr_a((LPCSTR)pvPara)); + + if (!pvPara) + { + SetLastError(ERROR_FILE_NOT_FOUND); + return NULL; + } + len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pvPara, -1, NULL, 0); + if (len) + { + LPWSTR storeName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + + if (storeName) + { + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pvPara, -1, storeName, len); + ret = CRYPT_SysRegOpenStoreW(hCryptProv, dwFlags, storeName); + HeapFree(GetProcessHeap(), 0, storeName); + } + } + return ret; +} + +static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara) +{ + HCERTSTORE store = 0; + BOOL ret; + + TRACE("(%ld, %08lx, %s)\n", hCryptProv, dwFlags, + debugstr_w((LPCWSTR)pvPara)); + + if (!pvPara) + { + SetLastError(ERROR_FILE_NOT_FOUND); + return NULL; + } + /* This returns a different error than system registry stores if the + * location is invalid. + */ + switch (dwFlags & CERT_SYSTEM_STORE_LOCATION_MASK) + { + case CERT_SYSTEM_STORE_LOCAL_MACHINE: + case CERT_SYSTEM_STORE_CURRENT_USER: + case CERT_SYSTEM_STORE_CURRENT_SERVICE: + case CERT_SYSTEM_STORE_SERVICES: + case CERT_SYSTEM_STORE_USERS: + case CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY: + case CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY: + case CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE: + ret = TRUE; + break; + default: + SetLastError(ERROR_FILE_NOT_FOUND); + ret = FALSE; + } + if (ret) + { + HCERTSTORE regStore = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, + 0, hCryptProv, dwFlags, pvPara); + + if (regStore) + { + store = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + if (store) + { + CertAddStoreToCollection(store, regStore, + dwFlags & CERT_STORE_READONLY_FLAG ? 0 : + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + CertCloseStore(regStore, 0); + } } } return (PWINECRYPT_CERTSTORE)store; } +static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreA(HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara) +{ + int len; + PWINECRYPT_CERTSTORE ret = NULL; + + TRACE("(%ld, %08lx, %s)\n", hCryptProv, dwFlags, + debugstr_a((LPCSTR)pvPara)); + + if (!pvPara) + { + SetLastError(ERROR_FILE_NOT_FOUND); + return NULL; + } + len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pvPara, -1, NULL, 0); + if (len) + { + LPWSTR storeName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + + if (storeName) + { + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pvPara, -1, storeName, len); + ret = CRYPT_SysOpenStoreW(hCryptProv, dwFlags, storeName); + HeapFree(GetProcessHeap(), 0, storeName); + } + } + return ret; +} HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, @@ -787,13 +1629,23 @@ case (int)CERT_STORE_PROV_MEMORY: openFunc = CRYPT_MemOpenStore; break; + case (int)CERT_STORE_PROV_REG: + openFunc = CRYPT_RegOpenStore; + break; case (int)CERT_STORE_PROV_COLLECTION: openFunc = CRYPT_CollectionOpenStore; break; - case (int)CERT_STORE_PROV_REG: case (int)CERT_STORE_PROV_SYSTEM_A: + openFunc = CRYPT_SysOpenStoreA; + break; case (int)CERT_STORE_PROV_SYSTEM_W: - openFunc = CRYPT_DummyOpenStore; + openFunc = CRYPT_SysOpenStoreW; + break; + case (int)CERT_STORE_PROV_SYSTEM_REGISTRY_A: + openFunc = CRYPT_SysRegOpenStoreA; + break; + case (int)CERT_STORE_PROV_SYSTEM_REGISTRY_W: + openFunc = CRYPT_SysRegOpenStoreW; break; default: if (LOWORD(lpszStoreProvider)) @@ -803,9 +1655,11 @@ else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_MEMORY)) openFunc = CRYPT_MemOpenStore; else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM)) - openFunc = CRYPT_DummyOpenStore; + openFunc = CRYPT_SysOpenStoreW; else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_COLLECTION)) openFunc = CRYPT_CollectionOpenStore; + else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM_REGISTRY)) + openFunc = CRYPT_SysRegOpenStoreW; else { FIXME("unimplemented type %s\n", lpszStoreProvider); @@ -826,17 +1680,64 @@ HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV hProv, LPCSTR szSubSystemProtocol) { - return CertOpenStore( CERT_STORE_PROV_SYSTEM_A, 0, 0, - CERT_SYSTEM_STORE_CURRENT_USER | CERT_SYSTEM_STORE_LOCAL_MACHINE | - CERT_SYSTEM_STORE_USERS, szSubSystemProtocol ); + HCERTSTORE ret = 0; + + if (szSubSystemProtocol) + { + int len = MultiByteToWideChar(CP_ACP, 0, szSubSystemProtocol, -1, NULL, + 0); + LPWSTR param = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + + if (param) + { + MultiByteToWideChar(CP_ACP, 0, szSubSystemProtocol, -1, param, len); + ret = CertOpenSystemStoreW(hProv, param); + HeapFree(GetProcessHeap(), 0, param); + } + } + else + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return ret; } HCERTSTORE WINAPI CertOpenSystemStoreW(HCRYPTPROV hProv, LPCWSTR szSubSystemProtocol) { - return CertOpenStore( CERT_STORE_PROV_SYSTEM_W, 0, 0, - CERT_SYSTEM_STORE_CURRENT_USER | CERT_SYSTEM_STORE_LOCAL_MACHINE | - CERT_SYSTEM_STORE_USERS, szSubSystemProtocol ); + HCERTSTORE ret; + + if (!szSubSystemProtocol) + { + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return 0; + } + + /* FIXME: needs some tests. It seems to open both HKEY_LOCAL_MACHINE and + * HKEY_CURRENT_USER stores, but I'm not sure under what conditions, if any, + * it fails. + */ + ret = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, hProv, + CERT_STORE_CREATE_NEW_FLAG, NULL); + if (ret) + { + HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, + 0, hProv, CERT_SYSTEM_STORE_LOCAL_MACHINE, szSubSystemProtocol); + + if (store) + { + CertAddStoreToCollection(ret, store, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + CertCloseStore(store, 0); + } + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, + 0, hProv, CERT_SYSTEM_STORE_CURRENT_USER, szSubSystemProtocol); + if (store) + { + CertAddStoreToCollection(ret, store, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + CertCloseStore(store, 0); + } + } + return ret; } BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, @@ -885,16 +1786,35 @@ { PWINE_CERT_CONTEXT cert = NULL; BOOL ret; + PCERT_SIGNED_CONTENT_INFO signedCert = NULL; PCERT_INFO certInfo = NULL; DWORD size = 0; TRACE("(%08lx, %p, %ld)\n", dwCertEncodingType, pbCertEncoded, cbCertEncoded); - ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_CERT_TO_BE_SIGNED, - pbCertEncoded, cbCertEncoded, - CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, NULL, - (BYTE *)&certInfo, &size); + /* First try to decode it as a signed cert. */ + ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_CERT, pbCertEncoded, + cbCertEncoded, CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, NULL, + (BYTE *)&signedCert, &size); + if (ret) + { + size = 0; + ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_CERT_TO_BE_SIGNED, + signedCert->ToBeSigned.pbData, signedCert->ToBeSigned.cbData, + CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, NULL, + (BYTE *)&certInfo, &size); + LocalFree(signedCert); + } + /* Failing that, try it as an unsigned cert */ + if (!ret) + { + size = 0; + ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_CERT_TO_BE_SIGNED, + pbCertEncoded, cbCertEncoded, + CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, NULL, + (BYTE *)&certInfo, &size); + } if (ret) { BYTE *data = NULL; @@ -930,7 +1850,6 @@ HeapFree(GetProcessHeap(), 0, context->cert.pbCertEncoded); LocalFree(context->cert.pCertInfo); - HeapFree(GetProcessHeap(), 0, context); DeleteCriticalSection(&context->cs); LIST_FOR_EACH_ENTRY_SAFE(prop, next, &context->extendedProperties, WINE_CERT_PROPERTY, entry) @@ -939,6 +1858,7 @@ HeapFree(GetProcessHeap(), 0, prop->pbData); HeapFree(GetProcessHeap(), 0, prop); } + HeapFree(GetProcessHeap(), 0, context); } PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType, @@ -1414,7 +2334,10 @@ if (!pCertContext) ret = TRUE; else if (!pCertContext->hCertStore) + { ret = TRUE; + CertFreeCertificateContext(pCertContext); + } else { PWINECRYPT_CERTSTORE hcs = @@ -1425,7 +2348,10 @@ else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC) ret = FALSE; else + { ret = hcs->deleteCert(hcs, pCertContext, 0); + CertFreeCertificateContext(pCertContext); + } } return ret; } @@ -1530,7 +2456,7 @@ if (InterlockedDecrement(&hcs->ref) == 0) { - TRACE("freeing %p\n", hcs); + TRACE("%p's ref count is 0, freeing\n", hcs); hcs->dwMagic = 0; if (!(hcs->dwOpenFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG)) CryptReleaseContext(hcs->cryptProv, 0); @@ -1544,9 +2470,24 @@ BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara) { - FIXME("(%p, %08lx, %ld, %p): stub\n", hCertStore, dwFlags, dwCtrlType, + WINECRYPT_CERTSTORE *hcs = (WINECRYPT_CERTSTORE *)hCertStore; + BOOL ret; + + TRACE("(%p, %08lx, %ld, %p)\n", hCertStore, dwFlags, dwCtrlType, pvCtrlPara); - return TRUE; + + if (!hcs) + ret = FALSE; + else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC) + ret = FALSE; + else + { + if (hcs->control) + ret = hcs->control(hCertStore, dwFlags, dwCtrlType, pvCtrlPara); + else + ret = TRUE; + } + return ret; } BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext, @@ -1655,14 +2596,293 @@ return ret; } +/* Looks for the property with ID propID in the buffer buf. Returns a pointer + * to its header if a valid header is found, NULL if not. Valid means the + * length of thte property won't overrun buf, and the unknown field is 1. + */ +static const WINE_CERT_PROP_HEADER *CRYPT_findPropID(const BYTE *buf, + DWORD size, DWORD propID) +{ + const WINE_CERT_PROP_HEADER *ret = NULL; + BOOL done = FALSE; + + while (size && !ret && !done) + { + if (size < sizeof(WINE_CERT_PROP_HEADER)) + { + SetLastError(CRYPT_E_FILE_ERROR); + done = TRUE; + } + else + { + const WINE_CERT_PROP_HEADER *hdr = + (const WINE_CERT_PROP_HEADER *)buf; + + size -= sizeof(WINE_CERT_PROP_HEADER); + buf += sizeof(WINE_CERT_PROP_HEADER); + if (size < hdr->cb) + { + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + done = TRUE; + } + else if (!hdr->propID) + { + /* assume a zero prop ID means the data are uninitialized, so + * stop looking. + */ + done = TRUE; + } + else if (hdr->unknown != 1) + { + SetLastError(ERROR_FILE_NOT_FOUND); + done = TRUE; + } + else if (hdr->propID == propID) + ret = hdr; + else + { + buf += hdr->cb; + size -= hdr->cb; + } + } + } + return ret; +} + +static const void * WINAPI CRYPT_ReadSerializedElement(const BYTE *pbElement, + DWORD cbElement, DWORD dwContextTypeFlags, DWORD *pdwContentType) +{ + const void *context; + + TRACE("(%p, %ld, %08lx, %p)\n", pbElement, cbElement, dwContextTypeFlags, + pdwContentType); + + if (!cbElement) + { + SetLastError(ERROR_END_OF_MEDIA); + return NULL; + } + + __TRY + { + const WINE_CONTEXT_INTERFACE *contextInterface = NULL; + const WINE_CERT_PROP_HEADER *hdr = NULL; + DWORD type = 0; + BOOL ret; + + ret = TRUE; + context = NULL; + if (dwContextTypeFlags == CERT_STORE_ALL_CONTEXT_FLAG) + { + hdr = CRYPT_findPropID(pbElement, cbElement, CERT_CERT_PROP_ID); + if (hdr) + type = CERT_STORE_CERTIFICATE_CONTEXT; + else + { + hdr = CRYPT_findPropID(pbElement, cbElement, CERT_CRL_PROP_ID); + if (hdr) + type = CERT_STORE_CRL_CONTEXT; + else + { + hdr = CRYPT_findPropID(pbElement, cbElement, + CERT_CTL_PROP_ID); + if (hdr) + type = CERT_STORE_CTL_CONTEXT; + } + } + } + else if (dwContextTypeFlags & CERT_STORE_CERTIFICATE_CONTEXT_FLAG) + { + hdr = CRYPT_findPropID(pbElement, cbElement, CERT_CERT_PROP_ID); + type = CERT_STORE_CERTIFICATE_CONTEXT; + } + else if (dwContextTypeFlags & CERT_STORE_CRL_CONTEXT_FLAG) + { + hdr = CRYPT_findPropID(pbElement, cbElement, CERT_CRL_PROP_ID); + type = CERT_STORE_CRL_CONTEXT; + } + else if (dwContextTypeFlags & CERT_STORE_CTL_CONTEXT_FLAG) + { + hdr = CRYPT_findPropID(pbElement, cbElement, CERT_CTL_PROP_ID); + type = CERT_STORE_CTL_CONTEXT; + } + + switch (type) + { + case CERT_STORE_CERTIFICATE_CONTEXT: + contextInterface = &gCertInterface; + break; + case CERT_STORE_CRL_CONTEXT: + contextInterface = &gCRLInterface; + break; + case CERT_STORE_CTL_CONTEXT: + contextInterface = &gCTLInterface; + break; + default: + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + ret = FALSE; + } + if (!hdr) + ret = FALSE; + + if (ret) + context = contextInterface->create(X509_ASN_ENCODING, + (BYTE *)hdr + sizeof(WINE_CERT_PROP_HEADER), hdr->cb); + if (ret && context) + { + BOOL noMoreProps = FALSE; + + while (!noMoreProps && ret) + { + if (cbElement < sizeof(WINE_CERT_PROP_HEADER)) + ret = FALSE; + else + { + const WINE_CERT_PROP_HEADER *hdr = + (const WINE_CERT_PROP_HEADER *)pbElement; + + TRACE("prop is %ld\n", hdr->propID); + cbElement -= sizeof(WINE_CERT_PROP_HEADER); + pbElement += sizeof(WINE_CERT_PROP_HEADER); + if (cbElement < hdr->cb) + { + SetLastError(HRESULT_FROM_WIN32( + ERROR_INVALID_PARAMETER)); + ret = FALSE; + } + else if (!hdr->propID) + { + /* Like in CRYPT_findPropID, stop if the propID is zero + */ + noMoreProps = TRUE; + } + else if (hdr->unknown != 1) + { + SetLastError(ERROR_FILE_NOT_FOUND); + ret = FALSE; + } + else if (hdr->propID != CERT_CERT_PROP_ID && + hdr->propID != CERT_CRL_PROP_ID && hdr->propID != + CERT_CTL_PROP_ID) + { + /* Have to create a blob for most types, but not + * for all.. arghh. + */ + switch (hdr->propID) + { + case CERT_AUTO_ENROLL_PROP_ID: + case CERT_CTL_USAGE_PROP_ID: + case CERT_DESCRIPTION_PROP_ID: + case CERT_FRIENDLY_NAME_PROP_ID: + case CERT_HASH_PROP_ID: + case CERT_KEY_IDENTIFIER_PROP_ID: + case CERT_MD5_HASH_PROP_ID: + case CERT_NEXT_UPDATE_LOCATION_PROP_ID: + case CERT_PUBKEY_ALG_PARA_PROP_ID: + case CERT_PVK_FILE_PROP_ID: + case CERT_SIGNATURE_HASH_PROP_ID: + case CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID: + case CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID: + case CERT_ENROLLMENT_PROP_ID: + case CERT_CROSS_CERT_DIST_POINTS_PROP_ID: + case CERT_RENEWAL_PROP_ID: + { + CRYPT_DATA_BLOB blob = { hdr->cb, + (LPBYTE)pbElement }; + + ret = contextInterface->setProp(context, + hdr->propID, 0, &blob); + break; + } + case CERT_DATE_STAMP_PROP_ID: + ret = contextInterface->setProp(context, + hdr->propID, 0, pbElement); + break; + default: + FIXME("prop ID %ld: stub\n", hdr->propID); + } + } + pbElement += hdr->cb; + cbElement -= hdr->cb; + if (!cbElement) + noMoreProps = TRUE; + } + } + if (ret) + { + if (pdwContentType) + *pdwContentType = type; + } + else + { + contextInterface->free(context); + context = NULL; + } + } + } + __EXCEPT(page_fault) + { + SetLastError(STATUS_ACCESS_VIOLATION); + context = NULL; + } + __ENDTRY + return context; +} + BOOL WINAPI CertAddSerializedElementToStore(HCERTSTORE hCertStore, const BYTE *pbElement, DWORD cbElement, DWORD dwAddDisposition, DWORD dwFlags, DWORD dwContextTypeFlags, DWORD *pdwContentType, const void **ppvContext) { - FIXME("(%p, %p, %ld, %08lx, %08lx, %08lx, %p, %p): stub\n", hCertStore, + const void *context; + DWORD type; + BOOL ret; + + TRACE("(%p, %p, %ld, %08lx, %08lx, %08lx, %p, %p)\n", hCertStore, pbElement, cbElement, dwAddDisposition, dwFlags, dwContextTypeFlags, pdwContentType, ppvContext); - return FALSE; + + /* Call the internal function, then delete the hashes. Tests show this + * function uses real hash values, not whatever's stored in the hash + * property. + */ + context = CRYPT_ReadSerializedElement(pbElement, cbElement, + dwContextTypeFlags, &type); + if (context) + { + const WINE_CONTEXT_INTERFACE *contextInterface = NULL; + + switch (type) + { + case CERT_STORE_CERTIFICATE_CONTEXT: + contextInterface = &gCertInterface; + break; + case CERT_STORE_CRL_CONTEXT: + contextInterface = &gCRLInterface; + break; + case CERT_STORE_CTL_CONTEXT: + contextInterface = &gCTLInterface; + break; + default: + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + } + if (contextInterface) + { + contextInterface->setProp(context, CERT_HASH_PROP_ID, 0, NULL); + contextInterface->setProp(context, CERT_MD5_HASH_PROP_ID, 0, NULL); + contextInterface->setProp(context, CERT_SIGNATURE_HASH_PROP_ID, 0, + NULL); + if (pdwContentType) + *pdwContentType = type; + ret = contextInterface->addContextToStore(hCertStore, context, + dwAddDisposition, ppvContext); + contextInterface->free(context); + } + else + ret = FALSE; + } + else + ret = FALSE; + return ret; } BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext) @@ -1676,12 +2896,11 @@ if (InterlockedDecrement(&ref->context->ref) == 0) { - TRACE("freeing %p\n", ref->context); + TRACE("%p's ref count is 0, freeing\n", ref->context); CRYPT_FreeCert(ref->context); } else - TRACE("%p's ref count is %ld\n", ref->context, - ref->context->ref); + TRACE("%p's ref count is %ld\n", ref->context, ref->context->ref); if (store && store->dwMagic == WINE_CRYPTCERTSTORE_MAGIC && store->freeCert) store->freeCert(ref); @@ -1923,3 +3142,16 @@ } return ret; } + +HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, DWORD dwFlags) +{ + FIXME("stub: %s %lx\n", debugstr_a(pszFuncName), dwFlags); + return NULL; +} + +BOOL WINAPI CryptUnregisterDefaultOIDFunction(DWORD dwEncodingType, + LPCSTR pszFuncName, LPCWSTR pwszDll) +{ + FIXME("stub: %lx %s %s\n", dwEncodingType, debugstr_a(pszFuncName), debugstr_w(pwszDll)); + return FALSE; +} diff -urN wine-20050830/dlls/crypt32/crypt32.spec wine-20050930/dlls/crypt32/crypt32.spec --- wine-20050830/dlls/crypt32/crypt32.spec 2005-08-26 10:46:48.000000000 +0200 +++ wine-20050930/dlls/crypt32/crypt32.spec 2005-09-28 12:15:37.000000000 +0200 @@ -98,8 +98,8 @@ @ stub CryptEnumOIDInfo @ stub CryptEnumProvidersU @ stub CryptExportPKCS8 -@ stub CryptExportPublicKeyInfo -@ stub CryptExportPublicKeyInfoEx +@ stdcall CryptExportPublicKeyInfo(long long long ptr ptr) +@ stdcall CryptExportPublicKeyInfoEx(long long long str long ptr ptr ptr) @ stub CryptFindOIDInfo @ stub CryptFormatObject @ stub CryptFreeOIDFunctionAddress @@ -115,9 +115,9 @@ @ stub CryptHashPublicKeyInfo @ stub CryptHashToBeSigned @ stub CryptImportPKCS8 -@ stub CryptImportPublicKeyInfo -@ stub CryptImportPublicKeyInfoEx -@ stub CryptInitOIDFunctionSet +@ stdcall CryptImportPublicKeyInfo(long long ptr ptr) +@ stdcall CryptImportPublicKeyInfoEx(long long ptr long long ptr ptr) +@ stdcall CryptInitOIDFunctionSet(str long) @ stub CryptInstallOIDFunctionAddress @ stub CryptLoadSip @ stub CryptMemAlloc @@ -154,7 +154,7 @@ @ stub CryptSignMessage @ stub CryptSignMessageWithKey @ stdcall CryptUnprotectData(ptr ptr ptr ptr ptr long ptr) -@ stub CryptUnregisterDefaultOIDFunction +@ stdcall CryptUnregisterDefaultOIDFunction(long str wstr) @ stdcall CryptUnregisterOIDFunction(long str str) @ stub CryptUnregisterOIDInfo @ stub CryptVerifyCertificateSignature diff -urN wine-20050830/dlls/crypt32/encode.c wine-20050930/dlls/crypt32/encode.c --- wine-20050830/dlls/crypt32/encode.c 2005-08-29 16:12:44.000000000 +0200 +++ wine-20050930/dlls/crypt32/encode.c 2005-09-30 12:35:31.000000000 +0200 @@ -115,6 +115,9 @@ static BOOL WINAPI CRYPT_AsnEncodeInteger(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded); +static BOOL WINAPI CRYPT_AsnEncodeUnsignedInteger(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded); static BOOL WINAPI CRYPT_AsnEncodeChoiceOfTime(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded); @@ -141,7 +144,8 @@ static BOOL WINAPI CRYPT_AsnDecodeBool(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo); -static BOOL WINAPI CRYPT_AsnDecodeOctets(DWORD dwCertEncodingType, +/* Assumes the CRYPT_DATA_BLOB's pbData member has been initialized */ +static BOOL WINAPI CRYPT_AsnDecodeOctetsInternal(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo); /* Like CRYPT_AsnDecodeBits, but assumes the CRYPT_INTEGER_BLOB's pbData @@ -164,6 +168,11 @@ static BOOL WINAPI CRYPT_AsnDecodeIntegerInternal(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo); +/* Like CRYPT_AsnDecodeInteger, but unsigned. */ +static BOOL WINAPI CRYPT_AsnDecodeUnsignedIntegerInternal( + DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, + DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, + void *pvStructInfo, DWORD *pcbStructInfo); /* filter for page-fault exceptions */ static WINE_EXCEPTION_FILTER(page_fault) @@ -190,7 +199,7 @@ */ if (!HIWORD(pszOID)) { - snprintf(numericOID, sizeof(numericOID), "#%d", (int)pszOID); + snprintf(numericOID, sizeof(numericOID), "#%d", LOWORD(pszOID)); oid = numericOID; } else @@ -956,7 +965,6 @@ { &info->ThisUpdate, CRYPT_AsnEncodeChoiceOfTime, 0 }, { 0 } }; - struct AsnConstructedItem constructed = { 0 }; DWORD cItem = 4; if (info->NextUpdate.dwLowDateTime || info->NextUpdate.dwHighDateTime) @@ -973,13 +981,8 @@ } if (info->cExtension) { - /* FIXME: is this really constructed? if so, is this the right tag? - */ - constructed.tag = 3; - constructed.pvStructInfo = &info->cExtension; - constructed.encodeFunc = CRYPT_AsnEncodeExtensions; - items[cItem].pvStructInfo = &constructed; - items[cItem].encodeFunc = CRYPT_AsnEncodeConstructed; + items[cItem].pvStructInfo = &info->cExtension; + items[cItem].encodeFunc = CRYPT_AsnEncodeExtensions; cItem++; } @@ -1318,11 +1321,12 @@ { BOOL ret; CRYPT_DER_BLOB *blobs = NULL; - + __TRY { DWORD bytesNeeded = 0, lenBytes, i; + blobs = NULL; ret = TRUE; if (rdn->cRDNAttr) { @@ -1389,7 +1393,7 @@ __EXCEPT(page_fault) { SetLastError(STATUS_ACCESS_VIOLATION); - ret = FALSE; + return FALSE; } __ENDTRY HeapFree(GetProcessHeap(), 0, blobs); @@ -1571,6 +1575,7 @@ *pcbEncoded = bytesNeeded; } } + TRACE("returning %d (%08lx)\n", ret, GetLastError()); return ret; } @@ -1599,6 +1604,15 @@ &len); if (ret) dataLen += len; + else if (GetLastError() == CRYPT_E_INVALID_IA5_STRING) + { + /* CRYPT_AsnEncodeAltNameEntry encoded the index of + * the bad character, now set the index of the bad + * entry + */ + *pcbEncoded = (BYTE)i << + CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT | len; + } } if (ret) { @@ -1630,15 +1644,6 @@ pbEncoded += len; dataLen -= len; } - else if (GetLastError() == CRYPT_E_INVALID_IA5_STRING) - { - /* CRYPT_AsnEncodeAltNameEntry encoded the index of - * the bad character, now set the index of the bad - * entry - */ - *pcbEncoded |= (BYTE)i << - CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT; - } } } } @@ -1690,6 +1695,47 @@ return ret; } +static BOOL WINAPI CRYPT_AsnEncodeRsaPubKey(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + BOOL ret; + + __TRY + { + const BLOBHEADER *hdr = + (const BLOBHEADER *)pvStructInfo; + + if (hdr->bType != PUBLICKEYBLOB) + { + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + ret = FALSE; + } + else + { + const RSAPUBKEY *rsaPubKey = (const RSAPUBKEY *) + ((const BYTE *)pvStructInfo + sizeof(BLOBHEADER)); + CRYPT_INTEGER_BLOB blob = { rsaPubKey->bitlen / 8, + (BYTE *)pvStructInfo + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) }; + struct AsnEncodeSequenceItem items[] = { + { &blob, CRYPT_AsnEncodeUnsignedInteger, 0 }, + { &rsaPubKey->pubexp, CRYPT_AsnEncodeInt, 0 }, + }; + + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded, + pcbEncoded); + } + } + __EXCEPT(page_fault) + { + SetLastError(STATUS_ACCESS_VIOLATION); + ret = FALSE; + } + __ENDTRY + return ret; +} + static BOOL WINAPI CRYPT_AsnEncodeOctets(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) @@ -2277,6 +2323,9 @@ case (WORD)X509_BASIC_CONSTRAINTS2: encodeFunc = CRYPT_AsnEncodeBasicConstraints2; break; + case (WORD)RSA_CSP_PUBLICKEYBLOB: + encodeFunc = CRYPT_AsnEncodeRsaPubKey; + break; case (WORD)X509_OCTET_STRING: encodeFunc = CRYPT_AsnEncodeOctets; break; @@ -2404,8 +2453,16 @@ } else if (pbEncoded[1] <= 0x7f) { - *len = pbEncoded[1]; - ret = TRUE; + if (pbEncoded[1] + 1 > cbEncoded) + { + SetLastError(CRYPT_E_ASN1_EOD); + ret = FALSE; + } + else + { + *len = pbEncoded[1]; + ret = TRUE; + } } else { @@ -2486,6 +2543,10 @@ * decoded, but minSize space is reserved for it. * minSize: * The minimum amount of space occupied after decoding. You must set this. + * optional: + * If true, and a decoding function fails with CRYPT_E_ASN1_BADTAG, then + * minSize space is filled with 0 for this member. (Any other failure + * results in CRYPT_AsnDecodeSequence failing.) * hasPointer, pointerOffset, minSize: * If the item has dynamic data, set hasPointer to TRUE, pointerOffset to * the offset within the (outer) struct of the data pointer (or to the @@ -2512,7 +2573,6 @@ * here. Otherwise, pass NULL, and one will be inferred from the items. * Each item decoder is never called with CRYPT_DECODE_ALLOC_FLAG set. * If any undecoded data are left over, fails with CRYPT_E_ASN1_CORRUPT. - * FIXME: use to decode more sequences. */ static BOOL CRYPT_AsnDecodeSequence(DWORD dwCertEncodingType, struct AsnDecodeSequenceItem items[], DWORD cItem, const BYTE *pbEncoded, @@ -2521,8 +2581,9 @@ { BOOL ret; - TRACE("%p, %ld, %p, %ld, %08lx, %p, %p, %ld\n", items, cItem, pbEncoded, - cbEncoded, dwFlags, pDecodePara, pvStructInfo, *pcbStructInfo); + TRACE("%p, %ld, %p, %ld, %08lx, %p, %p, %ld, %p\n", items, cItem, pbEncoded, + cbEncoded, dwFlags, pDecodePara, pvStructInfo, *pcbStructInfo, + startingPointer); if (pbEncoded[0] == ASN_SEQUENCE) { @@ -2549,6 +2610,7 @@ if (items[i].decodeFunc) { + TRACE("sizing item %ld\n", i); ret = items[i].decodeFunc(dwCertEncodingType, NULL, ptr, 1 + nextItemLenBytes + nextItemLen, dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, NULL, @@ -2565,10 +2627,14 @@ else if (items[i].optional && GetLastError() == CRYPT_E_ASN1_BADTAG) { + TRACE("skipping optional item %ld\n", i); bytesNeeded += items[i].minSize; SetLastError(NOERROR); ret = TRUE; } + else + TRACE("item %ld failed: %08lx\n", i, + GetLastError()); } else bytesNeeded += items[i].minSize; @@ -2582,6 +2648,13 @@ ret = FALSE; } } + if (cbEncoded - (ptr - pbEncoded) != 0) + { + TRACE("%ld remaining bytes, failing\n", cbEncoded - + (ptr - pbEncoded)); + SetLastError(CRYPT_E_ASN1_CORRUPT); + ret = FALSE; + } if (ret) { if (!pvStructInfo) @@ -2609,14 +2682,22 @@ CRYPT_GetLen(ptr, cbEncoded - (ptr - pbEncoded), &nextItemLen); if (items[i].hasPointer) + { *(BYTE **)((BYTE *)pvStructInfo + items[i].pointerOffset) = nextData; + } if (items[i].decodeFunc) + { + TRACE("decoding item %ld\n", i); ret = items[i].decodeFunc(dwCertEncodingType, NULL, ptr, 1 + nextItemLenBytes + nextItemLen, dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)pvStructInfo + items[i].offset, &items[i].size); + if (!ret) + TRACE("item %ld failed: %08lx\n", i, + GetLastError()); + } else items[i].size = items[i].minSize; if (ret) @@ -2628,8 +2709,10 @@ items[i].minSize; /* align nextData to DWORD boundaries */ if (items[i].size % sizeof(DWORD)) + { nextData += sizeof(DWORD) - items[i].size % sizeof(DWORD); + } } ptr += 1 + nextItemLenBytes + nextItemLen; } @@ -2715,21 +2798,33 @@ { BOOL ret; + TRACE("(%p, %ld, 0x%08lx, %p, %p, %ld)\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); + + /* Can't use the CRYPT_DECODE_NOCOPY_FLAG, because we modify the bytes in- + * place. + */ ret = CRYPT_AsnDecodeBitsInternal(dwCertEncodingType, lpszStructType, - pbEncoded, cbEncoded, dwFlags, pDecodePara, pvStructInfo, pcbStructInfo); + pbEncoded, cbEncoded, dwFlags & ~CRYPT_DECODE_NOCOPY_FLAG, pDecodePara, + pvStructInfo, pcbStructInfo); if (ret && pvStructInfo) { CRYPT_BIT_BLOB *blob = (CRYPT_BIT_BLOB *)pvStructInfo; - DWORD i; - BYTE temp; - for (i = 0; i < blob->cbData / 2; i++) + if (blob->cbData) { - temp = blob->pbData[i]; - blob->pbData[i] = blob->pbData[blob->cbData - i - 1]; - blob->pbData[blob->cbData - i - 1] = temp; + DWORD i; + BYTE temp; + + for (i = 0; i < blob->cbData / 2; i++) + { + temp = blob->pbData[i]; + blob->pbData[i] = blob->pbData[blob->cbData - i - 1]; + blob->pbData[blob->cbData - i - 1] = temp; + } } } + TRACE("returning %d (%08lx)\n", ret, GetLastError()); return ret; } @@ -2751,7 +2846,7 @@ { offsetof(CERT_SIGNED_CONTENT_INFO, SignatureAlgorithm), CRYPT_AsnDecodeAlgorithmId, sizeof(CRYPT_ALGORITHM_IDENTIFIER), FALSE, TRUE, offsetof(CERT_SIGNED_CONTENT_INFO, - SignatureAlgorithm.Parameters.pbData), 0 }, + SignatureAlgorithm.pszObjId), 0 }, { offsetof(CERT_SIGNED_CONTENT_INFO, Signature), CRYPT_AsnDecodeBitsSwapBytes, sizeof(CRYPT_BIT_BLOB), FALSE, TRUE, offsetof(CERT_SIGNED_CONTENT_INFO, Signature.pbData), 0 }, @@ -2818,6 +2913,33 @@ return ret; } +static BOOL WINAPI CRYPT_AsnDecodeCertExtensions(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret; + + if (pbEncoded[0] == (ASN_CONTEXT | ASN_CONSTRUCTOR | 3)) + { + DWORD dataLen; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + { + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + + ret = CRYPT_AsnDecodeExtensionsInternal(dwCertEncodingType, + X509_EXTENSIONS, pbEncoded + 1 + lenBytes, dataLen, dwFlags, + pDecodePara, pvStructInfo, pcbStructInfo); + } + } + else + { + SetLastError(CRYPT_E_ASN1_BADTAG); + ret = FALSE; + } + return ret; +} + static BOOL WINAPI CRYPT_AsnDecodeCertInfo(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) @@ -2837,7 +2959,7 @@ SerialNumber.pbData), 0 }, { offsetof(CERT_INFO, SignatureAlgorithm), CRYPT_AsnDecodeAlgorithmId, sizeof(CRYPT_ALGORITHM_IDENTIFIER), FALSE, TRUE, offsetof(CERT_INFO, - SignatureAlgorithm.Parameters.pbData), 0 }, + SignatureAlgorithm.pszObjId), 0 }, { offsetof(CERT_INFO, Issuer), CRYPT_AsnDecodeDerBlob, sizeof(CRYPT_DER_BLOB), FALSE, TRUE, offsetof(CERT_INFO, Issuer.pbData) }, @@ -2855,7 +2977,7 @@ { offsetof(CERT_INFO, SubjectUniqueId), CRYPT_AsnDecodeBitsInternal, sizeof(CRYPT_BIT_BLOB), TRUE, TRUE, offsetof(CERT_INFO, SubjectUniqueId.pbData), 0 }, - { offsetof(CERT_INFO, cExtension), CRYPT_AsnDecodeExtensionsInternal, + { offsetof(CERT_INFO, cExtension), CRYPT_AsnDecodeCertExtensions, sizeof(CERT_EXTENSIONS), TRUE, TRUE, offsetof(CERT_INFO, rgExtension), 0 }, }; @@ -3023,7 +3145,7 @@ sizeof(DWORD), TRUE, FALSE, 0, 0 }, { offsetof(CRL_INFO, SignatureAlgorithm), CRYPT_AsnDecodeAlgorithmId, sizeof(CRYPT_ALGORITHM_IDENTIFIER), FALSE, TRUE, offsetof(CRL_INFO, - SignatureAlgorithm.Parameters.pbData), 0 }, + SignatureAlgorithm.pszObjId), 0 }, { offsetof(CRL_INFO, Issuer), CRYPT_AsnDecodeDerBlob, sizeof(CRYPT_DER_BLOB), FALSE, TRUE, offsetof(CRL_INFO, Issuer.pbData) }, @@ -3055,97 +3177,57 @@ return ret; } -/* Warning: assumes ext->Value.pbData is set ahead of time! */ -static BOOL CRYPT_AsnDecodeExtension(const BYTE *pbEncoded, DWORD cbEncoded, - DWORD dwFlags, CERT_EXTENSION *ext, DWORD *pcbExt) +/* Differences between this and CRYPT_AsnDecodeOid: + * - pvStructInfo is a LPSTR *, not an LPSTR + * - CRYPT_AsnDecodeOid doesn't account for the size of an LPSTR in its byte + * count, whereas our callers (typically CRYPT_AsnDecodeSequence) expect this + * to + */ +static BOOL WINAPI CRYPT_AsnDecodeOidWrapper(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { - BOOL ret = TRUE; + BOOL ret; - if (pbEncoded[0] == ASN_SEQUENCE) - { - DWORD dataLen, bytesNeeded; + TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); - if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) - { - BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]), oidLenBytes = 0; + ret = CRYPT_AsnDecodeOid(pbEncoded, cbEncoded, dwFlags, + pvStructInfo ? *(LPSTR *)pvStructInfo : NULL, pcbStructInfo); + if (ret || GetLastError() == ERROR_MORE_DATA) + *pcbStructInfo += sizeof(LPSTR); + if (ret && pvStructInfo) + TRACE("returning %s\n", debugstr_a(*(LPSTR *)pvStructInfo)); + return ret; +} - bytesNeeded = sizeof(CERT_EXTENSION); - if (dataLen) - { - const BYTE *ptr = pbEncoded + 1 + lenBytes; - DWORD encodedOidLen, oidLen; +/* Warning: assumes ext->pszObjId is set ahead of time! */ +static BOOL CRYPT_AsnDecodeExtension(const BYTE *pbEncoded, DWORD cbEncoded, + DWORD dwFlags, CERT_EXTENSION *ext, DWORD *pcbExt) +{ + struct AsnDecodeSequenceItem items[] = { + { offsetof(CERT_EXTENSION, pszObjId), CRYPT_AsnDecodeOidWrapper, + sizeof(LPSTR), FALSE, TRUE, offsetof(CERT_EXTENSION, pszObjId), 0 }, + { offsetof(CERT_EXTENSION, fCritical), CRYPT_AsnDecodeBool, + sizeof(BOOL), TRUE, FALSE, 0, 0 }, + { offsetof(CERT_EXTENSION, Value), CRYPT_AsnDecodeOctetsInternal, + sizeof(CRYPT_OBJID_BLOB), FALSE, TRUE, offsetof(CERT_EXTENSION, + Value.pbData) }, + }; + BOOL ret = TRUE; - CRYPT_GetLen(ptr, cbEncoded - (ptr - pbEncoded), - &encodedOidLen); - oidLenBytes = GET_LEN_BYTES(ptr[1]); - ret = CRYPT_AsnDecodeOid(ptr, cbEncoded - (ptr - pbEncoded), - dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &oidLen); - if (ret) - { - bytesNeeded += oidLen; - ptr += 1 + encodedOidLen + oidLenBytes; - if (*ptr == ASN_BOOL) - ptr += 3; - ret = CRYPT_AsnDecodeOctets(X509_ASN_ENCODING, - X509_OCTET_STRING, ptr, cbEncoded - (ptr - pbEncoded), - 0, NULL, NULL, &dataLen); - bytesNeeded += dataLen; - if (ret) - { - if (!ext) - *pcbExt = bytesNeeded; - else if (*pcbExt < bytesNeeded) - { - SetLastError(ERROR_MORE_DATA); - ret = FALSE; - } - else - { - ptr = pbEncoded + 2 + lenBytes + encodedOidLen + - oidLenBytes; - if (*ptr == ASN_BOOL) - { - DWORD size = sizeof(BOOL); + TRACE("%p, %ld, %08lx, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, ext, + *pcbExt); - CRYPT_AsnDecodeBool(X509_ASN_ENCODING, NULL, - ptr, cbEncoded - (ptr - pbEncoded), - dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, - &ext->fCritical, &size); - ptr += 3; - } - else - ext->fCritical = FALSE; - ret = CRYPT_AsnDecodeOctets(X509_ASN_ENCODING, - X509_OCTET_STRING, ptr, - cbEncoded - (ptr - pbEncoded), - dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, - &ext->Value, &dataLen); - if (ret) - { - ext->pszObjId = (LPSTR)ext->Value.pbData + - ext->Value.cbData; - ptr = pbEncoded + 1 + lenBytes; - ret = CRYPT_AsnDecodeOid(ptr, - cbEncoded - (ptr - pbEncoded), - dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, - ext->pszObjId, &oidLen); - } - } - } - } - } - else - { - SetLastError(CRYPT_E_ASN1_EOD); - ret = FALSE; - } - } - } - else - { - SetLastError(CRYPT_E_ASN1_BADTAG); - ret = FALSE; - } + if (ext) + TRACE("ext->pszObjId is %p\n", ext->pszObjId); + ret = CRYPT_AsnDecodeSequence(X509_ASN_ENCODING, items, + sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, NULL, + ext, pcbExt, ext ? ext->pszObjId : NULL); + if (ext) + TRACE("ext->pszObjId is %p (%s)\n", ext->pszObjId, + debugstr_a(ext->pszObjId)); + TRACE("returning %d (%08lx)\n", ret, GetLastError()); return ret; } @@ -3155,6 +3237,9 @@ { BOOL ret = TRUE; + TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); + if (pbEncoded[0] == ASN_SEQUENCEOF) { DWORD dataLen, bytesNeeded; @@ -3173,6 +3258,7 @@ for (ptr = pbEncoded + 1 + lenBytes; ret && ptr - pbEncoded - 1 - lenBytes < dataLen; ) { + size = 0; ret = CRYPT_AsnDecodeExtension(ptr, cbEncoded - (ptr - pbEncoded), dwFlags, NULL, &size); if (ret) @@ -3215,7 +3301,7 @@ i < cExtension && ptr - pbEncoded - 1 - lenBytes < dataLen; i++) { - exts->rgExtension[i].Value.pbData = nextData; + exts->rgExtension[i].pszObjId = (LPSTR)nextData; size = bytesNeeded; ret = CRYPT_AsnDecodeExtension(ptr, cbEncoded - (ptr - pbEncoded), dwFlags, @@ -3225,21 +3311,8 @@ DWORD nextLen; bytesNeeded -= size; - /* If dwFlags & CRYPT_DECODE_NOCOPY_FLAG, the - * data may not have been copied. - */ - if (exts->rgExtension[i].Value.pbData == - nextData) - nextData += - exts->rgExtension[i].Value.cbData; - /* Ugly: the OID, if copied, is stored in - * memory after the value, so increment by its - * string length if it's set and points here. - */ - if ((const BYTE *)exts->rgExtension[i].pszObjId - == nextData) - nextData += strlen( - exts->rgExtension[i].pszObjId) + 1; + if (size > sizeof(CERT_EXTENSION)) + nextData += size - sizeof(CERT_EXTENSION); ret = CRYPT_GetLen(ptr, cbEncoded - (ptr - pbEncoded), &nextLen); if (ret) @@ -3304,6 +3377,9 @@ { BOOL ret = TRUE; + TRACE("%p, %ld, %08lx, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, pszObjId, + *pcbObjId); + __TRY { if (pbEncoded[0] == ASN_OBJECTIDENTIFIER) @@ -3366,6 +3442,7 @@ } else { + *pszObjId = 0; sprintf(pszObjId, "%d.%d", pbEncoded[1 + lenBytes] / 40, pbEncoded[1 + lenBytes] - (pbEncoded[1 + lenBytes] / 40) * 40); @@ -3511,6 +3588,9 @@ return ret; } +/* FIXME: this should use CRYPT_AsnDecodeSequence (though that won't accept it + * at the moment because of the ASN_CONSTRUCTOR tag.) + */ static BOOL WINAPI CRYPT_AsnDecodeRdnAttr(const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, CERT_RDN_ATTR *attr, DWORD *pcbAttr) { @@ -3605,7 +3685,8 @@ (LPSTR)(attr->Value.pbData + attr->Value.cbData); else - attr->pszObjId = (LPSTR)originalData; + attr->pszObjId = + (LPSTR)originalData; size = bytesNeeded - size; ret = CRYPT_AsnDecodeOid( pbEncoded + objIdOfset, @@ -3861,112 +3942,69 @@ return ret; } -static BOOL WINAPI CRYPT_AsnDecodeAlgorithmId(DWORD dwCertEncodingType, +static BOOL WINAPI CRYPT_AsnDecodeCopyBytes(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { - CRYPT_ALGORITHM_IDENTIFIER *algo = - (CRYPT_ALGORITHM_IDENTIFIER *)pvStructInfo; BOOL ret = TRUE; + DWORD bytesNeeded = sizeof(CRYPT_OBJID_BLOB); - if (pbEncoded[0] == ASN_SEQUENCE) + TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); + + if (!(dwFlags & CRYPT_DECODE_NOCOPY_FLAG)) + bytesNeeded += cbEncoded; + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if (*pcbStructInfo < bytesNeeded) { - DWORD dataLen, bytesNeeded; + SetLastError(ERROR_MORE_DATA); + *pcbStructInfo = bytesNeeded; + ret = FALSE; + } + else + { + PCRYPT_OBJID_BLOB blob = (PCRYPT_OBJID_BLOB)pvStructInfo; - if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + *pcbStructInfo = bytesNeeded; + blob->cbData = cbEncoded; + if (dwFlags & CRYPT_DECODE_NOCOPY_FLAG) + blob->pbData = (LPBYTE)pbEncoded; + else { - BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + assert(blob->pbData); + memcpy(blob->pbData, pbEncoded, blob->cbData); + } + } + return ret; +} - bytesNeeded = sizeof(CRYPT_ALGORITHM_IDENTIFIER); - if (dataLen) - { - const BYTE *ptr = pbEncoded + 1 + lenBytes; - BYTE oidLenBytes; - DWORD encodedOidLen, oidLen; - - CRYPT_GetLen(ptr, cbEncoded - (ptr - pbEncoded), - &encodedOidLen); - oidLenBytes = GET_LEN_BYTES(ptr[1]); - ret = CRYPT_AsnDecodeOid(ptr, cbEncoded - (ptr - pbEncoded), - dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &oidLen); - if (ret) - { - bytesNeeded += oidLen; - ptr += 1 + encodedOidLen + oidLenBytes; - /* The remaining bytes are just copied as-is, no decoding - * is done. - */ - if (!(dwFlags & CRYPT_DECODE_NOCOPY_FLAG)) - bytesNeeded += cbEncoded - (ptr - pbEncoded); - if (!algo) - *pcbStructInfo = bytesNeeded; - else if (*pcbStructInfo < bytesNeeded) - { - SetLastError(ERROR_MORE_DATA); - ret = FALSE; - } - else - { - /* Get and sanity-check parameter length first */ - if (dataLen - 1 - oidLenBytes - encodedOidLen != 0) - { - DWORD paramsLen; +static BOOL WINAPI CRYPT_AsnDecodeAlgorithmId(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + CRYPT_ALGORITHM_IDENTIFIER *algo = + (CRYPT_ALGORITHM_IDENTIFIER *)pvStructInfo; + BOOL ret = TRUE; + struct AsnDecodeSequenceItem items[] = { + { offsetof(CRYPT_ALGORITHM_IDENTIFIER, pszObjId), + CRYPT_AsnDecodeOidWrapper, sizeof(LPSTR), FALSE, TRUE, + offsetof(CRYPT_ALGORITHM_IDENTIFIER, pszObjId), 0 }, + { offsetof(CRYPT_ALGORITHM_IDENTIFIER, Parameters), + CRYPT_AsnDecodeCopyBytes, sizeof(CRYPT_OBJID_BLOB), TRUE, TRUE, + offsetof(CRYPT_ALGORITHM_IDENTIFIER, Parameters.pbData), 0 }, + }; - if ((ret = CRYPT_GetLen(ptr, cbEncoded - - (ptr - pbEncoded), ¶msLen))) - { - BYTE paramsLenBytes = GET_LEN_BYTES(ptr[1]); + TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); - if (paramsLen != dataLen - encodedOidLen - 1 - - oidLenBytes - 1 - paramsLenBytes) - { - SetLastError(CRYPT_E_ASN1_CORRUPT); - ret = FALSE; - } - } - } - if (ret) - { - *pcbStructInfo = bytesNeeded; - algo->Parameters.cbData = dataLen - 1 - - oidLenBytes - encodedOidLen; - if (algo->Parameters.cbData) - { - if (!(dwFlags & CRYPT_DECODE_NOCOPY_FLAG)) - { - memcpy(algo->Parameters.pbData, ptr, - algo->Parameters.cbData); - algo->pszObjId = (LPSTR)algo->Parameters.pbData + - algo->Parameters.cbData; - } - else - { - algo->Parameters.pbData = (BYTE *)ptr; - algo->pszObjId = (LPSTR)algo->Parameters.pbData; - } - } - else - algo->pszObjId = (LPSTR)algo->Parameters.pbData; - ptr = pbEncoded + 1 + lenBytes; - ret = CRYPT_AsnDecodeOid(ptr, - cbEncoded - (ptr - pbEncoded), - dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, - algo->pszObjId, &oidLen); - } - } - } - } - else - { - SetLastError(CRYPT_E_ASN1_EOD); - ret = FALSE; - } - } - } - else + ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, pcbStructInfo, algo ? algo->pszObjId : NULL); + if (ret && pvStructInfo) { - SetLastError(CRYPT_E_ASN1_BADTAG); - ret = FALSE; + TRACE("pszObjId is %p (%s)\n", algo->pszObjId, + debugstr_a(algo->pszObjId)); } return ret; } @@ -3983,7 +4021,7 @@ { offsetof(CERT_PUBLIC_KEY_INFO, Algorithm), CRYPT_AsnDecodeAlgorithmId, sizeof(CRYPT_ALGORITHM_IDENTIFIER), FALSE, TRUE, offsetof(CERT_PUBLIC_KEY_INFO, - Algorithm.Parameters.pbData) }, + Algorithm.pszObjId) }, { offsetof(CERT_PUBLIC_KEY_INFO, PublicKey), CRYPT_AsnDecodeBitsInternal, sizeof(CRYPT_BIT_BLOB), FALSE, TRUE, offsetof(CERT_PUBLIC_KEY_INFO, PublicKey.pbData) }, @@ -4044,6 +4082,7 @@ *(BOOL *)pvStructInfo = pbEncoded[2] ? TRUE : FALSE; ret = TRUE; } + TRACE("returning %d (%08lx)\n", ret, GetLastError()); return ret; } @@ -4120,7 +4159,8 @@ DWORD i; for (i = 0; i < dataLen; i++) - entry->u.pwszURL[i] = (WCHAR)pbEncoded[1 + lenBytes + i]; + entry->u.pwszURL[i] = + (WCHAR)pbEncoded[1 + lenBytes + i]; entry->u.pwszURL[i] = 0; break; } @@ -4212,7 +4252,8 @@ i < cEntry && ptr - pbEncoded - 1 - lenBytes < dataLen; i++) { - info->rgAltEntry[i].u.pwszURL = (LPWSTR)nextData; + info->rgAltEntry[i].u.pwszURL = + (LPWSTR)nextData; size = bytesNeeded; ret = CRYPT_AsnDecodeAltNameEntry(ptr, cbEncoded - (ptr - pbEncoded), dwFlags, @@ -4252,101 +4293,77 @@ return ret; } -static BOOL WINAPI CRYPT_AsnDecodeBasicConstraints2(DWORD dwCertEncodingType, +struct PATH_LEN_CONSTRAINT +{ + BOOL fPathLenConstraint; + DWORD dwPathLenConstraint; +}; + +static BOOL WINAPI CRYPT_AsnDecodePathLenConstraint(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { - BOOL ret; + BOOL ret = TRUE; - __TRY + if (cbEncoded) { - if (pbEncoded[0] == ASN_SEQUENCE) + if (pbEncoded[0] == ASN_INTEGER) { - DWORD dataLen; + DWORD bytesNeeded = sizeof(struct PATH_LEN_CONSTRAINT); - if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if (*pcbStructInfo < bytesNeeded) { - /* sanity-check length, space enough for 7 bytes of integer and - * 3 bytes of bool - */ - if (dataLen > 10) - { - SetLastError(CRYPT_E_ASN1_CORRUPT); - ret = FALSE; - } - else - { - DWORD bytesNeeded = sizeof(CERT_BASIC_CONSTRAINTS2_INFO); - - if (!pvStructInfo) - *pcbStructInfo = bytesNeeded; - else - { - BYTE lenBytes; - CERT_BASIC_CONSTRAINTS2_INFO info = { 0 }; - - lenBytes = GET_LEN_BYTES(pbEncoded[1]); - pbEncoded += 1 + lenBytes; - cbEncoded -= 1 + lenBytes; - if (cbEncoded) - { - DWORD size; - - if (pbEncoded[0] == ASN_BOOL) - { - size = sizeof(BOOL); - ret = CRYPT_AsnDecodeBool(dwCertEncodingType, - NULL, pbEncoded, cbEncoded, - dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, - &info.fCA, &size); - if (ret) - { - cbEncoded -= 2 + pbEncoded[1]; - pbEncoded += 2 + pbEncoded[1]; - } - } - if (ret && cbEncoded && pbEncoded[0] == ASN_INTEGER) - { - size = sizeof(info.dwPathLenConstraint); - ret = CRYPT_AsnDecodeInt(dwCertEncodingType, - X509_INTEGER, pbEncoded, cbEncoded, 0, NULL, - &info.dwPathLenConstraint, &size); - if (ret) - { - cbEncoded -= 2 + pbEncoded[1]; - pbEncoded += 2 + pbEncoded[1]; - if (cbEncoded) - { - SetLastError(CRYPT_E_ASN1_CORRUPT); - ret = FALSE; - } - else - info.fPathLenConstraint = TRUE; - } - } - } - if (ret) - { - if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, - pDecodePara, pvStructInfo, pcbStructInfo, - bytesNeeded))) - { - if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) - pvStructInfo = *(BYTE **)pvStructInfo; - memcpy(pvStructInfo, &info, - sizeof(CERT_BASIC_CONSTRAINTS2_INFO)); - } - } - } - } + SetLastError(ERROR_MORE_DATA); + *pcbStructInfo = bytesNeeded; + ret = FALSE; + } + else + { + struct PATH_LEN_CONSTRAINT *constraint = + (struct PATH_LEN_CONSTRAINT *)pvStructInfo; + DWORD size = sizeof(constraint->dwPathLenConstraint); + + ret = CRYPT_AsnDecodeInt(dwCertEncodingType, X509_INTEGER, + pbEncoded, cbEncoded, 0, NULL, + &constraint->dwPathLenConstraint, &size); + if (ret) + constraint->fPathLenConstraint = TRUE; + TRACE("got an int, dwPathLenConstraint is %ld\n", + constraint->dwPathLenConstraint); } } else { - SetLastError(CRYPT_E_ASN1_BADTAG); + SetLastError(CRYPT_E_ASN1_CORRUPT); ret = FALSE; } } + TRACE("returning %d (%08lx)\n", ret, GetLastError()); + return ret; +} + +static BOOL WINAPI CRYPT_AsnDecodeBasicConstraints2(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret; + + __TRY + { + struct AsnDecodeSequenceItem items[] = { + { offsetof(CERT_BASIC_CONSTRAINTS2_INFO, fCA), CRYPT_AsnDecodeBool, + sizeof(BOOL), TRUE, FALSE, 0, 0 }, + { offsetof(CERT_BASIC_CONSTRAINTS2_INFO, fPathLenConstraint), + CRYPT_AsnDecodePathLenConstraint, sizeof(struct PATH_LEN_CONSTRAINT), + TRUE, FALSE, 0, 0 }, + }; + + ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, pcbStructInfo, NULL); + } __EXCEPT(page_fault) { SetLastError(STATUS_ACCESS_VIOLATION); @@ -4356,7 +4373,15 @@ return ret; } -static BOOL WINAPI CRYPT_AsnDecodeOctets(DWORD dwCertEncodingType, +#define RSA1_MAGIC 0x31415352 + +struct DECODED_RSA_PUB_KEY +{ + DWORD pubexp; + CRYPT_INTEGER_BLOB modulus; +}; + +static BOOL WINAPI CRYPT_AsnDecodeRsaPubKey(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { @@ -4364,41 +4389,152 @@ __TRY { - if (pbEncoded[0] == ASN_OCTETSTRING) + struct AsnDecodeSequenceItem items[] = { + { offsetof(struct DECODED_RSA_PUB_KEY, modulus), + CRYPT_AsnDecodeUnsignedIntegerInternal, sizeof(CRYPT_INTEGER_BLOB), + FALSE, TRUE, offsetof(struct DECODED_RSA_PUB_KEY, modulus.pbData), + 0 }, + { offsetof(struct DECODED_RSA_PUB_KEY, pubexp), + CRYPT_AsnDecodeInt, sizeof(DWORD), FALSE, FALSE, 0, 0 }, + }; + struct DECODED_RSA_PUB_KEY *decodedKey = NULL; + DWORD size = 0; + + ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, + CRYPT_DECODE_ALLOC_FLAG, NULL, &decodedKey, &size, NULL); + if (ret) { - DWORD bytesNeeded, dataLen; + DWORD bytesNeeded = sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) + + decodedKey->modulus.cbData; - if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + if (!pvStructInfo) { + *pcbStructInfo = bytesNeeded; + ret = TRUE; + } + else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, + pvStructInfo, pcbStructInfo, bytesNeeded))) + { + BLOBHEADER *hdr; + RSAPUBKEY *rsaPubKey; + + if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) + pvStructInfo = *(BYTE **)pvStructInfo; + hdr = (BLOBHEADER *)pvStructInfo; + hdr->bType = PUBLICKEYBLOB; + hdr->bVersion = CUR_BLOB_VERSION; + hdr->reserved = 0; + hdr->aiKeyAlg = CALG_RSA_KEYX; + rsaPubKey = (RSAPUBKEY *)((BYTE *)pvStructInfo + + sizeof(BLOBHEADER)); + rsaPubKey->magic = RSA1_MAGIC; + rsaPubKey->pubexp = decodedKey->pubexp; + rsaPubKey->bitlen = decodedKey->modulus.cbData * 8; + memcpy((BYTE *)pvStructInfo + sizeof(BLOBHEADER) + + sizeof(RSAPUBKEY), decodedKey->modulus.pbData, + decodedKey->modulus.cbData); + } + LocalFree(decodedKey); + } + } + __EXCEPT(page_fault) + { + SetLastError(STATUS_ACCESS_VIOLATION); + ret = FALSE; + } + __ENDTRY + return ret; +} + +static BOOL WINAPI CRYPT_AsnDecodeOctetsInternal(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret; + + TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); + + if (pbEncoded[0] == ASN_OCTETSTRING) + { + DWORD bytesNeeded, dataLen; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + { + if (dwFlags & CRYPT_DECODE_NOCOPY_FLAG) + bytesNeeded = sizeof(CRYPT_DATA_BLOB); + else + bytesNeeded = dataLen + sizeof(CRYPT_DATA_BLOB); + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if (*pcbStructInfo < bytesNeeded) + { + SetLastError(ERROR_MORE_DATA); + *pcbStructInfo = bytesNeeded; + ret = FALSE; + } + else + { + CRYPT_DATA_BLOB *blob; + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + + blob = (CRYPT_DATA_BLOB *)pvStructInfo; + blob->cbData = dataLen; if (dwFlags & CRYPT_DECODE_NOCOPY_FLAG) - bytesNeeded = sizeof(CRYPT_DATA_BLOB); + blob->pbData = (BYTE *)pbEncoded + 1 + lenBytes; else - bytesNeeded = dataLen + sizeof(CRYPT_DATA_BLOB); - if (!pvStructInfo) - *pcbStructInfo = bytesNeeded; - else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, - pvStructInfo, pcbStructInfo, bytesNeeded))) { - CRYPT_DATA_BLOB *blob; - BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); - - if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) - pvStructInfo = *(BYTE **)pvStructInfo; - blob = (CRYPT_DATA_BLOB *)pvStructInfo; - blob->cbData = dataLen; - if (dwFlags & CRYPT_DECODE_NOCOPY_FLAG) - blob->pbData = (BYTE *)pbEncoded + 1 + lenBytes; - else - { - blob->pbData = (BYTE *)pvStructInfo + - sizeof(CRYPT_DATA_BLOB); - if (blob->cbData) - memcpy(blob->pbData, pbEncoded + 1 + lenBytes, - blob->cbData); - } + assert(blob->pbData); + if (blob->cbData) + memcpy(blob->pbData, pbEncoded + 1 + lenBytes, + blob->cbData); } } } + } + else + { + SetLastError(CRYPT_E_ASN1_BADTAG); + ret = FALSE; + } + return ret; +} + +static BOOL WINAPI CRYPT_AsnDecodeOctets(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret; + + TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); + + __TRY + { + DWORD bytesNeeded; + + if ((ret = CRYPT_AsnDecodeOctetsInternal(dwCertEncodingType, + lpszStructType, pbEncoded, cbEncoded, + dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, NULL, &bytesNeeded))) + { + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, + pvStructInfo, pcbStructInfo, bytesNeeded))) + { + CRYPT_DATA_BLOB *blob; + + if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) + pvStructInfo = *(BYTE **)pvStructInfo; + blob = (CRYPT_DATA_BLOB *)pvStructInfo; + blob->pbData = (BYTE *)pvStructInfo + sizeof(CRYPT_DATA_BLOB); + ret = CRYPT_AsnDecodeOctetsInternal(dwCertEncodingType, + lpszStructType, pbEncoded, cbEncoded, + dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, pvStructInfo, + &bytesNeeded); + } + } else { SetLastError(CRYPT_E_ASN1_BADTAG); @@ -4474,6 +4610,7 @@ SetLastError(CRYPT_E_ASN1_BADTAG); ret = FALSE; } + TRACE("returning %d (%08lx)\n", ret, GetLastError()); return ret; } @@ -4518,6 +4655,7 @@ ret = FALSE; } __ENDTRY + TRACE("returning %d (%08lx)\n", ret, GetLastError()); return ret; } @@ -4669,56 +4807,94 @@ return ret; } -static BOOL WINAPI CRYPT_AsnDecodeUnsignedInteger(DWORD dwCertEncodingType, - LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, - PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +static BOOL WINAPI CRYPT_AsnDecodeUnsignedIntegerInternal( + DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, + DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, + void *pvStructInfo, DWORD *pcbStructInfo) { BOOL ret; - __TRY + if (pbEncoded[0] == ASN_INTEGER) { - if (pbEncoded[0] == ASN_INTEGER) + DWORD bytesNeeded, dataLen; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) { - DWORD bytesNeeded, dataLen; - CRYPT_INTEGER_BLOB *blob; + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); - if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + bytesNeeded = dataLen + sizeof(CRYPT_INTEGER_BLOB); + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if (*pcbStructInfo < bytesNeeded) { - bytesNeeded = dataLen + sizeof(CRYPT_INTEGER_BLOB); - if (!pvStructInfo) - *pcbStructInfo = bytesNeeded; - else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, - pvStructInfo, pcbStructInfo, bytesNeeded))) + *pcbStructInfo = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + CRYPT_INTEGER_BLOB *blob = (CRYPT_INTEGER_BLOB *)pvStructInfo; + + blob->cbData = dataLen; + assert(blob->pbData); + /* remove leading zero byte if it exists */ + if (blob->cbData && *(pbEncoded + 1 + lenBytes) == 0) + { + blob->cbData--; + blob->pbData++; + } + if (blob->cbData) { - BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + DWORD i; - if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) - pvStructInfo = *(BYTE **)pvStructInfo; - blob = (CRYPT_INTEGER_BLOB *)pvStructInfo; - blob->cbData = dataLen; - blob->pbData = (BYTE *)pvStructInfo + - sizeof(CRYPT_INTEGER_BLOB); - /* remove leading zero byte if it exists */ - if (blob->cbData && *(pbEncoded + 1 + lenBytes) == 0) - { - blob->cbData--; - blob->pbData++; - } - if (blob->cbData) + for (i = 0; i < blob->cbData; i++) { - DWORD i; - - for (i = 0; i < blob->cbData; i++) - blob->pbData[i] = *(pbEncoded + 1 + lenBytes + - pbEncoded[1] - i - 1); + blob->pbData[i] = *(pbEncoded + 1 + lenBytes + + dataLen - i - 1); } } } } - else + } + else + { + SetLastError(CRYPT_E_ASN1_BADTAG); + ret = FALSE; + } + return ret; +} + +static BOOL WINAPI CRYPT_AsnDecodeUnsignedInteger(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret; + + __TRY + { + DWORD bytesNeeded; + + if ((ret = CRYPT_AsnDecodeUnsignedIntegerInternal(dwCertEncodingType, + lpszStructType, pbEncoded, cbEncoded, + dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, NULL, &bytesNeeded))) { - SetLastError(CRYPT_E_ASN1_BADTAG); - ret = FALSE; + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, + pvStructInfo, pcbStructInfo, bytesNeeded))) + { + CRYPT_INTEGER_BLOB *blob; + + if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) + pvStructInfo = *(BYTE **)pvStructInfo; + blob = (CRYPT_INTEGER_BLOB *)pvStructInfo; + blob->pbData = (BYTE *)pvStructInfo + + sizeof(CRYPT_INTEGER_BLOB); + ret = CRYPT_AsnDecodeUnsignedIntegerInternal(dwCertEncodingType, + lpszStructType, pbEncoded, cbEncoded, + dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, pvStructInfo, + &bytesNeeded); + } } } __EXCEPT(page_fault) @@ -4824,10 +5000,11 @@ static BOOL CRYPT_AsnDecodeTimeZone(const BYTE *pbEncoded, DWORD len, SYSTEMTIME *sysTime) { - BOOL ret = TRUE; + BOOL ret; __TRY { + ret = TRUE; if (len >= 3 && (*pbEncoded == '+' || *pbEncoded == '-')) { WORD hours, minutes = 0; @@ -4891,7 +5068,7 @@ LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { - BOOL ret = TRUE; + BOOL ret; if (!pvStructInfo) { @@ -4900,6 +5077,7 @@ } __TRY { + ret = TRUE; if (pbEncoded[0] == ASN_UTCTIME) { if (cbEncoded <= 1) @@ -4979,7 +5157,7 @@ LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { - BOOL ret = TRUE; + BOOL ret; if (!pvStructInfo) { @@ -4988,6 +5166,7 @@ } __TRY { + ret = TRUE; if (pbEncoded[0] == ASN_GENERALTIME) { if (cbEncoded <= 1) @@ -5268,6 +5447,9 @@ case (WORD)X509_BASIC_CONSTRAINTS2: decodeFunc = CRYPT_AsnDecodeBasicConstraints2; break; + case (WORD)RSA_CSP_PUBLICKEYBLOB: + decodeFunc = CRYPT_AsnDecodeRsaPubKey; + break; case (WORD)X509_OCTET_STRING: decodeFunc = CRYPT_AsnDecodeOctets; break; @@ -5337,3 +5519,183 @@ FreeLibrary(lib); return ret; } + +BOOL WINAPI CryptExportPublicKeyInfo(HCRYPTPROV hCryptProv, DWORD dwKeySpec, + DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo) +{ + return CryptExportPublicKeyInfoEx(hCryptProv, dwKeySpec, dwCertEncodingType, + NULL, 0, NULL, pInfo, pcbInfo); +} + +static BOOL WINAPI CRYPT_ExportRsaPublicKeyInfoEx(HCRYPTPROV hCryptProv, + DWORD dwKeySpec, DWORD dwCertEncodingType, LPSTR pszPublicKeyObjId, + DWORD dwFlags, void *pvAuxInfo, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo) +{ + BOOL ret; + HCRYPTKEY key; + + TRACE("(%ld, %ld, %08lx, %s, %08lx, %p, %p, %p)\n", hCryptProv, dwKeySpec, + dwCertEncodingType, debugstr_a(pszPublicKeyObjId), dwFlags, pvAuxInfo, + pInfo, pcbInfo); + + if (!pszPublicKeyObjId) + pszPublicKeyObjId = szOID_RSA_RSA; + if ((ret = CryptGetUserKey(hCryptProv, dwKeySpec, &key))) + { + DWORD keySize = 0; + + ret = CryptExportKey(key, 0, PUBLICKEYBLOB, 0, NULL, &keySize); + if (ret) + { + LPBYTE pubKey = HeapAlloc(GetProcessHeap(), 0, keySize); + + if (pubKey) + { + ret = CryptExportKey(key, 0, PUBLICKEYBLOB, 0, pubKey, + &keySize); + if (ret) + { + DWORD encodedLen = 0; + + ret = CryptEncodeObject(dwCertEncodingType, + RSA_CSP_PUBLICKEYBLOB, pubKey, NULL, &encodedLen); + if (ret) + { + DWORD sizeNeeded = sizeof(CERT_PUBLIC_KEY_INFO) + + strlen(pszPublicKeyObjId) + 1 + encodedLen; + + if (!pInfo) + *pcbInfo = sizeNeeded; + else if (*pcbInfo < sizeNeeded) + { + SetLastError(ERROR_MORE_DATA); + *pcbInfo = sizeNeeded; + ret = FALSE; + } + else + { + pInfo->Algorithm.pszObjId = (char *)pInfo + + sizeof(CERT_PUBLIC_KEY_INFO); + lstrcpyA(pInfo->Algorithm.pszObjId, + pszPublicKeyObjId); + pInfo->Algorithm.Parameters.cbData = 0; + pInfo->Algorithm.Parameters.pbData = NULL; + pInfo->PublicKey.pbData = + (BYTE *)pInfo->Algorithm.pszObjId + + lstrlenA(pInfo->Algorithm.pszObjId) + 1; + pInfo->PublicKey.cbData = encodedLen; + pInfo->PublicKey.cUnusedBits = 0; + ret = CryptEncodeObject(dwCertEncodingType, + RSA_CSP_PUBLICKEYBLOB, pubKey, + pInfo->PublicKey.pbData, &pInfo->PublicKey.cbData); + } + } + } + HeapFree(GetProcessHeap(), 0, pubKey); + } + else + ret = FALSE; + } + CryptDestroyKey(key); + } + return ret; +} + +typedef BOOL (WINAPI *ExportPublicKeyInfoExFunc)(HCRYPTPROV hCryptProv, + DWORD dwKeySpec, DWORD dwCertEncodingType, LPSTR pszPublicKeyObjId, + DWORD dwFlags, void *pvAuxInfo, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo); + +BOOL WINAPI CryptExportPublicKeyInfoEx(HCRYPTPROV hCryptProv, DWORD dwKeySpec, + DWORD dwCertEncodingType, LPSTR pszPublicKeyObjId, DWORD dwFlags, + void *pvAuxInfo, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo) +{ + BOOL ret; + ExportPublicKeyInfoExFunc exportFunc = NULL; + HMODULE lib = NULL; + + TRACE("(%ld, %ld, %08lx, %s, %08lx, %p, %p, %p)\n", hCryptProv, dwKeySpec, + dwCertEncodingType, debugstr_a(pszPublicKeyObjId), dwFlags, pvAuxInfo, + pInfo, pcbInfo); + + if (!hCryptProv) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (pszPublicKeyObjId) + exportFunc = CRYPT_GetFunc(dwCertEncodingType, pszPublicKeyObjId, + CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC, &lib); + if (!exportFunc) + exportFunc = CRYPT_ExportRsaPublicKeyInfoEx; + ret = exportFunc(hCryptProv, dwKeySpec, dwCertEncodingType, + pszPublicKeyObjId, dwFlags, pvAuxInfo, pInfo, pcbInfo); + if (lib) + FreeLibrary(lib); + return ret; +} + +BOOL WINAPI CryptImportPublicKeyInfo(HCRYPTPROV hCryptProv, + DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, HCRYPTKEY *phKey) +{ + return CryptImportPublicKeyInfoEx(hCryptProv, dwCertEncodingType, pInfo, + 0, 0, NULL, phKey); +} + +static BOOL WINAPI CRYPT_ImportRsaPublicKeyInfoEx(HCRYPTPROV hCryptProv, + DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, ALG_ID aiKeyAlg, + DWORD dwFlags, void *pvAuxInfo, HCRYPTKEY *phKey) +{ + BOOL ret; + DWORD pubKeySize = 0; + + TRACE("(%ld, %ld, %p, %d, %08lx, %p, %p)\n", hCryptProv, + dwCertEncodingType, pInfo, aiKeyAlg, dwFlags, pvAuxInfo, phKey); + + ret = CryptDecodeObject(dwCertEncodingType, RSA_CSP_PUBLICKEYBLOB, + pInfo->PublicKey.pbData, pInfo->PublicKey.cbData, 0, NULL, &pubKeySize); + if (ret) + { + LPBYTE pubKey = HeapAlloc(GetProcessHeap(), 0, pubKeySize); + + if (pubKey) + { + ret = CryptDecodeObject(dwCertEncodingType, RSA_CSP_PUBLICKEYBLOB, + pInfo->PublicKey.pbData, pInfo->PublicKey.cbData, 0, pubKey, + &pubKeySize); + if (ret) + ret = CryptImportKey(hCryptProv, pubKey, pubKeySize, 0, 0, + phKey); + HeapFree(GetProcessHeap(), 0, pubKey); + } + else + ret = FALSE; + } + return ret; +} + +typedef BOOL (WINAPI *ImportPublicKeyInfoExFunc)(HCRYPTPROV hCryptProv, + DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, ALG_ID aiKeyAlg, + DWORD dwFlags, void *pvAuxInfo, HCRYPTKEY *phKey); + +BOOL WINAPI CryptImportPublicKeyInfoEx(HCRYPTPROV hCryptProv, + DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, ALG_ID aiKeyAlg, + DWORD dwFlags, void *pvAuxInfo, HCRYPTKEY *phKey) +{ + BOOL ret; + ImportPublicKeyInfoExFunc importFunc = NULL; + HMODULE lib = NULL; + + TRACE("(%ld, %ld, %p, %d, %08lx, %p, %p)\n", hCryptProv, + dwCertEncodingType, pInfo, aiKeyAlg, dwFlags, pvAuxInfo, phKey); + + importFunc = CRYPT_GetFunc(dwCertEncodingType, pInfo->Algorithm.pszObjId, + CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC, &lib); + if (!importFunc) + importFunc = CRYPT_ImportRsaPublicKeyInfoEx; + ret = importFunc(hCryptProv, dwCertEncodingType, pInfo, aiKeyAlg, dwFlags, + pvAuxInfo, phKey); + if (lib) + FreeLibrary(lib); + return ret; +} diff -urN wine-20050830/dlls/crypt32/main.c wine-20050930/dlls/crypt32/main.c --- wine-20050830/dlls/crypt32/main.c 2005-08-25 11:52:00.000000000 +0200 +++ wine-20050930/dlls/crypt32/main.c 2005-09-03 11:36:55.000000000 +0200 @@ -294,10 +294,13 @@ { int i; - for (i = 0; i < sizeof(oidToAlgID) / sizeof(oidToAlgID[0]); i++) + if (pszObjId) { - if (!strcmp(pszObjId, oidToAlgID[i].oid)) - return oidToAlgID[i].algID; + for (i = 0; i < sizeof(oidToAlgID) / sizeof(oidToAlgID[0]); i++) + { + if (!strcmp(pszObjId, oidToAlgID[i].oid)) + return oidToAlgID[i].algID; + } } return 0; } diff -urN wine-20050830/dlls/crypt32/protectdata.c wine-20050930/dlls/crypt32/protectdata.c --- wine-20050830/dlls/crypt32/protectdata.c 2005-08-29 11:38:19.000000000 +0200 +++ wine-20050930/dlls/crypt32/protectdata.c 2005-09-02 14:20:43.000000000 +0200 @@ -132,7 +132,7 @@ #define TRACE_DATA_BLOB(blob) do { \ TRACE("%s cbData: %u\n", #blob ,(unsigned int)((blob)->cbData)); \ - TRACE("%s pbData @ 0x%x:%s\n", #blob ,(unsigned int)((blob)->pbData), \ + TRACE("%s pbData @ %p:%s\n", #blob ,(blob)->pbData, \ hex_str((blob)->pbData, (blob)->cbData)); \ } while (0) @@ -778,14 +778,14 @@ report(DATA_BLOB* pDataIn, DATA_BLOB* pOptionalEntropy, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags) { - TRACE("pPromptStruct: 0x%x\n",(unsigned int)pPromptStruct); + TRACE("pPromptStruct: %p\n", pPromptStruct); if (pPromptStruct) { TRACE(" cbSize: 0x%x\n",(unsigned int)pPromptStruct->cbSize); TRACE(" dwPromptFlags: 0x%x\n",(unsigned int)pPromptStruct->dwPromptFlags); - TRACE(" hwndApp: 0x%x\n",(unsigned int)pPromptStruct->hwndApp); - TRACE(" szPrompt: 0x%x %s\n", - (unsigned int)pPromptStruct->szPrompt, + TRACE(" hwndApp: %p\n", pPromptStruct->hwndApp); + TRACE(" szPrompt: %p %s\n", + pPromptStruct->szPrompt, pPromptStruct->szPrompt ? debugstr_w(pPromptStruct->szPrompt) : ""); } @@ -855,7 +855,7 @@ /* debug: show our arguments */ report(pDataIn,pOptionalEntropy,pPromptStruct,dwFlags); - TRACE("\tszDataDescr: 0x%x %s\n",(unsigned int)szDataDescr, + TRACE("\tszDataDescr: %p %s\n", szDataDescr, szDataDescr ? debugstr_w(szDataDescr) : ""); /* Windows appears to create an empty szDataDescr instead of maintaining @@ -1026,7 +1026,7 @@ /* debug: show our arguments */ report(pDataIn,pOptionalEntropy,pPromptStruct,dwFlags); - TRACE("\tppszDataDescr: 0x%x\n",(unsigned int)ppszDataDescr); + TRACE("\tppszDataDescr: %p\n", ppszDataDescr); /* take apart the opaque blob */ if (!unserialize(pDataIn, &protect_data)) diff -urN wine-20050830/dlls/crypt32/tests/Makefile.in wine-20050930/dlls/crypt32/tests/Makefile.in --- wine-20050830/dlls/crypt32/tests/Makefile.in 2005-08-27 11:27:10.000000000 +0200 +++ wine-20050930/dlls/crypt32/tests/Makefile.in 2005-09-07 15:25:56.000000000 +0200 @@ -3,7 +3,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ TESTDLL = crypt32.dll -IMPORTS = crypt32 kernel32 +IMPORTS = crypt32 advapi32 kernel32 CTESTS = \ cert.c \ diff -urN wine-20050830/dlls/crypt32/tests/cert.c wine-20050930/dlls/crypt32/tests/cert.c --- wine-20050830/dlls/crypt32/tests/cert.c 2005-08-30 11:59:03.000000000 +0200 +++ wine-20050930/dlls/crypt32/tests/cert.c 2005-09-12 12:08:34.000000000 +0200 @@ -28,6 +28,18 @@ #include "wine/test.h" +/* The following aren't defined in wincrypt.h, as they're "reserved" */ +#define CERT_CERT_PROP_ID 32 +#define CERT_CRL_PROP_ID 33 +#define CERT_CTL_PROP_ID 34 + +struct CertPropIDHeader +{ + DWORD propID; + DWORD unknown1; + DWORD cb; +}; + static void testCryptHashCert(void) { static const BYTE emptyHash[] = { 0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, @@ -98,6 +110,12 @@ 0x00, 0x03, 0x01, 0x00, 0xa3, 0x16, 0x30, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 }; +static const BYTE signedCRL[] = { 0x30, 0x45, 0x30, 0x2c, 0x30, 0x02, 0x06, + 0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, + 0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x18, 0x0f, + 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x5a, 0x30, 0x02, 0x06, 0x00, 0x03, 0x11, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, + 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }; static void testMemStore(void) { @@ -136,13 +154,32 @@ CRYPT_E_ASN1_CORRUPT), "Expected CRYPT_E_ASN1_EOD or CRYPT_E_ASN1_CORRUPT, got %08lx\n", GetLastError()); - /* add a signed cert (this also fails) */ - ok(!ret && (GetLastError() == CRYPT_E_ASN1_EOD || GetLastError() == + /* add a "signed" cert--the signature isn't a real signature, so this adds + * without any check of the signature's validity + */ + ret = CertAddEncodedCertificateToStore(store1, X509_ASN_ENCODING, + signedBigCert, sizeof(signedBigCert), CERT_STORE_ADD_ALWAYS, &context); + ok(ret, "CertAddEncodedCertificateToStore failed: %08lx\n", GetLastError()); + ok(context != NULL, "Expected a valid cert context\n"); + if (context) + { + ok(context->cbCertEncoded == sizeof(signedBigCert), + "Expected cert of %d bytes, got %ld\n", sizeof(signedBigCert), + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, signedBigCert, + sizeof(signedBigCert)), "Unexpected encoded cert in context\n"); + /* remove it, the rest of the tests will work on an unsigned cert */ + ret = CertDeleteCertificateFromStore(context); + ok(ret, "CertDeleteCertificateFromStore failed: %08lx\n", + GetLastError()); + } + /* try adding a "signed" CRL as a cert */ + ret = CertAddEncodedCertificateToStore(store1, X509_ASN_ENCODING, + signedCRL, sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, &context); + ok(!ret && (GetLastError() == CRYPT_E_ASN1_BADTAG || GetLastError() == CRYPT_E_ASN1_CORRUPT), - "Expected CRYPT_E_ASN1_EOD or CRYPT_E_ASN1_CORRUPT, got %08lx\n", + "Expected CRYPT_E_ASN1_BADTAG or CRYPT_E_ASN1_CORRUPT, got %08lx\n", GetLastError()); - ret = CertAddEncodedCertificateToStore(store1, X509_ASN_ENCODING, - signedBigCert, sizeof(signedBigCert) - 1, CERT_STORE_ADD_ALWAYS, &context); /* add a cert to store1 */ ret = CertAddEncodedCertificateToStore(store1, X509_ASN_ENCODING, bigCert, sizeof(bigCert) - 1, CERT_STORE_ADD_ALWAYS, &context); @@ -560,6 +597,488 @@ CertCloseStore(store1, 0); } +/* Looks for the property with ID propID in the buffer buf. Returns a pointer + * to its header if found, NULL if not. + */ +static const struct CertPropIDHeader *findPropID(const BYTE *buf, DWORD size, + DWORD propID) +{ + const struct CertPropIDHeader *ret = NULL; + BOOL failed = FALSE; + + while (size && !ret && !failed) + { + if (size < sizeof(struct CertPropIDHeader)) + failed = TRUE; + else + { + const struct CertPropIDHeader *hdr = + (const struct CertPropIDHeader *)buf; + + size -= sizeof(struct CertPropIDHeader); + buf += sizeof(struct CertPropIDHeader); + if (size < hdr->cb) + failed = TRUE; + else if (hdr->propID == propID) + ret = hdr; + else + { + buf += hdr->cb; + size -= hdr->cb; + } + } + } + return ret; +} + +typedef DWORD (WINAPI *SHDeleteKeyAFunc)(HKEY, LPCSTR); + +static void testRegStore(void) +{ + static const char tempKey[] = "Software\\Wine\\CryptTemp"; + HCERTSTORE store; + LONG rc; + HKEY key = NULL; + DWORD disp; + + store = CertOpenStore(CERT_STORE_PROV_REG, 0, 0, 0, NULL); + ok(!store && GetLastError() == ERROR_INVALID_HANDLE, + "Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError()); + store = CertOpenStore(CERT_STORE_PROV_REG, 0, 0, 0, key); + ok(!store && GetLastError() == ERROR_INVALID_HANDLE, + "Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError()); + + /* Opening up any old key works.. */ + key = HKEY_CURRENT_USER; + store = CertOpenStore(CERT_STORE_PROV_REG, 0, 0, 0, key); + /* Not sure if this is a bug in DuplicateHandle, marking todo_wine for now + */ + todo_wine ok(store != 0, "CertOpenStore failed: %08lx\n", GetLastError()); + CertCloseStore(store, 0); + + rc = RegCreateKeyExA(HKEY_CURRENT_USER, tempKey, 0, NULL, 0, KEY_ALL_ACCESS, + NULL, &key, NULL); + ok(!rc, "RegCreateKeyExA failed: %ld\n", rc); + if (key) + { + BOOL ret; + BYTE hash[20]; + DWORD size, i; + static const char certificates[] = "Certificates\\"; + char subKeyName[sizeof(certificates) + 20 * 2 + 1], *ptr; + HKEY subKey; + PCCERT_CONTEXT context; + + store = CertOpenStore(CERT_STORE_PROV_REG, 0, 0, 0, key); + ok(store != 0, "CertOpenStore failed: %08lx\n", GetLastError()); + /* Add a certificate. It isn't persisted right away, since it's only + * added to the cache.. + */ + ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, + bigCert2, sizeof(bigCert2) - 1, CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCertificateToStore failed: %08lx\n", + GetLastError()); + /* so flush the cache to force a commit.. */ + ret = CertControlStore(store, 0, CERT_STORE_CTRL_COMMIT, NULL); + ok(ret, "CertControlStore failed: %08lx\n", GetLastError()); + /* and check that the expected subkey was written. */ + size = sizeof(hash); + ret = CryptHashCertificate(0, 0, 0, bigCert2, sizeof(bigCert2) - 1, + hash, &size); + ok(ret, "CryptHashCertificate failed: %ld\n", GetLastError()); + strcpy(subKeyName, certificates); + for (i = 0, ptr = subKeyName + sizeof(certificates) - 1; i < size; + i++, ptr += 2) + sprintf(ptr, "%02X", hash[i]); + rc = RegCreateKeyExA(key, subKeyName, 0, NULL, 0, KEY_ALL_ACCESS, NULL, + &subKey, NULL); + ok(!rc, "RegCreateKeyExA failed: %ld\n", rc); + if (subKey) + { + LPBYTE buf; + + size = 0; + RegQueryValueExA(subKey, "Blob", NULL, NULL, NULL, &size); + buf = HeapAlloc(GetProcessHeap(), 0, size); + if (buf) + { + rc = RegQueryValueExA(subKey, "Blob", NULL, NULL, buf, &size); + ok(!rc, "RegQueryValueExA failed: %ld\n", rc); + if (!rc) + { + const struct CertPropIDHeader *hdr; + + /* Both the hash and the cert should be present */ + hdr = findPropID(buf, size, CERT_CERT_PROP_ID); + ok(hdr != NULL, "Expected to find a cert property\n"); + if (hdr) + { + ok(hdr->cb == sizeof(bigCert2) - 1, + "Unexpected size %ld of cert property, expected %d\n", + hdr->cb, sizeof(bigCert2) - 1); + ok(!memcmp((BYTE *)hdr + sizeof(*hdr), bigCert2, + hdr->cb), "Unexpected cert in cert property\n"); + } + hdr = findPropID(buf, size, CERT_HASH_PROP_ID); + ok(hdr != NULL, "Expected to find a hash property\n"); + if (hdr) + { + ok(hdr->cb == sizeof(hash), + "Unexpected size %ld of hash property, expected %d\n", + hdr->cb, sizeof(hash)); + ok(!memcmp((BYTE *)hdr + sizeof(*hdr), hash, + hdr->cb), "Unexpected hash in cert property\n"); + } + } + HeapFree(GetProcessHeap(), 0, buf); + } + RegCloseKey(subKey); + } + + /* Remove the existing context */ + context = CertEnumCertificatesInStore(store, NULL); + ok(context != NULL, "Expected a cert context\n"); + if (context) + CertDeleteCertificateFromStore(context); + ret = CertControlStore(store, 0, CERT_STORE_CTRL_COMMIT, NULL); + ok(ret, "CertControlStore failed: %08lx\n", GetLastError()); + + /* Add a serialized cert with a bogus hash directly to the registry */ + memset(hash, 0, sizeof(hash)); + strcpy(subKeyName, certificates); + for (i = 0, ptr = subKeyName + sizeof(certificates) - 1; + i < sizeof(hash); i++, ptr += 2) + sprintf(ptr, "%02X", hash[i]); + rc = RegCreateKeyExA(key, subKeyName, 0, NULL, 0, KEY_ALL_ACCESS, NULL, + &subKey, NULL); + ok(!rc, "RegCreateKeyExA failed: %ld\n", rc); + if (subKey) + { + BYTE buf[sizeof(struct CertPropIDHeader) * 2 + sizeof(hash) + + sizeof(bigCert) - 1], *ptr; + DWORD certCount = 0; + struct CertPropIDHeader *hdr; + + hdr = (struct CertPropIDHeader *)buf; + hdr->propID = CERT_HASH_PROP_ID; + hdr->unknown1 = 1; + hdr->cb = sizeof(hash); + ptr = buf + sizeof(*hdr); + memcpy(ptr, hash, sizeof(hash)); + ptr += sizeof(hash); + hdr = (struct CertPropIDHeader *)ptr; + hdr->propID = CERT_CERT_PROP_ID; + hdr->unknown1 = 1; + hdr->cb = sizeof(bigCert) - 1; + ptr += sizeof(*hdr); + memcpy(ptr, bigCert, sizeof(bigCert) - 1); + + rc = RegSetValueExA(subKey, "Blob", 0, REG_BINARY, buf, + sizeof(buf)); + ok(!rc, "RegSetValueExA failed: %ld\n", rc); + + ret = CertControlStore(store, 0, CERT_STORE_CTRL_RESYNC, NULL); + ok(ret, "CertControlStore failed: %08lx\n", GetLastError()); + + /* Make sure the bogus hash cert gets loaded. */ + certCount = 0; + context = NULL; + do { + context = CertEnumCertificatesInStore(store, context); + if (context) + certCount++; + } while (context != NULL); + ok(certCount == 1, "Expected 1 certificates, got %ld\n", certCount); + + RegCloseKey(subKey); + } + + /* Add another serialized cert directly to the registry, this time + * under the correct key name (named with the correct hash value). + */ + size = sizeof(hash); + ret = CryptHashCertificate(0, 0, 0, bigCert2, + sizeof(bigCert2) - 1, hash, &size); + ok(ret, "CryptHashCertificate failed: %ld\n", GetLastError()); + strcpy(subKeyName, certificates); + for (i = 0, ptr = subKeyName + sizeof(certificates) - 1; + i < sizeof(hash); i++, ptr += 2) + sprintf(ptr, "%02X", hash[i]); + rc = RegCreateKeyExA(key, subKeyName, 0, NULL, 0, KEY_ALL_ACCESS, NULL, + &subKey, NULL); + ok(!rc, "RegCreateKeyExA failed: %ld\n", rc); + if (subKey) + { + BYTE buf[sizeof(struct CertPropIDHeader) * 2 + sizeof(hash) + + sizeof(bigCert2) - 1], *ptr; + DWORD certCount = 0; + PCCERT_CONTEXT context; + struct CertPropIDHeader *hdr; + + /* First try with a bogus hash... */ + hdr = (struct CertPropIDHeader *)buf; + hdr->propID = CERT_HASH_PROP_ID; + hdr->unknown1 = 1; + hdr->cb = sizeof(hash); + ptr = buf + sizeof(*hdr); + memset(ptr, 0, sizeof(hash)); + ptr += sizeof(hash); + hdr = (struct CertPropIDHeader *)ptr; + hdr->propID = CERT_CERT_PROP_ID; + hdr->unknown1 = 1; + hdr->cb = sizeof(bigCert2) - 1; + ptr += sizeof(*hdr); + memcpy(ptr, bigCert2, sizeof(bigCert2) - 1); + + rc = RegSetValueExA(subKey, "Blob", 0, REG_BINARY, buf, + sizeof(buf)); + ok(!rc, "RegSetValueExA failed: %ld\n", rc); + + ret = CertControlStore(store, 0, CERT_STORE_CTRL_RESYNC, NULL); + ok(ret, "CertControlStore failed: %08lx\n", GetLastError()); + + /* and make sure just one cert still gets loaded. */ + certCount = 0; + context = NULL; + do { + context = CertEnumCertificatesInStore(store, context); + if (context) + certCount++; + } while (context != NULL); + ok(certCount == 1, "Expected 1 certificates, got %ld\n", certCount); + + /* Try again with the correct hash... */ + ptr = buf + sizeof(*hdr); + memcpy(ptr, hash, sizeof(hash)); + + rc = RegSetValueExA(subKey, "Blob", 0, REG_BINARY, buf, + sizeof(buf)); + ok(!rc, "RegSetValueExA failed: %ld\n", rc); + + ret = CertControlStore(store, 0, CERT_STORE_CTRL_RESYNC, NULL); + ok(ret, "CertControlStore failed: %08lx\n", GetLastError()); + + /* and make sure two certs get loaded. */ + certCount = 0; + context = NULL; + do { + context = CertEnumCertificatesInStore(store, context); + if (context) + certCount++; + } while (context != NULL); + ok(certCount == 2, "Expected 2 certificates, got %ld\n", certCount); + + RegCloseKey(subKey); + } + CertCloseStore(store, 0); + /* Is delete allowed on a reg store? */ + store = CertOpenStore(CERT_STORE_PROV_REG, 0, 0, + CERT_STORE_DELETE_FLAG, key); + ok(store == NULL, "Expected NULL return from CERT_STORE_DELETE_FLAG\n"); + ok(GetLastError() == 0, "CertOpenStore failed: %08lx\n", + GetLastError()); + + RegCloseKey(key); + } + /* The CertOpenStore with CERT_STORE_DELETE_FLAG above will delete the + * contents of the key, but not the key itself. + */ + rc = RegCreateKeyExA(HKEY_CURRENT_USER, tempKey, 0, NULL, 0, KEY_ALL_ACCESS, + NULL, &key, &disp); + ok(!rc, "RegCreateKeyExA failed: %ld\n", rc); + ok(disp == REG_OPENED_EXISTING_KEY, + "Expected REG_OPENED_EXISTING_KEY, got %ld\n", disp); + if (!rc) + { + RegCloseKey(key); + rc = RegDeleteKeyA(HKEY_CURRENT_USER, tempKey); + if (rc) + { + HMODULE shlwapi = LoadLibraryA("shlwapi"); + + /* Use shlwapi's SHDeleteKeyA to _really_ blow away the key, + * otherwise subsequent tests will fail. + */ + if (shlwapi) + { + SHDeleteKeyAFunc pSHDeleteKeyA = + (SHDeleteKeyAFunc)GetProcAddress(shlwapi, "SHDeleteKeyA"); + + if (pSHDeleteKeyA) + pSHDeleteKeyA(HKEY_CURRENT_USER, tempKey); + FreeLibrary(shlwapi); + } + } + } +} + +static const char MyA[] = { 'M','y',0,0 }; +static const WCHAR MyW[] = { 'M','y',0 }; +static const WCHAR BogusW[] = { 'B','o','g','u','s',0 }; +static const WCHAR BogusPathW[] = { 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r', + 't','i','f','i','c','a','t','e','s','\\','B','o','g','u','s',0 }; + +static void testSystemRegStore(void) +{ + HCERTSTORE store, memStore; + + /* Check with a UNICODE name */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_OPEN_EXISTING_FLAG, MyW); + /* Not all OSes support CERT_STORE_PROV_SYSTEM_REGISTRY, so don't continue + * testing if they don't. + */ + if (!store) + return; + + /* Check that it isn't a collection store */ + memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + if (memStore) + { + BOOL ret = CertAddStoreToCollection(store, memStore, 0, 0); + + ok(!ret && GetLastError() == + HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + CertCloseStore(memStore, 0); + } + CertCloseStore(store, 0); + + /* Check opening a bogus store */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_OPEN_EXISTING_FLAG, BogusW); + ok(!store && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER, BogusW); + ok(store != 0, "CertOpenStore failed: %08lx\n", GetLastError()); + if (store) + CertCloseStore(store, 0); + /* Now check whether deleting is allowed */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_DELETE_FLAG, BogusW); + RegDeleteKeyW(HKEY_CURRENT_USER, BogusPathW); + + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY, 0, 0, 0, NULL); + ok(!store && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY, 0, 0, + CERT_SYSTEM_STORE_LOCAL_MACHINE | CERT_SYSTEM_STORE_CURRENT_USER, MyA); + ok(!store && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY, 0, 0, + CERT_SYSTEM_STORE_LOCAL_MACHINE | CERT_SYSTEM_STORE_CURRENT_USER, MyW); + ok(!store && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* The name is expected to be UNICODE, check with an ASCII name */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_OPEN_EXISTING_FLAG, MyA); + ok(!store && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); +} + +static void testSystemStore(void) +{ + static const WCHAR baskslashW[] = { '\\',0 }; + HCERTSTORE store; + WCHAR keyName[MAX_PATH]; + HKEY key; + LONG rc; + + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, 0, NULL); + ok(!store && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, + CERT_SYSTEM_STORE_LOCAL_MACHINE | CERT_SYSTEM_STORE_CURRENT_USER, MyA); + ok(!store && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, + CERT_SYSTEM_STORE_LOCAL_MACHINE | CERT_SYSTEM_STORE_CURRENT_USER, MyW); + ok(!store && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + /* The name is expected to be UNICODE, first check with an ASCII name */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_OPEN_EXISTING_FLAG, MyA); + ok(!store && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + /* Create the expected key */ + lstrcpyW(keyName, CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH); + lstrcatW(keyName, baskslashW); + lstrcatW(keyName, MyW); + rc = RegCreateKeyExW(HKEY_CURRENT_USER, keyName, 0, NULL, 0, KEY_READ, + NULL, &key, NULL); + ok(!rc, "RegCreateKeyEx failed: %ld\n", rc); + if (!rc) + RegCloseKey(key); + /* Check opening with a UNICODE name, specifying the create new flag */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_CREATE_NEW_FLAG, MyW); + ok(!store && GetLastError() == ERROR_FILE_EXISTS, + "Expected ERROR_FILE_EXISTS, got %08lx\n", GetLastError()); + /* Now check opening with a UNICODE name, this time opening existing */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_OPEN_EXISTING_FLAG, MyW); + ok(store != 0, "CertOpenStore failed: %08lx\n", GetLastError()); + if (store) + { + HCERTSTORE memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + + /* Check that it's a collection store */ + if (memStore) + { + BOOL ret = CertAddStoreToCollection(store, memStore, 0, 0); + + /* FIXME: this'll fail on NT4, but what error will it give? */ + ok(ret, "CertAddStoreToCollection failed: %08lx\n", GetLastError()); + CertCloseStore(memStore, 0); + } + CertCloseStore(store, 0); + } + + /* Check opening a bogus store */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_OPEN_EXISTING_FLAG, BogusW); + ok(!store && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER, BogusW); + ok(store != 0, "CertOpenStore failed: %08lx\n", GetLastError()); + if (store) + CertCloseStore(store, 0); + /* Now check whether deleting is allowed */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_DELETE_FLAG, BogusW); + RegDeleteKeyW(HKEY_CURRENT_USER, BogusPathW); +} + +static void testCertOpenSystemStore(void) +{ + HCERTSTORE store; + + store = CertOpenSystemStoreW(0, NULL); + ok(!store && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* This succeeds, and on WinXP at least, the Bogus key is created under + * HKCU (but not under HKLM, even when run as an administrator.) + */ + store = CertOpenSystemStoreW(0, BogusW); + ok(store != 0, "CertOpenSystemStore failed: %08lx\n", GetLastError()); + if (store) + CertCloseStore(store, 0); + /* Delete it so other tests succeed next time around */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_DELETE_FLAG, BogusW); + RegDeleteKeyW(HKEY_CURRENT_USER, BogusPathW); +} + static void testCertProperties(void) { PCCERT_CONTEXT context = CertCreateCertificateContext(X509_ASN_ENCODING, @@ -667,6 +1186,169 @@ } } +static void testAddSerialized(void) +{ + BOOL ret; + HCERTSTORE store; + BYTE buf[sizeof(struct CertPropIDHeader) * 2 + 20 + sizeof(bigCert) - 1] = + { 0 }; + BYTE hash[20]; + struct CertPropIDHeader *hdr; + PCCERT_CONTEXT context; + + ret = CertAddSerializedElementToStore(0, NULL, 0, 0, 0, 0, NULL, NULL); + ok(!ret && GetLastError() == ERROR_END_OF_MEDIA, + "Expected ERROR_END_OF_MEDIA, got %08lx\n", GetLastError()); + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != 0, "CertOpenStore failed: %08lx\n", GetLastError()); + + ret = CertAddSerializedElementToStore(store, NULL, 0, 0, 0, 0, NULL, NULL); + ok(!ret && GetLastError() == ERROR_END_OF_MEDIA, + "Expected ERROR_END_OF_MEDIA, got %08lx\n", GetLastError()); + + /* Test with an empty property */ + hdr = (struct CertPropIDHeader *)buf; + hdr->propID = CERT_CERT_PROP_ID; + hdr->unknown1 = 1; + hdr->cb = 0; + ret = CertAddSerializedElementToStore(store, buf, sizeof(buf), 0, 0, 0, + NULL, NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* Test with a bad size in property header */ + hdr->cb = sizeof(bigCert) - 2; + memcpy(buf + sizeof(struct CertPropIDHeader), bigCert, sizeof(bigCert) - 1); + ret = CertAddSerializedElementToStore(store, buf, sizeof(buf), 0, 0, 0, + NULL, NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + ret = CertAddSerializedElementToStore(store, buf, + sizeof(struct CertPropIDHeader) + sizeof(bigCert) - 1, 0, 0, 0, NULL, + NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + ret = CertAddSerializedElementToStore(store, buf, + sizeof(struct CertPropIDHeader) + sizeof(bigCert) - 1, CERT_STORE_ADD_NEW, + 0, 0, NULL, NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* Kosher size in property header, but no context type */ + hdr->cb = sizeof(bigCert) - 1; + ret = CertAddSerializedElementToStore(store, buf, sizeof(buf), 0, 0, 0, + NULL, NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + ret = CertAddSerializedElementToStore(store, buf, + sizeof(struct CertPropIDHeader) + sizeof(bigCert) - 1, 0, 0, 0, NULL, + NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + ret = CertAddSerializedElementToStore(store, buf, + sizeof(struct CertPropIDHeader) + sizeof(bigCert) - 1, CERT_STORE_ADD_NEW, + 0, 0, NULL, NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* With a bad context type */ + ret = CertAddSerializedElementToStore(store, buf, sizeof(buf), 0, 0, + CERT_STORE_CRL_CONTEXT_FLAG, NULL, NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + ret = CertAddSerializedElementToStore(store, buf, + sizeof(struct CertPropIDHeader) + sizeof(bigCert) - 1, 0, 0, + CERT_STORE_CRL_CONTEXT_FLAG, NULL, NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + ret = CertAddSerializedElementToStore(store, buf, + sizeof(struct CertPropIDHeader) + sizeof(bigCert) - 1, CERT_STORE_ADD_NEW, + 0, CERT_STORE_CRL_CONTEXT_FLAG, NULL, NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* Bad unknown field, good type */ + hdr->unknown1 = 2; + ret = CertAddSerializedElementToStore(store, buf, sizeof(buf), 0, 0, + CERT_STORE_CERTIFICATE_CONTEXT_FLAG, NULL, NULL); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND got %08lx\n", GetLastError()); + ret = CertAddSerializedElementToStore(store, buf, + sizeof(struct CertPropIDHeader) + sizeof(bigCert) - 1, 0, 0, + CERT_STORE_CERTIFICATE_CONTEXT_FLAG, NULL, NULL); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND got %08lx\n", GetLastError()); + ret = CertAddSerializedElementToStore(store, buf, + sizeof(struct CertPropIDHeader) + sizeof(bigCert) - 1, CERT_STORE_ADD_NEW, + 0, CERT_STORE_CERTIFICATE_CONTEXT_FLAG, NULL, NULL); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND got %08lx\n", GetLastError()); + /* Most everything okay, but bad add disposition */ + hdr->unknown1 = 1; + /* This crashes + ret = CertAddSerializedElementToStore(store, buf, sizeof(buf), 0, 0, + CERT_STORE_CERTIFICATE_CONTEXT_FLAG, NULL, NULL); + * as does this + ret = CertAddSerializedElementToStore(store, buf, + sizeof(struct CertPropIDHeader) + sizeof(bigCert) - 1, 0, 0, + CERT_STORE_CERTIFICATE_CONTEXT_FLAG, NULL, NULL); + */ + /* Everything okay, but buffer's too big */ + ret = CertAddSerializedElementToStore(store, buf, sizeof(buf), + CERT_STORE_ADD_NEW, 0, CERT_STORE_CERTIFICATE_CONTEXT_FLAG, NULL, NULL); + ok(ret, "CertAddSerializedElementToStore failed: %08lx\n", GetLastError()); + /* Everything okay, check it's not re-added */ + ret = CertAddSerializedElementToStore(store, buf, + sizeof(struct CertPropIDHeader) + sizeof(bigCert) - 1, CERT_STORE_ADD_NEW, + 0, CERT_STORE_CERTIFICATE_CONTEXT_FLAG, NULL, NULL); + ok(!ret && GetLastError() == CRYPT_E_EXISTS, + "Expected CRYPT_E_EXISTS, got %08lx\n", GetLastError()); + + context = CertEnumCertificatesInStore(store, NULL); + ok(context != NULL, "Expected a cert\n"); + if (context) + CertDeleteCertificateFromStore(context); + + /* Try adding with a bogus hash. Oddly enough, it succeeds, and the hash, + * when queried, is the real hash rather than the bogus hash. + */ + hdr = (struct CertPropIDHeader *)(buf + sizeof(struct CertPropIDHeader) + + sizeof(bigCert) - 1); + hdr->propID = CERT_HASH_PROP_ID; + hdr->unknown1 = 1; + hdr->cb = sizeof(hash); + memset(hash, 0xc, sizeof(hash)); + memcpy((LPBYTE)hdr + sizeof(struct CertPropIDHeader), hash, sizeof(hash)); + ret = CertAddSerializedElementToStore(store, buf, sizeof(buf), + CERT_STORE_ADD_NEW, 0, CERT_STORE_CERTIFICATE_CONTEXT_FLAG, NULL, + (const void **)&context); + ok(ret, "CertAddSerializedElementToStore failed: %08lx\n", GetLastError()); + if (context) + { + BYTE hashVal[20], realHash[20]; + DWORD size = sizeof(hashVal); + + ret = CryptHashCertificate(0, 0, 0, bigCert, sizeof(bigCert) - 1, + realHash, &size); + ok(ret, "CryptHashCertificate failed: %08lx\n", GetLastError()); + ret = CertGetCertificateContextProperty(context, CERT_HASH_PROP_ID, + hashVal, &size); + ok(ret, "CertGetCertificateContextProperty failed: %08lx\n", + GetLastError()); + ok(!memcmp(hashVal, realHash, size), "Unexpected hash\n"); + } + + CertCloseStore(store, 0); +} + START_TEST(cert) { testCryptHashCert(); @@ -674,6 +1356,12 @@ /* various combinations of CertOpenStore */ testMemStore(); testCollectionStore(); + testRegStore(); + testSystemRegStore(); + testSystemStore(); + + testCertOpenSystemStore(); testCertProperties(); + testAddSerialized(); } diff -urN wine-20050830/dlls/crypt32/tests/encode.c wine-20050930/dlls/crypt32/tests/encode.c --- wine-20050830/dlls/crypt32/tests/encode.c 2005-08-29 16:12:44.000000000 +0200 +++ wine-20050930/dlls/crypt32/tests/encode.c 2005-09-30 12:35:31.000000000 +0200 @@ -32,14 +32,22 @@ const BYTE *encoded; }; +static const BYTE bin1[] = {0x02,0x01,0x01,0}; +static const BYTE bin2[] = {0x02,0x01,0x7f,0}; +static const BYTE bin3[] = {0x02,0x02,0x00,0x80,0}; +static const BYTE bin4[] = {0x02,0x02,0x01,0x00,0}; +static const BYTE bin5[] = {0x02,0x01,0x80,0}; +static const BYTE bin6[] = {0x02,0x02,0xff,0x7f,0}; +static const BYTE bin7[] = {0x02,0x04,0xba,0xdd,0xf0,0x0d,0}; + static const struct encodedInt ints[] = { - { 1, "\x02\x01\x01" }, - { 127, "\x02\x01\x7f" }, - { 128, "\x02\x02\x00\x80" }, - { 256, "\x02\x02\x01\x00" }, - { -128, "\x02\x01\x80" }, - { -129, "\x02\x02\xff\x7f" }, - { 0xbaddf00d, "\x02\x04\xba\xdd\xf0\x0d" }, + { 1, bin1 }, + { 127, bin2 }, + { 128, bin3 }, + { 256, bin4 }, + { -128, bin5 }, + { -129, bin6 }, + { 0xbaddf00d, bin7 }, }; struct encodedBigInt @@ -49,21 +57,28 @@ const BYTE *decoded; }; +static const BYTE bin8[] = {0xff,0xff,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0}; +static const BYTE bin9[] = {0x02,0x0a,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0xff,0xff,0}; +static const BYTE bin10[] = {0xff,0xff,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0}; + +static const BYTE bin11[] = {0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0xff,0xff,0xff,0}; +static const BYTE bin12[] = {0x02,0x09,0xff,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0}; +static const BYTE bin13[] = {0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0xff,0}; + static const struct encodedBigInt bigInts[] = { - { "\xff\xff\x01\x02\x03\x04\x05\x06\x07\x08", - "\x02\x0a\x08\x07\x06\x05\x04\x03\x02\x01\xff\xff", - "\xff\xff\x01\x02\x03\x04\x05\x06\x07\x08" }, - { "\x08\x07\x06\x05\x04\x03\x02\x01\xff\xff\xff", - "\x02\x09\xff\x01\x02\x03\x04\x05\x06\x07\x08", - "\x08\x07\x06\x05\x04\x03\x02\x01\xff" }, + { bin8, bin9, bin10 }, + { bin11, bin12, bin13 }, }; +static const BYTE bin14[] = {0xff,0xff,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0}; +static const BYTE bin15[] = {0x02,0x0a,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0xff,0xff,0}; +static const BYTE bin16[] = {0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0xff,0xff,0xff,0}; +static const BYTE bin17[] = {0x02,0x0c,0x00,0xff,0xff,0xff,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0}; + /* Decoded is the same as original, so don't bother storing a separate copy */ static const struct encodedBigInt bigUInts[] = { - { "\xff\xff\x01\x02\x03\x04\x05\x06\x07\x08", - "\x02\x0a\x08\x07\x06\x05\x04\x03\x02\x01\xff\xff", NULL }, - { "\x08\x07\x06\x05\x04\x03\x02\x01\xff\xff\xff", - "\x02\x0c\x00\xff\xff\xff\x01\x02\x03\x04\x05\x06\x07\x08", NULL }, + { bin14, bin15, NULL }, + { bin16, bin17, NULL }, }; static void test_encodeInt(DWORD dwEncoding) @@ -97,7 +112,7 @@ NULL, NULL, &bufSize); ok(ret, "Expected success, got %ld\n", GetLastError()); ret = CryptEncodeObjectEx(dwEncoding, X509_INTEGER, &ints[i].val, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &bufSize); ok(ret, "CryptEncodeObjectEx failed: %ld\n", GetLastError()); if (buf) { @@ -116,7 +131,7 @@ 0, NULL, NULL, &bufSize); ok(ret, "Expected success, got %ld\n", GetLastError()); ret = CryptEncodeObjectEx(dwEncoding, X509_MULTI_BYTE_INTEGER, &blob, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &bufSize); ok(ret, "CryptEncodeObjectEx failed: %ld\n", GetLastError()); if (buf) { @@ -134,13 +149,13 @@ */ for (i = 0; i < sizeof(bigInts) / sizeof(bigInts[0]); i++) { - blob.cbData = strlen(bigInts[i].val); + blob.cbData = strlen((const char*)bigInts[i].val); blob.pbData = (BYTE *)bigInts[i].val; ret = CryptEncodeObjectEx(dwEncoding, X509_MULTI_BYTE_INTEGER, &blob, 0, NULL, NULL, &bufSize); ok(ret, "Expected success, got %ld\n", GetLastError()); ret = CryptEncodeObjectEx(dwEncoding, X509_MULTI_BYTE_INTEGER, &blob, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &bufSize); ok(ret, "CryptEncodeObjectEx failed: %ld\n", GetLastError()); if (buf) { @@ -157,13 +172,13 @@ /* and, encode some uints */ for (i = 0; i < sizeof(bigUInts) / sizeof(bigUInts[0]); i++) { - blob.cbData = strlen(bigUInts[i].val); - blob.pbData = (BYTE *)bigUInts[i].val; + blob.cbData = strlen((const char*)bigUInts[i].val); + blob.pbData = (BYTE*)bigUInts[i].val; ret = CryptEncodeObjectEx(dwEncoding, X509_MULTI_BYTE_UINT, &blob, 0, NULL, NULL, &bufSize); ok(ret, "Expected success, got %ld\n", GetLastError()); ret = CryptEncodeObjectEx(dwEncoding, X509_MULTI_BYTE_UINT, &blob, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &bufSize); ok(ret, "CryptEncodeObjectEx failed: %ld\n", GetLastError()); if (buf) { @@ -181,8 +196,8 @@ static void test_decodeInt(DWORD dwEncoding) { - static const char bigInt[] = { 2, 5, 0xff, 0xfe, 0xff, 0xfe, 0xff }; - static const char testStr[] = { 0x16, 4, 't', 'e', 's', 't' }; + static const BYTE bigInt[] = { 2, 5, 0xff, 0xfe, 0xff, 0xfe, 0xff }; + static const BYTE testStr[] = { 0x16, 4, 't', 'e', 's', 't' }; static const BYTE longForm[] = { 2, 0x81, 0x01, 0x01 }; static const BYTE bigBogus[] = { 0x02, 0x84, 0x01, 0xff, 0xff, 0xf9 }; BYTE *buf = NULL; @@ -256,8 +271,8 @@ { CRYPT_INTEGER_BLOB *blob = (CRYPT_INTEGER_BLOB *)buf; - ok(blob->cbData == strlen(bigInts[i].decoded), - "Expected len %d, got %ld\n", strlen(bigInts[i].decoded), + ok(blob->cbData == strlen((const char*)bigInts[i].decoded), + "Expected len %d, got %ld\n", strlen((const char*)bigInts[i].decoded), blob->cbData); ok(!memcmp(blob->pbData, bigInts[i].decoded, blob->cbData), "Unexpected value\n"); @@ -283,8 +298,8 @@ { CRYPT_INTEGER_BLOB *blob = (CRYPT_INTEGER_BLOB *)buf; - ok(blob->cbData == strlen(bigUInts[i].val), - "Expected len %d, got %ld\n", strlen(bigUInts[i].val), + ok(blob->cbData == strlen((const char*)bigUInts[i].val), + "Expected len %d, got %ld\n", strlen((const char*)bigUInts[i].val), blob->cbData); ok(!memcmp(blob->pbData, bigUInts[i].val, blob->cbData), "Unexpected value\n"); @@ -320,12 +335,15 @@ "Expected STATUS_ACCESS_VIOLATION, got %08lx\n", GetLastError()); } +static const BYTE bin18[] = {0x0a,0x01,0x01,0}; +static const BYTE bin19[] = {0x0a,0x05,0x00,0xff,0xff,0xff,0x80,0}; + /* These are always encoded unsigned, and aren't constrained to be any * particular value */ static const struct encodedInt enums[] = { - { 1, "\x0a\x01\x01" }, - { -128, "\x0a\x05\x00\xff\xff\xff\x80" }, + { 1, bin18 }, + { -128, bin19 }, }; /* X509_CRL_REASON_CODE is also an enumerated type, but it's #defined to @@ -463,10 +481,17 @@ "Expected CRYPT_E_ASN1_BADTAG, got 0x%08lx\n", GetLastError()); } +static const BYTE bin20[] = { + 0x17,0x0d,'0','5','0','6','0','6','1','6','1','0','0','0','Z',0}; +static const BYTE bin21[] = { + 0x18,0x0f,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','Z',0}; +static const BYTE bin22[] = { + 0x18,0x0f,'2','1','4','5','0','6','0','6','1','6','1','0','0','0','Z',0}; + static const struct encodedFiletime times[] = { - { { 2005, 6, 1, 6, 16, 10, 0, 0 }, "\x17" "\x0d" "050606161000Z" }, - { { 1945, 6, 1, 6, 16, 10, 0, 0 }, "\x18" "\x0f" "19450606161000Z" }, - { { 2145, 6, 1, 6, 16, 10, 0, 0 }, "\x18" "\x0f" "21450606161000Z" }, + { { 2005, 6, 1, 6, 16, 10, 0, 0 }, bin20 }, + { { 1945, 6, 1, 6, 16, 10, 0, 0 }, bin21 }, + { { 2145, 6, 1, 6, 16, 10, 0, 0 }, bin22 }, }; static void test_encodeFiletime(DWORD dwEncoding) @@ -481,33 +506,66 @@ } } +static const BYTE bin23[] = { + 0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','.','0','0','0','Z',0}; +static const BYTE bin24[] = { + 0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','.','9','9','9','Z',0}; +static const BYTE bin25[] = { + 0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','+','0','1','0','0',0}; +static const BYTE bin26[] = { + 0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','-','0','1','0','0',0}; +static const BYTE bin27[] = { + 0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','-','0','1','1','5',0}; +static const BYTE bin28[] = { + 0x18,0x0a,'2','1','4','5','0','6','0','6','1','6',0}; +static const BYTE bin29[] = { + 0x17,0x0a,'4','5','0','6','0','6','1','6','1','0',0}; +static const BYTE bin30[] = { + 0x17,0x0b,'4','5','0','6','0','6','1','6','1','0','Z',0}; +static const BYTE bin31[] = { + 0x17,0x0d,'4','5','0','6','0','6','1','6','1','0','+','0','1',0}; +static const BYTE bin32[] = { + 0x17,0x0d,'4','5','0','6','0','6','1','6','1','0','-','0','1',0}; +static const BYTE bin33[] = { + 0x17,0x0f,'4','5','0','6','0','6','1','6','1','0','+','0','1','0','0',0}; +static const BYTE bin34[] = { + 0x17,0x0f,'4','5','0','6','0','6','1','6','1','0','-','0','1','0','0',0}; +static const BYTE bin35[] = { + 0x17,0x08, '4','5','0','6','0','6','1','6',0}; +static const BYTE bin36[] = { + 0x18,0x0f, 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','Z',0}; +static const BYTE bin37[] = { + 0x18,0x04, '2','1','4','5',0}; +static const BYTE bin38[] = { + 0x18,0x08, '2','1','4','5','0','6','0','6',0}; + static void test_decodeFiletime(DWORD dwEncoding) { static const struct encodedFiletime otherTimes[] = { - { { 1945, 6, 1, 6, 16, 10, 0, 0 }, "\x18" "\x13" "19450606161000.000Z" }, - { { 1945, 6, 1, 6, 16, 10, 0, 999 }, "\x18" "\x13" "19450606161000.999Z" }, - { { 1945, 6, 1, 6, 17, 10, 0, 0 }, "\x18" "\x13" "19450606161000+0100" }, - { { 1945, 6, 1, 6, 15, 10, 0, 0 }, "\x18" "\x13" "19450606161000-0100" }, - { { 1945, 6, 1, 6, 14, 55, 0, 0 }, "\x18" "\x13" "19450606161000-0115" }, - { { 2145, 6, 1, 6, 16, 0, 0, 0 }, "\x18" "\x0a" "2145060616" }, - { { 2045, 6, 1, 6, 16, 10, 0, 0 }, "\x17" "\x0a" "4506061610" }, - { { 2045, 6, 1, 6, 16, 10, 0, 0 }, "\x17" "\x0b" "4506061610Z" }, - { { 2045, 6, 1, 6, 17, 10, 0, 0 }, "\x17" "\x0d" "4506061610+01" }, - { { 2045, 6, 1, 6, 15, 10, 0, 0 }, "\x17" "\x0d" "4506061610-01" }, - { { 2045, 6, 1, 6, 17, 10, 0, 0 }, "\x17" "\x0f" "4506061610+0100" }, - { { 2045, 6, 1, 6, 15, 10, 0, 0 }, "\x17" "\x0f" "4506061610-0100" }, + { { 1945, 6, 1, 6, 16, 10, 0, 0 }, bin23 }, + { { 1945, 6, 1, 6, 16, 10, 0, 999 }, bin24 }, + { { 1945, 6, 1, 6, 17, 10, 0, 0 }, bin25 }, + { { 1945, 6, 1, 6, 15, 10, 0, 0 }, bin26 }, + { { 1945, 6, 1, 6, 14, 55, 0, 0 }, bin27 }, + { { 2145, 6, 1, 6, 16, 0, 0, 0 }, bin28 }, + { { 2045, 6, 1, 6, 16, 10, 0, 0 }, bin29 }, + { { 2045, 6, 1, 6, 16, 10, 0, 0 }, bin30 }, + { { 2045, 6, 1, 6, 17, 10, 0, 0 }, bin31 }, + { { 2045, 6, 1, 6, 15, 10, 0, 0 }, bin32 }, + { { 2045, 6, 1, 6, 17, 10, 0, 0 }, bin33 }, + { { 2045, 6, 1, 6, 15, 10, 0, 0 }, bin34 }, }; /* An oddball case that succeeds in Windows, but doesn't seem correct { { 2145, 6, 1, 2, 11, 31, 0, 0 }, "\x18" "\x13" "21450606161000-9999" }, */ - static const char *bogusTimes[] = { + static const unsigned char *bogusTimes[] = { /* oddly, this succeeds on Windows, with year 2765 "\x18" "\x0f" "21r50606161000Z", */ - "\x17" "\x08" "45060616", - "\x18" "\x0f" "aaaaaaaaaaaaaaZ", - "\x18" "\x04" "2145", - "\x18" "\x08" "21450606", + bin35, + bin36, + bin37, + bin38, }; DWORD i, size; FILETIME ft1 = { 0 }, ft2 = { 0 }; @@ -555,19 +613,29 @@ static const char bogusIA5[] = "\x80"; static const char bogusPrintable[] = "~"; static const char bogusNumeric[] = "A"; +static const unsigned char bin39[] = { + 0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,'J','u','a','n',' ','L','a','n','g',0}; +static const unsigned char bin40[] = { + 0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x16,0x0a,'J','u','a','n',' ','L','a','n','g',0}; +static const unsigned char bin41[] = { + 0x30,0x10,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55,0x04,0x04,0x16,0x05,'L','a','n','g',0}; +static const unsigned char bin42[] = { + 0x30,0x12,0x31,0x10,0x30,0x0e,0x06,0x00,0x13,0x0a,'J','u','a','n',' ','L','a','n','g',0}; +static const unsigned char bin43[] = { + 0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x03,0x16,0x02,0x80,0}; +static const unsigned char bin44[] = { + 0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x03,0x13,0x02,0x7e,0}; +static const unsigned char bin45[] = { + 0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x03,0x12,0x02,0x41,0}; static const struct EncodedName names[] = { { { szOID_COMMON_NAME, CERT_RDN_PRINTABLE_STRING, - { sizeof(commonName), (BYTE *)commonName } }, - "\x30\x15\x31\x13\x30\x11\x06\x03\x55\x04\x03\x13\x0aJuan Lang" }, + { sizeof(commonName), (BYTE *)commonName } }, bin39 }, { { szOID_COMMON_NAME, CERT_RDN_IA5_STRING, - { sizeof(commonName), (BYTE *)commonName } }, - "\x30\x15\x31\x13\x30\x11\x06\x03\x55\x04\x03\x16\x0aJuan Lang" }, + { sizeof(commonName), (BYTE *)commonName } }, bin40 }, { { szOID_SUR_NAME, CERT_RDN_IA5_STRING, - { sizeof(surName), (BYTE *)surName } }, - "\x30\x10\x31\x0e\x30\x0c\x06\x03\x55\x04\x04\x16\x05Lang" }, + { sizeof(surName), (BYTE *)surName } }, bin41 }, { { NULL, CERT_RDN_PRINTABLE_STRING, - { sizeof(commonName), (BYTE *)commonName } }, - "\x30\x12\x31\x10\x30\x0e\x06\x00\x13\x0aJuan Lang" }, + { sizeof(commonName), (BYTE *)commonName } }, bin42 }, /* The following test isn't a very good one, because it doesn't encode any * Japanese characters. I'm leaving it out for now. { { szOID_COMMON_NAME, CERT_RDN_T61_STRING, @@ -579,21 +647,19 @@ * including them to justify my lazy encoding. */ { { szOID_COMMON_NAME, CERT_RDN_IA5_STRING, - { sizeof(bogusIA5), (BYTE *)bogusIA5 } }, - "\x30\x0d\x31\x0b\x30\x09\x06\x03\x55\x04\x03\x16\x02\x80" }, + { sizeof(bogusIA5), (BYTE *)bogusIA5 } }, bin43 }, { { szOID_COMMON_NAME, CERT_RDN_PRINTABLE_STRING, - { sizeof(bogusPrintable), (BYTE *)bogusPrintable } }, - "\x30\x0d\x31\x0b\x30\x09\x06\x03\x55\x04\x03\x13\x02\x7e" }, + { sizeof(bogusPrintable), (BYTE *)bogusPrintable } }, bin44 }, { { szOID_COMMON_NAME, CERT_RDN_NUMERIC_STRING, - { sizeof(bogusNumeric), (BYTE *)bogusNumeric } }, - "\x30\x0d\x31\x0b\x30\x09\x06\x03\x55\x04\x03\x12\x02\x41" }, + { sizeof(bogusNumeric), (BYTE *)bogusNumeric } }, bin45 }, }; static const BYTE emptyName[] = { 0x30, 0 }; static const BYTE emptyRDNs[] = { 0x30, 0x02, 0x31, 0 }; -static const BYTE twoRDNs[] = "\x30\x23\x31\x21\x30\x0c\x06\x03\x55\x04\x04" - "\x13\x05\x4c\x61\x6e\x67\x00\x30\x11\x06\x03\x55\x04\x03" - "\x13\x0a\x4a\x75\x61\x6e\x20\x4c\x61\x6e\x67"; +static const BYTE twoRDNs[] = { + 0x30,0x23,0x31,0x21,0x30,0x0c,0x06,0x03,0x55,0x04,0x04, + 0x13,0x05,0x4c,0x61,0x6e,0x67,0x00,0x30,0x11,0x06,0x03,0x55,0x04,0x03, + 0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0}; static void test_encodeName(DWORD dwEncoding) { @@ -840,6 +906,8 @@ static const BYTE encodedURL[] = { 0x30, 0x13, 0x86, 0x11, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x69, 0x6e, 0x65, 0x68, 0x71, 0x2e, 0x6f, 0x72, 0x67 }; +static const WCHAR nihongoURL[] = { 'h','t','t','p',':','/','/',0x226f, + 0x575b, 0 }; static const WCHAR dnsName[] = { 'w','i','n','e','h','q','.','o','r','g',0 }; static const BYTE encodedDnsName[] = { 0x30, 0x0c, 0x82, 0x0a, 0x77, 0x69, 0x6e, 0x65, 0x68, 0x71, 0x2e, 0x6f, 0x72, 0x67 }; @@ -847,19 +915,8 @@ static const BYTE encodedIPAddr[] = { 0x30, 0x06, 0x87, 0x04, 0x7f, 0x00, 0x00, 0x01 }; -static void printBytes(const char *hdr, const BYTE *pb, size_t cb) -{ - size_t i; - - printf("%s:\n", hdr); - for (i = 0; i < cb; i++) - printf("%02x ", pb[i]); - putchar('\n'); -} - static void test_encodeAltName(DWORD dwEncoding) { - static const WCHAR nihongo[] = { 0x226f, 0x575b, 0 }; CERT_ALT_NAME_INFO info = { 0 }; CERT_ALT_NAME_ENTRY entry = { 0 }; BYTE *buf = NULL; @@ -907,11 +964,15 @@ LocalFree(buf); } /* Now with the URL containing an invalid IA5 char */ - U(entry).pwszURL = (LPWSTR)nihongo; + U(entry).pwszURL = (LPWSTR)nihongoURL; ret = CryptEncodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, &info, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); ok(!ret && GetLastError() == CRYPT_E_INVALID_IA5_STRING, "Expected CRYPT_E_INVALID_IA5_STRING, got %08lx\n", GetLastError()); + /* The first invalid character is at index 7 */ + ok(GET_CERT_ALT_NAME_VALUE_ERR_INDEX(size) == 7, + "Expected invalid char at index 7, got %ld\n", + GET_CERT_ALT_NAME_VALUE_ERR_INDEX(size)); /* Now with the URL missing a scheme */ U(entry).pwszURL = (LPWSTR)dnsName; ret = CryptEncodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, &info, @@ -1062,10 +1123,19 @@ const BYTE *encoded; }; +static const unsigned char bin46[] = { 'h','i',0 }; +static const unsigned char bin47[] = { 0x04,0x02,'h','i',0 }; +static const unsigned char bin48[] = { + 's','o','m','e','l','o','n','g',0xff,'s','t','r','i','n','g',0 }; +static const unsigned char bin49[] = { + 0x04,0x0f,'s','o','m','e','l','o','n','g',0xff,'s','t','r','i','n','g',0 }; +static const unsigned char bin50[] = { 0 }; +static const unsigned char bin51[] = { 0x04,0x00,0 }; + static const struct encodedOctets octets[] = { - { "hi", "\x04\x02hi" }, - { "somelong\xffstring", "\x04\x0fsomelong\xffstring" }, - { "", "\x04\x00" }, + { bin46, bin47 }, + { bin48, bin49 }, + { bin50, bin51 }, }; static void test_encodeOctets(DWORD dwEncoding) @@ -1079,8 +1149,8 @@ BOOL ret; DWORD bufSize = 0; - blob.cbData = strlen(octets[i].val); - blob.pbData = (BYTE *)octets[i].val; + blob.cbData = strlen((const char*)octets[i].val); + blob.pbData = (BYTE*)octets[i].val; ret = CryptEncodeObjectEx(dwEncoding, X509_OCTET_STRING, &blob, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); ok(ret, "CryptEncodeObjectEx failed: %ld\n", GetLastError()); @@ -1137,14 +1207,22 @@ const BYTE *decoded; }; +static const unsigned char bin52[] = { 0x03,0x03,0x00,0xff,0xff,0 }; +static const unsigned char bin53[] = { 0xff,0xff,0 }; +static const unsigned char bin54[] = { 0x03,0x03,0x01,0xff,0xfe,0 }; +static const unsigned char bin55[] = { 0xff,0xfe,0 }; +static const unsigned char bin56[] = { 0x03,0x02,0x01,0xfe,0 }; +static const unsigned char bin57[] = { 0xfe,0 }; +static const unsigned char bin58[] = { 0x03,0x01,0x00,0 }; + static const struct encodedBits bits[] = { /* normal test cases */ - { 0, "\x03\x03\x00\xff\xff", 2, "\xff\xff" }, - { 1, "\x03\x03\x01\xff\xfe", 2, "\xff\xfe" }, + { 0, bin52, 2, bin53 }, + { 1, bin54, 2, bin55 }, /* strange test case, showing cUnusedBits >= 8 is allowed */ - { 9, "\x03\x02\x01\xfe", 1, "\xfe" }, + { 9, bin56, 1, bin57 }, /* even stranger test case, showing cUnusedBits > cbData * 8 is allowed */ - { 17, "\x03\x01\x00", 0, NULL }, + { 17, bin58, 0, NULL }, }; static void test_encodeBits(DWORD dwEncoding) @@ -1238,17 +1316,21 @@ const BYTE *encoded; }; +static const unsigned char bin59[] = { 0x30,0x00,0 }; +static const unsigned char bin60[] = { 0x30,0x03,0x01,0x01,0xff,0 }; +static const unsigned char bin61[] = { 0x30,0x03,0x02,0x01,0x00,0 }; +static const unsigned char bin62[] = { 0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01,0 }; static const struct Constraints2 constraints2[] = { /* empty constraints */ - { { FALSE, FALSE, 0}, "\x30\x00" }, + { { FALSE, FALSE, 0}, bin59 }, /* can be a CA */ - { { TRUE, FALSE, 0}, "\x30\x03\x01\x01\xff" }, + { { TRUE, FALSE, 0}, bin60 }, /* has path length constraints set (MSDN implies fCA needs to be TRUE as well, * but that's not the case */ - { { FALSE, TRUE, 0}, "\x30\x03\x02\x01\x00" }, + { { FALSE, TRUE, 0}, bin61 }, /* can be a CA and has path length constraints set */ - { { TRUE, TRUE, 1}, "\x30\x06\x01\x01\xff\x02\x01\x01" }, + { { TRUE, TRUE, 1}, bin62 }, }; static void test_encodeBasicConstraints(DWORD dwEncoding) @@ -1278,11 +1360,12 @@ } } +static const unsigned char bin63[] = { 0x30,0x06,0x01,0x01,0x01,0x02,0x01,0x01,0 }; + static void test_decodeBasicConstraints(DWORD dwEncoding) { static const BYTE inverted[] = "\x30\x06\x02\x01\x01\x01\x01\xff"; - static const struct Constraints2 badBool = { { TRUE, TRUE, 1 }, - "\x30\x06\x01\x01\x01\x02\x01\x01" }; + static const struct Constraints2 badBool = { { TRUE, TRUE, 1 }, bin63 }; DWORD i; BOOL ret; BYTE *buf = NULL; @@ -1334,6 +1417,194 @@ "Expected CRYPT_E_ASN1_CORRUPT, got %08lx\n", GetLastError()); } +/* These are terrible public keys of course, I'm just testing encoding */ +static const BYTE modulus1[] = { 0,0,0,1,1,1,1,1 }; +static const BYTE modulus2[] = { 1,1,1,1,1,0,0,0 }; +static const BYTE modulus3[] = { 0x80,1,1,1,1,0,0,0 }; +static const BYTE modulus4[] = { 1,1,1,1,1,0,0,0x80 }; +static const BYTE mod1_encoded[] = { 0x30,0x0f,0x02,0x08,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x02,0x03,0x01,0x00,0x01 }; +static const BYTE mod2_encoded[] = { 0x30,0x0c,0x02,0x05,0x01,0x01,0x01,0x01,0x01,0x02,0x03,0x01,0x00,0x01 }; +static const BYTE mod3_encoded[] = { 0x30,0x0c,0x02,0x05,0x01,0x01,0x01,0x01,0x80,0x02,0x03,0x01,0x00,0x01 }; +static const BYTE mod4_encoded[] = { 0x30,0x10,0x02,0x09,0x00,0x80,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x02,0x03,0x01,0x00,0x01 }; + +struct EncodedRSAPubKey +{ + const BYTE *modulus; + size_t modulusLen; + const BYTE *encoded; + size_t decodedModulusLen; +}; + +struct EncodedRSAPubKey rsaPubKeys[] = { + { modulus1, sizeof(modulus1), mod1_encoded, sizeof(modulus1) }, + { modulus2, sizeof(modulus2), mod2_encoded, 5 }, + { modulus3, sizeof(modulus3), mod3_encoded, 5 }, + { modulus4, sizeof(modulus4), mod4_encoded, 8 }, +}; + +static void test_encodeRsaPublicKey(DWORD dwEncoding) +{ + BYTE toEncode[sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) + sizeof(modulus1)]; + BLOBHEADER *hdr = (BLOBHEADER *)toEncode; + RSAPUBKEY *rsaPubKey = (RSAPUBKEY *)(toEncode + sizeof(BLOBHEADER)); + BOOL ret; + BYTE *buf = NULL; + DWORD bufSize = 0, i; + + /* Try with a bogus blob type */ + hdr->bType = 2; + hdr->bVersion = CUR_BLOB_VERSION; + hdr->reserved = 0; + hdr->aiKeyAlg = CALG_RSA_KEYX; + rsaPubKey->magic = 0x31415352; + rsaPubKey->bitlen = sizeof(modulus1) * 8; + rsaPubKey->pubexp = 65537; + memcpy(toEncode + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY), modulus1, + sizeof(modulus1)); + + ret = CryptEncodeObjectEx(dwEncoding, RSA_CSP_PUBLICKEYBLOB, + toEncode, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, + &bufSize); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* Now with a bogus reserved field */ + hdr->bType = PUBLICKEYBLOB; + hdr->reserved = 1; + ret = CryptEncodeObjectEx(dwEncoding, RSA_CSP_PUBLICKEYBLOB, + toEncode, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, + &bufSize); + if (buf) + { + ok(bufSize == rsaPubKeys[0].encoded[1] + 2, + "Expected size %d, got %ld\n", rsaPubKeys[0].encoded[1] + 2, bufSize); + ok(!memcmp(buf, rsaPubKeys[0].encoded, bufSize), "Unexpected value\n"); + LocalFree(buf); + } + /* Now with a bogus blob version */ + hdr->reserved = 0; + hdr->bVersion = 0; + ret = CryptEncodeObjectEx(dwEncoding, RSA_CSP_PUBLICKEYBLOB, + toEncode, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, + &bufSize); + if (buf) + { + ok(bufSize == rsaPubKeys[0].encoded[1] + 2, + "Expected size %d, got %ld\n", rsaPubKeys[0].encoded[1] + 2, bufSize); + ok(!memcmp(buf, rsaPubKeys[0].encoded, bufSize), "Unexpected value\n"); + LocalFree(buf); + } + /* And with a bogus alg ID */ + hdr->bVersion = CUR_BLOB_VERSION; + hdr->aiKeyAlg = CALG_DES; + ret = CryptEncodeObjectEx(dwEncoding, RSA_CSP_PUBLICKEYBLOB, + toEncode, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, + &bufSize); + if (buf) + { + ok(bufSize == rsaPubKeys[0].encoded[1] + 2, + "Expected size %d, got %ld\n", rsaPubKeys[0].encoded[1] + 2, bufSize); + ok(!memcmp(buf, rsaPubKeys[0].encoded, bufSize), "Unexpected value\n"); + LocalFree(buf); + } + /* Check a couple of RSA-related OIDs */ + hdr->aiKeyAlg = CALG_RSA_KEYX; + ret = CryptEncodeObjectEx(dwEncoding, szOID_RSA_RSA, + toEncode, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + ret = CryptEncodeObjectEx(dwEncoding, szOID_RSA_SHA1RSA, + toEncode, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + /* Finally, all valid */ + hdr->aiKeyAlg = CALG_RSA_KEYX; + for (i = 0; i < sizeof(rsaPubKeys) / sizeof(rsaPubKeys[0]); i++) + { + memcpy(toEncode + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY), + rsaPubKeys[i].modulus, rsaPubKeys[i].modulusLen); + ret = CryptEncodeObjectEx(dwEncoding, RSA_CSP_PUBLICKEYBLOB, + toEncode, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + ok(bufSize == rsaPubKeys[i].encoded[1] + 2, + "Expected size %d, got %ld\n", rsaPubKeys[i].encoded[1] + 2, + bufSize); + ok(!memcmp(buf, rsaPubKeys[i].encoded, bufSize), + "Unexpected value\n"); + LocalFree(buf); + } + } +} + +static void test_decodeRsaPublicKey(DWORD dwEncoding) +{ + DWORD i; + LPBYTE buf = NULL; + DWORD bufSize = 0; + BOOL ret; + + /* Try with a bad length */ + ret = CryptDecodeObjectEx(dwEncoding, RSA_CSP_PUBLICKEYBLOB, + rsaPubKeys[0].encoded, rsaPubKeys[0].encoded[1], + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + ok(!ret && GetLastError() == CRYPT_E_ASN1_EOD, + "Expected CRYPT_E_ASN1_EOD, got %08lx\n", CRYPT_E_ASN1_EOD); + /* Try with a couple of RSA-related OIDs */ + ret = CryptDecodeObjectEx(dwEncoding, szOID_RSA_RSA, + rsaPubKeys[0].encoded, rsaPubKeys[0].encoded[1] + 2, + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + ret = CryptDecodeObjectEx(dwEncoding, szOID_RSA_SHA1RSA, + rsaPubKeys[0].encoded, rsaPubKeys[0].encoded[1] + 2, + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + /* Now try success cases */ + for (i = 0; i < sizeof(rsaPubKeys) / sizeof(rsaPubKeys[0]); i++) + { + bufSize = 0; + ret = CryptDecodeObjectEx(dwEncoding, RSA_CSP_PUBLICKEYBLOB, + rsaPubKeys[i].encoded, rsaPubKeys[i].encoded[1] + 2, + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + BLOBHEADER *hdr = (BLOBHEADER *)buf; + RSAPUBKEY *rsaPubKey = (RSAPUBKEY *)(buf + sizeof(BLOBHEADER)); + + ok(bufSize >= sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) + + rsaPubKeys[i].decodedModulusLen, + "Expected size at least %d, got %ld\n", + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) + + rsaPubKeys[i].decodedModulusLen, bufSize); + ok(hdr->bType == PUBLICKEYBLOB, + "Expected type PUBLICKEYBLOB (%d), got %d\n", PUBLICKEYBLOB, + hdr->bType); + ok(hdr->bVersion == CUR_BLOB_VERSION, + "Expected version CUR_BLOB_VERSION (%d), got %d\n", + CUR_BLOB_VERSION, hdr->bVersion); + ok(hdr->reserved == 0, "Expected reserved 0, got %d\n", + hdr->reserved); + ok(hdr->aiKeyAlg == CALG_RSA_KEYX, + "Expected CALG_RSA_KEYX, got %08x\n", hdr->aiKeyAlg); + ok(rsaPubKey->magic == 0x31415352, + "Expected magic RSA1, got %08lx\n", rsaPubKey->magic); + ok(rsaPubKey->bitlen == rsaPubKeys[i].decodedModulusLen * 8, + "Expected bit len %d, got %ld\n", + rsaPubKeys[i].decodedModulusLen * 8, rsaPubKey->bitlen); + ok(rsaPubKey->pubexp == 65537, "Expected pubexp 65537, got %ld\n", + rsaPubKey->pubexp); + ok(!memcmp(buf + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY), + rsaPubKeys[i].modulus, rsaPubKeys[i].decodedModulusLen), + "Unexpected modulus\n"); + LocalFree(buf); + } + } +} + static const BYTE intSequence[] = { 0x30, 0x1b, 0x02, 0x01, 0x01, 0x02, 0x01, 0x7f, 0x02, 0x02, 0x00, 0x80, 0x02, 0x02, 0x01, 0x00, 0x02, 0x01, 0x80, 0x02, 0x02, 0xff, 0x7f, 0x02, 0x04, 0xba, 0xdd, 0xf0, 0x0d }; @@ -1443,17 +1714,24 @@ const BYTE *encoded; }; +static BYTE crit_ext_data[] = { 0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 }; +static BYTE noncrit_ext_data[] = { 0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 }; + static CERT_EXTENSION criticalExt = - { szOID_BASIC_CONSTRAINTS2, TRUE, { 8, "\x30\x06\x01\x01\xff\x02\x01\x01" } }; + { szOID_BASIC_CONSTRAINTS2, TRUE, { 8, crit_ext_data } }; static CERT_EXTENSION nonCriticalExt = - { szOID_BASIC_CONSTRAINTS2, FALSE, { 8, "\x30\x06\x01\x01\xff\x02\x01\x01" } }; + { szOID_BASIC_CONSTRAINTS2, FALSE, { 8, noncrit_ext_data } }; + +static const BYTE ext0[] = { 0x30,0x00 }; +static const BYTE ext1[] = { 0x30,0x14,0x30,0x12,0x06,0x03,0x55,0x1d,0x13,0x01,0x01, + 0xff,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 }; +static const BYTE ext2[] = { 0x30,0x11,0x30,0x0f,0x06,0x03,0x55,0x1d,0x13,0x04, + 0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 }; static const struct encodedExtensions exts[] = { - { { 0, NULL }, "\x30\x00" }, - { { 1, &criticalExt }, "\x30\x14\x30\x12\x06\x03\x55\x1d\x13\x01\x01\xff" - "\x04\x08\x30\x06\x01\x01\xff\x02\x01\x01" }, - { { 1, &nonCriticalExt }, "\x30\x11\x30\x0f\x06\x03\x55\x1d\x13" - "\x04\x08\x30\x06\x01\x01\xff\x02\x01\x01" }, + { { 0, NULL }, ext0 }, + { { 1, &criticalExt }, ext1 }, + { { 1, &nonCriticalExt }, ext2 }, }; static void test_encodeExtensions(DWORD dwEncoding) @@ -1467,7 +1745,7 @@ DWORD bufSize = 0; ret = CryptEncodeObjectEx(dwEncoding, X509_EXTENSIONS, &exts[i].exts, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); + CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &bufSize); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); if (buf) { @@ -1536,32 +1814,46 @@ 0xe, 0xf }; static const BYTE params[] = { 0x02, 0x01, 0x01 }; +static const unsigned char bin64[] = { + 0x30,0x0b,0x30,0x06,0x06,0x02,0x2a,0x03,0x05,0x00,0x03,0x01,0x00,0}; +static const unsigned char bin65[] = { + 0x30,0x09,0x30,0x04,0x06,0x02,0x2a,0x03,0x03,0x01,0x00,0}; +static const unsigned char bin66[] = { + 0x30,0x0f,0x30,0x0a,0x06,0x06,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x05,0x00,0x03,0x01,0x00,0}; +static const unsigned char bin67[] = { + 0x30,0x0d,0x30,0x08,0x06,0x06,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x03,0x01,0x00,0}; +static const unsigned char bin68[] = { + 0x30,0x1f,0x30,0x0a,0x06,0x06,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x05,0x00,0x03,0x11,0x00,0x00,0x01, + 0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0}; +static const unsigned char bin69[] = { + 0x30,0x1d,0x30,0x08,0x06,0x06,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x03,0x11,0x00,0x00,0x01, + 0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0}; +static const unsigned char bin70[] = { + 0x30,0x20,0x30,0x0b,0x06,0x06,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x01,0x01, + 0x03,0x11,0x00,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e, + 0x0f,0}; +static const unsigned char bin71[] = { + 0x30,0x20,0x30,0x0b,0x06,0x06,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x01,0x01, + 0x03,0x11,0x00,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e, + 0x0f,0}; +static unsigned char bin72[] = { 0x05,0x00,0}; + static const struct encodedPublicKey pubKeys[] = { /* with a bogus OID */ { { { "1.2.3", { 0, NULL } }, { 0, NULL, 0 } }, - "\x30\x0b\x30\x06\x06\x02\x2a\x03\x05\x00\x03\x01\x00", - "\x30\x09\x30\x04\x06\x02\x2a\x03\x03\x01\x00", - { { "1.2.3", { 2, "\x05\x00" } }, { 0, NULL, 0 } } }, + bin64, bin65, + { { "1.2.3", { 2, bin72 } }, { 0, NULL, 0 } } }, /* some normal keys */ { { { szOID_RSA, { 0, NULL } }, { 0, NULL, 0} }, - "\x30\x0f\x30\x0a\x06\x06\x2a\x86\x48\x86\xf7\x0d\x05\x00\x03\x01\x00", - "\x30\x0d\x30\x08\x06\x06\x2a\x86\x48\x86\xf7\x0d\x03\x01\x00", - { { szOID_RSA, { 2, "\x05\x00" } }, { 0, NULL, 0 } } }, + bin66, bin67, + { { szOID_RSA, { 2, bin72 } }, { 0, NULL, 0 } } }, { { { szOID_RSA, { 0, NULL } }, { sizeof(aKey), (BYTE *)aKey, 0} }, - "\x30\x1f\x30\x0a\x06\x06\x2a\x86\x48\x86\xf7\x0d\x05\x00\x03\x11\x00\x00\x01" - "\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x30\x1d\x30\x08\x06\x06\x2a\x86\x48\x86\xf7\x0d\x03\x11\x00\x00\x01" - "\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - { { szOID_RSA, { 2, "\x05\x00" } }, { sizeof(aKey), (BYTE *)aKey, 0} } }, + bin68, bin69, + { { szOID_RSA, { 2, bin72 } }, { sizeof(aKey), (BYTE *)aKey, 0} } }, /* with add'l parameters--note they must be DER-encoded */ { { { szOID_RSA, { sizeof(params), (BYTE *)params } }, { sizeof(aKey), (BYTE *)aKey, 0 } }, - "\x30\x20\x30\x0b\x06\x06\x2a\x86\x48\x86\xf7\x0d\x02\x01\x01" - "\x03\x11\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e" - "\x0f", - "\x30\x20\x30\x0b\x06\x06\x2a\x86\x48\x86\xf7\x0d\x02\x01\x01" - "\x03\x11\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e" - "\x0f", + bin70, bin71, { { szOID_RSA, { sizeof(params), (BYTE *)params } }, { sizeof(aKey), (BYTE *)aKey, 0 } } }, }; @@ -1662,36 +1954,46 @@ "Expected CRYPT_E_ASN1_CORRUPT, got %08lx\n", GetLastError()); } -static const BYTE v1Cert[] = "\x30\x33\x02\x00\x30\x02\x06\x00\x30\x22\x18" - "\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30\x30\x5a\x18\x0f\x31" - "\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30\x30\x5a\x30\x07\x30\x02\x06" - "\x00\x03\x01\x00"; -static const BYTE v2Cert[] = "\x30\x38\xa0\x03\x02\x01\x01\x02\x00\x30\x02\x06" - "\x00\x30\x22\x18\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30\x30" - "\x5a\x18\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30\x30\x5a\x30" - "\x07\x30\x02\x06\x00\x03\x01\x00"; -static const BYTE v3Cert[] = "\x30\x38\xa0\x03\x02\x01\x02\x02\x00\x30\x02\x06" - "\x00\x30\x22\x18\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30\x30" - "\x5a\x18\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30\x30\x5a\x30" - "\x07\x30\x02\x06\x00\x03\x01\x00"; -static const BYTE v1CertWithConstraints[] = "\x30\x4b\x02\x00\x30\x02\x06\x00" - "\x30\x22\x18\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30\x30\x5a" - "\x18\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30\x30\x5a\x30\x07" - "\x30\x02\x06\x00\x03\x01\x00\xa3\x16\x30\x14\x30\x12\x06\x03\x55\x1d\x13\x01" - "\x01\xff\x04\x08\x30\x06\x01\x01\xff\x02\x01\x01"; -static const BYTE v1CertWithSerial[] = "\x30\x4c\x02\x01\x01\x30\x02\x06\x00" - "\x30\x22\x18\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30\x30\x5a" - "\x18\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30\x30\x5a\x30\x07" - "\x30\x02\x06\x00\x03\x01\x00\xa3\x16\x30\x14\x30\x12\x06\x03\x55\x1d\x13\x01" - "\x01\xff\x04\x08\x30\x06\x01\x01\xff\x02\x01\x01"; -static const BYTE bigCert[] = "\x30\x7a\x02\x01\x01\x30\x02\x06\x00" - "\x30\x15\x31\x13\x30\x11\x06\x03\x55\x04\x03\x13\x0a\x4a\x75\x61\x6e\x20\x4c" - "\x61\x6e\x67\x00\x30\x22\x18\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30" - "\x30\x30\x30\x5a\x18\x0f\x31\x36\x30\x31\x30\x31\x30\x31\x30\x30\x30\x30\x30" - "\x30\x5a\x30\x15\x31\x13\x30\x11\x06\x03\x55\x04\x03\x13\x0a\x4a\x75\x61\x6e" - "\x20\x4c\x61\x6e\x67\x00\x30\x07\x30\x02\x06\x00\x03\x01\x00\xa3\x16\x30\x14" - "\x30\x12\x06\x03\x55\x1d\x13\x01\x01\xff\x04\x08\x30\x06\x01\x01\xff\x02\x01" - "\x01"; +static const BYTE v1Cert[] = { 0x30, 0x33, 0x02, 0x00, 0x30, 0x02, 0x06, 0x00, + 0x30, 0x22, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, + 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x07, 0x30, + 0x02, 0x06, 0x00, 0x03, 0x01, 0x00 }; +static const BYTE v2Cert[] = { 0x30, 0x38, 0xa0, 0x03, 0x02, 0x01, 0x01, 0x02, + 0x00, 0x30, 0x02, 0x06, 0x00, 0x30, 0x22, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, + 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, + 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x5a, 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01, 0x00 }; +static const BYTE v3Cert[] = { 0x30, 0x38, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, + 0x00, 0x30, 0x02, 0x06, 0x00, 0x30, 0x22, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, + 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, + 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x5a, 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01, 0x00 }; +static const BYTE v1CertWithConstraints[] = { 0x30, 0x4b, 0x02, 0x00, 0x30, + 0x02, 0x06, 0x00, 0x30, 0x22, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, + 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x31, 0x36, + 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, + 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01, 0x00, 0xa3, 0x16, 0x30, 0x14, + 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, + 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 }; +static const BYTE v1CertWithSerial[] = { 0x30, 0x4c, 0x02, 0x01, 0x01, 0x30, + 0x02, 0x06, 0x00, 0x30, 0x22, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, + 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x31, 0x36, + 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, + 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01, 0x00, 0xa3, 0x16, 0x30, 0x14, + 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, + 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 }; +static const BYTE bigCert[] = { 0x30, 0x7a, 0x02, 0x01, 0x01, 0x30, 0x02, 0x06, + 0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, + 0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x30, 0x22, + 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, + 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x15, 0x31, 0x13, 0x30, + 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20, + 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01, + 0x00, 0xa3, 0x16, 0x30, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, + 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 }; + /* This is the encoded form of the printable string "Juan Lang" */ static const BYTE encodedCommonName[] = { 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x4c, @@ -1728,8 +2030,8 @@ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); if (buf) { - ok(size == v2Cert[1] + 2, "Expected size %d, got %ld\n", - v3Cert[1] + 2, size); + ok(size == sizeof(v2Cert), "Expected size %d, got %ld\n", + sizeof(v2Cert), size); ok(!memcmp(buf, v2Cert, size), "Got unexpected value\n"); LocalFree(buf); } @@ -1740,8 +2042,8 @@ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); if (buf) { - ok(size == v3Cert[1] + 2, "Expected size %d, got %ld\n", - v3Cert[1] + 2, size); + ok(size == sizeof(v3Cert), "Expected size %d, got %ld\n", + sizeof(v3Cert), size); ok(!memcmp(buf, v3Cert, size), "Got unexpected value\n"); LocalFree(buf); } @@ -1756,8 +2058,8 @@ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); if (buf) { - ok(size == v1CertWithConstraints[1] + 2, "Expected size %d, got %ld\n", - v1CertWithConstraints[1] + 2, size); + ok(size == sizeof(v1CertWithConstraints), "Expected size %d, got %ld\n", + sizeof(v1CertWithConstraints), size); ok(!memcmp(buf, v1CertWithConstraints, size), "Got unexpected value\n"); LocalFree(buf); } @@ -1768,8 +2070,8 @@ CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); if (buf) { - ok(size == v1CertWithSerial[1] + 2, "Expected size %d, got %ld\n", - v1CertWithSerial[1] + 2, size); + ok(size == sizeof(v1CertWithSerial), "Expected size %d, got %ld\n", + sizeof(v1CertWithSerial), size); ok(!memcmp(buf, v1CertWithSerial, size), "Got unexpected value\n"); LocalFree(buf); } @@ -1782,8 +2084,8 @@ CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); if (buf) { - ok(size == bigCert[1] + 2, "Expected size %d, got %ld\n", - bigCert[1] + 2, size); + ok(size == sizeof(bigCert), "Expected size %d, got %ld\n", + sizeof(bigCert), size); ok(!memcmp(buf, bigCert, size), "Got unexpected value\n"); LocalFree(buf); } @@ -1812,21 +2114,18 @@ /* The following certs all fail with CRYPT_E_ASN1_CORRUPT, because at a * minimum a cert must have a non-zero serial number, an issuer, and a * subject. - * It's hard to match the errors precisely sometimes, so accept one - * that only wine gives as long as it fails */ for (i = 0; i < sizeof(corruptCerts) / sizeof(corruptCerts[0]); i++) { ret = CryptDecodeObjectEx(dwEncoding, X509_CERT_TO_BE_SIGNED, corruptCerts[i], corruptCerts[i][1] + 2, CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && (GetLastError() == CRYPT_E_ASN1_CORRUPT || - GetLastError() == CRYPT_E_ASN1_BADTAG), + ok(!ret && (GetLastError() == CRYPT_E_ASN1_CORRUPT), "Expected CRYPT_E_ASN1_CORRUPT, got %08lx\n", GetLastError()); } /* Now check with serial number, subject and issuer specified */ ret = CryptDecodeObjectEx(dwEncoding, X509_CERT_TO_BE_SIGNED, bigCert, - bigCert[1] + 2, CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + sizeof(bigCert), CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); if (buf) { @@ -1876,7 +2175,7 @@ * also that bigCert is a NULL-terminated string, so don't count its * last byte (otherwise the signed cert won't decode.) */ - CERT_SIGNED_CONTENT_INFO info = { { sizeof(bigCert) - 1, (BYTE *)bigCert }, + CERT_SIGNED_CONTENT_INFO info = { { sizeof(bigCert), (BYTE *)bigCert }, { NULL, { 0, NULL } }, { sizeof(hash), (BYTE *)hash, 0 } }; BOOL ret; BYTE *buf = NULL; @@ -1907,8 +2206,8 @@ { CERT_SIGNED_CONTENT_INFO *info = (CERT_SIGNED_CONTENT_INFO *)buf; - ok(info->ToBeSigned.cbData == sizeof(bigCert) - 1, - "Expected cert to be %d bytes, got %ld\n", sizeof(bigCert) - 1, + ok(info->ToBeSigned.cbData == sizeof(bigCert), + "Expected cert to be %d bytes, got %ld\n", sizeof(bigCert), info->ToBeSigned.cbData); ok(!memcmp(info->ToBeSigned.pbData, bigCert, info->ToBeSigned.cbData), "Unexpected cert\n"); @@ -2057,11 +2356,7 @@ ret = CryptDecodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, corruptCRLs[i], corruptCRLs[i][1] + 2, CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - /* It's hard to match the errors precisely sometimes, so accept one - * that only wine gives as long as it fails - */ - ok(!ret && (GetLastError() == CRYPT_E_ASN1_CORRUPT || - GetLastError() == CRYPT_E_ASN1_BADTAG), + ok(!ret && (GetLastError() == CRYPT_E_ASN1_CORRUPT), "Expected CRYPT_E_ASN1_CORRUPT, got %08lx\n", GetLastError()); } /* at a minimum, a CRL must contain an issuer: */ @@ -2117,12 +2412,6 @@ info->Issuer.cbData); ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData), "Unexpected issuer\n"); - if (memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData)) - { - printBytes("Expected", encodedCommonName, - sizeof(encodedCommonName)); - printBytes("Got", info->Issuer.pbData, info->Issuer.cbData); - } } /* and finally, with an extension */ ret = CryptDecodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, @@ -2213,6 +2502,114 @@ ok(ret, "CryptUnregisterOIDFunction failed: %ld\n", GetLastError()); } +/* Free *pInfo with HeapFree */ +static void testExportPublicKey(HCRYPTPROV csp, PCERT_PUBLIC_KEY_INFO *pInfo) +{ + BOOL ret; + DWORD size = 0; + HCRYPTKEY key; + + /* This crashes + ret = CryptExportPublicKeyInfoEx(0, 0, 0, NULL, 0, NULL, NULL, NULL); + */ + ret = CryptExportPublicKeyInfoEx(0, 0, 0, NULL, 0, NULL, NULL, &size); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %08lx\n", GetLastError()); + ret = CryptExportPublicKeyInfoEx(0, AT_SIGNATURE, 0, NULL, 0, NULL, NULL, + &size); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %08lx\n", GetLastError()); + ret = CryptExportPublicKeyInfoEx(0, 0, X509_ASN_ENCODING, NULL, 0, NULL, + NULL, &size); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %08lx\n", GetLastError()); + ret = CryptExportPublicKeyInfoEx(0, AT_SIGNATURE, X509_ASN_ENCODING, NULL, + 0, NULL, NULL, &size); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %08lx\n", GetLastError()); + /* Test with no key */ + ret = CryptExportPublicKeyInfoEx(csp, AT_SIGNATURE, X509_ASN_ENCODING, NULL, + 0, NULL, NULL, &size); + ok(!ret && GetLastError() == NTE_NO_KEY, "Expected NTE_NO_KEY, got %08lx\n", + GetLastError()); + ret = CryptGenKey(csp, AT_SIGNATURE, 0, &key); + ok(ret, "CryptGenKey failed: %08lx\n", GetLastError()); + if (ret) + { + ret = CryptExportPublicKeyInfoEx(csp, AT_SIGNATURE, X509_ASN_ENCODING, + NULL, 0, NULL, NULL, &size); + ok(ret, "CryptExportPublicKeyInfoEx failed: %08lx\n", GetLastError()); + *pInfo = HeapAlloc(GetProcessHeap(), 0, size); + if (*pInfo) + { + ret = CryptExportPublicKeyInfoEx(csp, AT_SIGNATURE, + X509_ASN_ENCODING, NULL, 0, NULL, *pInfo, &size); + ok(ret, "CryptExportPublicKeyInfoEx failed: %08lx\n", + GetLastError()); + if (ret) + { + /* By default (we passed NULL as the OID) the OID is + * szOID_RSA_RSA. + */ + ok(!strcmp((*pInfo)->Algorithm.pszObjId, szOID_RSA_RSA), + "Expected %s, got %s\n", szOID_RSA_RSA, + (*pInfo)->Algorithm.pszObjId); + } + } + } +} + +static void testImportPublicKey(HCRYPTPROV csp, PCERT_PUBLIC_KEY_INFO info) +{ + BOOL ret; + HCRYPTKEY key; + + /* These crash + ret = CryptImportPublicKeyInfoEx(0, 0, NULL, 0, 0, NULL, NULL); + ret = CryptImportPublicKeyInfoEx(0, 0, NULL, 0, 0, NULL, &key); + ret = CryptImportPublicKeyInfoEx(0, 0, info, 0, 0, NULL, NULL); + ret = CryptImportPublicKeyInfoEx(csp, X509_ASN_ENCODING, info, 0, 0, NULL, + NULL); + */ + ret = CryptImportPublicKeyInfoEx(0, 0, info, 0, 0, NULL, &key); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + ret = CryptImportPublicKeyInfoEx(csp, 0, info, 0, 0, NULL, &key); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError()); + ret = CryptImportPublicKeyInfoEx(0, X509_ASN_ENCODING, info, 0, 0, NULL, + &key); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %08lx\n", GetLastError()); + ret = CryptImportPublicKeyInfoEx(csp, X509_ASN_ENCODING, info, 0, 0, NULL, + &key); + ok(ret, "CryptImportPublicKeyInfoEx failed: %08lx\n", GetLastError()); + CryptDestroyKey(key); +} + +static const char cspName[] = "WineCryptTemp"; + +static void testPortPublicKeyInfo(void) +{ + HCRYPTPROV csp; + BOOL ret; + PCERT_PUBLIC_KEY_INFO info = NULL; + + /* Just in case a previous run failed, delete this thing */ + CryptAcquireContextA(&csp, cspName, MS_DEF_PROV, PROV_RSA_FULL, + CRYPT_DELETEKEYSET); + ret = CryptAcquireContextA(&csp, cspName, MS_DEF_PROV, PROV_RSA_FULL, + CRYPT_NEWKEYSET); + + testExportPublicKey(csp, &info); + testImportPublicKey(csp, info); + + HeapFree(GetProcessHeap(), 0, info); + CryptReleaseContext(csp, 0); + ret = CryptAcquireContextA(&csp, cspName, MS_DEF_PROV, PROV_RSA_FULL, + CRYPT_DELETEKEYSET); +} + START_TEST(encode) { static const DWORD encodings[] = { X509_ASN_ENCODING, PKCS_7_ASN_ENCODING, @@ -2237,6 +2634,8 @@ test_decodeBits(encodings[i]); test_encodeBasicConstraints(encodings[i]); test_decodeBasicConstraints(encodings[i]); + test_encodeRsaPublicKey(encodings[i]); + test_decodeRsaPublicKey(encodings[i]); test_encodeSequenceOfAny(encodings[i]); test_decodeSequenceOfAny(encodings[i]); test_encodeExtensions(encodings[i]); @@ -2251,4 +2650,5 @@ test_decodeCRLToBeSigned(encodings[i]); } test_registerOIDFunction(); + testPortPublicKeyInfo(); } diff -urN wine-20050830/dlls/crypt32/tests/main.c wine-20050930/dlls/crypt32/tests/main.c --- wine-20050830/dlls/crypt32/tests/main.c 2005-08-29 11:38:19.000000000 +0200 +++ wine-20050930/dlls/crypt32/tests/main.c 2005-09-03 11:36:55.000000000 +0200 @@ -87,12 +87,21 @@ static void testOIDToAlgID(void) { int i; + DWORD alg; + + /* Test with a bogus one */ + SetLastError(0xdeadbeef); + alg = CertOIDToAlgId("1.2.3"); + ok(!alg && GetLastError() == 0xdeadbeef, + "Didn't expect last error (%08lx) to be set\n", GetLastError()); for (i = 0; i < sizeof(oidToAlgID) / sizeof(oidToAlgID[0]); i++) { - DWORD alg = CertOIDToAlgId(oidToAlgID[i].oid); - - ok(alg == oidToAlgID[i].algID, + alg = CertOIDToAlgId(oidToAlgID[i].oid); + /* Not all Windows installations support all these, so make sure it's + * at least not the wrong one. + */ + ok(alg == 0 || alg == oidToAlgID[i].algID, "Expected %ld, got %ld\n", oidToAlgID[i].algID, alg); } } @@ -100,16 +109,20 @@ static void testAlgIDToOID(void) { int i; + LPCSTR oid; + /* Test with a bogus one */ + SetLastError(0xdeadbeef); + oid = CertAlgIdToOID(ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | 80); + ok(!oid && GetLastError() == 0xdeadbeef, + "Didn't expect last error (%08lx) to be set\n", GetLastError()); for (i = 0; i < sizeof(algIDToOID) / sizeof(algIDToOID[0]); i++) { - LPCSTR oid = CertAlgIdToOID(algIDToOID[i].algID); - - if ((!oid || !algIDToOID[i].oid) && oid != algIDToOID[i].oid && - algIDToOID[i].algID) - printf("Expected %s, got %s\n", algIDToOID[i].oid, oid); - else if (oid && algIDToOID[i].oid && strcmp(oid, algIDToOID[i].oid)) - printf("Expected %s, got %s\n", algIDToOID[i].oid, oid); + oid = CertAlgIdToOID(algIDToOID[i].algID); + /* Allow failure, not every version of Windows supports every algo */ + if (oid) + ok(!strcmp(oid, algIDToOID[i].oid), + "Expected %s, got %s\n", algIDToOID[i].oid, oid); } } diff -urN wine-20050830/dlls/cryptdll/.cvsignore wine-20050930/dlls/cryptdll/.cvsignore --- wine-20050830/dlls/cryptdll/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/cryptdll/.cvsignore 2005-09-29 12:36:06.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -cryptdll.dll.dbg.c libcryptdll.def diff -urN wine-20050830/dlls/ctl3d/.cvsignore wine-20050930/dlls/ctl3d/.cvsignore --- wine-20050830/dlls/ctl3d/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/ctl3d/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,5 +1,2 @@ Makefile -ctl3d.spec.c -ctl3d32.dll.dbg.c -ctl3dv2.spec.c libctl3d32.def diff -urN wine-20050830/dlls/d3d8/.cvsignore wine-20050930/dlls/d3d8/.cvsignore --- wine-20050830/dlls/d3d8/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/d3d8/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -d3d8.dll.dbg.c libd3d8.def version.res diff -urN wine-20050830/dlls/d3d8/d3d8.spec wine-20050930/dlls/d3d8/d3d8.spec --- wine-20050830/dlls/d3d8/d3d8.spec 2004-05-27 03:56:56.000000000 +0200 +++ wine-20050930/dlls/d3d8/d3d8.spec 2005-09-21 11:42:21.000000000 +0200 @@ -1,5 +1,5 @@ @ stdcall D3D8GetSWInfo() @ stdcall DebugSetMute() @ stdcall Direct3DCreate8(long) -@ stdcall ValidatePixelShader(ptr ptr) -@ stdcall ValidateVertexShader(ptr) +@ stdcall ValidatePixelShader(ptr long long ptr) +@ stdcall ValidateVertexShader(ptr long long ptr) diff -urN wine-20050830/dlls/d3d8/d3d8_private.h wine-20050930/dlls/d3d8/d3d8_private.h --- wine-20050830/dlls/d3d8/d3d8_private.h 2005-07-11 15:21:17.000000000 +0200 +++ wine-20050930/dlls/d3d8/d3d8_private.h 2005-09-28 20:12:00.000000000 +0200 @@ -29,6 +29,7 @@ /* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES */ #define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */ +#define GL_GLEXT_PROTOTYPES #include #define GLX_GLXEXT_PROTOTYPES #include diff -urN wine-20050830/dlls/d3d8/shader.c wine-20050930/dlls/d3d8/shader.c --- wine-20050830/dlls/d3d8/shader.c 2005-07-10 19:48:20.000000000 +0200 +++ wine-20050930/dlls/d3d8/shader.c 2005-09-26 11:52:56.000000000 +0200 @@ -2364,16 +2364,24 @@ /*********************************************************************** * ValidateVertexShader (D3D8.@) + * + * PARAMS + * toto result? */ -BOOL WINAPI ValidateVertexShader(LPVOID what) { - FIXME("(void): stub: %p\n", what); - return 0; +BOOL WINAPI ValidateVertexShader(LPVOID pFunction, int param1, int param2, LPVOID toto) +{ + FIXME("(void): stub: pFunction %p, param1 %d, param2 %d, result? %p\n", pFunction, param1, param2, toto); + return 0; } /*********************************************************************** - * ValidatePixelShader (D3D8.@) + * ValidatePixelShader (D3D8.@) + * + * PARAMS + * toto result? */ -BOOL WINAPI ValidatePixelShader(LPVOID what, LPVOID toto) { - FIXME("(void): stub: %p %p\n", what, toto); - return TRUE; +BOOL WINAPI ValidatePixelShader(LPVOID pFunction, int param1, int param2, LPVOID toto) +{ + FIXME("(void): stub: pFunction %p, param1 %d, param2 %d, result? %p\n", pFunction, param1, param2, toto); + return TRUE; } diff -urN wine-20050830/dlls/d3d8/surface.c wine-20050930/dlls/d3d8/surface.c --- wine-20050830/dlls/d3d8/surface.c 2005-08-03 23:25:11.000000000 +0200 +++ wine-20050930/dlls/d3d8/surface.c 2005-09-29 12:31:22.000000000 +0200 @@ -167,11 +167,12 @@ } /* DXTn formats don't have exact pitches as they are to the new row of blocks, - where each block is 4x4 pixels, 8 bytes (dxt1) and 16 bytes (dxt3/5) + where each block is 4x4 pixels, 8 bytes (dxt1) and 16 bytes (dxt2/3/4/5) ie pitch = (width/4) * bytes per block */ if (This->myDesc.Format == D3DFMT_DXT1) /* DXT1 is 8 bytes per block */ pLockedRect->Pitch = (This->myDesc.Width/4) * 8; - else if (This->myDesc.Format == D3DFMT_DXT3 || This->myDesc.Format == D3DFMT_DXT5) /* DXT3/5 is 16 bytes per block */ + else if (This->myDesc.Format == D3DFMT_DXT2 || This->myDesc.Format == D3DFMT_DXT3 || + This->myDesc.Format == D3DFMT_DXT4 || This->myDesc.Format == D3DFMT_DXT5) /* DXT2/3/4/5 is 16 bytes per block */ pLockedRect->Pitch = (This->myDesc.Width/4) * 16; else pLockedRect->Pitch = This->bytesPerPixel * This->myDesc.Width; /* Bytes / row */ @@ -495,7 +496,8 @@ if (gl_level != 0) FIXME("Surface in texture is only supported for level 0\n"); else if (This->myDesc.Format == D3DFMT_P8 || This->myDesc.Format == D3DFMT_A8P8 || - This->myDesc.Format == D3DFMT_DXT1 || This->myDesc.Format == D3DFMT_DXT3 || + This->myDesc.Format == D3DFMT_DXT1 || This->myDesc.Format == D3DFMT_DXT2 || + This->myDesc.Format == D3DFMT_DXT3 || This->myDesc.Format == D3DFMT_DXT4 || This->myDesc.Format == D3DFMT_DXT5) FIXME("Format %d not supported\n", This->myDesc.Format); else { @@ -568,7 +570,9 @@ } if (This->myDesc.Format == D3DFMT_DXT1 || + This->myDesc.Format == D3DFMT_DXT2 || This->myDesc.Format == D3DFMT_DXT3 || + This->myDesc.Format == D3DFMT_DXT4 || This->myDesc.Format == D3DFMT_DXT5) { if (GL_SUPPORT_DEV(EXT_TEXTURE_COMPRESSION_S3TC, This->Device)) { TRACE("Calling glCompressedTexImage2D %x i=%d, intfmt=%x, w=%d, h=%d,0=%d, sz=%d, Mem=%p\n", diff -urN wine-20050830/dlls/d3d8/utils.c wine-20050930/dlls/d3d8/utils.c --- wine-20050830/dlls/d3d8/utils.c 2005-01-09 17:42:53.000000000 +0100 +++ wine-20050930/dlls/d3d8/utils.c 2005-09-29 12:31:22.000000000 +0200 @@ -406,7 +406,9 @@ case D3DFMT_X8L8V8U8: retVal = 4; break; /* Compressed */ case D3DFMT_DXT1: retVal = 1; break; /* Actually 8 bytes per 16 pixels - Special cased later */ + case D3DFMT_DXT2: retVal = 1; break; /* Actually 16 bytes per 16 pixels */ case D3DFMT_DXT3: retVal = 1; break; /* Actually 16 bytes per 16 pixels */ + case D3DFMT_DXT4: retVal = 1; break; /* Actually 16 bytes per 16 pixels */ case D3DFMT_DXT5: retVal = 1; break; /* Actually 16 bytes per 16 pixels */ /* to see */ case D3DFMT_A8: retVal = 1; break; @@ -431,7 +433,9 @@ if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) { switch (fmt) { case D3DFMT_DXT1: retVal = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break; + case D3DFMT_DXT2: retVal = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break; case D3DFMT_DXT3: retVal = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break; + case D3DFMT_DXT4: retVal = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; case D3DFMT_DXT5: retVal = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; default: /* stupid compiler */ @@ -480,7 +484,9 @@ if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) { switch (fmt) { case D3DFMT_DXT1: retVal = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break; + case D3DFMT_DXT2: retVal = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break; case D3DFMT_DXT3: retVal = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break; + case D3DFMT_DXT4: retVal = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; case D3DFMT_DXT5: retVal = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; default: /* stupid compiler */ @@ -530,7 +536,9 @@ if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) { switch (fmt) { case D3DFMT_DXT1: retVal = 0; break; + case D3DFMT_DXT2: retVal = 0; break; case D3DFMT_DXT3: retVal = 0; break; + case D3DFMT_DXT4: retVal = 0; break; case D3DFMT_DXT5: retVal = 0; break; default: /* stupid compiler */ diff -urN wine-20050830/dlls/d3d8/vshaderdeclaration.c wine-20050930/dlls/d3d8/vshaderdeclaration.c --- wine-20050830/dlls/d3d8/vshaderdeclaration.c 2004-12-09 15:08:00.000000000 +0100 +++ wine-20050930/dlls/d3d8/vshaderdeclaration.c 2005-09-09 16:50:29.000000000 +0200 @@ -389,7 +389,7 @@ /*DWORD tokenlen;*/ DWORD tokentype; /** for input readers */ - const char* curPos = NULL; + const BYTE* curPos = NULL; FLOAT x, y, z, w; SHORT u, v, r, t; DWORD dw; @@ -419,7 +419,7 @@ return D3DERR_INVALIDCALL; } else { if (This->StateBlock->streamIsUP) { - curPos = ((char *) pVB) + (SkipnStrides * skip); /* Not really a VB */ + curPos = (BYTE *)pVB + (SkipnStrides * skip); /* Not really a VB */ } else { curPos = ((IDirect3DVertexBuffer8Impl*) pVB)->allocatedMemory + (SkipnStrides * skip); } @@ -576,7 +576,7 @@ /*DWORD tokenlen;*/ DWORD tokentype; /** for input readers */ - const char* curPos = NULL; + const BYTE* curPos = NULL; int skip = 0; TRACE("(%p) - This:%p, skipstrides=%lu\n", vshader, This, SkipnStrides); @@ -603,7 +603,7 @@ return D3DERR_INVALIDCALL; } else { if (This->StateBlock->streamIsUP) { - curPos = ((char *) pVB) + (SkipnStrides * skip); /* Not really a VB */ + curPos = ((BYTE *) pVB) + (SkipnStrides * skip); /* Not really a VB */ } else { curPos = ((IDirect3DVertexBuffer8Impl*) pVB)->allocatedMemory + (SkipnStrides * skip); } diff -urN wine-20050830/dlls/d3d9/.cvsignore wine-20050930/dlls/d3d9/.cvsignore --- wine-20050830/dlls/d3d9/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/d3d9/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -d3d9.dll.dbg.c libd3d9.def version.res diff -urN wine-20050830/dlls/d3d9/d3d9_main.c wine-20050930/dlls/d3d9/d3d9_main.c --- wine-20050830/dlls/d3d9/d3d9_main.c 2005-08-23 11:34:57.000000000 +0200 +++ wine-20050930/dlls/d3d9/d3d9_main.c 2005-09-26 11:52:56.000000000 +0200 @@ -72,16 +72,24 @@ /*********************************************************************** * ValidateVertexShader (D3D9.@) + * + * PARAMS + * toto result? */ -BOOL WINAPI ValidateVertexShader(LPVOID pFunction, int param1, int param2, LPVOID toto/* result? */) { +BOOL WINAPI ValidateVertexShader(LPVOID pFunction, int param1, int param2, LPVOID toto) +{ FIXME("(void): stub: %p %d %d %p\n", pFunction, param1, param2, toto); return TRUE; } /*********************************************************************** * ValidatePixelShader (D3D9.@) + * + * PARAMS + * toto result? */ -BOOL WINAPI ValidatePixelShader(LPVOID pFunction, int param1, int param2, LPVOID toto/* result?*/) { +BOOL WINAPI ValidatePixelShader(LPVOID pFunction, int param1, int param2, LPVOID toto) +{ FIXME("(void): stub: %p %d %d %p\n", pFunction, param1, param2, toto); return TRUE; } diff -urN wine-20050830/dlls/d3dim/.cvsignore wine-20050930/dlls/d3dim/.cvsignore --- wine-20050830/dlls/d3dim/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/d3dim/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -d3dim.dll.dbg.c libd3dim.def version.res diff -urN wine-20050830/dlls/d3drm/.cvsignore wine-20050930/dlls/d3drm/.cvsignore --- wine-20050830/dlls/d3drm/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/d3drm/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -d3drm.dll.dbg.c libd3drm.def version.res diff -urN wine-20050830/dlls/d3dx8/.cvsignore wine-20050930/dlls/d3dx8/.cvsignore --- wine-20050830/dlls/d3dx8/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/d3dx8/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -d3dx8.dll.dbg.c libd3dx8.def diff -urN wine-20050830/dlls/d3dxof/.cvsignore wine-20050930/dlls/d3dxof/.cvsignore --- wine-20050830/dlls/d3dxof/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/d3dxof/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -d3dxof.dll.dbg.c libd3dxof.def version.res diff -urN wine-20050830/dlls/d3dxof/d3dxof.spec wine-20050930/dlls/d3dxof/d3dxof.spec --- wine-20050830/dlls/d3dxof/d3dxof.spec 2005-08-08 19:35:29.000000000 +0200 +++ wine-20050930/dlls/d3dxof/d3dxof.spec 2005-09-26 18:41:43.000000000 +0200 @@ -1,3 +1,5 @@ @ stdcall DirectXFileCreate(ptr) @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050830/dlls/dbghelp/.cvsignore wine-20050930/dlls/dbghelp/.cvsignore --- wine-20050830/dlls/dbghelp/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/dbghelp/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dbghelp.dll.dbg.c libdbghelp.def diff -urN wine-20050830/dlls/dbghelp/coff.c wine-20050930/dlls/dbghelp/coff.c --- wine-20050830/dlls/dbghelp/coff.c 2005-01-03 15:56:42.000000000 +0100 +++ wine-20050930/dlls/dbghelp/coff.c 2005-09-12 17:14:07.000000000 +0200 @@ -174,10 +174,8 @@ coff = (const IMAGE_COFF_SYMBOLS_HEADER*)msc_dbg->root; - coff_symbols = (const IMAGE_SYMBOL*)((unsigned int)coff + - coff->LvaToFirstSymbol); - coff_linetab = (const IMAGE_LINENUMBER*)((unsigned int)coff + - coff->LvaToFirstLinenumber); + coff_symbols = (const IMAGE_SYMBOL*)((const char *)coff + coff->LvaToFirstSymbol); + coff_linetab = (const IMAGE_LINENUMBER*)((const char *)coff + coff->LvaToFirstLinenumber); coff_strtab = (const char*)(coff_symbols + coff->NumberOfSymbols); linetab_indx = 0; diff -urN wine-20050830/dlls/dbghelp/dbghelp.spec wine-20050930/dlls/dbghelp/dbghelp.spec --- wine-20050830/dlls/dbghelp/dbghelp.spec 2005-07-29 16:42:37.000000000 +0200 +++ wine-20050930/dlls/dbghelp/dbghelp.spec 2005-09-09 17:05:02.000000000 +0200 @@ -26,10 +26,10 @@ @ stub StackWalk64 @ stdcall StackWalk(long long long ptr ptr ptr ptr ptr ptr) @ stdcall SymCleanup(long) -@ stdcall SymEnumSourceFiles(ptr long long str ptr ptr) +@ stdcall SymEnumSourceFiles(ptr double str ptr ptr) @ stub SymEnumSym -@ stdcall SymEnumSymbols(ptr long long str ptr ptr) -@ stdcall SymEnumTypes(ptr long long ptr ptr) +@ stdcall SymEnumSymbols(ptr double str ptr ptr) +@ stdcall SymEnumTypes(ptr double ptr ptr) @ stub SymEnumerateModules64 @ stdcall SymEnumerateModules(long ptr ptr) @ stub SymEnumerateSymbols64 @@ -37,7 +37,7 @@ @ stub SymEnumerateSymbolsW64 @ stub SymEnumerateSymbolsW @ stdcall SymFindFileInPath(long str str ptr long long long ptr ptr ptr) -@ stdcall SymFromAddr(ptr long long ptr ptr) +@ stdcall SymFromAddr(ptr double ptr ptr) @ stdcall SymFromName(long str ptr) @ stub SymFunctionTableAccess64 @ stdcall SymFunctionTableAccess(long long) @@ -66,10 +66,10 @@ @ stdcall SymGetSymNext(long ptr) @ stub SymGetSymPrev64 @ stdcall SymGetSymPrev(long ptr) -@ stdcall SymGetTypeFromName(ptr long long str ptr) -@ stdcall SymGetTypeInfo(ptr long long long long ptr) +@ stdcall SymGetTypeFromName(ptr double str ptr) +@ stdcall SymGetTypeInfo(ptr double long long ptr) @ stdcall SymInitialize(long str long) -@ stdcall SymLoadModule64(long long str str long long long) +@ stdcall SymLoadModule64(long long str str double long) @ stdcall SymLoadModule(long long str str long long) @ stub SymLoadModuleEx @ stdcall SymMatchFileName(str str ptr ptr) diff -urN wine-20050830/dlls/dbghelp/elf_module.c wine-20050930/dlls/dbghelp/elf_module.c --- wine-20050830/dlls/dbghelp/elf_module.c 2005-08-29 11:46:32.000000000 +0200 +++ wine-20050930/dlls/dbghelp/elf_module.c 2005-09-02 16:47:36.000000000 +0200 @@ -882,15 +882,15 @@ else if (debug_sect != -1) { /* Dwarf 2 debug information */ - const char* dw2_debug; - const char* dw2_debug_abbrev; - const char* dw2_debug_str; + const BYTE* dw2_debug; + const BYTE* dw2_debug_abbrev; + const BYTE* dw2_debug_str; FIXME("Alpha-support for Dwarf2 information for %s\n", module->module.ModuleName); - dw2_debug = elf_map_section(fmap, debug_sect); - dw2_debug_abbrev = elf_map_section(fmap, debug_abbrev_sect); - dw2_debug_str = elf_map_section(fmap, debug_str_sect); + dw2_debug = (const BYTE*) elf_map_section(fmap, debug_sect); + dw2_debug_abbrev = (const BYTE*) elf_map_section(fmap, debug_abbrev_sect); + dw2_debug_str = (const BYTE*) elf_map_section(fmap, debug_str_sect); if (dw2_debug != NO_MAP && NO_MAP != dw2_debug_abbrev && dw2_debug_str != NO_MAP) { /* OK, now just parse dwarf2 debug infos. */ diff -urN wine-20050830/dlls/dbghelp/minidump.c wine-20050930/dlls/dbghelp/minidump.c --- wine-20050830/dlls/dbghelp/minidump.c 2005-03-29 15:14:08.000000000 +0200 +++ wine-20050930/dlls/dbghelp/minidump.c 2005-09-13 00:07:53.000000000 +0200 @@ -407,7 +407,7 @@ if (sizeof(ULONG) + ms->Length > sizeof(tmp)) FIXME("Buffer overflow!!!\n"); MultiByteToWideChar(CP_ACP, 0, dc->module[i].name, -1, - ms->Buffer, ms->Length); + ms->Buffer, ms->Length/sizeof(WCHAR)); if (dc->cb) { diff -urN wine-20050830/dlls/dbghelp/msc.c wine-20050930/dlls/dbghelp/msc.c --- wine-20050830/dlls/dbghelp/msc.c 2005-05-18 15:27:24.000000000 +0200 +++ wine-20050930/dlls/dbghelp/msc.c 2005-09-02 16:47:36.000000000 +0200 @@ -76,7 +76,7 @@ static void dump(const void* ptr, unsigned len) { int i, j; - BYTE msg[128]; + char msg[128]; const char* hexof = "0123456789abcdef"; const BYTE* x = (const BYTE*)ptr; @@ -741,11 +741,11 @@ return codeview_add_type(typeno, symt); } -static int codeview_parse_type_table(struct module* module, const char* table, +static int codeview_parse_type_table(struct module* module, const BYTE* table, int len) { unsigned int curr_type = 0x1000; - const char* ptr = table; + const BYTE* ptr = table; int retv; const union codeview_type* type; int value, leaf_len; @@ -846,7 +846,7 @@ * type of the corresponding sort. Later on, the definition of * the 'real' type will copy the member / enumeration data. */ - const char* list = type->fieldlist.list; + const unsigned char* list = type->fieldlist.list; int len = (ptr + type->generic.len + 2) - list; if (((const union codeview_fieldtype*)list)->generic.id == LF_ENUMERATE_V1 || @@ -970,7 +970,7 @@ */ static struct codeview_linetab* codeview_snarf_linetab(struct module* module, - const char* linetab, int size, + const BYTE* linetab, int size, BOOL pascal_str) { int file_segcount; @@ -992,7 +992,7 @@ /* * Now get the important bits. */ - pnt.c = linetab; + pnt.uc = linetab; nfile = *pnt.s++; nseg = *pnt.s++; @@ -1004,7 +1004,7 @@ nseg = 0; for (i = 0; i < nfile; i++) { - pnt2.c = linetab + filetab[i]; + pnt2.uc = linetab + filetab[i]; nseg += *pnt2.s; } @@ -1033,7 +1033,7 @@ /* * Get the pointer into the segment information. */ - pnt2.c = linetab + filetab[i]; + pnt2.uc = linetab + filetab[i]; file_segcount = *pnt2.s; pnt2.ui++; @@ -1055,7 +1055,7 @@ for (k = 0; k < file_segcount; k++, this_seg++) { - pnt2.c = linetab + lt_ptr[k]; + pnt2.uc = linetab + lt_ptr[k]; lt_hdr[this_seg].start = start[k].start; lt_hdr[this_seg].end = start[k].end; lt_hdr[this_seg].compiland = compiland; @@ -1643,7 +1643,7 @@ return pdb_ds_read(pdb, block_list, toc->file_size[file_nr]); } -static void* pdb_read_file(const BYTE* image, const struct pdb_lookup* pdb_lookup, +static void* pdb_read_file(const char* image, const struct pdb_lookup* pdb_lookup, DWORD file_nr) { switch (pdb_lookup->kind) @@ -1795,7 +1795,7 @@ static void pdb_process_types(const struct msc_debug_info* msc_dbg, const char* image, struct pdb_lookup* pdb_lookup) { - char* types_image = NULL; + BYTE* types_image = NULL; types_image = pdb_read_file(image, pdb_lookup, 2); if (types_image) @@ -1995,7 +1995,7 @@ BOOL ret = FALSE; HANDLE hFile, hMap = NULL; char* image = NULL; - char* symbols_image = NULL; + BYTE* symbols_image = NULL; TRACE("Processing PDB file %s\n", pdb_lookup->filename); @@ -2013,8 +2013,8 @@ if (symbols_image) { PDB_SYMBOLS symbols; - char* modimage; - char* file; + BYTE* modimage; + BYTE* file; int header_size = 0; pdb_convert_symbols_header(&symbols, &header_size, symbols_image); @@ -2072,7 +2072,7 @@ } file_name = (const char*)file + size; file_name += strlen(file_name) + 1; - file = (char*)((DWORD)(file_name + strlen(file_name) + 1 + 3) & ~3); + file = (BYTE*)((DWORD)(file_name + strlen(file_name) + 1 + 3) & ~3); } } else diff -urN wine-20050830/dlls/dbghelp/mscvpdb.h wine-20050930/dlls/dbghelp/mscvpdb.h --- wine-20050830/dlls/dbghelp/mscvpdb.h 2004-12-20 20:27:07.000000000 +0100 +++ wine-20050930/dlls/dbghelp/mscvpdb.h 2005-09-02 16:47:36.000000000 +0200 @@ -1185,6 +1185,7 @@ union any_size { const char* c; + const unsigned char* uc; const short* s; const int* i; const unsigned int* ui; diff -urN wine-20050830/dlls/dbghelp/pe_module.c wine-20050930/dlls/dbghelp/pe_module.c --- wine-20050830/dlls/dbghelp/pe_module.c 2005-03-29 15:14:08.000000000 +0200 +++ wine-20050930/dlls/dbghelp/pe_module.c 2005-09-02 16:47:36.000000000 +0200 @@ -52,12 +52,12 @@ ((char*)&nth->OptionalHeader + nth->FileHeader.SizeOfOptionalHeader); for (i = 0; i < nth->FileHeader.NumberOfSections; i++, section++) { - if (!strcasecmp(section->Name, ".stab")) + if (!strcasecmp((const char*)section->Name, ".stab")) { stabs = section->VirtualAddress; stabsize = section->SizeOfRawData; } - else if (!strncasecmp(section->Name, ".stabstr", 8)) + else if (!strncasecmp((const char*)section->Name, ".stabstr", 8)) { stabstr = section->VirtualAddress; stabstrsize = section->SizeOfRawData; @@ -183,7 +183,7 @@ } else { - ret = pe_load_dbg_file(pcs, module, misc->Data, nth->FileHeader.TimeDateStamp); + ret = pe_load_dbg_file(pcs, module, (const char*)misc->Data, nth->FileHeader.TimeDateStamp); } } else diff -urN wine-20050830/dlls/dciman32/.cvsignore wine-20050930/dlls/dciman32/.cvsignore --- wine-20050830/dlls/dciman32/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/dciman32/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dciman32.dll.dbg.c libdciman32.def diff -urN wine-20050830/dlls/ddraw/.cvsignore wine-20050930/dlls/ddraw/.cvsignore --- wine-20050830/dlls/ddraw/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/ddraw/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -ddraw.dll.dbg.c libddraw.def version.res diff -urN wine-20050830/dlls/ddraw/clipper.c wine-20050930/dlls/ddraw/clipper.c --- wine-20050830/dlls/ddraw/clipper.c 2005-07-26 22:10:51.000000000 +0200 +++ wine-20050930/dlls/ddraw/clipper.c 2005-09-27 11:34:24.000000000 +0200 @@ -157,6 +157,13 @@ HRGN hRgn = CreateRectRgn(0,0,0,0); if (GetRandomRgn(hDC, hRgn, SYSRGN)) { + if (GetVersion() & 0x80000000) + { + /* map region to screen coordinates */ + POINT org; + GetDCOrgEx( hDC, &org ); + OffsetRgn( hRgn, org.x, org.y ); + } if (lpRect) { HRGN hRgnClip = CreateRectRgn(lpRect->left, lpRect->top, diff -urN wine-20050830/dlls/ddraw/d3d_private.h wine-20050930/dlls/ddraw/d3d_private.h --- wine-20050830/dlls/ddraw/d3d_private.h 2005-07-11 15:21:17.000000000 +0200 +++ wine-20050930/dlls/ddraw/d3d_private.h 2005-09-25 17:18:18.000000000 +0200 @@ -1,6 +1,8 @@ -/* Direct3D private include file - * Copyright (c) 1998-2004 Lionel ULMER - * Copyright (c) 2002-2004 Christian Costa +/* + * Direct3D private include file + * + * Copyright (c) 1998-2004 Lionel Ulmer + * Copyright (c) 2002-2005 Christian Costa * * This file contains all the structure that are not exported * through d3d.h and all common macros. @@ -230,7 +232,7 @@ LPD3DLIGHT7 light_parameters; DWORD *active_lights; - /* clipping planes */ + /* Clipping planes */ DWORD max_clipping_planes; d3d7clippingplane *clipping_planes; @@ -251,6 +253,15 @@ /* Used to prevent locks and rendering to overlap */ CRITICAL_SECTION crit; + + /* Rendering functions */ + D3DPRIMITIVETYPE primitive_type; + DWORD vertex_type; + DWORD render_flags; + DWORD nb_vertices; + LPBYTE vertex_buffer; + DWORD vertex_size; + DWORD buffer_size; }; /***************************************************************************** diff -urN wine-20050830/dlls/ddraw/ddraw_main.c wine-20050930/dlls/ddraw/ddraw_main.c --- wine-20050830/dlls/ddraw/ddraw_main.c 2005-07-26 22:10:51.000000000 +0200 +++ wine-20050930/dlls/ddraw/ddraw_main.c 2005-09-12 16:12:47.000000000 +0200 @@ -1049,7 +1049,7 @@ LPDIRECTDRAWSURFACE7 *lpDDS) { IDirectDrawImpl *This = (IDirectDrawImpl *)iface; - FIXME("(%p)->(%08ld,%p)\n", This, (DWORD) hdc, lpDDS); + FIXME("(%p)->(%p,%p)\n", This, hdc, lpDDS); return DD_OK; } @@ -1104,7 +1104,7 @@ { IDirectDrawImpl *This = (IDirectDrawImpl *)iface; - FIXME("(%p)->(%08lx,%08lx)\n",This,(DWORD)hwnd,cooplevel); + FIXME("(%p)->(%p,%08lx)\n",This,hwnd,cooplevel); DDRAW_dump_cooperativelevel(cooplevel); /* Makes realMYST test happy. */ diff -urN wine-20050830/dlls/ddraw/device_main.c wine-20050930/dlls/ddraw/device_main.c --- wine-20050830/dlls/ddraw/device_main.c 2005-06-07 23:34:40.000000000 +0200 +++ wine-20050930/dlls/ddraw/device_main.c 2005-09-25 17:18:18.000000000 +0200 @@ -1,6 +1,8 @@ -/* Direct3D Device - * Copyright (c) 1998-2004 Lionel ULMER - * Copyright (c) 2002-2004 Christian Costa +/* + * Direct3D Device + * + * Copyright (c) 1998-2004 Lionel Ulmer + * Copyright (c) 2002-2005 Christian Costa * * This file contains all the common stuff for D3D devices. * @@ -284,7 +286,7 @@ if (This->current_texture[i] != NULL) IDirect3DTexture2_Release(ICOM_INTERFACE(This->current_texture[i], IDirect3DTexture2)); } - + HeapFree(GetProcessHeap(), 0, This->vertex_buffer); HeapFree(GetProcessHeap(), 0, This); return 0; } @@ -1175,8 +1177,15 @@ DWORD dwFlags) { ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface); - FIXME("(%p/%p)->(%08x,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, dwVertexTypeDesc, dwFlags); - return DD_OK; + TRACE("(%p/%p)->(%08x,%08lx,%08lx)\n", This, iface, d3dptPrimitiveType, dwVertexTypeDesc, dwFlags); + + This->primitive_type = d3dptPrimitiveType; + This->vertex_type = dwVertexTypeDesc; + This->render_flags = dwFlags; + This->vertex_size = get_flexible_vertex_size(This->vertex_type); + This->nb_vertices = 0; + + return D3D_OK; } HRESULT WINAPI @@ -1197,8 +1206,24 @@ LPVOID lpVertexType) { ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface); - FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpVertexType); - return DD_OK; + TRACE("(%p/%p)->(%p)\n", This, iface, lpVertexType); + + if ((This->nb_vertices+1)*This->vertex_size > This->buffer_size) + { + LPBYTE old_buffer; + This->buffer_size = This->buffer_size ? This->buffer_size * 2 : This->vertex_size * 3; + old_buffer = This->vertex_buffer; + This->vertex_buffer = HeapAlloc(GetProcessHeap(), 0, This->buffer_size); + if (old_buffer) + { + CopyMemory(This->vertex_buffer, old_buffer, This->nb_vertices * This->vertex_size); + HeapFree(GetProcessHeap(), 0, old_buffer); + } + } + + CopyMemory(This->vertex_buffer + This->nb_vertices++ * This->vertex_size, lpVertexType, This->vertex_size); + + return D3D_OK; } HRESULT WINAPI @@ -1215,8 +1240,11 @@ DWORD dwFlags) { ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface); - FIXME("(%p/%p)->(%08lx): stub!\n", This, iface, dwFlags); - return DD_OK; + TRACE("(%p/%p)->(%08lx)\n", This, iface, dwFlags); + + IDirect3DDevice3_DrawPrimitive(iface, This->primitive_type, This->vertex_type, This->vertex_buffer, This->nb_vertices, This->render_flags); + + return D3D_OK; } HRESULT WINAPI diff -urN wine-20050830/dlls/ddraw/device_opengl.c wine-20050930/dlls/ddraw/device_opengl.c --- wine-20050830/dlls/ddraw/device_opengl.c 2005-08-22 20:58:27.000000000 +0200 +++ wine-20050930/dlls/ddraw/device_opengl.c 2005-09-25 17:18:18.000000000 +0200 @@ -1,6 +1,8 @@ -/* Direct3D Device - * Copyright (c) 1998-2004 Lionel ULMER - * Copyright (c) 2002-2004 Christian Costa +/* + * Direct3D Device + * + * Copyright (c) 1998-2004 Lionel Ulmer + * Copyright (c) 2002-2005 Christian Costa * * This file contains the MESA implementation of all the D3D devices that * Wine supports. @@ -427,16 +429,14 @@ This->d3d->d3d_removed_device(This->d3d, This); /* Free light arrays */ - if (This->light_parameters) - HeapFree(GetProcessHeap(), 0, This->light_parameters); + HeapFree(GetProcessHeap(), 0, This->light_parameters); HeapFree(GetProcessHeap(), 0, This->active_lights); HeapFree(GetProcessHeap(), 0, This->world_mat); HeapFree(GetProcessHeap(), 0, This->view_mat); HeapFree(GetProcessHeap(), 0, This->proj_mat); - if (glThis->surface_ptr) - HeapFree(GetProcessHeap(), 0, glThis->surface_ptr); + HeapFree(GetProcessHeap(), 0, glThis->surface_ptr); DeleteCriticalSection(&(This->crit)); @@ -446,6 +446,7 @@ glXDestroyContext(glThis->display, glThis->gl_context); LEAVE_GL(); HeapFree(GetProcessHeap(), 0, This->clipping_planes); + HeapFree(GetProcessHeap(), 0, This->vertex_buffer); HeapFree(GetProcessHeap(), 0, This); return 0; diff -urN wine-20050830/dlls/ddraw/surface_main.c wine-20050930/dlls/ddraw/surface_main.c --- wine-20050830/dlls/ddraw/surface_main.c 2005-08-03 23:25:11.000000000 +0200 +++ wine-20050930/dlls/ddraw/surface_main.c 2005-09-12 16:12:47.000000000 +0200 @@ -1085,7 +1085,7 @@ IDirectDrawSurfaceImpl *This = (IDirectDrawSurfaceImpl *)iface; if (TRACE_ON(ddraw)) { - TRACE("(%p)->Lock(%p,%p,%08lx,%08lx)\n",This,prect,pDDSD,flags,(DWORD)h); + TRACE("(%p)->Lock(%p,%p,%08lx,%p)\n",This,prect,pDDSD,flags,h); TRACE(" - locking flags : "); DDRAW_dump_lockflag(flags); } if (WARN_ON(ddraw)) { diff -urN wine-20050830/dlls/ddraw/surface_wndproc.c wine-20050930/dlls/ddraw/surface_wndproc.c --- wine-20050830/dlls/ddraw/surface_wndproc.c 2005-06-05 19:50:49.000000000 +0200 +++ wine-20050930/dlls/ddraw/surface_wndproc.c 2005-09-12 17:38:56.000000000 +0200 @@ -54,7 +54,7 @@ IDirectDrawSurfaceImpl *This; LRESULT ret; - This = (IDirectDrawSurfaceImpl *)GetWindowLongA(hwnd, 0); + This = (IDirectDrawSurfaceImpl *)GetWindowLongPtrA(hwnd, 0); if (This) { HWND window = This->ddraw_owner->window; @@ -96,7 +96,7 @@ if (msg == WM_CREATE) { CREATESTRUCTA *cs = (CREATESTRUCTA *)lParam; This = (IDirectDrawSurfaceImpl *)cs->lpCreateParams; - SetWindowLongA(hwnd, 0, (LONG)This); + SetWindowLongPtrA(hwnd, 0, (LONG_PTR)This); } ret = DefWindowProcA(hwnd, msg, wParam, lParam); } diff -urN wine-20050830/dlls/devenum/.cvsignore wine-20050930/dlls/devenum/.cvsignore --- wine-20050830/dlls/devenum/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/devenum/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -devenum.dll.dbg.c devenum.res diff -urN wine-20050830/dlls/dinput/.cvsignore wine-20050930/dlls/dinput/.cvsignore --- wine-20050830/dlls/dinput/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/dinput/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -dinput.dll.dbg.c libdinput.def version.res diff -urN wine-20050830/dlls/dinput/Makefile.in wine-20050930/dlls/dinput/Makefile.in --- wine-20050830/dlls/dinput/Makefile.in 2005-05-11 14:05:17.000000000 +0200 +++ wine-20050930/dlls/dinput/Makefile.in 2005-09-02 17:18:47.000000000 +0200 @@ -11,6 +11,7 @@ data_formats.c \ device.c \ dinput_main.c \ + effect_linuxinput.c \ joystick_linux.c \ joystick_linuxinput.c \ keyboard.c \ diff -urN wine-20050830/dlls/dinput/device.c wine-20050930/dlls/dinput/device.c --- wine-20050830/dlls/dinput/device.c 2005-05-16 16:07:36.000000000 +0200 +++ wine-20050930/dlls/dinput/device.c 2005-09-12 12:30:06.000000000 +0200 @@ -464,7 +464,7 @@ LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags ) { IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface; - TRACE("(this=%p,0x%08lx,0x%08lx)\n",This,(DWORD)hwnd,dwflags); + TRACE("(this=%p,%p,0x%08lx)\n",This,hwnd,dwflags); if (TRACE_ON(dinput)) { TRACE(" cooperative level : "); _dump_cooperativelevel_DI(dwflags); @@ -476,7 +476,7 @@ LPDIRECTINPUTDEVICE8A iface,HANDLE hnd ) { IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface; - FIXME("(this=%p,0x%08lx): stub\n",This,(DWORD)hnd); + FIXME("(this=%p,%p): stub\n",This,hnd); return DI_OK; } diff -urN wine-20050830/dlls/dinput/dinput_main.c wine-20050930/dlls/dinput/dinput_main.c --- wine-20050830/dlls/dinput/dinput_main.c 2005-08-08 19:35:29.000000000 +0200 +++ wine-20050930/dlls/dinput/dinput_main.c 2005-09-12 12:30:06.000000000 +0200 @@ -86,7 +86,7 @@ { IDirectInputImpl* This; - TRACE("(0x%08lx,%04lx,%s,%p,%p)\n", (DWORD)hinst,dwVersion,debugstr_guid(riid),ppDI,punkOuter); + TRACE("(%p,%04lx,%s,%p,%p)\n", hinst,dwVersion,debugstr_guid(riid),ppDI,punkOuter); if (IsEqualGUID(&IID_IDirectInputA,riid) || IsEqualGUID(&IID_IDirectInput2A,riid) || @@ -141,7 +141,7 @@ HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter) { IDirectInputImpl* This; - TRACE("(0x%08lx,%04lx,%p,%p)\n", (DWORD)hinst,dwVersion,ppDI,punkOuter); + TRACE("(%p,%04lx,%p,%p)\n", hinst,dwVersion,ppDI,punkOuter); This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl)); This->lpVtbl = &ddi7avt; This->ref = 1; @@ -157,7 +157,7 @@ HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter) { IDirectInputImpl* This; - TRACE("(0x%08lx,%04lx,%p,%p)\n", (DWORD)hinst,dwVersion,ppDI,punkOuter); + TRACE("(%p,%04lx,%p,%p)\n", hinst,dwVersion,ppDI,punkOuter); This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl)); This->lpVtbl = &ddi7wvt; This->ref = 1; @@ -384,7 +384,7 @@ HWND hwndOwner, DWORD dwFlags) { IDirectInputImpl *This = (IDirectInputImpl *)iface; - FIXME("(%p)->(%08lx,%08lx): stub\n",This, (DWORD) hwndOwner, dwFlags); + FIXME("(%p)->(%p,%08lx): stub\n",This, hwndOwner, dwFlags); return DI_OK; } diff -urN wine-20050830/dlls/dinput/effect_linuxinput.c wine-20050930/dlls/dinput/effect_linuxinput.c --- wine-20050830/dlls/dinput/effect_linuxinput.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/dinput/effect_linuxinput.c 2005-09-13 00:07:53.000000000 +0200 @@ -0,0 +1,927 @@ +/* DirectInput Linux Event Device Effect + * + * Copyright 2005 Daniel Remenak + * + * Thanks to Google's Summer of Code Program (2005) + * + * 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 "config.h" + +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + +#include +#include +#ifdef HAVE_LINUX_INPUT_H +# include +#endif +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#include +#include "wine/debug.h" +#include "wine/unicode.h" +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "dinput.h" + +#include "device_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dinput); + +static const IDirectInputEffectVtbl LinuxInputEffectVtbl; +typedef struct LinuxInputEffectImpl LinuxInputEffectImpl; +struct LinuxInputEffectImpl +{ + const void *lpVtbl; + LONG ref; + GUID guid; + + /* Effect data */ + struct ff_effect effect; + + /* Parent device */ + int* fd; +}; + + +/****************************************************************************** + * DirectInputEffect Functional Helper + */ + +static DWORD _typeFromGUID(REFGUID guid) +{ + if (IsEqualGUID(guid, &GUID_ConstantForce)) { + return DIEFT_CONSTANTFORCE; + } else if (IsEqualGUID(guid, &GUID_Square) + || IsEqualGUID(guid, &GUID_Sine) + || IsEqualGUID(guid, &GUID_Triangle) + || IsEqualGUID(guid, &GUID_SawtoothUp) + || IsEqualGUID(guid, &GUID_SawtoothDown)) { + return DIEFT_PERIODIC; + } else if (IsEqualGUID(guid, &GUID_RampForce)) { + return DIEFT_RAMPFORCE; + } else if (IsEqualGUID(guid, &GUID_Spring) + || IsEqualGUID(guid, &GUID_Damper) + || IsEqualGUID(guid, &GUID_Inertia) + || IsEqualGUID(guid, &GUID_Friction)) { + return DIEFT_CONDITION; + } else if (IsEqualGUID(guid, &GUID_CustomForce)) { + return DIEFT_CUSTOMFORCE; + } else { + WARN("GUID (%s) is not a known force type\n", _dump_dinput_GUID(guid)); + return 0; + } +} + + +/****************************************************************************** + * DirectInputEffect debug helpers + */ + +static void _dump_DIEFFECT_flags(DWORD dwFlags) +{ + if (TRACE_ON(dinput)) { + unsigned int i; + static const struct { + DWORD mask; + const char *name; + } flags[] = { +#define FE(x) { x, #x} + FE(DIEFF_CARTESIAN), + FE(DIEFF_OBJECTIDS), + FE(DIEFF_OBJECTOFFSETS), + FE(DIEFF_POLAR), + FE(DIEFF_SPHERICAL) +#undef FE + }; + for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++) + if (flags[i].mask & dwFlags) + DPRINTF("%s ", flags[i].name); + DPRINTF("\n"); + } +} + +static void _dump_DIENVELOPE(LPDIENVELOPE env) +{ + if (env->dwSize != sizeof(DIENVELOPE)) { + WARN("Non-standard DIENVELOPE structure size (%ld instead of %d).\n", + env->dwSize, sizeof(DIENVELOPE)); + } + TRACE("Envelope has attack (level: %ld time: %ld), fade (level: %ld time: %ld)\n", + env->dwAttackLevel, env->dwAttackTime, env->dwFadeLevel, env->dwFadeTime); +} + +static void _dump_DICONSTANTFORCE(LPDICONSTANTFORCE frc) +{ + TRACE("Constant force has magnitude %ld\n", frc->lMagnitude); +} + +static void _dump_DIPERIODIC(LPDIPERIODIC frc) +{ + TRACE("Periodic force has magnitude %ld, offset %ld, phase %ld, period %ld\n", + frc->dwMagnitude, frc->lOffset, frc->dwPhase, frc->dwPeriod); +} + +static void _dump_DIRAMPFORCE(LPDIRAMPFORCE frc) +{ + TRACE("Ramp force has start %ld, end %ld\n", + frc->lStart, frc->lEnd); +} + +static void _dump_DICONDITION(LPDICONDITION frc) +{ + TRACE("Condition has offset %ld, pos/neg coefficients %ld and %ld, pos/neg saturations %ld and %ld, deadband %ld\n", + frc->lOffset, frc->lPositiveCoefficient, frc->lNegativeCoefficient, + frc->dwPositiveSaturation, frc->dwNegativeSaturation, frc->lDeadBand); +} + +static void _dump_DICUSTOMFORCE(LPDICUSTOMFORCE frc) +{ + unsigned int i; + TRACE("Custom force uses %ld channels, sample period %ld. Has %ld samples at %p.\n", + frc->cChannels, frc->dwSamplePeriod, frc->cSamples, frc->rglForceData); + if (frc->cSamples % frc->cChannels != 0) + WARN("Custom force has a non-integral samples-per-channel count!\n"); + if (TRACE_ON(dinput)) { + DPRINTF("Custom force data (time aligned, axes in order):\n"); + for (i = 1; i <= frc->cSamples; ++i) { + DPRINTF("%ld ", frc->rglForceData[i]); + if (i % frc->cChannels == 0) + DPRINTF("\n"); + } + } +} + +static void _dump_DIEFFECT(LPCDIEFFECT eff, REFGUID guid) +{ + unsigned int i; + DWORD type = _typeFromGUID(guid); + + TRACE("Dumping DIEFFECT structure:\n"); + TRACE(" - dwSize: %ld\n", eff->dwSize); + if ((eff->dwSize != sizeof(DIEFFECT)) && (eff->dwSize != sizeof(DIEFFECT_DX5))) { + WARN("Non-standard DIEFFECT structure size (%ld instead of %d or %d).\n", + eff->dwSize, sizeof(DIEFFECT), sizeof(DIEFFECT_DX5)); + } + TRACE(" - dwFlags: %ld\n", eff->dwFlags); + TRACE(" "); + _dump_DIEFFECT_flags(eff->dwFlags); + TRACE(" - dwDuration: %ld\n", eff->dwDuration); + TRACE(" - dwGain: %ld\n", eff->dwGain); + if ((eff->dwGain > 10000) || (eff->dwGain < 0)) + WARN("dwGain is out of range (0 - 10,000)\n"); + TRACE(" - dwTriggerButton: %ld\n", eff->dwTriggerButton); + TRACE(" - dwTriggerRepeatInterval: %ld\n", eff->dwTriggerRepeatInterval); + TRACE(" - cAxes: %ld\n", eff->cAxes); + TRACE(" - rgdwAxes: %p\n", eff->rgdwAxes); + if (TRACE_ON(dinput)) { + TRACE(" "); + for (i = 0; i < eff->cAxes; ++i) + DPRINTF("%ld ", eff->rgdwAxes[i]); + DPRINTF("\n"); + } + TRACE(" - rglDirection: %p\n", eff->rglDirection); + TRACE(" - lpEnvelope: %p\n", eff->lpEnvelope); + TRACE(" - cbTypeSpecificParams: %ld\n", eff->cbTypeSpecificParams); + TRACE(" - lpvTypeSpecificParams: %p\n", eff->lpvTypeSpecificParams); + if (eff->dwSize > sizeof(DIEFFECT_DX5)) + TRACE(" - dwStartDelay: %ld\n", eff->dwStartDelay); + if (eff->lpEnvelope != NULL) + _dump_DIENVELOPE(eff->lpEnvelope); + if (type == DIEFT_CONSTANTFORCE) { + if (eff->cbTypeSpecificParams != sizeof(DICONSTANTFORCE)) { + WARN("Effect claims to be a constant force but the type-specific params are the wrong size!\n"); + } else { + _dump_DICONSTANTFORCE(eff->lpvTypeSpecificParams); + } + } else if (type == DIEFT_PERIODIC) { + if (eff->cbTypeSpecificParams != sizeof(DIPERIODIC)) { + WARN("Effect claims to be a periodic force but the type-specific params are the wrong size!\n"); + } else { + _dump_DIPERIODIC(eff->lpvTypeSpecificParams); + } + } else if (type == DIEFT_RAMPFORCE) { + if (eff->cbTypeSpecificParams != sizeof(DIRAMPFORCE)) { + WARN("Effect claims to be a ramp force but the type-specific params are the wrong size!\n"); + } else { + _dump_DIRAMPFORCE(eff->lpvTypeSpecificParams); + } + } else if (type == DIEFT_CONDITION) { + if (eff->cbTypeSpecificParams != sizeof(DICONDITION)) { + WARN("Effect claims to be a condition but the type-specific params are the wrong size!\n"); + } else { + _dump_DICONDITION(eff->lpvTypeSpecificParams); + } + } else if (type == DIEFT_CUSTOMFORCE) { + if (eff->cbTypeSpecificParams != sizeof(DICUSTOMFORCE)) { + WARN("Effect claims to be a custom force but the type-specific params are the wrong size!\n"); + } else { + _dump_DICUSTOMFORCE(eff->lpvTypeSpecificParams); + } + } +} + + +/****************************************************************************** + * LinuxInputEffectImpl + */ + +static ULONG WINAPI LinuxInputEffectImpl_AddRef( + LPDIRECTINPUTEFFECT iface) +{ + LinuxInputEffectImpl *This = (LinuxInputEffectImpl *)iface; + return InterlockedIncrement(&(This->ref)); +} + +static HRESULT WINAPI LinuxInputEffectImpl_Download( + LPDIRECTINPUTEFFECT iface) +{ + LinuxInputEffectImpl *This = (LinuxInputEffectImpl *)iface; + + TRACE("(this=%p)\n", This); + + if (ioctl(*(This->fd), EVIOCSFF, &This->effect) == -1) { + if (errno == ENOMEM) { + return DIERR_DEVICEFULL; + } else { + FIXME("Could not upload effect. Assuming a disconnected device.\n"); + return DIERR_INPUTLOST; + } + } + + return DI_OK; +} + +static HRESULT WINAPI LinuxInputEffectImpl_Escape( + LPDIRECTINPUTEFFECT iface, + LPDIEFFESCAPE pesc) +{ + WARN("(this=%p,%p): invalid: no hardware-specific escape codes in this" + " driver!\n", iface, pesc); + + return DI_OK; +} + +static HRESULT WINAPI LinuxInputEffectImpl_GetEffectGuid( + LPDIRECTINPUTEFFECT iface, + LPGUID pguid) +{ + LinuxInputEffectImpl *This = (LinuxInputEffectImpl*)iface; + + TRACE("(this=%p,%p)\n", This, pguid); + + pguid = &This->guid; + + return DI_OK; +} + +static HRESULT WINAPI LinuxInputEffectImpl_GetEffectStatus( + LPDIRECTINPUTEFFECT iface, + LPDWORD pdwFlags) +{ + TRACE("(this=%p,%p)\n", iface, pdwFlags); + + /* linux sends the effect status through an event. + * that event is trapped by our parent joystick driver + * and there is no clean way to pass it back to us. */ + FIXME("Not enough information to provide a status.\n"); + + (*pdwFlags) = 0; + + return DI_OK; +} + +static HRESULT WINAPI LinuxInputEffectImpl_GetParameters( + LPDIRECTINPUTEFFECT iface, + LPDIEFFECT peff, + DWORD dwFlags) +{ + HRESULT diErr = DI_OK; + LinuxInputEffectImpl *This = (LinuxInputEffectImpl *)iface; + TRACE("(this=%p,%p,%ld)\n", This, peff, dwFlags); + + /* Major conversion factors are: + * times: millisecond (linux) -> microsecond (windows) (x * 1000) + * forces: scale 0x7FFF (linux) -> scale 10000 (windows) approx ((x / 33) * 10) + * angles: scale 0x7FFF (linux) -> scale 35999 (windows) approx ((x / 33) * 36) + * angle bases: 0 -> -y (down) (linux) -> 0 -> +x (right) (windows) + */ + + if (dwFlags & DIEP_AXES) { + if (peff->cAxes < 2 /* linuxinput effects always use 2 axes, x and y */) + diErr = DIERR_MOREDATA; + peff->cAxes = 2; + if (diErr) + return diErr; + else { + peff->rgdwAxes[0] = DIJOFS_X; + peff->rgdwAxes[1] = DIJOFS_Y; + } + } + + if (dwFlags & DIEP_DIRECTION) { + if (peff->cAxes < 2) + diErr = DIERR_MOREDATA; + peff->cAxes = 2; + if (diErr) + return diErr; + else { + if (peff->dwFlags & DIEFF_CARTESIAN) { + peff->rglDirection[0] = (long)(sin(M_PI * 3 * This->effect.direction / 0x7FFF) * 1000); + peff->rglDirection[1] = (long)(cos(M_PI * 3 * This->effect.direction / 0x7FFF) * 1000); + } else { + /* Polar and spherical coordinates are the same for two or less + * axes. + * Note that we also use this case if NO flags are marked. + * According to MSDN, we should return the direction in the + * format that it was specified in, if no flags are marked. + */ + peff->rglDirection[0] = (This->effect.direction / 33) * 36 + 9000; + if (peff->rglDirection[0] > 35999) + peff->rglDirection[0] -= 35999; + } + } + } + + if (dwFlags & DIEP_DURATION) { + peff->dwDuration = (DWORD)This->effect.replay.length * 1000; + } + + if (dwFlags & DIEP_ENVELOPE) { + struct ff_envelope* env; + if (This->effect.type == FF_CONSTANT) env = &This->effect.u.constant.envelope; + else if (This->effect.type == FF_PERIODIC) env = &This->effect.u.periodic.envelope; + else if (This->effect.type == FF_RAMP) env = &This->effect.u.ramp.envelope; + else env = NULL; + if (env == NULL) { + peff->lpEnvelope = NULL; + } else if (peff->lpEnvelope == NULL) { + return DIERR_INVALIDPARAM; + } else { + peff->lpEnvelope->dwAttackLevel = (env->attack_level / 33) * 10; + peff->lpEnvelope->dwAttackTime = env->attack_length * 1000; + peff->lpEnvelope->dwFadeLevel = (env->fade_level / 33) * 10; + peff->lpEnvelope->dwFadeTime = env->fade_length * 1000; + } + } + + if (dwFlags & DIEP_GAIN) { + /* the linux input ff driver apparently has no support + * for setting the device's gain. */ + peff->dwGain = DI_FFNOMINALMAX; + } + + if (dwFlags & DIEP_SAMPLEPERIOD) { + /* the linux input ff driver has no support for setting + * the playback sample period. 0 means default. */ + peff->dwSamplePeriod = 0; + } + + if (dwFlags & DIEP_STARTDELAY) { + peff->dwStartDelay = This->effect.replay.delay * 1000; + } + + if (dwFlags & DIEP_TRIGGERBUTTON) { + FIXME("LinuxInput button mapping needs redoing; for now, assuming we're using an actual joystick.\n"); + peff->dwTriggerButton = DIJOFS_BUTTON(This->effect.trigger.button - BTN_JOYSTICK); + } + + if (dwFlags & DIEP_TRIGGERREPEATINTERVAL) { + peff->dwTriggerRepeatInterval = This->effect.trigger.interval * 1000; + } + + if (dwFlags & DIEP_TYPESPECIFICPARAMS) { + int expectedsize = 0; + if (This->effect.type == FF_PERIODIC) { + expectedsize = sizeof(DIPERIODIC); + } else if (This->effect.type == FF_CONSTANT) { + expectedsize = sizeof(DICONSTANTFORCE); + } else if (This->effect.type == FF_SPRING + || This->effect.type == FF_FRICTION + || This->effect.type == FF_INERTIA + || This->effect.type == FF_DAMPER) { + expectedsize = sizeof(DICONDITION) * 2; + } else if (This->effect.type == FF_RAMP) { + expectedsize = sizeof(DIRAMPFORCE); + } + if (expectedsize > peff->cbTypeSpecificParams) + diErr = DIERR_MOREDATA; + peff->cbTypeSpecificParams = expectedsize; + if (diErr) + return diErr; + else { + if (This->effect.type == FF_PERIODIC) { + LPDIPERIODIC tsp = (LPDIPERIODIC)(peff->lpvTypeSpecificParams); + tsp->dwMagnitude = (This->effect.u.periodic.magnitude / 33) * 10; + tsp->lOffset = (This->effect.u.periodic.offset / 33) * 10; + tsp->dwPhase = (This->effect.u.periodic.phase / 33) * 36; + tsp->dwPeriod = (This->effect.u.periodic.period * 1000); + } else if (This->effect.type == FF_CONSTANT) { + LPDICONSTANTFORCE tsp = (LPDICONSTANTFORCE)(peff->lpvTypeSpecificParams); + tsp->lMagnitude = (This->effect.u.constant.level / 33) * 10; + } else if (This->effect.type == FF_SPRING + || This->effect.type == FF_FRICTION + || This->effect.type == FF_INERTIA + || This->effect.type == FF_DAMPER) { + LPDICONDITION tsp = (LPDICONDITION)(peff->lpvTypeSpecificParams); + int i; + for (i = 0; i < 2; ++i) { + tsp[i].lOffset = (This->effect.u.condition[i].center / 33) * 10; + tsp[i].lPositiveCoefficient = (This->effect.u.condition[i].right_coeff / 33) * 10; + tsp[i].lNegativeCoefficient = (This->effect.u.condition[i].left_coeff / 33) * 10; + tsp[i].dwPositiveSaturation = (This->effect.u.condition[i].right_saturation / 33) * 10; + tsp[i].dwNegativeSaturation = (This->effect.u.condition[i].left_saturation / 33) * 10; + tsp[i].lDeadBand = (This->effect.u.condition[i].deadband / 33) * 10; + } + } else if (This->effect.type == FF_RAMP) { + LPDIRAMPFORCE tsp = (LPDIRAMPFORCE)(peff->lpvTypeSpecificParams); + tsp->lStart = (This->effect.u.ramp.start_level / 33) * 10; + tsp->lEnd = (This->effect.u.ramp.end_level / 33) * 10; + } + } + } + + return diErr; +} + +static HRESULT WINAPI LinuxInputEffectImpl_Initialize( + LPDIRECTINPUTEFFECT iface, + HINSTANCE hinst, + DWORD dwVersion, + REFGUID rguid) +{ + FIXME("(this=%p,%p,%ld,%s): stub!\n", + iface, hinst, dwVersion, debugstr_guid(rguid)); + + return DI_OK; +} + +static HRESULT WINAPI LinuxInputEffectImpl_QueryInterface( + LPDIRECTINPUTEFFECT iface, + REFIID riid, + void **ppvObject) +{ + LinuxInputEffectImpl* This = (LinuxInputEffectImpl*)iface; + + TRACE("(this=%p,%s,%p)\n", This, debugstr_guid(riid), ppvObject); + + if (IsEqualGUID(&IID_IUnknown, riid) || + IsEqualGUID(&IID_IDirectInputEffect, riid)) { + LinuxInputEffectImpl_AddRef(iface); + *ppvObject = This; + return 0; + } + + TRACE("Unsupported interface!\n"); + return E_FAIL; +} + +static HRESULT WINAPI LinuxInputEffectImpl_Start( + LPDIRECTINPUTEFFECT iface, + DWORD dwIterations, + DWORD dwFlags) +{ + struct input_event event; + LinuxInputEffectImpl* This = (LinuxInputEffectImpl*)iface; + + TRACE("(this=%p,%ld,%ld)\n", This, dwIterations, dwFlags); + + if (!(dwFlags & DIES_NODOWNLOAD)) { + /* Download the effect if necessary */ + if (This->effect.id == -1) { + HRESULT res = LinuxInputEffectImpl_Download(iface); + if (res != DI_OK) + return res; + } + } + + if (dwFlags & DIES_SOLO) { + FIXME("Solo mode requested: should be stopping all effects here!\n"); + } + + event.type = EV_FF; + event.code = This->effect.id; + event.value = dwIterations; + if (write(*(This->fd), &event, sizeof(event)) == -1) { + FIXME("Unable to write event. Assuming device disconnected.\n"); + return DIERR_INPUTLOST; + } + + return DI_OK; +} + +static HRESULT WINAPI LinuxInputEffectImpl_SetParameters( + LPDIRECTINPUTEFFECT iface, + LPCDIEFFECT peff, + DWORD dwFlags) +{ + LinuxInputEffectImpl* This = (LinuxInputEffectImpl*)iface; + DWORD type = _typeFromGUID(&This->guid); + HRESULT retval = DI_OK; + + TRACE("(this=%p,%p,%ld)\n", This, peff, dwFlags); + + _dump_DIEFFECT(peff, &This->guid); + + if ((dwFlags & !DIEP_NORESTART & !DIEP_NODOWNLOAD & !DIEP_START) == 0) { + /* set everything */ + dwFlags = DIEP_AXES | DIEP_DIRECTION | DIEP_DURATION | DIEP_ENVELOPE | + DIEP_GAIN | DIEP_SAMPLEPERIOD | DIEP_STARTDELAY | DIEP_TRIGGERBUTTON | + DIEP_TRIGGERREPEATINTERVAL | DIEP_TYPESPECIFICPARAMS; + } + + if (dwFlags & DIEP_AXES) { + /* the linux input effect system only supports one or two axes */ + if (peff->cAxes > 2) + return DIERR_INVALIDPARAM; + else if (peff->cAxes < 1) + return DIERR_INCOMPLETEEFFECT; + } + + /* some of this may look funky, but it's 'cause the linux driver and directx have + * different opinions about which way direction "0" is. directx has 0 along the x + * axis (left), linux has it along the y axis (down). */ + if (dwFlags & DIEP_DIRECTION) { + if (peff->cAxes == 1) { + if (peff->dwFlags & DIEFF_CARTESIAN) { + if (dwFlags & DIEP_AXES) { + if (peff->rgdwAxes[0] == DIJOFS_X && peff->rglDirection[0] >= 0) + This->effect.direction = 0x4000; + else if (peff->rgdwAxes[0] == DIJOFS_X && peff->rglDirection[0] < 0) + This->effect.direction = 0xC000; + else if (peff->rgdwAxes[0] == DIJOFS_Y && peff->rglDirection[0] >= 0) + This->effect.direction = 0; + else if (peff->rgdwAxes[0] == DIJOFS_Y && peff->rglDirection[0] < 0) + This->effect.direction = 0x8000; + } + } else { + /* one-axis effects must use cartesian coords */ + return DIERR_INVALIDPARAM; + } + } else { /* two axes */ + if (peff->dwFlags & DIEFF_CARTESIAN) { + /* avoid divide-by-zero */ + if (peff->rglDirection[1] == 0) { + if (peff->rglDirection[0] >= 0) + This->effect.direction = 0x4000; + else if (peff->rglDirection[0] < 0) + This->effect.direction = 0xC000; + } else { + This->effect.direction = (int)(atan(peff->rglDirection[0] / peff->rglDirection[1]) * 0x7FFF / (3 * M_PI)); + } + } else { + /* Polar and spherical are the same for 2 axes */ + /* Precision is important here, so we do double math with exact constants */ + This->effect.direction = (int)(((double)peff->rglDirection[0] - 90) / 35999) * 0x7FFF; + } + } + } + + if (dwFlags & DIEP_DURATION) + This->effect.replay.length = peff->dwDuration / 1000; + + if (dwFlags & DIEP_ENVELOPE) { + struct ff_envelope* env; + if (This->effect.type == FF_CONSTANT) env = &This->effect.u.constant.envelope; + else if (This->effect.type == FF_PERIODIC) env = &This->effect.u.periodic.envelope; + else if (This->effect.type == FF_RAMP) env = &This->effect.u.ramp.envelope; + else env = NULL; + + if (peff->lpEnvelope == NULL) { + /* if this type had an envelope, reset it + * note that length can never be zero, so we set it to something miniscule */ + if (env) { + env->attack_length = 0x10; + env->attack_level = 0x7FFF; + env->fade_length = 0x10; + env->fade_level = 0x7FFF; + } + } else { + /* did we get passed an envelope for a type that doesn't even have one? */ + if (!env) return DIERR_INVALIDPARAM; + /* copy the envelope */ + env->attack_length = peff->lpEnvelope->dwAttackTime / 1000; + env->attack_level = (peff->lpEnvelope->dwAttackLevel / 10) * 32; + env->fade_length = peff->lpEnvelope->dwFadeTime / 1000; + env->fade_level = (peff->lpEnvelope->dwFadeLevel / 10) * 32; + } + } + + /* Gain and Sample Period settings are not supported by the linux + * event system */ + if (dwFlags & DIEP_GAIN) + TRACE("Gain requested but no gain functionality present.\n"); + + if (dwFlags & DIEP_SAMPLEPERIOD) + TRACE("Sample period requested but no sample period functionality present.\n"); + + if (dwFlags & DIEP_STARTDELAY) + This->effect.replay.delay = peff->dwStartDelay / 1000; + + if (dwFlags & DIEP_TRIGGERBUTTON) { + if (peff->dwTriggerButton != -1) { + FIXME("Linuxinput button mapping needs redoing, assuming we're using a joystick.\n"); + FIXME("Trigger button translation not yet implemented!\n"); + } + This->effect.trigger.button = 0; + } + + if (dwFlags & DIEP_TRIGGERREPEATINTERVAL) + This->effect.trigger.interval = peff->dwTriggerRepeatInterval / 1000; + + if (dwFlags & DIEP_TYPESPECIFICPARAMS) { + if (!(peff->lpvTypeSpecificParams)) + return DIERR_INCOMPLETEEFFECT; + if (type == DIEFT_PERIODIC) { + LPCDIPERIODIC tsp; + if (peff->cbTypeSpecificParams != sizeof(DIPERIODIC)) + return DIERR_INVALIDPARAM; + tsp = (LPCDIPERIODIC)(peff->lpvTypeSpecificParams); + This->effect.u.periodic.magnitude = (tsp->dwMagnitude / 10) * 32; + This->effect.u.periodic.offset = (tsp->lOffset / 10) * 32; + This->effect.u.periodic.phase = (tsp->dwPhase / 9) * 8; /* == (/ 36 * 32) */ + This->effect.u.periodic.period = tsp->dwPeriod / 1000; + } else if (type == DIEFT_CONSTANTFORCE) { + LPCDICONSTANTFORCE tsp; + if (peff->cbTypeSpecificParams != sizeof(DICONSTANTFORCE)) + return DIERR_INVALIDPARAM; + tsp = (LPCDICONSTANTFORCE)(peff->lpvTypeSpecificParams); + This->effect.u.constant.level = (tsp->lMagnitude / 10) * 32; + } else if (type == DIEFT_RAMPFORCE) { + LPCDIRAMPFORCE tsp; + if (peff->cbTypeSpecificParams != sizeof(DIRAMPFORCE)) + return DIERR_INVALIDPARAM; + tsp = (LPCDIRAMPFORCE)(peff->lpvTypeSpecificParams); + This->effect.u.ramp.start_level = (tsp->lStart / 10) * 32; + This->effect.u.ramp.end_level = (tsp->lStart / 10) * 32; + } else if (type == DIEFT_CONDITION) { + LPCDICONDITION tsp = (LPCDICONDITION)(peff->lpvTypeSpecificParams); + if (peff->cbTypeSpecificParams == sizeof(DICONDITION)) { + /* One condition block. This needs to be rotated to direction, + * and expanded to separate x and y conditions. */ + int i; + double factor[2]; + factor[0] = asin((This->effect.direction * 3.0 * M_PI) / 0x7FFF); + factor[1] = acos((This->effect.direction * 3.0 * M_PI) / 0x7FFF); + for (i = 0; i < 2; ++i) { + This->effect.u.condition[i].center = (int)(factor[i] * (tsp->lOffset / 10) * 32); + This->effect.u.condition[i].right_coeff = (int)(factor[i] * (tsp->lPositiveCoefficient / 10) * 32); + This->effect.u.condition[i].left_coeff = (int)(factor[i] * (tsp->lNegativeCoefficient / 10) * 32); + This->effect.u.condition[i].right_saturation = (int)(factor[i] * (tsp->dwPositiveSaturation / 10) * 32); + This->effect.u.condition[i].left_saturation = (int)(factor[i] * (tsp->dwNegativeSaturation / 10) * 32); + This->effect.u.condition[i].deadband = (int)(factor[i] * (tsp->lDeadBand / 10) * 32); + } + } else if (peff->cbTypeSpecificParams == 2 * sizeof(DICONDITION)) { + /* Two condition blocks. Direct parameter copy. */ + int i; + for (i = 0; i < 2; ++i) { + This->effect.u.condition[i].center = (tsp[i].lOffset / 10) * 32; + This->effect.u.condition[i].right_coeff = (tsp[i].lPositiveCoefficient / 10) * 32; + This->effect.u.condition[i].left_coeff = (tsp[i].lNegativeCoefficient / 10) * 32; + This->effect.u.condition[i].right_saturation = (tsp[i].dwPositiveSaturation / 10) * 32; + This->effect.u.condition[i].left_saturation = (tsp[i].dwNegativeSaturation / 10) * 32; + This->effect.u.condition[i].deadband = (tsp[i].lDeadBand / 10) * 32; + } + } else { + return DIERR_INVALIDPARAM; + } + } else { + FIXME("Custom force types are not supported\n"); + return DIERR_INVALIDPARAM; + } + } + + if (!(dwFlags & DIEP_NODOWNLOAD)) + retval = LinuxInputEffectImpl_Download(iface); + if (retval != DI_OK) + return DI_DOWNLOADSKIPPED; + + if (dwFlags & DIEP_NORESTART) + TRACE("DIEP_NORESTART: not handled (we have no control of that).\n"); + + if (dwFlags & DIEP_START) + retval = LinuxInputEffectImpl_Start(iface, 1, 0); + if (retval != DI_OK) + return retval; + + return DI_OK; +} + +static ULONG WINAPI LinuxInputEffectImpl_Release( + LPDIRECTINPUTEFFECT iface) +{ + LinuxInputEffectImpl *This = (LinuxInputEffectImpl *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + + if (ref == 0) + HeapFree(GetProcessHeap(), 0, This); + return ref; +} + +static HRESULT WINAPI LinuxInputEffectImpl_Stop( + LPDIRECTINPUTEFFECT iface) +{ + struct input_event event; + LinuxInputEffectImpl *This = (LinuxInputEffectImpl *)iface; + + TRACE("(this=%p)\n", This); + + event.type = EV_FF; + event.code = This->effect.id; + event.value = 0; + /* we don't care about the success or failure of this call */ + write(*(This->fd), &event, sizeof(event)); + + return DI_OK; +} + +static HRESULT WINAPI LinuxInputEffectImpl_Unload( + LPDIRECTINPUTEFFECT iface) +{ + LinuxInputEffectImpl *This = (LinuxInputEffectImpl *)iface; + TRACE("(this=%p)\n", This); + + /* Erase the downloaded effect */ + if (ioctl(*(This->fd), EVIOCRMFF, This->effect.id) == -1) + return DIERR_INVALIDPARAM; + + /* Mark the effect as deallocated */ + This->effect.id = -1; + + return DI_OK; +} + +/****************************************************************************** + * LinuxInputEffect + */ + +HRESULT linuxinput_create_effect( + int* fd, + REFGUID rguid, + LPDIRECTINPUTEFFECT* peff) +{ + LinuxInputEffectImpl* newEffect = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, sizeof(LinuxInputEffectImpl)); + DWORD type = _typeFromGUID(rguid); + + newEffect->lpVtbl = &LinuxInputEffectVtbl; + newEffect->ref = 1; + memcpy(&(newEffect->guid), rguid, sizeof(*rguid)); + newEffect->fd = fd; + + /* set the type. this cannot be changed over the effect's life. */ + switch (type) { + case DIEFT_PERIODIC: + newEffect->effect.type = FF_PERIODIC; + if (IsEqualGUID(rguid, &GUID_Sine)) { + newEffect->effect.u.periodic.waveform = FF_SINE; + } else if (IsEqualGUID(rguid, &GUID_Triangle)) { + newEffect->effect.u.periodic.waveform = FF_TRIANGLE; + } else if (IsEqualGUID(rguid, &GUID_Square)) { + newEffect->effect.u.periodic.waveform = FF_SQUARE; + } else if (IsEqualGUID(rguid, &GUID_SawtoothUp)) { + newEffect->effect.u.periodic.waveform = FF_SAW_UP; + } else if (IsEqualGUID(rguid, &GUID_SawtoothDown)) { + newEffect->effect.u.periodic.waveform = FF_SAW_DOWN; + } + break; + case DIEFT_CONSTANTFORCE: + newEffect->effect.type = FF_CONSTANT; + break; + case DIEFT_RAMPFORCE: + newEffect->effect.type = FF_RAMP; + break; + case DIEFT_CONDITION: + if (IsEqualGUID(rguid, &GUID_Spring)) { + newEffect->effect.type = FF_SPRING; + } else if (IsEqualGUID(rguid, &GUID_Friction)) { + newEffect->effect.type = FF_FRICTION; + } else if (IsEqualGUID(rguid, &GUID_Inertia)) { + newEffect->effect.type = FF_INERTIA; + } else if (IsEqualGUID(rguid, &GUID_Damper)) { + newEffect->effect.type = FF_DAMPER; + } + break; + case DIEFT_CUSTOMFORCE: + FIXME("Custom forces are not supported.\n"); + HeapFree(GetProcessHeap(), 0, newEffect); + return DIERR_INVALIDPARAM; + default: + FIXME("Unkown force type.\n"); + HeapFree(GetProcessHeap(), 0, newEffect); + return DIERR_INVALIDPARAM; + } + + /* mark as non-uploaded */ + newEffect->effect.id = -1; + + *peff = (LPDIRECTINPUTEFFECT)newEffect; + + TRACE("Creating linux input system effect (%p) with guid %s\n", + *peff, _dump_dinput_GUID(rguid)); + + return DI_OK; +} + +HRESULT linuxinput_get_info_A( + int fd, + REFGUID rguid, + LPDIEFFECTINFOA info) +{ + DWORD type = _typeFromGUID(rguid); + + TRACE("(%d, %s, %p) type=%ld\n", fd, _dump_dinput_GUID(rguid), info, type); + + if (!info) return E_POINTER; + + if (info->dwSize != sizeof(DIEFFECTINFOA)) return DIERR_INVALIDPARAM; + + info->guid = *rguid; + + info->dwEffType = type; + /* the event device API does not support querying for all these things + * therefore we assume that we have support for them + * that's not as dangerous as it sounds, since drivers are allowed to + * ignore parameters they claim to support anyway */ + info->dwEffType |= DIEFT_DEADBAND | DIEFT_FFATTACK | DIEFT_FFFADE + | DIEFT_POSNEGCOEFFICIENTS | DIEFT_POSNEGSATURATION + | DIEFT_SATURATION | DIEFT_STARTDELAY; + + /* again, assume we have support for everything */ + info->dwStaticParams = DIEP_ALLPARAMS; + info->dwDynamicParams = info->dwStaticParams; + + /* yes, this is windows behavior (print the GUID_Name for name) */ + strcpy((char*)&(info->tszName), _dump_dinput_GUID(rguid)); + + return DI_OK; +} + +HRESULT linuxinput_get_info_W( + int fd, + REFGUID rguid, + LPDIEFFECTINFOW info) +{ + DWORD type = _typeFromGUID(rguid); + + TRACE("(%d, %s, %p) type=%ld\n", fd, _dump_dinput_GUID(rguid), info, type); + + if (!info) return E_POINTER; + + if (info->dwSize != sizeof(DIEFFECTINFOW)) return DIERR_INVALIDPARAM; + + info->guid = *rguid; + + info->dwEffType = type; + /* the event device API does not support querying for all these things + * therefore we assume that we have support for them + * that's not as dangerous as it sounds, since drivers are allowed to + * ignore parameters they claim to support anyway */ + info->dwEffType |= DIEFT_DEADBAND | DIEFT_FFATTACK | DIEFT_FFFADE + | DIEFT_POSNEGCOEFFICIENTS | DIEFT_POSNEGSATURATION + | DIEFT_SATURATION | DIEFT_STARTDELAY; + + /* again, assume we have support for everything */ + info->dwStaticParams = DIEP_ALLPARAMS; + info->dwDynamicParams = info->dwStaticParams; + + /* yes, this is windows behavior (print the GUID_Name for name) */ + MultiByteToWideChar(CP_ACP, 0, _dump_dinput_GUID(rguid), -1, + (WCHAR*)&(info->tszName), MAX_PATH); + + return DI_OK; +} + +static const IDirectInputEffectVtbl LinuxInputEffectVtbl = { + LinuxInputEffectImpl_QueryInterface, + LinuxInputEffectImpl_AddRef, + LinuxInputEffectImpl_Release, + LinuxInputEffectImpl_Initialize, + LinuxInputEffectImpl_GetEffectGuid, + LinuxInputEffectImpl_GetParameters, + LinuxInputEffectImpl_SetParameters, + LinuxInputEffectImpl_Start, + LinuxInputEffectImpl_Stop, + LinuxInputEffectImpl_GetEffectStatus, + LinuxInputEffectImpl_Download, + LinuxInputEffectImpl_Unload, + LinuxInputEffectImpl_Escape +}; + +#endif /* HAVE_STRUCT_FF_EFFECT_DIRECTION */ diff -urN wine-20050830/dlls/dinput/joystick_linux.c wine-20050930/dlls/dinput/joystick_linux.c --- wine-20050830/dlls/dinput/joystick_linux.c 2005-08-29 11:38:19.000000000 +0200 +++ wine-20050930/dlls/dinput/joystick_linux.c 2005-09-12 12:30:06.000000000 +0200 @@ -552,7 +552,7 @@ IDirectInputDevice_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->dinput); InitializeCriticalSection(&(newDevice->crit)); - newDevice->crit.DebugInfo->Spare[1] = (DWORD)"DINPUT_Mouse"; + newDevice->crit.DebugInfo->Spare[0] = (DWORD_PTR)"DINPUT_Mouse"; newDevice->devcaps.dwSize = sizeof(newDevice->devcaps); newDevice->devcaps.dwFlags = DIDC_ATTACHED; @@ -688,7 +688,7 @@ /* release the data transform filter */ release_DataFormat(This->transform); - This->crit.DebugInfo->Spare[1] = 0; + This->crit.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&(This->crit)); IDirectInputDevice_Release((LPDIRECTINPUTDEVICE8A)This->dinput); @@ -1131,7 +1131,7 @@ _dump_DIPROPHEADER(ph); if (!HIWORD(rguid)) { - switch ((DWORD)rguid) { + switch (LOWORD(rguid)) { case (DWORD) DIPROP_BUFFERSIZE: { LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; TRACE("buffersize = %ld\n",pd->dwData); @@ -1196,7 +1196,7 @@ break; } default: - FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid)); + FIXME("Unknown type %p (%s)\n",rguid,debugstr_guid(rguid)); break; } } @@ -1212,7 +1212,7 @@ ) { JoystickImpl *This = (JoystickImpl *)iface; - TRACE("(this=%p,0x%08lx)\n",This,(DWORD)hnd); + TRACE("(this=%p,%p)\n",This,hnd); This->hEvent = hnd; return DI_OK; } @@ -1427,7 +1427,7 @@ _dump_DIPROPHEADER(pdiph); if (!HIWORD(rguid)) { - switch ((DWORD)rguid) { + switch (LOWORD(rguid)) { case (DWORD) DIPROP_BUFFERSIZE: { LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; TRACE(" return buffersize = %d\n",This->queue_len); @@ -1468,7 +1468,7 @@ break; } default: - FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid)); + FIXME("Unknown type %p (%s)\n",rguid,debugstr_guid(rguid)); break; } } diff -urN wine-20050830/dlls/dinput/joystick_linuxinput.c wine-20050930/dlls/dinput/joystick_linuxinput.c --- wine-20050830/dlls/dinput/joystick_linuxinput.c 2005-08-08 13:17:25.000000000 +0200 +++ wine-20050930/dlls/dinput/joystick_linuxinput.c 2005-09-12 12:30:06.000000000 +0200 @@ -69,6 +69,18 @@ #define WINE_JOYSTICK_AXIS_BASE 0 #define WINE_JOYSTICK_BUTTON_BASE 8 +typedef struct EffectListItem EffectListItem; +struct EffectListItem +{ + LPDIRECTINPUTEFFECT ref; + struct EffectListItem* next; +}; + +/* implemented in effect_linuxinput.c */ +HRESULT linuxinput_create_effect(int* fd, REFGUID rguid, LPDIRECTINPUTEFFECT* peff); +HRESULT linuxinput_get_info_A(int fd, REFGUID rguid, LPDIEFFECTINFOA info); +HRESULT linuxinput_get_info_W(int fd, REFGUID rguid, LPDIEFFECTINFOW info); + typedef struct JoystickImpl JoystickImpl; static const IDirectInputDevice8AVtbl JoystickAvt; static const IDirectInputDevice8WVtbl JoystickWvt; @@ -104,6 +116,8 @@ /* Force feedback variables */ BOOL has_ff; int num_effects; + EffectListItem* top_effect; + int ff_state; /* data returned by the EVIOCGABS() ioctl */ int axes[ABS_MAX+1][5]; @@ -288,6 +302,9 @@ newDevice->ref = 1; newDevice->joyfd = -1; newDevice->dinput = dinput; +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + newDevice->ff_state = FF_STATUS_STOPPED; +#endif memcpy(&(newDevice->guid),rguid,sizeof(*rguid)); for (i=0;iwantmin[i] = -32768; @@ -376,6 +393,9 @@ if (ref) return ref; + /* Reset the FF state, free all effects, etc */ + IDirectInputDevice8_SendForceFeedbackCommand(iface, DISFFC_RESET); + /* Free the data queue */ HeapFree(GetProcessHeap(),0,This->data_queue); @@ -705,6 +725,11 @@ break; } break; +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + case EV_FF_STATUS: + This->ff_state = ie.value; + break; +#endif default: FIXME("joystick cannot handle type %d event (code %d)\n",ie.type,ie.code); break; @@ -770,7 +795,7 @@ FIXME("ph.dwSize = %ld, ph.dwHeaderSize =%ld, ph.dwObj = %ld, ph.dwHow= %ld\n",ph->dwSize, ph->dwHeaderSize,ph->dwObj,ph->dwHow); if (!HIWORD(rguid)) { - switch ((DWORD)rguid) { + switch (LOWORD(rguid)) { case (DWORD) DIPROP_BUFFERSIZE: { LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; @@ -806,7 +831,7 @@ break; } default: - FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid)); + FIXME("Unknown type %p (%s)\n",rguid,debugstr_guid(rguid)); break; } } @@ -822,7 +847,7 @@ ) { JoystickImpl *This = (JoystickImpl *)iface; - TRACE("(this=%p,0x%08lx)\n",This,(DWORD)hnd); + TRACE("(this=%p,%p)\n",This,hnd); This->hEvent = hnd; return DI_OK; } @@ -887,7 +912,6 @@ DIDEVICEOBJECTINSTANCEA ddoi; int xfd = This->joyfd; - TRACE("(this=%p,%p,%p,%08lx)\n", This, lpCallback, lpvRef, dwFlags); if (TRACE_ON(dinput)) { TRACE(" - flags = "); @@ -895,7 +919,9 @@ TRACE("\n"); } - if (xfd == -1) return DIERR_NOTACQUIRED; + /* We need to work even if we're not yet acquired */ + if (xfd == -1) + IDirectInputDevice8_Acquire(iface); /* Only the fields till dwFFMaxForce are relevant */ ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA, dwFFMaxForce); @@ -946,10 +972,19 @@ FIXME("unhandled abs axis %d, ignoring!\n",i); } ddoi.dwType = DIDFT_MAKEINSTANCE((1<has_ff) + ddoi.dwFlags |= DIDOI_FFACTUATOR; + } sprintf(ddoi.tszName, "%d-Axis", i); _dump_OBJECTINSTANCEA(&ddoi); - if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) - return DI_OK; + if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) { + /* return to unaquired state if that's where we were */ + if (xfd == -1) + IDirectInputDevice8_Unacquire(iface); + return DI_OK; + } } } @@ -1032,13 +1067,18 @@ } sprintf(ddoi.tszName, "%d-Button", i); _dump_OBJECTINSTANCEA(&ddoi); - if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) - return DI_OK; + if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) { + /* return to unaquired state if that's where we were */ + if (xfd == -1) + IDirectInputDevice8_Unacquire(iface); + return DI_OK; + } } } - if (xfd!=This->joyfd) - close(xfd); + /* return to unaquired state if that's where we were */ + if (xfd == -1) + IDirectInputDevice8_Unacquire(iface); return DI_OK; } @@ -1074,7 +1114,7 @@ _dump_DIPROPHEADER(pdiph); if (!HIWORD(rguid)) { - switch ((DWORD)rguid) { + switch (LOWORD(rguid)) { case (DWORD) DIPROP_BUFFERSIZE: { LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; @@ -1095,7 +1135,7 @@ } default: - FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid)); + FIXME("Unknown type %p (%s)\n",rguid,debugstr_guid(rguid)); break; } } @@ -1104,6 +1144,350 @@ return DI_OK; } +/****************************************************************************** + * CreateEffect - Create a new FF effect with the specified params + */ +static HRESULT WINAPI JoystickAImpl_CreateEffect(LPDIRECTINPUTDEVICE8A iface, + REFGUID rguid, + LPCDIEFFECT lpeff, + LPDIRECTINPUTEFFECT *ppdef, + LPUNKNOWN pUnkOuter) +{ +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + EffectListItem* new = NULL; + HRESULT retval = DI_OK; +#endif + + JoystickImpl* This = (JoystickImpl*)iface; + TRACE("(this=%p,%p,%p,%p,%p)\n", This, rguid, lpeff, ppdef, pUnkOuter); + +#ifndef HAVE_STRUCT_FF_EFFECT_DIRECTION + TRACE("not available (compiled w/o ff support)\n"); + *ppdef = NULL; + return DI_OK; +#else + + new = malloc(sizeof(EffectListItem)); + new->next = This->top_effect; + This->top_effect = new; + + retval = linuxinput_create_effect(&(This->joyfd), rguid, &(new->ref)); + if (retval != DI_OK) + return retval; + + if (lpeff != NULL) + retval = IDirectInputEffect_SetParameters(new->ref, lpeff, 0); + if (retval != DI_OK && retval != DI_DOWNLOADSKIPPED) + return retval; + + *ppdef = new->ref; + + if (pUnkOuter != NULL) + FIXME("Interface aggregation not implemented.\n"); + + return DI_OK; + +#endif /* HAVE_STRUCT_FF_EFFECT_DIRECTION */ +} + +/******************************************************************************* + * EnumEffects - Enumerate available FF effects + */ +static HRESULT WINAPI JoystickAImpl_EnumEffects(LPDIRECTINPUTDEVICE8A iface, + LPDIENUMEFFECTSCALLBACKA lpCallback, + LPVOID pvRef, + DWORD dwEffType) +{ +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + DIEFFECTINFOA dei; /* feif */ + DWORD type = DIEFT_GETTYPE(dwEffType); + JoystickImpl* This = (JoystickImpl*)iface; + int xfd = This->joyfd; + + TRACE("(this=%p,%p,%ld) type=%ld fd=%d\n", This, pvRef, dwEffType, type, xfd); + + dei.dwSize = sizeof(DIEFFECTINFOA); + + /* We need to return something even if we're not yet acquired */ + if (xfd == -1) + IDirectInputDevice8_Acquire(iface); + + if ((type == DIEFT_ALL || type == DIEFT_CONSTANTFORCE) + && test_bit(This->ffbits, FF_CONSTANT)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_ConstantForce); + (*lpCallback)(&dei, pvRef); + } + + if ((type == DIEFT_ALL || type == DIEFT_PERIODIC) + && test_bit(This->ffbits, FF_PERIODIC)) { + if (test_bit(This->ffbits, FF_SQUARE)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Square); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_SINE)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Sine); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_TRIANGLE)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Triangle); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_SAW_UP)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_SawtoothUp); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_SAW_DOWN)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_SawtoothDown); + (*lpCallback)(&dei, pvRef); + } + } + + if ((type == DIEFT_ALL || type == DIEFT_RAMPFORCE) + && test_bit(This->ffbits, FF_RAMP)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_RampForce); + (*lpCallback)(&dei, pvRef); + } + + if (type == DIEFT_ALL || type == DIEFT_CONDITION) { + if (test_bit(This->ffbits, FF_SPRING)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Spring); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_DAMPER)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Damper); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_INERTIA)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Inertia); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_FRICTION)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Friction); + (*lpCallback)(&dei, pvRef); + } + } + + /* return to unaquired state if that's where it was */ + if (xfd == -1) + IDirectInputDevice8_Unacquire(iface); +#endif + + return DI_OK; +} + +static HRESULT WINAPI JoystickWImpl_EnumEffects(LPDIRECTINPUTDEVICE8W iface, + LPDIENUMEFFECTSCALLBACKW lpCallback, + LPVOID pvRef, + DWORD dwEffType) +{ +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + /* seems silly to duplicate all this code but all the structures and functions + * are actually different (A/W) */ + DIEFFECTINFOW dei; /* feif */ + DWORD type = DIEFT_GETTYPE(dwEffType); + JoystickImpl* This = (JoystickImpl*)iface; + int xfd = This->joyfd; + + TRACE("(this=%p,%p,%ld) type=%ld fd=%d\n", This, pvRef, dwEffType, type, xfd); + + dei.dwSize = sizeof(DIEFFECTINFOW); + + /* We need to return something even if we're not yet acquired */ + if (xfd == -1) + IDirectInputDevice8_Acquire(iface); + + if ((type == DIEFT_ALL || type == DIEFT_CONSTANTFORCE) + && test_bit(This->ffbits, FF_CONSTANT)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_ConstantForce); + (*lpCallback)(&dei, pvRef); + } + + if ((type == DIEFT_ALL || type == DIEFT_PERIODIC) + && test_bit(This->ffbits, FF_PERIODIC)) { + if (test_bit(This->ffbits, FF_SQUARE)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Square); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_SINE)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Sine); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_TRIANGLE)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Triangle); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_SAW_UP)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_SawtoothUp); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_SAW_DOWN)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_SawtoothDown); + (*lpCallback)(&dei, pvRef); + } + } + + if ((type == DIEFT_ALL || type == DIEFT_RAMPFORCE) + && test_bit(This->ffbits, FF_RAMP)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_RampForce); + (*lpCallback)(&dei, pvRef); + } + + if (type == DIEFT_ALL || type == DIEFT_CONDITION) { + if (test_bit(This->ffbits, FF_SPRING)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Spring); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_DAMPER)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Damper); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_INERTIA)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Inertia); + (*lpCallback)(&dei, pvRef); + } + if (test_bit(This->ffbits, FF_FRICTION)) { + IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_Friction); + (*lpCallback)(&dei, pvRef); + } + } + + /* return to unaquired state if that's where it was */ + if (xfd == -1) + IDirectInputDevice8_Unacquire(iface); +#endif + + return DI_OK; +} + +/******************************************************************************* + * GetEffectInfo - Get information about a particular effect + */ +static HRESULT WINAPI JoystickAImpl_GetEffectInfo(LPDIRECTINPUTDEVICE8A iface, + LPDIEFFECTINFOA pdei, + REFGUID guid) +{ + JoystickImpl* This = (JoystickImpl*)iface; + + TRACE("(this=%p,%p,%s)\n", This, pdei, _dump_dinput_GUID(guid)); + +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + return linuxinput_get_info_A(This->joyfd, guid, pdei); +#else + return DI_OK; +#endif +} + +static HRESULT WINAPI JoystickWImpl_GetEffectInfo(LPDIRECTINPUTDEVICE8W iface, + LPDIEFFECTINFOW pdei, + REFGUID guid) +{ + JoystickImpl* This = (JoystickImpl*)iface; + + TRACE("(this=%p,%p,%s)\n", This, pdei, _dump_dinput_GUID(guid)); + +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + return linuxinput_get_info_W(This->joyfd, guid, pdei); +#else + return DI_OK; +#endif +} + +/******************************************************************************* + * GetForceFeedbackState - Get information about the device's FF state + */ +static HRESULT WINAPI JoystickAImpl_GetForceFeedbackState( + LPDIRECTINPUTDEVICE8A iface, + LPDWORD pdwOut) +{ + JoystickImpl* This = (JoystickImpl*)iface; + + TRACE("(this=%p,%p)\n", This, pdwOut); + + (*pdwOut) = 0; + +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + /* DIGFFS_STOPPED is the only mandatory flag to report */ + if (This->ff_state == FF_STATUS_STOPPED) + (*pdwOut) |= DIGFFS_STOPPED; +#endif + + return DI_OK; +} + +/******************************************************************************* + * SendForceFeedbackCommand - Send a command to the device's FF system + */ +static HRESULT WINAPI JoystickAImpl_SendForceFeedbackCommand( + LPDIRECTINPUTDEVICE8A iface, + DWORD dwFlags) +{ + JoystickImpl* This = (JoystickImpl*)iface; + TRACE("(this=%p,%ld)\n", This, dwFlags); + +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + if (dwFlags == DISFFC_STOPALL) { + /* Stop all effects */ + EffectListItem* itr = This->top_effect; + while (itr) { + IDirectInputEffect_Stop(itr->ref); + itr = itr->next; + } + } else if (dwFlags == DISFFC_RESET) { + /* Stop, unload, release and free all effects */ + /* This returns the device to its "bare" state */ + while (This->top_effect) { + EffectListItem* temp = This->top_effect; + IDirectInputEffect_Stop(temp->ref); + IDirectInputEffect_Unload(temp->ref); + IDirectInputEffect_Release(temp->ref); + This->top_effect = temp->next; + free(temp); + } + } else if (dwFlags == DISFFC_PAUSE || dwFlags == DISFFC_CONTINUE) { + FIXME("No support for Pause or Continue in linux\n"); + } else if (dwFlags == DISFFC_SETACTUATORSOFF + || dwFlags == DISFFC_SETACTUATORSON) { + FIXME("No direct actuator control in linux\n"); + } else { + FIXME("Unknown Force Feedback Command!\n"); + return DIERR_INVALIDPARAM; + } + return DI_OK; +#else + return DIERR_UNSUPPORTED; +#endif +} + +/******************************************************************************* + * EnumCreatedEffectObjects - Enumerate all the effects that have been + * created for this device. + */ +static HRESULT WINAPI JoystickAImpl_EnumCreatedEffectObjects( + LPDIRECTINPUTDEVICE8A iface, + LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, + LPVOID pvRef, + DWORD dwFlags) +{ + /* this function is safe to call on non-ff-enabled builds */ + + JoystickImpl* This = (JoystickImpl*)iface; + EffectListItem* itr = This->top_effect; + TRACE("(this=%p,%p,%p,%ld)\n", This, lpCallback, pvRef, dwFlags); + + if (!lpCallback) + return DIERR_INVALIDPARAM; + + if (dwFlags != 0) + FIXME("Flags specified, but no flags exist yet (DX9)!"); + + while (itr) { + (*lpCallback)(itr->ref, pvRef); + itr = itr->next; + } + + return DI_OK; +} + static const IDirectInputDevice8AVtbl JoystickAvt = { IDirectInputDevice2AImpl_QueryInterface, @@ -1124,12 +1508,12 @@ IDirectInputDevice2AImpl_GetDeviceInfo, IDirectInputDevice2AImpl_RunControlPanel, IDirectInputDevice2AImpl_Initialize, - IDirectInputDevice2AImpl_CreateEffect, - IDirectInputDevice2AImpl_EnumEffects, - IDirectInputDevice2AImpl_GetEffectInfo, - IDirectInputDevice2AImpl_GetForceFeedbackState, - IDirectInputDevice2AImpl_SendForceFeedbackCommand, - IDirectInputDevice2AImpl_EnumCreatedEffectObjects, + JoystickAImpl_CreateEffect, + JoystickAImpl_EnumEffects, + JoystickAImpl_GetEffectInfo, + JoystickAImpl_GetForceFeedbackState, + JoystickAImpl_SendForceFeedbackCommand, + JoystickAImpl_EnumCreatedEffectObjects, IDirectInputDevice2AImpl_Escape, JoystickAImpl_Poll, IDirectInputDevice2AImpl_SendDeviceData, @@ -1166,12 +1550,12 @@ IDirectInputDevice2WImpl_GetDeviceInfo, XCAST(RunControlPanel)IDirectInputDevice2AImpl_RunControlPanel, XCAST(Initialize)IDirectInputDevice2AImpl_Initialize, - XCAST(CreateEffect)IDirectInputDevice2AImpl_CreateEffect, - IDirectInputDevice2WImpl_EnumEffects, - IDirectInputDevice2WImpl_GetEffectInfo, - XCAST(GetForceFeedbackState)IDirectInputDevice2AImpl_GetForceFeedbackState, - XCAST(SendForceFeedbackCommand)IDirectInputDevice2AImpl_SendForceFeedbackCommand, - XCAST(EnumCreatedEffectObjects)IDirectInputDevice2AImpl_EnumCreatedEffectObjects, + XCAST(CreateEffect)JoystickAImpl_CreateEffect, + JoystickWImpl_EnumEffects, + JoystickWImpl_GetEffectInfo, + XCAST(GetForceFeedbackState)JoystickAImpl_GetForceFeedbackState, + XCAST(SendForceFeedbackCommand)JoystickAImpl_SendForceFeedbackCommand, + XCAST(EnumCreatedEffectObjects)JoystickAImpl_EnumCreatedEffectObjects, XCAST(Escape)IDirectInputDevice2AImpl_Escape, XCAST(Poll)JoystickAImpl_Poll, XCAST(SendDeviceData)IDirectInputDevice2AImpl_SendDeviceData, diff -urN wine-20050830/dlls/dinput/keyboard.c wine-20050930/dlls/dinput/keyboard.c --- wine-20050830/dlls/dinput/keyboard.c 2005-08-03 13:03:05.000000000 +0200 +++ wine-20050930/dlls/dinput/keyboard.c 2005-09-12 12:30:06.000000000 +0200 @@ -83,7 +83,7 @@ { 0, 0, &keyboard_crit, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": keyboard_crit") } + 0, 0, { (DWORD_PTR)(__FILE__ ": keyboard_crit") } }; static CRITICAL_SECTION keyboard_crit = { &critsect_debug, -1, 0, 0, 0, 0 }; @@ -342,7 +342,7 @@ TRACE("(size=%ld,headersize=%ld,obj=%ld,how=%ld\n", ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow); if (!HIWORD(rguid)) { - switch ((DWORD)rguid) { + switch (LOWORD(rguid)) { case (DWORD) DIPROP_BUFFERSIZE: { LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; @@ -356,7 +356,7 @@ break; } default: - WARN("Unknown type %ld\n",(DWORD)rguid); + WARN("Unknown type %p\n",rguid); break; } } @@ -373,7 +373,7 @@ TRACE("(size=%ld,headersize=%ld,obj=%ld,how=%ld\n", ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow); if (!HIWORD(rguid)) { - switch ((DWORD)rguid) { + switch (LOWORD(rguid)) { case (DWORD) DIPROP_BUFFERSIZE: { LPDIPROPDWORD pd = (LPDIPROPDWORD)ph; @@ -387,7 +387,7 @@ break; } default: - WARN("Unknown type %ld\n",(DWORD)rguid); + WARN("Unknown type %p\n",rguid); break; } } @@ -597,7 +597,7 @@ HANDLE hnd) { SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - TRACE("(this=%p,0x%08lx)\n",This,(DWORD)hnd); + TRACE("(this=%p,%p)\n",This,hnd); This->hEvent = hnd; return DI_OK; diff -urN wine-20050830/dlls/dinput/mouse.c wine-20050930/dlls/dinput/mouse.c --- wine-20050830/dlls/dinput/mouse.c 2005-08-03 13:03:05.000000000 +0200 +++ wine-20050930/dlls/dinput/mouse.c 2005-09-12 12:30:06.000000000 +0200 @@ -361,7 +361,7 @@ { SysMouseImpl *This = (SysMouseImpl *)iface; - TRACE("(this=%p,0x%08lx,0x%08lx)\n",This,(DWORD)hwnd,dwflags); + TRACE("(this=%p,%p,0x%08lx)\n",This,hwnd,dwflags); if (TRACE_ON(dinput)) { TRACE(" cooperative level : "); @@ -824,7 +824,7 @@ TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph); if (!HIWORD(rguid)) { - switch ((DWORD)rguid) { + switch (LOWORD(rguid)) { case (DWORD) DIPROP_BUFFERSIZE: { LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; @@ -843,7 +843,7 @@ break; } default: - FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid)); + FIXME("Unknown type %p (%s)\n",rguid,debugstr_guid(rguid)); break; } } @@ -867,7 +867,7 @@ _dump_DIPROPHEADER(pdiph); if (!HIWORD(rguid)) { - switch ((DWORD)rguid) { + switch (LOWORD(rguid)) { case (DWORD) DIPROP_BUFFERSIZE: { LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; @@ -902,7 +902,7 @@ } default: - FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid)); + FIXME("Unknown type %p (%s)\n",rguid,debugstr_guid(rguid)); break; } } @@ -919,7 +919,7 @@ HANDLE hnd) { SysMouseImpl *This = (SysMouseImpl *)iface; - TRACE("(this=%p,0x%08lx)\n",This,(DWORD)hnd); + TRACE("(this=%p,%p)\n",This,hnd); This->hEvent = hnd; diff -urN wine-20050830/dlls/dinput8/.cvsignore wine-20050930/dlls/dinput8/.cvsignore --- wine-20050830/dlls/dinput8/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050930/dlls/dinput8/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -dinput8.dll.dbg.c libdinput8.def version.res diff -urN wine-20050830/dlls/dmband/.cvsignore wine-20050930/dlls/dmband/.cvsignore --- wine-20050830/dlls/dmband/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/dmband/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dmband.dll.dbg.c version.res diff -urN wine-20050830/dlls/dmcompos/.cvsignore wine-20050930/dlls/dmcompos/.cvsignore --- wine-20050830/dlls/dmcompos/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/dmcompos/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dmcompos.dll.dbg.c version.res diff -urN wine-20050830/dlls/dmcompos/chordmaptrack.c wine-20050930/dlls/dmcompos/chordmaptrack.c --- wine-20050830/dlls/dmcompos/chordmaptrack.c 2005-06-09 11:44:12.000000000 +0200 +++ wine-20050930/dlls/dmcompos/chordmaptrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmcompos_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmcompos); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicChordMapTrack implementation diff -urN wine-20050830/dlls/dmcompos/signposttrack.c wine-20050930/dlls/dmcompos/signposttrack.c --- wine-20050830/dlls/dmcompos/signposttrack.c 2005-06-09 11:44:12.000000000 +0200 +++ wine-20050930/dlls/dmcompos/signposttrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmcompos_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmcompos); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicSignPostTrack implementation diff -urN wine-20050830/dlls/dmime/.cvsignore wine-20050930/dlls/dmime/.cvsignore --- wine-20050830/dlls/dmime/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/dmime/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dmime.dll.dbg.c version.res diff -urN wine-20050830/dlls/dmime/dmime_main.c wine-20050930/dlls/dmime/dmime_main.c --- wine-20050830/dlls/dmime/dmime_main.c 2005-06-17 22:58:33.000000000 +0200 +++ wine-20050930/dlls/dmime/dmime_main.c 2005-09-22 12:44:40.000000000 +0200 @@ -21,7 +21,6 @@ #include "dmime_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); LONG DMIME_refCount = 0; diff -urN wine-20050830/dlls/dmime/lyricstrack.c wine-20050930/dlls/dmime/lyricstrack.c --- wine-20050830/dlls/dmime/lyricstrack.c 2005-06-21 11:44:28.000000000 +0200 +++ wine-20050930/dlls/dmime/lyricstrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmime_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicLyricsTrack implementation diff -urN wine-20050830/dlls/dmime/markertrack.c wine-20050930/dlls/dmime/markertrack.c --- wine-20050830/dlls/dmime/markertrack.c 2005-06-21 11:44:28.000000000 +0200 +++ wine-20050930/dlls/dmime/markertrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmime_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicMarkerTrack implementation diff -urN wine-20050830/dlls/dmime/paramcontroltrack.c wine-20050930/dlls/dmime/paramcontroltrack.c --- wine-20050830/dlls/dmime/paramcontroltrack.c 2005-06-21 11:44:28.000000000 +0200 +++ wine-20050930/dlls/dmime/paramcontroltrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmime_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicParamControlTrack implementation diff -urN wine-20050830/dlls/dmime/seqtrack.c wine-20050930/dlls/dmime/seqtrack.c --- wine-20050830/dlls/dmime/seqtrack.c 2005-06-21 11:44:28.000000000 +0200 +++ wine-20050930/dlls/dmime/seqtrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmime_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicSeqTrack implementation diff -urN wine-20050830/dlls/dmime/sysextrack.c wine-20050930/dlls/dmime/sysextrack.c --- wine-20050830/dlls/dmime/sysextrack.c 2005-06-21 11:44:28.000000000 +0200 +++ wine-20050930/dlls/dmime/sysextrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmime_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicSysExTrack implementation diff -urN wine-20050830/dlls/dmime/timesigtrack.c wine-20050930/dlls/dmime/timesigtrack.c --- wine-20050830/dlls/dmime/timesigtrack.c 2005-06-21 11:44:28.000000000 +0200 +++ wine-20050930/dlls/dmime/timesigtrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmime_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicTimeSigTrack implementation diff -urN wine-20050830/dlls/dmime/wavetrack.c wine-20050930/dlls/dmime/wavetrack.c --- wine-20050830/dlls/dmime/wavetrack.c 2005-06-21 11:44:28.000000000 +0200 +++ wine-20050930/dlls/dmime/wavetrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmime_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicWaveTrack implementation diff -urN wine-20050830/dlls/dmloader/.cvsignore wine-20050930/dlls/dmloader/.cvsignore --- wine-20050830/dlls/dmloader/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/dmloader/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dmloader.dll.dbg.c version.res diff -urN wine-20050830/dlls/dmscript/.cvsignore wine-20050930/dlls/dmscript/.cvsignore --- wine-20050830/dlls/dmscript/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/dmscript/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dmscript.dll.dbg.c version.res diff -urN wine-20050830/dlls/dmscript/scripttrack.c wine-20050930/dlls/dmscript/scripttrack.c --- wine-20050830/dlls/dmscript/scripttrack.c 2005-05-30 12:01:09.000000000 +0200 +++ wine-20050930/dlls/dmscript/scripttrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmscript_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmscript); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicScriptTrack implementation diff -urN wine-20050830/dlls/dmstyle/.cvsignore wine-20050930/dlls/dmstyle/.cvsignore --- wine-20050830/dlls/dmstyle/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/dmstyle/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dmstyle.dll.dbg.c version.res diff -urN wine-20050830/dlls/dmstyle/auditiontrack.c wine-20050930/dlls/dmstyle/auditiontrack.c --- wine-20050830/dlls/dmstyle/auditiontrack.c 2005-05-30 12:01:08.000000000 +0200 +++ wine-20050930/dlls/dmstyle/auditiontrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmstyle_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmstyle); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicAuditionTrack implementation diff -urN wine-20050830/dlls/dmstyle/motiftrack.c wine-20050930/dlls/dmstyle/motiftrack.c --- wine-20050830/dlls/dmstyle/motiftrack.c 2005-05-30 12:01:08.000000000 +0200 +++ wine-20050930/dlls/dmstyle/motiftrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmstyle_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmstyle); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicMotifTrack implementation diff -urN wine-20050830/dlls/dmstyle/mutetrack.c wine-20050930/dlls/dmstyle/mutetrack.c --- wine-20050830/dlls/dmstyle/mutetrack.c 2005-05-30 12:01:08.000000000 +0200 +++ wine-20050930/dlls/dmstyle/mutetrack.c 2005-09-22 12:44:40.000000000 +0200 @@ -20,7 +20,6 @@ #include "dmstyle_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmstyle); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); /***************************************************************************** * IDirectMusicMuteTrack implementation diff -urN wine-20050830/dlls/dmsynth/.cvsignore wine-20050930/dlls/dmsynth/.cvsignore --- wine-20050830/dlls/dmsynth/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/dmsynth/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dmsynth.dll.dbg.c version.res diff -urN wine-20050830/dlls/dmusic/.cvsignore wine-20050930/dlls/dmusic/.cvsignore --- wine-20050830/dlls/dmusic/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/dmusic/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dmusic.dll.dbg.c version.res diff -urN wine-20050830/dlls/dmusic32/.cvsignore wine-20050930/dlls/dmusic32/.cvsignore --- wine-20050830/dlls/dmusic32/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/dmusic32/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -dmusic32.dll.dbg.c libdmusic32.def version.res diff -urN wine-20050830/dlls/dplay/.cvsignore wine-20050930/dlls/dplay/.cvsignore --- wine-20050830/dlls/dplay/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/dplay/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -dplay.dll.dbg.c libdplay.def version.res diff -urN wine-20050830/dlls/dplayx/.cvsignore wine-20050930/dlls/dplayx/.cvsignore --- wine-20050830/dlls/dplayx/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/dplayx/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -dplayx.dll.dbg.c libdplayx.def version.res diff -urN wine-20050830/dlls/dpnet/.cvsignore wine-20050930/dlls/dpnet/.cvsignore --- wine-20050830/dlls/dpnet/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/dpnet/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -dpnet.dll.dbg.c libdpnet.def version.res diff -urN wine-20050830/dlls/dpnhpast/.cvsignore wine-20050930/dlls/dpnhpast/.cvsignore --- wine-20050830/dlls/dpnhpast/.cvsignore 2005-07-26 17:52:59.000000000 +0200 +++ wine-20050930/dlls/dpnhpast/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dpnhpast.dll.dbg.c version.res diff -urN wine-20050830/dlls/dsound/.cvsignore wine-20050930/dlls/dsound/.cvsignore --- wine-20050830/dlls/dsound/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/dsound/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,4 +1,3 @@ Makefile -dsound.dll.dbg.c libdsound.def version.res diff -urN wine-20050830/dlls/dsound/buffer.c wine-20050930/dlls/dsound/buffer.c --- wine-20050830/dlls/dsound/buffer.c 2005-06-01 21:57:42.000000000 +0200 +++ wine-20050930/dlls/dsound/buffer.c 2005-09-12 12:30:06.000000000 +0200 @@ -89,8 +89,8 @@ if (TRACE_ON(dsound)) { unsigned int i; for (i=0;idsb->hwnotify) { @@ -365,7 +365,7 @@ if (!ref) { DSOUND_RemoveBuffer(This->dsound, This); - This->lock.DebugInfo->Spare[1] = 0; + This->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&(This->lock)); if (This->hwbuf) { @@ -1152,7 +1152,7 @@ DSOUND_RecalcVolPan(&(dsb->volpan)); InitializeCriticalSection(&(dsb->lock)); - dsb->lock.DebugInfo->Spare[1] = (DWORD)"DSOUNDBUFFER_lock"; + dsb->lock.DebugInfo->Spare[0] = (DWORD_PTR)"DSOUNDBUFFER_lock"; /* register buffer if not primary */ if (!(dsbd->dwFlags & DSBCAPS_PRIMARYBUFFER)) { @@ -1160,7 +1160,7 @@ if (err != DS_OK) { HeapFree(GetProcessHeap(),0,dsb->buffer->memory); HeapFree(GetProcessHeap(),0,dsb->buffer); - dsb->lock.DebugInfo->Spare[1] = 0; + dsb->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&(dsb->lock)); HeapFree(GetProcessHeap(),0,dsb->pwfx); HeapFree(GetProcessHeap(),0,dsb); diff -urN wine-20050830/dlls/dsound/capture.c wine-20050930/dlls/dsound/capture.c --- wine-20050830/dlls/dsound/capture.c 2005-08-30 10:56:35.000000000 +0200 +++ wine-20050930/dlls/dsound/capture.c 2005-09-12 17:14:07.000000000 +0200 @@ -266,7 +266,7 @@ device->state = STATE_STOPPED; InitializeCriticalSection( &(device->lock) ); - device->lock.DebugInfo->Spare[1] = (DWORD)"DSCAPTURE_lock"; + device->lock.DebugInfo->Spare[0] = (DWORD_PTR)"DSCAPTURE_lock"; *ppDevice = device; @@ -308,7 +308,7 @@ if (GetDeviceID(&DSDEVID_DefaultCapture, &guid) == DS_OK) { for (wid = 0; wid < devs; ++wid) { if (IsEqualGUID( &guid, &DSOUND_capture_guids[wid] ) ) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", "Primary Sound Capture Driver",desc.szDrvname,lpContext); @@ -321,7 +321,7 @@ } for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", debugstr_guid(&DSOUND_capture_guids[wid]),desc.szDesc,desc.szDrvname,lpContext); @@ -370,7 +370,7 @@ if (GetDeviceID(&DSDEVID_DefaultCapture, &guid) == DS_OK) { for (wid = 0; wid < devs; ++wid) { if (IsEqualGUID( &guid, &DSOUND_capture_guids[wid] ) ) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", "Primary Sound Capture Driver",desc.szDrvname,lpContext); @@ -387,7 +387,7 @@ } for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", debugstr_guid(&DSOUND_capture_guids[wid]),desc.szDesc,desc.szDrvname,lpContext); @@ -509,7 +509,7 @@ } HeapFree(GetProcessHeap(), 0, device->pwfx); - device->lock.DebugInfo->Spare[1] = 0; + device->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection( &(device->lock) ); DSOUND_capture[device->drvdesc.dnDevNode] = NULL; HeapFree(GetProcessHeap(), 0, device); @@ -681,7 +681,7 @@ This->device = device; device->guid = devGUID; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&(This->device->driver),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&(This->device->driver),0)); if ( (err != DS_OK) && (err != DSERR_UNSUPPORTED) ) { WARN("waveInMessage failed; err=%lx\n",err); return err; @@ -896,7 +896,7 @@ flags |= WAVE_DIRECTSOUND; err = mmErr(waveInOpen(&(ipDSC->device->hwi), ipDSC->device->drvdesc.dnDevNode, ipDSC->device->pwfx, - (DWORD)DSOUND_capture_callback, (DWORD)ipDSC->device, flags)); + (DWORD_PTR)DSOUND_capture_callback, (DWORD)ipDSC->device, flags)); if (err != DS_OK) { WARN("waveInOpen failed\n"); This->dsound->device->capture_buffer = 0; @@ -986,8 +986,8 @@ if (TRACE_ON(dsound)) { unsigned int i; for (i=0;idscb->hwnotify) { diff -urN wine-20050830/dlls/dsound/dsound.c wine-20050930/dlls/dsound/dsound.c --- wine-20050830/dlls/dsound/dsound.c 2005-07-15 11:58:36.000000000 +0200 +++ wine-20050930/dlls/dsound/dsound.c 2005-09-12 17:14:07.000000000 +0200 @@ -468,7 +468,7 @@ } /* FIXME: hack to make sure we have a secondary buffer */ - if ((DWORD)((SecondaryBufferImpl *)psb)->dsb == (DWORD)This) { + if ((IDirectSoundImpl *)((SecondaryBufferImpl *)psb)->dsb == This) { WARN("trying to duplicate primary buffer\n"); *ppdsb = NULL; return DSERR_INVALIDCALL; @@ -545,13 +545,13 @@ CopyMemory(dsb->pwfx, pdsb->pwfx, size); InitializeCriticalSection(&(dsb->lock)); - dsb->lock.DebugInfo->Spare[1] = (DWORD)"DSOUNDBUFFER_lock"; + dsb->lock.DebugInfo->Spare[0] = (DWORD_PTR)"DSOUNDBUFFER_lock"; /* register buffer */ hres = DSOUND_AddBuffer(This, dsb); if (hres != DS_OK) { IDirectSoundBuffer8_Release(psb); - dsb->lock.DebugInfo->Spare[1] = 0; + dsb->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&(dsb->lock)); HeapFree(GetProcessHeap(),0,dsb->buffer); HeapFree(GetProcessHeap(),0,dsb->pwfx); @@ -575,7 +575,7 @@ DWORD level) { IDirectSoundImpl *This = (IDirectSoundImpl *)iface; - TRACE("(%p,%08lx,%s)\n",This,(DWORD)hwnd,dumpCooperativeLevel(level)); + TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level)); if (level==DSSCL_PRIORITY || level==DSSCL_EXCLUSIVE) { WARN("level=%s not fully supported\n", @@ -711,7 +711,7 @@ device->guid = devGUID; /* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */ - waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&device->driver, 0); + waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&device->driver, 0); /* Disable the direct sound driver to force emulation if requested. */ if (ds_hw_accel == DS_HW_ACCEL_EMULATION) @@ -744,7 +744,7 @@ hr = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, device->pwfx, - (DWORD)DSOUND_callback, (DWORD)device, + (DWORD_PTR)DSOUND_callback, (DWORD)device, flags)); if (hr != DS_OK) { WARN("waveOutOpen failed\n"); @@ -817,7 +817,7 @@ DSOUND_renderer[device->drvdesc.dnDevNode] = device; timeBeginPeriod(DS_TIME_RES); DSOUND_renderer[device->drvdesc.dnDevNode]->timerID = timeSetEvent(DS_TIME_DEL, DS_TIME_RES, DSOUND_timer, - (DWORD)DSOUND_renderer[device->drvdesc.dnDevNode], TIME_PERIODIC | TIME_CALLBACK_FUNCTION); + (DWORD_PTR)DSOUND_renderer[device->drvdesc.dnDevNode], TIME_PERIODIC | TIME_CALLBACK_FUNCTION); } else { WARN("DSOUND_PrimaryCreate failed\n"); } @@ -931,7 +931,7 @@ device->pwfx->cbSize = 0; InitializeCriticalSection(&(device->mixlock)); - device->mixlock.DebugInfo->Spare[1] = (DWORD)"DSOUND_mixlock"; + device->mixlock.DebugInfo->Spare[0] = (DWORD_PTR)"DSOUND_mixlock"; RtlInitializeResource(&(device->buffer_list_lock)); @@ -989,7 +989,7 @@ HeapFree(GetProcessHeap(),0,device->tmp_buffer); HeapFree(GetProcessHeap(),0,device->buffer); RtlDeleteResource(&device->buffer_list_lock); - device->mixlock.DebugInfo->Spare[1] = 0; + device->mixlock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&device->mixlock); HeapFree(GetProcessHeap(),0,device); TRACE("(%p) released\n", device); @@ -1170,7 +1170,7 @@ DWORD level) { IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; - TRACE("(%p,%08lx,%s)\n",This,(DWORD)hwnd,dumpCooperativeLevel(level)); + TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level)); return IDirectSoundImpl_SetCooperativeLevel(This->pds,hwnd,level); } @@ -1409,7 +1409,7 @@ DWORD level) { IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; - TRACE("(%p,%08lx,%s)\n",This,(DWORD)hwnd,dumpCooperativeLevel(level)); + TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level)); return IDirectSoundImpl_SetCooperativeLevel(This->pds,hwnd,level); } @@ -1570,7 +1570,7 @@ DWORD level) { IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; - TRACE("(%p,%08lx,%s)\n",This,(DWORD)hwnd,dumpCooperativeLevel(level)); + TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level)); return IDirectSoundImpl_SetCooperativeLevel(This->pds,hwnd,level); } diff -urN wine-20050830/dlls/dsound/dsound_main.c wine-20050930/dlls/dsound/dsound_main.c --- wine-20050830/dlls/dsound/dsound_main.c 2005-08-15 12:48:51.000000000 +0200 +++ wine-20050930/dlls/dsound/dsound_main.c 2005-09-12 17:14:07.000000000 +0200 @@ -316,7 +316,7 @@ if (GetDeviceID(&DSDEVID_DefaultPlayback, &guid) == DS_OK) { for (wod = 0; wod < devs; ++wod) { if (IsEqualGUID( &guid, &DSOUND_renderer_guids[wod]) ) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", "Primary Sound Driver",desc.szDrvname,lpContext); @@ -329,7 +329,7 @@ } for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", debugstr_guid(&DSOUND_renderer_guids[wod]),desc.szDesc,desc.szDrvname,lpContext); @@ -377,7 +377,7 @@ if (GetDeviceID(&DSDEVID_DefaultPlayback, &guid) == DS_OK) { for (wod = 0; wod < devs; ++wod) { if (IsEqualGUID( &guid, &DSOUND_renderer_guids[wod] ) ) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", "Primary Sound Driver",desc.szDrvname,lpContext); @@ -394,7 +394,7 @@ } for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", debugstr_guid(&DSOUND_renderer_guids[wod]),desc.szDesc,desc.szDrvname,lpContext); diff -urN wine-20050830/dlls/dsound/duplex.c wine-20050930/dlls/dsound/duplex.c --- wine-20050830/dlls/dsound/duplex.c 2005-06-02 12:28:34.000000000 +0200 +++ wine-20050930/dlls/dsound/duplex.c 2005-09-12 12:30:06.000000000 +0200 @@ -91,9 +91,9 @@ LPUNKNOWN pUnkOuter) { IDirectSoundFullDuplexImpl** ippDSFD=(IDirectSoundFullDuplexImpl**)ppDSFD; - TRACE("(%s,%s,%p,%p,%lx,%lx,%p,%p,%p,%p)\n", debugstr_guid(pcGuidCaptureDevice), + TRACE("(%s,%s,%p,%p,%p,%lx,%p,%p,%p,%p)\n", debugstr_guid(pcGuidCaptureDevice), debugstr_guid(pcGuidRenderDevice), pcDSCBufferDesc, pcDSBufferDesc, - (DWORD)hWnd, dwLevel, ppDSFD, ppDSCBuffer8, ppDSBuffer8, pUnkOuter); + hWnd, dwLevel, ppDSFD, ppDSCBuffer8, ppDSBuffer8, pUnkOuter); if ( pUnkOuter ) { WARN("pUnkOuter != 0\n"); @@ -114,7 +114,7 @@ This->lpVtbl = &dsfdvt; InitializeCriticalSection( &(This->lock) ); - This->lock.DebugInfo->Spare[1] = (DWORD)"DSDUPLEX_lock"; + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)"DSDUPLEX_lock"; hres = IDirectSoundFullDuplexImpl_Initialize( (LPDIRECTSOUNDFULLDUPLEX)This, pcGuidCaptureDevice, pcGuidRenderDevice, @@ -161,7 +161,7 @@ TRACE("(%p) ref was %ld\n", This, ref - 1); if (!ref) { - This->lock.DebugInfo->Spare[1] = 0; + This->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection( &(This->lock) ); HeapFree( GetProcessHeap(), 0, This ); TRACE("(%p) released\n", This); @@ -185,8 +185,8 @@ IDirectSoundCaptureBufferImpl** ippdscb=(IDirectSoundCaptureBufferImpl**)lplpDirectSoundCaptureBuffer8; IDirectSoundBufferImpl** ippdsc=(IDirectSoundBufferImpl**)lplpDirectSoundBuffer8; - FIXME( "(%p,%s,%s,%p,%p,%lx,%lx,%p,%p) stub!\n", This, debugstr_guid(pCaptureGuid), - debugstr_guid(pRendererGuid), lpDscBufferDesc, lpDsBufferDesc, (DWORD)hWnd, dwLevel, + FIXME( "(%p,%s,%s,%p,%p,%p,%lx,%p,%p) stub!\n", This, debugstr_guid(pCaptureGuid), + debugstr_guid(pRendererGuid), lpDscBufferDesc, lpDsBufferDesc, hWnd, dwLevel, ippdscb, ippdsc); return E_FAIL; diff -urN wine-20050830/dlls/dsound/primary.c wine-20050930/dlls/dsound/primary.c --- wine-20050830/dlls/dsound/primary.c 2005-08-30 10:56:35.000000000 +0200 +++ wine-20050930/dlls/dsound/primary.c 2005-09-12 17:14:07.000000000 +0200 @@ -264,7 +264,7 @@ waveOutClose(device->hwo); device->hwo = 0; err = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, - device->pwfx, (DWORD)DSOUND_callback, (DWORD)device, + device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD)device, flags)); if (err == DS_OK) { err = IDsDriver_CreateSoundBuffer(device->driver,device->pwfx, @@ -372,7 +372,7 @@ waveOutClose(device->hwo); device->hwo = 0; err = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, - device->pwfx, (DWORD)DSOUND_callback, (DWORD)device, + device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD)device, flags)); if (err == DS_OK) { err = DSOUND_PrimaryOpen(device); diff -urN wine-20050830/dlls/dsound/propset.c wine-20050930/dlls/dsound/propset.c --- wine-20050830/dlls/dsound/propset.c 2005-06-04 11:38:14.000000000 +0200 +++ wine-20050930/dlls/dsound/propset.c 2005-09-13 00:07:53.000000000 +0200 @@ -443,14 +443,14 @@ DSDRIVERDESC desc; ppd->WaveDeviceId = wod; ppd->Devnode = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA)); lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA)); MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -474,14 +474,14 @@ DSDRIVERDESC desc; ppd->WaveDeviceId = wid; ppd->Devnode = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSCDRIVER drv; lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA)); lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA)); MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -506,14 +506,14 @@ ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; ppd->Devnode = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA)); lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA)); MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -539,14 +539,14 @@ ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; ppd->WaveDeviceId = wid; ppd->Devnode = wid; - err = mmErr(waveInMessage((HWAVEIN)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA)); lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA)); MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) ); MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) ); - err = mmErr(waveInMessage((HWAVEIN)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveInMessage((HWAVEIN)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -619,7 +619,7 @@ if (IsEqualGUID( &dev_guid, &DSOUND_renderer_guids[wod] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -635,7 +635,7 @@ ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -668,7 +668,7 @@ if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -684,7 +684,7 @@ ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -716,7 +716,7 @@ TRACE("DSOUND_renderer_guids[%ld]\n", wod); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -732,7 +732,7 @@ ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -764,7 +764,7 @@ DSDRIVERDESC desc; TRACE("DSOUND_capture_guids[%ld]\n", wid); ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -780,7 +780,7 @@ ppd->Description = szDescription; ppd->Module = szModule; ppd->Interface = szInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -861,7 +861,7 @@ DSDRIVERDESC desc; TRACE("DSOUND_renderer_guids[%ld]\n", wod); ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -877,7 +877,7 @@ ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -910,7 +910,7 @@ if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) { DSDRIVERDESC desc; ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -926,7 +926,7 @@ ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -958,7 +958,7 @@ TRACE("DSOUND_renderer_guids[%ld]\n", wod); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSDRIVER drv = NULL; /* FIXME: this is a memory leak */ @@ -974,7 +974,7 @@ ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1006,7 +1006,7 @@ DSDRIVERDESC desc; TRACE("DSOUND_capture_guids[%ld]\n", wid); ppd->WaveDeviceId = wid; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&(desc),0)); if (err == DS_OK) { PIDSCDRIVER drv; /* FIXME: this is a memory leak */ @@ -1022,7 +1022,7 @@ ppd->Description = wDescription; ppd->Module = wModule; ppd->Interface = wInterface; - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0)); if (err == DS_OK && drv) ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1078,7 +1078,7 @@ devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; ZeroMemory(&data, sizeof(data)); @@ -1088,11 +1088,11 @@ lstrcpynA(data.DescriptionA, desc.szDesc, sizeof(data.DescriptionA)); lstrcpynA(data.ModuleA, desc.szDrvname, sizeof(data.ModuleA)); - MultiByteToWideChar( CP_ACP, 0, data.DescriptionA, -1, data.DescriptionW, sizeof(data.DescriptionW) ); - MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW) ); + MultiByteToWideChar( CP_ACP, 0, data.DescriptionA, -1, data.DescriptionW, sizeof(data.DescriptionW)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW)/sizeof(WCHAR) ); data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1105,7 +1105,7 @@ devs = waveInGetNumDevs(); for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { PIDSCDRIVER drv; ZeroMemory(&data, sizeof(data)); @@ -1115,11 +1115,11 @@ lstrcpynA(data.DescriptionA, desc.szDesc, sizeof(data.DescriptionA)); lstrcpynA(data.ModuleA, desc.szDrvname, sizeof(data.ModuleA)); - MultiByteToWideChar( CP_ACP, 0, data.DescriptionA, -1, data.DescriptionW, sizeof(data.DescriptionW) ); - MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW) ); + MultiByteToWideChar( CP_ACP, 0, data.DescriptionA, -1, data.DescriptionW, sizeof(data.DescriptionW)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW)/sizeof(WCHAR) ); data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1165,7 +1165,7 @@ devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { DWORD size; err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0)); @@ -1187,7 +1187,7 @@ data.Interface = szInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1206,7 +1206,7 @@ devs = waveInGetNumDevs(); for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { DWORD size; err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0)); @@ -1228,7 +1228,7 @@ data.Interface = szInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1280,7 +1280,7 @@ devs = waveOutGetNumDevs(); for (wod = 0; wod < devs; ++wod) { - err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200); WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200); @@ -1306,7 +1306,7 @@ data.Interface = wInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else @@ -1326,7 +1326,7 @@ devs = waveInGetNumDevs(); for (wid = 0; wid < devs; ++wid) { - err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0)); + err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0)); if (err == DS_OK) { WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200); WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200); @@ -1351,7 +1351,7 @@ data.Module = wModule; data.Interface = wInterface; data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED; - err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0)); + err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0)); if (err == DS_OK && drv) data.Type = DIRECTSOUNDDEVICE_TYPE_VXD; else diff -urN wine-20050830/dlls/dsound/tests/capture.c wine-20050930/dlls/dsound/tests/capture.c --- wine-20050830/dlls/dsound/tests/capture.c 2005-06-21 22:53:14.000000000 +0200 +++ wine-20050930/dlls/dsound/tests/capture.c 2005-09-23 12:05:40.000000000 +0200 @@ -196,8 +196,12 @@ /* try the COM class factory method of creation with no device specified */ rc=CoCreateInstance(&CLSID_DirectSoundCapture, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSoundCapture, (void**)&dsco); - ok(rc==S_OK,"CoCreateInstance(CLSID_DirectSoundCapture) failed: %s\n", + ok(rc==S_OK||rc==REGDB_E_CLASSNOTREG,"CoCreateInstance(CLSID_DirectSoundCapture) failed: %s\n", DXGetErrorString8(rc)); + if (rc==REGDB_E_CLASSNOTREG) { + trace(" Class Not Registered\n"); + return; + } if (dsco) IDirectSoundCapture_test(dsco, FALSE, NULL); diff -urN wine-20050830/dlls/dsound/tests/ds3d.c wine-20050930/dlls/dsound/tests/ds3d.c --- wine-20050830/dlls/dsound/tests/ds3d.c 2005-07-15 18:34:04.000000000 +0200 +++ wine-20050930/dlls/dsound/tests/ds3d.c 2005-09-12 12:30:06.000000000 +0200 @@ -452,8 +452,8 @@ ok(rc==DS_OK && temp_buffer!=NULL, "IDirectSoundBuffer_QueryInterface() failed: %s\n", DXGetErrorString8(rc)); - ok(temp_buffer==dsbo,"COM interface broken: 0x%08lx != 0x%08lx\n", - (DWORD)temp_buffer,(DWORD)dsbo); + ok(temp_buffer==dsbo,"COM interface broken: %p != %p\n", + temp_buffer,dsbo); ref=IDirectSoundBuffer_Release(temp_buffer); ok(ref==1,"IDirectSoundBuffer_Release() has %d references, " "should have 1\n",ref); @@ -465,8 +465,8 @@ ok(rc==DS_OK && temp_buffer!=NULL, "IDirectSound3DBuffer_QueryInterface() failed: %s\n", DXGetErrorString8(rc)); - ok(temp_buffer==dsbo,"COM interface broken: 0x%08lx != 0x%08lx\n", - (DWORD)temp_buffer,(DWORD)dsbo); + ok(temp_buffer==dsbo,"COM interface broken: %p != %p\n", + temp_buffer,dsbo); ref=IDirectSoundBuffer_Release(temp_buffer); ok(ref==1,"IDirectSoundBuffer_Release() has %d references, " "should have 1\n",ref); @@ -762,8 +762,7 @@ getDSBCAPS(bufdesc.dwFlags),DXGetErrorString8(rc)); if (rc==DS_OK && secondary!=NULL) { if (!has_3d) { - DWORD refpan,pan; - LONG refvol,vol; + LONG refvol,vol,refpan,pan; /* Check the initial secondary buffer's volume and pan */ rc=IDirectSoundBuffer_GetVolume(secondary,&vol); @@ -1131,8 +1130,8 @@ "IDirectSoundBuffer_QueryInterface() failed: %s\n", DXGetErrorString8(rc)); ok(temp_buffer==primary, - "COM interface broken: 0x%08lx != 0x%08lx\n", - (DWORD)temp_buffer,(DWORD)primary); + "COM interface broken: %p != %p\n", + temp_buffer,primary); if (rc==DS_OK && temp_buffer!=NULL) { ref=IDirectSoundBuffer_Release(temp_buffer); ok(ref==1,"IDirectSoundBuffer_Release() has %d references, " @@ -1145,8 +1144,8 @@ "IDirectSoundBuffer_QueryInterface() failed: %s\n", DXGetErrorString8(rc)); ok(temp_buffer==primary, - "COM interface broken: 0x%08lx != 0x%08lx\n", - (DWORD)temp_buffer,(DWORD)primary); + "COM interface broken: %p != %p\n", + temp_buffer,primary); ref=IDirectSoundBuffer_Release(temp_buffer); ok(ref==1,"IDirectSoundBuffer_Release() has %d references, " "should have 1\n",ref); diff -urN wine-20050830/dlls/dsound/tests/ds3d8.c wine-20050930/dlls/dsound/tests/ds3d8.c --- wine-20050830/dlls/dsound/tests/ds3d8.c 2005-06-20 16:18:04.000000000 +0200 +++ wine-20050930/dlls/dsound/tests/ds3d8.c 2005-09-12 12:30:06.000000000 +0200 @@ -339,8 +339,8 @@ ok(rc==DS_OK && temp_buffer!=NULL, "IDirectSoundBuffer_QueryInterface() failed: %s\n", DXGetErrorString8(rc)); - ok(temp_buffer==dsbo,"COM interface broken: 0x%08lx != 0x%08lx\n", - (DWORD)temp_buffer,(DWORD)dsbo); + ok(temp_buffer==dsbo,"COM interface broken: %p != %p\n", + temp_buffer,dsbo); ref=IDirectSoundBuffer_Release(temp_buffer); ok(ref==1,"IDirectSoundBuffer_Release() has %d references, " "should have 1\n",ref); @@ -351,8 +351,8 @@ ok(rc==DS_OK && temp_buffer!=NULL, "IDirectSound3DBuffer_QueryInterface() failed: %s\n", DXGetErrorString8(rc)); - ok(temp_buffer==dsbo,"COM interface broken: 0x%08lx != 0x%08lx\n", - (DWORD)temp_buffer,(DWORD)dsbo); + ok(temp_buffer==dsbo,"COM interface broken: %p != %p\n", + temp_buffer,dsbo); ref=IDirectSoundBuffer_Release(temp_buffer); ok(ref==1,"IDirectSoundBuffer_Release() has %d references, " "should have 1\n",ref); @@ -656,8 +656,7 @@ getDSBCAPS(bufdesc.dwFlags),DXGetErrorString8(rc)); if (rc==DS_OK && secondary!=NULL) { if (!has_3d) { - DWORD refpan,pan; - LONG refvol,vol; + LONG refvol,vol,refpan,pan; /* Check the initial secondary buffer's volume and pan */ rc=IDirectSoundBuffer_GetVolume(secondary,&vol); @@ -1025,8 +1024,7 @@ ok(rc==DS_OK && temp_buffer!=NULL, "IDirectSoundBuffer_QueryInterface() failed: %s\n", DXGetErrorString8(rc)); - ok(temp_buffer==primary,"COM interface broken: 0x%08lx != " - "0x%08lx\n",(DWORD)temp_buffer,(DWORD)primary); + ok(temp_buffer==primary,"COM interface broken: %p != %p\n",temp_buffer,primary); if (rc==DS_OK && temp_buffer!=NULL) { ref=IDirectSoundBuffer_Release(temp_buffer); ok(ref==1,"IDirectSoundBuffer_Release() has %d references, " @@ -1038,8 +1036,7 @@ ok(rc==DS_OK && temp_buffer!=NULL, "IDirectSoundBuffer_QueryInterface() failed: %s\n", DXGetErrorString8(rc)); - ok(temp_buffer==primary,"COM interface broken: 0x%08lx != " - "0x%08lx\n",(DWORD)temp_buffer,(DWORD)primary); + ok(temp_buffer==primary,"COM interface broken: %p != %p\n",temp_buffer,primary); ref=IDirectSoundBuffer_Release(temp_buffer); ok(ref==1,"IDirectSoundBuffer_Release() has %d references, " "should have 1\n",ref); diff -urN wine-20050830/dlls/dsound/tests/dsound.c wine-20050930/dlls/dsound/tests/dsound.c --- wine-20050830/dlls/dsound/tests/dsound.c 2005-06-20 16:18:04.000000000 +0200 +++ wine-20050930/dlls/dsound/tests/dsound.c 2005-09-12 12:30:06.000000000 +0200 @@ -291,8 +291,7 @@ ref=IDirectSound_Release(dso1); ok(ref==0,"IDirectSound_Release() has %d references, should have " "0\n",ref); - ok(dso!=dso1,"DirectSound objects should be unique: " - "dso=0x%08lx,dso1=0x%08lx\n",(DWORD)dso,(DWORD)dso1); + ok(dso!=dso1,"DirectSound objects should be unique: dso=%p,dso1=%p\n",dso,dso1); } /* Release the first DirectSound object */ @@ -385,13 +384,13 @@ rc=IDirectSound_CreateSoundBuffer(dso,0,&primary,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0, "IDirectSound_CreateSoundBuffer() should have failed: rc=%s," - "dsbo=0x%lx\n",DXGetErrorString8(rc),(DWORD)primary); + "dsbo=%p\n",DXGetErrorString8(rc),primary); /* DSOUND: Error: Invalid buffer description pointer */ rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,0,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0, "IDirectSound_CreateSoundBuffer() should have failed: rc=%s," - "dsbo=0x%lx\n",DXGetErrorString8(rc),(DWORD)primary); + "dsbo=0x%p\n",DXGetErrorString8(rc),primary); ZeroMemory(&bufdesc, sizeof(bufdesc)); @@ -400,7 +399,7 @@ rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0, "IDirectSound_CreateSoundBuffer() should have failed: rc=%s," - "primary=0x%lx\n",DXGetErrorString8(rc),(DWORD)primary); + "primary=%p\n",DXGetErrorString8(rc),primary); /* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ diff -urN wine-20050830/dlls/dsound/tests/dsound8.c wine-20050930/dlls/dsound/tests/dsound8.c --- wine-20050830/dlls/dsound/tests/dsound8.c 2005-07-15 18:34:04.000000000 +0200 +++ wine-20050930/dlls/dsound/tests/dsound8.c 2005-09-12 12:30:06.000000000 +0200 @@ -306,7 +306,7 @@ ok(ref==0,"IDirectSound8_Release() has %d references, " "should have 0\n",ref); ok(dso!=dso1,"DirectSound8 objects should be unique: " - "dso=0x%08lx,dso1=0x%08lx\n",(DWORD)dso,(DWORD)dso1); + "dso=%p,dso1=%p\n",dso,dso1); } /* Release the first DirectSound8 object */ @@ -410,14 +410,14 @@ rc=IDirectSound8_CreateSoundBuffer(dso,0,&primary,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0, "IDirectSound8_CreateSoundBuffer() should have returned " - "DSERR_INVALIDPARAM, returned: rc=%s,dsbo=0x%lx\n", - DXGetErrorString8(rc),(DWORD)primary); + "DSERR_INVALIDPARAM, returned: rc=%s,dsbo=%p\n", + DXGetErrorString8(rc),primary); /* DSOUND: Error: Invalid buffer description pointer */ rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,0,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0, "IDirectSound8_CreateSoundBuffer() should have failed: rc=%s," - "dsbo=0x%lx\n",DXGetErrorString8(rc),(DWORD)primary); + "dsbo=%p\n",DXGetErrorString8(rc),primary); ZeroMemory(&bufdesc, sizeof(bufdesc)); @@ -426,7 +426,7 @@ rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); ok(rc==DSERR_INVALIDPARAM && primary==0, "IDirectSound8_CreateSoundBuffer() should have failed: rc=%s," - "primary=0x%lx\n",DXGetErrorString8(rc),(DWORD)primary); + "primary=%p\n",DXGetErrorString8(rc),primary); /* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ diff -urN wine-20050830/dlls/dsound/tests/propset.c wine-20050930/dlls/dsound/tests/propset.c --- wine-20050830/dlls/dsound/tests/propset.c 2005-06-20 16:18:04.000000000 +0200 +++ wine-20050930/dlls/dsound/tests/propset.c 2005-09-07 15:28:25.000000000 +0200 @@ -21,6 +21,7 @@ #define NONAMELESSSTRUCT #define NONAMELESSUNION +#define COBJMACROS #include #include "wine/test.h" @@ -209,12 +210,12 @@ /* direct sound doesn't have an IKsPropertySet */ /* DSOUND: Error: Invalid interface buffer */ - rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet, + rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)0); ok(rc==DSERR_INVALIDPARAM, "CreateInstance(IID_IKsPropertySet) should have " "returned DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc)); - rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet, + rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have " "returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc)); @@ -228,7 +229,7 @@ goto error; /* direct sound 8 doesn't have an IKsPropertySet */ - rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet, + rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have " "returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc)); @@ -244,7 +245,7 @@ goto error; /* direct sound capture doesn't have an IKsPropertySet */ - rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet, + rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have " "returned E_NOINTERFACE,returned: %s\n",DXGetErrorString8(rc)); @@ -260,7 +261,7 @@ goto error; /* direct sound capture 8 doesn't have an IKsPropertySet */ - rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet, + rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have " "returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc)); @@ -276,7 +277,7 @@ goto error; /* direct sound full duplex doesn't have an IKsPropertySet */ - rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet, + rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have " "returned NOINTERFACE, returned: %s\n",DXGetErrorString8(rc)); @@ -291,7 +292,7 @@ goto error; /* direct sound private does have an IKsPropertySet */ - rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet, + rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet, (void **)(&pps)); ok(rc==DS_OK, "CreateInstance(IID_IKsPropertySet) failed: %s\n", DXGetErrorString8(rc)); @@ -299,7 +300,7 @@ goto error; /* test generic DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION */ - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION, &support); ok(rc==DS_OK||rc==E_INVALIDARG, @@ -320,7 +321,7 @@ "support = 0x%lx\n",support); /* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 */ - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1, &support); ok(rc==DS_OK||rc==E_INVALIDARG, @@ -341,7 +342,7 @@ "support = 0x%lx\n",support); /* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A */ - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A, &support); ok(rc==DS_OK||rc==E_INVALIDARG, @@ -362,7 +363,7 @@ "support = 0x%lx\n",support); /* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W */ - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W, &support); ok(rc==DS_OK||rc==E_INVALIDARG, @@ -383,7 +384,7 @@ "support = 0x%lx\n",support); /* test generic DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING */ - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, " "DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING) failed: %s\n", @@ -399,7 +400,7 @@ "0x%lx\n",support); /* test DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A */ - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, " "DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A) failed: %s\n", @@ -415,7 +416,7 @@ "0x%lx\n",support); /* test DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W */ - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, " "DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W) failed: %s\n", @@ -432,7 +433,7 @@ /* test generic DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE */ trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE ***\n"); - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, " @@ -454,7 +455,7 @@ data.Callback = callback; data.Context = 0; - rc = pps->lpVtbl->Get(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE, NULL, 0, &data, sizeof(data), &bytes); ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc); @@ -462,7 +463,7 @@ /* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 */ trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 ***\n"); - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, " @@ -484,7 +485,7 @@ data.Callback = callback1; data.Context = 0; - rc = pps->lpVtbl->Get(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1, NULL, 0, &data, sizeof(data), &bytes); ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc); @@ -492,7 +493,7 @@ /* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A */ trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A ***\n"); - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, " @@ -514,7 +515,7 @@ data.Callback = callbackA; data.Context = 0; - rc = pps->lpVtbl->Get(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A, NULL, 0, &data, sizeof(data), &bytes); ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc); @@ -522,7 +523,7 @@ /* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W */ trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W ***\n"); - rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W, &support); ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, " @@ -544,7 +545,7 @@ data.Callback = callbackW; data.Context = 0; - rc = pps->lpVtbl->Get(pps, &DSPROPSETID_DirectSoundDevice, + rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W, NULL, 0, &data, sizeof(data), &bytes); ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc); diff -urN wine-20050830/dlls/dswave/.cvsignore wine-20050930/dlls/dswave/.cvsignore --- wine-20050830/dlls/dswave/.cvsignore 2005-07-26 17:52:58.000000000 +0200 +++ wine-20050930/dlls/dswave/.cvsignore 2005-09-29 12:36:05.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dswave.dll.dbg.c version.res diff -urN wine-20050830/dlls/dxdiagn/.cvsignore wine-20050930/dlls/dxdiagn/.cvsignore --- wine-20050830/dlls/dxdiagn/.cvsignore 2005-07-26 17:52:58.000000000 +0200 +++ wine-20050930/dlls/dxdiagn/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -dxdiagn.dll.dbg.c version.res diff -urN wine-20050830/dlls/dxerr8/.cvsignore wine-20050930/dlls/dxerr8/.cvsignore --- wine-20050830/dlls/dxerr8/.cvsignore 2004-03-10 00:25:57.000000000 +0100 +++ wine-20050930/dlls/dxerr8/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,2 +1 @@ Makefile -libdxerr8.a.dbg.c diff -urN wine-20050830/dlls/dxerr8/Makefile.in wine-20050930/dlls/dxerr8/Makefile.in --- wine-20050830/dlls/dxerr8/Makefile.in 2005-08-25 14:14:13.000000000 +0200 +++ wine-20050930/dlls/dxerr8/Makefile.in 2005-09-28 20:34:00.000000000 +0200 @@ -7,8 +7,6 @@ C_SRCS = \ dxerr8.c -EXTRA_OBJS = $(MODULE).dbg.o - @MAKE_IMPLIB_RULES@ ### Dependencies: diff -urN wine-20050830/dlls/dxerr8/errors.awk wine-20050930/dlls/dxerr8/errors.awk --- wine-20050830/dlls/dxerr8/errors.awk 2004-03-10 00:25:57.000000000 +0100 +++ wine-20050930/dlls/dxerr8/errors.awk 2005-09-23 12:08:57.000000000 +0200 @@ -40,7 +40,10 @@ i = 1 len = length(array[word]) + 1 while (i < len) { - printf "'%s',", substr(array[word],i,1) + if (substr(array[word],i,1) == "\'") + printf "'\\''," + else + printf "'%s',", substr(array[word],i,1) i++ } if (word < NF ) diff -urN wine-20050830/dlls/dxerr9/.cvsignore wine-20050930/dlls/dxerr9/.cvsignore --- wine-20050830/dlls/dxerr9/.cvsignore 2004-03-10 00:25:57.000000000 +0100 +++ wine-20050930/dlls/dxerr9/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,2 +1 @@ Makefile -libdxerr9.a.dbg.c diff -urN wine-20050830/dlls/dxerr9/Makefile.in wine-20050930/dlls/dxerr9/Makefile.in --- wine-20050830/dlls/dxerr9/Makefile.in 2005-08-25 14:14:13.000000000 +0200 +++ wine-20050930/dlls/dxerr9/Makefile.in 2005-09-28 20:34:00.000000000 +0200 @@ -7,8 +7,6 @@ C_SRCS = \ dxerr9.c -EXTRA_OBJS = $(MODULE).dbg.o - @MAKE_IMPLIB_RULES@ ### Dependencies: diff -urN wine-20050830/dlls/dxerr9/errors.awk wine-20050930/dlls/dxerr9/errors.awk --- wine-20050830/dlls/dxerr9/errors.awk 2004-03-10 00:25:57.000000000 +0100 +++ wine-20050930/dlls/dxerr9/errors.awk 2005-09-23 12:08:57.000000000 +0200 @@ -40,7 +40,10 @@ i = 1 len = length(array[word]) + 1 while (i < len) { - printf "'%s',", substr(array[word],i,1) + if (substr(array[word],i,1) == "\'") + printf "'\\''," + else + printf "'%s',", substr(array[word],i,1) i++ } if (word < NF ) diff -urN wine-20050830/dlls/dxguid/dxguid.c wine-20050930/dlls/dxguid/dxguid.c --- wine-20050830/dlls/dxguid/dxguid.c 2004-07-22 21:40:44.000000000 +0200 +++ wine-20050930/dlls/dxguid/dxguid.c 2005-09-26 18:41:26.000000000 +0200 @@ -44,3 +44,4 @@ #include "dinput.h" #include "ddrawi.h" #include "dxfile.h" +#include "d3drm.h" diff -urN wine-20050830/dlls/gdi/.cvsignore wine-20050930/dlls/gdi/.cvsignore --- wine-20050830/dlls/gdi/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/gdi/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,8 +1,4 @@ Makefile -dispdib.spec.c -gdi.exe.spec.c -gdi32.dll.dbg.c libgdi32.def version.res version16.res -wing.spec.c diff -urN wine-20050830/dlls/gdi/Makefile.in wine-20050930/dlls/gdi/Makefile.in --- wine-20050830/dlls/gdi/Makefile.in 2005-05-09 16:42:34.000000000 +0200 +++ wine-20050930/dlls/gdi/Makefile.in 2005-09-21 16:23:54.000000000 +0200 @@ -71,8 +71,8 @@ # Special rules for 16-bit resource and spec files -gdi.exe.spec.c: gdi.exe.spec version16.res - $(WINEBUILD) $(DEFS) $(DLLFLAGS) --dll -o $@ --heap 65520 --main-module $(MODULE) --res version16.res --export $(SRCDIR)/gdi.exe.spec +gdi.exe.spec.o: gdi.exe.spec version16.res + $(WINEBUILD) $(WINEBUILDFLAGS) --dll -o $@ --heap 65520 --main-module $(MODULE) --res version16.res --export $(SRCDIR)/gdi.exe.spec version16.res: version16.rc $(LDPATH) $(RC16) $(RC16FLAGS) -fo$@ $(SRCDIR)/version16.rc diff -urN wine-20050830/dlls/gdi/brush.c wine-20050930/dlls/gdi/brush.c --- wine-20050830/dlls/gdi/brush.c 2004-11-24 19:09:20.000000000 +0100 +++ wine-20050930/dlls/gdi/brush.c 2005-09-12 13:19:56.000000000 +0200 @@ -119,14 +119,14 @@ ptr->logbrush.lbStyle = BS_PATTERN; /* fall through */ case BS_PATTERN: - ptr->logbrush.lbHatch = (LONG)BITMAP_CopyBitmap( (HBITMAP) ptr->logbrush.lbHatch ); + ptr->logbrush.lbHatch = (ULONG_PTR)BITMAP_CopyBitmap( (HBITMAP) ptr->logbrush.lbHatch ); if (!ptr->logbrush.lbHatch) goto error; break; case BS_DIBPATTERNPT: ptr->logbrush.lbStyle = BS_DIBPATTERN; - ptr->logbrush.lbHatch = (LONG)dib_copy( (BITMAPINFO *) ptr->logbrush.lbHatch, - ptr->logbrush.lbColor); + ptr->logbrush.lbHatch = (ULONG_PTR)dib_copy( (BITMAPINFO *) ptr->logbrush.lbHatch, + ptr->logbrush.lbColor); if (!ptr->logbrush.lbHatch) goto error; break; @@ -247,7 +247,7 @@ logbrush.lbStyle = BS_DIBPATTERN; logbrush.lbColor = coloruse; - logbrush.lbHatch = (LONG)hbitmap; + logbrush.lbHatch = (ULONG_PTR)hbitmap; return CreateBrushIndirect( &logbrush ); } @@ -284,7 +284,7 @@ logbrush.lbStyle = BS_DIBPATTERNPT; logbrush.lbColor = coloruse; - logbrush.lbHatch = (LONG) data; + logbrush.lbHatch = (ULONG_PTR)data; return CreateBrushIndirect( &logbrush ); } diff -urN wine-20050830/dlls/gdi/driver.c wine-20050930/dlls/gdi/driver.c --- wine-20050830/dlls/gdi/driver.c 2005-08-08 17:03:42.000000000 +0200 +++ wine-20050930/dlls/gdi/driver.c 2005-09-09 12:19:45.000000000 +0200 @@ -53,7 +53,7 @@ { 0, 0, &driver_section, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": driver_section") } + 0, 0, { (DWORD_PTR)(__FILE__ ": driver_section") } }; static CRITICAL_SECTION driver_section = { &critsect_debug, -1, 0, 0, 0, 0 }; diff -urN wine-20050830/dlls/gdi/enhmetafile.c wine-20050930/dlls/gdi/enhmetafile.c --- wine-20050830/dlls/gdi/enhmetafile.c 2005-07-05 14:49:14.000000000 +0200 +++ wine-20050930/dlls/gdi/enhmetafile.c 2005-09-12 13:19:56.000000000 +0200 @@ -873,8 +873,11 @@ case EMR_CREATEBRUSHINDIRECT: { PEMRCREATEBRUSHINDIRECT pBrush = (PEMRCREATEBRUSHINDIRECT) mr; - (handletable->objectHandle)[pBrush->ihBrush] = - CreateBrushIndirect(&pBrush->lb); + LOGBRUSH brush; + brush.lbStyle = pBrush->lb.lbStyle; + brush.lbColor = pBrush->lb.lbColor; + brush.lbHatch = pBrush->lb.lbHatch; + (handletable->objectHandle)[pBrush->ihBrush] = CreateBrushIndirect(&brush); break; } case EMR_EXTCREATEFONTINDIRECTW: diff -urN wine-20050830/dlls/gdi/enhmfdrv/objects.c wine-20050930/dlls/gdi/enhmfdrv/objects.c --- wine-20050830/dlls/gdi/enhmfdrv/objects.c 2004-12-20 20:27:07.000000000 +0100 +++ wine-20050930/dlls/gdi/enhmfdrv/objects.c 2005-09-12 13:19:56.000000000 +0200 @@ -155,7 +155,9 @@ emr.emr.iType = EMR_CREATEBRUSHINDIRECT; emr.emr.nSize = sizeof(emr); emr.ihBrush = index = EMFDRV_AddHandle( dev, hBrush ); - emr.lb = logbrush; + emr.lb.lbStyle = logbrush.lbStyle; + emr.lb.lbColor = logbrush.lbColor; + emr.lb.lbHatch = logbrush.lbHatch; if(!EMFDRV_WriteRecord( dev, &emr.emr )) index = 0; diff -urN wine-20050830/dlls/gdi/font.c wine-20050930/dlls/gdi/font.c --- wine-20050830/dlls/gdi/font.c 2005-08-23 11:38:59.000000000 +0200 +++ wine-20050930/dlls/gdi/font.c 2005-09-28 12:14:45.000000000 +0200 @@ -1738,7 +1738,7 @@ { BOOL ret = FALSE; LPWSTR reordered_str = (LPWSTR)str; - const WORD *glyphs = NULL; + WORD *glyphs = NULL; UINT align = GetTextAlign( hdc ); POINT pt; TEXTMETRICW tm; @@ -1748,7 +1748,7 @@ SIZE sz; RECT rc; BOOL done_extents = FALSE; - INT width, xwidth, ywidth; + INT width, xwidth = 0, ywidth = 0; DWORD type; DC * dc = DC_GetDCUpdate( hdc ); @@ -1794,13 +1794,7 @@ lprect, debugstr_wn(str, count), count, lpDx); if(flags & ETO_GLYPH_INDEX) - glyphs = (const WORD*)reordered_str; - else if(dc->gdiFont) - { - glyphs = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WCHAR)); - GetGlyphIndicesW(hdc, reordered_str, count, (WORD*)glyphs, 0); - flags |= ETO_GLYPH_INDEX; - } + glyphs = reordered_str; if(lprect) TRACE("rect: %ld,%ld - %ld,%ld\n", lprect->left, lprect->top, lprect->right, @@ -1862,7 +1856,10 @@ dc->funcs->pExtTextOut(dc->physDev, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL); if(count == 0) + { + ret = TRUE; goto done; + } pt.x = x; pt.y = y; @@ -1891,7 +1888,7 @@ deltas[i] = tmpsz.cx; } - if (dc->breakExtra && reordered_str[i] == tm.tmBreakChar) + if (!(flags & ETO_GLYPH_INDEX) && dc->breakExtra && reordered_str[i] == tm.tmBreakChar) { deltas[i] = deltas[i] + dc->breakExtra; } @@ -1979,20 +1976,90 @@ } } - ret = dc->funcs->pExtTextOut(dc->physDev, x, y, (flags & ~ETO_OPAQUE), &rc, - (flags & ETO_GLYPH_INDEX) ? glyphs: reordered_str, count, deltas); + if(FontIsLinked(hdc) && !(flags & ETO_GLYPH_INDEX)) + { + HFONT orig_font = dc->hFont, cur_font; + UINT glyph; + INT span = 0, *offsets = NULL, i; - if (lf.lfUnderline || lf.lfStrikeOut) + glyphs = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WORD)); + for(i = 0; i < count; i++) + { + WineEngGetLinkedHFont(dc, reordered_str[i], &cur_font, &glyph); + if(cur_font != dc->hFont) + { + if(!offsets) + { + int j; + offsets = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*deltas)); + offsets[0] = 0; + if(!deltas) + { + SIZE tmpsz; + for(j = 1; j < count; j++) + { + GetTextExtentPointW(hdc, reordered_str + j - 1, 1, &tmpsz); + offsets[j] = offsets[j-1] + INTERNAL_XWSTODS(dc, tmpsz.cx); + } + } + else + { + for(j = 1; j < count; j++) + offsets[j] = offsets[j-1] + deltas[j]; + } + } + if(span) + { + dc->funcs->pExtTextOut(dc->physDev, x + offsets[i - span] * cosEsc, y - offsets[i - span] * sinEsc, + (flags & ~ETO_OPAQUE) | ETO_GLYPH_INDEX, &rc, + glyphs, span, deltas ? deltas + i - span : NULL); + span = 0; + } + SelectObject(hdc, cur_font); + } + glyphs[span++] = glyph; + + if(i == count - 1) + { + ret = dc->funcs->pExtTextOut(dc->physDev, x + (offsets ? offsets[count - span] * cosEsc : 0), + y - (offsets ? offsets[count - span] * sinEsc : 0), + (flags & ~ETO_OPAQUE) | ETO_GLYPH_INDEX, &rc, + glyphs, span, deltas ? deltas + count - span : NULL); + SelectObject(hdc, orig_font); + HeapFree(GetProcessHeap(), 0, offsets); + } + } + } + else + { + if(!(flags & ETO_GLYPH_INDEX) && dc->gdiFont) + { + glyphs = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WORD)); + GetGlyphIndicesW(hdc, reordered_str, count, glyphs, 0); + flags |= ETO_GLYPH_INDEX; + } + ret = dc->funcs->pExtTextOut(dc->physDev, x, y, (flags & ~ETO_OPAQUE), &rc, + glyphs ? glyphs : reordered_str, count, deltas); + } + +done: + HeapFree(GetProcessHeap(), 0, deltas); + if(glyphs != reordered_str) + HeapFree(GetProcessHeap(), 0, glyphs); + if(reordered_str != str) + HeapFree(GetProcessHeap(), 0, reordered_str); + + GDI_ReleaseObj( hdc ); + + if (ret && (lf.lfUnderline || lf.lfStrikeOut)) { int underlinePos, strikeoutPos; int underlineWidth, strikeoutWidth; - UINT nMetricsSize = GetOutlineTextMetricsW(hdc, 0, NULL); + UINT size = GetOutlineTextMetricsW(hdc, 0, NULL); OUTLINETEXTMETRICW* otm = NULL; - if(!nMetricsSize) + if(!size) { - TEXTMETRICW tm; - GetTextMetricsW(hdc, &tm); underlinePos = 0; underlineWidth = tm.tmAscent / 20 + 1; strikeoutPos = tm.tmAscent / 2; @@ -2000,57 +2067,97 @@ } else { - otm = HeapAlloc(GetProcessHeap(), 0, nMetricsSize); - if (!otm) goto done; - - GetOutlineTextMetricsW(hdc, nMetricsSize, otm); + otm = HeapAlloc(GetProcessHeap(), 0, size); + GetOutlineTextMetricsW(hdc, size, otm); underlinePos = otm->otmsUnderscorePosition; underlineWidth = otm->otmsUnderscoreSize; strikeoutPos = otm->otmsStrikeoutPosition; strikeoutWidth = otm->otmsStrikeoutSize; + HeapFree(GetProcessHeap(), 0, otm); } - if(lf.lfUnderline) + if (PATH_IsPathOpen(dc->path)) { - POINT pts[2], oldpt; - HPEN hpen = CreatePen(PS_SOLID, underlineWidth, dc->textColor); - hpen = SelectObject(hdc, hpen); - pts[0].x = x; - pts[0].y = y; - pts[1].x = x + xwidth; - pts[1].y = y - ywidth; - DPtoLP(hdc, pts, 2); - MoveToEx(hdc, pts[0].x - underlinePos * sinEsc, pts[0].y - underlinePos * cosEsc, &oldpt); - LineTo(hdc, pts[1].x - underlinePos * sinEsc, pts[1].y - underlinePos * cosEsc); - MoveToEx(hdc, oldpt.x, oldpt.y, NULL); - DeleteObject(SelectObject(hdc, hpen)); - } + POINT pts[5]; + HPEN hpen; + HBRUSH hbrush = CreateSolidBrush(GetTextColor(hdc)); - if(lf.lfStrikeOut) + hbrush = SelectObject(hdc, hbrush); + hpen = SelectObject(hdc, GetStockObject(NULL_PEN)); + + if (lf.lfUnderline) + { + pts[0].x = x - underlinePos * sinEsc; + pts[0].y = y - underlinePos * cosEsc; + pts[1].x = x + xwidth - underlinePos * sinEsc; + pts[1].y = y - ywidth - underlinePos * cosEsc; + pts[2].x = pts[1].x + underlineWidth * sinEsc; + pts[2].y = pts[1].y + underlineWidth * cosEsc; + pts[3].x = pts[0].x + underlineWidth * sinEsc; + pts[3].y = pts[0].y + underlineWidth * cosEsc; + pts[4].x = pts[0].x; + pts[4].y = pts[0].y; + DPtoLP(hdc, pts, 5); + Polygon(hdc, pts, 5); + } + + if (lf.lfStrikeOut) + { + pts[0].x = x - strikeoutPos * sinEsc; + pts[0].y = y - strikeoutPos * cosEsc; + pts[1].x = x + xwidth - strikeoutPos * sinEsc; + pts[1].y = y - ywidth - strikeoutPos * cosEsc; + pts[2].x = pts[1].x + strikeoutWidth * sinEsc; + pts[2].y = pts[1].y + strikeoutWidth * cosEsc; + pts[3].x = pts[0].x + strikeoutWidth * sinEsc; + pts[3].y = pts[0].y + strikeoutWidth * cosEsc; + pts[4].x = pts[0].x; + pts[4].y = pts[0].y; + DPtoLP(hdc, pts, 5); + Polygon(hdc, pts, 5); + } + + SelectObject(hdc, hpen); + hbrush = SelectObject(hdc, hbrush); + DeleteObject(hbrush); + } + else { POINT pts[2], oldpt; - HPEN hpen = CreatePen(PS_SOLID, strikeoutWidth, dc->textColor); - hpen = SelectObject(hdc, hpen); - pts[0].x = x; - pts[0].y = y; - pts[1].x = x + xwidth; - pts[1].y = y - ywidth; - DPtoLP(hdc, pts, 2); - MoveToEx(hdc, pts[0].x - strikeoutPos * sinEsc, pts[0].y - strikeoutPos * cosEsc, &oldpt); - LineTo(hdc, pts[1].x - strikeoutPos * sinEsc, pts[1].y - strikeoutPos * cosEsc); - MoveToEx(hdc, oldpt.x, oldpt.y, NULL); - DeleteObject(SelectObject(hdc, hpen)); + HPEN hpen; + + if (lf.lfUnderline) + { + hpen = CreatePen(PS_SOLID, underlineWidth, GetTextColor(hdc)); + hpen = SelectObject(hdc, hpen); + pts[0].x = x; + pts[0].y = y; + pts[1].x = x + xwidth; + pts[1].y = y - ywidth; + DPtoLP(hdc, pts, 2); + MoveToEx(hdc, pts[0].x - underlinePos * sinEsc, pts[0].y - underlinePos * cosEsc, &oldpt); + LineTo(hdc, pts[1].x - underlinePos * sinEsc, pts[1].y - underlinePos * cosEsc); + MoveToEx(hdc, oldpt.x, oldpt.y, NULL); + DeleteObject(SelectObject(hdc, hpen)); + } + + if (lf.lfStrikeOut) + { + hpen = CreatePen(PS_SOLID, strikeoutWidth, GetTextColor(hdc)); + hpen = SelectObject(hdc, hpen); + pts[0].x = x; + pts[0].y = y; + pts[1].x = x + xwidth; + pts[1].y = y - ywidth; + DPtoLP(hdc, pts, 2); + MoveToEx(hdc, pts[0].x - strikeoutPos * sinEsc, pts[0].y - strikeoutPos * cosEsc, &oldpt); + LineTo(hdc, pts[1].x - strikeoutPos * sinEsc, pts[1].y - strikeoutPos * cosEsc); + MoveToEx(hdc, oldpt.x, oldpt.y, NULL); + DeleteObject(SelectObject(hdc, hpen)); + } } } -done: - HeapFree(GetProcessHeap(), 0, deltas); - if(glyphs && glyphs != reordered_str) - HeapFree(GetProcessHeap(), 0, (WORD*)glyphs); - if(reordered_str != str) - HeapFree(GetProcessHeap(), 0, reordered_str); - - GDI_ReleaseObj( hdc ); return ret; } diff -urN wine-20050830/dlls/gdi/freetype.c wine-20050930/dlls/gdi/freetype.c --- wine-20050830/dlls/gdi/freetype.c 2005-08-19 11:58:32.000000000 +0200 +++ wine-20050930/dlls/gdi/freetype.c 2005-09-16 20:46:54.000000000 +0200 @@ -182,6 +182,7 @@ BOOL Italic; BOOL Bold; FONTSIGNATURE fs; + FONTSIGNATURE fs_links; FT_Fixed font_version; BOOL scalable; Bitmap_Size size; /* set if face is a bitmap */ @@ -219,6 +220,13 @@ HFONT hfont; } HFONTLIST; +typedef struct { + struct list entry; + char *file_name; + INT index; + GdiFont font; +} CHILD_FONT; + struct tagGdiFont { struct list entry; FT_Face ft_face; @@ -239,13 +247,24 @@ SHORT yMin; OUTLINETEXTMETRICW *potm; FONTSIGNATURE fs; + GdiFont base_font; + struct list child_fonts; + LONG ppem; }; +typedef struct { + struct list entry; + WCHAR *font_name; + struct list links; +} SYSTEM_LINKS; + #define INIT_GM_SIZE 128 static struct list gdi_font_list = LIST_INIT(gdi_font_list); static struct list unused_gdi_font_list = LIST_INIT(unused_gdi_font_list); #define UNUSED_CACHE_SIZE 10 +static struct list child_font_list = LIST_INIT(child_font_list); +static struct list system_links = LIST_INIT(system_links); static struct list font_list = LIST_INIT(font_list); @@ -431,12 +450,14 @@ } if(!FT_IS_SFNT(ft_face) && (FT_IS_SCALABLE(ft_face) || !(flags & ADDFONT_FORCE_BITMAP))) { /* for now we'll accept TT/OT or bitmap fonts*/ + WARN("Ignoring font %s\n", debugstr_a(file)); pFT_Done_Face(ft_face); return FALSE; } /* There are too many bugs in FreeType < 2.1.9 for bitmap font support */ if(!FT_IS_SCALABLE(ft_face) && FT_SimpleVersion < ((2 << 16) | (1 << 8) | (9 << 0))) { + WARN("FreeType version < 2.1.9, skipping bitmap font %s\n", debugstr_a(file)); pFT_Done_Face(ft_face); return FALSE; } @@ -564,6 +585,7 @@ face->family = family; face->external = (flags & ADDFONT_EXTERNAL_FONT) ? TRUE : FALSE; memcpy(&face->fs, &fs, sizeof(face->fs)); + memset(&face->fs_links, 0, sizeof(face->fs_links)); if(FT_IS_SCALABLE(ft_face)) { memset(&face->size, 0, sizeof(face->size)); @@ -635,6 +657,49 @@ return; } +static Face *find_face_from_filename(const WCHAR *name) +{ + Family *family; + Face *face; + char *file; + DWORD len = WideCharToMultiByte(CP_UNIXCP, 0, name, -1, NULL, 0, NULL, NULL); + char *nameA = HeapAlloc(GetProcessHeap(), 0, len); + Face *ret = NULL; + + WideCharToMultiByte(CP_UNIXCP, 0, name, -1, nameA, len, NULL, NULL); + TRACE("looking for %s\n", debugstr_a(nameA)); + + LIST_FOR_EACH_ENTRY(family, &font_list, Family, entry) + { + LIST_FOR_EACH_ENTRY(face, &family->faces, Face, entry) + { + file = strrchr(face->file, '/'); + if(!file) + file = face->file; + else + file++; + if(!strcmp(file, nameA)) + ret = face; + break; + } + } + HeapFree(GetProcessHeap(), 0, nameA); + return ret; +} + +static Family *find_family_from_name(const WCHAR *name) +{ + Family *family; + + LIST_FOR_EACH_ENTRY(family, &font_list, Family, entry) + { + if(!strcmpiW(family->FamilyName, name)) + return family; + } + + return NULL; +} + static void DumpSubstList(void) { FontSubst *psub; @@ -649,7 +714,7 @@ return; } -static LPWSTR strdupW(LPWSTR p) +static LPWSTR strdupW(LPCWSTR p) { LPWSTR ret; DWORD len = (strlenW(p) + 1) * sizeof(WCHAR); @@ -658,6 +723,15 @@ return ret; } +static LPSTR strdupA(LPCSTR p) +{ + LPSTR ret; + DWORD len = (strlen(p) + 1); + ret = HeapAlloc(GetProcessHeap(), 0, len); + memcpy(ret, p, len); + return ret; +} + static void split_subst_info(NameCs *nc, LPSTR str) { CHAR *p = strrchr(str, ','); @@ -776,7 +850,7 @@ &dlen) == ERROR_SUCCESS) { TRACE("Got %s=%s\n", debugstr_a(value), debugstr_a(data)); /* "NewName"="Oldname" */ - if(!MultiByteToWideChar(CP_ACP, 0, data, -1, old_nameW, sizeof(old_nameW))) + if(!MultiByteToWideChar(CP_ACP, 0, data, -1, old_nameW, sizeof(old_nameW)/sizeof(WCHAR))) break; /* Find the old family and hence all of the font files @@ -804,6 +878,136 @@ } } +/************************************************************* + * init_system_links + */ +static BOOL init_system_links(void) +{ + static const WCHAR system_link[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s',' ','N','T','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','F','o','n','t','L','i','n','k','\\', + 'S','y','s','t','e','m','L','i','n','k',0}; + HKEY hkey; + BOOL ret = FALSE; + DWORD type, max_val, max_data, val_len, data_len, index; + WCHAR *value, *data; + WCHAR *entry, *next; + SYSTEM_LINKS *font_link, *system_font_link; + CHILD_FONT *child_font; + static const WCHAR Tahoma[] = {'T','a','h','o','m','a',0}; + static const WCHAR tahoma_ttf[] = {'t','a','h','o','m','a','.','t','t','f',0}; + static const WCHAR System[] = {'S','y','s','t','e','m',0}; + FONTSIGNATURE fs; + Family *family; + Face *face; + + if(RegOpenKeyW(HKEY_LOCAL_MACHINE, system_link, &hkey) == ERROR_SUCCESS) + { + RegQueryInfoKeyW(hkey, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &max_val, &max_data, NULL, NULL); + value = HeapAlloc(GetProcessHeap(), 0, (max_val + 1) * sizeof(WCHAR)); + data = HeapAlloc(GetProcessHeap(), 0, max_data); + val_len = max_val + 1; + data_len = max_data; + index = 0; + while(RegEnumValueW(hkey, index++, value, &val_len, NULL, &type, (LPBYTE)data, &data_len) == ERROR_SUCCESS) + { + TRACE("%s:\n", debugstr_w(value)); + + memset(&fs, 0, sizeof(fs)); + font_link = HeapAlloc(GetProcessHeap(), 0, sizeof(*font_link)); + font_link->font_name = strdupW(value); + list_init(&font_link->links); + for(entry = data; (char*)entry < (char*)data + data_len && *entry != 0; entry = next) + { + WCHAR *face_name; + INT index; + CHILD_FONT *child_font; + + TRACE("\t%s\n", debugstr_w(entry)); + + next = entry + strlenW(entry) + 1; + + face_name = strchrW(entry, ','); + if(!face_name) + index = 0; + else + { + FIXME("don't yet handle ttc's correctly in linking. Assuming index 0\n"); + *face_name++ = 0; + while(isspaceW(*face_name)) + face_name++; + + index = 0; + } + face = find_face_from_filename(entry); + if(!face) + { + TRACE("Unable to find file %s\n", debugstr_w(entry)); + continue; + } + + child_font = HeapAlloc(GetProcessHeap(), 0, sizeof(*child_font)); + child_font->file_name = strdupA(face->file); + child_font->index = index; + child_font->font = NULL; + fs.fsCsb[0] |= face->fs.fsCsb[0]; + fs.fsCsb[1] |= face->fs.fsCsb[1]; + list_add_tail(&font_link->links, &child_font->entry); + } + family = find_family_from_name(font_link->font_name); + if(family) + { + LIST_FOR_EACH_ENTRY(face, &family->faces, Face, entry) + { + memcpy(&face->fs_links, &fs, sizeof(fs)); + } + } + list_add_tail(&system_links, &font_link->entry); + val_len = max_val + 1; + data_len = max_data; + } + + HeapFree(GetProcessHeap(), 0, value); + HeapFree(GetProcessHeap(), 0, data); + RegCloseKey(hkey); + } + + /* Explicitly add an entry for the system font, this links to Tahoma and any links + that Tahoma has */ + + system_font_link = HeapAlloc(GetProcessHeap(), 0, sizeof(*system_font_link)); + system_font_link->font_name = strdupW(System); + list_init(&system_font_link->links); + + face = find_face_from_filename(tahoma_ttf); + if(face) + { + child_font = HeapAlloc(GetProcessHeap(), 0, sizeof(*child_font)); + child_font->file_name = strdupA(face->file); + child_font->index = 0; + child_font->font = NULL; + list_add_tail(&system_font_link->links, &child_font->entry); + } + LIST_FOR_EACH_ENTRY(font_link, &system_links, SYSTEM_LINKS, entry) + { + if(!strcmpiW(font_link->font_name, Tahoma)) + { + CHILD_FONT *font_link_entry; + LIST_FOR_EACH_ENTRY(font_link_entry, &font_link->links, CHILD_FONT, entry) + { + CHILD_FONT *new_child; + new_child = HeapAlloc(GetProcessHeap(), 0, sizeof(*new_child)); + new_child->file_name = strdupA(font_link_entry->file_name); + new_child->index = font_link_entry->index; + new_child->font = NULL; + list_add_tail(&system_font_link->links, &new_child->entry); + } + break; + } + } + list_add_tail(&system_links, &system_font_link->entry); + return ret; +} static BOOL ReadFontDir(const char *dirname, BOOL external_fonts) { @@ -992,6 +1196,7 @@ externalkey = 0; RegDeleteKeyW(HKEY_CURRENT_USER, external_fonts_reg_key); + /* @@ Wine registry key: HKCU\Software\Wine\Fonts\ExternalFonts */ if(RegCreateKeyExW(HKEY_CURRENT_USER, external_fonts_reg_key, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &externalkey, NULL) != ERROR_SUCCESS) { ERR("Can't create external font reg key\n"); @@ -1072,6 +1277,169 @@ return TRUE; } +static const struct nls_update_font_list +{ + UINT ansi_cp, oem_cp; + const char *oem, *fixed, *system; + const char *courier, *serif, *small, *sserif; +} nls_update_font_list[] = +{ + /* Latin 1 (United States) */ + { 1252, 437, "vgaoem.fon", "vgafix.fon", "vgasys.fon", + "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", + }, + /* Latin 1 (Multilingual) */ + { 1252, 850, "vga850.fon", "vgafix.fon", "vgasys.fon", + "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", + }, + /* Eastern Europe */ + { 1250, 852, "vga852.fon", "vgafixe.fon", "vgasyse.fon", + "couree.fon", "serifee.fon", "smallee.fon", "sserifee.fon", + }, + /* Cyrillic */ + { 1251, 866, "vga866.fon", "vgafixr.fon", "vgasysr.fon", + "courer.fon", "serifer.fon", "smaller.fon", "sserifer.fon", + }, + /* Greek */ + { 1253, 737, "vga869.fon", "vgafixg.fon", "vgasysg.fon", + "coureg.fon", "serifeg.fon", "smalleg.fon", "sserifeg.fon", + }, + /* Turkish */ + { 1254, 857, "vga857.fon", "vgafixt.fon", "vgasyst.fon", + "couret.fon", "serifet.fon", "smallet.fon", "sserifet.fon", + }, + /* Hebrew */ + { 1255, 862, "vgaoem.fon", "vgaf1255.fon", "vgas1255.fon", + "coue1255.fon", "sere1255.fon", "smae1255.fon", "ssee1255.fon", + }, + /* Arabic */ + { 1256, 720, "vgaoem.fon", "vgaf1256.fon", "vgas1256.fon", + "coue1256.fon", "sere1256.fon", "smae1256.fon", "ssee1256.fon", + }, + /* Baltic */ + { 1257, 775, "vga775.fon", "vgaf1257.fon", "vgas1257.fon", + "coue1257.fon", "sere1257.fon", "smae1257.fon", "ssee1257.fon", + }, + /* Vietnamese */ + { 1258, 1258, "vga850.fon", "vgafix.fon", "vgasys.fon", + "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", + }, + /* Thai */ + { 874, 874, "vga850.fon", "vgaf874.fon", "vgas874.fon", + "coure.fon", "serife.fon", "smalle.fon", "ssee874.fon", + }, + /* Japanese */ + { 932, 932, "vga932.fon", "jvgafix.fon", "jvgasys.fon", + "coure.fon", "serife.fon", "jsmalle.fon", "sserife.fon", + }, + /* Chinese Simplified */ + { 936, 936, "vga936.fon", "svgafix.fon", "svgasys.fon", + "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", + }, + /* Korean */ + { 949, 949, "vga949.fon", "hvgafix.fon", "hvgasys.fon", + "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", + }, + /* Chinese Traditional */ + { 950, 950, "vga950.fon", "cvgafix.fon", "cvgasys.fon", + "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", + } +}; + +inline static HKEY create_fonts_NT_registry_key(void) +{ + HKEY hkey = 0; + + RegCreateKeyExW(HKEY_LOCAL_MACHINE, winnt_font_reg_key, 0, NULL, + 0, KEY_ALL_ACCESS, NULL, &hkey, NULL); + return hkey; +} + +inline static HKEY create_fonts_9x_registry_key(void) +{ + HKEY hkey = 0; + + RegCreateKeyExW(HKEY_LOCAL_MACHINE, win9x_font_reg_key, 0, NULL, + 0, KEY_ALL_ACCESS, NULL, &hkey, NULL); + return hkey; +} + +inline static HKEY create_config_fonts_registry_key(void) +{ + HKEY hkey = 0; + + RegCreateKeyExW(HKEY_CURRENT_CONFIG, system_fonts_reg_key, 0, NULL, + 0, KEY_ALL_ACCESS, NULL, &hkey, NULL); + return hkey; +} + +static void add_font_list(HKEY hkey, const struct nls_update_font_list *fl) +{ + RegSetValueExA(hkey, "Courier", 0, REG_SZ, (const BYTE *)fl->courier, strlen(fl->courier)+1); + RegSetValueExA(hkey, "MS Serif", 0, REG_SZ, (const BYTE *)fl->serif, strlen(fl->serif)+1); + RegSetValueExA(hkey, "MS Sans Serif", 0, REG_SZ, (const BYTE *)fl->sserif, strlen(fl->sserif)+1); + RegSetValueExA(hkey, "Small Fonts", 0, REG_SZ, (const BYTE *)fl->small, strlen(fl->small)+1); +} + +static void update_font_info(void) +{ + char buf[80]; + DWORD len, type; + HKEY hkey = 0; + UINT i, ansi_cp = 0, oem_cp = 0; + LCID lcid = GetUserDefaultLCID(); + + if (RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Fonts", &hkey) != ERROR_SUCCESS) + return; + + len = sizeof(buf); + if (RegQueryValueExA(hkey, "Locale", 0, &type, (BYTE *)buf, &len) == ERROR_SUCCESS && type == REG_SZ) + { + if (strtoul(buf, NULL, 16 ) == lcid) /* already set correctly */ + { + RegCloseKey(hkey); + return; + } + TRACE("updating registry, locale changed %s -> %08lx\n", debugstr_a(buf), lcid); + } + else TRACE("updating registry, locale changed none -> %08lx\n", lcid); + + sprintf(buf, "%08lx", lcid); + RegSetValueExA(hkey, "Locale", 0, REG_SZ, (const BYTE *)buf, strlen(buf)+1); + RegCloseKey(hkey); + + GetLocaleInfoW(lcid, LOCALE_IDEFAULTANSICODEPAGE|LOCALE_RETURN_NUMBER|LOCALE_NOUSEROVERRIDE, + (WCHAR *)&ansi_cp, sizeof(ansi_cp)/sizeof(WCHAR)); + GetLocaleInfoW(lcid, LOCALE_IDEFAULTCODEPAGE|LOCALE_RETURN_NUMBER|LOCALE_NOUSEROVERRIDE, + (WCHAR *)&oem_cp, sizeof(oem_cp)/sizeof(WCHAR)); + + for (i = 0; i < sizeof(nls_update_font_list)/sizeof(nls_update_font_list[0]); i++) + { + if (nls_update_font_list[i].ansi_cp == ansi_cp && + nls_update_font_list[i].oem_cp == oem_cp) + { + HKEY hkey; + + hkey = create_config_fonts_registry_key(); + RegSetValueExA(hkey, "OEMFONT.FON", 0, REG_SZ, (const BYTE *)nls_update_font_list[i].oem, strlen(nls_update_font_list[i].oem)+1); + RegSetValueExA(hkey, "FIXED.FON", 0, REG_SZ, (const BYTE *)nls_update_font_list[i].fixed, strlen(nls_update_font_list[i].fixed)+1); + RegSetValueExA(hkey, "FONTS.FON", 0, REG_SZ, (const BYTE *)nls_update_font_list[i].system, strlen(nls_update_font_list[i].system)+1); + RegCloseKey(hkey); + + hkey = create_fonts_NT_registry_key(); + add_font_list(hkey, &nls_update_font_list[i]); + RegCloseKey(hkey); + + hkey = create_fonts_9x_registry_key(); + add_font_list(hkey, &nls_update_font_list[i]); + RegCloseKey(hkey); + + return; + } + } + FIXME("there is no font defaults for lcid %04lx/ansi_cp %u", lcid, ansi_cp); +} + /************************************************************* * WineEngInit * @@ -1090,6 +1458,9 @@ TRACE("\n"); + /* update locale dependent font info in registry */ + update_font_info(); + ft_handle = wine_dlopen(SONAME_LIBFREETYPE, RTLD_NOW, NULL, 0); if(!ft_handle) { WINE_MESSAGE( @@ -1263,6 +1634,8 @@ LoadReplaceList(); update_reg_entries(); + init_system_links(); + ReleaseMutex(font_mutex); return TRUE; sym_not_found: @@ -1323,8 +1696,8 @@ { FT_Error err; FT_Face ft_face; - LONG ppem; + TRACE("%s, %ld, %ld x %ld\n", debugstr_a(file), face_index, width, height); err = pFT_New_Face(library, file, face_index, &ft_face); if(err) { ERR("FT_New_Face rets %d\n", err); @@ -1336,13 +1709,14 @@ if(FT_IS_SCALABLE(ft_face)) { /* load the VDMX table if we have one */ - ppem = load_VDMX(font, height); - if(ppem == 0) - ppem = calc_ppem_for_height(ft_face, height); + font->ppem = load_VDMX(font, height); + if(font->ppem == 0) + font->ppem = calc_ppem_for_height(ft_face, height); - if((err = pFT_Set_Pixel_Sizes(ft_face, 0, ppem)) != 0) - WARN("FT_Set_Pixel_Sizes %d, %ld rets %x\n", 0, ppem, err); + if((err = pFT_Set_Pixel_Sizes(ft_face, 0, font->ppem)) != 0) + WARN("FT_Set_Pixel_Sizes %d, %ld rets %x\n", 0, font->ppem, err); } else { + font->ppem = height; if((err = pFT_Set_Pixel_Sizes(ft_face, width, height)) != 0) WARN("FT_Set_Pixel_Sizes %ld, %ld rets %x\n", width, height, err); } @@ -1393,11 +1767,32 @@ ret->potm = NULL; ret->font_desc.matrix.eM11 = ret->font_desc.matrix.eM22 = 1.0; list_init(&ret->hfontlist); + list_init(&ret->child_fonts); return ret; } static void free_font(GdiFont font) { + struct list *cursor, *cursor2; + + LIST_FOR_EACH_SAFE(cursor, cursor2, &font->child_fonts) + { + CHILD_FONT *child = LIST_ENTRY(cursor, CHILD_FONT, entry); + struct list *first_hfont; + HFONTLIST *hfontlist; + list_remove(cursor); + if(child->font) + { + first_hfont = list_head(&child->font->hfontlist); + hfontlist = LIST_ENTRY(first_hfont, HFONTLIST, entry); + DeleteObject(hfontlist->hfont); + HeapFree(GetProcessHeap(), 0, hfontlist); + free_font(child->font); + } + HeapFree(GetProcessHeap(), 0, child->file_name); + HeapFree(GetProcessHeap(), 0, child); + } + if (font->ft_face) pFT_Done_Face(font->ft_face); HeapFree(GetProcessHeap(), 0, font->potm); HeapFree(GetProcessHeap(), 0, font->name); @@ -1634,6 +2029,38 @@ return NULL; } + +/************************************************************* + * create_child_font_list + */ +static BOOL create_child_font_list(GdiFont font) +{ + BOOL ret = FALSE; + SYSTEM_LINKS *font_link; + CHILD_FONT *font_link_entry, *new_child; + + LIST_FOR_EACH_ENTRY(font_link, &system_links, SYSTEM_LINKS, entry) + { + if(!strcmpW(font_link->font_name, font->name)) + { + TRACE("found entry in system list\n"); + LIST_FOR_EACH_ENTRY(font_link_entry, &font_link->links, CHILD_FONT, entry) + { + new_child = HeapAlloc(GetProcessHeap(), 0, sizeof(*new_child)); + new_child->file_name = strdupA(font_link_entry->file_name); + new_child->index = font_link_entry->index; + new_child->font = NULL; + list_add_tail(&font->child_fonts, &new_child->entry); + TRACE("font %s %d\n", debugstr_a(new_child->file_name), new_child->index); + } + ret = TRUE; + break; + } + } + + return ret; +} + /************************************************************* * WineEngCreateFontInstance * @@ -1651,6 +2078,14 @@ CHARSETINFO csi; HFONTLIST *hflist; + LIST_FOR_EACH_ENTRY(ret, &child_font_list, struct tagGdiFont, entry) + { + struct list *first_hfont = list_head(&ret->hfontlist); + hflist = LIST_ENTRY(first_hfont, HFONTLIST, entry); + if(hflist->hfont == hfont) + return ret; + } + if (!GetObjectW( hfont, sizeof(lf), &lf )) return NULL; can_use_bitmap = GetDeviceCaps(dc->hSelf, TEXTCAPS) & TC_RA_ABLE; @@ -1666,11 +2101,16 @@ } TRACE("not in cache\n"); - if(list_empty(&font_list) || !have_installed_roman_font) /* No fonts installed */ + if(list_empty(&font_list)) /* No fonts installed */ { TRACE("No fonts installed\n"); return NULL; } + if(!have_installed_roman_font) + { + TRACE("No roman font installed\n"); + return NULL; + } ret = alloc_font(); @@ -1727,7 +2167,7 @@ if(!strcmpiW(family->FamilyName, lf.lfFaceName)) { LIST_FOR_EACH(face_elem_ptr, &family->faces) { face = LIST_ENTRY(face_elem_ptr, Face, entry); - if((csi.fs.fsCsb[0] & face->fs.fsCsb[0]) || !csi.fs.fsCsb[0]) + if((csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) || !csi.fs.fsCsb[0]) if(face->scalable || can_use_bitmap) goto found; } @@ -1763,7 +2203,7 @@ if(!strcmpiW(family->FamilyName, lf.lfFaceName)) { LIST_FOR_EACH(face_elem_ptr, &family->faces) { face = LIST_ENTRY(face_elem_ptr, Face, entry); - if(csi.fs.fsCsb[0] & face->fs.fsCsb[0]) + if(csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) if(face->scalable || can_use_bitmap) goto found; } @@ -1774,7 +2214,7 @@ family = LIST_ENTRY(family_elem_ptr, Family, entry); LIST_FOR_EACH(face_elem_ptr, &family->faces) { face = LIST_ENTRY(face_elem_ptr, Face, entry); - if(csi.fs.fsCsb[0] & face->fs.fsCsb[0]) + if(csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) if(face->scalable || can_use_bitmap) goto found; } @@ -1807,7 +2247,7 @@ LIST_FOR_EACH(face_elem_ptr, &family->faces) { face = LIST_ENTRY(face_elem_ptr, Face, entry); if(!(face->Italic ^ it) && !(face->Bold ^ bd) && - ((csi.fs.fsCsb[0] & face->fs.fsCsb[0]) || !csi.fs.fsCsb[0])) { + ((csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) || !csi.fs.fsCsb[0])) { if(face->scalable) break; if(height > 0) @@ -1831,7 +2271,7 @@ best = NULL; LIST_FOR_EACH(face_elem_ptr, &family->faces) { face = LIST_ENTRY(face_elem_ptr, Face, entry); - if((csi.fs.fsCsb[0] & face->fs.fsCsb[0]) || !csi.fs.fsCsb[0]) { + if((csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) || !csi.fs.fsCsb[0]) { if(face->scalable) break; if(height > 0) @@ -1894,6 +2334,7 @@ ret->name = strdupW(family->FamilyName); ret->underline = lf.lfUnderline ? 0xff : 0; ret->strikeout = lf.lfStrikeOut ? 0xff : 0; + create_child_font_list(ret); TRACE("caching: gdiFont=%p hfont=%p\n", ret, hfont); @@ -1936,6 +2377,18 @@ struct list *font_elem_ptr, *hfontlist_elem_ptr; int i = 0; + LIST_FOR_EACH_ENTRY(gdiFont, &child_font_list, struct tagGdiFont, entry) + { + struct list *first_hfont = list_head(&gdiFont->hfontlist); + hflist = LIST_ENTRY(first_hfont, HFONTLIST, entry); + if(hflist->hfont == handle) + { + TRACE("removing child font %p from child list\n", gdiFont); + list_remove(&gdiFont->entry); + return TRUE; + } + } + TRACE("destroying hfont=%p\n", handle); if(TRACE_ON(font)) dump_gdi_font_list(); @@ -2211,9 +2664,15 @@ { if(font->ft_face->charmap->encoding == FT_ENCODING_NONE) { WCHAR wc = (WCHAR)glyph; + BOOL default_used; + FT_UInt ret; char buf; - WideCharToMultiByte(font->codepage, 0, &wc, 1, &buf, sizeof(buf), 0, 0); - return pFT_Get_Char_Index(font->ft_face, (unsigned char)buf); + if(!WideCharToMultiByte(font->codepage, 0, &wc, 1, &buf, sizeof(buf), NULL, &default_used) || default_used) + ret = 0; + else + ret = pFT_Get_Char_Index(font->ft_face, (unsigned char)buf); + TRACE("%04x (%02x) -> ret %d def_used %d\n", glyph, buf, ret, default_used); + return ret; } if(font->charset == SYMBOL_CHARSET && glyph < 0x100) @@ -2812,7 +3271,7 @@ * sizeof(WCHAR); style_nameW = HeapAlloc(GetProcessHeap(), 0, lensty); MultiByteToWideChar(CP_ACP, 0, ft_face->style_name, -1, - style_nameW, lensty); + style_nameW, lensty/sizeof(WCHAR)); /* These names should be read from the TT name table */ @@ -3023,6 +3482,59 @@ return ret; } +static BOOL load_child_font(GdiFont font, CHILD_FONT *child) +{ + HFONTLIST *hfontlist; + child->font = alloc_font(); + child->font->ft_face = OpenFontFile(child->font, child->file_name, child->index, 0, -font->ppem); + if(!child->font->ft_face) + { + free_font(child->font); + child->font = NULL; + return FALSE; + } + + child->font->orientation = font->orientation; + hfontlist = HeapAlloc(GetProcessHeap(), 0, sizeof(*hfontlist)); + hfontlist->hfont = CreateFontIndirectW(&font->font_desc.lf); + list_add_head(&child->font->hfontlist, &hfontlist->entry); + child->font->base_font = font; + list_add_head(&child_font_list, &child->font->entry); + TRACE("created child font hfont %p for base %p child %p\n", hfontlist->hfont, font, child->font); + return TRUE; +} + +static BOOL get_glyph_index_linked(GdiFont font, UINT c, GdiFont *linked_font, FT_UInt *glyph) +{ + FT_UInt g; + CHILD_FONT *child_font; + + if(font->base_font) + font = font->base_font; + + *linked_font = font; + + if((*glyph = get_glyph_index(font, c))) + return TRUE; + + LIST_FOR_EACH_ENTRY(child_font, &font->child_fonts, CHILD_FONT, entry) + { + if(!child_font->font) + if(!load_child_font(font, child_font)) + continue; + + if(!child_font->font->ft_face) + continue; + g = get_glyph_index(child_font->font, c); + if(g) + { + *glyph = g; + *linked_font = child_font->font; + return TRUE; + } + } + return FALSE; +} /************************************************************* * WineEngGetCharWidth @@ -3034,14 +3546,15 @@ UINT c; GLYPHMETRICS gm; FT_UInt glyph_index; + GdiFont linked_font; TRACE("%p, %d, %d, %p\n", font, firstChar, lastChar, buffer); for(c = firstChar; c <= lastChar; c++) { - glyph_index = get_glyph_index(font, c); - WineEngGetGlyphOutline(font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, + get_glyph_index_linked(font, c, &linked_font, &glyph_index); + WineEngGetGlyphOutline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, NULL); - buffer[c - firstChar] = font->gm[glyph_index].adv; + buffer[c - firstChar] = linked_font->gm[glyph_index].adv; } return TRUE; } @@ -3056,6 +3569,7 @@ UINT c; GLYPHMETRICS gm; FT_UInt glyph_index; + GdiFont linked_font; TRACE("%p, %d, %d, %p\n", font, firstChar, lastChar, buffer); @@ -3063,13 +3577,13 @@ return FALSE; for(c = firstChar; c <= lastChar; c++) { - glyph_index = get_glyph_index(font, c); - WineEngGetGlyphOutline(font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, + get_glyph_index_linked(font, c, &linked_font, &glyph_index); + WineEngGetGlyphOutline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, NULL); - buffer[c - firstChar].abcA = font->gm[glyph_index].lsb; - buffer[c - firstChar].abcB = font->gm[glyph_index].bbx; - buffer[c - firstChar].abcC = font->gm[glyph_index].adv - font->gm[glyph_index].lsb - - font->gm[glyph_index].bbx; + buffer[c - firstChar].abcA = linked_font->gm[glyph_index].lsb; + buffer[c - firstChar].abcB = linked_font->gm[glyph_index].bbx; + buffer[c - firstChar].abcC = linked_font->gm[glyph_index].adv - linked_font->gm[glyph_index].lsb - + linked_font->gm[glyph_index].bbx; } return TRUE; } @@ -3085,6 +3599,7 @@ GLYPHMETRICS gm; TEXTMETRICW tm; FT_UInt glyph_index; + GdiFont linked_font; TRACE("%p, %s, %d, %p\n", font, debugstr_wn(wstr, count), count, size); @@ -3094,10 +3609,10 @@ size->cy = tm.tmHeight; for(idx = 0; idx < count; idx++) { - glyph_index = get_glyph_index(font, wstr[idx]); - WineEngGetGlyphOutline(font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, + get_glyph_index_linked(font, wstr[idx], &linked_font, &glyph_index); + WineEngGetGlyphOutline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, NULL); - size->cx += font->gm[glyph_index].adv; + size->cx += linked_font->gm[glyph_index].adv; } TRACE("return %ld,%ld\n", size->cx, size->cy); return TRUE; @@ -3201,6 +3716,42 @@ return font->charset; } +BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) +{ + GdiFont font = dc->gdiFont, linked_font; + struct list *first_hfont; + BOOL ret; + + ret = get_glyph_index_linked(font, c, &linked_font, glyph); + TRACE("get_glyph_index_linked glyph %d font %p\n", *glyph, linked_font); + if(font == linked_font) + *new_hfont = dc->hFont; + else + { + first_hfont = list_head(&linked_font->hfontlist); + *new_hfont = LIST_ENTRY(first_hfont, struct tagHFONTLIST, entry)->hfont; + } + + return ret; +} + + +/************************************************************* + * FontIsLinked + */ +BOOL WINAPI FontIsLinked(HDC hdc) +{ + DC *dc = DC_GetDCPtr(hdc); + BOOL ret = FALSE; + + if(!dc) return FALSE; + if(dc->gdiFont && !list_empty(&dc->gdiFont->child_fonts)) + ret = TRUE; + GDI_ReleaseObj(hdc); + TRACE("returning %d\n", ret); + return ret; +} + #else /* HAVE_FREETYPE */ BOOL WineEngInit(void) @@ -3307,4 +3858,13 @@ return DEFAULT_CHARSET; } +BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) +{ + return FALSE; +} + +BOOL WINAPI FontIsLinked(HDC hdc) +{ + return FALSE; +} #endif /* HAVE_FREETYPE */ diff -urN wine-20050830/dlls/gdi/gdi16.c wine-20050930/dlls/gdi/gdi16.c --- wine-20050830/dlls/gdi/gdi16.c 2005-04-16 13:18:43.000000000 +0200 +++ wine-20050930/dlls/gdi/gdi16.c 2005-09-06 16:12:17.000000000 +0200 @@ -646,11 +646,24 @@ rc16->bottom = rc.bottom; return ret; } + /* Escape(hdc,DRAWPATTERNRECT,PRECT_STRUCT*,NULL); */ + case DRAWPATTERNRECT: + { + DRAWPATRECT pr; + DRAWPATRECT16 *pr16 = (DRAWPATRECT16*)MapSL(in_data); + + pr.ptPosition.x = pr16->ptPosition.x; + pr.ptPosition.y = pr16->ptPosition.y; + pr.ptSize.x = pr16->ptSize.x; + pr.ptSize.y = pr16->ptSize.y; + pr.wStyle = pr16->wStyle; + pr.wPattern = pr16->wPattern; + return Escape( HDC_32(hdc), escape, sizeof(pr), (LPCSTR)&pr, NULL ); + } /* Escape(hdc,ABORTDOC,NULL,NULL); */ /* Escape(hdc,BANDINFO,BANDINFOSTRUCT*,BANDINFOSTRUCT*); */ /* Escape(hdc,BEGIN_PATH,NULL,NULL); */ - /* Escape(hdc,DRAWPATTERNRECT,PRECT_STRUCT*,NULL); */ /* Escape(hdc,ENDDOC,NULL,NULL); */ /* Escape(hdc,END_PATH,PATHINFO,NULL); */ /* Escape(hdc,EXTTEXTOUT,EXTTEXT_STRUCT*,NULL); */ @@ -674,7 +687,6 @@ case ABORTDOC: case BANDINFO: case BEGIN_PATH: - case DRAWPATTERNRECT: case ENDDOC: case END_PATH: case EXTTEXTOUT: diff -urN wine-20050830/dlls/gdi/gdi32.spec wine-20050930/dlls/gdi/gdi32.spec --- wine-20050830/dlls/gdi/gdi32.spec 2005-08-15 11:45:40.000000000 +0200 +++ wine-20050930/dlls/gdi/gdi32.spec 2005-09-07 15:26:49.000000000 +0200 @@ -125,7 +125,7 @@ @ stdcall FixBrushOrgEx(long long long ptr) @ stdcall FlattenPath(long) @ stdcall FloodFill(long long long long) -# @ stub FontIsLinked +@ stdcall FontIsLinked(long) @ stdcall FrameRgn(long long long long long) @ stub FreeImageColorMatcher # @ stub GdiAddFontResourceW diff -urN wine-20050830/dlls/gdi/gdi_private.h wine-20050930/dlls/gdi/gdi_private.h --- wine-20050830/dlls/gdi/gdi_private.h 2005-08-23 11:38:59.000000000 +0200 +++ wine-20050930/dlls/gdi/gdi_private.h 2005-09-07 15:26:49.000000000 +0200 @@ -366,6 +366,7 @@ extern DWORD WineEngGetGlyphOutline(GdiFont, UINT glyph, UINT format, LPGLYPHMETRICS, DWORD buflen, LPVOID buf, const MAT2*); +extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph); extern UINT WineEngGetOutlineTextMetrics(GdiFont, UINT, LPOUTLINETEXTMETRICW); extern UINT WineEngGetTextCharsetInfo(GdiFont font, LPFONTSIGNATURE fs, DWORD flags); extern BOOL WineEngGetTextExtentPoint(GdiFont, LPCWSTR, INT, LPSIZE); @@ -431,3 +432,5 @@ /* Undocumented value for DIB's iUsage: Indicates a mono DIB w/o pal enties */ #define DIB_PAL_MONO 2 #endif /* __WINE_GDI_PRIVATE_H */ + +BOOL WINAPI FontIsLinked(HDC); diff -urN wine-20050830/dlls/gdi/gdiobj.c wine-20050930/dlls/gdi/gdiobj.c --- wine-20050830/dlls/gdi/gdiobj.c 2005-06-14 13:53:39.000000000 +0200 +++ wine-20050930/dlls/gdi/gdiobj.c 2005-09-13 17:00:33.000000000 +0200 @@ -72,7 +72,7 @@ { 0, 0, &GDI_level.crst, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": GDI_level") } + 0, 0, { (DWORD_PTR)(__FILE__ ": GDI_level") } }; static SYSLEVEL GDI_level = { { &critsect_debug, -1, 0, 0, 0, 0 }, 3 }; @@ -1357,7 +1357,7 @@ DWORD WINAPI GdiSeeGdiDo16( WORD wReqType, WORD wParam1, WORD wParam2, WORD wParam3 ) { - DWORD ret = ~0UL; + DWORD ret = ~0U; switch (wReqType) { diff -urN wine-20050830/dlls/gdi/printdrv.c wine-20050930/dlls/gdi/printdrv.c --- wine-20050830/dlls/gdi/printdrv.c 2005-07-05 13:02:37.000000000 +0200 +++ wine-20050930/dlls/gdi/printdrv.c 2005-09-12 12:30:06.000000000 +0200 @@ -635,7 +635,7 @@ int nRet = SP_ERROR; PPRINTJOB pPrintJob = NULL; - TRACE("%04x %08lx %04x\n", hJob, (DWORD)lpData, cch); + TRACE("%04x %p %04x\n", hJob, lpData, cch); pPrintJob = FindPrintJobFromHandle(hJob); if (pPrintJob != NULL && pPrintJob->fd >= 0 && cch) diff -urN wine-20050830/dlls/gdi/tests/bitmap.c wine-20050930/dlls/gdi/tests/bitmap.c --- wine-20050830/dlls/gdi/tests/bitmap.c 2005-06-27 13:09:52.000000000 +0200 +++ wine-20050930/dlls/gdi/tests/bitmap.c 2005-09-09 17:20:05.000000000 +0200 @@ -451,7 +451,7 @@ 10, 10, 300, 300, NULL, NULL, NULL, NULL); assert(hWnd); - is_win9x = GetWindowLongW(hWnd, GWL_WNDPROC) == 0; + is_win9x = GetWindowLongPtrW(hWnd, GWLP_WNDPROC) == 0; DestroyWindow(hWnd); test_createdibitmap(); diff -urN wine-20050830/dlls/gdi/tests/metafile.c wine-20050930/dlls/gdi/tests/metafile.c --- wine-20050830/dlls/gdi/tests/metafile.c 2005-08-08 17:03:42.000000000 +0200 +++ wine-20050930/dlls/gdi/tests/metafile.c 2005-09-12 13:19:56.000000000 +0200 @@ -412,8 +412,8 @@ orig_lb->lbStyle = BS_PATTERN; orig_lb->lbColor = RGB(0, 0, 0); - orig_lb->lbHatch = (INT) CreateBitmap (8, 8, 1, 1, SAMPLE_PATTERN_BRUSH); - ok((HBITMAP *)orig_lb->lbHatch != NULL, "CreateBitmap error %ld.\n", GetLastError()); + orig_lb->lbHatch = (ULONG_PTR)CreateBitmap (8, 8, 1, 1, SAMPLE_PATTERN_BRUSH); + ok((HBITMAP)orig_lb->lbHatch != NULL, "CreateBitmap error %ld.\n", GetLastError()); hBrush = CreateBrushIndirect (orig_lb); ok(hBrush != 0, "CreateBrushIndirect error %ld\n", GetLastError()); @@ -437,7 +437,7 @@ ok( ret, "DeleteMetaFile error %ld\n", GetLastError()); ret = DeleteObject(hBrush); ok( ret, "DeleteObject(HBRUSH) error %ld\n", GetLastError()); - ret = DeleteObject((HBITMAP *)orig_lb->lbHatch); + ret = DeleteObject((HBITMAP)orig_lb->lbHatch); ok( ret, "DeleteObject(HBITMAP) error %ld\n", GetLastError()); HeapFree (GetProcessHeap(), 0, orig_lb); diff -urN wine-20050830/dlls/glu32/.cvsignore wine-20050930/dlls/glu32/.cvsignore --- wine-20050830/dlls/glu32/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/glu32/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -glu32.dll.dbg.c libglu32.def diff -urN wine-20050830/dlls/glut32/.cvsignore wine-20050930/dlls/glut32/.cvsignore --- wine-20050830/dlls/glut32/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/glut32/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -glut32.dll.dbg.c libglut32.def diff -urN wine-20050830/dlls/hhctrl.ocx/.cvsignore wine-20050930/dlls/hhctrl.ocx/.cvsignore --- wine-20050830/dlls/hhctrl.ocx/.cvsignore 2005-08-02 16:55:11.000000000 +0200 +++ wine-20050930/dlls/hhctrl.ocx/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -hhctrl.ocx.dbg.c hhctrl.res diff -urN wine-20050830/dlls/hhctrl.ocx/Fi.rc wine-20050930/dlls/hhctrl.ocx/Fi.rc --- wine-20050830/dlls/hhctrl.ocx/Fi.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/hhctrl.ocx/Fi.rc 2005-09-12 13:10:04.000000000 +0200 @@ -0,0 +1,58 @@ +/* + * HTML Help resources + * Finnish Language Support + * + * Copyright 2005 Kimmo Myllyvirta + * + * 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 + */ + +LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + IDS_CONTENTS "&Sisällys" + IDS_INDEX "&Hakemisto" + IDS_SEARCH "&Etsi" + IDS_FAVORITES "S&uosikit" +END + +STRINGTABLE +BEGIN + IDTB_EXPAND "Näytä" + IDTB_CONTRACT "Piilota" + IDTB_STOP "Pysäytä" + IDTB_REFRESH "Päivitä" + IDTB_BACK "Takaisin" + IDTB_HOME "Alkuun" + IDTB_SYNC "Synkronoi" + IDTB_PRINT "Tulosta" + IDTB_OPTIONS "Valinnat" + IDTB_FORWARD "Seuraava" + IDTB_NOTES "IDTB_NOTES" + IDTB_BROWSE_FWD "IDTB_BROWSE_FWD" + IDTB_BROWSE_BACK "IDT_BROWSE_BACK" + IDTB_CONTENTS "IDTB_CONTENTS" + IDTB_INDEX "IDTB_INDEX" + IDTB_SEARCH "IDTB_SEARCH" + IDTB_HISTORY "IDTB_HISTORY" + IDTB_FAVORITES "IDTB_FAVORITES" + IDTB_JUMP1 "Hyppää1" + IDTB_JUMP2 "Hyppää2" + IDTB_CUSTOMIZE "Räätälöi" + IDTB_ZOOM "Suurenna" + IDTB_TOC_NEXT "IDTB_TOC_NEXT" + IDTB_TOC_PREV "IDTB_TOC_PREV" +END diff -urN wine-20050830/dlls/hhctrl.ocx/Makefile.in wine-20050930/dlls/hhctrl.ocx/Makefile.in --- wine-20050830/dlls/hhctrl.ocx/Makefile.in 2005-08-02 16:55:11.000000000 +0200 +++ wine-20050930/dlls/hhctrl.ocx/Makefile.in 2005-09-13 12:32:47.000000000 +0200 @@ -3,13 +3,16 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = hhctrl.ocx -IMPORTS = advapi32 comctl32 shell32 ole32 user32 gdi32 kernel32 +IMPORTS = advapi32 comctl32 shell32 ole32 oleaut32 user32 gdi32 kernel32 +EXTRALIBS = -luuid C_SRCS = \ + chm.c \ help.c \ hhctrl.c \ main.c \ - regsvr.c + regsvr.c \ + webbrowser.c RC_SRCS = hhctrl.rc diff -urN wine-20050830/dlls/hhctrl.ocx/No.rc wine-20050930/dlls/hhctrl.ocx/No.rc --- wine-20050830/dlls/hhctrl.ocx/No.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/hhctrl.ocx/No.rc 2005-09-25 17:18:38.000000000 +0200 @@ -0,0 +1,58 @@ +/* + * HTML Help resources + * Norwegian Bokmål Language Support + * + * Copyright 2005 Alexander N. Sørnes + * + * 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 + */ + +LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL + +STRINGTABLE +BEGIN + IDS_CONTENTS "&Innhold" + IDS_INDEX "I&ndeks" + IDS_SEARCH "&Søk" + IDS_FAVORITES "Favor&itter" +END + +STRINGTABLE +BEGIN + IDTB_EXPAND "Vis" + IDTB_CONTRACT "Skjul" + IDTB_STOP "Stopp" + IDTB_REFRESH "Oppdater" + IDTB_BACK "Tilbake" + IDTB_HOME "Hjem" + IDTB_SYNC "Synkroniser" + IDTB_PRINT "Skriv ut" + IDTB_OPTIONS "Innstillinger" + IDTB_FORWARD "Fram" + IDTB_NOTES "IDTB_NOTES" + IDTB_BROWSE_FWD "IDTB_BROWSE_FWD" + IDTB_BROWSE_BACK "IDT_BROWSE_BACK" + IDTB_CONTENTS "IDTB_CONTENTS" + IDTB_INDEX "IDTB_INDEX" + IDTB_SEARCH "IDTB_SEARCH" + IDTB_HISTORY "IDTB_HISTORY" + IDTB_FAVORITES "IDTB_FAVORITES" + IDTB_JUMP1 "Jump1" + IDTB_JUMP2 "Jump2" + IDTB_CUSTOMIZE "Tilpass" + IDTB_ZOOM "Forstørr" + IDTB_TOC_NEXT "IDTB_TOC_NEXT" + IDTB_TOC_PREV "IDTB_TOC_PREV" +END diff -urN wine-20050830/dlls/hhctrl.ocx/chm.c wine-20050930/dlls/hhctrl.ocx/chm.c --- wine-20050830/dlls/hhctrl.ocx/chm.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/hhctrl.ocx/chm.c 2005-09-06 11:20:42.000000000 +0200 @@ -0,0 +1,186 @@ +/* + * CHM Utility API + * + * Copyright 2005 James Hawkins + * + * 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 + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winnls.h" +#include "winreg.h" +#include "ole2.h" +#include "htmlhelp.h" + +#include "initguid.h" +#include "chm.h" + +static LPWSTR CHM_ANSIToUnicode(LPCSTR ansi) +{ + LPWSTR unicode; + int count; + + count = MultiByteToWideChar(CP_ACP, 0, ansi, -1, NULL, 0); + unicode = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, ansi, -1, unicode, count); + + return unicode; +} + +/* Reads a string from the #STRINGS section in the CHM file */ +LPWSTR CHM_ReadString(CHMInfo *pChmInfo, DWORD dwOffset) +{ + LARGE_INTEGER liOffset; + IStorage *pStorage = pChmInfo->pStorage; + IStream *pStream; + DWORD cbRead; + ULONG iPos; + DWORD dwSize; + LPSTR szString; + LPWSTR stringW; + + const int CB_READ_BLOCK = 64; + static const WCHAR stringsW[] = {'#','S','T','R','I','N','G','S',0}; + + dwSize = CB_READ_BLOCK; + szString = HeapAlloc(GetProcessHeap(), 0, dwSize); + + if (FAILED(IStorage_OpenStream(pStorage, stringsW, NULL, STGM_READ, 0, &pStream))) + return NULL; + + liOffset.QuadPart = dwOffset; + + if (FAILED(IStream_Seek(pStream, liOffset, STREAM_SEEK_SET, NULL))) + { + IStream_Release(pStream); + return NULL; + } + + while (SUCCEEDED(IStream_Read(pStream, szString, CB_READ_BLOCK, &cbRead))) + { + if (!cbRead) + return NULL; + + for (iPos = 0; iPos < cbRead; iPos++) + { + if (!szString[iPos]) + { + stringW = CHM_ANSIToUnicode(szString); + HeapFree(GetProcessHeap(), 0, szString); + return stringW; + } + } + + dwSize *= 2; + szString = HeapReAlloc(GetProcessHeap(), 0, szString, dwSize); + szString += cbRead; + } + + /* didn't find a string */ + return NULL; +} + +/* Loads the HH_WINTYPE data from the CHM file + * + * FIXME: There may be more than one window type in the file, so + * add the ability to choose a certain window type + */ +BOOL CHM_LoadWinTypeFromCHM(CHMInfo *pChmInfo, HH_WINTYPEW *pHHWinType) +{ + LARGE_INTEGER liOffset; + IStorage *pStorage = pChmInfo->pStorage; + IStream *pStream; + HRESULT hr; + DWORD cbRead; + + static const WCHAR windowsW[] = {'#','W','I','N','D','O','W','S',0}; + + hr = IStorage_OpenStream(pStorage, windowsW, NULL, STGM_READ, 0, &pStream); + if (FAILED(hr)) + return FALSE; + + /* jump past the #WINDOWS header */ + liOffset.QuadPart = sizeof(DWORD) * 2; + + hr = IStream_Seek(pStream, liOffset, STREAM_SEEK_SET, NULL); + if (FAILED(hr)) goto done; + + /* read the HH_WINTYPE struct data */ + hr = IStream_Read(pStream, pHHWinType, sizeof(*pHHWinType), &cbRead); + if (FAILED(hr)) goto done; + + /* convert the #STRINGS offsets to actual strings */ + pHHWinType->pszType = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszType); + pHHWinType->pszCaption = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszCaption); + pHHWinType->pszToc = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszToc); + pHHWinType->pszIndex = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszIndex); + pHHWinType->pszFile = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszFile); + pHHWinType->pszHome = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszHome); + pHHWinType->pszJump1 = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszJump1); + pHHWinType->pszJump2 = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszJump2); + pHHWinType->pszUrlJump1 = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszUrlJump1); + pHHWinType->pszUrlJump2 = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszUrlJump2); + + /* FIXME: pszCustomTabs is a list of multiple zero-terminated strings so ReadString won't + * work in this case + */ +#if 0 + pHHWinType->pszCustomTabs = CHM_ReadString(pChmInfo, (DWORD)pHHWinType->pszCustomTabs); +#endif + +done: + IStream_Release(pStream); + + return SUCCEEDED(hr); +} + +/* Opens the CHM file for reading */ +BOOL CHM_OpenCHM(CHMInfo *pChmInfo, LPCWSTR szFile) +{ + pChmInfo->szFile = szFile; + + if (FAILED(CoCreateInstance(&CLSID_ITStorage, NULL, CLSCTX_INPROC_SERVER, + &IID_IITStorage, (void **) &pChmInfo->pITStorage))) + return FALSE; + + if (FAILED(IITStorage_StgOpenStorage(pChmInfo->pITStorage, szFile, NULL, + STGM_READ | STGM_SHARE_DENY_WRITE, + NULL, 0, &pChmInfo->pStorage))) + return FALSE; + + return TRUE; +} + +void CHM_CloseCHM(CHMInfo *pCHMInfo) +{ + IITStorage_Release(pCHMInfo->pITStorage); + IStorage_Release(pCHMInfo->pStorage); +} + +/* Creates a Url of a CHM file that can be used with WB_Navigate */ +void CHM_CreateITSUrl(CHMInfo *pChmInfo, LPCWSTR szIndex, LPWSTR szUrl) +{ + static const WCHAR formatW[] = { + 'i','t','s',':','%','s',':',':','%','s',0 + }; + + wsprintfW(szUrl, formatW, pChmInfo->szFile, szIndex); +} diff -urN wine-20050830/dlls/hhctrl.ocx/chm.h wine-20050930/dlls/hhctrl.ocx/chm.h --- wine-20050830/dlls/hhctrl.ocx/chm.h 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/hhctrl.ocx/chm.h 2005-09-06 11:20:42.000000000 +0200 @@ -0,0 +1,38 @@ +/* + * CHM Utility API + * + * Copyright 2005 James Hawkins + * + * 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 + */ + +#ifndef CHM_H +#define CHM_H + +#include "wine/itss.h" + +typedef struct CHMInfo +{ + IITStorage *pITStorage; + IStorage *pStorage; + LPCWSTR szFile; +} CHMInfo; + +BOOL CHM_OpenCHM(CHMInfo *pCHMInfo, LPCWSTR szFile); +BOOL CHM_LoadWinTypeFromCHM(CHMInfo *pCHMInfo, HH_WINTYPEW *pHHWinType); +void CHM_CloseCHM(CHMInfo *pCHMInfo); +void CHM_CreateITSUrl(CHMInfo *pCHMInfo, LPCWSTR szIndex, LPWSTR szUrl); + +#endif diff -urN wine-20050830/dlls/hhctrl.ocx/help.c wine-20050930/dlls/hhctrl.ocx/help.c --- wine-20050830/dlls/hhctrl.ocx/help.c 2005-08-15 12:21:56.000000000 +0200 +++ wine-20050930/dlls/hhctrl.ocx/help.c 2005-09-28 12:16:02.000000000 +0200 @@ -31,6 +31,10 @@ #include "wine/unicode.h" #include "resource.h" +#include "chm.h" +#include "webbrowser.h" + +static void Help_OnSize(HWND hWnd); /* Window type defaults */ @@ -38,14 +42,19 @@ #define WINTYPE_DEFAULT_Y 100 #define WINTYPE_DEFAULT_WIDTH 740 #define WINTYPE_DEFAULT_HEIGHT 640 -#define WINTYPE_DEFAULT_NAVWIDTH 251 +#define WINTYPE_DEFAULT_NAVWIDTH 250 + +static const WCHAR szEmpty[] = {0}; typedef struct tagHHInfo { HH_WINTYPEW *pHHWinType; + CHMInfo *pCHMInfo; + WBInfo *pWBInfo; HINSTANCE hInstance; LPWSTR szCmdLine; HWND hwndTabCtrl; + HWND hwndSizeBar; HFONT hFont; } HHInfo; @@ -78,14 +87,153 @@ return string; } +/* Size Bar */ + +#define SIZEBAR_WIDTH 4 + +static const WCHAR szSizeBarClass[] = { + 'H','H',' ','S','i','z','e','B','a','r',0 +}; + +/* Draw the SizeBar */ +static void SB_OnPaint(HWND hWnd) +{ + PAINTSTRUCT ps; + HDC hdc; + RECT rc; + + hdc = BeginPaint(hWnd, &ps); + + GetClientRect(hWnd, &rc); + + /* dark frame */ + rc.right += 1; + rc.bottom -= 1; + FrameRect(hdc, &rc, GetStockObject(GRAY_BRUSH)); + + /* white highlight */ + SelectObject(hdc, GetStockObject(WHITE_PEN)); + MoveToEx(hdc, rc.right, 1, NULL); + LineTo(hdc, 1, 1); + LineTo(hdc, 1, rc.bottom - 1); + + + MoveToEx(hdc, 0, rc.bottom, NULL); + LineTo(hdc, rc.right, rc.bottom); + + EndPaint(hWnd, &ps); +} + +static void SB_OnLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam) +{ + SetCapture(hWnd); +} + +static void SB_OnLButtonUp(HWND hWnd, WPARAM wParam, LPARAM lParam) +{ + HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA); + POINTS pt = MAKEPOINTS(lParam); + + /* update the window sizes */ + pHHInfo->pHHWinType->iNavWidth += pt.x; + Help_OnSize(hWnd); + + ReleaseCapture(); +} + +static void SB_OnMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam) +{ + /* ignore WM_MOUSEMOVE if not dragging the SizeBar */ + if (!(wParam & MK_LBUTTON)) + return; +} + +LRESULT CALLBACK SizeBar_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_LBUTTONDOWN: + SB_OnLButtonDown(hWnd, wParam, lParam); + break; + case WM_LBUTTONUP: + SB_OnLButtonUp(hWnd, wParam, lParam); + break; + case WM_MOUSEMOVE: + SB_OnMouseMove(hWnd, wParam, lParam); + break; + case WM_PAINT: + SB_OnPaint(hWnd); + break; + default: + return DefWindowProcW(hWnd, message, wParam, lParam); + } + + return 0; +} + +static void HH_RegisterSizeBarClass(HHInfo *pHHInfo) +{ + WNDCLASSEXW wcex; + + wcex.cbSize = sizeof(WNDCLASSEXW); + wcex.style = 0; + wcex.lpfnWndProc = (WNDPROC)SizeBar_WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = pHHInfo->hInstance; + wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); + wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_SIZEWE); + wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1); + wcex.lpszMenuName = NULL; + wcex.lpszClassName = szSizeBarClass; + wcex.hIconSm = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); + + RegisterClassExW(&wcex); +} + +static void SB_GetSizeBarRect(HHInfo *pHHInfo, RECT *rc) +{ + RECT rectWND, rectTB, rectNP; + + GetClientRect(pHHInfo->pHHWinType->hwndHelp, &rectWND); + GetClientRect(pHHInfo->pHHWinType->hwndToolBar, &rectTB); + GetClientRect(pHHInfo->pHHWinType->hwndNavigation, &rectNP); + + rc->left = rectNP.right; + rc->top = rectTB.bottom; + rc->bottom = rectWND.bottom - rectTB.bottom; + rc->right = SIZEBAR_WIDTH; +} + +static BOOL HH_AddSizeBar(HHInfo *pHHInfo) +{ + HWND hWnd; + HWND hwndParent = pHHInfo->pHHWinType->hwndHelp; + DWORD dwStyles = WS_CHILDWINDOW | WS_VISIBLE | WS_OVERLAPPED; + DWORD dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR; + RECT rc; + + SB_GetSizeBarRect(pHHInfo, &rc); + + hWnd = CreateWindowExW(dwExStyles, szSizeBarClass, szEmpty, dwStyles, + rc.left, rc.top, rc.right, rc.bottom, + hwndParent, NULL, pHHInfo->hInstance, NULL); + if (!hWnd) + return FALSE; + + /* store the pointer to the HH info struct */ + SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)pHHInfo); + + pHHInfo->hwndSizeBar = hWnd; + return TRUE; +} + /* Child Window */ static const WCHAR szChildClass[] = { 'H','H',' ','C','h','i','l','d',0 }; -static const WCHAR szEmpty[] = {0}; - static void Child_OnPaint(HWND hWnd) { PAINTSTRUCT ps; @@ -105,15 +253,12 @@ SelectObject(hdc, GetStockObject(DC_PEN)); SetDCPenColor(hdc, GetSysColor(COLOR_BTNSHADOW)); - /* Draw the top and right borders */ - MoveToEx(hdc, 0, 0, NULL); - LineTo(hdc, rc.right - 1, 0); - LineTo(hdc, rc.right - 1, rc.bottom); - - /* Fill in the background, taking the border lines into account */ - rc.top += 2; - rc.right -= 1; - FillRect(hdc, &rc, GetSysColorBrush(COLOR_3DFACE)); + /* Draw the top border */ + LineTo(hdc, rc.right, 0); + + SelectObject(hdc, GetStockObject(WHITE_PEN)); + MoveToEx(hdc, 0, 1, NULL); + LineTo(hdc, rc.right, 1); } EndPaint(hWnd, &ps); @@ -145,7 +290,7 @@ wcex.hInstance = pHHInfo->hInstance; wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); - wcex.hbrBackground = (HBRUSH)(COLOR_3DFACE); + wcex.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wcex.lpszMenuName = NULL; wcex.lpszClassName = szChildClass; wcex.hIconSm = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); @@ -157,6 +302,49 @@ #define ICON_SIZE 20 +static void TB_OnClick(HWND hWnd, DWORD dwID) +{ + HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA); + + switch (dwID) + { + case IDTB_STOP: + WB_DoPageAction(pHHInfo->pWBInfo, WB_STOP); + break; + case IDTB_REFRESH: + WB_DoPageAction(pHHInfo->pWBInfo, WB_REFRESH); + break; + case IDTB_BACK: + WB_DoPageAction(pHHInfo->pWBInfo, WB_GOBACK); + break; + case IDTB_HOME: + { + WCHAR szUrl[MAX_PATH]; + + CHM_CreateITSUrl(pHHInfo->pCHMInfo, pHHInfo->pHHWinType->pszHome, szUrl); + WB_Navigate(pHHInfo->pWBInfo, szUrl); + break; + } + case IDTB_FORWARD: + WB_DoPageAction(pHHInfo->pWBInfo, WB_GOFORWARD); + break; + case IDTB_EXPAND: + case IDTB_CONTRACT: + case IDTB_SYNC: + case IDTB_PRINT: + case IDTB_OPTIONS: + case IDTB_BROWSE_FWD: + case IDTB_BROWSE_BACK: + case IDTB_JUMP1: + case IDTB_JUMP2: + case IDTB_CUSTOMIZE: + case IDTB_ZOOM: + case IDTB_TOC_NEXT: + case IDTB_TOC_PREV: + break; + } +} + static void TB_AddButton(TBBUTTON *pButtons, DWORD dwIndex, DWORD dwID) { /* FIXME: Load the correct button bitmaps */ @@ -219,15 +407,17 @@ { HWND hToolbar; HWND hwndParent = pHHInfo->pHHWinType->hwndHelp; - DWORD toolbarFlags = pHHInfo->pHHWinType->fsToolBarFlags; + DWORD toolbarFlags; TBBUTTON buttons[IDTB_TOC_PREV - IDTB_EXPAND]; TBADDBITMAP tbAB; DWORD dwStyles, dwExStyles; DWORD dwNumButtons, dwIndex; - /* FIXME: Remove the following line once we read the CHM file */ - toolbarFlags = HHWIN_BUTTON_EXPAND | HHWIN_BUTTON_BACK | HHWIN_BUTTON_STOP | - HHWIN_BUTTON_REFRESH | HHWIN_BUTTON_HOME | HHWIN_BUTTON_PRINT; + if (pHHInfo->pHHWinType->fsWinProperties & HHWIN_PARAM_TB_FLAGS) + toolbarFlags = pHHInfo->pHHWinType->fsToolBarFlags; + else + toolbarFlags = HHWIN_DEF_BUTTONS; + TB_AddButtonsFromFlags(buttons, toolbarFlags, &dwNumButtons); dwStyles = WS_CHILDWINDOW | WS_VISIBLE | TBSTYLE_FLAT | @@ -269,7 +459,6 @@ /* Navigation Pane */ -#define TAB_PADDING 2 #define TAB_TOP_PADDING 8 #define TAB_RIGHT_PADDING 4 @@ -286,10 +475,13 @@ rc->top = rectTB.bottom; rc->bottom = rectWND.bottom - rectTB.bottom; - if (pHHInfo->pHHWinType->fsValidMembers & HHWIN_PARAM_NAV_WIDTH) - rc->right = pHHInfo->pHHWinType->iNavWidth; - else - rc->right = WINTYPE_DEFAULT_NAVWIDTH; + if (!(pHHInfo->pHHWinType->fsValidMembers & HHWIN_PARAM_NAV_WIDTH) && + pHHInfo->pHHWinType->iNavWidth == 0) + { + pHHInfo->pHHWinType->iNavWidth = WINTYPE_DEFAULT_NAVWIDTH; + } + + rc->right = pHHInfo->pHHWinType->iNavWidth; } static void NP_CreateTab(HINSTANCE hInstance, HWND hwndTabCtrl, DWORD dwStrID, DWORD dwIndex) @@ -322,18 +514,24 @@ return FALSE; hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles, - TAB_PADDING, TAB_TOP_PADDING, - rc.right - TAB_PADDING - TAB_RIGHT_PADDING, - rc.bottom - TAB_PADDING - TAB_TOP_PADDING, + 0, TAB_TOP_PADDING, + rc.right - TAB_RIGHT_PADDING, + rc.bottom - TAB_TOP_PADDING, hWnd, NULL, pHHInfo->hInstance, NULL); if (!hwndTabCtrl) return FALSE; - /* FIXME: Check which tabs to include when we read the CHM file */ - NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_CONTENTS, dwIndex++); - NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_INDEX, dwIndex++); - NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_SEARCH, dwIndex++); - NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_FAVORITES, dwIndex++); + if (*pHHInfo->pHHWinType->pszToc) + NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_CONTENTS, dwIndex++); + + if (*pHHInfo->pHHWinType->pszIndex) + NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_INDEX, dwIndex++); + + if (pHHInfo->pHHWinType->fsWinProperties & HHWIN_PROP_TAB_SEARCH) + NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_SEARCH, dwIndex++); + + if (pHHInfo->pHHWinType->fsWinProperties & HHWIN_PROP_TAB_FAVORITES) + NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_FAVORITES, dwIndex++); SendMessageW(hwndTabCtrl, WM_SETFONT, (WPARAM)pHHInfo->hFont, TRUE); @@ -346,18 +544,16 @@ static void HP_GetHTMLRect(HHInfo *pHHInfo, RECT *rc) { - HWND hwndParent = pHHInfo->pHHWinType->hwndHelp; - HWND hwndToolbar = pHHInfo->pHHWinType->hwndToolBar; - HWND hwndNavigation = pHHInfo->pHHWinType->hwndNavigation; - RECT rectTB, rectWND, rectNP; + RECT rectTB, rectWND, rectNP, rectSB; - GetClientRect(hwndParent, &rectWND); - GetClientRect(hwndToolbar, &rectTB); - GetClientRect(hwndNavigation, &rectNP); + GetClientRect(pHHInfo->pHHWinType->hwndHelp, &rectWND); + GetClientRect(pHHInfo->pHHWinType->hwndToolBar, &rectTB); + GetClientRect(pHHInfo->pHHWinType->hwndNavigation, &rectNP); + GetClientRect(pHHInfo->hwndSizeBar, &rectSB); - rc->left = rectNP.right; + rc->left = rectNP.right + rectSB.right; rc->top = rectTB.bottom; - rc->right = rectWND.right - rectNP.right; + rc->right = rectWND.right - rc->left; rc->bottom = rectWND.bottom - rectTB.bottom; } @@ -377,6 +573,9 @@ if (!hWnd) return FALSE; + if (!WB_EmbedBrowser(pHHInfo->pWBInfo, hWnd)) + return FALSE; + /* store the pointer to the HH info struct */ SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)pHHInfo); @@ -389,30 +588,35 @@ /* Viewer Window */ -static void Help_OnSize(HWND hWnd, LPARAM lParam) +static void Help_OnSize(HWND hWnd) { HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA); + DWORD dwSize; RECT rc; if (!pHHInfo) return; - /* Only resize the Navigation pane vertically */ - if (HIWORD(lParam)) - { - NP_GetNavigationRect(pHHInfo, &rc); - SetWindowPos(pHHInfo->pHHWinType->hwndNavigation, HWND_TOP, 0, 0, - rc.right, rc.bottom, SWP_NOMOVE); - - GetClientRect(pHHInfo->pHHWinType->hwndNavigation, &rc); - SetWindowPos(pHHInfo->hwndTabCtrl, HWND_TOP, 0, 0, - rc.right - TAB_PADDING - TAB_RIGHT_PADDING, - rc.bottom - TAB_PADDING - TAB_TOP_PADDING, SWP_NOMOVE); - } + NP_GetNavigationRect(pHHInfo, &rc); + SetWindowPos(pHHInfo->pHHWinType->hwndNavigation, HWND_TOP, 0, 0, + rc.right, rc.bottom, SWP_NOMOVE); + + GetClientRect(pHHInfo->pHHWinType->hwndNavigation, &rc); + SetWindowPos(pHHInfo->hwndTabCtrl, HWND_TOP, 0, 0, + rc.right - TAB_RIGHT_PADDING, + rc.bottom - TAB_TOP_PADDING, SWP_NOMOVE); + + SB_GetSizeBarRect(pHHInfo, &rc); + SetWindowPos(pHHInfo->hwndSizeBar, HWND_TOP, rc.left, rc.top, + rc.right, rc.bottom, SWP_SHOWWINDOW); HP_GetHTMLRect(pHHInfo, &rc); - SetWindowPos(pHHInfo->pHHWinType->hwndHTML, HWND_TOP, 0, 0, - LOWORD(lParam), HIWORD(lParam), SWP_NOMOVE); + SetWindowPos(pHHInfo->pHHWinType->hwndHTML, HWND_TOP, rc.left, rc.top, + rc.right, rc.bottom, SWP_SHOWWINDOW); + + /* Resize browser window taking the frame size into account */ + dwSize = GetSystemMetrics(SM_CXFRAME); + WB_ResizeBrowser(pHHInfo->pWBInfo, rc.right - dwSize, rc.bottom - dwSize); } LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -422,8 +626,12 @@ switch (message) { + case WM_COMMAND: + if (HIWORD(wParam) == BN_CLICKED) + TB_OnClick(hWnd, LOWORD(wParam)); + break; case WM_SIZE: - Help_OnSize(hWnd, lParam); + Help_OnSize(hWnd); break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); @@ -444,6 +652,7 @@ { HWND hWnd; HINSTANCE hInstance = pHHInfo->hInstance; + RECT winPos = pHHInfo->pHHWinType->rcWindowPos; WNDCLASSEXW wcex; DWORD dwStyles, dwExStyles; DWORD x, y, width, height; @@ -452,10 +661,6 @@ 'H','H',' ', 'P','a','r','e','n','t',0 }; - static const WCHAR windowTitleW[] = { - 'H','T','M','L',' ','H','e','l','p',0 - }; - wcex.cbSize = sizeof(WNDCLASSEXW); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = (WNDPROC)Help_WndProc; @@ -471,18 +676,36 @@ RegisterClassExW(&wcex); - dwStyles = WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; - dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | - WS_EX_WINDOWEDGE | WS_EX_APPWINDOW; - - /* these will be loaded from the CHM file in the future if they're provided */ - x = WINTYPE_DEFAULT_X; - y = WINTYPE_DEFAULT_Y; - width = WINTYPE_DEFAULT_WIDTH; - height = WINTYPE_DEFAULT_HEIGHT; + /* Read in window parameters if available */ + if (pHHInfo->pHHWinType->fsValidMembers & HHWIN_PARAM_STYLES) + dwStyles = pHHInfo->pHHWinType->dwStyles; + else + dwStyles = WS_OVERLAPPEDWINDOW | WS_VISIBLE | + WS_CLIPSIBLINGS | WS_CLIPCHILDREN; + + if (pHHInfo->pHHWinType->fsValidMembers & HHWIN_PARAM_EXSTYLES) + dwExStyles = pHHInfo->pHHWinType->dwExStyles; + else + dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_APPWINDOW | + WS_EX_WINDOWEDGE | WS_EX_RIGHTSCROLLBAR; + + if (pHHInfo->pHHWinType->fsValidMembers & HHWIN_PARAM_RECT) + { + x = winPos.left; + y = winPos.top; + width = winPos.right - x; + height = winPos.bottom - y; + } + else + { + x = WINTYPE_DEFAULT_X; + y = WINTYPE_DEFAULT_Y; + width = WINTYPE_DEFAULT_WIDTH; + height = WINTYPE_DEFAULT_HEIGHT; + } - hWnd = CreateWindowExW(dwExStyles, windowClassW, windowTitleW, dwStyles, - x, y, width, height, NULL, NULL, hInstance, NULL); + hWnd = CreateWindowExW(dwExStyles, windowClassW, pHHInfo->pHHWinType->pszCaption, + dwStyles, x, y, width, height, NULL, NULL, hInstance, NULL); if (!hWnd) return FALSE; @@ -535,6 +758,11 @@ if (!HH_AddNavigationPane(pHHInfo)) return FALSE; + HH_RegisterSizeBarClass(pHHInfo); + + if (!HH_AddSizeBar(pHHInfo)) + return FALSE; + if (!HH_AddHTMLPane(pHHInfo)) return FALSE; @@ -546,6 +774,8 @@ HHInfo *pHHInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HHInfo)); pHHInfo->pHHWinType = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HH_WINTYPEW)); + pHHInfo->pCHMInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(CHMInfo)); + pHHInfo->pWBInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(WBInfo)); pHHInfo->hInstance = hInstance; pHHInfo->szCmdLine = szCmdLine; @@ -557,8 +787,56 @@ if (!pHHInfo) return; + /* Free allocated strings */ + if (pHHInfo->pHHWinType) + { + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszType); + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszCaption); + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszToc); + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszType); + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszIndex); + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszFile); + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszHome); + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszJump1); + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszJump2); + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszUrlJump1); + HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszUrlJump2); + } + HeapFree(GetProcessHeap(), 0, pHHInfo->pHHWinType); HeapFree(GetProcessHeap(), 0, pHHInfo->szCmdLine); + + if (pHHInfo->pCHMInfo) + { + CHM_CloseCHM(pHHInfo->pCHMInfo); + HeapFree(GetProcessHeap(), 0, pHHInfo->pCHMInfo); + } + + if (pHHInfo->pWBInfo) + { + WB_UnEmbedBrowser(pHHInfo->pWBInfo); + HeapFree(GetProcessHeap(), 0, pHHInfo->pWBInfo); + } +} + +static void HH_OpenDefaultTopic(HHInfo *pHHInfo) +{ + WCHAR url[MAX_PATH]; + LPCWSTR defTopic = pHHInfo->pHHWinType->pszFile; + + CHM_CreateITSUrl(pHHInfo->pCHMInfo, defTopic, url); + WB_Navigate(pHHInfo->pWBInfo, url); +} + +static BOOL HH_OpenCHM(HHInfo *pHHInfo) +{ + if (!CHM_OpenCHM(pHHInfo->pCHMInfo, pHHInfo->szCmdLine)) + return FALSE; + + if (!CHM_LoadWinTypeFromCHM(pHHInfo->pCHMInfo, pHHInfo->pHHWinType)) + return FALSE; + + return TRUE; } /* FIXME: Check szCmdLine for bad arguments */ @@ -571,12 +849,14 @@ return -1; pHHInfo = HH_OpenHH(hInstance, HH_ANSIToUnicode(szCmdLine)); - if (!pHHInfo || !HH_CreateViewer(pHHInfo)) + if (!pHHInfo || !HH_OpenCHM(pHHInfo) || !HH_CreateViewer(pHHInfo)) { OleUninitialize(); return -1; } + HH_OpenDefaultTopic(pHHInfo); + while (GetMessageW(&msg, 0, 0, 0)) { TranslateMessage(&msg); diff -urN wine-20050830/dlls/hhctrl.ocx/hhctrl.rc wine-20050930/dlls/hhctrl.ocx/hhctrl.rc --- wine-20050830/dlls/hhctrl.ocx/hhctrl.rc 2005-08-03 13:46:52.000000000 +0200 +++ wine-20050930/dlls/hhctrl.ocx/hhctrl.rc 2005-09-25 17:18:38.000000000 +0200 @@ -31,3 +31,5 @@ #include "De.rc" #include "En.rc" +#include "Fi.rc" +#include "No.rc" diff -urN wine-20050830/dlls/hhctrl.ocx/webbrowser.c wine-20050930/dlls/hhctrl.ocx/webbrowser.c --- wine-20050830/dlls/hhctrl.ocx/webbrowser.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/hhctrl.ocx/webbrowser.c 2005-09-14 21:16:13.000000000 +0200 @@ -0,0 +1,729 @@ +/* + * WebBrowser Implementation + * + * Copyright 2005 James Hawkins + * + * 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 + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winnls.h" +#include "ole2.h" + +#include "webbrowser.h" + +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + +static const SAFEARRAYBOUND ArrayBound = {1, 0}; + +typedef struct IOleClientSiteImpl +{ + const IOleClientSiteVtbl *lpVtbl; + const IOleInPlaceSiteVtbl *lpvtblOleInPlaceSite; + const IOleInPlaceFrameVtbl *lpvtblOleInPlaceFrame; + const IDocHostUIHandlerVtbl *lpvtblDocHostUIHandler; + + /* IOleClientSiteImpl data */ + IOleObject *pBrowserObject; + LONG ref; + + /* IOleInPlaceFrame data */ + HWND hwndWindow; +} IOleClientSiteImpl; + +static HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppvObj) +{ + ICOM_THIS_MULTI(IOleClientSiteImpl, lpVtbl, iface); + *ppvObj = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IOleClientSite)) + { + *ppvObj = This; + } + else if (IsEqualIID(riid, &IID_IOleInPlaceSite)) + { + *ppvObj = &(This->lpvtblOleInPlaceSite); + } + else if (IsEqualIID(riid, &IID_IDocHostUIHandler)) + { + *ppvObj = &(This->lpvtblDocHostUIHandler); + } + else + return E_NOINTERFACE; + + return S_OK; +} + +static ULONG STDMETHODCALLTYPE Site_AddRef(IOleClientSite *iface) +{ + ICOM_THIS_MULTI(IOleClientSiteImpl, lpVtbl, iface); + return InterlockedIncrement(&This->ref); +} + +static ULONG STDMETHODCALLTYPE Site_Release(IOleClientSite *iface) +{ + ICOM_THIS_MULTI(IOleClientSiteImpl, lpVtbl, iface); + LONG refCount = InterlockedDecrement(&This->ref); + + if (refCount) + return refCount; + + HeapFree(GetProcessHeap(), 0, This); + return 0; +} + +static HRESULT STDMETHODCALLTYPE Site_SaveObject(IOleClientSite *iface) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Site_GetMoniker(IOleClientSite *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Site_GetContainer(IOleClientSite *iface, LPOLECONTAINER *ppContainer) +{ + *ppContainer = NULL; + + return E_NOINTERFACE; +} + +static HRESULT STDMETHODCALLTYPE Site_ShowObject(IOleClientSite *iface) +{ + return NOERROR; +} + +static HRESULT STDMETHODCALLTYPE Site_OnShowWindow(IOleClientSite *iface, BOOL fShow) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Site_RequestNewObjectLayout(IOleClientSite *iface) +{ + return E_NOTIMPL; +} + +static const IOleClientSiteVtbl MyIOleClientSiteTable = +{ + Site_QueryInterface, + Site_AddRef, + Site_Release, + Site_SaveObject, + Site_GetMoniker, + Site_GetContainer, + Site_ShowObject, + Site_OnShowWindow, + Site_RequestNewObjectLayout +}; + +static HRESULT STDMETHODCALLTYPE UI_QueryInterface(IDocHostUIHandler *iface, REFIID riid, LPVOID *ppvObj) +{ + ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblDocHostUIHandler, iface); + return Site_QueryInterface((IOleClientSite *)This, riid, ppvObj); +} + +static ULONG STDMETHODCALLTYPE UI_AddRef(IDocHostUIHandler *iface) +{ + return 1; +} + +static ULONG STDMETHODCALLTYPE UI_Release(IDocHostUIHandler * iface) +{ + return 2; +} + +static HRESULT STDMETHODCALLTYPE UI_ShowContextMenu(IDocHostUIHandler *iface, DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE UI_GetHostInfo(IDocHostUIHandler *iface, DOCHOSTUIINFO *pInfo) +{ + pInfo->cbSize = sizeof(DOCHOSTUIINFO); + pInfo->dwFlags = DOCHOSTUIFLAG_NO3DBORDER; + pInfo->dwDoubleClick = DOCHOSTUIDBLCLK_DEFAULT; + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE UI_ShowUI(IDocHostUIHandler *iface, DWORD dwID, IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget, IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE UI_HideUI(IDocHostUIHandler *iface) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE UI_UpdateUI(IDocHostUIHandler *iface) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE UI_EnableModeless(IDocHostUIHandler *iface, BOOL fEnable) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE UI_OnDocWindowActivate(IDocHostUIHandler *iface, BOOL fActivate) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE UI_OnFrameWindowActivate(IDocHostUIHandler *iface, BOOL fActivate) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE UI_ResizeBorder(IDocHostUIHandler *iface, LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE UI_TranslateAccelerator(IDocHostUIHandler *iface, LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID) +{ + return S_FALSE; +} + +static HRESULT STDMETHODCALLTYPE UI_GetOptionKeyPath(IDocHostUIHandler *iface, LPOLESTR *pchKey, DWORD dw) +{ + return S_FALSE; +} + +static HRESULT STDMETHODCALLTYPE UI_GetDropTarget(IDocHostUIHandler *iface, IDropTarget *pDropTarget, IDropTarget **ppDropTarget) +{ + return S_FALSE; +} + +static HRESULT STDMETHODCALLTYPE UI_GetExternal(IDocHostUIHandler *iface, IDispatch **ppDispatch) +{ + *ppDispatch = NULL; + return S_FALSE; +} + +static HRESULT STDMETHODCALLTYPE UI_TranslateUrl(IDocHostUIHandler *iface, DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut) +{ + *ppchURLOut = NULL; + return S_FALSE; +} + +static HRESULT STDMETHODCALLTYPE UI_FilterDataObject(IDocHostUIHandler *iface, IDataObject *pDO, IDataObject **ppDORet) +{ + *ppDORet = NULL; + return S_FALSE; +} + +static const IDocHostUIHandlerVtbl MyIDocHostUIHandlerTable = +{ + UI_QueryInterface, + UI_AddRef, + UI_Release, + UI_ShowContextMenu, + UI_GetHostInfo, + UI_ShowUI, + UI_HideUI, + UI_UpdateUI, + UI_EnableModeless, + UI_OnDocWindowActivate, + UI_OnFrameWindowActivate, + UI_ResizeBorder, + UI_TranslateAccelerator, + UI_GetOptionKeyPath, + UI_GetDropTarget, + UI_GetExternal, + UI_TranslateUrl, + UI_FilterDataObject +}; + +static HRESULT STDMETHODCALLTYPE InPlace_QueryInterface(IOleInPlaceSite *iface, REFIID riid, LPVOID *ppvObj) +{ + ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface); + return Site_QueryInterface((IOleClientSite *)This, riid, ppvObj); +} + +static ULONG STDMETHODCALLTYPE InPlace_AddRef(IOleInPlaceSite *iface) +{ + return 1; +} + +static ULONG STDMETHODCALLTYPE InPlace_Release(IOleInPlaceSite *iface) +{ + return 2; +} + +static HRESULT STDMETHODCALLTYPE InPlace_GetWindow(IOleInPlaceSite *iface, HWND *lphwnd) +{ + ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface); + *lphwnd = This->hwndWindow; + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE InPlace_ContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE InPlace_CanInPlaceActivate(IOleInPlaceSite *iface) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE InPlace_OnInPlaceActivate(IOleInPlaceSite *iface) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE InPlace_OnUIActivate(IOleInPlaceSite *iface) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE InPlace_GetWindowContext(IOleInPlaceSite *iface, LPOLEINPLACEFRAME *lplpFrame, LPOLEINPLACEUIWINDOW *lplpDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo) +{ + ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface); + *lplpFrame = (LPOLEINPLACEFRAME)&This->lpvtblOleInPlaceFrame; + *lplpDoc = NULL; + + lpFrameInfo->fMDIApp = FALSE; + lpFrameInfo->hwndFrame = This->hwndWindow; + lpFrameInfo->haccel = NULL; + lpFrameInfo->cAccelEntries = 0; + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE InPlace_Scroll(IOleInPlaceSite *iface, SIZE scrollExtent) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE InPlace_OnUIDeactivate(IOleInPlaceSite *iface, BOOL fUndoable) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE InPlace_OnInPlaceDeactivate(IOleInPlaceSite *iface) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE InPlace_DiscardUndoState(IOleInPlaceSite *iface) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE InPlace_DeactivateAndUndo(IOleInPlaceSite *iface) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE InPlace_OnPosRectChange(IOleInPlaceSite *iface, LPCRECT lprcPosRect) +{ + ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface); + IOleInPlaceObject *inplace; + + if (!IOleObject_QueryInterface(This->pBrowserObject, &IID_IOleInPlaceObject, (void **)&inplace)) + IOleInPlaceObject_SetObjectRects(inplace, lprcPosRect, lprcPosRect); + + return S_OK; +} + +static const IOleInPlaceSiteVtbl MyIOleInPlaceSiteTable = +{ + InPlace_QueryInterface, + InPlace_AddRef, + InPlace_Release, + InPlace_GetWindow, + InPlace_ContextSensitiveHelp, + InPlace_CanInPlaceActivate, + InPlace_OnInPlaceActivate, + InPlace_OnUIActivate, + InPlace_GetWindowContext, + InPlace_Scroll, + InPlace_OnUIDeactivate, + InPlace_OnInPlaceDeactivate, + InPlace_DiscardUndoState, + InPlace_DeactivateAndUndo, + InPlace_OnPosRectChange +}; + +static HRESULT STDMETHODCALLTYPE Frame_QueryInterface(IOleInPlaceFrame *iface, REFIID riid, LPVOID *ppvObj) +{ + return E_NOTIMPL; +} + +static ULONG STDMETHODCALLTYPE Frame_AddRef(IOleInPlaceFrame *iface) +{ + return 1; +} + +static ULONG STDMETHODCALLTYPE Frame_Release(IOleInPlaceFrame *iface) +{ + return 2; +} + +static HRESULT STDMETHODCALLTYPE Frame_GetWindow(IOleInPlaceFrame *iface, HWND *lphwnd) +{ + ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceFrame, iface); + *lphwnd = This->hwndWindow; + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE Frame_ContextSensitiveHelp(IOleInPlaceFrame *iface, BOOL fEnterMode) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Frame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Frame_RequestBorderSpace(IOleInPlaceFrame *iface, LPCBORDERWIDTHS pborderwidths) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Frame_SetBorderSpace(IOleInPlaceFrame *iface, LPCBORDERWIDTHS pborderwidths) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Frame_SetActiveObject(IOleInPlaceFrame *iface, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE Frame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Frame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE Frame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Frame_SetStatusText(IOleInPlaceFrame *iface, LPCOLESTR pszStatusText) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE Frame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE Frame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg, WORD wID) +{ + return E_NOTIMPL; +} + +static const IOleInPlaceFrameVtbl MyIOleInPlaceFrameTable = +{ + Frame_QueryInterface, + Frame_AddRef, + Frame_Release, + Frame_GetWindow, + Frame_ContextSensitiveHelp, + Frame_GetBorder, + Frame_RequestBorderSpace, + Frame_SetBorderSpace, + Frame_SetActiveObject, + Frame_InsertMenus, + Frame_SetMenu, + Frame_RemoveMenus, + Frame_SetStatusText, + Frame_EnableModeless, + Frame_TranslateAccelerator +}; + +static HRESULT STDMETHODCALLTYPE Storage_QueryInterface(IStorage *This, REFIID riid, LPVOID *ppvObj) +{ + return E_NOTIMPL; +} + +static ULONG STDMETHODCALLTYPE Storage_AddRef(IStorage *This) +{ + return 1; +} + +static ULONG STDMETHODCALLTYPE Storage_Release(IStorage *This) +{ + return 2; +} + +static HRESULT STDMETHODCALLTYPE Storage_CreateStream(IStorage *This, const WCHAR *pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream **ppstm) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_OpenStream(IStorage *This, const WCHAR * pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream **ppstm) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_CreateStorage(IStorage *This, const WCHAR *pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStorage **ppstg) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_OpenStorage(IStorage *This, const WCHAR * pwcsName, IStorage * pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstg) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_CopyTo(IStorage *This, DWORD ciidExclude, IID const *rgiidExclude, SNB snbExclude,IStorage *pstgDest) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_MoveElementTo(IStorage *This, const OLECHAR *pwcsName,IStorage * pstgDest, const OLECHAR *pwcsNewName, DWORD grfFlags) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_Commit(IStorage *This, DWORD grfCommitFlags) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_Revert(IStorage *This) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_EnumElements(IStorage *This, DWORD reserved1, void *reserved2, DWORD reserved3, IEnumSTATSTG **ppenum) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_DestroyElement(IStorage *This, const OLECHAR *pwcsName) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_RenameElement(IStorage *This, const WCHAR *pwcsOldName, const WCHAR *pwcsNewName) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_SetElementTimes(IStorage *This, const WCHAR *pwcsName, FILETIME const *pctime, FILETIME const *patime, FILETIME const *pmtime) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_SetClass(IStorage *This, REFCLSID clsid) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE Storage_SetStateBits(IStorage *This, DWORD grfStateBits, DWORD grfMask) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE Storage_Stat(IStorage *This, STATSTG *pstatstg, DWORD grfStatFlag) +{ + return E_NOTIMPL; +} + +static const IStorageVtbl MyIStorageTable = +{ + Storage_QueryInterface, + Storage_AddRef, + Storage_Release, + Storage_CreateStream, + Storage_OpenStream, + Storage_CreateStorage, + Storage_OpenStorage, + Storage_CopyTo, + Storage_MoveElementTo, + Storage_Commit, + Storage_Revert, + Storage_EnumElements, + Storage_DestroyElement, + Storage_RenameElement, + Storage_SetElementTimes, + Storage_SetClass, + Storage_SetStateBits, + Storage_Stat +}; + +static IStorage MyIStorage = { &MyIStorageTable }; + +BOOL WB_EmbedBrowser(WBInfo *pWBInfo, HWND hwndParent) +{ + IOleClientSiteImpl *iOleClientSiteImpl; + IOleObject *browserObject; + IWebBrowser2 *webBrowser2; + HRESULT hr; + RECT rc; + + static const WCHAR hostNameW[] = {'H','o','s','t',' ','N','a','m','e',0}; + + /* clear out struct to keep from accessing invalid ptrs */ + ZeroMemory(pWBInfo, sizeof(WBInfo)); + + iOleClientSiteImpl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(IOleClientSiteImpl)); + if (!iOleClientSiteImpl) + return FALSE; + + iOleClientSiteImpl->ref = 0; + iOleClientSiteImpl->lpVtbl = &MyIOleClientSiteTable; + iOleClientSiteImpl->lpvtblOleInPlaceSite = &MyIOleInPlaceSiteTable; + iOleClientSiteImpl->lpvtblOleInPlaceFrame = &MyIOleInPlaceFrameTable; + iOleClientSiteImpl->hwndWindow = hwndParent; + iOleClientSiteImpl->lpvtblDocHostUIHandler = &MyIDocHostUIHandlerTable; + + hr = OleCreate(&CLSID_WebBrowser, &IID_IOleObject, OLERENDER_DRAW, 0, + (IOleClientSite *)iOleClientSiteImpl, &MyIStorage, + (void **)&browserObject); + + pWBInfo->pOleClientSite = (IOleClientSite *)iOleClientSiteImpl; + pWBInfo->pBrowserObject = browserObject; + + if (FAILED(hr)) goto error; + + /* make the browser object accessible to the IOleClientSite implementation */ + iOleClientSiteImpl->pBrowserObject = browserObject; + IOleObject_SetHostNames(browserObject, hostNameW, 0); + + GetClientRect(hwndParent, &rc); + + hr = OleSetContainedObject((struct IUnknown *)browserObject, TRUE); + if (FAILED(hr)) goto error; + + hr = IOleObject_DoVerb(browserObject, OLEIVERB_SHOW, NULL, + (IOleClientSite *)iOleClientSiteImpl, + -1, hwndParent, &rc); + if (FAILED(hr)) goto error; + + + hr = IOleObject_QueryInterface(browserObject, &IID_IWebBrowser2, + (void **)&webBrowser2); + if (SUCCEEDED(hr)) + { + IWebBrowser2_put_Left(webBrowser2, 0); + IWebBrowser2_put_Top(webBrowser2, 0); + IWebBrowser2_put_Width(webBrowser2, rc.right); + IWebBrowser2_put_Height(webBrowser2, rc.bottom); + + pWBInfo->pWebBrowser2 = webBrowser2; + pWBInfo->hwndParent = hwndParent; + + return TRUE; + } + +error: + WB_UnEmbedBrowser(pWBInfo); + HeapFree(GetProcessHeap(), 0, iOleClientSiteImpl); + + return FALSE; +} + +void WB_UnEmbedBrowser(WBInfo *pWBInfo) +{ + if (pWBInfo->pBrowserObject) + { + IOleObject_Close(pWBInfo->pBrowserObject, OLECLOSE_NOSAVE); + IOleObject_Release(pWBInfo->pBrowserObject); + pWBInfo->pBrowserObject = NULL; + } + + if (pWBInfo->pWebBrowser2) + { + IWebBrowser2_Release(pWBInfo->pWebBrowser2); + pWBInfo->pWebBrowser2 = NULL; + } + + if (pWBInfo->pOleClientSite) + { + IOleClientSite_Release(pWBInfo->pOleClientSite); + pWBInfo->pOleClientSite = NULL; + } +} + +BOOL WB_Navigate(WBInfo *pWBInfo, LPCWSTR szUrl) +{ + IWebBrowser2 *pWebBrowser2 = pWBInfo->pWebBrowser2; + VARIANT myURL; + + if (!pWebBrowser2) + return FALSE; + + V_VT(&myURL) = VT_BSTR; + V_BSTR(&myURL) = SysAllocString(szUrl); + + IWebBrowser2_Navigate2(pWebBrowser2, &myURL, 0, 0, 0, 0); + VariantClear(&myURL); + + return TRUE; +} + +void WB_ResizeBrowser(WBInfo *pWBInfo, DWORD dwWidth, DWORD dwHeight) +{ + IWebBrowser2 *pWebBrowser2 = pWBInfo->pWebBrowser2; + + if (!pWebBrowser2) + return; + + IWebBrowser2_put_Width(pWebBrowser2, dwWidth); + IWebBrowser2_put_Height(pWebBrowser2, dwHeight); +} + +void WB_DoPageAction(WBInfo *pWBInfo, DWORD dwAction) +{ + IWebBrowser2 *pWebBrowser2 = pWBInfo->pWebBrowser2; + + if (!pWebBrowser2) + return; + + switch (dwAction) + { + case WB_GOBACK: + IWebBrowser2_GoBack(pWebBrowser2); + break; + case WB_GOFORWARD: + IWebBrowser2_GoForward(pWebBrowser2); + break; + case WB_GOHOME: + IWebBrowser2_GoHome(pWebBrowser2); + break; + case WB_SEARCH: + IWebBrowser2_GoSearch(pWebBrowser2); + break; + case WB_REFRESH: + IWebBrowser2_Refresh(pWebBrowser2); + case WB_STOP: + IWebBrowser2_Stop(pWebBrowser2); + } +} diff -urN wine-20050830/dlls/hhctrl.ocx/webbrowser.h wine-20050930/dlls/hhctrl.ocx/webbrowser.h --- wine-20050830/dlls/hhctrl.ocx/webbrowser.h 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/hhctrl.ocx/webbrowser.h 2005-09-13 12:32:47.000000000 +0200 @@ -0,0 +1,49 @@ +/* + * WebBrowser Include + * + * Copyright 2005 James Hawkins + * + * 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 + */ + +#ifndef __WINE_WEBBROWSER_H +#define __WINE_WEBBROWSER_H + +#include "exdisp.h" +#include "mshtml.h" +#include "mshtmhst.h" + +#define WB_GOBACK 0 +#define WB_GOFORWARD 1 +#define WB_GOHOME 2 +#define WB_SEARCH 3 +#define WB_REFRESH 4 +#define WB_STOP 5 + +typedef struct WBInfo +{ + IOleClientSite *pOleClientSite; + IWebBrowser2 *pWebBrowser2; + IOleObject *pBrowserObject; + HWND hwndParent; +} WBInfo; + +BOOL WB_EmbedBrowser(WBInfo *pWBInfo, HWND hwndParent); +void WB_UnEmbedBrowser(WBInfo *pWBInfo); +BOOL WB_Navigate(WBInfo *pWBInfo, LPCWSTR szUrl); +void WB_ResizeBrowser(WBInfo *pWBInfo, DWORD dwWidth, DWORD dwHeight); +void WB_DoPageAction(WBInfo *pWBInfo, DWORD dwAction); + +#endif /* __WINE_WEBBROWSER_H */ diff -urN wine-20050830/dlls/iccvid/.cvsignore wine-20050930/dlls/iccvid/.cvsignore --- wine-20050830/dlls/iccvid/.cvsignore 2005-08-17 14:42:40.000000000 +0200 +++ wine-20050930/dlls/iccvid/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,2 +1 @@ Makefile -iccvid.dll.dbg.c diff -urN wine-20050830/dlls/icmp/.cvsignore wine-20050930/dlls/icmp/.cvsignore --- wine-20050830/dlls/icmp/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/icmp/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -icmp.dll.dbg.c libicmp.def diff -urN wine-20050830/dlls/ifsmgr.vxd/.cvsignore wine-20050930/dlls/ifsmgr.vxd/.cvsignore --- wine-20050830/dlls/ifsmgr.vxd/.cvsignore 2004-03-24 04:36:48.000000000 +0100 +++ wine-20050930/dlls/ifsmgr.vxd/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,2 +1 @@ Makefile -ifsmgr.vxd.dbg.c diff -urN wine-20050830/dlls/imagehlp/.cvsignore wine-20050930/dlls/imagehlp/.cvsignore --- wine-20050830/dlls/imagehlp/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/imagehlp/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -imagehlp.dll.dbg.c libimagehlp.def diff -urN wine-20050830/dlls/imm32/.cvsignore wine-20050930/dlls/imm32/.cvsignore --- wine-20050830/dlls/imm32/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/imm32/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,4 +1,2 @@ Makefile -imm.spec.c -imm32.dll.dbg.c libimm32.def diff -urN wine-20050830/dlls/imm32/imm.c wine-20050930/dlls/imm32/imm.c --- wine-20050830/dlls/imm32/imm.c 2005-05-06 21:38:50.000000000 +0200 +++ wine-20050930/dlls/imm32/imm.c 2005-09-12 12:30:06.000000000 +0200 @@ -740,7 +740,7 @@ the_name, WS_POPUPWINDOW|WS_CAPTION, 0, 0, 120, 55, 0, 0, hImeInst, 0); - TRACE("Default created (0x%x)\n",(INT)hwndDefault); + TRACE("Default created (%p)\n",hwndDefault); } return (HWND)hwndDefault; diff -urN wine-20050830/dlls/iphlpapi/.cvsignore wine-20050930/dlls/iphlpapi/.cvsignore --- wine-20050830/dlls/iphlpapi/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/iphlpapi/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -iphlpapi.dll.dbg.c libiphlpapi.def diff -urN wine-20050830/dlls/iphlpapi/iphlpapi_main.c wine-20050930/dlls/iphlpapi/iphlpapi_main.c --- wine-20050830/dlls/iphlpapi/iphlpapi_main.c 2005-07-07 14:08:43.000000000 +0200 +++ wine-20050930/dlls/iphlpapi/iphlpapi_main.c 2005-09-12 12:30:06.000000000 +0200 @@ -114,8 +114,8 @@ { DWORD ret; - TRACE("ppIfTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n", ppIfTable, - (DWORD)bOrder, (DWORD)heap, flags); + TRACE("ppIfTable %p, bOrder %d, heap %p, flags 0x%08lx\n", ppIfTable, + bOrder, heap, flags); if (!ppIfTable) ret = ERROR_INVALID_PARAMETER; else { @@ -155,8 +155,8 @@ { DWORD ret; - TRACE("ppIpAddrTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n", - ppIpAddrTable, (DWORD)bOrder, (DWORD)heap, flags); + TRACE("ppIpAddrTable %p, bOrder %d, heap %p, flags 0x%08lx\n", + ppIpAddrTable, bOrder, heap, flags); if (!ppIpAddrTable) ret = ERROR_INVALID_PARAMETER; else { @@ -196,8 +196,8 @@ { DWORD ret; - TRACE("ppIpForwardTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n", - ppIpForwardTable, (DWORD)bOrder, (DWORD)heap, flags); + TRACE("ppIpForwardTable %p, bOrder %d, heap %p, flags 0x%08lx\n", + ppIpForwardTable, bOrder, heap, flags); if (!ppIpForwardTable) ret = ERROR_INVALID_PARAMETER; else { @@ -237,8 +237,8 @@ { DWORD ret; - TRACE("ppIpNetTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n", - ppIpNetTable, (DWORD)bOrder, (DWORD)heap, flags); + TRACE("ppIpNetTable %p, bOrder %d, heap %p, flags 0x%08lx\n", + ppIpNetTable, bOrder, heap, flags); if (!ppIpNetTable) ret = ERROR_INVALID_PARAMETER; else { @@ -278,8 +278,8 @@ { DWORD ret; - TRACE("ppTcpTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n", - ppTcpTable, (DWORD)bOrder, (DWORD)heap, flags); + TRACE("ppTcpTable %p, bOrder %d, heap %p, flags 0x%08lx\n", + ppTcpTable, bOrder, heap, flags); if (!ppTcpTable) ret = ERROR_INVALID_PARAMETER; else { @@ -319,8 +319,8 @@ { DWORD ret; - TRACE("ppUdpTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n", - ppUdpTable, (DWORD)bOrder, (DWORD)heap, flags); + TRACE("ppUdpTable %p, bOrder %d, heap %p, flags 0x%08lx\n", + ppUdpTable, bOrder, heap, flags); if (!ppUdpTable) ret = ERROR_INVALID_PARAMETER; else { diff -urN wine-20050830/dlls/itss/.cvsignore wine-20050930/dlls/itss/.cvsignore --- wine-20050830/dlls/itss/.cvsignore 2005-08-25 12:25:14.000000000 +0200 +++ wine-20050930/dlls/itss/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,2 +1 @@ Makefile -itss.dll.dbg.c diff -urN wine-20050830/dlls/kernel/.cvsignore wine-20050930/dlls/kernel/.cvsignore --- wine-20050830/dlls/kernel/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/kernel/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,13 +1,4 @@ Makefile -comm.drv.spec.c kernel.res -kernel32.dll.dbg.c -krnl386.exe.spec.c libkernel32.def -relay16asm.s -stress.spec.c -system.drv.spec.c -toolhelp.spec.c version16.res -win87em.spec.c -windebug.spec.c diff -urN wine-20050830/dlls/kernel/Makefile.in wine-20050930/dlls/kernel/Makefile.in --- wine-20050830/dlls/kernel/Makefile.in 2005-08-29 12:20:51.000000000 +0200 +++ wine-20050930/dlls/kernel/Makefile.in 2005-09-21 16:23:54.000000000 +0200 @@ -1,4 +1,4 @@ -EXTRADEFS = -D_KERNEL32_ -DETCDIR="\"$(sysconfdir)\"" +EXTRADEFS = -D_KERNEL32_ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ @@ -84,8 +84,6 @@ toolhelp16.c \ win87em.c -ASM_SRCS = relay16asm.s - RC_SRCS = kernel.rc RC_SRCS16 = \ @@ -94,7 +92,7 @@ MC_SRCS = \ messages/winerr_enu.mc -EXTRA_OBJS = $(ASM_SRCS:.s=.o) +EXTRA_OBJS = relay16asm.o SUBDIRS = tests EXTRASUBDIRS = messages nls @@ -102,18 +100,15 @@ kernel.res: $(MC_SRCS:.mc=.mc.rc) -relay16asm.s: $(WINEBUILD) - $(WINEBUILD) $(DEFS) $(DLLFLAGS) -o $@ --relay16 +relay16asm.o: $(WINEBUILD) + $(WINEBUILD) $(WINEBUILDFLAGS) -o $@ --relay16 # Special rules for 16-bit resource and spec files -krnl386.exe.spec.c: krnl386.exe.spec version16.res - $(WINEBUILD) $(DEFS) $(DLLFLAGS) --dll -o $@ --dll-name kernel --main-module $(MODULE) --res version16.res --export $(SRCDIR)/krnl386.exe.spec +krnl386.exe.spec.o: krnl386.exe.spec version16.res + $(WINEBUILD) $(WINEBUILDFLAGS) --dll -o $@ --dll-name kernel --main-module $(MODULE) --res version16.res --export $(SRCDIR)/krnl386.exe.spec version16.res: version16.rc $(LDPATH) $(RC16) $(RC16FLAGS) -fo$@ $(SRCDIR)/version16.rc -clean:: - $(RM) $(ASM_SRCS) - ### Dependencies: diff -urN wine-20050830/dlls/kernel/change.c wine-20050930/dlls/kernel/change.c --- wine-20050830/dlls/kernel/change.c 2005-06-20 12:40:37.000000000 +0200 +++ wine-20050930/dlls/kernel/change.c 2005-09-12 12:30:06.000000000 +0200 @@ -128,7 +128,7 @@ */ FARPROC16 WINAPI FileCDR16(FARPROC16 x) { - FIXME("(0x%8x): stub\n", (int) x); + FIXME("(%p): stub\n", x); return (FARPROC16)TRUE; } diff -urN wine-20050830/dlls/kernel/comm.c wine-20050930/dlls/kernel/comm.c --- wine-20050830/dlls/kernel/comm.c 2005-08-08 20:01:42.000000000 +0200 +++ wine-20050930/dlls/kernel/comm.c 2005-09-27 11:32:17.000000000 +0200 @@ -1491,17 +1491,22 @@ fd = get_comm_fd( handle, GENERIC_READ ); if (fd < 0) return FALSE; - if (tcgetattr(fd, &port) == -1 -#ifdef TIOCMGET - || ioctl(fd, TIOCMGET, &stat) == -1 -#endif - ) { + if (tcgetattr(fd, &port) == -1) { int save_error=errno; - ERR("tcgetattr or ioctl error '%s'\n", strerror(save_error)); + ERR("tcgetattr error '%s'\n", strerror(save_error)); COMM_SetCommError(handle,CE_IOE); release_comm_fd( handle, fd ); return FALSE; } + +#ifdef TIOCMGET + if (ioctl(fd, TIOCMGET, &stat) == -1) + { + int save_error=errno; + WARN("ioctl error '%s'\n", strerror(save_error)); + stat = DTR_CONTROL_ENABLE | RTS_CONTROL_ENABLE; + } +#endif release_comm_fd( handle, fd ); #ifndef __EMX__ #ifdef CBAUD diff -urN wine-20050830/dlls/kernel/console.c wine-20050930/dlls/kernel/console.c --- wine-20050830/dlls/kernel/console.c 2005-06-27 11:54:09.000000000 +0200 +++ wine-20050930/dlls/kernel/console.c 2005-09-09 12:19:45.000000000 +0200 @@ -1460,7 +1460,7 @@ { 0, 0, &CONSOLE_CritSect, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": CONSOLE_CritSect") } + 0, 0, { (DWORD_PTR)(__FILE__ ": CONSOLE_CritSect") } }; static CRITICAL_SECTION CONSOLE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 }; diff -urN wine-20050830/dlls/kernel/dosmem.c wine-20050930/dlls/kernel/dosmem.c --- wine-20050830/dlls/kernel/dosmem.c 2005-06-20 12:40:37.000000000 +0200 +++ wine-20050930/dlls/kernel/dosmem.c 2005-09-12 17:14:07.000000000 +0200 @@ -224,7 +224,7 @@ { if (((char*)ptr >= DOSMEM_dosmem) && ((char*)ptr < DOSMEM_dosmem + DOSMEM_SIZE)) - return (UINT)ptr - (UINT)DOSMEM_dosmem; + return (char *)ptr - DOSMEM_dosmem; return (UINT)ptr; } @@ -236,7 +236,7 @@ */ LPVOID DOSMEM_MapDosToLinear(UINT ptr) { - if (ptr < DOSMEM_SIZE) return (LPVOID)(ptr + (UINT)DOSMEM_dosmem); + if (ptr < DOSMEM_SIZE) return DOSMEM_dosmem + ptr; return (LPVOID)ptr; } diff -urN wine-20050830/dlls/kernel/except.c wine-20050930/dlls/kernel/except.c --- wine-20050830/dlls/kernel/except.c 2005-06-20 12:40:37.000000000 +0200 +++ wine-20050930/dlls/kernel/except.c 2005-09-12 12:30:06.000000000 +0200 @@ -168,8 +168,8 @@ else #endif len2 = snprintf(buffer+len, size-len, - " at address 0x%08lx.\nDo you wish to debug it ?", - (DWORD)ptr->ExceptionRecord->ExceptionAddress); + " at address %p.\nDo you wish to debug it ?", + ptr->ExceptionRecord->ExceptionAddress); if ((len2<0) || (len>=size-len)) return -1; return len+len2; diff -urN wine-20050830/dlls/kernel/instr.c wine-20050930/dlls/kernel/instr.c --- wine-20050830/dlls/kernel/instr.c 2005-08-27 12:18:03.000000000 +0200 +++ wine-20050930/dlls/kernel/instr.c 2005-09-25 17:23:21.000000000 +0200 @@ -381,15 +381,15 @@ switch(size) { case 1: - DPRINTF( "0x%x < %02x @ %04x:%04x\n", port, LOBYTE(res), + TRACE_(io)( "0x%x < %02x @ %04x:%04x\n", port, LOBYTE(res), (WORD)context->SegCs, LOWORD(context->Eip)); break; case 2: - DPRINTF( "0x%x < %04x @ %04x:%04x\n", port, LOWORD(res), + TRACE_(io)( "0x%x < %04x @ %04x:%04x\n", port, LOWORD(res), (WORD)context->SegCs, LOWORD(context->Eip)); break; case 4: - DPRINTF( "0x%x < %08lx @ %04x:%04x\n", port, res, + TRACE_(io)( "0x%x < %08lx @ %04x:%04x\n", port, res, (WORD)context->SegCs, LOWORD(context->Eip)); break; } @@ -413,15 +413,15 @@ switch(size) { case 1: - DPRINTF("0x%x > %02x @ %04x:%04x\n", port, LOBYTE(val), + TRACE_(io)("0x%x > %02x @ %04x:%04x\n", port, LOBYTE(val), (WORD)context->SegCs, LOWORD(context->Eip)); break; case 2: - DPRINTF("0x%x > %04x @ %04x:%04x\n", port, LOWORD(val), + TRACE_(io)("0x%x > %04x @ %04x:%04x\n", port, LOWORD(val), (WORD)context->SegCs, LOWORD(context->Eip)); break; case 4: - DPRINTF("0x%x > %08lx @ %04x:%04x\n", port, val, + TRACE_(io)("0x%x > %08lx @ %04x:%04x\n", port, val, (WORD)context->SegCs, LOWORD(context->Eip)); break; } @@ -888,7 +888,7 @@ LONG CALLBACK INSTR_vectored_handler( EXCEPTION_POINTERS *ptrs ) { EXCEPTION_RECORD *record = ptrs->ExceptionRecord; - CONTEXT *context = ptrs->ContextRecord; + CONTEXT86 *context = ptrs->ContextRecord; if (wine_ldt_is_system(context->SegCs) && (record->ExceptionCode == EXCEPTION_ACCESS_VIOLATION || @@ -934,6 +934,6 @@ */ FARPROC16 WINAPI GetSetKernelDOSProc16( FARPROC16 DosProc ) { - FIXME("(DosProc=0x%08x): stub\n", (UINT)DosProc); + FIXME("(DosProc=%p): stub\n", DosProc); return NULL; } diff -urN wine-20050830/dlls/kernel/kernel16_private.h wine-20050930/dlls/kernel/kernel16_private.h --- wine-20050830/dlls/kernel/kernel16_private.h 2005-08-27 12:18:03.000000000 +0200 +++ wine-20050930/dlls/kernel/kernel16_private.h 2005-09-18 14:25:23.000000000 +0200 @@ -126,8 +126,8 @@ BYTE lcall; /* lcall __FLATCS__:glue */ void *glue; WORD flatcs; - WORD lret; /* lret $nArgs */ - WORD nArgs; + WORD ret[5]; /* return sequence */ + WORD movl; /* movl arg_types[1],arg_types[0](%esi) */ DWORD arg_types[2]; /* type of each argument */ } CALLFROM16; @@ -147,6 +147,9 @@ HTASK16 LockTDB; /* 14 hLockedTask */ } THHOOK; +extern LONG __wine_call_from_16(); +extern void __wine_call_from_16_regs(); + extern THHOOK *pThhook; #include "poppack.h" diff -urN wine-20050830/dlls/kernel/kernel32.spec wine-20050930/dlls/kernel/kernel32.spec --- wine-20050830/dlls/kernel/kernel32.spec 2005-08-29 12:27:25.000000000 +0200 +++ wine-20050930/dlls/kernel/kernel32.spec 2005-09-18 14:25:23.000000000 +0200 @@ -1008,7 +1008,7 @@ @ stdcall SetFileAttributesA(str long) @ stdcall SetFileAttributesW(wstr long) @ stdcall SetFilePointer(long long ptr long) -@ stdcall SetFilePointerEx(long long long ptr long) +@ stdcall SetFilePointerEx(long double ptr long) # @ stub SetFileShortNameA # @ stub SetFileShortNameW @ stdcall SetFileTime(long ptr ptr ptr) @@ -1111,8 +1111,8 @@ @ stdcall VerLanguageNameW(long wstr long) @ stdcall -ret64 VerSetConditionMask(long long long long) ntdll.VerSetConditionMask @ stdcall VerifyConsoleIoHandle(long) -@ stdcall VerifyVersionInfoA(long long long long) -@ stdcall VerifyVersionInfoW(long long long long) +@ stdcall VerifyVersionInfoA(long long double) +@ stdcall VerifyVersionInfoW(long long double) @ stdcall VirtualAlloc(ptr long long long) @ stdcall VirtualAllocEx(long ptr long long long) @ stub VirtualBufferExceptionHandler @@ -1247,9 +1247,7 @@ # 16-bit relays @ cdecl __wine_dll_register_16(ptr str) @ cdecl __wine_dll_unregister_16(ptr) -@ varargs __wine_call_from_16_word() -@ varargs __wine_call_from_16_long() -@ varargs __wine_call_from_16_regs() +@ varargs -private __wine_call_from_16_regs() # Unix files @ cdecl wine_get_unix_file_name(wstr) diff -urN wine-20050830/dlls/kernel/kernel_main.c wine-20050930/dlls/kernel/kernel_main.c --- wine-20050830/dlls/kernel/kernel_main.c 2005-08-29 14:26:19.000000000 +0200 +++ wine-20050930/dlls/kernel/kernel_main.c 2005-09-09 12:19:45.000000000 +0200 @@ -57,7 +57,7 @@ { 0, 0, &ldt_section, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": ldt_section") } + 0, 0, { (DWORD_PTR)(__FILE__ ": ldt_section") } }; static CRITICAL_SECTION ldt_section = { &critsect_debug, -1, 0, 0, 0, 0 }; diff -urN wine-20050830/dlls/kernel/kernel_private.h wine-20050930/dlls/kernel/kernel_private.h --- wine-20050830/dlls/kernel/kernel_private.h 2005-08-27 12:18:03.000000000 +0200 +++ wine-20050930/dlls/kernel/kernel_private.h 2005-09-12 17:14:07.000000000 +0200 @@ -47,19 +47,19 @@ static inline BOOL is_console_handle(HANDLE h) { - return h != INVALID_HANDLE_VALUE && ((DWORD)h & 3) == 3; + return h != INVALID_HANDLE_VALUE && ((UINT_PTR)h & 3) == 3; } /* map a real wineserver handle onto a kernel32 console handle */ static inline HANDLE console_handle_map(HANDLE h) { - return h != INVALID_HANDLE_VALUE ? (HANDLE)((DWORD)h ^ 3) : INVALID_HANDLE_VALUE; + return h != INVALID_HANDLE_VALUE ? (HANDLE)((UINT_PTR)h ^ 3) : INVALID_HANDLE_VALUE; } /* map a kernel32 console handle onto a real wineserver handle */ static inline HANDLE console_handle_unmap(HANDLE h) { - return h != INVALID_HANDLE_VALUE ? (HANDLE)((DWORD)h ^ 3) : INVALID_HANDLE_VALUE; + return h != INVALID_HANDLE_VALUE ? (HANDLE)((UINT_PTR)h ^ 3) : INVALID_HANDLE_VALUE; } extern HMODULE kernel32_handle; diff -urN wine-20050830/dlls/kernel/lcformat.c wine-20050930/dlls/kernel/lcformat.c --- wine-20050830/dlls/kernel/lcformat.c 2005-07-28 12:47:53.000000000 +0200 +++ wine-20050930/dlls/kernel/lcformat.c 2005-09-09 12:19:45.000000000 +0200 @@ -88,7 +88,7 @@ 0, 0, &NLS_FormatsCS, { &NLS_FormatsCS_debug.ProcessLocksList, &NLS_FormatsCS_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": NLS_Formats") } + 0, 0, { (DWORD_PTR)(__FILE__ ": NLS_Formats") } }; static CRITICAL_SECTION NLS_FormatsCS = { &NLS_FormatsCS_debug, -1, 0, 0, 0, 0 }; diff -urN wine-20050830/dlls/kernel/local16.c wine-20050930/dlls/kernel/local16.c --- wine-20050830/dlls/kernel/local16.c 2005-08-10 12:59:20.000000000 +0200 +++ wine-20050930/dlls/kernel/local16.c 2005-09-25 17:23:21.000000000 +0200 @@ -346,42 +346,42 @@ if (!pInfo) { - DPRINTF( "Local Heap corrupted! ds=%04x\n", ds ); + ERR( "Local Heap corrupted! ds=%04x\n", ds ); return; } - DPRINTF( "Local Heap ds=%04x first=%04x last=%04x items=%d\n", + TRACE( "Local Heap ds=%04x first=%04x last=%04x items=%d\n", ds, pInfo->first, pInfo->last, pInfo->items ); arena = pInfo->first; for (;;) { LOCALARENA *pArena = ARENA_PTR(ptr,arena); - DPRINTF( " %04x: prev=%04x next=%04x type=%d\n", arena, - pArena->prev & ~3, pArena->next, pArena->prev & 3 ); + TRACE( " %04x: prev=%04x next=%04x type=%d\n", arena, + pArena->prev & ~3, pArena->next, pArena->prev & 3 ); if (arena == pInfo->first) { - DPRINTF( " size=%d free_prev=%04x free_next=%04x\n", + TRACE( " size=%d free_prev=%04x free_next=%04x\n", pArena->size, pArena->free_prev, pArena->free_next ); } if ((pArena->prev & 3) == LOCAL_ARENA_FREE) { - DPRINTF( " size=%d free_prev=%04x free_next=%04x\n", + TRACE( " size=%d free_prev=%04x free_next=%04x\n", pArena->size, pArena->free_prev, pArena->free_next ); if (pArena->next == arena) break; /* last one */ if (ARENA_PTR(ptr,pArena->free_next)->free_prev != arena) { - DPRINTF( "*** arena->free_next->free_prev != arena\n" ); + TRACE( "*** arena->free_next->free_prev != arena\n" ); break; } } if (pArena->next == arena) { - DPRINTF( "*** last block is not marked free\n" ); + TRACE( "*** last block is not marked free\n" ); break; } if ((ARENA_PTR(ptr,pArena->next)->prev & ~3) != arena) { - DPRINTF( "*** arena->next->prev != arena (%04x, %04x)\n", + TRACE( "*** arena->next->prev != arena (%04x, %04x)\n", pArena->next, ARENA_PTR(ptr,pArena->next)->prev); break; } @@ -1624,7 +1624,7 @@ LOCAL_PrintHeap( ds ); return 0; } - TRACE("(%04x): %08lx\n", ds, (DWORD)func ); + TRACE("(%04x): %p\n", ds, func ); FIXME("Half implemented\n"); oldNotify = pInfo->notify; pInfo->notify = func; @@ -1768,8 +1768,8 @@ segSize++; } - if ( heapSize == -1L ) - heapSize = 1024L*1024L; /* FIXME */ + if ( heapSize == (DWORD)-1 ) + heapSize = 1024*1024; /* FIXME */ heapSize = (heapSize + 0xffff) & 0xffff0000; segSize = (segSize + 0x0fff) & 0xfffff000; diff -urN wine-20050830/dlls/kernel/locale.c wine-20050930/dlls/kernel/locale.c --- wine-20050830/dlls/kernel/locale.c 2005-06-20 12:40:37.000000000 +0200 +++ wine-20050930/dlls/kernel/locale.c 2005-09-12 23:22:32.000000000 +0200 @@ -425,9 +425,9 @@ } l_data.n_found = 0; - strcpynAtoW(l_data.lang, Lang, sizeof(l_data.lang)); + strcpynAtoW(l_data.lang, Lang, sizeof(l_data.lang)/sizeof(WCHAR)); - if (Country) strcpynAtoW(l_data.country, Country, sizeof(l_data.country)); + if (Country) strcpynAtoW(l_data.country, Country, sizeof(l_data.country)/sizeof(WCHAR)); else l_data.country[0] = 0; EnumResourceLanguagesW(kernel32_handle, (LPCWSTR)RT_STRING, (LPCWSTR)LOCALE_ILANGUAGE, @@ -1820,7 +1820,7 @@ TRACE("(%p,%08lx)\n", lpfnLocaleEnum, dwFlags); EnumResourceLanguagesA( kernel32_handle, (LPSTR)RT_STRING, (LPCSTR)LOCALE_ILANGUAGE, enum_lang_proc_a, - (LONG)lpfnLocaleEnum); + (LONG_PTR)lpfnLocaleEnum); return TRUE; } @@ -1835,7 +1835,7 @@ TRACE("(%p,%08lx)\n", lpfnLocaleEnum, dwFlags); EnumResourceLanguagesW( kernel32_handle, (LPWSTR)RT_STRING, (LPCWSTR)LOCALE_ILANGUAGE, enum_lang_proc_w, - (LONG)lpfnLocaleEnum); + (LONG_PTR)lpfnLocaleEnum); return TRUE; } @@ -2683,7 +2683,7 @@ static BOOL NLS_GetLanguageGroupName(LGRPID lgrpid, LPWSTR szName, ULONG nameSize) { LANGID langId; - LPCWSTR szResourceName = (LPCWSTR)(((lgrpid + 0x2000) >> 4) + 1); + LPCWSTR szResourceName = MAKEINTRESOURCEW(((lgrpid + 0x2000) >> 4) + 1); HRSRC hResource; BOOL bRet = FALSE; diff -urN wine-20050830/dlls/kernel/module.c wine-20050930/dlls/kernel/module.c --- wine-20050830/dlls/kernel/module.c 2005-08-12 18:00:42.000000000 +0200 +++ wine-20050930/dlls/kernel/module.c 2005-09-22 12:44:40.000000000 +0200 @@ -45,8 +45,6 @@ #include "wine/server.h" WINE_DEFAULT_DEBUG_CHANNEL(module); -WINE_DECLARE_DEBUG_CHANNEL(loaddll); - static WCHAR *dll_directory; /* extra path for SetDllDirectoryW */ @@ -55,7 +53,7 @@ { 0, 0, &dlldir_section, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": dlldir_section") } + 0, 0, { (DWORD_PTR)(__FILE__ ": dlldir_section") } }; static CRITICAL_SECTION dlldir_section = { &critsect_debug, -1, 0, 0, 0, 0 }; @@ -941,7 +939,7 @@ nts = LdrGetProcedureAddress( hModule, &str, 0, (void**)&fp ); } else - nts = LdrGetProcedureAddress( hModule, NULL, (DWORD)function, (void**)&fp ); + nts = LdrGetProcedureAddress( hModule, NULL, LOWORD(function), (void**)&fp ); if (nts != STATUS_SUCCESS) { SetLastError( RtlNtStatusToDosError( nts ) ); diff -urN wine-20050830/dlls/kernel/ne_module.c wine-20050930/dlls/kernel/ne_module.c --- wine-20050830/dlls/kernel/ne_module.c 2005-07-22 11:03:14.000000000 +0200 +++ wine-20050930/dlls/kernel/ne_module.c 2005-09-25 17:23:21.000000000 +0200 @@ -112,8 +112,15 @@ call = GlobalLock16( pSeg->hSeg ); - if (call->flatcs != wine_get_cs()) /* need to patch cs values */ - for (i = 0; call[i].pushl == 0x68; i++) call[i].flatcs = wine_get_cs(); + /* patch glue code address and code selector */ + for (i = 0; call[i].pushl == 0x68; i++) + { + if (call[i].ret[0] == 0xca66 || call[i].ret[0] == 0xcb66) /* register entry point? */ + call[i].glue = __wine_call_from_16_regs; + else + call[i].glue = __wine_call_from_16; + call[i].flatcs = wine_get_cs(); + } if (TRACE_ON(relay)) /* patch relay functions to all point to relay_call_from_16 */ for (i = 0; call[i].pushl == 0x68; i++) call[i].relay = relay_call_from_16; @@ -172,7 +179,7 @@ /* check the dll file name */ if (!NE_strcasecmp( builtin_dlls[i].file_name, dllname ) || /* check the dll module name (without extension) */ - (!NE_strncasecmp( dllname, name_table+1, *name_table ) && + (!NE_strncasecmp( dllname, (const char*)name_table+1, *name_table ) && !strcmp( dllname + *name_table, ".dll" ))) { *file_name = builtin_dlls[i].file_name; @@ -256,72 +263,72 @@ if (!(pModule = NE_GetPtr( hModule ))) { - MESSAGE( "**** %04x is not a module handle\n", hModule ); + ERR( "**** %04x is not a module handle\n", hModule ); return; } /* Dump the module info */ - DPRINTF( "---\n" ); - DPRINTF( "Module %04x:\n", hModule ); - DPRINTF( "count=%d flags=%04x heap=%d stack=%d\n", + TRACE( "---\n" ); + TRACE( "Module %04x:\n", hModule ); + TRACE( "count=%d flags=%04x heap=%d stack=%d\n", pModule->count, pModule->ne_flags, pModule->ne_heap, pModule->ne_stack ); - DPRINTF( "cs:ip=%04x:%04x ss:sp=%04x:%04x ds=%04x nb seg=%d modrefs=%d\n", + TRACE( "cs:ip=%04x:%04x ss:sp=%04x:%04x ds=%04x nb seg=%d modrefs=%d\n", SELECTOROF(pModule->ne_csip), OFFSETOF(pModule->ne_csip), SELECTOROF(pModule->ne_sssp), OFFSETOF(pModule->ne_sssp), pModule->ne_autodata, pModule->ne_cseg, pModule->ne_cmod ); - DPRINTF( "os_flags=%d swap_area=%d version=%04x\n", + TRACE( "os_flags=%d swap_area=%d version=%04x\n", pModule->ne_exetyp, pModule->ne_swaparea, pModule->ne_expver ); if (pModule->ne_flags & NE_FFLAGS_WIN32) - DPRINTF( "PE module=%p\n", pModule->module32 ); + TRACE( "PE module=%p\n", pModule->module32 ); /* Dump the file info */ - DPRINTF( "---\n" ); - DPRINTF( "Filename: '%s'\n", NE_MODULE_NAME(pModule) ); + TRACE( "---\n" ); + TRACE( "Filename: '%s'\n", NE_MODULE_NAME(pModule) ); /* Dump the segment table */ - DPRINTF( "---\n" ); - DPRINTF( "Segment table:\n" ); + TRACE( "---\n" ); + TRACE( "Segment table:\n" ); pSeg = NE_SEG_TABLE( pModule ); for (i = 0; i < pModule->ne_cseg; i++, pSeg++) - DPRINTF( "%02x: pos=%d size=%d flags=%04x minsize=%d hSeg=%04x\n", + TRACE( "%02x: pos=%d size=%d flags=%04x minsize=%d hSeg=%04x\n", i + 1, pSeg->filepos, pSeg->size, pSeg->flags, pSeg->minsize, pSeg->hSeg ); /* Dump the resource table */ - DPRINTF( "---\n" ); - DPRINTF( "Resource table:\n" ); + TRACE( "---\n" ); + TRACE( "Resource table:\n" ); if (pModule->ne_rsrctab) { pword = (WORD *)((BYTE *)pModule + pModule->ne_rsrctab); - DPRINTF( "Alignment: %d\n", *pword++ ); + TRACE( "Alignment: %d\n", *pword++ ); while (*pword) { NE_TYPEINFO *ptr = (NE_TYPEINFO *)pword; NE_NAMEINFO *pname = (NE_NAMEINFO *)(ptr + 1); - DPRINTF( "id=%04x count=%d\n", ptr->type_id, ptr->count ); + TRACE( "id=%04x count=%d\n", ptr->type_id, ptr->count ); for (i = 0; i < ptr->count; i++, pname++) - DPRINTF( "offset=%d len=%d id=%04x\n", + TRACE( "offset=%d len=%d id=%04x\n", pname->offset, pname->length, pname->id ); pword = (WORD *)pname; } } - else DPRINTF( "None\n" ); + else TRACE( "None\n" ); /* Dump the resident name table */ - DPRINTF( "---\n" ); - DPRINTF( "Resident-name table:\n" ); - pstr = (char *)pModule + pModule->ne_restab; + TRACE( "---\n" ); + TRACE( "Resident-name table:\n" ); + pstr = (BYTE*) pModule + pModule->ne_restab; while (*pstr) { - DPRINTF( "%*.*s: %d\n", *pstr, *pstr, pstr + 1, + TRACE( "%*.*s: %d\n", *pstr, *pstr, pstr + 1, *(WORD *)(pstr + *pstr + 1) ); pstr += *pstr + 1 + sizeof(WORD); } /* Dump the module reference table */ - DPRINTF( "---\n" ); - DPRINTF( "Module ref table:\n" ); + TRACE( "---\n" ); + TRACE( "Module ref table:\n" ); if (pModule->ne_modtab) { pword = (WORD *)((BYTE *)pModule + pModule->ne_modtab); @@ -329,43 +336,43 @@ { char name[10]; GetModuleName16( *pword, name, sizeof(name) ); - DPRINTF( "%d: %04x -> '%s'\n", i, *pword, name ); + TRACE( "%d: %04x -> '%s'\n", i, *pword, name ); } } - else DPRINTF( "None\n" ); + else TRACE( "None\n" ); /* Dump the entry table */ - DPRINTF( "---\n" ); - DPRINTF( "Entry table:\n" ); + TRACE( "---\n" ); + TRACE( "Entry table:\n" ); bundle = (ET_BUNDLE *)((BYTE *)pModule+pModule->ne_enttab); do { entry = (ET_ENTRY *)((BYTE *)bundle+6); - DPRINTF( "Bundle %d-%d: %02x\n", bundle->first, bundle->last, entry->type); + TRACE( "Bundle %d-%d: %02x\n", bundle->first, bundle->last, entry->type); ordinal = bundle->first; while (ordinal < bundle->last) { if (entry->type == 0xff) - DPRINTF("%d: %02x:%04x (moveable)\n", ordinal++, entry->segnum, entry->offs); + TRACE("%d: %02x:%04x (moveable)\n", ordinal++, entry->segnum, entry->offs); else - DPRINTF("%d: %02x:%04x (fixed)\n", ordinal++, entry->segnum, entry->offs); + TRACE("%d: %02x:%04x (fixed)\n", ordinal++, entry->segnum, entry->offs); entry++; } } while ( (bundle->next) && (bundle = ((ET_BUNDLE *)((BYTE *)pModule + bundle->next))) ); /* Dump the non-resident names table */ - DPRINTF( "---\n" ); - DPRINTF( "Non-resident names table:\n" ); + TRACE( "---\n" ); + TRACE( "Non-resident names table:\n" ); if (pModule->nrname_handle) { - pstr = (char *)GlobalLock16( pModule->nrname_handle ); + pstr = GlobalLock16( pModule->nrname_handle ); while (*pstr) { - DPRINTF( "%*.*s: %d\n", *pstr, *pstr, pstr + 1, + TRACE( "%*.*s: %d\n", *pstr, *pstr, pstr + 1, *(WORD *)(pstr + *pstr + 1) ); pstr += *pstr + 1 + sizeof(WORD); } } - DPRINTF( "\n" ); + TRACE( "\n" ); } @@ -428,7 +435,8 @@ */ WORD NE_GetOrdinal( HMODULE16 hModule, const char *name ) { - unsigned char buffer[256], *cpnt; + char buffer[256], *p; + BYTE *cpnt; BYTE len; NE_MODULE *pModule; @@ -444,18 +452,18 @@ /* Now copy and uppercase the string */ strcpy( buffer, name ); - for (cpnt = buffer; *cpnt; cpnt++) *cpnt = RtlUpperChar(*cpnt); - len = cpnt - buffer; + for (p = buffer; *p; p++) *p = RtlUpperChar(*p); + len = p - buffer; /* First search the resident names */ - cpnt = (char *)pModule + pModule->ne_restab; + cpnt = (BYTE *)pModule + pModule->ne_restab; /* Skip the first entry (module name) */ cpnt += *cpnt + 1 + sizeof(WORD); while (*cpnt) { - if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len )) + if ((*cpnt == len) && !memcmp( cpnt+1, buffer, len )) { WORD ordinal; memcpy( &ordinal, cpnt + *cpnt + 1, sizeof(ordinal) ); @@ -468,13 +476,13 @@ /* Now search the non-resident names table */ if (!pModule->nrname_handle) return 0; /* No non-resident table */ - cpnt = (char *)GlobalLock16( pModule->nrname_handle ); + cpnt = GlobalLock16( pModule->nrname_handle ); /* Skip the first entry (module description string) */ cpnt += *cpnt + 1 + sizeof(WORD); while (*cpnt) { - if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len )) + if ((*cpnt == len) && !memcmp( cpnt+1, buffer, len )) { WORD ordinal; memcpy( &ordinal, cpnt + *cpnt + 1, sizeof(ordinal) ); @@ -1197,6 +1205,8 @@ LPSTR cmdline; WORD cmdShow; + if (name == NULL) return 0; + /* Load module */ if ( (hModule = NE_GetModuleByFilename(name) ) != 0 ) @@ -1489,7 +1499,7 @@ if (pModule->ne_flags & NE_FFLAGS_WIN32) continue; name_table = (BYTE *)pModule + pModule->ne_restab; - if ((*name_table == len) && !strncmp(name, name_table+1, len)) + if ((*name_table == len) && !strncmp(name, (char*) name_table+1, len)) return hModule; } @@ -1511,7 +1521,7 @@ * 'i' compare is just a quickfix until the loader handles that * correctly. -MM 990705 */ - if ((*name_table == len) && !NE_strncasecmp(tmpstr, name_table+1, len)) + if ((*name_table == len) && !NE_strncasecmp(tmpstr, (const char*)name_table+1, len)) return hModule; } @@ -1739,7 +1749,7 @@ ret = NE_GetEntryPoint( hModule, ordinal ); - TRACE("returning %08x\n", (UINT)ret ); + TRACE("returning %p\n", ret ); return ret; } @@ -1863,7 +1873,7 @@ if (pModule->ne_flags & NE_FFLAGS_WIN32) continue; name_table = (BYTE *)pModule + pModule->ne_restab; - if ((*name_table == len) && !NE_strncasecmp(s, name_table+1, len)) + if ((*name_table == len) && !NE_strncasecmp(s, (const char*)name_table+1, len)) return hModule; } diff -urN wine-20050830/dlls/kernel/ne_segment.c wine-20050930/dlls/kernel/ne_segment.c --- wine-20050830/dlls/kernel/ne_segment.c 2005-08-17 12:28:35.000000000 +0200 +++ wine-20050930/dlls/kernel/ne_segment.c 2005-09-27 13:03:18.000000000 +0200 @@ -385,16 +385,19 @@ 0xff00 - sizeof(STACK16FRAME)); hFile16 = NE_OpenFile( pModule ); - TRACE_(dll)("CallLoadAppSegProc(hmodule=0x%04x,hf=%x,segnum=%d\n", + TRACE_(dll)("Call LoadAppSegProc(hmodule=0x%04x,hf=%x,segnum=%d)\n", pModule->self,hFile16,segnum ); args[2] = pModule->self; args[1] = hFile16; args[0] = segnum; WOWCallback16Ex( (DWORD)selfloadheader->LoadAppSeg, WCB16_PASCAL, sizeof(args), args, &ret ); pSeg->hSeg = LOWORD(ret); - TRACE_(dll)("Ret CallLoadAppSegProc: hSeg = 0x%04x\n", pSeg->hSeg); + TRACE_(dll)("Ret LoadAppSegProc: hSeg=0x%04x\n", pSeg->hSeg); _lclose16( hFile16 ); NtCurrentTeb()->WOW32Reserved = oldstack; + + pSeg->flags |= NE_SEGFLAGS_LOADED; + return TRUE; } else if (!(pSeg->flags & NE_SEGFLAGS_ITERATED)) { @@ -539,47 +542,45 @@ bundle = (ET_BUNDLE *)((BYTE *)pModule+pModule->ne_enttab); do { - TRACE("num_entries: %d, bundle: %p, next: %04x, pSeg: %p\n", bundle->last - bundle->first, bundle, bundle->next, pSeg); - if (!(num_entries = bundle->last - bundle->first)) - return; - entry = (ET_ENTRY *)((BYTE *)bundle+6); - while (num_entries--) - { - /*TRACE("entry: %p, entry->segnum: %d, entry->offs: %04x\n", entry, entry->segnum, entry->offs);*/ - if (entry->segnum == segnum) - { - pFunc = ((BYTE *)pSeg+entry->offs); - TRACE("pFunc: %p, *(DWORD *)pFunc: %08lx, num_entries: %d\n", pFunc, *(DWORD *)pFunc, num_entries); - if (*(pFunc+2) == 0x90) + TRACE("num_entries: %d, bundle: %p, next: %04x, pSeg: %p\n", bundle->last - bundle->first, bundle, bundle->next, pSeg); + if (!(num_entries = bundle->last - bundle->first)) + return; + entry = (ET_ENTRY *)((BYTE *)bundle+6); + while (num_entries--) { - if (*(WORD *)pFunc == 0x581e) /* push ds, pop ax */ - { - TRACE("patch %04x:%04x -> mov ax, ds\n", sel, entry->offs); - *(WORD *)pFunc = 0xd88c; /* mov ax, ds */ - } + /*TRACE("entry: %p, entry->segnum: %d, entry->offs: %04x\n", entry, entry->segnum, entry->offs);*/ + if (entry->segnum == segnum) + { + pFunc = ((BYTE *)pSeg+entry->offs); + TRACE("pFunc: %p, *(DWORD *)pFunc: %08lx, num_entries: %d\n", pFunc, *(DWORD *)pFunc, num_entries); + if (*(pFunc+2) == 0x90) + { + if (*(WORD *)pFunc == 0x581e) /* push ds, pop ax */ + { + TRACE("patch %04x:%04x -> mov ax, ds\n", sel, entry->offs); + *(WORD *)pFunc = 0xd88c; /* mov ax, ds */ + } - if (*(WORD *)pFunc == 0xd88c) + if (*(WORD *)pFunc == 0xd88c) + { + if ((entry->flags & 2)) /* public data ? */ { - if ((entry->flags & 2)) /* public data ? */ + TRACE("patch %04x:%04x -> mov ax, dgroup [%04x]\n", sel, entry->offs, dgroup); + *pFunc = 0xb8; /* mov ax, */ + *(WORD *)(pFunc+1) = dgroup; + } + else if ((pModule->ne_flags & NE_FFLAGS_MULTIPLEDATA) + && (entry->flags & 1)) /* exported ? */ { - TRACE("patch %04x:%04x -> mov ax, dgroup [%04x]\n", sel, entry->offs, dgroup); - *pFunc = 0xb8; /* mov ax, */ - *(WORD *)(pFunc+1) = dgroup; - } - else - if ((pModule->ne_flags & NE_FFLAGS_MULTIPLEDATA) - && (entry->flags & 1)) /* exported ? */ - { - TRACE("patch %04x:%04x -> nop, nop\n", sel, entry->offs); - *(WORD *)pFunc = 0x9090; /* nop, nop */ - } + TRACE("patch %04x:%04x -> nop, nop\n", sel, entry->offs); + *(WORD *)pFunc = 0x9090; /* nop, nop */ + } } - } + } } - entry++; - } - } while ( (bundle->next) - && (bundle = ((ET_BUNDLE *)((BYTE *)pModule + bundle->next))) ); + entry++; + } + } while ( (bundle->next) && (bundle = ((ET_BUNDLE *)((BYTE *)pModule + bundle->next))) ); } diff -urN wine-20050830/dlls/kernel/path.c wine-20050930/dlls/kernel/path.c --- wine-20050830/dlls/kernel/path.c 2005-08-11 13:07:17.000000000 +0200 +++ wine-20050930/dlls/kernel/path.c 2005-09-26 15:26:40.000000000 +0200 @@ -849,18 +849,23 @@ */ BOOL WINAPI CopyFileW( LPCWSTR source, LPCWSTR dest, BOOL fail_if_exists ) { + static const int buffer_size = 65536; HANDLE h1, h2; BY_HANDLE_FILE_INFORMATION info; - FILETIME filetime; DWORD count; BOOL ret = FALSE; - char buffer[2048]; + char *buffer; if (!source || !dest) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, buffer_size ))) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } TRACE("%s -> %s\n", debugstr_w(source), debugstr_w(dest)); @@ -887,7 +892,7 @@ return FALSE; } - while (ReadFile( h1, buffer, sizeof(buffer), &count, NULL ) && count) + while (ReadFile( h1, buffer, buffer_size, &count, NULL ) && count) { char *p = buffer; while (count != 0) @@ -901,9 +906,8 @@ ret = TRUE; done: /* Maintain the timestamp of source file to destination file */ - GetFileTime(h1, NULL, NULL, &filetime); - SetFileTime(h2, NULL, NULL, &filetime); - + SetFileTime(h2, NULL, NULL, &info.ftLastWriteTime); + HeapFree( GetProcessHeap(), 0, buffer ); CloseHandle( h1 ); CloseHandle( h2 ); return ret; @@ -1122,7 +1126,13 @@ BOOL ret; if (!(sourceW = FILE_name_AtoW( source, FALSE ))) return FALSE; - if (!(destW = FILE_name_AtoW( dest, TRUE ))) return FALSE; + if (dest) + { + if (!(destW = FILE_name_AtoW( dest, TRUE ))) return FALSE; + } + else + destW = NULL; + ret = MoveFileExW( sourceW, destW, flag ); HeapFree( GetProcessHeap(), 0, destW ); return ret; diff -urN wine-20050830/dlls/kernel/process.c wine-20050930/dlls/kernel/process.c --- wine-20050830/dlls/kernel/process.c 2005-08-23 20:20:59.000000000 +0200 +++ wine-20050930/dlls/kernel/process.c 2005-09-28 20:34:00.000000000 +0200 @@ -310,7 +310,7 @@ void *module; OBJECT_ATTRIBUTES attr; LARGE_INTEGER size; - DWORD len = 0; + SIZE_T len = 0; attr.Length = sizeof(attr); attr.RootDirectory = 0; @@ -362,7 +362,7 @@ */ static BOOL build_initial_environment( char **environ ) { - ULONG size = 1; + SIZE_T size = 1; char **e; WCHAR *p, *endptr; void *ptr; @@ -738,7 +738,7 @@ { BOOL ret; void *ptr; - DWORD size, env_size, info_size; + SIZE_T size, env_size, info_size; HANDLE hstdin, hstdout, hstderr; size = info_size = params->AllocationSize; @@ -933,12 +933,9 @@ { static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2',0}; PEB *peb = NtCurrentTeb()->Peb; - extern void __wine_dbg_kernel32_init(void); PTHREAD_Init(); - __wine_dbg_kernel32_init(); /* hack: register debug channels early */ - setbuf(stdout,NULL); setbuf(stderr,NULL); setlocale(LC_CTYPE,""); @@ -2076,15 +2073,8 @@ void WINAPI ExitProcess( DWORD status ) { LdrShutdownProcess(); - SERVER_START_REQ( terminate_process ) - { - /* send the exit code to the server */ - req->handle = GetCurrentProcess(); - req->exit_code = status; - wine_server_call( req ); - } - SERVER_END_REQ; - exit( status ); + NtTerminateProcess(GetCurrentProcess(), status); + exit(status); } @@ -2143,18 +2133,18 @@ RtlAcquirePebLock(); index = RtlFindClearBitsAndSet( peb->TlsBitmap, 1, 0 ); - if (index != ~0UL) NtCurrentTeb()->TlsSlots[index] = 0; /* clear the value */ + if (index != ~0U) NtCurrentTeb()->TlsSlots[index] = 0; /* clear the value */ else { index = RtlFindClearBitsAndSet( peb->TlsExpansionBitmap, 1, 0 ); - if (index != ~0UL) + if (index != ~0U) { if (!NtCurrentTeb()->TlsExpansionSlots && !(NtCurrentTeb()->TlsExpansionSlots = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 8 * sizeof(peb->TlsExpansionBitmapBits) * sizeof(void*) ))) { RtlClearBits( peb->TlsExpansionBitmap, index, 1 ); - index = ~0UL; + index = ~0U; SetLastError( ERROR_NOT_ENOUGH_MEMORY ); } else @@ -2614,16 +2604,38 @@ */ BOOL WINAPI SetPriorityClass( HANDLE hprocess, DWORD priorityclass ) { - BOOL ret; - SERVER_START_REQ( set_process_info ) + NTSTATUS status; + PROCESS_PRIORITY_CLASS ppc; + + ppc.Foreground = FALSE; + switch (priorityclass) { - req->handle = hprocess; - req->priority = priorityclass; - req->mask = SET_PROCESS_INFO_PRIORITY; - ret = !wine_server_call_err( req ); + case IDLE_PRIORITY_CLASS: + ppc.PriorityClass = PROCESS_PRIOCLASS_IDLE; break; + case BELOW_NORMAL_PRIORITY_CLASS: + ppc.PriorityClass = PROCESS_PRIOCLASS_BELOW_NORMAL; break; + case NORMAL_PRIORITY_CLASS: + ppc.PriorityClass = PROCESS_PRIOCLASS_NORMAL; break; + case ABOVE_NORMAL_PRIORITY_CLASS: + ppc.PriorityClass = PROCESS_PRIOCLASS_ABOVE_NORMAL; break; + case HIGH_PRIORITY_CLASS: + ppc.PriorityClass = PROCESS_PRIOCLASS_HIGH; break; + case REALTIME_PRIORITY_CLASS: + ppc.PriorityClass = PROCESS_PRIOCLASS_REALTIME; break; + default: + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; } - SERVER_END_REQ; - return ret; + + status = NtSetInformationProcess(hprocess, ProcessPriorityClass, + &ppc, sizeof(ppc)); + + if (status != STATUS_SUCCESS) + { + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; + } + return TRUE; } @@ -2637,8 +2649,21 @@ status = NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); - if (status == STATUS_SUCCESS) return pbi.BasePriority; - SetLastError( RtlNtStatusToDosError(status) ); + if (status != STATUS_SUCCESS) + { + SetLastError( RtlNtStatusToDosError(status) ); + return 0; + } + switch (pbi.BasePriority) + { + case PROCESS_PRIOCLASS_IDLE: return IDLE_PRIORITY_CLASS; + case PROCESS_PRIOCLASS_BELOW_NORMAL: return BELOW_NORMAL_PRIORITY_CLASS; + case PROCESS_PRIOCLASS_NORMAL: return NORMAL_PRIORITY_CLASS; + case PROCESS_PRIOCLASS_ABOVE_NORMAL: return ABOVE_NORMAL_PRIORITY_CLASS; + case PROCESS_PRIOCLASS_HIGH: return HIGH_PRIORITY_CLASS; + case PROCESS_PRIOCLASS_REALTIME: return REALTIME_PRIORITY_CLASS; + } + SetLastError( ERROR_INVALID_PARAMETER ); return 0; } @@ -2648,16 +2673,16 @@ */ BOOL WINAPI SetProcessAffinityMask( HANDLE hProcess, DWORD_PTR affmask ) { - BOOL ret; - SERVER_START_REQ( set_process_info ) + NTSTATUS status; + + status = NtSetInformationProcess(hProcess, ProcessAffinityMask, + &affmask, sizeof(DWORD_PTR)); + if (!status) { - req->handle = hProcess; - req->affinity = affmask; - req->mask = SET_PROCESS_INFO_AFFINITY; - ret = !wine_server_call_err( req ); + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; } - SERVER_END_REQ; - return ret; + return TRUE; } @@ -2665,22 +2690,24 @@ * GetProcessAffinityMask (KERNEL32.@) */ BOOL WINAPI GetProcessAffinityMask( HANDLE hProcess, - LPDWORD lpProcessAffinityMask, - LPDWORD lpSystemAffinityMask ) + PDWORD_PTR lpProcessAffinityMask, + PDWORD_PTR lpSystemAffinityMask ) { - BOOL ret = FALSE; - SERVER_START_REQ( get_process_info ) + PROCESS_BASIC_INFORMATION pbi; + NTSTATUS status; + + status = NtQueryInformationProcess(hProcess, + ProcessBasicInformation, + &pbi, sizeof(pbi), NULL); + if (status) { - req->handle = hProcess; - if (!wine_server_call_err( req )) - { - if (lpProcessAffinityMask) *lpProcessAffinityMask = reply->process_affinity; - if (lpSystemAffinityMask) *lpSystemAffinityMask = reply->system_affinity; - ret = TRUE; - } + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; } - SERVER_END_REQ; - return ret; + if (lpProcessAffinityMask) *lpProcessAffinityMask = pbi.AffinityMask; + /* FIXME */ + if (lpSystemAffinityMask) *lpSystemAffinityMask = 1; + return TRUE; } diff -urN wine-20050830/dlls/kernel/profile.c wine-20050930/dlls/kernel/profile.c --- wine-20050830/dlls/kernel/profile.c 2005-08-10 14:59:38.000000000 +0200 +++ wine-20050930/dlls/kernel/profile.c 2005-09-09 12:19:45.000000000 +0200 @@ -91,7 +91,7 @@ { 0, 0, &PROFILE_CritSect, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": PROFILE_CritSect") } + 0, 0, { (DWORD_PTR)(__FILE__ ": PROFILE_CritSect") } }; static CRITICAL_SECTION PROFILE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 }; diff -urN wine-20050830/dlls/kernel/pthread.c wine-20050930/dlls/kernel/pthread.c --- wine-20050830/dlls/kernel/pthread.c 2005-06-20 12:40:37.000000000 +0200 +++ wine-20050930/dlls/kernel/pthread.c 2005-09-03 17:11:29.000000000 +0200 @@ -354,7 +354,7 @@ } } -int wine_pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *cond_attr) +static int wine_pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *cond_attr) { /* The same as for wine_pthread_mutex_init, we postpone initialization until condition is really used.*/ @@ -362,7 +362,7 @@ return 0; } -int wine_pthread_cond_destroy(pthread_cond_t *cond) +static int wine_pthread_cond_destroy(pthread_cond_t *cond) { wine_cond_detail *detail = ((wine_cond)cond)->cond; @@ -375,7 +375,7 @@ return 0; } -int wine_pthread_cond_signal(pthread_cond_t *cond) +static int wine_pthread_cond_signal(pthread_cond_t *cond) { int have_waiters; wine_cond_detail *detail; @@ -394,7 +394,7 @@ return 0; } -int wine_pthread_cond_broadcast(pthread_cond_t *cond) +static int wine_pthread_cond_broadcast(pthread_cond_t *cond) { int have_waiters = 0; wine_cond_detail *detail; @@ -438,7 +438,7 @@ return 0; } -int wine_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +static int wine_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { wine_cond_detail *detail; int last_waiter; @@ -474,8 +474,8 @@ return 0; } -int wine_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime) +static int wine_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime) { DWORD ms = abstime->tv_sec * 1000 + abstime->tv_nsec / 1000000; int last_waiter; @@ -539,9 +539,8 @@ kernel_get_thread_data()->pthread_data = data; } -static const struct wine_pthread_functions functions = +static const struct wine_pthread_callbacks callbacks = { - sizeof(functions), /* size */ wine_get_thread_data, /* ptr_get_thread_data */ wine_set_thread_data, /* ptr_set_thread_data */ wine_pthread_self, /* ptr_pthread_self */ @@ -571,9 +570,12 @@ wine_pthread_cond_timedwait /* ptr_pthread_cond_timedwait */ }; +static struct wine_pthread_functions pthread_functions; + void PTHREAD_Init(void) { - wine_pthread_init_process( &functions ); + wine_pthread_get_functions( &pthread_functions, sizeof(pthread_functions) ); + pthread_functions.init_process( &callbacks, sizeof(callbacks) ); } #endif /* HAVE_PTHREAD_H */ diff -urN wine-20050830/dlls/kernel/relay16.c wine-20050930/dlls/kernel/relay16.c --- wine-20050830/dlls/kernel/relay16.c 2005-08-17 12:28:35.000000000 +0200 +++ wine-20050930/dlls/kernel/relay16.c 2005-09-18 14:25:23.000000000 +0200 @@ -277,7 +277,7 @@ /* Retrieve entry point call structure */ p = MapSL( MAKESEGPTR( frame->module_cs, frame->callfrom_ip ) ); /* p now points to lret, get the start of CALLFROM16 structure */ - return (CALLFROM16 *)(p - (BYTE *)&((CALLFROM16 *)0)->lret); + return (CALLFROM16 *)(p - (BYTE *)&((CALLFROM16 *)0)->ret); } @@ -304,10 +304,14 @@ static int relay_call_from_16_no_debug( void *entry_point, unsigned char *args16, CONTEXT86 *context, const CALLFROM16 *call ) { - int i, nb_args, args32[20]; + unsigned int i, j, nb_args = 0; + int args32[20]; - nb_args = 0; - if (call->lret == 0xcb66) /* cdecl */ + /* look for the ret instruction */ + for (j = 0; j < sizeof(call->ret)/sizeof(call->ret[0]); j++) + if (call->ret[j] == 0xca66 || call->ret[j] == 0xcb66) break; + + if (call->ret[j] == 0xcb66) /* cdecl */ { for (i = 0; i < 20; i++, nb_args++) { @@ -345,7 +349,7 @@ else /* not cdecl */ { /* Start with the last arg */ - args16 += call->nArgs; + args16 += call->ret[j + 1]; for (i = 0; i < 20; i++, nb_args++) { int type = (call->arg_types[i / 10] >> (3 * (i % 10))) & 7; @@ -377,7 +381,8 @@ } } - if (call->arg_types[0] & ARG_REGISTER) args32[nb_args++] = (int)context; + if (!j) /* register function */ + args32[nb_args++] = (int)context; SYSLEVEL_CheckNotLevel( 2 ); @@ -394,7 +399,8 @@ { STACK16FRAME *frame; WORD ordinal; - int i, ret_val, nb_args, args32[20]; + unsigned int i, j, nb_args = 0; + int ret_val, args32[20]; char module[10], func[64]; const CALLFROM16 *call; @@ -405,8 +411,11 @@ DPRINTF( "%04lx:Call %s.%d: %s(",GetCurrentThreadId(), module, ordinal, func ); - nb_args = 0; - if (call->lret == 0xcb66) /* cdecl */ + /* look for the ret instruction */ + for (j = 0; j < sizeof(call->ret)/sizeof(call->ret[0]); j++) + if (call->ret[j] == 0xca66 || call->ret[j] == 0xcb66) break; + + if (call->ret[j] == 0xcb66) /* cdecl */ { for (i = 0; i < 20; i++, nb_args++) { @@ -460,7 +469,7 @@ else /* not cdecl */ { /* Start with the last arg */ - args16 += call->nArgs; + args16 += call->ret[j + 1]; for (i = 0; i < 20; i++, nb_args++) { int type = (call->arg_types[i / 10] >> (3 * (i % 10))) & 7; @@ -513,7 +522,7 @@ DPRINTF( ") ret=%04x:%04x ds=%04x\n", frame->cs, frame->ip, frame->ds ); - if (call->arg_types[0] & ARG_REGISTER) + if (!j) /* register function */ { args32[nb_args++] = (int)context; DPRINTF(" AX=%04x BX=%04x CX=%04x DX=%04x SI=%04x DI=%04x ES=%04x EFL=%08lx\n", @@ -529,7 +538,7 @@ SYSLEVEL_CheckNotLevel( 2 ); DPRINTF( "%04lx:Ret %s.%d: %s() ",GetCurrentThreadId(), module, ordinal, func ); - if (call->arg_types[0] & ARG_REGISTER) + if (!j) /* register function */ { DPRINTF("retval=none ret=%04x:%04x ds=%04x\n", (WORD)context->SegCs, LOWORD(context->Eip), (WORD)context->SegDs); @@ -541,7 +550,7 @@ else { frame = CURRENT_STACK16; /* might have be changed by the entry point */ - if (call->arg_types[0] & ARG_RET16) + if (j == 1) /* 16-bit return sequence */ DPRINTF( "retval=%04x ret=%04x:%04x ds=%04x\n", ret_val & 0xffff, frame->cs, frame->ip, frame->ds ); else @@ -559,22 +568,6 @@ */ /*********************************************************************** - * __wine_call_from_16_word (KERNEL32.@) - */ -WORD __wine_call_from_16_word() -{ - assert( FALSE ); -} - -/*********************************************************************** - * __wine_call_from_16_long (KERNEL32.@) - */ -LONG __wine_call_from_16_long() -{ - assert( FALSE ); -} - -/*********************************************************************** * __wine_call_from_16_regs (KERNEL32.@) */ void __wine_call_from_16_regs() diff -urN wine-20050830/dlls/kernel/resource16.c wine-20050930/dlls/kernel/resource16.c --- wine-20050830/dlls/kernel/resource16.c 2005-08-17 12:28:35.000000000 +0200 +++ wine-20050930/dlls/kernel/resource16.c 2005-09-12 23:22:32.000000000 +0200 @@ -150,7 +150,7 @@ */ static inline LPCSTR get_res_name( LPCSTR name ) { - if (HIWORD(name) && name[0] == '#') name = (LPCSTR)atoi( name + 1 ); + if (HIWORD(name) && name[0] == '#') name = MAKEINTRESOURCEA( atoi( name + 1 ) ); return name; } @@ -202,7 +202,7 @@ TRACE("NameTable entry: type=%04x id=%04x\n", pTypeInfo->type_id, pNameInfo->id ); handle = LoadResource16( pModule->self, - (HRSRC16)((int)pNameInfo - (int)pModule) ); + (HRSRC16)((char *)pNameInfo - (char *)pModule) ); for(p = (WORD*)LockResource16(handle); p && *p; p = (WORD *)((char*)p+*p)) { TRACE(" type=%04x '%s' id=%04x '%s'\n", @@ -226,7 +226,7 @@ if (strcasecmp( resId, (char*)(p+3)+strlen((char*)(p+3))+1 )) continue; } - else if (HIWORD(resId) || (((DWORD)resId & ~0x8000) != p[2])) + else if (HIWORD(resId) || ((LOWORD(resId) & ~0x8000) != p[2])) continue; /* If we get here, we've found the entry */ @@ -507,7 +507,7 @@ while (nbItems) { /* align on DWORD boundary (32-bit only) */ - dialog32 = (LPVOID)((((int)dialog32) + 3) & ~3); + dialog32 = (LPVOID)(((UINT_PTR)dialog32 + 3) & ~3); if (dialogEx) { @@ -636,7 +636,7 @@ while (nbItems) { /* align on DWORD boundary */ - p = (LPVOID)((((int)p) + 3) & ~3); + p = (LPVOID)(((UINT_PTR)p + 3) & ~3); if (dialogEx) { @@ -736,7 +736,7 @@ menu32 = (LPWSTR)menu32 + strlenW( (LPWSTR)menu32 ) + 1; /* align on DWORD boundary (32-bit only) */ - menu32 = (LPVOID)((((int)menu32) + 3) & ~3); + menu32 = (LPVOID)(((UINT_PTR)menu32 + 3) & ~3); /* If popup, transfer helpid */ if ( flags & 1) @@ -787,7 +787,7 @@ p = (LPWSTR)p + strlenW( (LPWSTR)p ) + 1; /* align on DWORD boundary (32-bit only) */ - p = (LPVOID)((((int)p) + 3) & ~3); + p = (LPVOID)(((UINT_PTR)p + 3) & ~3); /* If popup, skip helpid */ if ( flags & 1) @@ -970,7 +970,7 @@ if (!(pTypeInfo = NE_FindTypeSection( pResTab, pTypeInfo, type ))) break; if ((pNameInfo = NE_FindResourceFromType( pResTab, pTypeInfo, name ))) { - TRACE(" Found id %08lx\n", (DWORD)name ); + TRACE(" Found id %p\n", name ); return (HRSRC16)( (char *)pNameInfo - (char *)pModule ); } pTypeInfo = next_typeinfo(pTypeInfo); diff -urN wine-20050830/dlls/kernel/selector.c wine-20050930/dlls/kernel/selector.c --- wine-20050830/dlls/kernel/selector.c 2005-05-10 18:01:38.000000000 +0200 +++ wine-20050930/dlls/kernel/selector.c 2005-09-12 23:22:32.000000000 +0200 @@ -481,7 +481,7 @@ const void *base; SEGPTR ret = 0; - if (!HIWORD(ptr)) return (SEGPTR)ptr; + if (!HIWORD(ptr)) return (SEGPTR)LOWORD(ptr); base = (const char *)ptr - ((unsigned int)ptr & 0x7fff); HeapLock( GetProcessHeap() ); diff -urN wine-20050830/dlls/kernel/sync.c wine-20050930/dlls/kernel/sync.c --- wine-20050830/dlls/kernel/sync.c 2005-08-22 11:23:32.000000000 +0200 +++ wine-20050930/dlls/kernel/sync.c 2005-09-30 12:33:43.000000000 +0200 @@ -445,7 +445,8 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = (sa && sa->bInheritHandle) ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | + ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0); attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL; attr.SecurityQualityOfService = NULL; if (name) @@ -502,7 +503,7 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = inherit ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0); attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; if (name) @@ -639,7 +640,8 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = (sa && sa->bInheritHandle) ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | + ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0); attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL; attr.SecurityQualityOfService = NULL; if (name) @@ -687,7 +689,7 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = inherit ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0); attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; if (name) @@ -760,7 +762,8 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = (sa && sa->bInheritHandle) ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | + ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0); attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL; attr.SecurityQualityOfService = NULL; if (name) @@ -808,7 +811,7 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = inherit ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0); attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; if (name) @@ -874,7 +877,8 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = (sa && sa->bInheritHandle) ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | + ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0); attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL; attr.SecurityQualityOfService = NULL; if (name) @@ -923,7 +927,7 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = inherit ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0); attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; if (name) @@ -1104,7 +1108,8 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = &nt_name; - attr.Attributes = (sa && sa->bInheritHandle) ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | + ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0); attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL; attr.SecurityQualityOfService = NULL; @@ -1124,10 +1129,10 @@ SetLastError(0); - status = NtCreateNamedPipeFile(&handle, 0, &attr, &iosb, 0, FILE_OVERWRITE_IF, - options, pipe_type, read_mode, non_block, - nMaxInstances, nInBufferSize, nOutBufferSize, - &timeout); + status = NtCreateNamedPipeFile(&handle, GENERIC_READ|GENERIC_WRITE, &attr, &iosb, + 0, FILE_OVERWRITE_IF, options, pipe_type, + read_mode, non_block, nMaxInstances, + nInBufferSize, nOutBufferSize, &timeout); RtlFreeUnicodeString( &nt_name ); if (status) @@ -1310,50 +1315,34 @@ /*********************************************************************** * ConnectNamedPipe (KERNEL32.@) + * + * Connects to a named pipe + * + * Parameters + * hPipe: A handle to a named pipe returned by CreateNamedPipe + * overlapped: Optional OVERLAPPED struct + * + * Return values + * TRUE: Success + * FALSE: Failure, GetLastError can be called for further details */ BOOL WINAPI ConnectNamedPipe(HANDLE hPipe, LPOVERLAPPED overlapped) { - BOOL ret; - LPOVERLAPPED pov; - OVERLAPPED ov; + NTSTATUS status; + IO_STATUS_BLOCK status_block; TRACE("(%p,%p)\n", hPipe, overlapped); - if (!overlapped) - { - memset(&ov, 0, sizeof(ov)); - ov.hEvent = CreateEventW(NULL, 0, 0, NULL); - if (!ov.hEvent) return FALSE; - pov = &ov; - } - else pov = overlapped; - - pov->Internal = STATUS_PENDING; - - SERVER_START_REQ( connect_named_pipe ) - { - req->handle = hPipe; - req->overlapped = pov; - req->func = PIPE_CompletionWait; - ret = !wine_server_call_err( req ); - } - SERVER_END_REQ; + if(overlapped) + overlapped->Internal = STATUS_PENDING; - if (ret) - { - if (overlapped) - { - SetLastError( ERROR_IO_PENDING ); - ret = FALSE; - } - else - { - ret = GetOverlappedResult(hPipe, &ov, NULL, TRUE); - CloseHandle(ov.hEvent); - } - } + status = NtFsControlFile(hPipe, overlapped ? overlapped->hEvent : NULL, NULL, NULL, + overlapped ? (IO_STATUS_BLOCK *)overlapped : &status_block, + FSCTL_PIPE_LISTEN, NULL, 0, NULL, 0); - return ret; + if (status == STATUS_SUCCESS) return TRUE; + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; } /*********************************************************************** @@ -1544,31 +1533,58 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES sa, DWORD size ) { - static unsigned index = 0; - WCHAR name[64]; - HANDLE hr, hw; - unsigned in_index = index; + static unsigned index /* = 0 */; + WCHAR name[64]; + HANDLE hr, hw; + unsigned in_index = index; + UNICODE_STRING nt_name; + OBJECT_ATTRIBUTES attr; + NTSTATUS status; + IO_STATUS_BLOCK iosb; + LARGE_INTEGER timeout; *hReadPipe = *hWritePipe = INVALID_HANDLE_VALUE; + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.ObjectName = &nt_name; + attr.Attributes = OBJ_CASE_INSENSITIVE | + (sa && sa->bInheritHandle) ? OBJ_INHERIT : 0; + attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL; + attr.SecurityQualityOfService = NULL; + + timeout.QuadPart = (ULONGLONG)NMPWAIT_USE_DEFAULT_WAIT * -10000; /* generate a unique pipe name (system wide) */ do { - static const WCHAR nameFmt[] = { '\\','\\','.','\\','p','i','p','e', + static const WCHAR nameFmt[] = { '\\','?','?','\\','p','i','p','e', '\\','W','i','n','3','2','.','P','i','p','e','s','.','%','0','8','l', 'u','.','%','0','8','u','\0' }; + snprintfW(name, sizeof(name) / sizeof(name[0]), nameFmt, GetCurrentProcessId(), ++index); - hr = CreateNamedPipeW(name, PIPE_ACCESS_INBOUND, - PIPE_TYPE_BYTE | PIPE_WAIT, 1, size, size, - NMPWAIT_USE_DEFAULT_WAIT, sa); + RtlInitUnicodeString(&nt_name, name); + status = NtCreateNamedPipeFile(&hr, GENERIC_READ | SYNCHRONIZE, &attr, &iosb, + 0, FILE_OVERWRITE_IF, + FILE_SYNCHRONOUS_IO_ALERT | FILE_PIPE_INBOUND, + FALSE, FALSE, FALSE, + 1, size, size, &timeout); + if (status) + { + SetLastError( RtlNtStatusToDosError(status) ); + hr = INVALID_HANDLE_VALUE; + } } while (hr == INVALID_HANDLE_VALUE && index != in_index); /* from completion sakeness, I think system resources might be exhausted before this happens !! */ if (hr == INVALID_HANDLE_VALUE) return FALSE; - hw = CreateFileW(name, GENERIC_WRITE, 0, sa, OPEN_EXISTING, 0, 0); - if (hw == INVALID_HANDLE_VALUE) + status = NtOpenFile(&hw, GENERIC_WRITE | SYNCHRONIZE, &attr, &iosb, 0, + FILE_SYNCHRONOUS_IO_ALERT | FILE_NON_DIRECTORY_FILE); + + if (status) { - CloseHandle(hr); + SetLastError( RtlNtStatusToDosError(status) ); + NtClose(hr); return FALSE; } @@ -1899,7 +1915,7 @@ */ LONG WINAPI InterlockedCompareExchange( LONG volatile *dest, LONG xchg, LONG compare ) { - return interlocked_cmpxchg( dest, xchg, compare ); + return interlocked_cmpxchg( (int *)dest, xchg, compare ); } /*********************************************************************** @@ -1916,7 +1932,7 @@ */ LONG WINAPI InterlockedExchange( LONG volatile *dest, LONG val ) { - return interlocked_xchg( dest, val ); + return interlocked_xchg( (int *)dest, val ); } /*********************************************************************** @@ -1933,7 +1949,7 @@ */ LONG WINAPI InterlockedExchangeAdd( LONG volatile *dest, LONG incr ) { - return interlocked_xchg_add( dest, incr ); + return interlocked_xchg_add( (int *)dest, incr ); } /*********************************************************************** @@ -1949,7 +1965,7 @@ */ LONG WINAPI InterlockedIncrement( LONG volatile *dest ) { - return interlocked_xchg_add( dest, 1 ) + 1; + return interlocked_xchg_add( (int *)dest, 1 ) + 1; } /*********************************************************************** @@ -1965,7 +1981,7 @@ */ LONG WINAPI InterlockedDecrement( LONG volatile *dest ) { - return interlocked_xchg_add( dest, -1 ) - 1; + return interlocked_xchg_add( (int *)dest, -1 ) - 1; } #endif /* __i386__ */ diff -urN wine-20050830/dlls/kernel/syslevel.c wine-20050930/dlls/kernel/syslevel.c --- wine-20050830/dlls/kernel/syslevel.c 2005-07-03 13:28:44.000000000 +0200 +++ wine-20050930/dlls/kernel/syslevel.c 2005-09-09 12:19:45.000000000 +0200 @@ -41,7 +41,7 @@ { 0, 0, &Win16Mutex.crst, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": Win16Mutex") } + 0, 0, { (DWORD_PTR)(__FILE__ ": Win16Mutex") } }; static SYSLEVEL Win16Mutex = { { &critsect_debug, -1, 0, 0, 0, 0 }, 1 }; diff -urN wine-20050830/dlls/kernel/task.c wine-20050930/dlls/kernel/task.c --- wine-20050830/dlls/kernel/task.c 2005-08-29 12:26:48.000000000 +0200 +++ wine-20050930/dlls/kernel/task.c 2005-09-22 12:44:40.000000000 +0200 @@ -47,7 +47,6 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(task); -WINE_DECLARE_DEBUG_CHANNEL(relay); WINE_DECLARE_DEBUG_CHANNEL(toolhelp); #include "pshpack1.h" @@ -854,11 +853,11 @@ hInstanceSelector = GlobalHandleToSel16(hInstance); - TRACE("(%08lx, %04x);\n", (DWORD)func, hInstance); + TRACE("(%p, %04x);\n", func, hInstance); if (!HIWORD(func)) { /* Win95 actually protects via SEH, but this is better for debugging */ - WARN("Ouch ! Called with invalid func 0x%08lx !\n", (DWORD)func); + WARN("Ouch ! Called with invalid func %p !\n", func); return (FARPROC16)0; } @@ -887,8 +886,7 @@ thunk = MapSL( thunkaddr ); lfunc = MapSL( (SEGPTR)func ); - TRACE("(%08lx,%04x): got thunk %08lx\n", - (DWORD)func, hInstance, (DWORD)thunkaddr ); + TRACE("(%p,%04x): got thunk %08lx\n", func, hInstance, thunkaddr ); if (((lfunc[0]==0x8c) && (lfunc[1]==0xd8)) || /* movw %ds, %ax */ ((lfunc[0]==0x1e) && (lfunc[1]==0x58)) /* pushw %ds, popw %ax */ ) { @@ -910,7 +908,7 @@ */ void WINAPI FreeProcInstance16( FARPROC16 func ) { - TRACE("(%08lx)\n", (DWORD)func ); + TRACE("(%p)\n", func ); TASK_FreeThunk( (SEGPTR)func ); } diff -urN wine-20050830/dlls/kernel/tests/atom.c wine-20050930/dlls/kernel/tests/atom.c --- wine-20050830/dlls/kernel/tests/atom.c 2005-04-18 17:47:18.000000000 +0200 +++ wine-20050930/dlls/kernel/tests/atom.c 2005-09-28 13:58:20.000000000 +0200 @@ -25,11 +25,53 @@ #include "windef.h" #include "winbase.h" #include "winerror.h" +#include "winuser.h" + +#define DOUBLE(x) (WCHAR)((x<<8)|(x)) static const WCHAR foobarW[] = {'f','o','o','b','a','r',0}; static const WCHAR FOOBARW[] = {'F','O','O','B','A','R',0}; static const WCHAR _foobarW[] = {'_','f','o','o','b','a','r',0}; +static void do_initA(char* tmp, const char* pattern, int len) +{ + const char* p = pattern; + + while (len--) + { + *tmp++ = *p++; + if (!*p) p = pattern; + } + *tmp = '\0'; +} + +static void do_initW(WCHAR* tmp, const char* pattern, int len) +{ + const char* p = pattern; + + while (len--) + { + *tmp++ = *p++; + if (!*p) p = pattern; + } + *tmp = '\0'; +} + +static void print_integral( WCHAR* buffer, int atom ) +{ + BOOL first = TRUE; + +#define X(v) { if (atom >= v) {*buffer++ = '0' + atom / v; first = FALSE; } else if (!first || v == 1) *buffer++ = '0'; atom %= v; } + *buffer++ = '#'; + X(10000); + X(1000); + X(100); + X(10); + X(1); + *buffer = '\0'; +#undef X +} + static BOOL unicode_OS; static void test_add_atom(void) @@ -111,6 +153,8 @@ int i; UINT len; static const WCHAR resultW[] = {'f','o','o','b','a','r',0,'.','.','.'}; + char in[257], out[257]; + WCHAR inW[257], outW[257]; ATOM atom = GlobalAddAtomA( "foobar" ); @@ -160,6 +204,109 @@ } else ok( !len, "bad length %d\n", len ); + + SetLastError(0xdeadbeef); + len = GlobalGetAtomNameA( (ATOM)i, buf, 2); + if (!len) /* the NT way */ + { + ok(GetLastError() == (i ? ERROR_MORE_DATA : ERROR_INVALID_PARAMETER), + "wrong error conditions %lu for %u\n", GetLastError(), i); + } + else /* the Win 9x way */ + { + ok(GetLastError() == 0xdeadbeef, + "wrong error conditions %lu for %u\n", GetLastError(), i); + } + } + + /* test string limits & overflow */ + do_initA(in, "abcdefghij", 255); + atom = GlobalAddAtomA(in); + ok(atom, "couldn't add atom for %s\n", in); + len = GlobalGetAtomNameA(atom, out, sizeof(out)); + ok(len == 255, "length mismatch (%u instead of 255)\n", len); + for (i = 0; i < 255; i++) + { + ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]); + } + ok(out[255] == '\0', "wrong end of string\n"); + memset(out, '.', sizeof(out)); + SetLastError(0xdeadbeef); + len = GlobalGetAtomNameA(atom, out, 10); + if (!len) /* the NT way */ + { + ok(GetLastError() == ERROR_MORE_DATA, "wrong error code (%lu instead of %u)\n", GetLastError(), ERROR_MORE_DATA); + } + else /* the Win9x way */ + { + ok(GetLastError() == 0xdeadbeef, "wrong error code (%lu instead of %u)\n", GetLastError(), 0xdeadbeef); + } + for (i = 0; i < 9; i++) + { + ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]); + } + ok(out[9] == '\0', "wrong end of string\n"); + ok(out[10] == '.', "wrote after end of buf\n"); + do_initA(in, "abcdefghij", 256); + atom = GlobalAddAtomA(in); + ok(!atom, "succeeded\n"); + if (unicode_OS) + { + /* test integral atoms */ + for (i = 0; i <= 0xbfff; i++) + { + memset(outW, 'a', sizeof(outW)); + len = GlobalGetAtomNameW( (ATOM)i, outW, 10 ); + if (i) + { + WCHAR res[20]; + + if (len < 7) /* FIXME: temporary before we fix it */ + ok( (len > 1) && (len < 7), "bad length %d\n", len ); + else + todo_wine ok( (len > 1) && (len < 7), "bad length %d\n", len ); + print_integral( res, i ); + memset( res + lstrlenW(res) + 1, 'a', 10 * sizeof(WCHAR)); + ok( !memcmp( res, outW, 10 * sizeof(WCHAR) ), "bad buffer contents for %d\n", i ); + } + else + ok( !len, "bad length %d\n", len ); + + memset(outW, '.', sizeof(outW)); + len = GlobalGetAtomNameW( (ATOM)i, outW, 1); + if (i) + { + todo_wine ok(len == 1, "succeed (got %u instead of 1)\n", len); + ok(outW[1] == DOUBLE('.'), "buffer overwrite\n"); + } + else ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "0 badly handled\n"); + } + + do_initW(inW, "abcdefghij", 255); + atom = GlobalAddAtomW(inW); + ok(atom, "couldn't add atom for %s\n", in); + len = GlobalGetAtomNameW(atom, outW, sizeof(outW)); + ok(len == 255, "length mismatch (%u instead of 255)\n", len); + for (i = 0; i < 255; i++) + { + ok(outW[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, outW[i], "abcdefghij"[i % 10]); + } + ok(outW[255] == '\0', "wrong end of string\n"); + memset(outW, '.', sizeof(outW)); + len = GlobalGetAtomNameW(atom, outW, 10); + todo_wine ok(len == 10, "succeeded\n"); + for (i = 0; i < 10; i++) + { + if (i < 9) /* FIXME: temporary */ + ok(outW[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, outW[i], "abcdefghij"[i % 10]); + else + todo_wine ok(outW[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, outW[i], "abcdefghij"[i % 10]); + } + ok(outW[10] == DOUBLE('.'), "wrote after end of buf\n"); + do_initW(inW, "abcdefghij", 256); + atom = GlobalAddAtomW(inW); + ok(!atom, "succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error code\n"); } } @@ -257,8 +404,8 @@ static void test_local_get_atom_name(void) { - char buf[10]; - WCHAR bufW[10]; + char buf[10], in[257], out[257]; + WCHAR bufW[10], inW[257], outW[257]; int i; UINT len; static const WCHAR resultW[] = {'f','o','o','b','a','r',0,'.','.','.'}; @@ -304,13 +451,96 @@ if (i) { char res[20]; - ok( (len > 1) && (len < 7), "bad length %d\n", len ); + ok( (len > 1) && (len < 7), "bad length %d for %s\n", len, buf ); sprintf( res, "#%d", i ); memset( res + strlen(res) + 1, 'a', 10 ); ok( !memcmp( res, buf, 10 ), "bad buffer contents %s\n", buf ); } else ok( !len, "bad length %d\n", len ); + + len = GetAtomNameA( (ATOM)i, buf, 1); + ok(!len, "succeed\n"); + if (i) + todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error conditions %lu for %u\n", GetLastError(), i); + else + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error conditions %lu for %u\n", GetLastError(), i); + } + /* test string limits & overflow */ + do_initA(in, "abcdefghij", 255); + atom = AddAtomA(in); + ok(atom, "couldn't add atom for %s\n", in); + len = GetAtomNameA(atom, out, sizeof(out)); + ok(len == 255, "length mismatch (%u instead of 255)\n", len); + for (i = 0; i < 255; i++) + { + ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]); + } + ok(out[255] == '\0', "wrong end of string\n"); + memset(out, '.', sizeof(out)); + len = GetAtomNameA(atom, out, 10); + todo_wine ok(len == 9, "succeeded %d\n", len); + for (i = 0; i < 9; i++) + { + ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]); + } + ok(out[9] == '\0', "wrong end of string\n"); + ok(out[10] == '.', "buffer overwrite\n"); + do_initA(in, "abcdefghij", 256); + atom = AddAtomA(in); + ok(!atom, "succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error code (%lu)\n", GetLastError()); + + if (unicode_OS) + { + /* test integral atoms */ + for (i = 0; i <= 0xbfff; i++) + { + memset(outW, 'a', sizeof(outW)); + len = GetAtomNameW( (ATOM)i, outW, 10 ); + if (i) + { + WCHAR res[20]; + + if (len < 7) /* FIXME: temporary before we fix it */ + ok( (len > 1) && (len < 7), "bad length %d\n", len ); + else + todo_wine ok( (len > 1) && (len < 7), "bad length %d\n", len ); + print_integral( res, i ); + memset( res + lstrlenW(res) + 1, 'a', 10 * sizeof(WCHAR)); + ok( !memcmp( res, outW, 10 * sizeof(WCHAR) ), "bad buffer contents for %d\n", i ); + } + else + ok( !len, "bad length %d\n", len ); + + len = GetAtomNameW( (ATOM)i, outW, 1); + ok(!len, "succeed\n"); + ok(GetLastError() == (i ? ERROR_INSUFFICIENT_BUFFER : ERROR_INVALID_PARAMETER), + "wrong error conditions %lu for %u\n", GetLastError(), i); + } + do_initW(inW, "abcdefghij", 255); + atom = AddAtomW(inW); + ok(atom, "couldn't add atom for %s\n", in); + len = GetAtomNameW(atom, outW, sizeof(outW)); + ok(len == 255, "length mismatch (%u instead of 255)\n", len); + for (i = 0; i < 255; i++) + { + ok(outW[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, outW[i], "abcdefghij"[i % 10]); + } + ok(outW[255] == '\0', "wrong end of string\n"); + memset(outW, '.', sizeof(outW)); + len = GetAtomNameW(atom, outW, 10); + todo_wine ok(len == 9, "succeeded %d\n", len); + for (i = 0; i < 9; i++) + { + ok(outW[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, outW[i], "abcdefghij"[i % 10]); + } + ok(outW[9] == '\0', "wrong end of string\n"); + ok(outW[10] == DOUBLE('.'), "buffer overwrite\n"); + do_initW(inW, "abcdefghij", 256); + atom = AddAtomW(inW); + ok(!atom, "succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error code (%lu)\n", GetLastError()); } } @@ -334,7 +564,6 @@ } } - START_TEST(atom) { test_add_atom(); diff -urN wine-20050830/dlls/kernel/tests/mailslot.c wine-20050930/dlls/kernel/tests/mailslot.c --- wine-20050830/dlls/kernel/tests/mailslot.c 2005-06-20 16:18:04.000000000 +0200 +++ wine-20050930/dlls/kernel/tests/mailslot.c 2005-09-13 17:00:33.000000000 +0200 @@ -65,10 +65,10 @@ dwMax = dwNext = dwMsgCount = dwTimeout = 0; ok( GetMailslotInfo( hSlot, &dwMax, &dwNext, &dwMsgCount, &dwTimeout ), "getmailslotinfo failed\n"); - ok( dwMax == ~0UL, "dwMax incorrect\n"); + ok( dwMax == ~0U, "dwMax incorrect\n"); ok( dwNext == MAILSLOT_NO_MESSAGE, "dwNext incorrect\n"); ok( dwMsgCount == 0, "dwMsgCount incorrect\n"); - ok( dwTimeout == ~0UL, "dwTimeout incorrect\n"); + ok( dwTimeout == ~0U, "dwTimeout incorrect\n"); ok( GetMailslotInfo( hSlot, NULL, NULL, NULL, NULL ), "getmailslotinfo failed\n"); ok( CloseHandle(hSlot), "failed to close mailslot\n"); diff -urN wine-20050830/dlls/kernel/tests/thread.c wine-20050930/dlls/kernel/tests/thread.c --- wine-20050830/dlls/kernel/tests/thread.c 2005-08-12 20:22:06.000000000 +0200 +++ wine-20050930/dlls/kernel/tests/thread.c 2005-09-13 17:00:33.000000000 +0200 @@ -290,8 +290,8 @@ 0,threadId); ok(access_thread!=NULL,"OpenThread returned an invalid handle\n"); if (access_thread!=NULL) { - obey_ar(SuspendThread(access_thread)==~0UL); - obey_ar(ResumeThread(access_thread)==~0UL); + obey_ar(SuspendThread(access_thread)==~0U); + obey_ar(ResumeThread(access_thread)==~0U); ok(CloseHandle(access_thread)!=0,"CloseHandle Failed\n"); } } @@ -307,7 +307,7 @@ } /* Trying to suspend a terminated thread should fail */ error=SuspendThread(thread); - ok(error==~0UL, "wrong return code: %ld\n", error); + ok(error==~0U, "wrong return code: %ld\n", error); ok(GetLastError()==ERROR_ACCESS_DENIED || GetLastError()==ERROR_NO_MORE_ITEMS, "unexpected error code: %ld\n", GetLastError()); ok(CloseHandle(thread)!=0,"CloseHandle Failed\n"); diff -urN wine-20050830/dlls/kernel/thread.c wine-20050930/dlls/kernel/thread.c --- wine-20050830/dlls/kernel/thread.c 2005-08-02 11:55:40.000000000 +0200 +++ wine-20050930/dlls/kernel/thread.c 2005-09-13 00:01:33.000000000 +0200 @@ -25,9 +25,6 @@ #include #include #include -#ifdef HAVE_SYS_TIMES_H -#include -#endif #ifdef HAVE_UNISTD_H # include #endif @@ -42,7 +39,6 @@ #include "wine/winbase16.h" #include "wine/exception.h" #include "wine/library.h" -#include "wine/pthread.h" #include "wine/server.h" #include "wine/debug.h" @@ -417,16 +413,19 @@ HANDLE hthread, /* [in] Handle to thread */ INT priority) /* [in] Thread priority level */ { - BOOL ret; - SERVER_START_REQ( set_thread_info ) + DWORD prio = priority; + NTSTATUS status; + + status = NtSetInformationThread(hthread, ThreadBasePriority, + &prio, sizeof(prio)); + + if (status) { - req->handle = hthread; - req->priority = priority; - req->mask = SET_THREAD_INFO_PRIORITY; - ret = !wine_server_call_err( req ); + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; } - SERVER_END_REQ; - return ret; + + return TRUE; } @@ -543,59 +542,38 @@ LPFILETIME kerneltime, /* [out] Time thread spent in kernel mode */ LPFILETIME usertime) /* [out] Time thread spent in user mode */ { - BOOL ret = TRUE; + KERNEL_USER_TIMES kusrt; + NTSTATUS status; - if (creationtime || exittime) + status = NtQueryInformationThread(thread, ThreadTimes, &kusrt, + sizeof(kusrt), NULL); + if (status) { - /* We need to do a server call to get the creation time or exit time */ - /* This works on any thread */ - - SERVER_START_REQ( get_thread_info ) - { - req->handle = thread; - req->tid_in = 0; - if ((ret = !wine_server_call_err( req ))) - { - if (creationtime) - RtlSecondsSince1970ToTime( reply->creation_time, (LARGE_INTEGER*)creationtime ); - if (exittime) - RtlSecondsSince1970ToTime( reply->exit_time, (LARGE_INTEGER*)exittime ); - } - } - SERVER_END_REQ; + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; } - if (ret && (kerneltime || usertime)) + if (creationtime) { - /* We call times(2) for kernel time or user time */ - /* We can only (portably) do this for the current thread */ - if (thread == GetCurrentThread()) - { - ULONGLONG time; - struct tms time_buf; - long clocks_per_sec = sysconf(_SC_CLK_TCK); - - times(&time_buf); - if (kerneltime) - { - time = (ULONGLONG)time_buf.tms_stime * 10000000 / clocks_per_sec; - kerneltime->dwHighDateTime = time >> 32; - kerneltime->dwLowDateTime = (DWORD)time; - } - if (usertime) - { - time = (ULONGLONG)time_buf.tms_utime * 10000000 / clocks_per_sec; - usertime->dwHighDateTime = time >> 32; - usertime->dwLowDateTime = (DWORD)time; - } - } - else - { - if (kerneltime) kerneltime->dwHighDateTime = kerneltime->dwLowDateTime = 0; - if (usertime) usertime->dwHighDateTime = usertime->dwLowDateTime = 0; - FIXME("Cannot get kerneltime or usertime of other threads\n"); - } + creationtime->dwLowDateTime = kusrt.CreateTime.u.LowPart; + creationtime->dwHighDateTime = kusrt.CreateTime.u.HighPart; } - return ret; + if (exittime) + { + exittime->dwLowDateTime = kusrt.ExitTime.u.LowPart; + exittime->dwHighDateTime = kusrt.ExitTime.u.HighPart; + } + if (kerneltime) + { + kerneltime->dwLowDateTime = kusrt.KernelTime.u.LowPart; + kerneltime->dwHighDateTime = kusrt.KernelTime.u.HighPart; + } + if (usertime) + { + usertime->dwLowDateTime = kusrt.UserTime.u.LowPart; + usertime->dwHighDateTime = kusrt.UserTime.u.HighPart; + } + + return TRUE; } diff -urN wine-20050830/dlls/kernel/thunk.c wine-20050930/dlls/kernel/thunk.c --- wine-20050830/dlls/kernel/thunk.c 2005-07-01 18:24:32.000000000 +0200 +++ wine-20050930/dlls/kernel/thunk.c 2005-09-12 16:12:47.000000000 +0200 @@ -355,15 +355,15 @@ { directionSL = TRUE; - TRACE("SL01 thunk %s (%lx) <- %s (%s), Reason: %ld\n", - module32, (DWORD)TD, module16, thunkfun16, dwReason); + TRACE("SL01 thunk %s (%p) <- %s (%s), Reason: %ld\n", + module32, TD, module16, thunkfun16, dwReason); } else if (!strncmp(TD->magic, "LS01", 4)) { directionSL = FALSE; - TRACE("LS01 thunk %s (%lx) -> %s (%s), Reason: %ld\n", - module32, (DWORD)TD, module16, thunkfun16, dwReason); + TRACE("LS01 thunk %s (%p) -> %s (%s), Reason: %ld\n", + module32, TD, module16, thunkfun16, dwReason); } else { @@ -401,8 +401,8 @@ tdb->next = SL32->data->targetDB; /* FIXME: not thread-safe! */ SL32->data->targetDB = tdb; - TRACE("Process %08lx allocated TargetDB entry for ThunkDataSL %08lx\n", - GetCurrentProcessId(), (DWORD)SL32->data); + TRACE("Process %08lx allocated TargetDB entry for ThunkDataSL %p\n", + GetCurrentProcessId(), SL32->data); } else { @@ -1030,7 +1030,7 @@ * RETURNS * TRUE for success. */ -BOOL WINAPI SSOnBigStack() +BOOL WINAPI SSOnBigStack(void) { TRACE("Yes, thunking is initialized\n"); return TRUE; @@ -1379,15 +1379,15 @@ { directionSL = TRUE; - TRACE("SL01 thunk %s (%lx) -> %s (%s), Reason: %ld\n", - module16, (DWORD)TD, module32, thunkfun32, dwReason); + TRACE("SL01 thunk %s (%p) -> %s (%s), Reason: %ld\n", + module16, TD, module32, thunkfun32, dwReason); } else if (!strncmp(TD->magic, "LS01", 4)) { directionSL = FALSE; - TRACE("LS01 thunk %s (%lx) <- %s (%s), Reason: %ld\n", - module16, (DWORD)TD, module32, thunkfun32, dwReason); + TRACE("LS01 thunk %s (%p) <- %s (%s), Reason: %ld\n", + module16, TD, module32, thunkfun32, dwReason); } else { @@ -1515,7 +1515,7 @@ return; } - TRACE("Creating stub for ThunkDataSL %08lx\n", (DWORD)td); + TRACE("Creating stub for ThunkDataSL %p\n", td); /* We produce the following code: @@ -1556,8 +1556,8 @@ DWORD targetNr = LOWORD(context->Ecx) / 4; struct SLTargetDB *tdb; - TRACE("Process %08lx calling target %ld of ThunkDataSL %08lx\n", - GetCurrentProcessId(), targetNr, (DWORD)td); + TRACE("Process %08lx calling target %ld of ThunkDataSL %p\n", + GetCurrentProcessId(), targetNr, td); for (tdb = td->targetDB; tdb; tdb = tdb->next) if (tdb->process == GetCurrentProcessId()) @@ -2109,7 +2109,7 @@ * GetWin16DOSEnv (KERNEL32.34) * Returns some internal value.... probably the default environment database? */ -DWORD WINAPI GetWin16DOSEnv() +DWORD WINAPI GetWin16DOSEnv(void) { FIXME("stub, returning 0\n"); return 0; diff -urN wine-20050830/dlls/kernel/toolhelp.c wine-20050930/dlls/kernel/toolhelp.c --- wine-20050830/dlls/kernel/toolhelp.c 2005-08-29 12:26:10.000000000 +0200 +++ wine-20050930/dlls/kernel/toolhelp.c 2005-09-06 12:25:11.000000000 +0200 @@ -160,7 +160,25 @@ lppe->th32ModuleID = (DWORD)reply->module; lppe->cntThreads = reply->threads; lppe->th32ParentProcessID = reply->ppid; - lppe->pcPriClassBase = reply->priority; + switch (reply->priority) + { + case PROCESS_PRIOCLASS_IDLE: + lppe->pcPriClassBase = IDLE_PRIORITY_CLASS; break; + case PROCESS_PRIOCLASS_BELOW_NORMAL: + lppe->pcPriClassBase = BELOW_NORMAL_PRIORITY_CLASS; break; + case PROCESS_PRIOCLASS_NORMAL: + lppe->pcPriClassBase = NORMAL_PRIORITY_CLASS; break; + case PROCESS_PRIOCLASS_ABOVE_NORMAL: + lppe->pcPriClassBase = ABOVE_NORMAL_PRIORITY_CLASS; break; + case PROCESS_PRIOCLASS_HIGH: + lppe->pcPriClassBase = HIGH_PRIORITY_CLASS; break; + case PROCESS_PRIOCLASS_REALTIME: + lppe->pcPriClassBase = REALTIME_PRIORITY_CLASS; break; + default: + FIXME("Unknown NT priority class %d, setting to normal\n", reply->priority); + lppe->pcPriClassBase = NORMAL_PRIORITY_CLASS; + break; + } lppe->dwFlags = -1; /* FIXME */ if (unicode) { diff -urN wine-20050830/dlls/kernel/version.c wine-20050930/dlls/kernel/version.c --- wine-20050830/dlls/kernel/version.c 2005-08-10 17:02:28.000000000 +0200 +++ wine-20050930/dlls/kernel/version.c 2005-09-25 17:23:21.000000000 +0200 @@ -360,5 +360,5 @@ void WINAPI DiagOutput16(LPCSTR str) { /* FIXME */ - DPRINTF("DIAGOUTPUT:%s\n", debugstr_a(str)); + TRACE("DIAGOUTPUT:%s\n", debugstr_a(str)); } diff -urN wine-20050830/dlls/kernel/virtual.c wine-20050930/dlls/kernel/virtual.c --- wine-20050830/dlls/kernel/virtual.c 2005-07-15 12:01:31.000000000 +0200 +++ wine-20050930/dlls/kernel/virtual.c 2005-09-30 12:33:43.000000000 +0200 @@ -304,7 +304,8 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = (sa && sa->bInheritHandle) ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | + ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0); attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL; attr.SecurityQualityOfService = NULL; @@ -399,7 +400,7 @@ attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = &nameW; - attr.Attributes = inherit ? OBJ_INHERIT : 0; + attr.Attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0); attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; RtlInitUnicodeString( &nameW, name ); diff -urN wine-20050830/dlls/kernel/vxd.c wine-20050930/dlls/kernel/vxd.c --- wine-20050830/dlls/kernel/vxd.c 2005-08-22 16:08:39.000000000 +0200 +++ wine-20050930/dlls/kernel/vxd.c 2005-09-09 12:19:45.000000000 +0200 @@ -84,7 +84,7 @@ { 0, 0, &vxd_section, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": vxd_section") } + 0, 0, { (DWORD_PTR)(__FILE__ ": vxd_section") } }; static CRITICAL_SECTION vxd_section = { &critsect_debug, -1, 0, 0, 0, 0 }; diff -urN wine-20050830/dlls/lzexpand/.cvsignore wine-20050930/dlls/lzexpand/.cvsignore --- wine-20050830/dlls/lzexpand/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/lzexpand/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,4 +1,2 @@ Makefile liblz32.def -lz32.dll.dbg.c -lzexpand.spec.c diff -urN wine-20050830/dlls/mapi32/.cvsignore wine-20050930/dlls/mapi32/.cvsignore --- wine-20050830/dlls/mapi32/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/mapi32/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,4 +1,2 @@ Makefile libmapi32.def -mapi32.dll -mapi32.dll.dbg.c diff -urN wine-20050830/dlls/mapi32/mapi32.spec wine-20050930/dlls/mapi32/mapi32.spec --- wine-20050830/dlls/mapi32/mapi32.spec 2005-08-08 19:37:41.000000000 +0200 +++ wine-20050930/dlls/mapi32/mapi32.spec 2005-09-09 17:05:02.000000000 +0200 @@ -62,12 +62,12 @@ 80 stdcall LPropCompareProp@8(ptr ptr) LPropCompareProp 81 stub HrAddColumns@16 82 stub HrAddColumnsEx@20 -121 stdcall -ret64 FtAddFt@16(long long long long) MAPI32_FtAddFt +121 stdcall -ret64 FtAddFt@16(double double) MAPI32_FtAddFt 122 stub FtAdcFt@20 -123 stdcall -ret64 FtSubFt@16(long long long long) MAPI32_FtSubFt -124 stdcall -ret64 FtMulDw@12(long long long) MAPI32_FtMulDw +123 stdcall -ret64 FtSubFt@16(double double) MAPI32_FtSubFt +124 stdcall -ret64 FtMulDw@12(long double) MAPI32_FtMulDw 125 stdcall -ret64 FtMulDwDw@8(long long) MAPI32_FtMulDwDw -126 stdcall -ret64 FtNegFt@8(long long) MAPI32_FtNegFt +126 stdcall -ret64 FtNegFt@8(double) MAPI32_FtNegFt 127 stub FtDivFtBogus@20 128 stdcall UlAddRef@4(ptr) UlAddRef 129 stdcall UlRelease@4(ptr) UlRelease diff -urN wine-20050830/dlls/mapi32/tests/prop.c wine-20050930/dlls/mapi32/tests/prop.c --- wine-20050830/dlls/mapi32/tests/prop.c 2005-06-14 21:18:18.000000000 +0200 +++ wine-20050930/dlls/mapi32/tests/prop.c 2005-09-02 14:26:21.000000000 +0200 @@ -480,8 +480,8 @@ case PT_BINARY: pvLeft.Value.bin.cb = 1; pvRight.Value.bin.cb = 1; - pvLeft.Value.bin.lpb = lbuffa; - pvRight.Value.bin.lpb = rbuffa; + pvLeft.Value.bin.lpb = (LPBYTE)lbuffa; + pvRight.Value.bin.lpb = (LPBYTE)rbuffa; lbuffa[0] = lVal; rbuffa[0] = rVal; break; @@ -603,8 +603,8 @@ case PT_BINARY: pvLeft.Value.bin.cb = 1; pvRight.Value.bin.cb = 1; - pvLeft.Value.bin.lpb = lbuffa; - pvRight.Value.bin.lpb = rbuffa; + pvLeft.Value.bin.lpb = (LPBYTE)lbuffa; + pvRight.Value.bin.lpb = (LPBYTE)rbuffa; lbuffa[0] = lVal; rbuffa[0] = rVal; break; diff -urN wine-20050830/dlls/mciavi32/.cvsignore wine-20050930/dlls/mciavi32/.cvsignore --- wine-20050830/dlls/mciavi32/.cvsignore 2005-08-23 21:52:30.000000000 +0200 +++ wine-20050930/dlls/mciavi32/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,3 +1,2 @@ Makefile -mciavi32.dll.dbg.c mciavi_res.res diff -urN wine-20050830/dlls/mciavi32/mmoutput.c wine-20050930/dlls/mciavi32/mmoutput.c --- wine-20050830/dlls/mciavi32/mmoutput.c 2005-08-23 21:52:30.000000000 +0200 +++ wine-20050930/dlls/mciavi32/mmoutput.c 2005-09-19 16:31:32.000000000 +0200 @@ -597,10 +597,8 @@ LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC) { - void* pBitmapData = NULL; - LPBITMAPINFO pBitmapInfo = NULL; - HDC hdcMem; - HBITMAP hbmOld; + void* pBitmapData; + LPBITMAPINFO pBitmapInfo; int nWidth; int nHeight; @@ -619,7 +617,6 @@ mmioSeek(wma->hFile, wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset, SEEK_SET); mmioRead(wma->hFile, wma->indata, wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize); - /* FIXME ? */ wma->inbih->biSizeImage = wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize; if (wma->hic && ICDecompress(wma->hic, 0, wma->inbih, wma->indata, @@ -647,21 +644,12 @@ nHeight = wma->inbih->biHeight; } - if (!wma->hbmFrame) - wma->hbmFrame = CreateCompatibleBitmap(hDC, nWidth, nHeight); + StretchDIBits(hDC, + wma->dest.left, wma->dest.top, + wma->dest.right - wma->dest.left, wma->dest.bottom - wma->dest.top, + wma->source.left, wma->source.top, + wma->source.right - wma->source.left, wma->source.bottom - wma->source.top, + pBitmapData, pBitmapInfo, DIB_RGB_COLORS, SRCCOPY); - SetDIBits(hDC, wma->hbmFrame, 0, nHeight, pBitmapData, pBitmapInfo, DIB_RGB_COLORS); - - hdcMem = CreateCompatibleDC(hDC); - hbmOld = SelectObject(hdcMem, wma->hbmFrame); - - StretchBlt(hDC, - wma->dest.left, wma->dest.top, wma->dest.right, wma->dest.bottom, - hdcMem, - wma->source.left, wma->source.top, wma->source.right, wma->source.bottom, - SRCCOPY); - - SelectObject(hdcMem, hbmOld); - DeleteDC(hdcMem); return TRUE; } diff -urN wine-20050830/dlls/mcicda/.cvsignore wine-20050930/dlls/mcicda/.cvsignore --- wine-20050830/dlls/mcicda/.cvsignore 2005-07-27 17:42:40.000000000 +0200 +++ wine-20050930/dlls/mcicda/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,2 +1 @@ Makefile -mcicda.dll.dbg.c diff -urN wine-20050830/dlls/mciseq/.cvsignore wine-20050930/dlls/mciseq/.cvsignore --- wine-20050830/dlls/mciseq/.cvsignore 2005-08-17 14:15:35.000000000 +0200 +++ wine-20050930/dlls/mciseq/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,2 +1 @@ Makefile -mciseq.dll.dbg.c diff -urN wine-20050830/dlls/midimap/.cvsignore wine-20050930/dlls/midimap/.cvsignore --- wine-20050830/dlls/midimap/.cvsignore 2005-07-21 13:31:56.000000000 +0200 +++ wine-20050930/dlls/midimap/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,2 +1 @@ Makefile -midimap.dll.dbg.c diff -urN wine-20050830/dlls/mlang/.cvsignore wine-20050930/dlls/mlang/.cvsignore --- wine-20050830/dlls/mlang/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/mlang/.cvsignore 2005-09-29 12:36:04.000000000 +0200 @@ -1,3 +1,2 @@ Makefile libmlang.def -mlang.dll.dbg.c diff -urN wine-20050830/dlls/mlang/mlang.c wine-20050930/dlls/mlang/mlang.c --- wine-20050830/dlls/mlang/mlang.c 2005-08-10 11:53:47.000000000 +0200 +++ wine-20050930/dlls/mlang/mlang.c 2005-09-28 13:58:47.000000000 +0200 @@ -1254,8 +1254,24 @@ UINT uCodePage, DWORD* pdwCodePages) { - FIXME("\n"); - return E_NOTIMPL; + ICOM_THIS_MULTI(MLang_impl, vtbl_IMLangFontLink, iface); + CHARSETINFO cs; + BOOL rc; + + TRACE("(%p) Seeking %u\n",This, uCodePage); + memset(&cs, 0, sizeof(cs)); + + rc = TranslateCharsetInfo((DWORD*)uCodePage, &cs, TCI_SRCCODEPAGE); + + if (rc) + { + *pdwCodePages = cs.fs.fsCsb[0]; + TRACE("resulting CodePages 0x%lx\n",*pdwCodePages); + } + else + TRACE("CodePage Not Found\n"); + + return S_OK; } static HRESULT WINAPI fnIMLangFontLink_CodePagesToCodePage( @@ -1264,8 +1280,49 @@ UINT uDefaultCodePage, UINT* puCodePage) { - FIXME("\n"); - return E_NOTIMPL; + ICOM_THIS_MULTI(MLang_impl, vtbl_IMLangFontLink, iface); + DWORD mask = 0x00000000; + UINT i; + CHARSETINFO cs; + BOOL rc; + + TRACE("(%p) scanning 0x%lx default page %u\n",This, dwCodePages, + uDefaultCodePage); + + *puCodePage = 0x00000000; + + rc = TranslateCharsetInfo((DWORD*)uDefaultCodePage, &cs, TCI_SRCCODEPAGE); + + if (rc && (dwCodePages & cs.fs.fsCsb[0])) + { + TRACE("Found Default Codepage\n"); + *puCodePage = uDefaultCodePage; + return S_OK; + } + + + for (i = 0; i < 32; i++) + { + + mask = 1 << i; + if (dwCodePages & mask) + { + DWORD Csb[2]; + Csb[0] = mask; + Csb[1] = 0x0; + rc = TranslateCharsetInfo((DWORD*)Csb, &cs, TCI_SRCFONTSIG); + if (!rc) + continue; + + TRACE("Falling back to least significant found CodePage %u\n", + cs.ciACP); + *puCodePage = cs.ciACP; + return S_OK; + } + } + + TRACE("no codepage found\n"); + return E_FAIL; } static HRESULT WINAPI fnIMLangFontLink_GetFontCodePages( @@ -1274,8 +1331,20 @@ HFONT hFont, DWORD* pdwCodePages) { - FIXME("\n"); - return E_NOTIMPL; + HFONT old_font; + FONTSIGNATURE fontsig; + ICOM_THIS_MULTI(MLang_impl, vtbl_IMLangFontLink, iface); + + TRACE("(%p)\n",This); + + old_font = SelectObject(hDC,hFont); + GetTextCharsetInfo(hDC,&fontsig, 0); + SelectObject(hDC,old_font); + + *pdwCodePages = fontsig.fsCsb[0]; + TRACE("CodePages is 0x%lx\n",fontsig.fsCsb[0]); + + return S_OK; } static HRESULT WINAPI fnIMLangFontLink_MapFont( @@ -1407,7 +1476,7 @@ UINT* pcDstSize) { return ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, - pSrcStr, pcSrcSize, pDstStr, pcDstSize); + (LPCSTR)pSrcStr, (LPINT)pcSrcSize, (LPSTR)pDstStr, (LPINT)pcDstSize); } static HRESULT WINAPI fnIMultiLanguage_ConvertStringToUnicode( @@ -1420,7 +1489,7 @@ UINT* pcDstSize) { return ConvertINetMultiByteToUnicode(pdwMode, dwEncoding, - pSrcStr, pcSrcSize, pDstStr, pcDstSize); + (LPCSTR)pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize); } static HRESULT WINAPI fnIMultiLanguage_ConvertStringFromUnicode( @@ -1433,7 +1502,7 @@ UINT* pcDstSize) { return ConvertINetUnicodeToMultiByte(pdwMode, dwEncoding, - pSrcStr, pcSrcSize, pDstStr, pcDstSize); + pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize); } static HRESULT WINAPI fnIMultiLanguage_ConvertStringReset( @@ -1705,7 +1774,7 @@ UINT* pcDstSize) { return ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, - pSrcStr, pcSrcSize, pDstStr, pcDstSize); + (LPCSTR)pSrcStr, (LPINT)pcSrcSize, (LPSTR)pDstStr, (LPINT)pcDstSize); } static HRESULT WINAPI fnIMultiLanguage2_ConvertStringToUnicode( @@ -1718,7 +1787,7 @@ UINT* pcDstSize) { return ConvertINetMultiByteToUnicode(pdwMode, dwEncoding, - pSrcStr, pcSrcSize, pDstStr, pcDstSize); + pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize); } static HRESULT WINAPI fnIMultiLanguage2_ConvertStringFromUnicode( @@ -1731,7 +1800,7 @@ UINT* pcDstSize) { return ConvertINetUnicodeToMultiByte(pdwMode, dwEncoding, - pSrcStr, pcSrcSize, pDstStr, pcDstSize); + pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize); } static HRESULT WINAPI fnIMultiLanguage2_ConvertStringReset( diff -urN wine-20050830/dlls/mlang/tests/mlang.c wine-20050930/dlls/mlang/tests/mlang.c --- wine-20050830/dlls/mlang/tests/mlang.c 2005-03-14 22:41:27.000000000 +0100 +++ wine-20050930/dlls/mlang/tests/mlang.c 2005-09-28 13:58:47.000000000 +0200 @@ -51,7 +51,7 @@ WCHAR stringW[] = {'J','u','s','t',' ','a',' ','t','e','s','t',' ','s','t','r','i','n','g',0}; char bufA[256]; WCHAR bufW[256]; - int lenA, lenW, expected_len; + UINT lenA, lenW, expected_len; HRESULT ret; HMODULE hMlang; FARPROC pConvertINetMultiByteToUnicode; @@ -606,9 +606,45 @@ IEnumScript_Release(iEnumScript); } +void IMLangFontLink_Test(IMLangFontLink* iMLFL) +{ + DWORD dwCodePages = 0; + DWORD dwManyCodePages = 0; + UINT CodePage = 0; + + ok(IMLangFontLink_CodePageToCodePages(iMLFL, 932, &dwCodePages)==S_OK, + "IMLangFontLink_CodePageToCodePages failed\n"); + ok (dwCodePages != 0, "No CodePages returned\n"); + ok(IMLangFontLink_CodePagesToCodePage(iMLFL, dwCodePages, 1035, + &CodePage)==S_OK, + "IMLangFontLink_CodePagesToCodePage failed\n"); + ok(CodePage == 932, "Incorrect CodePage Returned (%i)\n",CodePage); + + ok(IMLangFontLink_CodePageToCodePages(iMLFL, 1252, &dwCodePages)==S_OK, + "IMLangFontLink_CodePageToCodePages failed\n"); + dwManyCodePages = dwManyCodePages | dwCodePages; + ok(IMLangFontLink_CodePageToCodePages(iMLFL, 1256, &dwCodePages)==S_OK, + "IMLangFontLink_CodePageToCodePages failed\n"); + dwManyCodePages = dwManyCodePages | dwCodePages; + ok(IMLangFontLink_CodePageToCodePages(iMLFL, 874, &dwCodePages)==S_OK, + "IMLangFontLink_CodePageToCodePages failed\n"); + dwManyCodePages = dwManyCodePages | dwCodePages; + + ok(IMLangFontLink_CodePagesToCodePage(iMLFL, dwManyCodePages, 1256, + &CodePage)==S_OK, + "IMLangFontLink_CodePagesToCodePage failed\n"); + ok(CodePage == 1256, "Incorrect CodePage Returned (%i)\n",CodePage); + + ok(IMLangFontLink_CodePagesToCodePage(iMLFL, dwManyCodePages, 936, + &CodePage)==S_OK, + "IMLangFontLink_CodePagesToCodePage failed\n"); + ok(CodePage == 1252, "Incorrect CodePage Returned (%i)\n",CodePage); +} + START_TEST(mlang) { IMultiLanguage2 *iML2 = NULL; + IMLangFontLink *iMLFL = NULL; HRESULT ret; pGetCPInfoExA = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetCPInfoExA"); @@ -644,5 +680,14 @@ IMultiLanguage2_Release(iML2); + ret = CoCreateInstance(&CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER, + &IID_IMLangFontLink, (void **)&iMLFL); + + trace("ret = %08lx, IMLangFontLink iMLFL = %p\n", ret, iMLFL); + if (ret != S_OK || !iML2) return; + + IMLangFontLink_Test(iMLFL); + IMLangFontLink_Release(iMLFL); + CoUninitialize(); } diff -urN wine-20050830/dlls/mmdevldr.vxd/.cvsignore wine-20050930/dlls/mmdevldr.vxd/.cvsignore --- wine-20050830/dlls/mmdevldr.vxd/.cvsignore 2004-03-24 04:36:48.000000000 +0100 +++ wine-20050930/dlls/mmdevldr.vxd/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,2 +1 @@ Makefile -mmdevldr.vxd.dbg.c diff -urN wine-20050830/dlls/monodebg.vxd/.cvsignore wine-20050930/dlls/monodebg.vxd/.cvsignore --- wine-20050830/dlls/monodebg.vxd/.cvsignore 2004-03-24 04:36:48.000000000 +0100 +++ wine-20050930/dlls/monodebg.vxd/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,2 +1 @@ Makefile -monodebg.vxd.dbg.c diff -urN wine-20050830/dlls/mpr/.cvsignore wine-20050930/dlls/mpr/.cvsignore --- wine-20050830/dlls/mpr/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050930/dlls/mpr/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,4 +1,3 @@ Makefile libmpr.def -mpr.dll.dbg.c mpr.res diff -urN wine-20050830/dlls/mpr/mpr.rc wine-20050930/dlls/mpr/mpr.rc --- wine-20050830/dlls/mpr/mpr.rc 2005-01-17 16:34:50.000000000 +0100 +++ wine-20050930/dlls/mpr/mpr.rc 2005-09-26 12:56:47.000000000 +0200 @@ -24,6 +24,7 @@ #include "version.rc" +#include "mpr_Bg.rc" #include "mpr_Cs.rc" #include "mpr_De.rc" #include "mpr_En.rc" @@ -32,4 +33,5 @@ #include "mpr_It.rc" #include "mpr_Ja.rc" #include "mpr_Nl.rc" +#include "mpr_No.rc" #include "mpr_Pt.rc" diff -urN wine-20050830/dlls/mpr/mpr_Bg.rc wine-20050930/dlls/mpr/mpr_Bg.rc --- wine-20050830/dlls/mpr/mpr_Bg.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/mpr/mpr_Bg.rc 2005-09-19 19:00:59.000000000 +0200 @@ -0,0 +1,46 @@ +/* + * MPR Bulgarian resource + * + * Copyright 2005 Milko Krachounov + * + * 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 + */ + +LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +{ + IDS_ENTIRENETWORK "Öÿëàòà ìðåæà" +} + +IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Âúâåäåòå ìðåæîâà ïàðîëà" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Âúâåäåòå âàøåòî ïîòðåáèòåëñêî èìå è ïàðîëà:", IDC_EXPLAIN, 40, 6, 150, 15 + LTEXT "Ïðîêñè", -1, 40, 26, 50, 10 +/* LTEXT "Realm", -1, 40, 46, 50, 10 */ + LTEXT "Ïîòðåáèòåë", -1, 40, 66, 50, 10 + LTEXT "Ïàðîëà", -1, 40, 86, 50, 10 + LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 + LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + CHECKBOX "&Save this password (Insecure)", IDC_SAVEPASSWORD, + 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "Îòìåíè", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP +} diff -urN wine-20050830/dlls/mpr/mpr_No.rc wine-20050930/dlls/mpr/mpr_No.rc --- wine-20050830/dlls/mpr/mpr_No.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/mpr/mpr_No.rc 2005-09-26 12:56:47.000000000 +0200 @@ -0,0 +1,46 @@ +/* + * MPR dll resources for Norwegian Bokmål + * + * Copyright (C) 2005 Alexander N. Sørnes + * + * 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 + */ + +LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL + +STRINGTABLE DISCARDABLE +{ + IDS_ENTIRENETWORK "Hele nettverket" +} + +IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Skriv inn nettverkspassord" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Skriv inn brukernavnet og passordet ditt:", IDC_EXPLAIN, 40, 6, 150, 15 + LTEXT "Mellomtjener", -1, 40, 26, 50, 10 +/* LTEXT "Område", -1, 40, 46, 50, 10 */ + LTEXT "Bruker", -1, 40, 66, 50, 10 + LTEXT "Passord", -1, 40, 86, 50, 10 + LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 + LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + CHECKBOX "Lagre dette pa&ssordet (usikkert)", IDC_SAVEPASSWORD, + 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP +} diff -urN wine-20050830/dlls/mpr/mpr_main.c wine-20050930/dlls/mpr/mpr_main.c --- wine-20050830/dlls/mpr/mpr_main.c 2005-08-08 19:37:41.000000000 +0200 +++ wine-20050930/dlls/mpr/mpr_main.c 2005-09-08 13:01:27.000000000 +0200 @@ -75,7 +75,7 @@ /***************************************************************** * DllCanUnloadNow [MPR.@] */ -DWORD WINAPI DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { FIXME("Stub\n"); return S_OK; diff -urN wine-20050830/dlls/msacm/.cvsignore wine-20050930/dlls/msacm/.cvsignore --- wine-20050830/dlls/msacm/.cvsignore 2005-05-07 14:39:55.000000000 +0200 +++ wine-20050930/dlls/msacm/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,5 +1,3 @@ Makefile libmsacm32.def msacm.res -msacm.spec.c -msacm32.dll.dbg.c diff -urN wine-20050830/dlls/msacm/driver.c wine-20050930/dlls/msacm/driver.c --- wine-20050830/dlls/msacm/driver.c 2004-06-01 21:41:01.000000000 +0200 +++ wine-20050930/dlls/msacm/driver.c 2005-09-12 16:12:47.000000000 +0200 @@ -386,7 +386,7 @@ /* FIXME: Create a WINE_ACMDRIVER32 */ *phad = (HACMDRIVER)pad; - TRACE("'%s' => %08lx\n", debugstr_w(padid->pszDriverAlias), (DWORD)pad); + TRACE("'%s' => %p\n", debugstr_w(padid->pszDriverAlias), pad); return MMSYSERR_NOERROR; gotError: diff -urN wine-20050830/dlls/msacm/format.c wine-20050930/dlls/msacm/format.c --- wine-20050830/dlls/msacm/format.c 2005-03-29 21:49:22.000000000 +0200 +++ wine-20050930/dlls/msacm/format.c 2005-09-12 17:14:07.000000000 +0200 @@ -271,7 +271,7 @@ MMRESULT WINAPI acmFormatChooseA(PACMFORMATCHOOSEA pafmtc) { return DialogBoxParamA(MSACM_hInstance32, MAKEINTRESOURCEA(DLG_ACMFORMATCHOOSE_ID), - pafmtc->hwndOwner, FormatChooseDlgProc, (INT)pafmtc); + pafmtc->hwndOwner, FormatChooseDlgProc, (LPARAM)pafmtc); } /*********************************************************************** diff -urN wine-20050830/dlls/msacm/imaadp32/.cvsignore wine-20050930/dlls/msacm/imaadp32/.cvsignore --- wine-20050830/dlls/msacm/imaadp32/.cvsignore 2004-03-24 04:36:48.000000000 +0100 +++ wine-20050930/dlls/msacm/imaadp32/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,2 +1 @@ Makefile -imaadp32.acm.dbg.c diff -urN wine-20050830/dlls/msacm/msacm.rc wine-20050930/dlls/msacm/msacm.rc --- wine-20050830/dlls/msacm/msacm.rc 2004-09-22 21:18:15.000000000 +0200 +++ wine-20050930/dlls/msacm/msacm.rc 2005-09-26 12:56:47.000000000 +0200 @@ -31,5 +31,6 @@ #include "msacm_It.rc" #include "msacm_Ja.rc" #include "msacm_Nl.rc" +#include "msacm_No.rc" #include "msacm_Pl.rc" #include "msacm_Pt.rc" diff -urN wine-20050830/dlls/msacm/msacm_No.rc wine-20050930/dlls/msacm/msacm_No.rc --- wine-20050830/dlls/msacm/msacm_No.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/msacm/msacm_No.rc 2005-09-26 12:56:47.000000000 +0200 @@ -0,0 +1,56 @@ +/* + * Norwegian Bokmål resource file for MS ACM + * + * Copyright 2005 Alexander N. Sørnes + * + * 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 + */ + +LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL + +DLG_ACMFORMATCHOOSE_ID DIALOG DISCARDABLE 10, 20, 225, 100 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Lydutvalg" +FONT 8, "MS Shell Dlg" +BEGIN + + LTEXT "&Navn:", -1, 5, 5, 115, 8, NOT WS_GROUP + + COMBOBOX IDD_ACMFORMATCHOOSE_CMB_CUSTOM, 5, 15, 115, 60, + CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + + PUSHBUTTON "Lagre &som . . .", IDD_ACMFORMATCHOOSE_BTN_SETNAME, 125, 14, 45, 14 + PUSHBUTTON "Fje&rn", IDD_ACMFORMATCHOOSE_BTN_DELNAME, 175, 14, 45, 14 + + LTEXT "&Format:", -1, 5, 41, 44, 8, NOT WS_GROUP + + COMBOBOX IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, 50, 39, 170, 60, + CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + + LTEXT "&Attributter:", -1, 5, 59, 44, 8, NOT WS_GROUP + +#if 0 + COMBOBOX IDD_ACMFORMATCHOOSE_CMB_FORMAT, 50, 57, 170, 60, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | + CBS_OWNERDRAWFIXED | CBS_HASSTRINGS +#else + COMBOBOX IDD_ACMFORMATCHOOSE_CMB_FORMAT, 50, 57, 170, 60, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +#endif + DEFPUSHBUTTON "OK", IDOK, 48, 80, 40, 14 + PUSHBUTTON "Avbryt", IDCANCEL, 92, 80, 40, 14 + PUSHBUTTON "&Hjelp", IDD_ACMFORMATCHOOSE_BTN_HELP, 136, 80, 40, 14 + +END diff -urN wine-20050830/dlls/msacm/msadp32/.cvsignore wine-20050930/dlls/msacm/msadp32/.cvsignore --- wine-20050830/dlls/msacm/msadp32/.cvsignore 2004-03-24 04:36:48.000000000 +0100 +++ wine-20050930/dlls/msacm/msadp32/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,2 +1 @@ Makefile -msadp32.acm.dbg.c diff -urN wine-20050830/dlls/msacm/msadp32/msadp32.c wine-20050930/dlls/msacm/msadp32/msadp32.c --- wine-20050830/dlls/msacm/msadp32/msadp32.c 2005-01-09 17:52:51.000000000 +0100 +++ wine-20050930/dlls/msacm/msadp32/msadp32.c 2005-09-12 16:12:47.000000000 +0200 @@ -716,8 +716,8 @@ LRESULT CALLBACK ADPCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2) { - TRACE("(%08lx %08lx %04x %08lx %08lx);\n", - dwDevID, (DWORD)hDriv, wMsg, dwParam1, dwParam2); + TRACE("(%08lx %p %04x %08lx %08lx);\n", + dwDevID, hDriv, wMsg, dwParam1, dwParam2); switch (wMsg) { diff -urN wine-20050830/dlls/msacm/msg711/.cvsignore wine-20050930/dlls/msacm/msg711/.cvsignore --- wine-20050830/dlls/msacm/msg711/.cvsignore 2004-03-24 04:36:48.000000000 +0100 +++ wine-20050930/dlls/msacm/msg711/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,2 +1 @@ Makefile -msg711.acm.dbg.c diff -urN wine-20050830/dlls/msacm/msg711/msg711.c wine-20050930/dlls/msacm/msg711/msg711.c --- wine-20050830/dlls/msacm/msg711/msg711.c 2005-01-09 17:52:51.000000000 +0100 +++ wine-20050930/dlls/msacm/msg711/msg711.c 2005-09-12 16:12:47.000000000 +0200 @@ -1100,8 +1100,8 @@ LRESULT CALLBACK G711_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2) { - TRACE("(%08lx %08lx %04x %08lx %08lx);\n", - dwDevID, (DWORD)hDriv, wMsg, dwParam1, dwParam2); + TRACE("(%08lx %p %04x %08lx %08lx);\n", + dwDevID, hDriv, wMsg, dwParam1, dwParam2); switch (wMsg) { diff -urN wine-20050830/dlls/msacm/pcmconverter.c wine-20050930/dlls/msacm/pcmconverter.c --- wine-20050830/dlls/msacm/pcmconverter.c 2005-01-09 17:52:51.000000000 +0100 +++ wine-20050930/dlls/msacm/pcmconverter.c 2005-09-12 16:12:47.000000000 +0200 @@ -1025,8 +1025,8 @@ LRESULT CALLBACK PCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2) { - TRACE("(%08lx %08lx %u %08lx %08lx);\n", - dwDevID, (DWORD)hDriv, wMsg, dwParam1, dwParam2); + TRACE("(%08lx %p %u %08lx %08lx);\n", + dwDevID, hDriv, wMsg, dwParam1, dwParam2); switch (wMsg) { case DRV_LOAD: return 1; diff -urN wine-20050830/dlls/msacm/stream.c wine-20050930/dlls/msacm/stream.c --- wine-20050830/dlls/msacm/stream.c 2004-08-11 21:35:34.000000000 +0200 +++ wine-20050930/dlls/msacm/stream.c 2005-09-12 17:14:07.000000000 +0200 @@ -64,7 +64,7 @@ WARN("invalid handle\n"); return MMSYSERR_INVALHANDLE; } - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (DWORD)&was->drvInst, 0); + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (LPARAM)&was->drvInst, 0); if (ret == MMSYSERR_NOERROR) { if (was->hAcmDriver) acmDriverClose(was->hAcmDriver, 0L); @@ -116,7 +116,7 @@ padsh->fdwConvert = fdwConvert; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CONVERT, (DWORD)&was->drvInst, (DWORD)padsh); + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CONVERT, (LPARAM)&was->drvInst, (LPARAM)padsh); if (ret == MMSYSERR_NOERROR) { padsh->fdwStatus |= ACMSTREAMHEADER_STATUSF_DONE; } @@ -228,7 +228,7 @@ was->pDrv = wad; was->hAcmDriver = 0; /* not to close it in acmStreamClose */ - ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L); + ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (LPARAM)&was->drvInst, 0L); if (ret != MMSYSERR_NOERROR) goto errCleanUp; } else { @@ -249,7 +249,7 @@ was->pDrv = wad; was->hAcmDriver = had; - ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L); + ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (LPARAM)&was->drvInst, 0L); TRACE("%s => %08x\n", debugstr_w(wadi->pszDriverAlias), ret); if (ret == MMSYSERR_NOERROR) { if (fdwOpen & ACM_STREAMOPENF_QUERY) { @@ -326,7 +326,7 @@ padsh->pbPreparedDst = 0; padsh->cbPreparedDstLength = 0; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_PREPARE, (DWORD)&was->drvInst, (DWORD)padsh); + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_PREPARE, (LPARAM)&was->drvInst, (DWORD)padsh); if (ret == MMSYSERR_NOERROR || ret == MMSYSERR_NOTSUPPORTED) { ret = MMSYSERR_NOERROR; padsh->fdwStatus &= ~(ACMSTREAMHEADER_STATUSF_DONE|ACMSTREAMHEADER_STATUSF_INQUEUE); @@ -366,7 +366,7 @@ WARN("invalid handle\n"); return MMSYSERR_INVALHANDLE; } else if (was->drvInst.fdwOpen & ACM_STREAMOPENF_ASYNC) { - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_RESET, (DWORD)&was->drvInst, 0); + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_RESET, (LPARAM)&was->drvInst, 0); } TRACE("=> (%d)\n", ret); return ret; @@ -412,7 +412,7 @@ adss.cbStruct = sizeof(adss); adss.fdwSize = fdwSize; ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE, - (DWORD)&was->drvInst, (DWORD)&adss); + (LPARAM)&was->drvInst, (LPARAM)&adss); if (ret == MMSYSERR_NOERROR) { switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) { case ACM_STREAMSIZEF_DESTINATION: @@ -469,7 +469,7 @@ padsh->fdwConvert = fdwUnprepare; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_UNPREPARE, (DWORD)&was->drvInst, (DWORD)padsh); + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_UNPREPARE, (LPARAM)&was->drvInst, (LPARAM)padsh); if (ret == MMSYSERR_NOERROR || ret == MMSYSERR_NOTSUPPORTED) { ret = MMSYSERR_NOERROR; padsh->fdwStatus &= ~(ACMSTREAMHEADER_STATUSF_DONE|ACMSTREAMHEADER_STATUSF_INQUEUE|ACMSTREAMHEADER_STATUSF_PREPARED); diff -urN wine-20050830/dlls/msacm/tests/msacm.c wine-20050930/dlls/msacm/tests/msacm.c --- wine-20050830/dlls/msacm/tests/msacm.c 2005-06-21 22:53:14.000000000 +0200 +++ wine-20050930/dlls/msacm/tests/msacm.c 2005-09-12 16:12:47.000000000 +0200 @@ -188,8 +188,8 @@ "acmDriverID(): rc = %08x, should be %08x\n", rc, MMSYSERR_NOERROR); ok(hid == hadid, - "acmDriverID() returned ID %08lx doesn't equal %08lx\n", - (DWORD)hid, (DWORD)hadid); + "acmDriverID() returned ID %p doesn't equal %p\n", + hid, hadid); /* try bad pointer */ rc = acmMetrics((HACMOBJ)had, ACM_METRIC_MAX_SIZE_FORMAT, 0); diff -urN wine-20050830/dlls/msacm/winemp3/.cvsignore wine-20050930/dlls/msacm/winemp3/.cvsignore --- wine-20050830/dlls/msacm/winemp3/.cvsignore 2004-03-24 04:36:48.000000000 +0100 +++ wine-20050930/dlls/msacm/winemp3/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,2 +1 @@ Makefile -winemp3.acm.dbg.c diff -urN wine-20050830/dlls/mscms/.cvsignore wine-20050930/dlls/mscms/.cvsignore --- wine-20050830/dlls/mscms/.cvsignore 2005-05-07 14:39:55.000000000 +0200 +++ wine-20050930/dlls/mscms/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,4 +1,3 @@ Makefile libmscms.def -mscms.dll.dbg.c version.res diff -urN wine-20050830/dlls/mscms/handle.c wine-20050930/dlls/mscms/handle.c --- wine-20050830/dlls/mscms/handle.c 2005-07-18 17:10:37.000000000 +0200 +++ wine-20050930/dlls/mscms/handle.c 2005-09-09 12:19:45.000000000 +0200 @@ -37,7 +37,7 @@ 0, 0, &MSCMS_handle_cs, { &MSCMS_handle_cs_debug.ProcessLocksList, &MSCMS_handle_cs_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": MSCMS_handle_cs") } + 0, 0, { (DWORD_PTR)(__FILE__ ": MSCMS_handle_cs") } }; static CRITICAL_SECTION MSCMS_handle_cs = { &MSCMS_handle_cs_debug, -1, 0, 0, 0, 0 }; diff -urN wine-20050830/dlls/msdmo/.cvsignore wine-20050930/dlls/msdmo/.cvsignore --- wine-20050830/dlls/msdmo/.cvsignore 2005-05-07 14:39:55.000000000 +0200 +++ wine-20050930/dlls/msdmo/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,4 +1,3 @@ Makefile libmsdmo.def -msdmo.dll.dbg.c rsrc.res diff -urN wine-20050830/dlls/mshtml/.cvsignore wine-20050930/dlls/mshtml/.cvsignore --- wine-20050830/dlls/mshtml/.cvsignore 2005-08-01 12:59:45.000000000 +0200 +++ wine-20050930/dlls/mshtml/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -1,5 +1,4 @@ Makefile libmshtml.def -mshtml.dll.dbg.c nsiface.h rsrc.res diff -urN wine-20050830/dlls/mshtml/Bg.rc wine-20050930/dlls/mshtml/Bg.rc --- wine-20050830/dlls/mshtml/Bg.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/mshtml/Bg.rc 2005-09-19 19:00:59.000000000 +0200 @@ -0,0 +1,244 @@ +/* + * Copyright 2005 Milko Krachounov + * + * 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 + */ + + +LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +{ + IDS_HTMLDISABLED "HTML èçîáðàçÿâàíåòî å èçêëþ÷åíî." + IDS_HTMLDOCUMENT "HTML äîêóìåíò" +} + +/* FIXME: This should be in shdoclc.dll */ + +IDR_BROWSE_CONTEXT_MENU MENU +{ + POPUP "Default" + { + MENUITEM "Íà&çàä", IDM_BACK + MENUITEM "Íà&ïðåä", IDM_FORWARD + MENUITEM SEPARATOR + MENUITEM "&Ñúõðàíè ôîíà êàòî...", IDM_SAVEBACKGROUNDAS + MENUITEM "Ïîñòàâè êàòî &ôîí íà ðàáîòíèÿ ïëîò", IDM_SETASBACKGROUND + MENUITEM "&Êîïèðàé ôîíà", IDM_COPYBACKGROUND + MENUITEM "Ïîñòàâè êàòî åëåìåíò íà &ðàáîòíèÿ ïëîò", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "Ìàðêèðàé &âñè÷êî", IDM_SELECTALL + MENUITEM "&Âìúêíè", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Ñúçäàé ïðåïðà&òêà", IDM_CREATESHORTCUT + MENUITEM "Äîáàâè êúì &îòìåòêèòå", IDM_ADDTOFAVOURITES + MENUITEM "Ïðå&ãëåäàé èçõîäíèÿ êîä", IDM_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "Êî&äèðîâêà", IDM_ENCODING + MENUITEM SEPARATOR + MENUITEM "Ïå&÷àò", IDM_PRINT + MENUITEM "Îïð&åñíè", IDM_REFRESH + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Ñâî&éñòâà", IDM_PROPERTIES + } + + POPUP "Image" + { + MENUITEM "&Îòâîðè âðúçêàòà", IDM_OPENLINK + MENUITEM "Îòâîðè âðúçêàòà â &íîâ ïðîçîðåö", IDM_OPENINNEWWINDOW + MENUITEM "Çàïè&øè öåëòà êàòî...", IDM_SAVETARGETAS + MENUITEM "Ðàç&ïå÷àòàé öåëòà", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "Ïî&êàæè èçîáðàæåíèåòî", IDM_SHOWPICTURE + MENUITEM "&Ñúõðàíè èçîáðàæåíèåòî êàòî...", IDM_SAVEPICTUREAS + MENUITEM "Èçïðàòè èçîáðàæåíèåòî ïî ïî&ùàòà...", IDM_EMAILPICTURE + MENUITEM "&Ðàçïå÷àòàé èçîáðàæåíèåòî...", IDM_PRINTPICTURE + MENUITEM "È&äè â Ìîèòå Ñíèìêè", IDM_GOTOMYPICTURES + MENUITEM "Ïîñòàâè êàòî &ôîí", IDM_SETASBACKGROUND + MENUITEM "Ïîñòàâè êàòî åëåìåíò íà &ðàáîòíèÿ ïëîò...", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "&Èçðåæè", IDM_CUT + MENUITEM "&Êîïèðàé", IDM_COPY + MENUITEM "Êîïèðàé ïðåïðà&òêàòà", IDM_COPYSHORTCUT + MENUITEM "&Âìúêíè", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Äîáàâè êúì îò&ìåòêèòå...", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Ñâî&éñòâà", IDM_PROPERTIES + } + + POPUP "Control" + { + MENUITEM "&Îòìåíè", IDM_UNDO + MENUITEM SEPARATOR + MENUITEM "&Èçðåæè", IDM_CUT + MENUITEM "&Êîïèðàé", IDM_COPY + MENUITEM "&Âìúêíè", IDM_PASTE + MENUITEM "Èç&òðèé", IDM_DELETE + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Ìàðêèðàé &âñè÷êî", IDM_SELECTALL + } + + POPUP "Table" + { + POPUP "&Èçáåðè" + { + MENUITEM "&Êëåòêà", IDM_CELL + MENUITEM "&Ðåä", IDM_ROW + MENUITEM "&Êîëîíà", IDM_COLUMN + MENUITEM "&Òàáëèöà", IDM_TABLE + } + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "&Ñâîéñòâà íà êëåòêàòà", IDM_CELLPROPERTIES + MENUITEM "&Ñâîéñòâà íà òàáëèöàòà", IDM_TABLEPROPERTIES + } + + POPUP "1DSite Select" + { + MENUITEM "&Èçðåæè", IDM_CUT + MENUITEM "&Êîïèðàé", IDM_COPY + MENUITEM "&Âìúêíè", IDM_PASTE + MENUITEM "Ìàðêèðàé &âñè÷êî", IDM_SELECTALL + MENUITEM "&Ïå÷àò", IDM_PRINT + MENUITEM SEPARATOR + } + + POPUP "Anchor" + { + MENUITEM "&Îòâîðè", IDM_OPENLINK + MENUITEM "Îòâîðè â &íîâ ïðîçîðåö", IDM_OPENINNEWWINDOW + MENUITEM "Çàïè&øè öåëòà êàòî...", IDM_SAVETARGETAS + MENUITEM "Ðàç&ïå÷àòàé öåëòà", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "&Èçðåæè", IDM_CUT + MENUITEM "&Êîïèðàé", IDM_COPY + MENUITEM "Êîïèðàé ïðåïðà&òêàòà", IDM_COPYSHORTCUT + MENUITEM "&Âìúêíè", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Äîáàâè êúì îò&ìåòêèòå...", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "&Ñâîéñòâà", IDM_PROPERTIES + } + + POPUP "Context Unknown" + { + MENUITEM SEPARATOR + } + + POPUP "DYNSRC Image" + { + MENUITEM "&Îòâîðè âðúçêàòà", IDM_OPENLINK + MENUITEM "Îòâîðè âðúçêàòà â &íîâ ïðîçîðåö", IDM_OPENINNEWWINDOW + MENUITEM "Çàïè&øè öåëòà êàòî...", IDM_SAVETARGETAS + MENUITEM "Ðàç&ïå÷àòàé öåëòà", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "Ïî&êàæè èçîáðàæåíèåòî", IDM_SHOWPICTURE + MENUITEM "&Ñúõðàíè âèäåî èçîáðàæåíèåòî êàòî...", IDM_SAVEPICTUREAS + MENUITEM "Ïîñòàâè êàòî &ôîí", IDM_SETASBACKGROUND + MENUITEM "Ïîñòàâè êàòî åëåìåíò íà &ðàáîòíèÿ ïëîò...", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "&Èçðåæè", IDM_CUT + MENUITEM "&Êîïèðàé", IDM_COPY + MENUITEM "Êîïèðàé ïðåïðà&òêàòà", IDM_COPYSHORTCUT + MENUITEM "&Âìúêíè", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Äîáàâè êúì îò&ìåòêèòå...", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Âúçïðîèçâåäè", IDM_PLAY + MENUITEM "Ñïðè", IDM_STOP + MENUITEM "&Ñâîéñòâà", IDM_PROPERTIES + } + + POPUP "ART Image" + { + MENUITEM "&Îòâîðè âðúçêàòà", IDM_OPENLINK + MENUITEM "Îòâîðè âðúçêàòà â &íîâ ïðîçîðåö", IDM_OPENINNEWWINDOW + MENUITEM "Çàïè&øè öåëòà êàòî...", IDM_SAVETARGETAS + MENUITEM "Ðàç&ïå÷àòàé öåëòà", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "Ïî&êàæè èçîáðàæåíèåòî", IDM_SHOWPICTURE + MENUITEM "&Ñúõðàíè èçîáðàæåíèåòî êàòî...", IDM_SAVEPICTUREAS + MENUITEM "Ïîñòàâè êàòî &ôîí", IDM_SETASBACKGROUND + MENUITEM "Ïîñòàâè êàòî åëåìåíò íà &ðàáîòíèÿ ïëîò......", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "&Èçðåæè", IDM_CUT + MENUITEM "&Êîïèðàé", IDM_COPY + MENUITEM "Êîïèðàé ïðåïðà&òêàòà", IDM_COPYSHORTCUT + MENUITEM "&Âìúêíè", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Äîáàâè êúì îò&ìåòêèòå...", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM "Âúçïðîèçâåäè", IDM_PLAY + MENUITEM "Ñïðè", IDM_STOP + MENUITEM "Âúðíè ñå â íà÷àëîòî", IDM_REWIND + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "&Ñâîéñòâà", IDM_PROPERTIES + } + + POPUP "Debug" + { + MENUITEM "Trace Tags", IDM_TRACETAGS + MENUITEM "Resource Failures", IDM_RESOURCEFAILURES + MENUITEM "Dump Tracking Info", IDM_DUMPTRACKINGINFO + MENUITEM "Debug Break", IDM_DEBUGBREAK + MENUITEM "Debug View", IDM_DEBUGVIEW + MENUITEM "Dump Tree", IDM_DUMPTREE + MENUITEM "Dump Lines", IDM_DUMPLINES + MENUITEM "Dump DisplayTree", IDM_DUMPDISPLAYTREE + MENUITEM "Dump FormatCaches", IDM_DUMPFORMATCACHES + MENUITEM "Dump LayoutRects", IDM_DUMPLAYOUTRECTS + MENUITEM "Memory Monitor", IDM_MEMORYMONITOR + MENUITEM "Performance Meters", IDM_PERFORMANCEMETERS + MENUITEM "Save HTML", IDM_SAVEHTML + MENUITEM SEPARATOR + MENUITEM "&Browse View", IDM_BROWSEVIEW + MENUITEM "&Edit View", IDM_EDITVIEW + } + + POPUP "Vertical Scrollbar" + { + MENUITEM "Ïðåâúðòè òóê", IDM_SCROLLHERE + MENUITEM SEPARATOR + MENUITEM "Íàé-ãîðå", IDM_TOP + MENUITEM "Íàé-äîëó", IDM_BOTTOM + MENUITEM SEPARATOR + MENUITEM "Ñòðàíèöà íàãîðå", IDM_PAGEUP + MENUITEM "Ñòðàíèöà íàäîëó", IDM_PAGEDOWN + MENUITEM SEPARATOR + MENUITEM "Ïðåâúðòè íàãîðå", IDM_SCROLLUP + MENUITEM "Ïðåâúðòè íàäîëó", IDM_SCROLLDOWN + } + + POPUP "Horizontal Scrollbar" + { + MENUITEM "Ïðåâúðòè òóê", IDM_SCROLLHERE + MENUITEM SEPARATOR + MENUITEM "Íàé-âëÿâî", IDM_LEFTEDGE + MENUITEM "Íàé-âäÿñíî", IDM_RIGHTEDGE + MENUITEM SEPARATOR + MENUITEM "Ñòðàíèöà íàëÿâî", IDM_PAGELEFT + MENUITEM "Ñòðàíèöà íàäÿñíî", IDM_PAGERIGHT + MENUITEM SEPARATOR + MENUITEM "Ïðåâúðòè íàëÿâî", IDM_SCROLLLEFT + MENUITEM "Ïðåâúðòè íàäÿñíî", IDM_SCROLLRIGHT + } +} diff -urN wine-20050830/dlls/mshtml/Fi.rc wine-20050930/dlls/mshtml/Fi.rc --- wine-20050830/dlls/mshtml/Fi.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/mshtml/Fi.rc 2005-09-19 16:29:49.000000000 +0200 @@ -0,0 +1,246 @@ +/* + * Finnish resources for mshtml + * + * Copyright 2005 Kimmo Myllyvirta + * + * 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 + */ + + +LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +{ + IDS_HTMLDISABLED "HTML:n näyttäminen on tällähetkellä poistettu käytöstä." + IDS_HTMLDOCUMENT "HTML Dokumentti" +} + +/* FIXME: This should be in shdoclc.dll */ + +IDR_BROWSE_CONTEXT_MENU MENU +{ + POPUP "Oletus" + { + MENUITEM "&Takaisin", IDM_BACK + MENUITEM "&Eteenpäin", IDM_FORWARD + MENUITEM SEPARATOR + MENUITEM "Ta&llenna Tausta...", IDM_SAVEBACKGROUNDAS + MENUITEM "&Aseta Taustaksi", IDM_SETASBACKGROUND + MENUITEM "&Kopioi Tausta", IDM_COPYBACKGROUND + MENUITEM "A&seta Työpöydälle", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "&Valitse Kaikki", IDM_SELECTALL + MENUITEM "L&iitä", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Luo &Pikakuvake", IDM_CREATESHORTCUT + MENUITEM "Lisää S&uosikkeihin", IDM_ADDTOFAVOURITES + MENUITEM "Nä&ytä Lähde", IDM_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "Koo&daus", IDM_ENCODING + MENUITEM SEPARATOR + MENUITEM "Tul&osta", IDM_PRINT + MENUITEM "P&äivitä", IDM_REFRESH + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "O&minaisuudet", IDM_PROPERTIES + } + + POPUP "Kuva" + { + MENUITEM "&Avaa Linkki", IDM_OPENLINK + MENUITEM "A&vaa Linkki Uudessa Ikkunassa",IDM_OPENINNEWWINDOW + MENUITEM "&Tallenna kohde nimellä...", IDM_SAVETARGETAS + MENUITEM "T&ulosta Kohde", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "&Näytä Kuva", IDM_SHOWPICTURE + MENUITEM "Tallenna Kuva Ni&mellä...", IDM_SAVEPICTUREAS + MENUITEM "Lä&hetä kuva sähköpostina...", IDM_EMAILPICTURE + MENUITEM "Tulosta &Kuva...", IDM_PRINTPICTURE + MENUITEM "Mene &Omiin Kuviin", IDM_GOTOMYPICTURES + MENUITEM "A&seta Taustaksi", IDM_SETASBACKGROUND + MENUITEM "Aseta T&yöpöydälle...", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "&Leikkaa", IDM_CUT + MENUITEM "Ko&pioi", IDM_COPY + MENUITEM "Kopioi Pikakuvak&e", IDM_COPYSHORTCUT + MENUITEM "L&iitä", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Lis&ää Suosikkeihin...", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Ominaisuu&det", IDM_PROPERTIES + } + + POPUP "Hallinta" + { + MENUITEM "K&umoa", IDM_UNDO + MENUITEM SEPARATOR + MENUITEM "&Leikkaa", IDM_CUT + MENUITEM "&Kopioi", IDM_COPY + MENUITEM "L&iitä", IDM_PASTE + MENUITEM "P&oista", IDM_DELETE + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "V&alitse Kaikki", IDM_SELECTALL + } + + POPUP "Taulukko" + { + POPUP "&Valitse" + { + MENUITEM "&Solu", IDM_CELL + MENUITEM "&Rivi", IDM_ROW + MENUITEM "&Palsta", IDM_COLUMN + MENUITEM "&Taulukko", IDM_TABLE + } + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "S&olun Ominaisuudet", IDM_CELLPROPERTIES + MENUITEM "Ta&ulukon Ominaisuudet", IDM_TABLEPROPERTIES + } + + POPUP "1DSivun Valinta" + { + MENUITEM "&Leikkaa", IDM_CUT + MENUITEM "&Kopioi", IDM_COPY + MENUITEM "L&iitä", IDM_PASTE + MENUITEM "V&alitse Kaikki", IDM_SELECTALL + MENUITEM "&Tulosta", IDM_PRINT + MENUITEM SEPARATOR + } + + POPUP "Ankkuri" + { + MENUITEM "&Avaa", IDM_OPENLINK + MENUITEM "A&vaa Uudessa Ikkunassa", IDM_OPENINNEWWINDOW + MENUITEM "&Tallenna Kohde...", IDM_SAVETARGETAS + MENUITEM "T&ulosta Kohde", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "&Leikkaa", IDM_CUT + MENUITEM "&Kopioi", IDM_COPY + MENUITEM "Kopioi &Pikakuvake", IDM_COPYSHORTCUT + MENUITEM "L&iitä", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Li&sää Suosikkeihin...", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "O&minaisuudet", IDM_PROPERTIES + } + + POPUP "Context Unknown" + { + MENUITEM SEPARATOR + } + + POPUP "DYNSRC Kuva" + { + MENUITEM "&Avaa Linkki", IDM_OPENLINK + MENUITEM "A&vaa Uudessa Ikkunassa", IDM_OPENINNEWWINDOW + MENUITEM "Tallenna &Kohde...", IDM_SAVETARGETAS + MENUITEM "T&ulosta Kohde", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "&Näytä Kuva", IDM_SHOWPICTURE + MENUITEM "Tallenna Vi&deo Nimellä...", IDM_SAVEPICTUREAS + MENUITEM "A&seta Taustaksi", IDM_SETASBACKGROUND + MENUITEM "Aseta Ty&öpöydälle...", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "&Leikkaa", IDM_CUT + MENUITEM "K&opioi", IDM_COPY + MENUITEM "Kopioi &Pikakuvake", IDM_COPYSHORTCUT + MENUITEM "L&iitä", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Lis&ää Suosikkeihin...", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "&Toista", IDM_PLAY + MENUITEM "P&ysäytä", IDM_STOP + MENUITEM "O&minaisuuedet", IDM_PROPERTIES + } + + POPUP "ART Kuva" + { + MENUITEM "&Avaa Linkki", IDM_OPENLINK + MENUITEM "A&vaa Uudessa Ikkunassa", IDM_OPENINNEWWINDOW + MENUITEM "Tallenna Koh&de...", IDM_SAVETARGETAS + MENUITEM "T&ulosta Kohde", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "&Näytä Kuva", IDM_SHOWPICTURE + MENUITEM "Tall&enna Kuva Nimellä...", IDM_SAVEPICTUREAS + MENUITEM "A&seta Taustaksi", IDM_SETASBACKGROUND + MENUITEM "Aseta Ty&öpöydälle...", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "&Leikkaa", IDM_CUT + MENUITEM "K&opioi", IDM_COPY + MENUITEM "Kopioi &Pikakuvake", IDM_COPYSHORTCUT + MENUITEM "L&iitä", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Lis&ää Suosikkeihin...", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM "&Toista", IDM_PLAY + MENUITEM "P&ysäytä", IDM_STOP + MENUITEM "Al&kuun", IDM_REWIND + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "O&minaisuudet", IDM_PROPERTIES + } + + POPUP "Debug" + { + MENUITEM "Trace Tags", IDM_TRACETAGS + MENUITEM "Resource Failures", IDM_RESOURCEFAILURES + MENUITEM "Dump Tracking Info", IDM_DUMPTRACKINGINFO + MENUITEM "Debug Break", IDM_DEBUGBREAK + MENUITEM "Debug View", IDM_DEBUGVIEW + MENUITEM "Dump Tree", IDM_DUMPTREE + MENUITEM "Dump Lines", IDM_DUMPLINES + MENUITEM "Dump DisplayTree", IDM_DUMPDISPLAYTREE + MENUITEM "Dump FormatCaches", IDM_DUMPFORMATCACHES + MENUITEM "Dump LayoutRects", IDM_DUMPLAYOUTRECTS + MENUITEM "Memory Monitor", IDM_MEMORYMONITOR + MENUITEM "Performance Meters", IDM_PERFORMANCEMETERS + MENUITEM "Save HTML", IDM_SAVEHTML + MENUITEM SEPARATOR + MENUITEM "&Browse View", IDM_BROWSEVIEW + MENUITEM "&Edit View", IDM_EDITVIEW + } + + POPUP "Pystysuora Vierityspalkki" + { + MENUITEM "Vieritä Tänne", IDM_SCROLLHERE + MENUITEM SEPARATOR + MENUITEM "Ylös", IDM_TOP + MENUITEM "Alas", IDM_BOTTOM + MENUITEM SEPARATOR + MENUITEM "Sivu Ylös", IDM_PAGEUP + MENUITEM "Sivu Alas", IDM_PAGEDOWN + MENUITEM SEPARATOR + MENUITEM "Vieritä Ylös", IDM_SCROLLUP + MENUITEM "Vieritä Alas", IDM_SCROLLDOWN + } + + POPUP "Vaakasuora Vierityspalkki" + { + MENUITEM "Vieritä Tänne", IDM_SCROLLHERE + MENUITEM SEPARATOR + MENUITEM "Vasen Reuna", IDM_LEFTEDGE + MENUITEM "Oikea Reuna", IDM_RIGHTEDGE + MENUITEM SEPARATOR + MENUITEM "Sivu Vasempaan", IDM_PAGELEFT + MENUITEM "Sivu Oikeaan", IDM_PAGERIGHT + MENUITEM SEPARATOR + MENUITEM "Vieritä Vasemmalle", IDM_SCROLLLEFT + MENUITEM "Vieritä Oikealle", IDM_SCROLLRIGHT + } +} diff -urN wine-20050830/dlls/mshtml/No.rc wine-20050930/dlls/mshtml/No.rc --- wine-20050830/dlls/mshtml/No.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050930/dlls/mshtml/No.rc 2005-09-25 17:18:58.000000000 +0200 @@ -0,0 +1,244 @@ +/* + * Copyright 2005 Alexander N. Sørnes + * + * 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 + */ + + +LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL + +STRINGTABLE DISCARDABLE +{ + IDS_HTMLDISABLED "HTML-tegning er for øyeblikket deaktivert." + IDS_HTMLDOCUMENT "HTML-dokument" +} + +/* FIXME: This should be in shdoclc.dll */ + +IDR_BROWSE_CONTEXT_MENU MENU +{ + POPUP "Standard" + { + MENUITEM "Til&bake", IDM_BACK + MENUITEM "&Fram", IDM_FORWARD + MENUITEM SEPARATOR + MENUITEM "Lagre bakgrunn &som . . .", IDM_SAVEBACKGROUNDAS + MENUITEM "Bruk som bak&grunn", IDM_SETASBACKGROUND + MENUITEM "&Kopier bakgrunn", IDM_COPYBACKGROUND + MENUITEM "Bruk som skrivebor&dsobjekt", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "Merk &alt", IDM_SELECTALL + MENUITEM "&Lim inn", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Lag s&narvei", IDM_CREATESHORTCUT + MENUITEM "Legg til i &favoritter", IDM_ADDTOFAVOURITES + MENUITEM "&Vis kildekode", IDM_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "K&oding", IDM_ENCODING + MENUITEM SEPARATOR + MENUITEM "Skr&iv ut", IDM_PRINT + MENUITEM "Oppdate&r", IDM_REFRESH + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Egenska&per", IDM_PROPERTIES + } + + POPUP "Bilde" + { + MENUITEM "Åpne k&obling", IDM_OPENLINK + MENUITEM "Åpne kobling i &nytt vindu", IDM_OPENINNEWWINDOW + MENUITEM "L&agre mål som . . .", IDM_SAVETARGETAS + MENUITEM "Skriv &ut mål", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "&Vis bilde", IDM_SHOWPICTURE + MENUITEM "Lagre bilde &som . . .", IDM_SAVEPICTUREAS + MENUITEM "Send bilde via &e-post . . .", IDM_EMAILPICTURE + MENUITEM "Skr&iv ut bilde . . .", IDM_PRINTPICTURE + MENUITEM "&Gå til mine bilder", IDM_GOTOMYPICTURES + MENUITEM "Bruk som bak&grunn", IDM_SETASBACKGROUND + MENUITEM "Bruk som skrivebor&dsobjekt . . .", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "Klipp u&t", IDM_CUT + MENUITEM "&Kopier", IDM_COPY + MENUITEM "Kopier snar&veiCopy Shor&tcut", IDM_COPYSHORTCUT + MENUITEM "&Lim inn", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Legg til i &favoritter . . .", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Egenskape&r", IDM_PROPERTIES + } + + POPUP "Kontroller" + { + MENUITEM "An&gre", IDM_UNDO + MENUITEM SEPARATOR + MENUITEM "Klipp u&t", IDM_CUT + MENUITEM "&Kopier", IDM_COPY + MENUITEM "&Lim inn", IDM_PASTE + MENUITEM "&Slett", IDM_DELETE + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Merk &alt", IDM_SELECTALL + } + + POPUP "Tabell" + { + POPUP "&Merk" + { + MENUITEM "&Celle", IDM_CELL + MENUITEM "&Rad", IDM_ROW + MENUITEM "&Kolonne", IDM_COLUMN + MENUITEM "&Tabell", IDM_TABLE + } + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Egenskaper for &celle", IDM_CELLPROPERTIES + MENUITEM "Egenskaper for &tabell", IDM_TABLEPROPERTIES + } + + POPUP "1DSidevelging" + { + MENUITEM "Klipp u&t", IDM_CUT + MENUITEM "&Kopier", IDM_COPY + MENUITEM "Lim inn", IDM_PASTE + MENUITEM "Merk &alt", IDM_SELECTALL + MENUITEM "&Skriv ut", IDM_PRINT + MENUITEM SEPARATOR + } + + POPUP "Anker" + { + MENUITEM "&Åpne", IDM_OPENLINK + MENUITEM "Åpne i &nytt vindu", IDM_OPENINNEWWINDOW + MENUITEM "L&agre mål som . . .", IDM_SAVETARGETAS + MENUITEM "&Skriv ut mål", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "Klipp ut", IDM_CUT + MENUITEM "&Kopier", IDM_COPY + MENUITEM "Kopier snarve&i", IDM_COPYSHORTCUT + MENUITEM "&Lim inn", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Legg til i &favoritter . . .", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Egenskape&r", IDM_PROPERTIES + } + + POPUP "Ukjent sammenheng" + { + MENUITEM SEPARATOR + } + + POPUP "DYNSRC-bilde" + { + MENUITEM "Åpne k&obling", IDM_OPENLINK + MENUITEM "Åpne kobling i &nytt vindu", IDM_OPENINNEWWINDOW + MENUITEM "L&agre mål som . . .", IDM_SAVETARGETAS + MENUITEM "Skriv &ut mål", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "&Vis bilde", IDM_SHOWPICTURE + MENUITEM "Lagre video &som . . .", IDM_SAVEPICTUREAS + MENUITEM "Bruk som bakgrunn", IDM_SETASBACKGROUND + MENUITEM "Bruk som skrivebor&dselement . . .", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "Klipp u&t", IDM_CUT + MENUITEM "&Kopier", IDM_COPY + MENUITEM "Kopier snar&vei", IDM_COPYSHORTCUT + MENUITEM "&Lim inn", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Legg til i &favoritter . . .", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Spill av", IDM_PLAY + MENUITEM "Stopp", IDM_STOP + MENUITEM "Egenskape&r", IDM_PROPERTIES + } + + POPUP "ART-bilde" + { + MENUITEM "&Åpne kobling", IDM_OPENLINK + MENUITEM "Åpne kobling i &nytt vindu", IDM_OPENINNEWWINDOW + MENUITEM "L&agre mål som . . .", IDM_SAVETARGETAS + MENUITEM "Skriv &ut mål", IDM_PRINTTARGET + MENUITEM SEPARATOR + MENUITEM "&Vis bilde", IDM_SHOWPICTURE + MENUITEM "Lagre bilde &som . . .", IDM_SAVEPICTUREAS + MENUITEM "Bruk som bak&grunn", IDM_SETASBACKGROUND + MENUITEM "Bruk som skrivebor&dobjekt . . .", IDM_SETASDESKTOPITEM + MENUITEM SEPARATOR + MENUITEM "Klipp u&t", IDM_CUT + MENUITEM "&Kopier", IDM_COPY + MENUITEM "Kopier s&narvei", IDM_COPYSHORTCUT + MENUITEM "&Lim inn", IDM_PASTE + MENUITEM SEPARATOR + MENUITEM "Legg til i &Favoritter . . .", IDM_ADDTOFAVOURITES + MENUITEM SEPARATOR + MENUITEM "Spill av", IDM_PLAY + MENUITEM "Stopp", IDM_STOP + MENUITEM "Spol tilbake", IDM_REWIND + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "Egenskape&r", IDM_PROPERTIES + } + + POPUP "Feilsøking" + { + MENUITEM "Sporingsmerkelapper", IDM_TRACETAGS + MENUITEM "Ressursfeil", IDM_RESOURCEFAILURES + MENUITEM "Dump sporingsinformasjon", IDM_DUMPTRACKINGINFO + MENUITEM "Feilsøkingspause", IDM_DEBUGBREAK + MENUITEM "Feilsøkingsvisning", IDM_DEBUGVIEW + MENUITEM "Dump 'Tree'", IDM_DUMPTREE + MENUITEM "Dump 'Lines'", IDM_DUMPLINES + MENUITEM "Dump 'DisplayTree'", IDM_DUMPDISPLAYTREE + MENUITEM "Dump 'FormatCaches'", IDM_DUMPFORMATCACHES + MENUITEM "Dump 'LayoutRects'", IDM_DUMPLAYOUTRECTS + MENUITEM "Minneovervåker", IDM_MEMORYMONITOR + MENUITEM "Ytelsesmålere", IDM_PERFORMANCEMETERS + MENUITEM "Lagre HTML", IDM_SAVEHTML + MENUITEM SEPARATOR + MENUITEM "&Bla-visning", IDM_BROWSEVIEW + MENUITEM "R&edigerings-visning", IDM_EDITVIEW + } + + POPUP "Loddrett rullefelt" + { + MENUITEM "Rull her", IDM_SCROLLHERE + MENUITEM SEPARATOR + MENUITEM "Topp", IDM_TOP + MENUITEM "Bunn", IDM_BOTTOM + MENUITEM SEPARATOR + MENUITEM "Side opp", IDM_PAGEUP + MENUITEM "Side ned", IDM_PAGEDOWN + MENUITEM SEPARATOR + MENUITEM "Rull opp", IDM_SCROLLUP + MENUITEM "Rull ned", IDM_SCROLLDOWN + } + + POPUP "Vannrett rullefelt" + { + MENUITEM "Rull her", IDM_SCROLLHERE + MENUITEM SEPARATOR + MENUITEM "Venstre kant", IDM_LEFTEDGE + MENUITEM "Høyre kant", IDM_RIGHTEDGE + MENUITEM SEPARATOR + MENUITEM "Side venstre", IDM_PAGELEFT + MENUITEM "Side høyre", IDM_PAGERIGHT + MENUITEM SEPARATOR + MENUITEM "Rull til venstre", IDM_SCROLLLEFT + MENUITEM "Rull til høyre", IDM_SCROLLRIGHT + } +} diff -urN wine-20050830/dlls/mshtml/mshtml_private.h wine-20050930/dlls/mshtml/mshtml_private.h --- wine-20050830/dlls/mshtml/mshtml_private.h 2005-08-27 11:25:56.000000000 +0200 +++ wine-20050930/dlls/mshtml/mshtml_private.h 2005-09-02 14:19:42.000000000 +0200 @@ -79,6 +79,7 @@ struct NSContainer { const nsIWebBrowserChromeVtbl *lpWebBrowserChromeVtbl; const nsIContextMenuListenerVtbl *lpContextMenuListenerVtbl; + const nsIURIContentListenerVtbl *lpURIContentListenerVtbl; nsIWebBrowser *webbrowser; nsIWebNavigation *navigation; @@ -89,6 +90,8 @@ HTMLDocument *doc; HWND hwnd; + + LPOLESTR url; /* hack */ }; #define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl) @@ -113,6 +116,7 @@ #define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl) #define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl) +#define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl) #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl))) @@ -130,6 +134,7 @@ void HTMLDocument_LockContainer(HTMLDocument*,BOOL); void HTMLDocument_ShowContextMenu(HTMLDocument*,DWORD,POINT*); +BOOL HTMLDocument_OnLoad(HTMLDocument*,LPCWSTR); HRESULT ProtocolFactory_Create(REFCLSID,REFIID,void**); diff -urN wine-20050830/dlls/mshtml/nsembed.c wine-20050930/dlls/mshtml/nsembed.c --- wine-20050830/dlls/mshtml/nsembed.c 2005-08-26 12:05:52.000000000 +0200 +++ wine-20050930/dlls/mshtml/nsembed.c 2005-09-02 16:48:10.000000000 +0200 @@ -35,9 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); -DEFINE_GUID(CLSID_StartupNotifier, 0x1f59b001,0x02c9,0x11d5,0xae,0x76,0xcc,0x92,0xf7,0xdb,0x9e,0x03); -DEFINE_GUID(CLSID_nsWebBrowser, 0xf1eac761,0x87e9,0x11d3,0xaf,0x80,0x00,0xa0,0x24,0xff,0xc0,0x8c); - #define NS_APPSTARTUPNOTIFIER_CONTRACTID "@mozilla.org/embedcomp/appstartup-notifier;1" #define NS_WEBBROWSER_CONTRACTID "@mozilla.org/embedding/browser/nsWebBrowser;1" #define NS_IOSERVICE_CONTRACTID "@mozilla.org/network/io-service;1" @@ -59,8 +56,9 @@ static nsresult (*NS_StringContainerFinish)(nsString*); static nsresult (*NS_CStringContainerFinish)(nsACString*); static nsresult (*NS_StringSetData)(nsString*,const PRUnichar*,PRUint32); -static nsresult (*NS_CStringSetData)(nsString*,const char*,PRUint32); +static nsresult (*NS_CStringSetData)(nsACString*,const char*,PRUint32); static nsresult (*NS_NewLocalFile)(const nsString*,PRBool,nsIFile**); +static PRUint32 (*NS_CStringGetData)(nsACString*,const char**,PRBool*); static HINSTANCE hXPCOM = NULL; @@ -225,6 +223,7 @@ NS_DLSYM(NS_StringSetData); NS_DLSYM(NS_CStringSetData); NS_DLSYM(NS_NewLocalFile); + NS_DLSYM(NS_CStringGetData); #undef NS_DLSYM @@ -277,6 +276,11 @@ NS_CStringSetData(str, data, PR_UINT32_MAX); } +static PRUint32 nsACString_GetData(nsACString *str, const char **data, PRBool *termited) +{ + return NS_CStringGetData(str, data, termited); +} + void nsACString_Destroy(nsACString *str) { NS_CStringContainerFinish(str); @@ -329,6 +333,10 @@ return ret; } +/********************************************************** + * nsIWebBrowserChrome interface + */ + #define NSWBCHROME_THIS(iface) DEFINE_THIS(NSContainer, WebBrowserChrome, iface) static nsresult NSAPI nsWebBrowserChrome_QueryInterface(nsIWebBrowserChrome *iface, @@ -475,6 +483,10 @@ nsWebBrowserChrome_ExitModalEventLoop }; +/********************************************************** + * nsIContextMenuListener interface + */ + #define NSCML_THIS(iface) DEFINE_THIS(NSContainer, ContextMenuListener, iface) static nsresult NSAPI nsContextMenuListener_QueryInterface(nsIContextMenuListener *iface, @@ -487,7 +499,7 @@ static nsrefcnt NSAPI nsContextMenuListener_AddRef(nsIContextMenuListener *iface) { NSContainer *This = NSCML_THIS(iface); - return nsIContextMenuListener_AddRef(NSWBCHROME(This)); + return nsIWebBrowserChrome_AddRef(NSWBCHROME(This)); } static nsrefcnt NSAPI nsContextMenuListener_Release(nsIContextMenuListener *iface) @@ -551,6 +563,151 @@ nsContextMenuListener_OnShowContextMenu }; +/********************************************************** + * nsIURIContentListener interface + */ + +#define NSURICL_THIS(iface) DEFINE_THIS(NSContainer, URIContentListener, iface) + +static nsresult NSAPI nsURIContentListener_QueryInterface(nsIURIContentListener *iface, + nsIIDRef riid, nsQIResult result) +{ + NSContainer *This = NSURICL_THIS(iface); + return nsIWebBrowserChrome_QueryInterface(NSWBCHROME(This), riid, result); +} + +static nsrefcnt NSAPI nsURIContentListener_AddRef(nsIURIContentListener *iface) +{ + NSContainer *This = NSURICL_THIS(iface); + return nsIWebBrowserChrome_AddRef(NSWBCHROME(This)); +} + +static nsrefcnt NSAPI nsURIContentListener_Release(nsIURIContentListener *iface) +{ + NSContainer *This = NSURICL_THIS(iface); + return nsIWebBrowserChrome_Release(NSWBCHROME(This)); +} + +static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener *iface, nsIURI *aURI, + PRBool *_retval) +{ + NSContainer *This = NSURICL_THIS(iface); + BOOL do_load = TRUE; + nsresult nsres; + nsACString *spec_str = nsACString_Create(); + + TRACE("(%p)->(%p %p)\n", This, aURI, _retval); + + nsres = nsIURI_GetSpec(aURI, spec_str); + if(NS_SUCCEEDED(nsres)) { + const char *spec = NULL; + LPWSTR specw; + int len; + + nsACString_GetData(spec_str, &spec, NULL); + + len = MultiByteToWideChar(CP_ACP, 0, spec, -1, NULL, 0); + specw = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, spec, -1, specw, -1); + + if(strcmpW(This->url, specw)) /* hack */ + do_load = HTMLDocument_OnLoad(This->doc, specw); + + HeapFree(GetProcessHeap(), 0, specw); + }else { + ERR("GetSpec failed: %08lx\n", nsres); + } + + nsACString_Destroy(spec_str); + + if(!do_load) { + *_retval = TRUE; + return NS_OK; + } + + return NS_ERROR_NOT_IMPLEMENTED; +} + +static nsresult NSAPI nsURIContentListener_DoContent(nsIURIContentListener *iface, + const char *aContentType, PRBool aIsContentPreferred, nsIRequest *aRequest, + nsIStreamListener **aContentHandler, PRBool *_retval) +{ + NSContainer *This = NSURICL_THIS(iface); + TRACE("(%p)->(%s %x %p %p %p)\n", This, debugstr_a(aContentType), aIsContentPreferred, + aRequest, aContentHandler, _retval); + return NS_ERROR_NOT_IMPLEMENTED; +} + +static nsresult NSAPI nsURIContentListener_IsPreferred(nsIURIContentListener *iface, + const char *aContentType, char **aDesiredContentType, PRBool *_retval) +{ + NSContainer *This = NSURICL_THIS(iface); + + TRACE("(%p)->(%s %p %p)\n", This, debugstr_a(aContentType), aDesiredContentType, _retval); + + /* FIXME: Should we do something here? */ + *_retval = TRUE; + return NS_OK; +} + +static nsresult NSAPI nsURIContentListener_CanHandleContent(nsIURIContentListener *iface, + const char *aContentType, PRBool aIsContentPreferred, char **aDesiredContentType, + PRBool *_retval) +{ + NSContainer *This = NSURICL_THIS(iface); + TRACE("(%p)->(%s %x %p %p)\n", This, debugstr_a(aContentType), aIsContentPreferred, + aDesiredContentType, _retval); + return NS_ERROR_NOT_IMPLEMENTED; +} + +static nsresult NSAPI nsURIContentListener_GetLoadCookie(nsIURIContentListener *iface, + nsISupports **aLoadCookie) +{ + NSContainer *This = NSURICL_THIS(iface); + WARN("(%p)->(%p)\n", This, aLoadCookie); + return NS_ERROR_NOT_IMPLEMENTED; +} + +static nsresult NSAPI nsURIContentListener_SetLoadCookie(nsIURIContentListener *iface, + nsISupports *aLoadCookie) +{ + NSContainer *This = NSURICL_THIS(iface); + WARN("(%p)->(%p)\n", This, aLoadCookie); + return NS_ERROR_NOT_IMPLEMENTED; +} + +static nsresult NSAPI nsURIContentListener_GetParentContentListener(nsIURIContentListener *iface, + nsIURIContentListener **aParentContentListener) +{ + NSContainer *This = NSURICL_THIS(iface); + WARN("(%p)->(%p)\n", This, aParentContentListener); + return NS_ERROR_NOT_IMPLEMENTED; +} + +static nsresult NSAPI nsURIContentListener_SetParentContentListener(nsIURIContentListener *iface, + nsIURIContentListener *aParentContentListener) +{ + NSContainer *This = NSURICL_THIS(iface); + WARN("(%p)->(%p)\n", This, aParentContentListener); + return NS_ERROR_NOT_IMPLEMENTED; +} + +#undef NSURICL_THIS + +static const nsIURIContentListenerVtbl nsURIContentListenerVtbl = { + nsURIContentListener_QueryInterface, + nsURIContentListener_AddRef, + nsURIContentListener_Release, + nsURIContentListener_OnStartURIOpen, + nsURIContentListener_DoContent, + nsURIContentListener_IsPreferred, + nsURIContentListener_CanHandleContent, + nsURIContentListener_GetLoadCookie, + nsURIContentListener_SetLoadCookie, + nsURIContentListener_GetParentContentListener, + nsURIContentListener_SetParentContentListener +}; + void HTMLDocument_NSContainer_Init(HTMLDocument *This) { nsIWebBrowserSetup *wbsetup; @@ -565,6 +722,7 @@ This->nscontainer->lpWebBrowserChromeVtbl = &nsWebBrowserChromeVtbl; This->nscontainer->lpContextMenuListenerVtbl = &nsContextMenuListenerVtbl; + This->nscontainer->lpURIContentListenerVtbl = &nsURIContentListenerVtbl; This->nscontainer->doc = This; @@ -632,6 +790,13 @@ }else { ERR("InitWindow failed: %08lx\n", nsres); } + + nsres = nsIWebBrowser_SetParentURIContentListener(This->nscontainer->webbrowser, + NSURICL(This->nscontainer)); + if(NS_FAILED(nsres)) + ERR("SetParentURIContentListener failed: %08lx\n", nsres); + + This->nscontainer->url = NULL; } void HTMLDocument_NSContainer_Destroy(HTMLDocument *This) @@ -646,4 +811,7 @@ nsIWebBrowserStream_Release(This->nscontainer->stream); HeapFree(GetProcessHeap(), 0, This->nscontainer); + + if(This->nscontainer->url) + CoTaskMemFree(This->nscontainer->url); } diff -urN wine-20050830/dlls/mshtml/nsiface.idl wine-20050930/dlls/mshtml/nsiface.idl --- wine-20050830/dlls/mshtml/nsiface.idl 2005-08-26 12:05:52.000000000 +0200 +++ wine-20050930/dlls/mshtml/nsiface.idl 2005-09-02 14:19:42.000000000 +0200 @@ -64,7 +64,6 @@ /* Currently we don't need a full declaration of these interfaces */ typedef nsISupports nsIWeakReference; -typedef nsISupports nsIURIContentListener; typedef nsISupports nsIDOMWindow; typedef nsISupports nsIInputStream; typedef nsISupports nsIDOMDocument; @@ -77,6 +76,8 @@ typedef nsISupports nsIDOMNode; typedef nsISupports nsIDOMEventTarget; typedef nsISupports nsIDOMAbstractView; +typedef nsISupports nsIRequest; +typedef nsISupports nsIStreamListener; [ object, @@ -149,6 +150,24 @@ [ object, + uuid(94928ab3-8b63-11d3-989d-001083010e9b) +] +interface nsIURIContentListener : nsISupports +{ + nsresult OnStartURIOpen(nsIURI *aURI, PRBool *_retval); + nsresult DoContent(const char *aContentType, PRBool aIsContentPreferred, nsIRequest *aRequest, + nsIStreamListener **aContentHandler, PRBool *_retval); + nsresult IsPreferred(const char *aContentType, char **aDesiredContentType, PRBool *_retval); + nsresult CanHandleContent(const char *aContentType, PRBool aIsContentPreferred, + char **aDesiredContentType, PRBool *_retval); + nsresult GetLoadCookie(nsISupports **aLoadCookie); + nsresult SetLoadCookie(nsISupports *aLoadCookie); + nsresult GetParentContentListener(nsIURIContentListener **aParentContentListener); + nsresult SetParentContentListener(nsIURIContentListener *aParentContentListener); +} + +[ + object, uuid(69e5df00-7b8b-11d3-af61-00a024ffc08c) ] interface nsIWebBrowser : nsISupports diff -urN wine-20050830/dlls/mshtml/oleobj.c wine-20050930/dlls/mshtml/oleobj.c --- wine-20050830/dlls/mshtml/oleobj.c 2005-08-22 16:07:49.000000000 +0200 +++ wine-20050930/dlls/mshtml/oleobj.c 2005-09-02 13:16:40.000000000 +0200 @@ -634,8 +634,16 @@ static HRESULT exec_on_unload(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) { - FIXME("(%p)->(%ld %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut); - return E_NOTIMPL; + TRACE("(%p)->(%ld %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut); + + /* Tests show that we have nothing more to do here */ + + if(pvaOut) { + V_VT(pvaOut) = VT_BOOL; + V_BOOL(pvaOut) = VARIANT_TRUE; + } + + return S_OK; } static HRESULT exec_show_page_setup(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) @@ -775,7 +783,7 @@ } } - if(pguidCmdGroup) + if(pCmdText) FIXME("Set pCmdText\n"); }else { FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup)); @@ -797,9 +805,13 @@ } return exec_table[nCmdID].func(This, nCmdexecopt, pvaIn, pvaOut); + }else if(IsEqualGUID(&CGID_Explorer, pguidCmdGroup)) { + FIXME("unsupported nCmdID %ld of CGID_Explorer group\n", nCmdID); + TRACE("%p %p\n", pvaIn, pvaOut); + return OLECMDERR_E_NOTSUPPORTED; }else if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) { FIXME("unsupported nCmdID %ld of CGID_ShellDocView group\n", nCmdID); - return OLECMDERR_E_UNKNOWNGROUP; + return OLECMDERR_E_NOTSUPPORTED; } FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup)); diff -urN wine-20050830/dlls/mshtml/olewnd.c wine-20050930/dlls/mshtml/olewnd.c --- wine-20050830/dlls/mshtml/olewnd.c 2005-08-26 10:46:37.000000000 +0200 +++ wine-20050930/dlls/mshtml/olewnd.c 2005-09-02 13:18:17.000000000 +0200 @@ -240,7 +240,7 @@ return E_NOTIMPL; } -static IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl = { +static const IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl = { OleInPlaceObjectWindowless_QueryInterface, OleInPlaceObjectWindowless_AddRef, OleInPlaceObjectWindowless_Release, diff -urN wine-20050830/dlls/mshtml/persist.c wine-20050930/dlls/mshtml/persist.c --- wine-20050830/dlls/mshtml/persist.c 2005-08-25 17:19:19.000000000 +0200 +++ wine-20050930/dlls/mshtml/persist.c 2005-09-02 14:19:42.000000000 +0200 @@ -39,7 +39,7 @@ struct BindStatusCallback { const IBindStatusCallbackVtbl *lpBindStatusCallbackVtbl; - + LONG ref; HTMLDocument *doc; @@ -362,13 +362,17 @@ * It uses Gecko's LoadURI instead of IMoniker's BindToStorage. Should we improve * it (to do so we'd have to use not frozen interfaces)? */ + LPOLESTR old_url = This->nscontainer->url; + + This->nscontainer->url = url; nsres = nsIWebNavigation_LoadURI(This->nscontainer->navigation, url, LOAD_FLAGS_NONE, NULL, NULL, NULL); if(NS_SUCCEEDED(nsres)) { - CoTaskMemFree(url); + CoTaskMemFree(old_url); return S_OK; }else { WARN("LoadURI failed: %08lx\n", nsres); + This->nscontainer->url = old_url; } } @@ -559,6 +563,34 @@ PersistFile_GetCurFile }; +BOOL HTMLDocument_OnLoad(HTMLDocument *This, LPCWSTR url) +{ + IOleCommandTarget *cmdtrg = NULL; + HRESULT hres; + + TRACE("(%p)->(%s)\n", This, debugstr_w(url)); + + hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&cmdtrg); + if(SUCCEEDED(hres)) { + VARIANT varUrl, varRes; + + V_VT(&varUrl) = VT_BSTR; + V_BSTR(&varUrl) = SysAllocString(url); + V_VT(&varRes) = VT_BOOL; + + hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 67, 0, &varUrl, &varRes); + SysFreeString(V_BSTR(&varUrl)); + + if(SUCCEEDED(hres) && !V_BOOL(&varRes)) { + TRACE("got VARIANT_FALSE, do not load\n"); + IOleCommandTarget_Release(cmdtrg); + return FALSE; + } + } + + return TRUE; +} + void HTMLDocument_Persist_Init(HTMLDocument *This) { This->lpPersistMonikerVtbl = &PersistMonikerVtbl; diff -urN wine-20050830/dlls/mshtml/protocol.c wine-20050930/dlls/mshtml/protocol.c --- wine-20050830/dlls/mshtml/protocol.c 2005-08-15 12:23:35.000000000 +0200 +++ wine-20050930/dlls/mshtml/protocol.c 2005-09-14 12:06:34.000000000 +0200 @@ -231,6 +231,7 @@ memset(&bindinfo, 0, sizeof(bindinfo)); bindinfo.cbSize = sizeof(BINDINFO); IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo); + ReleaseBindInfo(&bindinfo); if(strlenW(szUrl)>=sizeof(wszAbout)/sizeof(WCHAR) && !memcmp(wszAbout, szUrl, sizeof(wszAbout))) { text = szUrl + sizeof(wszAbout)/sizeof(WCHAR); @@ -399,9 +400,25 @@ PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD* pcchResult, DWORD dwReserved) { - FIXME("%p)->(%s %08x %08lx %p %ld %p %ld)\n", iface, debugstr_w(pwzUrl), ParseAction, + TRACE("%p)->(%s %08x %08lx %p %ld %p %ld)\n", iface, debugstr_w(pwzUrl), ParseAction, dwParseFlags, pwzResult, cchResult, pcchResult, dwReserved); - return E_NOTIMPL; + + if(ParseAction == PARSE_SECURITY_URL) { + int len = lstrlenW(pwzUrl); + + if(len >= cchResult) + return S_FALSE; + + memcpy(pwzResult, pwzUrl, (len+1)*sizeof(WCHAR)); + return S_OK; + } + + if(ParseAction == PARSE_DOMAIN) { + /* Tests show that we don't have to do anything here */ + return S_OK; + } + + return INET_E_DEFAULT_ACTION; } static HRESULT WINAPI AboutProtocolInfo_CombineUrl(IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, @@ -530,13 +547,12 @@ DWORD grfPI, DWORD dwReserved) { ResProtocol *This = PROTOCOL_THIS(iface); - DWORD grfBINDF = 0; + DWORD grfBINDF = 0, len; BINDINFO bindinfo; - int len; - WCHAR dll[MAX_PATH]; - LPCWSTR url_dll, url_file; + LPWSTR url_dll, url_file, url, mime; HMODULE hdll; HRSRC src; + HRESULT hres; static const WCHAR wszRes[] = {'r','e','s',':','/','/'}; @@ -546,40 +562,46 @@ memset(&bindinfo, 0, sizeof(bindinfo)); bindinfo.cbSize = sizeof(BINDINFO); IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo); + ReleaseBindInfo(&bindinfo); + + len = strlenW(szUrl)+16; + url = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + hres = CoInternetParseUrl(szUrl, PARSE_ENCODE, 0, url, len, &len, 0); + if(FAILED(hres)) { + WARN("CoInternetParseUrl failed: %08lx\n", hres); + HeapFree(GetProcessHeap(), 0, url); + IInternetProtocolSink_ReportResult(pOIProtSink, hres, 0, NULL); + return hres; + } - /* FIXME: - * Implement MIME type checking - * Use CoInternetParseUrl (not implemented yet) - */ - - len = strlenW(szUrl); - if(len < sizeof(wszRes)/sizeof(wszRes[0]) || memcmp(szUrl, wszRes, sizeof(wszRes))) { - WARN("Wrong protocol of url: %s\n", debugstr_w(szUrl)); + if(len < sizeof(wszRes)/sizeof(wszRes[0]) || memcmp(url, wszRes, sizeof(wszRes))) { + WARN("Wrong protocol of url: %s\n", debugstr_w(url)); IInternetProtocolSink_ReportResult(pOIProtSink, MK_E_SYNTAX, 0, NULL); + HeapFree(GetProcessHeap(), 0, url); return MK_E_SYNTAX; } - url_dll = szUrl + sizeof(wszRes)/sizeof(wszRes[0]); + url_dll = url + sizeof(wszRes)/sizeof(wszRes[0]); if(!(url_file = strchrW(url_dll, '/'))) { - WARN("wrong url: %s\n", debugstr_w(szUrl)); + WARN("wrong url: %s\n", debugstr_w(url)); IInternetProtocolSink_ReportResult(pOIProtSink, MK_E_SYNTAX, 0, NULL); + HeapFree(GetProcessHeap(), 0, url); return MK_E_SYNTAX; } - memcpy(dll, url_dll, (url_file-url_dll)*sizeof(WCHAR)); - dll[url_file-url_dll] = 0; - - hdll = LoadLibraryExW(dll, NULL, LOAD_LIBRARY_AS_DATAFILE); + *url_file++ = 0; + hdll = LoadLibraryExW(url_dll, NULL, LOAD_LIBRARY_AS_DATAFILE); if(!hdll) { - WARN("Could not open dll: %s\n", debugstr_w(dll)); + WARN("Could not open dll: %s\n", debugstr_w(url_dll)); IInternetProtocolSink_ReportResult(pOIProtSink, HRESULT_FROM_WIN32(GetLastError()), 0, NULL); return HRESULT_FROM_WIN32(GetLastError()); } - src = FindResourceW(hdll, ++url_file, (LPCWSTR)RT_HTML); + src = FindResourceW(hdll, url_file, (LPCWSTR)RT_HTML); if(!src) { - WARN("Could not find resource: %s\n", debugstr_w(url_file)); + WARN("Could not find resource\n"); IInternetProtocolSink_ReportResult(pOIProtSink, HRESULT_FROM_WIN32(GetLastError()), 0, NULL); + HeapFree(GetProcessHeap(), 0, url); return HRESULT_FROM_WIN32(GetLastError()); } @@ -595,6 +617,13 @@ FreeLibrary(hdll); + hres = FindMimeFromData(NULL, url_file, NULL, 0, NULL, 0, &mime, 0); + HeapFree(GetProcessHeap(), 0, url); + if(SUCCEEDED(hres)) { + IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, mime); + CoTaskMemFree(mime); + } + IInternetProtocolSink_ReportData(pOIProtSink, BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE, This->data_len, This->data_len); @@ -747,9 +776,45 @@ PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD* pcchResult, DWORD dwReserved) { - FIXME("%p)->(%s %08x %08lx %p %ld %p %ld)\n", iface, debugstr_w(pwzUrl), ParseAction, + TRACE("%p)->(%s %d %lx %p %ld %p %ld)\n", iface, debugstr_w(pwzUrl), ParseAction, dwParseFlags, pwzResult, cchResult, pcchResult, dwReserved); - return E_NOTIMPL; + + if(ParseAction == PARSE_SECURITY_URL) { + WCHAR *ptr; + DWORD size; + + static const WCHAR wszFile[] = {'f','i','l','e',':','/','/'}; + static const WCHAR wszRes[] = {'r','e','s',':','/','/'}; + + if(strlenW(pwzUrl) <= sizeof(wszRes)/sizeof(WCHAR) || memcmp(pwzUrl, wszRes, sizeof(wszRes))) + return MK_E_SYNTAX; + + ptr = strchrW(pwzUrl + sizeof(wszRes)/sizeof(WCHAR), '/'); + if(!ptr) + return MK_E_SYNTAX; + + size = ptr-pwzUrl + sizeof(wszFile)/sizeof(WCHAR) - sizeof(wszRes)/sizeof(WCHAR); + if(size >= cchResult) + return S_FALSE; + + /* FIXME: return full path */ + memcpy(pwzResult, wszFile, sizeof(wszFile)); + memcpy(pwzResult + sizeof(wszFile)/sizeof(WCHAR), + pwzUrl + sizeof(wszRes)/sizeof(WCHAR), + size*sizeof(WCHAR) - sizeof(wszFile)); + pwzResult[size] = 0; + + if(pcchResult) + *pcchResult = size; + return S_OK; + } + + if(ParseAction == PARSE_DOMAIN) { + /* Tests show that we don't have to do anything here */ + return S_OK; + } + + return INET_E_DEFAULT_ACTION; } static HRESULT WINAPI ResProtocolInfo_CombineUrl(IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, diff -urN wine-20050830/dlls/mshtml/rsrc.rc wine-20050930/dlls/mshtml/rsrc.rc --- wine-20050830/dlls/mshtml/rsrc.rc 2005-08-29 12:47:02.000000000 +0200 +++ wine-20050930/dlls/mshtml/rsrc.rc 2005-09-25 17:18:58.000000000 +0200 @@ -21,9 +21,12 @@ #include "resource.h" +#include "Bg.rc" #include "De.rc" #include "En.rc" +#include "Fi.rc" #include "Fr.rc" +#include "No.rc" REGINST REGINST mshtml.inf diff -urN wine-20050830/dlls/mshtml/tests/htmldoc.c wine-20050930/dlls/mshtml/tests/htmldoc.c --- wine-20050830/dlls/mshtml/tests/htmldoc.c 2005-08-29 11:29:58.000000000 +0200 +++ wine-20050930/dlls/mshtml/tests/htmldoc.c 2005-09-02 13:16:39.000000000 +0200 @@ -210,8 +210,7 @@ static const WCHAR wszHTML_Document[] = {'H','T','M','L',' ','D','o','c','u','m','e','n','t',0}; - ok(expect_SetActiveObject, "unexpected call\n"); - called_SetActiveObject = TRUE; + CHECK_EXPECT2(SetActiveObject); if(expect_SetActiveObject_active) { ok(pActiveObject != NULL, "pActiveObject = NULL\n"); @@ -1077,6 +1076,7 @@ /* TODO: * IServiceProvider + * IOleInPlaceSiteEx * {D48A6EC6-6A4A-11CF-94A7-444553540000} * {7BB0B520-B1A7-11D2-BB23-00C04F79ABCD} * {000670BA-0000-0000-C000-000000000046} @@ -1365,6 +1365,31 @@ IOleCommandTarget_Release(cmdtrg); } +static void test_exec_onunload(IUnknown *unk) +{ + IOleCommandTarget *cmdtrg; + VARIANT var; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IOleCommandTarget, (void**)&cmdtrg); + ok(hres == S_OK, "QueryInterface(IID_IOleCommandTarget) failed: %08lx\n", hres); + if(FAILED(hres)) + return; + + memset(&var, 0x0a, sizeof(var)); + hres = IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_ONUNLOAD, + OLECMDEXECOPT_DODEFAULT, NULL, &var); + ok(hres == S_OK, "Exec(..., OLECMDID_ONUNLOAD, ...) failed: %08lx\n", hres); + ok(V_VT(&var) == VT_BOOL, "V_VT(var)=%d, expected VT_BOOL\n", V_VT(&var)); + ok(V_BOOL(&var) == VARIANT_TRUE, "V_BOOL(var)=%x, expected VARIANT_TRUE\n", V_BOOL(&var)); + + hres = IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_ONUNLOAD, + OLECMDEXECOPT_DODEFAULT, NULL, NULL); + ok(hres == S_OK, "Exec(..., OLECMDID_ONUNLOAD, ...) failed: %08lx\n", hres); + + IOleCommandTarget_Release(cmdtrg); +} + static HWND create_container_window(void) { static const WCHAR wszHTMLDocumentTest[] = @@ -1825,6 +1850,7 @@ test_download(); #endif + test_exec_onunload(unk); test_Window(unk, TRUE); test_InPlaceDeactivate(unk, TRUE); test_Close(unk, FALSE); @@ -1835,7 +1861,6 @@ ref = IUnknown_Release(unk); ok(ref == 0, "ref=%ld, expected 0\n", ref); - } START_TEST(htmldoc) diff -urN wine-20050830/dlls/mshtml/tests/protocol.c wine-20050930/dlls/mshtml/tests/protocol.c --- wine-20050830/dlls/mshtml/tests/protocol.c 2005-08-16 17:59:50.000000000 +0200 +++ wine-20050930/dlls/mshtml/tests/protocol.c 2005-09-14 12:06:34.000000000 +0200 @@ -192,7 +192,7 @@ expect_GetBindInfo = called_GetBindInfo = FALSE; } -static void protocol_start(IInternetProtocol *protocol, LPCWSTR url, BOOL is_mime_todo) +static void protocol_start(IInternetProtocol *protocol, LPCWSTR url) { HRESULT hres; @@ -202,16 +202,12 @@ expect_ReportData = TRUE; expect_hrResult = S_OK; expect_hr_win32err = FALSE; + hres = IInternetProtocol_Start(protocol, url, &protocol_sink, &bind_info, 0, 0); ok(hres == S_OK, "Start failed: %08lx\n", hres); + ok(called_GetBindInfo, "expected GetBindInfo\n"); - if(is_mime_todo) { - todo_wine { - ok(called_ReportProgress, "expected ReportProgress\n"); - } - }else { - ok(called_ReportProgress, "expected ReportProgress\n"); - } + ok(called_ReportProgress, "expected ReportProgress\n"); ok(called_ReportData, "expected ReportData\n"); ok(called_ReportResult, "expected ReportResult\n"); called_GetBindInfo = expect_GetBindInfo = FALSE; @@ -247,8 +243,48 @@ hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (void**)&protocol_info); ok(hres == S_OK, "Could not get IInternetProtocolInfo interface: %08lx\n", hres); if(SUCCEEDED(hres)) { - /* TODO: test IInternetProtocol interface */ - IInternetProtocol_Release(protocol_info); + WCHAR buf[128]; + DWORD size; + int i; + + for(i = PARSE_CANONICALIZE; i <= PARSE_UNESCAPE; i++) { + if(i != PARSE_SECURITY_URL && i != PARSE_DOMAIN) { + hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, i, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == INET_E_DEFAULT_ACTION, + "[%d] failed: %08lx, expected INET_E_DEFAULT_ACTION\n", i, hres); + } + } + + hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_SECURITY_URL, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == S_OK, "ParseUrl failed: %08lx\n", hres); + + hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_SECURITY_URL, 0, buf, + 3, &size, 0); + ok(hres == S_FALSE, "ParseUrl failed: %08lx, expected S_FALSE\n", hres); + + hres = IInternetProtocolInfo_ParseUrl(protocol_info, wrong_url1, PARSE_SECURITY_URL, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == MK_E_SYNTAX, "ParseUrl failed: %08lx, expected MK_E_SYNTAX\n", hres); + + buf[0] = '?'; + hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_DOMAIN, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == S_OK, "ParseUrl failed: %08lx\n", hres); + ok(buf[0] == '?', "buf changed\n"); + + hres = IInternetProtocolInfo_ParseUrl(protocol_info, wrong_url1, PARSE_DOMAIN, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == S_OK, "ParseUrl failed: %08lx, expected MK_E_SYNTAX\n", hres); + ok(buf[0] == '?', "buf changed\n"); + + hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_UNESCAPE+1, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == INET_E_DEFAULT_ACTION, + "ParseUrl failed: %08lx, expected INET_E_DEFAULT_ACTION\n", hres); + + IInternetProtocolInfo_Release(protocol_info); } hres = IUnknown_QueryInterface(unk, &IID_IClassFactory, (void**)&factory); @@ -271,7 +307,7 @@ ok(hres == E_FAIL, "Read returned %08lx expected E_FAIL\n", hres); ok(cb == 0xdeadbeef, "cb=%lu expected 0xdeadbeef\n", cb); - protocol_start(protocol, blank_url, TRUE); + protocol_start(protocol, blank_url); hres = IInternetProtocol_Read(protocol, buf, 2, &cb); ok(hres == S_OK, "Read failed: %08lx\n", hres); ok(cb == 2, "cb=%lu expected 2\n", cb); @@ -283,7 +319,7 @@ hres = IInternetProtocol_UnlockRequest(protocol); ok(hres == S_OK, "UnlockRequest failed: %08lx\n", hres); - protocol_start(protocol, blank_url, TRUE); + protocol_start(protocol, blank_url); hres = IInternetProtocol_Read(protocol, buf, 2, &cb); ok(hres == S_OK, "Read failed: %08lx\n", hres); hres = IInternetProtocol_LockRequest(protocol, 0); @@ -293,7 +329,7 @@ hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); ok(hres == S_OK, "Read failed: %08lx\n", hres); - protocol_start(protocol, blank_url, TRUE); + protocol_start(protocol, blank_url); hres = IInternetProtocol_LockRequest(protocol, 0); ok(hres == S_OK, "LockRequest failed: %08lx\n", hres); hres = IInternetProtocol_Terminate(protocol, 0); @@ -310,12 +346,12 @@ ok(hres == S_OK, "Read failed: %08lx\n", hres); ok(cb == 2, "cb=%lu expected 2\n", cb); - protocol_start(protocol, blank_url, TRUE); + protocol_start(protocol, blank_url); hres = IInternetProtocol_LockRequest(protocol, 0); ok(hres == S_OK, "LockRequest failed: %08lx\n", hres); hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); ok(hres == S_OK, "Read failed: %08lx\n", hres); - protocol_start(protocol, blank_url, TRUE); + protocol_start(protocol, blank_url); hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); ok(hres == S_OK, "Read failed: %08lx\n", hres); hres = IInternetProtocol_Terminate(protocol, 0); @@ -352,8 +388,45 @@ hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (void**)&protocol_info); ok(hres == S_OK, "Could not get IInternetProtocolInfo interface: %08lx\n", hres); if(SUCCEEDED(hres)) { - /* TODO: test IInternetProtocol interface */ - IInternetProtocol_Release(protocol_info); + WCHAR buf[128]; + DWORD size; + int i; + + for(i = PARSE_CANONICALIZE; i <= PARSE_UNESCAPE; i++) { + if(i != PARSE_SECURITY_URL && i != PARSE_DOMAIN) { + hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, i, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == INET_E_DEFAULT_ACTION, + "[%d] failed: %08lx, expected INET_E_DEFAULT_ACTION\n", i, hres); + } + } + + hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_SECURITY_URL, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == S_OK, "ParseUrl failed: %08lx\n", hres); + ok(!lstrcmpW(blank_url, buf), "buf != blank_url\n"); + + hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_SECURITY_URL, 0, buf, + 3, &size, 0); + ok(hres == S_FALSE, "ParseUrl failed: %08lx, expected S_FALSE\n", hres); + + hres = IInternetProtocolInfo_ParseUrl(protocol_info, test_url, PARSE_SECURITY_URL, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == S_OK, "ParseUrl failed: %08lx\n", hres); + ok(!lstrcmpW(test_url, buf), "buf != test_url\n"); + + buf[0] = '?'; + hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_DOMAIN, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == S_OK, "ParseUrl failed: %08lx\n", hres); + ok(buf[0] == '?', "buf changed\n"); + + hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_UNESCAPE+1, 0, buf, + sizeof(buf)/sizeof(buf[0]), &size, 0); + ok(hres == INET_E_DEFAULT_ACTION, + "ParseUrl failed: %08lx, expected INET_E_DEFAULT_ACTION\n", hres); + + IInternetProtocolInfo_Release(protocol_info); } hres = IUnknown_QueryInterface(unk, &IID_IClassFactory, (void**)&factory); @@ -366,7 +439,7 @@ ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres); if(SUCCEEDED(hres)) { - protocol_start(protocol, blank_url, FALSE); + protocol_start(protocol, blank_url); hres = IInternetProtocol_LockRequest(protocol, 0); ok(hres == S_OK, "LockRequest failed: %08lx\n", hres); hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); @@ -376,7 +449,7 @@ hres = IInternetProtocol_UnlockRequest(protocol); ok(hres == S_OK, "UnlockRequest failed: %08lx\n", hres); - protocol_start(protocol, test_url, FALSE); + protocol_start(protocol, test_url); hres = IInternetProtocol_LockRequest(protocol, 0); ok(hres == S_OK, "LockRequest failed: %08lx\n", hres); hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); @@ -386,7 +459,7 @@ hres = IInternetProtocol_UnlockRequest(protocol); ok(hres == S_OK, "UnlockRequest failed: %08lx\n", hres); - protocol_start(protocol, res_url, FALSE); + protocol_start(protocol, res_url); hres = IInternetProtocol_LockRequest(protocol, 0); ok(hres == S_OK, "LockRequest failed: %08lx\n", hres); hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); diff -urN wine-20050830/dlls/msi/.cvsignore wine-20050930/dlls/msi/.cvsignore --- wine-20050830/dlls/msi/.cvsignore 2005-05-07 14:39:55.000000000 +0200 +++ wine-20050930/dlls/msi/.cvsignore 2005-09-29 12:36:03.000000000 +0200 @@ -2,7 +2,6 @@ cond.tab.c cond.tab.h libmsi.def -msi.dll.dbg.c msi.res sql.tab.c sql.tab.h diff -urN wine-20050830/dlls/msi/action.c wine-20050930/dlls/msi/action.c --- wine-20050830/dlls/msi/action.c 2005-08-25 21:19:10.000000000 +0200 +++ wine-20050930/dlls/msi/action.c 2005-09-30 12:32:41.000000000 +0200 @@ -55,36 +55,6 @@ static UINT ACTION_ProcessUISequence(MSIPACKAGE *package); static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq, BOOL UI); -/* - * action handlers - */ -typedef UINT (*STANDARDACTIONHANDLER)(MSIPACKAGE*); - -static UINT ACTION_LaunchConditions(MSIPACKAGE *package); -static UINT ACTION_CostInitialize(MSIPACKAGE *package); -static UINT ACTION_CreateFolders(MSIPACKAGE *package); -static UINT ACTION_CostFinalize(MSIPACKAGE *package); -static UINT ACTION_FileCost(MSIPACKAGE *package); -static UINT ACTION_WriteRegistryValues(MSIPACKAGE *package); -static UINT ACTION_InstallInitialize(MSIPACKAGE *package); -static UINT ACTION_InstallValidate(MSIPACKAGE *package); -static UINT ACTION_ProcessComponents(MSIPACKAGE *package); -static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package); -static UINT ACTION_RegisterUser(MSIPACKAGE *package); -static UINT ACTION_CreateShortcuts(MSIPACKAGE *package); -static UINT ACTION_PublishProduct(MSIPACKAGE *package); -static UINT ACTION_WriteIniValues(MSIPACKAGE *package); -static UINT ACTION_SelfRegModules(MSIPACKAGE *package); -static UINT ACTION_PublishFeatures(MSIPACKAGE *package); -static UINT ACTION_RegisterProduct(MSIPACKAGE *package); -static UINT ACTION_InstallExecute(MSIPACKAGE *package); -static UINT ACTION_InstallFinalize(MSIPACKAGE *package); -static UINT ACTION_ForceReboot(MSIPACKAGE *package); -static UINT ACTION_ResolveSource(MSIPACKAGE *package); -static UINT ACTION_ExecuteAction(MSIPACKAGE *package); -static UINT ACTION_RegisterFonts(MSIPACKAGE *package); -static UINT ACTION_PublishComponents(MSIPACKAGE *package); - /* * consts and values used */ @@ -262,89 +232,15 @@ {'W','r','i','t','e','E','n','v','i','r','o','n','m','e','n','t', 'S','t','r','i','n','g','s',0}; +/* action handlers */ +typedef UINT (*STANDARDACTIONHANDLER)(MSIPACKAGE*); + struct _actions { LPCWSTR action; STANDARDACTIONHANDLER handler; }; -static struct _actions StandardActions[] = { - { szAllocateRegistrySpace, NULL}, - { szAppSearch, ACTION_AppSearch }, - { szBindImage, NULL}, - { szCCPSearch, NULL}, - { szCostFinalize, ACTION_CostFinalize }, - { szCostInitialize, ACTION_CostInitialize }, - { szCreateFolders, ACTION_CreateFolders }, - { szCreateShortcuts, ACTION_CreateShortcuts }, - { szDeleteServices, NULL}, - { szDisableRollback, NULL}, - { szDuplicateFiles, ACTION_DuplicateFiles }, - { szExecuteAction, ACTION_ExecuteAction }, - { szFileCost, ACTION_FileCost }, - { szFindRelatedProducts, ACTION_FindRelatedProducts }, - { szForceReboot, ACTION_ForceReboot }, - { szInstallAdminPackage, NULL}, - { szInstallExecute, ACTION_InstallExecute }, - { szInstallExecuteAgain, ACTION_InstallExecute }, - { szInstallFiles, ACTION_InstallFiles}, - { szInstallFinalize, ACTION_InstallFinalize }, - { szInstallInitialize, ACTION_InstallInitialize }, - { szInstallSFPCatalogFile, NULL}, - { szInstallValidate, ACTION_InstallValidate }, - { szIsolateComponents, NULL}, - { szLaunchConditions, ACTION_LaunchConditions }, - { szMigrateFeatureStates, NULL}, - { szMoveFiles, NULL}, - { szMsiPublishAssemblies, NULL}, - { szMsiUnpublishAssemblies, NULL}, - { szInstallODBC, NULL}, - { szInstallServices, NULL}, - { szPatchFiles, NULL}, - { szProcessComponents, ACTION_ProcessComponents }, - { szPublishComponents, ACTION_PublishComponents }, - { szPublishFeatures, ACTION_PublishFeatures }, - { szPublishProduct, ACTION_PublishProduct }, - { szRegisterClassInfo, ACTION_RegisterClassInfo }, - { szRegisterComPlus, NULL}, - { szRegisterExtensionInfo, ACTION_RegisterExtensionInfo }, - { szRegisterFonts, ACTION_RegisterFonts }, - { szRegisterMIMEInfo, ACTION_RegisterMIMEInfo }, - { szRegisterProduct, ACTION_RegisterProduct }, - { szRegisterProgIdInfo, ACTION_RegisterProgIdInfo }, - { szRegisterTypeLibraries, ACTION_RegisterTypeLibraries }, - { szRegisterUser, ACTION_RegisterUser}, - { szRemoveDuplicateFiles, NULL}, - { szRemoveEnvironmentStrings, NULL}, - { szRemoveExistingProducts, NULL}, - { szRemoveFiles, NULL}, - { szRemoveFolders, NULL}, - { szRemoveIniValues, NULL}, - { szRemoveODBC, NULL}, - { szRemoveRegistryValues, NULL}, - { szRemoveShortcuts, NULL}, - { szResolveSource, ACTION_ResolveSource}, - { szRMCCPSearch, NULL}, - { szScheduleReboot, NULL}, - { szSelfRegModules, ACTION_SelfRegModules }, - { szSelfUnregModules, NULL}, - { szSetODBCFolders, NULL}, - { szStartServices, NULL}, - { szStopServices, NULL}, - { szUnpublishComponents, NULL}, - { szUnpublishFeatures, NULL}, - { szUnregisterClassInfo, NULL}, - { szUnregisterComPlus, NULL}, - { szUnregisterExtensionInfo, NULL}, - { szUnregisterFonts, NULL}, - { szUnregisterMIMEInfo, NULL}, - { szUnregisterProgIdInfo, NULL}, - { szUnregisterTypeLibraries, NULL}, - { szValidateProductID, NULL}, - { szWriteEnvironmentStrings, NULL}, - { szWriteIniValues, ACTION_WriteIniValues }, - { szWriteRegistryValues, ACTION_WriteRegistryValues}, - { NULL, NULL}, -}; +static struct _actions StandardActions[]; /******************************************************** @@ -399,7 +295,7 @@ MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, row); msiobj_release(&row->hdr); - HeapFree(GetProcessHeap(),0,deformated); + msi_free(deformated); } static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, @@ -431,15 +327,90 @@ msiobj_release(&row->hdr); } +static int msi_get_property_int( MSIPACKAGE *package, LPCWSTR prop, int def ) +{ + LPWSTR str = msi_dup_property( package, prop ); + int val = str ? atoiW( str ) : def; + msi_free( str ); + return val; +} + +static UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine ) +{ + LPCWSTR ptr,ptr2; + BOOL quote; + DWORD len; + LPWSTR prop = NULL, val = NULL; + + if (!szCommandLine) + return ERROR_SUCCESS; + + ptr = szCommandLine; + + while (*ptr) + { + if (*ptr==' ') + { + ptr++; + continue; + } + + TRACE("Looking at %s\n",debugstr_w(ptr)); + + ptr2 = strchrW(ptr,'='); + if (!ptr2) + { + ERR("command line contains unknown string : %s\n", debugstr_w(ptr)); + break; + } + + quote = FALSE; + + len = ptr2-ptr; + prop = msi_alloc((len+1)*sizeof(WCHAR)); + memcpy(prop,ptr,len*sizeof(WCHAR)); + prop[len]=0; + ptr2++; + + len = 0; + ptr = ptr2; + while (*ptr && (quote || (!quote && *ptr!=' '))) + { + if (*ptr == '"') + quote = !quote; + ptr++; + len++; + } + + if (*ptr2=='"') + { + ptr2++; + len -= 2; + } + val = msi_alloc((len+1)*sizeof(WCHAR)); + memcpy(val,ptr2,len*sizeof(WCHAR)); + val[len] = 0; + + if (lstrlenW(prop) > 0) + { + TRACE("Found commandline property (%s) = (%s)\n", + debugstr_w(prop), debugstr_w(val)); + MSI_SetPropertyW(package,prop,val); + } + msi_free(val); + msi_free(prop); + } + + return ERROR_SUCCESS; +} + /**************************************************** * TOP level entry points *****************************************************/ -UINT ACTION_DoTopLevelINSTALL(MSIPACKAGE *package, LPCWSTR szPackagePath, - LPCWSTR szCommandLine, LPCWSTR msiFilePath) +UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, + LPCWSTR szCommandLine ) { - DWORD sz; - WCHAR buffer[10]; UINT rc; BOOL ui = FALSE; static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0}; @@ -448,13 +419,11 @@ MSI_SetPropertyW(package, szAction, szInstall); - package->script = HeapAlloc(GetProcessHeap(),0,sizeof(MSISCRIPT)); + package->script = msi_alloc(sizeof(MSISCRIPT)); memset(package->script,0,sizeof(MSISCRIPT)); package->script->InWhatSequence = SEQUENCE_INSTALL; - package->msiFilePath= strdupW(msiFilePath); - if (szPackagePath) { LPWSTR p, check, path; @@ -469,94 +438,31 @@ } else { - HeapFree(GetProcessHeap(),0,path); - path = HeapAlloc(GetProcessHeap(),0,MAX_PATH*sizeof(WCHAR)); + msi_free(path); + path = msi_alloc(MAX_PATH*sizeof(WCHAR)); GetCurrentDirectoryW(MAX_PATH,path); strcatW(path,cszbs); } - check = load_dynamic_property(package, cszSourceDir,NULL); + check = msi_dup_property( package, cszSourceDir ); if (!check) MSI_SetPropertyW(package, cszSourceDir, path); - else - HeapFree(GetProcessHeap(), 0, check); - - HeapFree(GetProcessHeap(), 0, path); + msi_free(check); + msi_free(path); } - if (szCommandLine) - { - LPWSTR ptr,ptr2; - ptr = (LPWSTR)szCommandLine; - - while (*ptr) - { - WCHAR *prop = NULL; - WCHAR *val = NULL; - - TRACE("Looking at %s\n",debugstr_w(ptr)); - - ptr2 = strchrW(ptr,'='); - if (ptr2) - { - BOOL quote=FALSE; - DWORD len = 0; - - while (*ptr == ' ') ptr++; - len = ptr2-ptr; - prop = HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR)); - memcpy(prop,ptr,len*sizeof(WCHAR)); - prop[len]=0; - ptr2++; - - len = 0; - ptr = ptr2; - while (*ptr && (quote || (!quote && *ptr!=' '))) - { - if (*ptr == '"') - quote = !quote; - ptr++; - len++; - } - - if (*ptr2=='"') - { - ptr2++; - len -= 2; - } - val = HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR)); - memcpy(val,ptr2,len*sizeof(WCHAR)); - val[len] = 0; + msi_parse_command_line( package, szCommandLine ); - if (strlenW(prop) > 0) - { - TRACE("Found commandline property (%s) = (%s)\n", - debugstr_w(prop), debugstr_w(val)); - MSI_SetPropertyW(package,prop,val); - } - HeapFree(GetProcessHeap(),0,val); - HeapFree(GetProcessHeap(),0,prop); - } - ptr++; - } - } - - sz = 10; - if (MSI_GetPropertyW(package,szUILevel,buffer,&sz) == ERROR_SUCCESS) + if ( msi_get_property_int(package, szUILevel, 0) >= INSTALLUILEVEL_REDUCED ) { - if (atoiW(buffer) >= INSTALLUILEVEL_REDUCED) + package->script->InWhatSequence |= SEQUENCE_UI; + rc = ACTION_ProcessUISequence(package); + ui = TRUE; + if (rc == ERROR_SUCCESS) { - package->script->InWhatSequence |= SEQUENCE_UI; - rc = ACTION_ProcessUISequence(package); - ui = TRUE; - if (rc == ERROR_SUCCESS) - { - package->script->InWhatSequence |= SEQUENCE_EXEC; - rc = ACTION_ProcessExecSequence(package,TRUE); - } + package->script->InWhatSequence |= SEQUENCE_EXEC; + rc = ACTION_ProcessExecSequence(package,TRUE); } - else - rc = ACTION_ProcessExecSequence(package,FALSE); } else rc = ACTION_ProcessExecSequence(package,FALSE); @@ -692,6 +598,40 @@ return rc; } +UINT MSI_Sequence( MSIPACKAGE *package, LPCWSTR szTable, INT iSequenceMode ) +{ + MSIQUERY * view; + UINT r; + static const WCHAR query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','%','s','`', + ' ','W','H','E','R','E',' ', + '`','S','e','q','u','e','n','c','e','`',' ', + '>',' ','0',' ','O','R','D','E','R',' ','B','Y',' ', + '`','S','e','q','u','e','n','c','e','`',0}; + iterate_action_param iap; + + /* + * FIXME: probably should be checking UILevel in the + * ACTION_PerformUIAction/ACTION_PerformAction + * rather than saving the UI level here. Those + * two functions can be merged too. + */ + iap.package = package; + iap.UI = TRUE; + + TRACE("%p %s %i\n", package, debugstr_w(szTable), iSequenceMode ); + + r = MSI_OpenQuery( package->db, &view, query, szTable ); + if (r == ERROR_SUCCESS) + { + r = MSI_IterateRecords( view, NULL, ITERATE_Actions, &iap ); + msiobj_release(&view->hdr); + } + + return r; +} + static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package, BOOL UIran) { MSIQUERY * view; @@ -818,7 +758,7 @@ } else { - FIXME("UNHANDLED Standard Action %s\n",debugstr_w(action)); + FIXME("unhandled standard action %s\n",debugstr_w(action)); *rc = ERROR_SUCCESS; } } @@ -868,7 +808,7 @@ if (!handled) { - FIXME("UNHANDLED MSI ACTION %s\n",debugstr_w(action)); + FIXME("unhandled msi action %s\n",debugstr_w(action)); rc = ERROR_FUNCTION_NOT_CALLED; } @@ -892,7 +832,7 @@ if (!handled) { - FIXME("UNHANDLED MSI ACTION %s\n",debugstr_w(action)); + FIXME("unhandled msi action %s\n",debugstr_w(action)); rc = ERROR_FUNCTION_NOT_CALLED; } @@ -939,7 +879,7 @@ folder->State = 3; - HeapFree(GetProcessHeap(),0,full_path); + msi_free(full_path); return ERROR_SUCCESS; } @@ -971,33 +911,21 @@ static MSICOMPONENT* load_component( MSIRECORD * row ) { MSICOMPONENT *comp; - DWORD sz; - comp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MSICOMPONENT) ); + comp = msi_alloc_zero( sizeof(MSICOMPONENT) ); if (!comp) return comp; /* fill in the data */ - sz = IDENTIFIER_SIZE; - MSI_RecordGetStringW(row,1,comp->Component,&sz); + comp->Component = load_dynamic_stringW( row, 1 ); - TRACE("Loading Component %s\n", - debugstr_w(comp->Component)); - - sz = 0x100; - if (!MSI_RecordIsNull(row,2)) - MSI_RecordGetStringW(row,2,comp->ComponentId,&sz); - - sz = IDENTIFIER_SIZE; - MSI_RecordGetStringW(row,3,comp->Directory,&sz); + TRACE("Loading Component %s\n", debugstr_w(comp->Component)); + comp->ComponentId = load_dynamic_stringW( row, 2 ); + comp->Directory = load_dynamic_stringW( row, 3 ); comp->Attributes = MSI_RecordGetInteger(row,4); - - sz = 0x100; - MSI_RecordGetStringW(row,5,comp->Condition,&sz); - - sz = IDENTIFIER_SIZE; - MSI_RecordGetStringW(row,6,comp->KeyPath,&sz); + comp->Condition = load_dynamic_stringW( row, 5 ); + comp->KeyPath = load_dynamic_stringW( row, 6 ); comp->Installed = INSTALLSTATE_ABSENT; comp->Action = INSTALLSTATE_UNKNOWN; @@ -1017,7 +945,7 @@ { ComponentList *cl; - cl = HeapAlloc( GetProcessHeap(), 0, sizeof (*cl) ); + cl = msi_alloc( sizeof (*cl) ); if ( !cl ) return ERROR_NOT_ENOUGH_MEMORY; cl->component = comp; @@ -1084,7 +1012,6 @@ { MSIPACKAGE* package = (MSIPACKAGE*)param; MSIFEATURE* feature; - DWORD sz; static const WCHAR Query1[] = {'S','E','L','E','C','T',' ', '`','C','o','m','p','o','n','e','n','t','_','`', @@ -1098,38 +1025,25 @@ /* fill in the data */ - feature = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (MSIFEATURE) ); + feature = msi_alloc_zero( sizeof (MSIFEATURE) ); if (!feature) return ERROR_NOT_ENOUGH_MEMORY; list_init( &feature->Components ); - sz = IDENTIFIER_SIZE; - MSI_RecordGetStringW(row,1,feature->Feature,&sz); + feature->Feature = load_dynamic_stringW( row, 1 ); TRACE("Loading feature %s\n",debugstr_w(feature->Feature)); - sz = IDENTIFIER_SIZE; - if (!MSI_RecordIsNull(row,2)) - MSI_RecordGetStringW(row,2,feature->Feature_Parent,&sz); - - sz = 0x100; - if (!MSI_RecordIsNull(row,3)) - MSI_RecordGetStringW(row,3,feature->Title,&sz); - - sz = 0x100; - if (!MSI_RecordIsNull(row,4)) - MSI_RecordGetStringW(row,4,feature->Description,&sz); + feature->Feature_Parent = load_dynamic_stringW( row, 2 ); + feature->Title = load_dynamic_stringW( row, 3 ); + feature->Description = load_dynamic_stringW( row, 4 ); if (!MSI_RecordIsNull(row,5)) feature->Display = MSI_RecordGetInteger(row,5); feature->Level= MSI_RecordGetInteger(row,6); - - sz = IDENTIFIER_SIZE; - if (!MSI_RecordIsNull(row,7)) - MSI_RecordGetStringW(row,7,feature->Directory,&sz); - + feature->Directory = load_dynamic_stringW( row, 7 ); feature->Attributes = MSI_RecordGetInteger(row,8); feature->Installed = INSTALLSTATE_ABSENT; @@ -1161,7 +1075,7 @@ /* fill in the data */ - file = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (MSIFILE) ); + file = msi_alloc_zero( sizeof (MSIFILE) ); if (!file) return ERROR_NOT_ENOUGH_MEMORY; @@ -1185,7 +1099,6 @@ file->Attributes = MSI_RecordGetInteger( row, 7 ); file->Sequence = MSI_RecordGetInteger( row, 8 ); - file->Temporary = FALSE; file->State = 0; TRACE("File Loaded (%s)\n",debugstr_w(file->File)); @@ -1277,11 +1190,11 @@ ui_actionstart(package, action); TRACE("Executing Action (%s)\n",debugstr_w(action)); rc = ACTION_PerformAction(package, action, TRUE); - HeapFree(GetProcessHeap(),0,package->script->Actions[script][i]); + msi_free(package->script->Actions[script][i]); if (rc != ERROR_SUCCESS) break; } - HeapFree(GetProcessHeap(),0,package->script->Actions[script]); + msi_free(package->script->Actions[script]); package->script->ActionCount[script] = 0; package->script->Actions[script] = NULL; @@ -1316,7 +1229,7 @@ TRACE("Working to load %s\n",debugstr_w(dir)); - folder = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (MSIFOLDER) ); + folder = msi_alloc_zero( sizeof (MSIFOLDER) ); if (!folder) return NULL; @@ -1360,7 +1273,7 @@ if (targetdir) { TRACE(" TargetDefault = %s\n",debugstr_w(targetdir)); - HeapFree(GetProcessHeap(),0, folder->TargetDefault); + msi_free( folder->TargetDefault); folder->TargetDefault = strdupW(targetdir); } @@ -1370,7 +1283,7 @@ folder->SourceDefault = strdupW(shortname); else if (targetdir) folder->SourceDefault = strdupW(targetdir); - HeapFree(GetProcessHeap(), 0, ptargetdir); + msi_free(ptargetdir); TRACE(" SourceDefault = %s\n", debugstr_w( folder->SourceDefault )); parent = MSI_RecordGetString(row,2); @@ -1384,7 +1297,7 @@ ERR("failed to load parent folder %s\n", debugstr_w(parent)); } - folder->Property = load_dynamic_property( package, dir, NULL ); + folder->Property = msi_dup_property( package, dir ); msiobj_release(&row->hdr); @@ -1439,56 +1352,52 @@ INSTALLSTATE state) { static const WCHAR all[]={'A','L','L',0}; - LPWSTR override = NULL; - BOOL rc = FALSE; + LPWSTR override; MSIFEATURE *feature; - override = load_dynamic_property(package, property, NULL); - if (override) + override = msi_dup_property( package, property ); + if (!override) + return FALSE; + + LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { - rc = TRUE; - LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) + if (strcmpiW(override,all)==0) { - if (strcmpiW(override,all)==0) - { - feature->ActionRequest= state; - feature->Action = state; - } - else - { - LPWSTR ptr = override; - LPWSTR ptr2 = strchrW(override,','); + feature->ActionRequest= state; + feature->Action = state; + } + else + { + LPWSTR ptr = override; + LPWSTR ptr2 = strchrW(override,','); - while (ptr) + while (ptr) + { + if ((ptr2 && strncmpW(ptr,feature->Feature, ptr2-ptr)==0) + || (!ptr2 && strcmpW(ptr,feature->Feature)==0)) { - if ((ptr2 && - strncmpW(ptr,feature->Feature, ptr2-ptr)==0) - || (!ptr2 && strcmpW(ptr,feature->Feature)==0)) - { - feature->ActionRequest= state; - feature->Action = state; - break; - } - if (ptr2) - { - ptr=ptr2+1; - ptr2 = strchrW(ptr,','); - } - else - break; + feature->ActionRequest= state; + feature->Action = state; + break; } + if (ptr2) + { + ptr=ptr2+1; + ptr2 = strchrW(ptr,','); + } + else + break; } } - HeapFree(GetProcessHeap(),0,override); } + msi_free(override); - return rc; + return TRUE; } static UINT SetFeatureStates(MSIPACKAGE *package) { - LPWSTR level; - INT install_level; + int install_level; static const WCHAR szlevel[] = {'I','N','S','T','A','L','L','L','E','V','E','L',0}; static const WCHAR szAddLocal[] = @@ -1504,14 +1413,7 @@ TRACE("Checking Install Level\n"); - level = load_dynamic_property(package,szlevel,NULL); - if (level) - { - install_level = atoiW(level); - HeapFree(GetProcessHeap(), 0, level); - } - else - install_level = 1; + install_level = msi_get_property_int( package, szlevel, 1 ); /* ok hereis the _real_ rub * all these activation/deactivation things happen in order and things @@ -1659,7 +1561,7 @@ load_folder(package,name); path = resolve_folder(package,name,FALSE,TRUE,NULL); TRACE("resolves to %s\n",debugstr_w(path)); - HeapFree( GetProcessHeap(), 0, path); + msi_free(path); return ERROR_SUCCESS; } @@ -1736,81 +1638,74 @@ LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry ) { - MSICOMPONENT* comp = NULL; + MSICOMPONENT* comp = file->Component; + LPWSTR p; - comp = file->Component; - - if (file->Temporary == TRUE) + if (!comp) continue; - if (comp) - { - LPWSTR p; + /* calculate target */ + p = resolve_folder(package, comp->Directory, FALSE, FALSE, NULL); - /* calculate target */ - p = resolve_folder(package, comp->Directory, FALSE, FALSE, NULL); + msi_free(file->TargetPath); - HeapFree(GetProcessHeap(),0,file->TargetPath); + TRACE("file %s is named %s\n", + debugstr_w(file->File),debugstr_w(file->FileName)); - TRACE("file %s is named %s\n", - debugstr_w(file->File),debugstr_w(file->FileName)); + file->TargetPath = build_directory_name(2, p, file->FileName); - file->TargetPath = build_directory_name(2, p, file->FileName); + msi_free(p); - HeapFree(GetProcessHeap(),0,p); + TRACE("file %s resolves to %s\n", + debugstr_w(file->File),debugstr_w(file->TargetPath)); - TRACE("file %s resolves to %s\n", - debugstr_w(file->File),debugstr_w(file->TargetPath)); + if (GetFileAttributesW(file->TargetPath) == INVALID_FILE_ATTRIBUTES) + { + file->State = 1; + comp->Cost += file->FileSize; + continue; + } - if (GetFileAttributesW(file->TargetPath) == INVALID_FILE_ATTRIBUTES) + if (file->Version) + { + DWORD handle; + DWORD versize; + UINT sz; + LPVOID version; + static const WCHAR name[] = + {'\\',0}; + static const WCHAR name_fmt[] = + {'%','u','.','%','u','.','%','u','.','%','u',0}; + WCHAR filever[0x100]; + VS_FIXEDFILEINFO *lpVer; + + TRACE("Version comparison.. \n"); + versize = GetFileVersionInfoSizeW(file->TargetPath,&handle); + version = msi_alloc(versize); + GetFileVersionInfoW(file->TargetPath, 0, versize, version); + + VerQueryValueW(version, name, (LPVOID*)&lpVer, &sz); + + sprintfW(filever,name_fmt, + HIWORD(lpVer->dwFileVersionMS), + LOWORD(lpVer->dwFileVersionMS), + HIWORD(lpVer->dwFileVersionLS), + LOWORD(lpVer->dwFileVersionLS)); + + TRACE("new %s old %s\n", debugstr_w(file->Version), + debugstr_w(filever)); + if (strcmpiW(filever,file->Version)<0) { - file->State = 1; + file->State = 2; + FIXME("cost should be diff in size\n"); comp->Cost += file->FileSize; } else - { - if (file->Version) - { - DWORD handle; - DWORD versize; - UINT sz; - LPVOID version; - static const WCHAR name[] = - {'\\',0}; - static const WCHAR name_fmt[] = - {'%','u','.','%','u','.','%','u','.','%','u',0}; - WCHAR filever[0x100]; - VS_FIXEDFILEINFO *lpVer; - - TRACE("Version comparison.. \n"); - versize = GetFileVersionInfoSizeW(file->TargetPath,&handle); - version = HeapAlloc(GetProcessHeap(),0,versize); - GetFileVersionInfoW(file->TargetPath, 0, versize, version); - - VerQueryValueW(version, name, (LPVOID*)&lpVer, &sz); - - sprintfW(filever,name_fmt, - HIWORD(lpVer->dwFileVersionMS), - LOWORD(lpVer->dwFileVersionMS), - HIWORD(lpVer->dwFileVersionLS), - LOWORD(lpVer->dwFileVersionLS)); - - TRACE("new %s old %s\n", debugstr_w(file->Version), - debugstr_w(filever)); - if (strcmpiW(filever,file->Version)<0) - { - file->State = 2; - FIXME("cost should be diff in size\n"); - comp->Cost += file->FileSize; - } - else - file->State = 3; - HeapFree(GetProcessHeap(),0,version); - } - else - file->State = 3; - } - } + file->State = 3; + msi_free(version); + } + else + file->State = 3; } TRACE("Evaluating Condition Table\n"); @@ -1826,7 +1721,7 @@ TRACE("Enabling or Disabling Components\n"); LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry ) { - if (comp->Condition[0]) + if (comp->Condition) { if (MSI_EvaluateConditionW(package, comp->Condition) == MSICONDITION_FALSE) @@ -1839,11 +1734,10 @@ MSI_SetPropertyW(package,szCosting,szOne); /* set default run level if not set */ - level = load_dynamic_property(package,szlevel,NULL); + level = msi_dup_property( package, szlevel ); if (!level) MSI_SetPropertyW(package,szlevel, szOne); - else - HeapFree(GetProcessHeap(),0,level); + msi_free(level); ACTION_UpdateInstallStates(package); @@ -1875,7 +1769,7 @@ else *size = strlenW(ptr)/2; - data = HeapAlloc(GetProcessHeap(),0,*size); + data = msi_alloc(*size); byte[0] = '0'; byte[1] = 'x'; @@ -1900,7 +1794,7 @@ data[count] = (BYTE)strtol(byte,NULL,0); count ++; } - HeapFree(GetProcessHeap(),0,deformated); + msi_free(deformated); TRACE("Data %li bytes(%i)\n",*size,count); } @@ -1913,7 +1807,7 @@ *type=REG_DWORD; *size = sizeof(DWORD); - data = HeapAlloc(GetProcessHeap(),0,*size); + data = msi_alloc(*size); p = deformated; if (*p == '-') p++; @@ -1930,7 +1824,7 @@ *(LPDWORD)data = d; TRACE("DWORD %li\n",*(LPDWORD)data); - HeapFree(GetProcessHeap(),0,deformated); + msi_free(deformated); } } else @@ -2032,7 +1926,7 @@ case -1: { static const WCHAR szALLUSER[] = {'A','L','L','U','S','E','R','S',0}; - LPWSTR all_users = load_dynamic_property(p