diff -urN wine-20050725/ANNOUNCE wine-20050830/ANNOUNCE --- wine-20050725/ANNOUNCE 2005-07-25 14:22:04.000000000 +0200 +++ wine-20050830/ANNOUNCE 2005-08-30 12:58:41.000000000 +0200 @@ -1,15 +1,16 @@ -This is release 20050725 of Wine, a free implementation of Windows on +This is release 20050830 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-20050725: (see ChangeLog for details) - - Beginnings of theme support in common controls. - - Many MSHTML improvements. - - A bunch of OLE fixes for InstallShield installers. - - Many Direct3D fixes and improvements. - - Beginnings of LDAP support. - - Various cleanups after removal of the config file. +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. - Lots of bug fixes. See the README file in the distribution for installation instructions. @@ -18,8 +19,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-20050725.tar.gz - http://prdownloads.sourceforge.net/wine/Wine-20050725.tar.gz + http://www.ibiblio.org/pub/Linux/ALPHA/wine/development/Wine-20050830.tar.gz + http://prdownloads.sourceforge.net/wine/Wine-20050830.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-20050725/ChangeLog wine-20050830/ChangeLog --- wine-20050725/ChangeLog 2005-07-25 14:22:04.000000000 +0200 +++ wine-20050830/ChangeLog 2005-08-30 12:58:41.000000000 +0200 @@ -1,4 +1,3297 @@ ---------------------------------------------------------------- +2005-08-30 Alexandre Julliard + + * dlls/comctl32/animate.c, dlls/comctl32/comboex.c, + dlls/comctl32/comctl32undoc.c, dlls/comctl32/commctrl.c, + dlls/comctl32/header.c, dlls/comctl32/imagelist.c, + dlls/comctl32/ipaddress.c, dlls/comctl32/listview.c, + dlls/comctl32/propsheet.c, dlls/comctl32/status.c, + dlls/comctl32/tab.c, dlls/comctl32/theming.c, + dlls/comctl32/toolbar.c, dlls/comctl32/tooltips.c, + dlls/comctl32/treeview.c, include/commctrl.h, include/prsht.h: + Frank Richter + Fix warnings in 64bit. + + * programs/winecfg/De.rc, programs/winecfg/En.rc, + programs/winecfg/resource.h, programs/winecfg/theme.c: + Frank Richter + Add an "Install theme" button to the appearance page to allow + convenient copying of the .msstyles file to the Right Place inside the + Windows dir. + + * programs/winecfg/No.rc, programs/winecfg/winecfg.rc: + Alexander N. Sřrnes + Norwegian translation of winecfg. + + * dlls/crypt32/cert.c, dlls/crypt32/tests/cert.c: + Juan Lang + Implement collection stores. + + * dlls/uxtheme/draw.c: Frank Richter + More elaborate IsThemeBackgroundPartiallyTransparent() implementation; + also returns TRUE for theme parts with 32bpp images. + + * dlls/shell32/shfldr_unixfs.c: + Michael Jung + Use FIXME's in stubs instead of TRACE's. + Infer pathmode from CLSID in UnixFolderConstructor. + Fail in IShellFolder::BindToObject, if folder does not initialize. + + * dlls/dplayx/dplay.c, dlls/dsound/capture.c, dlls/dsound/primary.c, + dlls/rpcrt4/cpsf.c, dlls/rpcrt4/ndr_marshall.c, + dlls/rpcrt4/rpc_epmap.c, dlls/rpcrt4/rpc_server.c, + dlls/rpcrt4/rpcrt4_main.c: + Mike McCormack + Fix some gcc 4.0 warnings. + + * dlls/mshtml/De.rc: Henning Gerhardt + Update the German resource file. + + * dlls/secur32/secur32.c, dlls/secur32/secur32_priv.h, + dlls/secur32/tests/main.c: + James Hawkins + Juan Lang + Use a standard wine list for packages and providers. + + * dlls/uxtheme/system.c, dlls/uxtheme/uxtheme.spec, + dlls/uxtheme/uxthemedll.h: + Frank Richter + EnumThemeColors() and EnumThemeSizes() actually do not return a single + string with the color/size name, but rather a struct containing three + strings - name, display name and tooltip. + + * dlls/uxtheme/draw.c: Frank Richter + Since theme images are reused now it's not really a good idea to + delete them in drawing functions. + + * programs/winecfg/Nl.rc: Paul Vriens + Update to the latest theme and tab settings. + + * dlls/wldap32/misc.c, dlls/wldap32/winldap_private.h, + dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_count_entries, ldap_count_references, + ldap_first_attribute*, ldap_first_entry, ldap_first_reference, + ldap_next_attribute*, ldap_next_entry and ldap_next_reference. + +2005-08-29 Alexandre Julliard + + * dlls/winecrt0/crt0_private.h, dlls/winecrt0/dll_entry.c, + dlls/winecrt0/exe_entry.c, dlls/winecrt0/exe_wentry.c, + tools/winebuild/spec32.c: + Avoid using common symbols, they are broken on Mac OS. + + * dlls/uxtheme/draw.c, dlls/uxtheme/msstyles.c, + dlls/uxtheme/uxthemedll.h: + Frank Richter + Pass around what kind of transparency an image actually needs. Use + alpha-blending for 32bpp images. + + * programs/winecfg/theme.c: Frank Richter + Make THEME_update_color_and_size static and drop THEME_ prefix. + + * dlls/oleaut32/tmarshal.c: Robert Shearman + Make typelib marshaler use IRpcChannelBuffer::GetBuffer if possible. + + * dlls/oleaut32/typelib.c: Robert Shearman + - Shunt some trace statements over to the typelib channel that aren't + really much use except in debugging typelib parsing. + - Make sure to release a reference to being returned as VariantCopyInd + takes one for us. + + * dlls/shell32/shell32_main.c: Michael Jung + Clone pidlLast before free'ing pidl after call to SHBindToParent. + + * dlls/shell32/tests/shlfolder.c: + Michael Jung + Added test to show that Windows does not allocate a new pidl in + SHBindToParent. + + * dlls/shell32/shfldr_unixfs.c: + Michael Jung + Use StringFromGUID2 instead of StringFromCLSID in + UNIXFS_is_rooted_at_desktop. + + * tools/winebuild/parser.c: + Compute the ordinal base and limit in assign_ordinals instead of doing + it while parsing. + + * dlls/dinput8/Makefile.in, dlls/dplay/Makefile.in, + dlls/newdev/Makefile.in, dlls/ntdll/loader.c, + dlls/olepro32/Makefile.in, dlls/rsabase/Makefile.in, + dlls/shfolder/Makefile.in, dlls/stdole2.tlb/Makefile.in, + dlls/stdole32.tlb/Makefile.in, dlls/winecrt0/dll_main.c: + Uncomment out DisableThreadLibraryCalls in DllMain and add the + kernel32 imports that it requires. + + * dlls/version/info.c, dlls/version/tests/info.c: + Store the result of the A/W conversions in the extra buffer space. + + * dlls/version/info.c, dlls/version/tests/info.c: + Paul Vriens + Reserve extra space for conversions. + + * dlls/winecrt0/Makefile.in, dlls/winecrt0/crt0_private.h, + dlls/winecrt0/dll_entry.c, dlls/winecrt0/exe_entry.c, + dlls/winecrt0/exe_wentry.c, tools/winebuild/import.c, + tools/winebuild/spec32.c, tools/winegcc/winegcc.c: + Moved more of the spec initialization code to the winecrt0 library, + and get rid of implicit kernel32 imports. + + * dlls/wldap32/Makefile.in, dlls/wldap32/misc.c, dlls/wldap32/value.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_count_values*, ldap_get_values*, ldap_msgfree and + ldap_value_free_len. + + * dlls/crypt32/encode.c, dlls/crypt32/tests/encode.c: + Juan Lang + Implement encoding/decoding of CERT_ALT_NAME_INFOs and CRL_INFOs. + + * dlls/kernel/global16.c, dlls/kernel/kernel_main.c, + dlls/kernel/system.c, dlls/kernel/system.drv.spec: + Moved the implementation of a couple of system.drv entry points to + system.c. + + * dlls/wined3d/device.c, dlls/wined3d/directx.c, + dlls/wined3d/surface.c, dlls/wined3d/utils.c: + Oliver Stieber + Added support for DXT2 and DXT4. + + * include/wine/list.h: Juan Lang + Added a LIST_FOR_EACH_ENTRY_SAFE helper macro. + + * dlls/crypt32/cert.c, dlls/crypt32/tests/cert.c: + Juan Lang + Implemented memory cert stores. + + * dlls/comctl32/header.c: Phil Krylov + Improved header control performance by maintaining an internal order + array. + + * libs/wine/ldt.c: + Implemented wine_ldt_alloc_fs and wine_ldt_init_fs for Mac OS. + + * tools/winebuild/spec16.c: + Use __wine_unimplemented_stub from crt0 for 16-bit spec files too. + + * programs/winemine/No.rc, programs/winemine/rsrc.rc: + Alexander N. Sřrnes + Norwegian language support. + + * dlls/mshtml/Fr.rc, dlls/mshtml/rsrc.rc: + Jonathan Ernst + French resources. + + * dlls/uxtheme/draw.c: Frank Richter + If a MINSIZEn property is not present, fall back to actual size of nth + image to determine whether it is suitable. + + * dlls/kernel/kernel32.spec: + Removed a few no longer used 16-bit exports. + + * dlls/kernel/task.c, dlls/kernel/toolhelp16.c: + Moved TaskFindHandle16 to toolhelp16.c. + + * dlls/kernel/global16.c, dlls/kernel/toolhelp.c: + Moved GlobalMasterHandle to global16.c. + + * dlls/kernel/Makefile.in, dlls/kernel/kernel16.c, + dlls/kernel/kernel_main.c, dlls/kernel/krnl386.exe.spec, + dlls/kernel/wowthunk.c: + Moved the kernel 16-bit initialization to a new DllEntryPoint routine + in krnl386. + + * dlls/msi/table.c: Mike McCormack + - the combination of all table keys must be unique, not each key + - MsiViewExecute may not be called before MsiModifyView + + * dlls/uxtheme/draw.c: Frank Richter + Take a common computation out of two if-branches in + UXTHEME_LoadImage(). + + * dlls/wined3d/device.c: Oliver Stieber + Implemented IWineD3DDevice_GetRenderTargetData. + + * dlls/mshtml/En.rc, dlls/mshtml/resource.h, dlls/mshtml/view.c: + Jacek Caban + Move strings to resources. + + * libs/wine/loader.c: Use the correct ordinal flag for Win64 support. + + * dlls/dbghelp/elf_module.c: + Added a couple of missing stubs for the non-ELF case. + + * tools/winebuild/build.h, tools/winebuild/main.c, tools/winebuild/utils.c: + Get rid of the unused owner_name field. + + * programs/winecfg/Fr.rc: Jonathan Ernst + Theming setings in French. + + * dlls/comctl32/toolbar.c: Yuri Kozlov + Set default size for toolbar bitmap if not specified. + + * dlls/msi/action.h, dlls/msi/classes.c, dlls/msi/helpers.c, + dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + - build a standard Wine list of extensions instead of using an array + - use extension pointers instead of array indexes + + * dlls/crypt32/encode.c, dlls/crypt32/protectdata.c, + dlls/crypt32/tests/main.c, dlls/crypt32/tests/protectdata.c, + dlls/dinput/joystick_linux.c, dlls/icmp/icmp_main.c, + dlls/itss/chm_lib.c, dlls/itss/lzx.c, dlls/netapi32/nbnamecache.c, + dlls/netapi32/nbt.c, dlls/odbc32/proxyodbc.c, + dlls/rsaenh/tests/rsaenh.c: + Mike McCormack + gcc 4.0 warning fixes. + + * dlls/wldap32/Makefile.in, dlls/wldap32/extended.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_extended_operation* and ldap_close_extended_op. + + * dlls/d3d8/directx.c: Oliver Stieber + Use wined3dformat when calling wined3d. + + * dlls/uxtheme/draw.c, dlls/uxtheme/msstyles.c, dlls/uxtheme/msstyles.h: + Frank Richter + Implement "manual" image sharing(as opposed to using LoadImage() with + LR_SHARED) by keeping the loaded images in a list. This is needed for + proper alpha support later on since once-per-image preparations will + be needed then. + + * dlls/mshtml/tests/htmldoc.c: Jacek Caban + - Added IHlinkTarget::Navigate test. + - Added downloading test (disabled). + + * programs/winecfg/Ru.rc: Yuri Kozlov + Theme dialog added in Ru.rc. + +2005-08-27 Alexandre Julliard + + * dlls/Makedll.rules.in: + Fixed the checklink target to link against winecrt0 too. + + * dlls/kernel/instr.c, dlls/kernel/kernel16_private.h, + dlls/kernel/kernel_main.c, dlls/kernel/kernel_private.h, + dlls/kernel/wowthunk.c: + Don't try to initialize the 16-bit thunking code if 16-bit support is + disabled. + + * dlls/msi/classes.c: Mike McCormack + Add the allocated mime type to the mime type list. + + * dlls/advapi32/crypt_lmhash.c, dlls/advapi32/crypt_sha.c, + dlls/advapi32/registry.c, dlls/advapi32/service.c, + dlls/advapi32/tests/crypt_lmhash.c, dlls/advapi32/tests/crypt_md4.c, + dlls/advapi32/tests/crypt_md5.c, dlls/cabinet/cabinet.h, + dlls/comctl32/rebar.c, dlls/comctl32/tab.c, programs/view/view.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/comctl32/propsheet.c: + Thomas Weidenmueller + It should be allowed to pass NULL handles in the phpage array of the + PROPSHEETHEADER structure to PropertySheet(), just ignore them. + + * dlls/wined3d/device.c, dlls/wined3d/swapchain.c: + Oliver Stieber + Moved GetRasterStatus from device to swapchain. + + * dlls/comctl32/tests/Makefile.in, dlls/crypt32/tests/Makefile.in, + dlls/gdi/tests/Makefile.in, dlls/iphlpapi/tests/Makefile.in, + dlls/lzexpand/tests/Makefile.in, dlls/mapi32/tests/Makefile.in, + dlls/msacm/tests/Makefile.in, dlls/mshtml/tests/Makefile.in, + dlls/msvcrt/tests/Makefile.in, dlls/msvcrtd/tests/Makefile.in, + dlls/netapi32/tests/Makefile.in, dlls/oleaut32/tests/Makefile.in, + dlls/rpcrt4/tests/Makefile.in, dlls/secur32/tests/Makefile.in, + dlls/shell32/tests/Makefile.in, dlls/shlwapi/tests/Makefile.in, + dlls/urlmon/tests/Makefile.in, dlls/user/tests/Makefile.in, + dlls/version/tests/Makefile.in, dlls/wininet/tests/Makefile.in, + dlls/winsock/tests/Makefile.in, programs/winetest/Makefile.in: + Explicitly import kernel32 in tests that use it. + + * dlls/mshtml/Makefile.in, dlls/mshtml/hlink.c, dlls/mshtml/htmldoc.c, + dlls/mshtml/mshtml_private.h: + Jacek Caban + Added IHlinkTarget interface. + + * dlls/ole32/compobj_private.h, dlls/ole32/marshal.c, + dlls/ole32/tests/marshal.c: + Robert Shearman + - Implement IMarshal on proxies so that we don't end up with proxies + to proxies, causing potential deadlock issues and performance + problems. + - Add a test for this situation and remove the todo_wine from another + test that now succeeds. + + * dlls/mshtml/De.rc, dlls/mshtml/rsrc.rc: + Henning Gerhardt + Added German resources. + + * dlls/user/listbox.c, dlls/user/tests/listbox.c: + Jason Edmeades + Listbox delete string handling should validate the range of the + index. Added some tests. + + * dlls/wined3d/texture.c: Oliver Stieber + Change SetDirty in texture to pass the value of dirty instead of + always passing TRUE. + + * dlls/x11drv/xrender.c: Frank Richter + Make AlphaBlend() respect the destination clipping region. + + * include/commctrl.h: Frank Richter + Added WC_SCROLLBAR. + + * dlls/winsock/socket.c, dlls/winsock/tests/sock.c: + Hans Leidekker + Avoid using the obsolete inet_addr. + + * dlls/mshtml/tests/htmldoc.c: Jacek Caban + Make pActiveObject test language specific. + + * dlls/sensapi/sensapi.c, include/sensapi.h: + Marcus Meissner + IsNetworkAlive() enhanced, always reports LAN. + +2005-08-26 Alexandre Julliard + + * dlls/rsaenh/rsaenh.c, dlls/wined3d/swapchain.c, + dlls/wined3d/wined3d_private.h: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/mshtml/mshtml_private.h, dlls/mshtml/nsembed.c, + dlls/mshtml/nsiface.idl, dlls/mshtml/view.c: + Jacek Caban + Beginning implementation of Gecko focus handling. + + * dlls/shell32/.cvsignore, dlls/shell32/Makefile.in, + dlls/shell32/folders.c, dlls/shell32/iconcache.c, + dlls/shell32/regsvr.c, dlls/shell32/shell32_main.h, + dlls/shell32/shellole.c, dlls/shell32/shfldr_unixfs.c, + dlls/shell32/shres.rc, dlls/shell32/shresdef.h: + Michael Jung + Implemented 'My Documents' folder. + + * dlls/oleaut32/varformat.c, dlls/winedos/dosaspi.c, + dlls/winedos/dosmem.c, dlls/winedos/module.c, dlls/wineps/driver.c, + dlls/wineps/init.c, dlls/wineps/ps.c, dlls/wineps/type42.c, + dlls/winsock/tests/sock.c, programs/winetest/send.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/Makefile.in, dlls/make_dlls: + We no longer need a special case for the ntdll import library. + + * include/wtypes.idl: Robert Shearman + Added more wtypes definitions, particularly for GDI/USER handles. + + * include/urlmon.idl: Robert Shearman + - The output size should be *pcbPolicy for ppPolicy, not the input + size. + - Remove a stray semi-colon. + + * include/oleidl.idl: Robert Shearman + Move interfaces around to satisfy MIDL. + + * include/msxml.idl: Robert Shearman + Remove nonsense msxml IDL attributes. + + * dlls/x11drv/xfont.c: Pavel Roskin + Extend uRelax scale so that yres is relaxed before slant, not at the + same time. + + * dlls/msi/action.h, dlls/msi/classes.c, dlls/msi/helpers.c, + dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + - build a standard Wine list of mime types instead of using an array + - use mime type pointers instead of array indexes + + * dlls/ole32/compobj.c, dlls/ole32/ole32.spec: + Robert Shearman + Add stub for CoAllowSetForegroundWindow. + + * dlls/crypt32/cert.c, dlls/crypt32/crypt32.spec: + Juan Lang + Added a bunch of stubs. + + * dlls/mshtml/En.rc, dlls/mshtml/olewnd.c, dlls/mshtml/resource.h, + dlls/mshtml/rsrc.rc: + Jacek Caban + Added default MSHTML context menu. + + * include/wincrypt.h: Juan Lang + Correct a typo, and add more definitions. + +2005-08-25 Alexandre Julliard + + * dlls/winecrt0/Makefile.in, dlls/winecrt0/delay_load.c, + tools/winebuild/import.c, tools/winebuild/spec32.c: + Moved the delay loading support code to the winecrt0 library. + + * include/Makefile.in, include/ddk/winsplp.h: + Detlef Riekenberg + Added winsplp.h header. + + * programs/uninstaller/Makefile.in, programs/winepath/Makefile.in, + tools/winegcc/winegcc.c, tools/winegcc/winegcc.man: + Added a -municode flag to winegcc for applications that have a wmain() + entry point. + + * dlls/mshtml/mshtml_private.h, dlls/mshtml/nsembed.c, + dlls/mshtml/nsiface.idl, dlls/mshtml/olewnd.c: + Jacek Caban + - Beginning implementation of context menu. + - Set nsIWebBrowserChrome of nsIWebBrowser. + + * dlls/wined3d/Makefile.in, dlls/wined3d/device.c, + dlls/wined3d/pixelshader.c, dlls/wined3d/wined3d_private.h: + Oliver Stieber + Implemented stubbed out pixel shaders and their states in wined3d. + + * dlls/commdlg/printdlg.c: Vitaly Lipatov + Restore paper orientation when pagesetupdlg is initializing. + + * dlls/ntdll/signal_i386.c: Glenn Wurster + Make stack check work if stack is a small value. + + * dlls/ddraw/tests/d3d.c: + Saulius Krasuckas + - DirectDrawCreateEx fails with Standard VGA Adapter driver. + - IDirect3D7::CreateDevice() returns E_OUTOFMEMORY if a card has no 3D + acceleration. + + * programs/winecfg/De.rc, programs/winecfg/En.rc, + programs/winecfg/Fr.rc, programs/winecfg/Ja.rc, + programs/winecfg/Nl.rc, programs/winecfg/Ru.rc, + programs/winecfg/main.c, programs/winecfg/resource.h: + Frank Richter + Load tab titles and property sheet caption from string resources. + + * dlls/msi/action.c: Mike McCormack + Make sure to save the result calculated in ACTION_UpdateInstallStates. + + * dlls/user/sysparams.c, dlls/user/tests/sysparams.c: + Vitaly Lipatov + - remove return: now break loop if can't change state during test + - add test for value returned by SwapMouseButton + - fix SwapMouseButton return value (it returns previous state) + + * dlls/comctl32/header.c: Phil Krylov + Draw header control items only within the header client area. + + * dlls/activeds/Makefile.in, dlls/d3dim/Makefile.in, + dlls/d3drm/Makefile.in, dlls/msnet32/Makefile.in, + dlls/msvcrt20/Makefile.in, dlls/msvcrt40/Makefile.in, + dlls/ntdll/exception.c, dlls/oleacc/Makefile.in, + dlls/sti/Makefile.in, dlls/url/Makefile.in, + dlls/winecrt0/Makefile.in, dlls/winecrt0/stub.c, + tools/winebuild/import.c, tools/winebuild/spec32.c: + Moved the implementation of spec file stubs to the winecrt0 library. + + * dlls/comctl32/theme_dialog.c: Frank Richter + Add WM_CTLCOLORSTATIC handler to dialog theming subclass so static + text can appear transparent (for e.g. tab pages which commonly have a + "fancy" background). + + * dlls/msi/files.c: Aric Stewart + The file name used in the ui messages is the target name not the + source name. + + * programs/winecfg/De.rc, programs/winecfg/En.rc: + Frank Richter + Add English Neutral and German appearance tab translations. + + * documentation/PACKAGING: Tom Wickline + Removed remaining config references. + + * dlls/mshtml/persist.c, dlls/mshtml/tests/Makefile.in, + dlls/mshtml/tests/htmldoc.c: + Jacek Caban + - Added test of IPersistMoniker::Load. + - Fix Wine to pass the test. + + * dlls/Makefile.in, dlls/make_dlls: + Install the static import libraries too. + + * configure, configure.ac, dlls/.cvsignore, dlls/Makeimplib.rules.in, + dlls/dxerr8/Makefile.in, dlls/dxerr9/Makefile.in, + dlls/dxguid/Makefile.in, dlls/strmiids/Makefile.in, + dlls/uuid/Makefile.in, dlls/winecrt0/Makefile.in: + Added a make rules file for static import libraries. + + * configure, configure.ac, dlls/Makefile.in, dlls/winecrt0/.cvsignore, + dlls/winecrt0/Makefile.in, dlls/winecrt0/dll_main.c, + dlls/winecrt0/exe_main.c, dlls/winecrt0/exe_wmain.c, + programs/uninstaller/Makefile.in, programs/winepath/Makefile.in, + tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/main.c, tools/winebuild/spec32.c, + tools/winegcc/winegcc.c: + Beginnings of a crt0 library. + + * include/Makefile.in: + Fixed installation rules for Wine-specific IDL files. + + * dlls/itss/itss.idl, dlls/itss/.cvsignore, dlls/itss/Makefile.in, + dlls/itss/itss.c, dlls/itss/moniker.c, dlls/itss/regsvr.c, + dlls/itss/storage.c, include/Makefile.in, include/wine/.cvsignore, + include/wine/itss.idl: + James Hawkins + Moved itss.idl to include/wine. + + * dlls/ntdll/virtual.c: + Use FILE_GetDeviceInfo in NtMapViewOfSection to avoid having to fetch + the file descriptor twice. + + * dlls/msi/action.h, dlls/msi/classes.c, dlls/msi/helpers.c, + dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + - build a standard Wine list of classes instead of using an array + - use class pointers instead of array indexes + + * dlls/winsock/socket.c: Mike McCormack + gcc 4.0 warning fixes. + + * dlls/crypt32/cert.c, dlls/crypt32/crypt32.spec, + dlls/crypt32/crypt32_private.h, dlls/crypt32/main.c, + dlls/crypt32/tests/.cvsignore, dlls/crypt32/tests/Makefile.in, + dlls/crypt32/tests/cert.c: + Juan Lang + Implemented CryptHashCertificate. + + * dlls/msi/package.c: Mike McCormack + Don't dereference variables in a trace. + + * include/objidl.idl, include/wtypes.idl: + Robert Shearman + Update to include all of the interfaces in the Platform SDK as of the + XP SP2 version. + + * dlls/ole32/compobj.c, dlls/ole32/compobj_private.h: + Robert Shearman + Remove unused thread handle entry from the apartment structure. + + * dlls/msi/classes.c: Mike McCormack + Fix a small bug introduced when converting appids to a list. + + * dlls/msi/action.c: Aric Stewart + Display the correct text string in the action text field for the + dialog boxes. Also the string should be deformatted. + +2005-08-24 Alexandre Julliard + + * dlls/ntdll/server.c, include/wine/server_protocol.h, server/fd.c, + server/handle.c, server/handle.h, server/protocol.def, + server/request.h, server/trace.c: + Don't cache file descriptors open on removable devices. + + * dlls/ntdll/file.c, dlls/ntdll/ntdll_misc.h: + Moved the FileFsDeviceInformation query to a separate function. + + * dlls/msvcrt/mbcs.c, dlls/msvcrt/msvcrt.spec: + Vitaly Lipatov + Add missed _mbscoll function. + + * dlls/atl/atl_main.c: Aric Stewart + Version 1 atl modules only have a structure size of 100 and no + functions to call. + + * dlls/msi/install.c, include/msiquery.h: + Johan Dahlin + Implemented MsiSetComponentState*. + + * dlls/msi/tests/db.c: Mike McCormack + Test case for MsiModifyView and MsiViewGetError. + + * dlls/msi/create.c, dlls/msi/delete.c, dlls/msi/insert.c, + dlls/msi/msipriv.h, dlls/msi/select.c, dlls/msi/table.c: + Mike McCormack + Implement MsiModifyView (MSIMODIFY_INSERT_TEMPORARY). + + * programs/winecfg/De.rc, programs/winecfg/En.rc, + programs/winecfg/Makefile.in, programs/winecfg/main.c, + programs/winecfg/resource.h, programs/winecfg/theme.c, + programs/winecfg/winecfg.h: + Frank Richter + Add an "Appearance" tab to control the currently active theme. + + * dlls/msi/msiquery.c, include/msiquery.h: + Mike McCormack + Better stub for MsiViewGetError. + + * dlls/msi/action.c: Johan Dahlin + Added a null check for component. + + * dlls/msi/action.h: Mike McCormack + Add include guard to header and make functions extern. + + * dlls/x11drv/text.c: Huw Davies + Use the correct rectangle for ETO_OPAQUE - spotted by James Hawkins. + + * dlls/msi/install.c, dlls/msi/msi.spec: + Johan Dahlin + Added stubs for MsiSetComponentStateA and MsiSetComponentStateW. + + * dlls/msi/action.h, dlls/msi/classes.c, dlls/msi/helpers.c, + dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + - build a standard Wine list of appids instead of using an array + - use appid pointers instead of array indexes + + * dlls/wininet/http.c: James Hawkins + Avoid heap corruption by not accessing old HeapReAlloc'ed pointer. + + * dlls/oleaut32/tmarshal.c: Robert Shearman + - Remove redundant QueryInterface in marshal_interface - the object is + always queried later on for the correct interface of the object. + - Make sure to Release the marshaled pointer in the typelib marshaler + once it is no longer required. + + * dlls/oleaut32/olepicture.c: Michael Stefaniuc + Implement IPicture::get_hPal for PICTYPE_BITMAP. + +2005-08-23 Alexandre Julliard + + * tools/winebuild/spec32.c: + The exported name strings should be inside the export directory (found + by Vitaliy Margolen). + + * dlls/ddraw/tests/d3d.c: + Saulius Krasuckas + Skip testing on IDirect3D7::CreateDevice() failure. + + * dlls/wined3d/swapchain.c: Oliver Stieber + Update the implementation of GetFrontBufferData in stateblock. + + * configure, configure.ac, dlls/Makefile.in, dlls/mciavi32/.cvsignore, + dlls/mciavi32/Makefile.in, dlls/mciavi32/info.c, + dlls/mciavi32/mciavi.c, dlls/mciavi32/mciavi32.spec, + dlls/mciavi32/mciavi_res.rc, dlls/mciavi32/mmoutput.c, + dlls/mciavi32/private_mciavi.h, dlls/mciavi32/wnd.c, + dlls/winmm/mciavi/.cvsignore, dlls/winmm/mciavi/Makefile.in, + dlls/winmm/mciavi/info.c, dlls/winmm/mciavi/mciavi.c, + dlls/winmm/mciavi/mciavi.drv.spec, dlls/winmm/mciavi/mciavi_res.rc, + dlls/winmm/mciavi/mmoutput.c, dlls/winmm/mciavi/private_mciavi.h, + dlls/winmm/mciavi/wnd.c, dlls/winmm/time.c, + programs/winecfg/properties.c, tools/wine.inf: + Rémi Assailly + Moved mciavi32 to the top-level dlls directory. + + * dlls/msvcrt/mbcs.c, dlls/msvideo/msvideo16.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/ntdll/om.c, dlls/ntdll/server.c, include/wine/server_protocol.h, + server/handle.c, server/handle.h, server/protocol.def, + server/request.h, server/trace.c: + Added a separate set_handle_cached_fd request instead of abusing + set_handle_info for that. + + * dlls/kernel/process.c: + Rewrote Get/SetHandleInformation to call the corresponding ntdll + functions. + + * dlls/itss/Makefile.in, dlls/itss/itss.c, dlls/itss/regsvr.c, + tools/wine.inf: + James Hawkins + Register the ITStorage class. + + * dlls/riched20/caret.c, dlls/riched20/reader.c: + Phil Krylov + Fixed a RichEdit RTF reader bug which resulted in loss of text. + Eliminated unneeded recursion in ME_InsertTextFromCursor(). + + * include/mshtmhst.idl: Jacek Caban + Added more definitions. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/helpers.c, + dlls/msi/install.c, dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + - build a standard Wine list of folders instead of using an array + - use folder pointers instead of array indexes + + * documentation/PACKAGING: Tom Wickline + Remove reference to config file. + Add .deb file with .rpm file for successful install. + + * DEVELOPERS-HINTS: Tom Wickline + Remove reference to documentation/samples/. + Add recently implemented dlls. + + * dlls/x11drv/xrender.c: Huw Davies + Avoid using XRenderFindStandardFormat as older libraries don't have + it. + + * dlls/comctl32/tab.c, dlls/comctl32/tests/tab.c: + Vitaliy Margolen + Fix handling of minimum tab width. + Add more tests to test it. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/classes.c, + dlls/msi/custom.c, dlls/msi/files.c, dlls/msi/format.c, + dlls/msi/helpers.c, dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + - build a standard Wine list of files instead of using an array + - use file pointers instead of array indexes + + * dlls/riched20/row.c: Phil Krylov + Fixed EM_EXLINEFROMCHAR to work for last row of a paragraph. + + * dlls/comctl32/progress.c, dlls/comctl32/tests/.cvsignore, + dlls/comctl32/tests/Makefile.in, dlls/comctl32/tests/progress.c: + Michael Kaufmann + - Redraw immediately upon PBM_SETPOS, PBM_DELTAPOS, PBM_STEPIT. + - New tests. + + * programs/winedbg/winedbg.c: Glenn Wurster + Don't pass on EH_STACK_INVALID exceptions. + + * dlls/gdi/enhmfdrv/enhmetafiledrv.h, dlls/gdi/enhmfdrv/graphics.c, + dlls/gdi/font.c, dlls/gdi/gdi_private.h, + dlls/gdi/mfdrv/metafiledrv.h, dlls/gdi/mfdrv/text.c, + dlls/ttydrv/graphics.c, dlls/ttydrv/ttydrv.h, + dlls/ttydrv/winetty.drv.spec, dlls/wineps/psdrv.h, + dlls/wineps/text.c, dlls/wineps/wineps.drv.spec, dlls/x11drv/text.c, + dlls/x11drv/winex11.drv.spec, dlls/x11drv/x11drv.h, + dlls/x11drv/xrender.c: + Huw Davies + Move a bunch of common code from the drivers into gdi. + + * dlls/shell32/tests/Makefile.in, dlls/shell32/tests/shlfolder.c: + Michael Jung + Added some tests for CLSID_FolderShortcut objects. + + * dlls/msxml3/tests/domdoc.c: Mike McCormack + Add some node tests. + + * dlls/shell32/tests/shlexec.c, dlls/twain/capability.c, + dlls/version/resource.c, dlls/winaspi/winaspi16.c, + dlls/winaspi/winaspi32.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * include/windef.h, include/wine/debug.h: + Kevin Koltzau + Fix pointer cast warnings in 64bit. + + * dlls/d3d9/cubetexture.c, dlls/d3d9/d3d9.spec, dlls/d3d9/d3d9_main.c, + dlls/d3d9/d3d9_private.h, dlls/d3d9/device.c, dlls/d3d9/directx.c, + dlls/d3d9/indexbuffer.c, dlls/d3d9/pixelshader.c, + dlls/d3d9/stateblock.c, dlls/d3d9/surface.c, dlls/d3d9/swapchain.c, + dlls/d3d9/texture.c, dlls/d3d9/vertexbuffer.c, + dlls/d3d9/vertexshader.c, dlls/d3d9/volume.c, + dlls/d3d9/volumetexture.c, include/wine/wined3d_types.h: + Oliver Stieber + Tidy up d3d9 and finalize passing d3d9 calls to wined3d for now. + + * dlls/oleaut32/tests/vartest.c, dlls/oleaut32/variant.c: + Michael Stefaniuc + - VarAdd, VarMul: I4 overflows to R8 and not I8 even if the result + would fit in I8. Fix tests. + - Document a brokeness in the handling of I8 numbers in + VarNumFromParseNum. Fix tests. + + * dlls/riched20/editor.c: Phil Krylov + Added support for backward search to RichEdit EM_FINDTEXT[AW], + EM_FINDTEXTEX[AW] message handler. + + * dlls/advapi32/service.c, include/winsvc.h: + Kevin Koltzau + Properly declare handles. + + * include/commctrl.h: Michael Kaufmann + Added SB_SIMPLEID. + + * dlls/msi/action.c: Aric Stewart + Make index INT not UINT because it can be -1. + +2005-08-22 Alexandre Julliard + + * dlls/ddraw/device_opengl.c: + Saulius Krasuckas + Don't leak a list of visuals (with advice of Jacek Caban). + + * dlls/version/tests/info.c: + Add an extra test to show failing behavior. + + * dlls/wldap32/error.c, dlls/wldap32/init.c, dlls/wldap32/misc.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement LdapGetLastError, cldap_open*, ldap_abandon, + ldap_check_filter*, ldap_cleanup, ldap_conn_from_msg and + ldap_connect. + + * dlls/shell32/shfldr_unixfs.c: + Michael Jung + Initialize all members in UnixFolder constructor. + Support NULL value pidls in GetDisplayNameOf method. + + * dlls/riched20/editor.c: Phil Krylov + Fixed EM_SETEVENTMASK RichEdit message handler to return old event + mask. + + * dlls/user/menu.c: Mike McCormack + Fix magic item handling and warnings. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/classes.c, + dlls/msi/events.c, dlls/msi/helpers.c, dlls/msi/install.c, + dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + - build a standard Wine list of features instead of using an array + - use feature pointers instead of array indexes + + * dlls/kernel/vxd.c: Ivan Leo Puoti + Let DeviceIoControl call the appropriate native interface. + + * dlls/riched20/reader.c: Phil Krylov + Automatically set default font after parsing a font table in RichEdit + RTF reader. + + * dlls/mshtml/mshtml_private.h, dlls/mshtml/oleobj.c: + Jacek Caban + - Call LockContainer only if it's not already locked/unlocked. + - Only return S_OK in SetClientSite if IOleClientSite is not changed. + + * dlls/wldap32/Makefile.in, dlls/wldap32/rename.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_rename* functions. + + * dlls/comctl32/tab.c: Aric Stewart + Fix for dreamweaver site definition dialog. Need to initialize the + rect for a tab control to an empty rect if it is not visible. + + * dlls/atl/registrar.c: Kevin Koltzau + Fix 'cast to pointer from integer of different size' warnings in + 64bit. + + * dlls/gdi/path.c, dlls/user/sysparams.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/uxtheme/msstyles.c: Kevin Koltzau + Fix 'cast to pointer from integer of different size' warnings in + 64bit. + + * server/ptrace.c, server/thread.c, server/thread.h: + Don't try to detach from a thread that is exiting, to avoid triggering + a kernel race condition. + + * dlls/wined3d/basetexture.c, dlls/wined3d/device.c, + dlls/wined3d/stateblock.c, dlls/wined3d/wined3d_private.h: + Oliver Stieber + Fix quite a few texturing problems and cases where text isn't being + correctly displated. + + * dlls/riched20/editor.c, dlls/riched20/reader.c, dlls/riched20/rtf.h: + Phil Krylov + Added handling of deff RTF control word. + + * dlls/secur32/wrapper.c: Kai Blin + Fixed a couple of bugs in InitializeSecurityContext(A/W) and + AcceptSecurityContext. + + * dlls/mshtml/nsembed.c: Jacek Caban + Disable using nsWebBrowserStream. + + * configure, configure.ac, dlls/kernel/time.c, include/config.h.in: + Gerald Pfeifer + Prefer sys/limits.h over machine/limits.h. + + * dlls/quartz/memallocator.c, dlls/quartz/tests/.cvsignore, + dlls/quartz/tests/Makefile.in, dlls/quartz/tests/memallocator.c: + Christian Costa + Return S_OK when committing/decomitting an already + committed/decommitted allocator. + Add corresponding test case. + Improve traces. + + * dlls/ole32/stg_prop.c, dlls/shell32/regsvr.c, + dlls/shell32/shellole.c, dlls/shell32/shellreg.c, + dlls/user/sysparams.c, dlls/winmm/mmsystem.c: + Mike McCormack + Fix some gcc 4.0 warnings. + + * dlls/mshtml/Makefile.in, dlls/mshtml/oleobj.c, + dlls/mshtml/tests/htmldoc.c: + Jacek Caban + - Added OnAmbientPropertyChange implementation. + - Call IDispatch::Invoke when native does (with test). + + * dlls/msxml3/node.c: Mike McCormack + Implement IXMLDOMNode::hasChildNode(). + + * dlls/msxml3/domdoc.c: Mike McCormack + Forward IXMLDOMDocument methods to contained node. + + * programs/winefile/Cs.rc, programs/winefile/De.rc, + programs/winefile/En.rc, programs/winefile/Sv.rc: + Dmitry Timoshkov + Remove unnecessary #pragma code_page(xxxx) statements from winefile + .rc files. + + * dlls/msxml3/element.c: Mike McCormack + Forward IXMLDOMElement methods derived from IXMLDOMNode to the + element's contained node. + + * dlls/kernel/sync.c: Phil Krylov + Fixed InterLocked* function definitions for non-x86 platforms in + accordance with the recent corresponding change of their declarations + in winbase.h. + + * dlls/mshtml/persist.c: Jacek Caban + Use pibc argument of IPersistMoniker::Load. + + * dlls/oleaut32/tests/olefont.c: Walt Ogburn + Add tests for olefont size functions & conversions. + + * dlls/oleaut32/olefont.c: Walt Ogburn + When applying logical / himetric ratio to olefont sizes, must divide + by the standard ratio 72 / 2540. + + * dlls/x11drv/opengl.c: Saulius Krasuckas + Don't dereference a NULL visual pointer. + + * dlls/mshtml/nsembed.c: Jacek Caban + Always add gecko directory to the path before loading xpcom. + + * dlls/atl/registrar.c: Stefan Leichter + Print something useful in trace and fixme. + + * dlls/quartz/filtergraph.c, dlls/quartz/transform.c: + Christian Costa + Properly allocate/release memory when adding filters to the filtergraph. + When connecting pin, discard filter which is the same as the upstream + one. + Remove wrong extra IBaseFilter_Release. + Improve traces by showing filters owing pins we want to connect or + render. + Properly initialize output pin of transform filter. + + * dlls/ddraw/surface_dib.c: + Maxime Bellengé + Fix regression in color keying with RGB mask. + + * dlls/comctl32/datetime.c: + Michael Kaufmann + Handle WM_GETFONT and WM_SETFONT. + + * dlls/winmm/wineoss/mixer.c: Robert Reif + Fix mixer detection for multiple sound cards. + + * dlls/riched20/editor.c: Phil Krylov + Added common keyboard shortcuts for Select All, Undo, Redo, Cut, Copy + and Paste to RichEdit. + + * dlls/ole32/compobj.c: Mike McCormack + - return a precomputed result for a NULL string + - pass strlen an LPSTR to eliminate a sign warning + + * dlls/msvideo/msvfw32.spec, dlls/msvideo/msvideo_main.c, + dlls/msvideo/msvideo_private.h, include/vfw.h: + Kevin Koltzau + Fix 'cast from pointer to integer of different size' warnings in + 64bit. + + * dlls/advapi32/security.c: Kevin Koltzau + Remove 'cast from pointer to integer of different size' warnings in + 64bit, + + * dlls/gdi/tests/.cvsignore, dlls/gdi/tests/Makefile.in, + dlls/gdi/tests/palette.c: + Glenn Wurster + Start to add some tests for basic palette operations. + + * programs/regedit/about.c: + Felix Nawothnig + Replace "Registry Explorer" by "Registry Editor" in about dialog. + + * programs/winemenubuilder/winemenubuilder.c: + Maxime Bellengé + Make the icon choice algorithm really choose the best icon. + + * dlls/wldap32/Makefile.in, dlls/wldap32/modrdn.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_modrdn* functions. + + * include/rpcdce.h: Kai Blin + Added SEC_WINNT_AUTH_IDENTITY struct. + + * dlls/user/message.c, include/winuser.h: + Jacek Caban + Fix RegisterWindowMessage declaration and improve debug message. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/classes.c, + dlls/msi/files.c, dlls/msi/format.c, dlls/msi/helpers.c, + dlls/msi/install.c, dlls/msi/msipriv.h, dlls/msi/package.c: + Mike McCormack + - build a standard Wine list of components instead of using an array + - use component pointers instead of array indexes + + * dlls/shell32/tests/shlfolder.c: + Saulius Krasuckas + Make file operations succeed on Win9x too. + + * dlls/x11drv/window.c: Todd Mokros + Fix a focus stealing bug introduced by the managed flag changes. + + * dlls/wined3d/device.c: Oliver Stieber + Tidy up some formatting, improve error handling and error logging and + fix a couple of spelling mistakes. + +2005-08-19 Alexandre Julliard + + * dlls/kernel/atom.c: Marcus Meissner + Protect GlobalAddAtomA string handling by exception handler (for + broken programs). + + * programs/winecfg/drive.c, programs/winecfg/winecfg.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/msxml3/Makefile.in, dlls/msxml3/node.c, dlls/msxml3/nodelist.c: + Mike McCormack + Implement the IXMLDOMNodeList interface for + IXMLDOMNode::get_childNodes. + + * server/object.h, server/ptrace.c, server/signal.c: + Added a watchdog mechanism to break out of the wait4 call in case it + didn't return properly (can happen at thread exit). + + * dlls/shell32/regsvr.c, dlls/shell32/shell32_main.h, + dlls/shell32/shellole.c, dlls/shell32/shfldr_unixfs.c: + Michael Jung + Added stubbed implementation of IPersistPropertyBag interface. + Register unixfs as CLSID_FolderShortcut. + + * dlls/gdi/dib.c: Felix Nawothnig + Fix GetDIBits to retrieve RGB 555 as 16bit BI_RGB and RGB 565 as 16bit + BI_BITFIELDS. + + * dlls/user/scroll.c: Frank Richter + Fix wrong structure size check in GetScrollBarInfo(). + GetScrollBarInfo() failed when SCROLL_GetScrollBarRect() returned + FALSE - however, this is the case if the scrollbar is horizontal, and + not an error indicator. + + * dlls/comctl32/theme_combo.c, dlls/comctl32/theme_edit.c: + Frank Richter + Forward WM_DESTROY to superclass in edit & listbox theming. + + * dlls/comctl32/theming.c: Frank Richter + Merge subclass stubs and subclass proc. Having the stub set the window + proc to the subclass proc was not a good idea since that breaks + subclasses of themed standard controls (e.g. what Delphi does a lot). + + * tools/winebuild/build.h, tools/winebuild/import.c, + tools/winebuild/main.c, tools/winebuild/winebuild.man.in: + Added a --undefined option to allow forcing some symbols to be + resolved by the linker. + + * dlls/msxml3/domdoc.c: Mike McCormack + Forward some IXMLDOMDocument methods to the implemenation's contained + node. + + * dlls/msxml3/node.c: Mike McCormack + Implement parentNode, firstChild, lastChild, previousSibling and + nextSibling methods. + + * configure, configure.ac, dlls/Makefile.in, + programs/winecfg/properties.c, tools/winapi/win32.api: + Rémi Assailly + Removed mcianim. + + * programs/winedbg/memory.c: + Make sure the string is null-terminated in memory_get_string. + + * tools/winebuild/import.c: + Added some general purpose routines for managing list of symbol + names. + + * dlls/ntdll/ntdll.spec: + Removed a few internal functions that are no longer exported on + Windows. + + * programs/regedit/regproc.c, programs/taskmgr/dbgchnl.c, + programs/wcmd/builtins.c, programs/wcmd/wcmdmain.c, + programs/winedbg/debugger.h, programs/winedbg/display.c, + programs/winedbg/expr.c, programs/winedbg/gdbproxy.c, + programs/winedbg/info.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/comctl32/Makefile.in, dlls/comctl32/theme_dialog.c, + dlls/comctl32/theming.c: + Frank Richter + Add theming support for dialogs (to support tab page background). + + * dlls/wined3d/device.c, dlls/wined3d/drawprim.c, + dlls/wined3d/vertexshader.c, dlls/wined3d/wined3d_private.h: + Oliver Stieber + Integrate hardware vertex shaders into the drawing pipeline. + + * dlls/winspool/info.c: Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/msxml3/domdoc.c, dlls/msxml3/element.c, + dlls/msxml3/msxml_private.h, dlls/msxml3/node.c, + dlls/msxml3/nodemap.c: + Mike McCormack + Use a single function to create all IXMLDOMNode implementations. + + * dlls/msi/action.c, dlls/msi/action.h, dlls/msi/helpers.c: + Mike McCormack + Store the component information in a standard Wine list. + + * dlls/shell32/shlview.c, dlls/shell32/shv_bg_cmenu.c: + Jason Edmeades + Handle context menu->refresh, and F5 to initiate a refresh of the file + dialog. + + * dlls/msvcrt/string.c, dlls/msvcrt/tests/string.c: + Jason Edmeades + _swab failed if src == dest, plus some testcases. + + * dlls/shell32/pidl.c: Jason Edmeades + Add the time to the file display dialog modified column. + + * dlls/shell32/shfldr_unixfs.c: + Michael Jung + Implemented IPersist::GetClassID. + + * programs/winecfg/Ru.rc, programs/winecfg/winecfg.rc: + Yuri Kozlov + Updated Russian resources. + + * dlls/gdi/font.c: Huw Davies + Simplify ExtTextOut a bit. Should be a nop. + + * dlls/kernel/oldconfig.c: Gerald Pfeifer + Enable SCSI_getprocentry() on non-Linux platforms which now should be + safe to do. + + * dlls/gdi/freetype.c: Huw Davies + Cope better with mixed charset fonts. + + * dlls/atl/atl_main.c: Aric Stewart + In AtlModuleInit do not call initialization procedures that are NULL. + + * fonts/.cvsignore, fonts/Makefile.in, tools/sfnt2fnt.c: + Huw Davies + Add System font for the Chinese codepages cp936 and cp950. Of course + they don't contain any ideographs (and nor should they). + + * dlls/user/cursoricon.c: Mike McCormack + Make sure a cursor is always returned if one exists. + +2005-08-18 Alexandre Julliard + + * dlls/ntdll/nt.c, dlls/ntdll/ntdll.spec, dlls/ntdll/thread.c: + Added a stub for NtAlertResumeThread. + + * dlls/comctl32/Makefile.in, dlls/comctl32/theme_listbox.c, + dlls/comctl32/theming.c: + Frank Richter + Add theming for listbox (and combo listbox) controls. + + * dlls/d3d9/volume.c, dlls/d3d9/volumetexture.c: + Mike McCormack + Fix pointer type warnings. + + * dlls/d3d9/d3d9_private.h, dlls/d3d9/vertexshader.c: + Oliver Stieber + Pass all the d3d9 calls onto their wined3d equivalents. + + * dlls/crypt32/Makefile.in, dlls/shell32/Makefile.in: + Added missing ntdll imports. + + * dlls/kernel/sync.c, dlls/ntdll/file.c: + Ivan Leo Puoti + Implement FSCTL_PIPE_DISCONNECT in NtFsControlFile and make + DisconnectNamedPipe call it. + + * dlls/mciseq/mcimidi.c, dlls/winmm/mci.c, dlls/winmm/message16.c, + include/mmsystem.h: + Felix Nawothnig + Make string elements of MCI_OPEN_PARMS const to match the SDK headers. + + * fonts/.cvsignore, fonts/Makefile.in: Pavel Roskin + fontforge 20050729 insists on adding .ttf extension even if the + requested output file name ends with a dot. So let's go back to names + ending with ttf. + + * dlls/user/dialog.c, dlls/user/dialog16.c: + Mike McCormack + Fix uninitialized variable warnings emitted by gcc 4.0. + + * include/wincrypt.h: Juan Lang + Add/update a few definitions. + + * dlls/kernel/tests/codepage.c: + Saulius Krasuckas + Test passing NULL source to WideCharToMultiByte. + + * include/winbase.h: Felix Nawothnig + Make the destination pointers of Interlocked* functions volatile to + match the SDK headers. + + * dlls/mshtml/oleobj.c, dlls/mshtml/view.c, + dlls/mshtml/tests/htmldoc.c: + Jacek Caban + - Added IOleCommandTerget interface to the test. + - Make Wine pass the test. + - Fix bug reported by Saulius Krasuckas. + + * tools/sfnt2fnt.c: Pavel Roskin + sfnt2fnt exits with code 0 for several errors, which causes make to + ignore them. Use exit code 1 instead. + + * fonts/wine_system.sfd: Huw Davies + System should be sans serif. + + * dlls/ntdll/cdrom.c: Vitaliy Margolen + Add trace to IOCTL_CDROM_RAW_READ. + + * dlls/comctl32/theme_edit.c: Frank Richter + Only draw a themed border when edit control has WS_EX_CLIENTEDGE + style. + + * dlls/msxml3/domdoc.c, dlls/msxml3/element.c, + dlls/msxml3/msxml_private.h, dlls/msxml3/node.c, + dlls/msxml3/nodemap.c: + Mike McCormack + Make each IXMLDOMNode interface represent one libxml2 xmlNodePtr. + + * dlls/shell32/tests/shlexec.c: + Francois Gouget + Test "%l" and "%L". At the same time this tests alternate verbs. + Test %1, %l and %L with no quotes. + test->todo is a bitmask so fix the checks accordingly. + +2005-08-17 Alexandre Julliard + + * dlls/Makefile.in, dlls/iccvid/.cvsignore, dlls/iccvid/Makefile.in, + dlls/msrle32/.cvsignore, dlls/msrle32/Makefile.in, + dlls/msvidc32/.cvsignore, dlls/msvidc32/Makefile.in, + dlls/twain/.cvsignore, dlls/twain/Makefile.in: + Removed a few more unnecessary import libraries. + + * dlls/iccvid/iccvid.spec, dlls/midimap/midimap.spec, + dlls/msacm/imaadp32/imaadp32.acm.spec, dlls/msacm/msacm32.spec, + dlls/msacm/msadp32/msadp32.acm.spec, + dlls/msacm/msg711/msg711.acm.spec, + dlls/msacm/winemp3/winemp3.acm.spec, dlls/msrle32/msrle32.spec, + dlls/msvidc32/msvidc32.spec, dlls/winmm/joystick/joystick.drv.spec, + dlls/winmm/mciavi/mciavi.drv.spec, + dlls/winmm/mciwave/mciwave.drv.spec, + dlls/winmm/wavemap/msacm.drv.spec, + dlls/winmm/winealsa/winealsa.drv.spec, + dlls/winmm/winearts/winearts.drv.spec, + dlls/winmm/wineaudioio/wineaudioio.drv.spec, + dlls/winmm/wineesd/wineesd.drv.spec, + dlls/winmm/winejack/winejack.drv.spec, + dlls/winmm/winenas/winenas.drv.spec, + dlls/winmm/wineoss/wineoss.drv.spec: + Make all the DriverProc entry points private. + + * configure, configure.ac, dlls/Makefile.in, dlls/mciseq/.cvsignore, + dlls/mciseq/Makefile.in, dlls/mciseq/mcimidi.c, + dlls/mciseq/mciseq.spec, tools/winapi/win32.api, tools/wine.inf: + Rémi Assailly + Moved mciseq to the top-level dlls directory. + + * programs/winecfg/appdefaults.c, programs/winecfg/properties.c, + programs/winecfg/properties.h, programs/winecfg/winecfg.c, + programs/winecfg/winecfg.h: + Vitaliy Margolen + Add windows version registry entries. + + * dlls/avifil32/avifile.c, dlls/avifil32/editstream.c: + Mike McCormack + gcc 4.0 warning fixes. + + * dlls/wined3d/device.c, dlls/wined3d/vertexshader.c, + dlls/wined3d/wined3d_private.h, include/wine/wined3d_interface.h: + Oliver Stieber + Copy the parser and cross compiler from d3d8 and update everything to + vertex shaders 3.0. + The Parser will now display the input shader in DirectX style, and the + cross compiler now generates valid ARB_VERTEX_PROGRAM programs and + outputs the result in ARB_VERTEX_PROGRAM style. + Support for a number of extended attributes has been added, but this + may not be complete, and dereferencing from loop counters isn't + properly parsed yet. + + * dlls/kernel/atom16.c, dlls/kernel/format_msg.c, + dlls/kernel/lzexpand.c, dlls/kernel/ne_segment.c, + dlls/kernel/relay16.c, dlls/kernel/resource16.c, + dlls/kernel/snoop16.c, dlls/kernel/sync.c, dlls/kernel/volume.c: + Mike McCormack + gcc 4.0 warning fixes. + + * dlls/wined3d/device.c, dlls/wined3d/stateblock.c, + dlls/wined3d/wined3d_private.h: + Oliver Stieber + Add support for vertex shader constants to the stateblock. + + * dlls/kernel/tests/process.c, dlls/msxml3/domdoc.c, + dlls/secur32/tests/main.c, dlls/wined3d/drawprim.c: + Francois Gouget + Assorted spelling fixes. + + * dlls/wined3d/vertexshader.c, dlls/wined3d/wined3d_private.h, + include/wine/wined3d_types.h: + Oliver Stieber + Tidy up vertex shaders and bring the current code inline with the rest + of wined3d. + + * dlls/wininet/tests/http.c: + Saulius Krasuckas + Correct failing test and transform it into a bunch of another tests. + + * dlls/ntdll/tests/info.c: Francois Gouget + Fix a couple of MSVC signed/unsigned warnings. + + * dlls/shell32/shlexec.c, dlls/shell32/tests/shlexec.c: + Francois Gouget + Fix ShellExecute("\"foo.doc\"") for Internet Explorer 6. + Update the conformance tests accordingly. + Tweak a trace because it's very confusing to see the path with no + escaped quotes in ShellExecuteA() and then with escaped quotes in + ShellExecuteExW32() (due to debugstr_w()). + + * dlls/msxml3/node.c: Mike McCormack + Fix a search and replace mishap. + + * dlls/ddraw/surface_dib.c, dlls/ddraw/tests/dsurface.c: + Christian Costa + Take RGB mask into account when doing color keying. + Add corresponding conformance test. + + * dlls/secur32/Makefile.in, dlls/secur32/ntlm.c, + dlls/secur32/secur32.c, dlls/secur32/secur32_priv.h: + Kai Blin + Add NTLM security provider dummy. + + * dlls/quartz/filtergraph.c: Christian Costa + Add stubbed IGraphConfig interface to the filtergraph. + + * dlls/quartz/videorenderer.c: Christian Costa + Fix rendering of paletted video stream. + +2005-08-16 Alexandre Julliard + + * server/queue.c: + Avoid a crash in find_hardware_message_window when there's no + foreground input. + + * dlls/comctl32/Makefile.in, dlls/comctl32/theme_combo.c, + dlls/comctl32/theming.c: + Frank Richter + Add theming for combo boxes. + + * include/wincrypt.h: Juan Lang + Add more missing definitions, and correct a prototype. + + * dlls/shell32/tests/shlfolder.c: + Francois Gouget + Dynamically load StrRetToBufW(). This lets shell32_test.exe run on + systems that have version 4.72 of shlwapi.dll. + + * dlls/shell32/tests/shlexec.c: + Francois Gouget + Verify the parameters received by the child process using code lifted + from kernel32/tests/process.c. + Test passing parameters to .lnk files that point to an executable. + + * dlls/ntdll/version.c: + There is a registry key for the service pack version (spotted by + Vitaliy Margolen). + + * dlls/x11drv/event.c, dlls/x11drv/keyboard.c, dlls/x11drv/mouse.c, + dlls/x11drv/opengl.c, dlls/x11drv/xrender.c: + Mike McCormack + gcc 4.0 warning fixes. + + * dlls/secur32/secur32.c, include/lmaccess.h, include/ntsecapi.h, + include/winternl.h: + Francois Gouget + Declare PNTSTATUS in lmaccess.h and ntsecapi.h to match the PSDK. + Protect against multiple definitions. + Use PNTSTATUS where appropriate. + + * dlls/ole32/ole2.c, dlls/ole32/ole2_16.c, dlls/ole32/storage.c, + tools/winapi/win16.api: + Francois Gouget + Use LPSTORAGE to better match the PSDK. + Document the real SEGPTR type using the standard documentation + mechanisms. Fixes winapi_check warnings. + + * dlls/kernel/heap.c: Dmitry Timoshkov + Report swap file total/free sizes to be the same as physical memory. + Make sure that we cache all calculated values. + + * dlls/shell32/tests/shellpath.c: + Michael Jung + Remove "initguid.h" include from shellpath test. + + * dlls/mshtml/tests/protocol.c: Jacek Caban + Fix protocol test on 9x. + + * dlls/ntdll/file.c: Ivan Leo Puoti + Improve NtCreateNamedPipe trace. + + * dlls/msi/action.c: Aric Stewart + Fixed a memory overflow and leak identified by Mike McCormack. + + * dlls/user/combo.c: Frank Richter + Change CB_GETCOMBOBOX to return STATE_SYSTEM_PRESSED in + COMBOBOXINFO.stateButton when really the button is pressed, not when + the combo is dropped down. + + * dlls/wininet/tests/http.c: + Saulius Krasuckas + Move repetitive code to two helper functions. + + * dlls/ntdll/version.c: + Fetch the version information from the standard Windows keys if not + specified otherwise. + + * programs/regedit/De.rc, programs/regedit/En.rc: + Juan Lang + Shrink the hex edit window a bit. + + * dlls/crypt32/tests/encode.c: Juan Lang + Remove a test that fails under WinME. Reported and helpfully debugged + by Saulius Krasuckas. + + * dlls/secur32/secur32.c: Juan Lang + Fix uninitialized pointer in builtin providers. Reported by Kai + Blin. + + * dlls/ntdll/file.c: Ivan Leo Puoti + NtCreateNamedPipeFile is no longer a stub, so fix TRACE() call. + + * dlls/mshtml/olewnd.c: Jacek Caban + Deactivate UI in InPlaceDeactivate. + +2005-08-15 Alexandre Julliard + + * include/objidl.idl, include/ocidl.idl, include/oleidl.idl, + include/windef.h: + Added a WINE_NO_UNICODE_MACROS define to allow Winelib apps to switch + off the Unicode macros too. + + * dlls/secur32/Makefile.in, dlls/secur32/negotiate.c, + dlls/secur32/secur32.c, dlls/secur32/secur32_priv.h, + dlls/secur32/tests/main.c: + Kai Blin + Added Negotiate security provider dummy. Removed todos from the test. + + * dlls/wldap32/misc.c: Hans Leidekker + Fix the build without openldap headers. + + * dlls/mshtml/tests/htmldoc.c: Jacek Caban + - Code cleanup. + - Dissable tests after UIActivate failes (fixes tests win 9x). + + * include/shlguid.h: Michael Jung + Added CLSID_FolderShortcut definition. + + * dlls/msi/action.c: Aric Stewart + Add some body to ResolveSource because it is possible to need it when + an install is begun but the media is not in the drive, such as in + install-on-demand cases. + + * dlls/ntdll/heap.c: + Fixed some confusion over whether HEAP_MIN_BLOCK_SIZE includes the + arena headers of not. + Free list sizes are constant so there's no need to store them in the + heap structure. + + * dlls/kernel/process.c, tools/wineprefixcreate.in: + Set the default system dir to windows/system32. + + * dlls/ntdll/version.c: Switch the default version to win2k. + + * dlls/gdi/freetype.c: Huw Davies + A previous signed-ness fix broke display of non-ansi chars, fix this. + + * dlls/shell32/pidl.c: Ge van Geldorp + Fix resource leak on error paths. + + * dlls/ntdll/virtual.c, server/mapping.c: + Better handling of conflicting section information between + SizeOfRawData and VirtualSize. + + * dlls/wldap32/misc.c, dlls/wldap32/winldap_private.h, + dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_result. + + * dlls/x11drv/xrender.c: Frank Richter + Fix AlphaBlend() to extract the right part of the source DIB. + + * dlls/kernel/registry16.c, dlls/ole32/compobj.c, + dlls/ole32/storage32.c, dlls/shell32/shell.c: + Mike McCormack + Warning fixes for gcc 4.0. + + * dlls/avifil32/factory.c, dlls/commdlg/cdlg32.c, + dlls/dplayx/dplayx_main.c, dlls/dsound/dsound_main.c, + dlls/hhctrl.ocx/main.c, dlls/mapi32/mapi32_main.c, + dlls/mscms/mscms_main.c, dlls/msisys/msisys.c, + dlls/oleaut32/oleaut.c, dlls/snmpapi/main.c, dlls/wineps/init.c, + dlls/wldap32/main.c: + Vincent Béron + Uniformize DllMain TRACEing across dlls. + + * dlls/advpack/tests/advpack.c: + Saulius Krasuckas + Remove trailing backslash. + + * dlls/x11drv/codepage.c, dlls/x11drv/dib.c: + Mike McCormack + gcc 4.0 warning fixes. + + * dlls/comctl32/Makefile.in, dlls/comctl32/theme_edit.c, + dlls/comctl32/theming.c: + Frank Richter + Subclass edit control to draw themed border. + + * dlls/comctl32/trackbar.c: Frank Richter + Improved trackbar theming. + + * dlls/uxtheme/system.c: Frank Richter + Compare result of RegQueryValueExW() with ERROR_SUCCESS. + + * dlls/mshtml/protocol.c: Jacek Caban + - Added support for aggregation to res protocol. + - Fix AboutProtocol_Release. + - Use *_THIS macros in protocol objects. + + * dlls/wldap32/add.c: Hans Leidekker + Improve parameter handling for the ldap_add* functions. + + * dlls/shell32/tests/shellpath.c: + Saulius Krasuckas + Fix some SHGetSpecialFolderPathA exceptions on WinME: + - pass pointer to valid buffer as lpszPath. + - disable check passing NULL as lpszPath. + + * dlls/hhctrl.ocx/help.c: James Hawkins + Handle resizing the help viewer window. + + * dlls/uxtheme/draw.c: Frank Richter + Whatever TrueSizeStretchMark is for - it's not what Wine uxtheme used + it for. Native uxtheme always stretches "truesize" parts when the + destination is smaller than the part image size, but + TrueSizeStretchMark doesn't seem to have an influence. + + * dlls/riched20/context.c, dlls/riched20/editor.c, + dlls/riched20/editstr.h, dlls/riched20/paint.c, include/richedit.h: + Phil Krylov + Added EM_SETRECT, EM_SETRECTNP, and WM_SETREDRAW message handling. + Added support for GT_SELECTION flag in EM_GETTEXTEX handler. + + * dlls/ole32/compobj.c, dlls/ole32/compobj.spec, dlls/ole32/ole2.spec, + dlls/ole32/ole2_16.c: + Marcus Meissner + Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. + + * dlls/gdi/font.c, dlls/gdi/gdi32.spec: Vikram Kumar + Added stub for EnableEUDC. + + * include/commctrl.h: Frank Richter + Add WC_EDIT and WC_LISTBOX. + + * dlls/advapi32/crypt.c, dlls/tapi32/phone.c, dlls/user/dde_client.c: + Vincent Béron + Change some TRACEing formats to make more sense. + + * dlls/msxml3/msxml_private.h: + Vincent Béron + Protect libxml/parser.h with proper autoconf definition. + + * dlls/shlwapi/ordinal.c: Vincent Béron + Correct typo in format string. + + * dlls/setupapi/parser.c: Ge van Geldorp + index is 1-based at this point, index == line->nb_fields is the last + field and is valid. + + * dlls/winaspi/aspi.c: Gerald Pfeifer + set_last_error() is only used on Linux. + + * dlls/wldap32/Makefile.in, dlls/wldap32/modify.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_modify* functions. + + * dlls/kernel/instr.c: Vitaliy Margolen + Add entry for int 2 handler. + + * dlls/shell32/shfldr_desktop.c: + Michael Jung + Ge van Geldorp + - Prepend Desktop folder path for files/directories stored in the + filesystem Desktop folder when GetDisplayNameOf is called with the + SHGDN_FORPARSING flags. + - Add testcases. + + * dlls/mshtml/mshtml_private.h, dlls/mshtml/tests/htmldoc.c, + dlls/mshtml/view.c: + Jacek Caban + Activate window in IOleDocumwnrView::Show. + + * dlls/mshtml/tests/protocol.c: Jacek Caban + Fix protocol test on winxp. + + * dlls/shell32/tests/shlfolder.c: + Saulius Krasuckas + XP returns E_INVALIDARG on failure. + + * dlls/hhctrl.ocx/help.c: James Hawkins + - Paint spacing around the tab control. + - Use COLOR_MENU to standardize the colors of the viewer. + + * dlls/msvcrtd/Makefile.in: Mike McCormack + Fix gcc 4.0 builtin function warnings. + + * programs/winecfg/Ja.rc, programs/winecfg/winecfg.rc: + Vikram Kumar + Added Japanese resources. + + * dlls/uxtheme/draw.c: Frank Richter + Better computations to have uniformly sized parts scaled in both + directions. + + * dlls/comctl32/progress.c: Frank Richter + Instead of adding the border via WM_NCPAINT and WM_NCCALCSIZE, do what + native does: just clear WS_EX_STATICEDGE when themed and reduce the + area the actual bar is painted in to the progress bar theme part + content rect. + + * dlls/x11drv/winpos.c: Frank Richter + Invalidate DCEs when a window region is set. + +2005-08-12 Alexandre Julliard + + * dlls/ntdll/heap.c: + Converted the process heap list to a standard list. + + * dlls/setupapi/misc.c, dlls/setupapi/setupapi.spec: + Added stubs for pSetupGet/SetGlobalFlags. + + * dlls/kernel/tests/thread.c, dlls/ntdll/cdrom.c, + dlls/wined3d/device.c, dlls/wined3d/directx.c, + dlls/wined3d/drawprim.c, dlls/wined3d/vertexdeclaration.c, + dlls/wininet/tests/wininet_test.h, tools/winapi/winapi.pm: + Francois Gouget + Assorted spelling fixes. + + * dlls/ntdll/heap.c: Converted the heap free lists to standard lists. + + * dlls/ntdll/loader.c: Removed a redundant and possibly wrong warning. + + * dlls/kernel/kernel32.spec, dlls/kernel/module.c, + tools/winebuild/import.c: + Implemented DelayLoadFailureHook and use it in the winebuild-generated + delay load code. + + * dlls/comctl32/theming.c: Frank Richter + Determining the superclass for a window subclassed for theming doesn't + work - e.g. Delphi buttons have the classname "TButton" for which no + superclass will be found. Instead, use initial subclass window procs + that have the subclass hardcoded and store it for the "real" subclass + window proc. + + * include/mshtmhst.idl: Jacek Caban + Fix Show*HTMLDialog declarations. + + * programs/winecfg/En.rc: Richard Cohen + Update English neutral version of winecfg graphics tab, and make the + groupboxes not overlap. + + * dlls/wldap32/option.c, dlls/wldap32/wldap32.h: + Hans Leidekker + Implement LDAP_OPT_API_FEATURE_INFO and LDAP_OPT_API_INFO. + + * dlls/mshtml/oleobj.c: Jacek Caban + - Added IOleObject::Close implementation. + - OLEIVERB_INPLACEACTIVATE is the same as OLEIVERB_UIACTIVATE. + + * dlls/shlwapi/ordinal.c, dlls/shlwapi/shlwapi.spec: + Huw Davies + Implement SHLoadRegUIStringW. + + * dlls/shlwapi/tests/shreg.c: Richard Cohen + Blame ExpandEnvironmentStringsA for the failing NT4 test. + + * dlls/uxtheme/msstyles.c, dlls/uxtheme/msstyles.h, + dlls/uxtheme/system.c: + Frank Richter + Enhance uxtheme to store the themed system metrics in the registry and + also backup the old metrics. That way, themed system colors are set + even uxtheme was not loaded and initialized yet, and when a theme is + deactivated, the colors prior to the activation are restored as well. + Also, not having to set the system colors in uxtheme startup works + around weird problems where SetSystemColors() ended up being called + from inside window creation and this seemingly led to some creation + message being sent twice. + + * dlls/kernel/module.c: + Add the 16-bit system directory if any to the module search path. + + * configure, configure.ac, dlls/msxml3/Makefile.in, + dlls/msxml3/tests/.cvsignore, dlls/msxml3/tests/Makefile.in, + dlls/msxml3/tests/domdoc.c: + Mike McCormack + Add some msxml3 tests. + + * dlls/ntdll/virtual.c: + Don't map data beyond the virtual size of a section. + + * dlls/msxml3/main.c, tools/wine.inf: + Mike McCormack + Partial implementation of DllRegisterServer. + + * dlls/winmm/winealsa/audio.c: + Alex Villacís Lasso + Remove crackling in DirectSound/ALSA playback with full hardware + acceleration. + + * dlls/comctl32/trackbar.c: Frank Richter + Add initial theming support for trackbars. + + * dlls/comctl32/toolbar.c: Frank Richter + Add theming for toolbar control. + + * dlls/x11drv/clipboard.c, dlls/x11drv/xdnd.c, dlls/x11drv/xfont.c, + dlls/x11drv/xrandr.c, dlls/x11drv/xrender.c: + Mike McCormack + Fix some gcc 4.0 warnings. + + * configure, configure.ac, dlls/msxml3/domdoc.c, include/config.h.in: + Mike McCormack + Add a configure test for xmlReadMemory. + + * dlls/msvcrtd/tests/Makefile.in, dlls/msvcrtd/tests/debug.c: + Saulius Krasuckas + Don't import MSVCRTD.DLL and don't fail when it could not be loaded. + + * dlls/shell32/tests/shlfolder.c: Saulius Krasuckas + Win98 returns HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) on failure. + + * dlls/mshtml/main.c, dlls/mshtml/mshtml.spec: + Jacek Caban + Added RNIGetCompatibleVersion implementation. + + * dlls/commdlg/filedlg.c: Michael Jung + Check the GetPidlFromDataObject's doSelected parameter before calling + a method on it. + + * dlls/shell32/shfldr_unixfs.c: + Michael Jung + Use wine_get_dos_file_name instead of GetFullPathName. + +2005-08-11 Alexandre Julliard + + * dlls/mshtml/mshtml_private.h, dlls/mshtml/nsembed.c, + dlls/mshtml/nsiface.idl, dlls/mshtml/persist.c: + Jacek Caban + Use nsIWebBrowserStream to load html. + + * dlls/kernel/task.c: + Make 16-bit task properly inherit the current directory of their + parent (based on a patch by Richard Cohen). + + * dlls/shlwapi/shlwapi.spec, dlls/shlwapi/string.c: + Huw Davies + Implement SHLoadIndirectString. + + * dlls/comctl32/tab.c: Frank Richter + Fix text color for "button" style tabs when theming is enabled. + + * dlls/comctl32/status.c: Frank Richter + Add theming for status bar control. + + * dlls/comctl32/progress.c: Frank Richter + Add theming for the progress control. + + * Make.rules.in, configure, configure.ac, dlls/crtdll/Makefile.in, + dlls/msvcrt/tests/Makefile.in, dlls/msvcrtd/tests/Makefile.in, + programs/notepad/Makefile.in, programs/regedit/Makefile.in, + programs/taskmgr/Makefile.in: + Mike McCormack + Turn off gcc 4.0's builtin wchar inlines. + + * dlls/secur32/tests/main.c, include/winerror.h: + Kai Blin + Added more secur32.dll tests and fixed missing constants in + winerror.h. + + * dlls/wldap32/Makefile.in, dlls/wldap32/delete.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_delete* functions. + Add missing spec file entries. + + * include/commctrl.h: Frank Richter + Add WC_COMBOBOX. + + * dlls/kernel/oldconfig.c: Frank Richter + Fix a crash on startup when /proc/ide does not exist. + + * dlls/comctl32/rebar.c: Frank Richter + Add theming for the rebar control. + + * dlls/comctl32/monthcal.c: Frank Richter + Add theming for the monthcal control. + + * dlls/mshtml/protocol.c: Jacek Caban + Added support for aggregation in about protocol. + + * dlls/shell32/shlexec.c: Francois Gouget + Fix the return value of SHELL_Argify() so it once again returns true + if a '%1' or equivalent placeholder was found. This fixes + ShellExecuteEx(lpFile="foo.txt", lpClass="txtfile"). + + * dlls/ntdll/tests/atom.c: Francois Gouget + Define WIN32_NO_STATUS so we don't get 'duplicate macro' errors when + compiling with the PSDK and MSVC. + Add some types that are not defined by the PSDK. + + * dlls/kernel/kernel32.spec, dlls/kernel/path.c, include/winbase.h: + Added a wine_get_dos_file_name function in kernel32 as a wrapper + around the new wine_unix_to_nt_file_name. + + * programs/msiexec/msiexec.c, programs/msiexec/msiexec.h: + Removed a useless header file. + + * dlls/lzexpand/lzexpand.spec, dlls/lzexpand/lzexpand16.c: + Vincent Béron + Implement LZDone in lzexpand, as the 32 bit one moved to kernel. + + * dlls/msxml3/domdoc.c: Mike McCormack + Increment the document's refcount when creating the root element. + + * dlls/msxml3/element.c: Mike McCormack + Implement IXMLDOMElement::get_tagName. + + * dlls/ddraw/device_opengl.c, dlls/wined3d/directx.c: + Mike McCormack + Fix gcc 4.0 warnings. + + * dlls/wined3d/device.c: Oliver Stieber + Allow the palette to be set and retrieved. + + * dlls/ntdll/directory.c, dlls/ntdll/ntdll.spec, + dlls/ntdll/ntdll_misc.h, dlls/ntdll/path.c, include/winternl.h: + Added a wine_unix_to_nt_file_name function to do proper pathname + conversions instead of relying on GetFullPathName hacks. + + * dlls/user/message.c: + Set remove to TRUE in accept_hardware_message for messages that should + go to a different thread. Simplify the code a bit. + + * include/winldap.h: Dmitry Timoshkov + Add some missing LDAP definitions. + + * tools/winedump/lnk.c: Steven Edwards + Correct size check. + + * dlls/shell32/shfldr_desktop.c, dlls/shell32/tests/shlfolder.c, + include/shobjidl.idl: + Steven Edwards + Correct definition of SFGAO_STORAGEANCESTOR. + + * dlls/msxml3/domdoc.c: Mike McCormack + Implement IXMLDOMDocument::loadXML. + + * dlls/sensapi/sensapi.c: Steven Edwards + Remove redundant include. + + * tools/winapi/winapi_local.pm: + Vincent Béron + Correct a typo in winapi_local.pm. + + * tools/winapi/win32.api: Vincent Béron + Another update to win*.api. + + * dlls/wined3d/device.c, dlls/wined3d/stateblock.c, + dlls/wined3d/wined3d_private.h: + Oliver Stieber + Track the state of softwareVertexProcessing. + + * dlls/wined3d/basetexture.c: + Oliver Stieber + Correct the starting values of MIN, MAX and MIP filter, they now match + the initial values in opengl. + + * dlls/riched20/writer.c: Phil Krylov + Fixed a bug in EM_STREAMOUT RichEdit message handler which truncated + some streamed text. + + * dlls/mshtml/htmldoc.c, dlls/mshtml/main.c, + dlls/mshtml/mshtml_private.h, dlls/mshtml/nsembed.c, + dlls/mshtml/oleobj.c, dlls/mshtml/olewnd.c, dlls/mshtml/persist.c, + dlls/mshtml/protocol.c, dlls/mshtml/service.c, dlls/mshtml/view.c: + Jacek Caban + Move includes of interfaces to mshtml_private.h. + + * dlls/shell32/shlexec.c: Francois Gouget + Fix handling of SEE_MASK_CLASSNAME and SEE_MASK_CLASSKEY. They are not + disjoint flags. + + * dlls/ntdll/tests/reg.c: Francois Gouget + Remove unneeded wine/library.h include. + Use lstrlenW() instead of the Wine-specific strlenW(). This also lets + us get rid of the wine/unicode.h include. + Define the InitializeObjectAttributes() macro if not using Wine's + winternl.h header. + +2005-08-10 Alexandre Julliard + + * dlls/kernel/version.c: + Directly use the PEB version fields in GetVersion. + + * dlls/shlwapi/ordinal.c, dlls/shlwapi/shlwapi.spec: + Huw Davies + Partial implementation of DeleteMenuWrap. + + * dlls/user/tests/dce.c: Francois Gouget + Define DCX_USESTYLE if it is not defined already. Fixes the + compilation with the PSDK. + + * dlls/ntdll/tests/rtl.c: Francois Gouget + Define RTL_HANDLE and RTL_HANDLE_TABLE if not using Wine's winternl.h + header. Fixes the compilation with the PSDK. + + * include/winldap.h: Hans Leidekker + Synchronize winldap.h with winldap_private.h. + + * dlls/ntdll/rtl.c, dlls/ntdll/version.c: + Implemented RtlGetNtProductType. + + * dlls/dmband/dmband_main.c, dlls/dmloader/dmloader_main.c, + dlls/dmscript/dmscript_main.c, dlls/dmsynth/dmsynth_main.c, + dlls/dmusic/dmusic_main.c, dlls/dswave/dswave_main.c: + Francois Gouget + Correct more mismatches between spec files and comments about export + number. + + * dlls/kernel/tests/comm.c: Francois Gouget + Add trailing '\n's to trace() call. + + * dlls/comctl32/tests/treeview.c: Francois Gouget + The PSDK does not define a TreeView_InsertItemA() macro so use + TreeView_InsertItem() instead. + + * dlls/winmm/wineesd/audio.c: Francois Gouget + Unicodify wineesd. + Fixes WIDM_GETDEVCAPS and WODM_GETDEVCAPS. + Call Unicode functions instead of their Ansi equivalent when possible. + + * dlls/wldap32/Makefile.in, dlls/wldap32/add.c, + dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_add* functions. + + * dlls/kernel/process.c, dlls/ntdll/loader.c, dlls/ntdll/ntdll.spec, + dlls/ntdll/ntdll_misc.h, dlls/ntdll/version.c: + Moved the version initialization to ntdll. + Properly set the version fields in the PEB. + Removed some no longer used structures. + + * tools/winebuild/res32.c: + Byteswap the resources if we detect that the header is in the wrong + endianness. + + * dlls/dplayx/dpclassfactory.c, dlls/dplayx/dplayx.spec, + dlls/dplayx/dplayx_main.c, dlls/dpnhpast/dpnhpast.spec, + dlls/dpnhpast/main.c, dlls/msi/msi.c, dlls/msi/msi.spec, + dlls/msi/regsvr.c, dlls/oleaut32/oleaut.c, + dlls/oleaut32/oleaut32.spec, dlls/oleaut32/regsvr.c: + Francois Gouget + Change some Dll* functions so they are exported by name like on + Windows. + Update the documentation accordingly. + + * dlls/wldap32/wldap32.rc, dlls/wldap32/wldap32_Fr.rc: + Jonathan Ernst + French localization for wldap32. + + * dlls/kernel/lzexpand.c: Francois Gouget + Update the documentation to reflect the fact that the LZ* functions + are implemented in kernel32.dll now. + + * dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.h: + Hans Leidekker + Add helpers for converting (arrays of) LDAPMod structures into + different encodings. + + * dlls/shlwapi/ordinal.c, dlls/shlwapi/shlwapi.spec: + Huw Davies + Implement IUnknown_EnumObjects. + + * dlls/kernel/profile.c, dlls/kernel/tests/profile.c: + Richard Cohen + - Fix regression in GetPrivateProfileString16 for key=NULL. + - Check return values in Profile tests. + + * dlls/gdi/metafile.c, dlls/kernel/kernel_main.c, + dlls/kernel/local16.c, dlls/kernel/resource16.c, dlls/kernel/task.c, + dlls/ole32/ole16.c, dlls/ole32/storage.c, dlls/user/edit.c, + dlls/user/user16.c, dlls/winmm/mmsystem.c, dlls/wow32/wow_main.c, + include/wine/winbase16.h, include/wownt32.h: + Use the proper WOW functions everywhere instead of the K32WOW variant. + + * dlls/winaspi/Makefile.in, dlls/winaspi/aspi.c, + dlls/winaspi/winescsi.h: + Vitaliy Margolen + Make use of now full and correct HKLM\HARDWARE\DEVICES\Scsi. + + * dlls/kernel/oldconfig.c: Vitaliy Margolen + Use /proc filesystem to create HKLM\HARDWARE\DEVICEMAP\Scsi entries. + + * programs/winelauncher.in: Marcus Meissner + Fixed harmless /tmp problem. + + * dlls/user/driver.c, dlls/user/user_main.c, dlls/user/user_private.h: + Make sure we don't call the graphics driver after process detach. + + * dlls/msxml3/Makefile.in, dlls/msxml3/domdoc.c, dlls/msxml3/element.c, + dlls/msxml3/msxml_private.h, dlls/msxml3/node.c, + dlls/msxml3/nodemap.c: + Mike McCormack + Create a node object and use it to hold libxml2 pointers. + + * dlls/mshtml/mshtml_private.h, dlls/mshtml/nsembed.c, + dlls/mshtml/persist.c, dlls/mshtml/view.c: + Jacek Caban + Init nsWebBrowser window while creating nscontainer. + + * dlls/atl/registrar.c, dlls/dmband/dmband_main.c, + dlls/dmloader/dmloader_main.c, dlls/dmscript/dmscript_main.c, + dlls/dmsynth/dmsynth_main.c, dlls/dmusic/dmusic_main.c, + dlls/dswave/dswave_main.c, dlls/mlang/mlang.c, dlls/mshtml/main.c, + dlls/msi/msi.c, dlls/msxml3/factory.c, dlls/ole32/ole2.c, + dlls/ole32/ole2.spec, dlls/ole32/storage.c: + Vincent Béron + Correct mismatches between spec files and comments about export + number. + + * dlls/usp10/usp10.c, include/msacmdrv.h, include/msi.h, + include/msxml.idl, include/msxml2.idl, include/odbcinst.h, + include/strmif.idl, include/xmldom.idl: + Vincent Béron + Use #include "foo.h" for including Windows headers in dlls/, use + #include for including Windows headers in include/. + + * dlls/commdlg/filedlg.c: Troy Rollo + Browse to the directory if a directory name is typed into the edit box + of a file dialog and the confirmation button (or Enter key) is hit. + Return any file name in the edit box if OFN_NOVALIDATE is set and + OFN_FILEMUSTEXIST is not, even if that file name includes a path name + or is the name of a folder. + + * dlls/wldap32/bind.c, dlls/wldap32/init.c, dlls/wldap32/search.c: + Vincent Béron + Use HAVE_LDAP_H when checking if ldap.h is available. + + * dlls/opengl32/wgl.c, dlls/opengl32/wgl_ext.c: + Mike McCormack + gcc 4.0 warning fixes. + + * tools/winapi/win16.api, tools/winapi/win32.api: + Vincent Béron + Another update to the win*.api files. + + * tools/winapi/winapi_check: + Vincent Béron + Since windows/ is gone, headers for user are only in + dlls/user/. Remove kludge from winapi_check. + + * dlls/mapi32/prop.c, dlls/ole32/ole16.c: + Vincent Béron + Remove local declarations already in included public headers. + + * include/wine/winbase16.h: Mike McCormack + Fix gcc 4.0 warnings. + +2005-08-09 Alexandre Julliard + + * dlls/shell32/debughlp.c: Use ERR instead of DPRINTF in dump_pidl_hex. + + * tools/winegcc/utils.c, tools/winegcc/utils.h, + tools/winegcc/winegcc.c: + Ignore prelink failures. + + * dlls/mshtml/Makefile.in, dlls/mshtml/mshtml_private.h, + dlls/mshtml/persist.c: + Jacek Caban + - Beginning implementation of true IPersistMoniker::Load. + - THIS macros cleanup. + + * dlls/ntdll/loader.c: + Don't call process attach notification during process shutdown. + Make sure we don't insert a module in the same list twice. + + * dlls/mshtml/protocol.c, dlls/mshtml/tests/protocol.c: + Jacek Caban + Report BINDSTATUS_MIMETYPEAVAILABLE in AboutProtocol::Start. + + * dlls/wldap32/Makefile.in, dlls/wldap32/option.c, + dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_{get,set}_option{A,W}. + + * dlls/shlwapi/shlwapi.spec, dlls/shlwapi/thread.c: + Huw Davies + _CreateAllAccessSecurityAttributes takes three parameters. + + * dlls/Makedll.rules.in, dlls/kernel/Makefile.in, + dlls/ntdll/Makefile.in: + Specify a base address for kernel and ntdll. + + * dlls/msxml3/main.c, dlls/msxml3/msxml_private.h: + Mike McCormack + Initialize and clean up libxml2 in DllMain. + + * Make.rules.in, configure, configure.ac, tools/winegcc/Makefile.in, + tools/winegcc/winegcc.c: + Added support for the --image-base linker option in winegcc using the + prelink tool. + + * dlls/ntdll/ntdll_misc.h, dlls/ntdll/thread.c, dlls/ntdll/virtual.c: + Added a VIRTUAL_alloc_teb function to allocate TEBs while making sure + they don't end up above the address space limit. + + * dlls/oleaut32/oleaut.c, dlls/oleaut32/tmarshal.c, + dlls/oleaut32/tmarshal.h, dlls/oleaut32/typelib.h: + Get rid of the almost empty tmarshal.h file. + + * server/named_pipe.c, server/registry.c, server/request.c, + server/sock.c, server/thread.c: + Mike McCormack + Fix some gcc 4.0 warnings. + + * server/registry.c: + The temp buffer always stores WCHARs, fixed its type and got rid of a + number of casts. + + * dlls/oleaut32/variant.h, dlls/oleaut32/vartype.c: + Moved a number of definitions that are not needed in other files into + vartype.c + + * dlls/Makefile.in, dlls/itss/.cvsignore, dlls/itss/Makefile.in: + itss doesn't need an import library. + + * dlls/advpack/advpack.spec, dlls/dciman32/dciman32.spec, + dlls/itss/itss.spec, dlls/msimg32/msimg32.spec: + Mark DllMain and similar exports as private. + + * tools/winebuild/parser.c: + Added a warning for DllGetVersion and DllInstall not being declared + private. Also warn when one of the Dll* functions is using a different + internal name. + + * dlls/user/menu.c, dlls/user/tests/win.c, dlls/user/win.c: + Dmitry Timoshkov + Make CreateWindow with invalid menu handle test pass on Wine. + + * dlls/d3d8/directx.c: Mike McCormack + Fix gcc 4.0 warnings. + + * include/winbase.h: Mike McCormack + Correct OFSTRUCT declaration. + + * dlls/shlwapi/ordinal.c, dlls/shlwapi/tests/ordinal.c: + Huw Davies + Implement and add tests for the FDSA functions. + +2005-08-08 Alexandre Julliard + + * dlls/gdi/dib.c, dlls/x11drv/dib.c: + Michael Kaufmann + Fix for BI_BITFIELDS: The color masks are at the same position in all + the bitmap headers that support this flag (BITMAPINFO: The first color + mask is in bmiColors[0], that's the same position as bV4RedMask in + BITMAPV4HEADER). + + * dlls/oleaut32/safearray.c, dlls/oleaut32/tmarshal.c, + dlls/oleaut32/typelib.c, dlls/oleaut32/typelib2.c: + Mike McCormack + gcc 4.0 warning fixes. + + * configure, configure.ac: Mike McCormack + Use pkg-config in the libxml configure check. + + * dlls/msxml3/domdoc.c: Mike McCormack + Use xmlParseMemory instead of xmlReadIO. + + * dlls/Makefile.in, dlls/richedit/.cvsignore, + dlls/richedit/Makefile.in: + riched32 doesn't need an import library. + + * dlls/dmcompos/dmcompos.spec, dlls/dmime/dmime.spec, + dlls/dmstyle/dmstyle.spec, dlls/shdocvw/shdocvw.spec: + Fixed DllGetClassObject spec entries. + + * dlls/shell32/tests/shlfileop.c, dlls/shell32/tests/shlfolder.c: + Saulius Krasuckas + Remove trailing backslash. + + * dlls/msxml3/nodemap.c: Jacek Caban + Fixed msxml compilation when libxml2 is not available. + + * dlls/kernel/comm.c: Gerald Pfeifer + Fix autoconf-related #ifdefs in Comm_CheckEvents(). + + * dlls/wined3d/stateblock.c: + Oliver Stieber + Fix stateblock loop errors. + + * tools/winedump/pe.c: Mike McCormack + gcc 4.0 warning fix. + + * dlls/shlwapi/ordinal.c: Huw Davies + IUnknown_SetSite calls IObjectWithSite_SetSite or + IInternetSecurityManager_SetSecuritySite. + + * dlls/oleaut32/tests/vartype.c: Saulius Krasuckas + Comment out VarDateFromStr() calls that generate exceptions on WinME. + + * dlls/richedit/riched32.spec, dlls/richedit/richedit.c, + dlls/shlwapi/shlwapi.spec, dlls/shlwapi/shlwapi_main.c, + dlls/wininet/wininet.spec, dlls/wininet/wininet_main.c: + Don't prefix the functions DllInstall and DllGetVersion with the dll + name so that the compiler can check the prototypes. + + * include/shlwapi.h: + Added a prototype for DllGetVersion to enable type checking in the + Wine source. + + * dlls/mapi32/mapi32.spec, dlls/mapi32/mapi32_main.c, + dlls/mlang/mlang.c, dlls/mlang/mlang.spec, dlls/mlang/regsvr.c, + dlls/mpr/mpr.spec, dlls/mpr/mpr_main.c, dlls/mshtml/main.c, + dlls/mshtml/mshtml.spec, dlls/msi/msi.c, dlls/msi/msi.spec, + dlls/msi/msipriv.h, dlls/msi/regsvr.c, dlls/msisys/msisys.c, + dlls/msisys/msisys.ocx.spec, dlls/msxml3/factory.c, + dlls/msxml3/main.c, dlls/msxml3/msxml3.spec, dlls/ole32/ole32.spec, + dlls/ole32/oleproxy.c, dlls/oleacc/main.c, dlls/oleacc/oleacc.spec, + dlls/qcap/qcap.spec, dlls/qcap/qcap_main.c, dlls/rpcrt4/rpcrt4.spec, + dlls/rpcrt4/rpcrt4_main.c, dlls/shell32/regsvr.c, + dlls/shell32/shell32.spec, dlls/shell32/shell32_main.c, + dlls/shell32/shell32_main.h, dlls/shell32/shellole.c, + dlls/urlmon/regsvr.c, dlls/urlmon/urlmon.spec, + dlls/urlmon/urlmon_main.c, dlls/amstream/amstream.spec, + dlls/amstream/main.c, dlls/amstream/regsvr.c, dlls/atl/atl.spec, + dlls/atl/registrar.c, dlls/avifil32/avifil32.spec, + dlls/avifil32/factory.c, dlls/avifil32/regsvr.c, + dlls/cabinet/cabinet.spec, dlls/cabinet/cabinet_main.c, + dlls/comcat/comcat.spec, dlls/comcat/comcat_main.c, + dlls/comcat/regsvr.c, dlls/comctl32/comctl32.spec, + dlls/comctl32/commctrl.c, dlls/d3dxof/d3dxof.spec, + dlls/d3dxof/main.c, dlls/d3dxof/regsvr.c, dlls/ddraw/ddraw.spec, + dlls/ddraw/main.c, dlls/ddraw/regsvr.c, dlls/dinput/dinput.spec, + dlls/dinput/dinput_main.c, dlls/dinput/regsvr.c, + dlls/dinput8/dinput8.spec, dlls/dinput8/dinput8_main.c, + dlls/dmband/dmband.spec, dlls/dmband/dmband_main.c, + dlls/dmband/regsvr.c, dlls/dmloader/dmloader.spec, + dlls/dmloader/dmloader_main.c, dlls/dmloader/regsvr.c, + dlls/dmscript/dmscript.spec, dlls/dmscript/dmscript_main.c, + dlls/dmscript/regsvr.c, dlls/dmsynth/dmsynth.spec, + dlls/dmsynth/dmsynth_main.c, dlls/dmsynth/regsvr.c, + dlls/dmusic/dmusic.spec, dlls/dmusic/dmusic_main.c, + dlls/dmusic/regsvr.c, dlls/dplayx/dpclassfactory.c, + dlls/dplayx/dplayx.spec, dlls/dplayx/dplayx_main.c, + dlls/dplayx/regsvr.c, dlls/dpnet/dpnet.spec, dlls/dpnet/dpnet_main.c, + dlls/dpnet/regsvr.c, dlls/dpnhpast/dpnhpast.spec, + dlls/dpnhpast/main.c, dlls/dswave/dswave.spec, + dlls/dswave/dswave_main.c, dlls/dswave/regsvr.c, + dlls/dxdiagn/dxdiagn.spec: + Don't prefix the functions DllCanUnloadNow, DllGetClassObject and + Dll(Un)RegisterServer with the dll name so that the compiler can check + the prototypes. + + * include/wine/server_protocol.h, server/change.c, server/fd.c, + server/file.c, server/mapping.c, server/protocol.def, + server/request.h, server/trace.c: + Added an unmount_device request that invalidates all file descriptors + open on a given Unix device. + + * dlls/oleaut32/variant.h, dlls/oleaut32/vartype.c: + Removed some unnecessary macros, and make some functions static. + + * dlls/amstream/main.c, dlls/avifil32/factory.c, dlls/d3dxof/main.c, + dlls/ddraw/main.c, dlls/dplayx/dpclassfactory.c, + dlls/msisys/msisys.c, dlls/msxml3/factory.c, + dlls/urlmon/urlmon_main.c: + Francois Gouget + Add missing WINAPI to MSXML_DllGetClassObject(). + Standardize the DllGetClassObject() prototypes so they match the MSDN + definition. + + * dlls/msxml3/Makefile.in, dlls/msxml3/element.c, + dlls/msxml3/msxml_private.h, dlls/msxml3/nodemap.c: + Mike McCormack + Implement the IXMLDOMNamedNodeMap interface. + + * dlls/gdi/driver.c, dlls/gdi/font.c, dlls/gdi/freetype.c, + dlls/gdi/tests/metafile.c: + Mike McCormack + Warning fixes for gcc 4.0. + + * tools/Makefile.in: Detlef Riekenberg + Added exe extensions for mingw32. + + * dlls/shlwapi/shlwapi.spec: Huw Davies + Forward ordinals 457,458 to GetLongPathNameW,A. + + * include/winspool.h: Detlef Riekenberg + - Access rights for Printserver, Printers and Printjobs added. + - Defines for bidirectional communication added. + + * dlls/msxml3/element.c, dlls/msxml3/msxml_private.h: + Jacek Caban + Fixed msxml compilation when libxml is not available. + + * dlls/wldap32/wldap32.rc, dlls/wldap32/wldap32_Ru.rc: + Dmitry Timoshkov + Added Russian resources to wldap32. + + * dlls/user/tests/win.c: Francois Gouget + CreateWindow(parent=NULL, ctlid!=0) should fail. + + * configure, configure.ac, dlls/dinput/joystick_linuxinput.c, + dlls/winmm/wineoss/midi.c, dlls/winmm/wineoss/oss.c, + dlls/winmm/wineoss/oss.h, include/config.h.in: + Removed some unused or redundant configure checks. + A few cleanups in configure.ac. + + * dlls/uuid/uuid.c, include/.cvsignore, include/Makefile.in, + include/hlink.idl: + Jacek Caban + Added hlink.idl. + + * dlls/mshtml/htmldoc.c, dlls/mshtml/mshtml_private.h, + dlls/mshtml/oleobj.c: + Jacek Caban + Added stub implementation of IOleControl. + + * dlls/gdi/tests/gdiobj.c: Dmitry Timoshkov + Add a test showing that Windows doesn't tie GDI objects to a + particular thread. + + * dlls/msi/msipriv.h: Yuri Kozlov + Remove duplicate declaration of MSI_SetPropertyW. + + * programs/winetest/Makefile.in: Kai Blin + Add secur32.dll tests to winetest. + + * dlls/atl/atl_main.c, dlls/atl/registrar.c: + Stefan Leichter + Basic implementation of AtlModuleUpdateRegistryFromResourceD. + + * tools/winapi/winapi_parser.pm: + Vincent Béron + Remove WINE_PACKED recognition. + Update various winapi parser regular expressions to let it understand + some Wine constructs. + + * tools/winapi/win16.api, tools/winapi/win32.api: + Vincent Béron + Update win16.api/win32.api to current CVS. + + * tools/winapi/c_parser.pm: Vincent Béron + Remove WINE_UNUSED checks. + + * dlls/riched20/reader.c: Phil Krylov + Fixed UTF-8 RTF parsing. + + * include/dinput.h: Daniel Remenak + Add some definitions necessary for force feedback. + + * dlls/ole32/ole2.c, dlls/ole32/ole2.spec, dlls/ole32/storage.c, + dlls/ole32/storage.spec: + Marcus Meissner + Implemented ILockBytes16 (memorystream) support for the 16bit compound + storage implementation. + Added ReadClassStg, OleDoAutoConvert, GetConvertStg + implementations/stubs. + + * dlls/shell32/tests/shlfolder.c: Saulius Krasuckas + Wine and NT4 returns E_FAIL on failure. + + * dlls/oleaut32/typelib.c: Robert Shearman + Revert to previous behaviour of detecting names with non-alphanumeric + characters as ones with offsets, but add in a special case for an + empty name. + + * dlls/wldap32/wldap32.rc, dlls/wldap32/wldap32_De.rc, + dlls/wldap32/wldap32_Nl.rc: + Hans Leidekker + Add Dutch resource translation. + Small fix for the German translation. + + * dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.h: + Hans Leidekker + Add helpers for converting (arrays of) LDAPSortKey, LDAPAPIInfo, and + LDAPAPIFeatureInfo structures into different encodings. + + * dlls/user/listbox.c, dlls/user/tests/listbox.c: + Francois Gouget + The listbox test shows that the control id must be stored in WPARAM + for the WM_DRAWITEM message. + Fix the listbox test so CreateWindow() does not fail on Windows. + + * dlls/ntdll/cdrom.c: Tobias Gruetzmacher + Reverse the direction of raw SCSI commands. + + * dlls/shlwapi/ordinal.c: Huw Davies + Fix call to GetMenuItemInfo and unicodify while we're at it. + + * dlls/msi/table.c: Mike McCormack + Handle loading strings over 64k from the string table. + + * dlls/hhctrl.ocx/De.rc: Henning Gerhardt + Update German resource file. + + * dlls/hhctrl.ocx/help.c: James Hawkins + - Don't keep track of the number of TB buttons. + - Call the W version of SetWindowLongPtr. + + * dlls/wined3d/stateblock.c: + Oliver Stieber + Allow the WINED3DSBT_IMPL to be applied so that states can be synced + between render target contexts. + + * dlls/wined3d/Makefile.in: Oliver Stieber + Remove dxguid dependency. + +2005-08-03 Alexandre Julliard + + * dlls/mshtml/nsembed.c: Jacek Caban + Fix comment about hack. + + * dlls/mshtml/oleobj.c, dlls/mshtml/tests/htmldoc.c: + Jacek Caban + Added IOleCommandTarget::Exec implementation. + + * configure, configure.ac, dlls/advapi32/crypt.c, + dlls/avicap32/avicap32_main.c, dlls/d3d8/surface.c, + dlls/dbghelp/elf_module.c, dlls/ddraw/surface_dib.c, + dlls/ddraw/surface_main.c, dlls/ddraw/texture.c, + dlls/iphlpapi/ipstats.c, dlls/ntdll/path.c, dlls/qcap/v4l.c, + dlls/shell32/shfldr_unixfs.c, dlls/winaspi/aspi.c, + dlls/winaspi/winaspi16.c, dlls/winedos/ppdev.c, dlls/wineps/ppd.c, + dlls/wineps/type1afm.c, dlls/winmm/joystick/joystick.c, + dlls/winmm/wineoss/midi.c, dlls/winmm/wineoss/mixer.c, + dlls/winmm/wineoss/mmaux.c, include/config.h.in, include/wine/port.h, + programs/winecfg/drivedetect.c, server/fd.c, tools/fnt2bdf.c, + tools/fnt2fon.c, tools/sfnt2fnt.c, tools/widl/proxy.c, + tools/widl/widl.c, tools/winedump/dump.c, tools/winedump/main.c, + tools/wmc/wmc.c, tools/wmc/write.c, tools/wrc/parser.y: + Removed the broken mmap64 configure check, and moved the + _FILE_OFFSET_BITS define to wine/port.h. Made sure that all files that + need the define include it. + + * dlls/wined3d/surface.c: Oliver Stieber + Set the apha channel to opaque when locking X8R8G8B8 backbuffers. + + * dlls/uxtheme/draw.c: Frank Richter + Implement DrawThemeEdge(). + + * dlls/wined3d/basetexture.c, dlls/wined3d/cubetexture.c, + dlls/wined3d/device.c, dlls/wined3d/drawprim.c, + dlls/wined3d/texture.c, dlls/wined3d/utils.c, + dlls/wined3d/wined3d_private.h: + Oliver Stieber + Moved support for non power 2 texture to hardware. + Fix for the texture state separation patches, ApplyTextureStates is + now called instead of being commented out. + + * dlls/uxtheme/draw.c: Frank Richter + Set some default values for truesize sizing that seem closer to + Windows. + + * configure, configure.ac, programs/regedit/Makefile.in: + Get rid of the no longer used regedit test. + + * configure, configure.ac, dlls/wineps/ppd.c, dlls/winsock/socket.c, + include/config.h.in, programs/wineconsole/curses.c: + Merged some of the header checks to reduce the size of the generated + configure script a bit. + + * dlls/user/painting.c: + Call the USER driver directly to check for X events on RDW_UPDATENOW + instead of calling MsgWaitForMultipleObjects. + + * Makefile.in: Detlef Riekenberg + Added description for crosstest. + + * dlls/wined3d/drawprim.c: Oliver Stieber + Improve on a fixup for the difference between opengl and directx pixel + centering of vertexes. + + * dlls/dsound/mixer.c: Alex Villacís Lasso + Correction to earlier assertion patch to allow for buf_mixpos == + buflen in non-looping case, fixes looping of one-off mixed samples + introduced by previous patch. + + * dlls/wininet/internet.c: Robert Shearman + As per MSDN, INTERNET_OPTION_CONNECTED_STATE should take a DWORD + instead of the INTERNET_CONNECTED_INFO structure. + + * dlls/uxtheme/draw.c: Frank Richter + The default image layout is HORIZONTAL, not VERTICAL. + + * dlls/ntdll/critsection.c, dlls/ntdll/heap.c: + Hack to make the main heap critical section have a proper debug info + structure. + + * configure, configure.ac, dlls/Makefile.in, + dlls/winmm/wineesd/.cvsignore, dlls/winmm/wineesd/Makefile.in, + dlls/winmm/wineesd/audio.c, dlls/winmm/wineesd/esound.c, + dlls/winmm/wineesd/esound.h, dlls/winmm/wineesd/wineesd.drv.spec, + include/config.h.in, programs/winecfg/audio.c, + programs/winecfg/properties.c: + Peter Ĺstrand + Implemented an Esound driver. + + * dlls/x11drv/event.c: + Don't call WaitForMultipleObjectsEx if we are just polling for pending + X events. + + * dlls/kernel/tests/comm.c: + Uwe Bonnes + More comm tests. + + * dlls/kernel/comm.c: + Uwe Bonnes + Implement WaitCommEvent by polling the appropriate data sources. + + * dlls/uxtheme/draw.c: Frank Richter + Another fix to use magenta as the default transparent color. + + * dlls/rpcrt4/ndr_marshall.c, dlls/rpcrt4/ndr_midl.c, + dlls/rpcrt4/rpcrt4.spec, include/rpcndr.h, include/wine/rpcfc.h: + Robert Shearman + Add stubs for NdrMapCommAndFaultStatus, conformant string marshaling + and context handle functions. + + * tools/widl/header.c, tools/widl/header.h: + Robert Shearman + - The header global variable is NULL when not generating a header so + don't try to use it in functions that may be called by the client + code. + - Make the functions that take char * take const char *. + + * dlls/rpcrt4/rpc_message.c: Robert Shearman + Don't free previous buffer in NdrGetBuffer. + + * libs/unicode/wctomb.c: Mike McCormack + Fix a gcc 4.0 -Wpointer-sign warning. + + * dlls/uxtheme/draw.c: Frank Richter + Add support for horizontal & vertical alignment when doing truesize + sizing. + + * configure, configure.ac, dlls/secur32/Makefile.in, + dlls/secur32/tests/.cvsignore, dlls/secur32/tests/Makefile.in, + dlls/secur32/tests/main.c: + Kai Blin + Set up tests for secur32. + + * dlls/hhctrl.ocx/help.c: James Hawkins + Free the allocated command line string. + + * dlls/uxtheme/draw.c: Frank Richter + Add support for the BT_NONE background type. + + * dlls/hhctrl.ocx/En.rc, dlls/hhctrl.ocx/help.c, + dlls/hhctrl.ocx/hhctrl.rc, dlls/hhctrl.ocx/resource.h: + James Hawkins + Add a tab control to the navigation pane. + + * dlls/comctl32/header.c: Frank Richter + Add hottracking support for the header control. + + * dlls/uxtheme/draw.c: Frank Richter + Implement GetThemeBackgroundExtent(). + + * dlls/version/info.c: + Don't convert the return value on failure in VerQueryValueA/W. + + * dlls/shell32/tests/shellpath.c, dlls/winspool/info.c: + Mike McCormack + gcc 4.0 RegSetValueEx warning fixes. + + * dlls/dinput/dinput_main.c, dlls/dinput/dinput_private.h, + dlls/dinput/joystick_linux.c, dlls/dinput/keyboard.c, + dlls/dinput/mouse.c, dlls/dxdiagn/dxdiag_private.h, + dlls/oleaut32/tests/safearray.c, dlls/oleaut32/tests/vartype.c, + dlls/quartz/enummoniker.c, dlls/riched20/richole.c, + include/wine/wined3d_gl.h: + Mike McCormack + gcc 4.0 warning fixes for Interlocked* functions. + + * dlls/x11drv/opengl.c: Oliver Stieber + Back out the previous stencil patch and slightly improve on the old + functionality. + + * dlls/wined3d/basetexture.c, dlls/wined3d/cubetexture.c, + dlls/wined3d/device.c, dlls/wined3d/directx.c, + dlls/wined3d/texture.c, dlls/wined3d/volumetexture.c, + dlls/wined3d/wined3d_private.h, include/wine/wined3d_interface.h: + Oliver Stieber + Move the setting of states from device to basetexture, states that + relate to the opengl texture object will only be updated when they are + out of sync, this reduces the number of texture object state changes + during game play in Axis and allies from several hundreds to 0 or 1. + + * dlls/msxml3/Makefile.in, dlls/msxml3/domdoc.c, dlls/msxml3/element.c, + dlls/msxml3/msxml_private.h: + Mike McCormack + Implemented the IXMLDOMElement interface. + + * dlls/wldap32/Makefile.in, dlls/wldap32/dn.c, dlls/wldap32/misc.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement LdapUnicodeToUTF8, LdapUTF8ToUnicode, + ldap_dn2ufn*, ldap_explode_dn*, ldap_get_dn*, + ldap_memfree*, ldap_ufn2dn* and ldap_value_free*. + + * dlls/hhctrl.ocx/De.rc, dlls/hhctrl.ocx/hhctrl.rc: + Henning Gerhardt + Add German resourced for hhctrl.ocx. + + * dlls/hhctrl.ocx/help.c: James Hawkins + - Add the HH Child window class. + - Create the Navigation and HTML panes as HH Child windows. + + * dlls/msi/msi.c, dlls/msi/msi.spec: + Steven Edwards + Add real stub for MsiConfigureFeatureW. + + * dlls/mshtml/protocol.c, dlls/mshtml/tests/protocol.c: + Jacek Caban + Added about protocol implementation. + + * dlls/comctl32/listview.c: Frank Richter + Remove unneeded theming check. + + * dlls/uxtheme/draw.c: Frank Richter + Implement support for the ST_TILE background stretching mode. + + * dlls/ntdll/cdrom.c: Vitaliy Margolen + Implement IOCTL_SCSI_GET_INQUIRY_DATA. + +2005-08-02 Alexandre Julliard + + * dlls/kernel/kernel32.spec, dlls/kernel/module.c: + Implemented Get/SetDllDirectory. + + * dlls/hhctrl.ocx/.cvsignore, dlls/hhctrl.ocx/En.rc, + dlls/hhctrl.ocx/Makefile.in, dlls/hhctrl.ocx/help.c, + dlls/hhctrl.ocx/hhctrl.rc: + James Hawkins + - Add the toolbar to the viewer window. + - Load the toolbar button text from the resource file. + + * dlls/ntdll/version.c: Removed a noisy trace. + + * dlls/wldap32/bind.c, dlls/wldap32/compare.c, dlls/wldap32/init.c, + dlls/wldap32/search.c: + Hans Leidekker + Use WLDAP32_LDAP_NO_MEMORY instead of LDAP_NO_MEMORY. + + * dlls/shell32/tests/shlfolder.c: Saulius Krasuckas + Added test for IShellFolder_ParseDisplayName. + + * dlls/Maketest.rules.in: Robert Shearman + Move TESTLIST from EXTRA_SRCS to C_SRCS in test makefiles to free up + EXTRA_SRCS for other purposes. + + * dlls/hhctrl.ocx/Makefile.in, dlls/hhctrl.ocx/main.c: + James Hawkins + Implement DllMain and store the Dll hinstance. + + * dlls/ntdll/ntdll.spec, dlls/ntdll/process.c, dlls/ntdll/rtl.c, + include/winternl.h: + Implemented a few trivial ntdll functions that have been added in + recent Windows versions. + + * configure, configure.ac, dlls/Makefile.in, dlls/msxml3/.cvsignore, + dlls/msxml3/Makefile.in, dlls/msxml3/domdoc.c, dlls/msxml3/factory.c, + dlls/msxml3/main.c, dlls/msxml3/msxml3.spec, + dlls/msxml3/msxml_private.h, include/config.h.in: + Mike McCormack + Initial implementation of msxml3 based on libxml2. + + * dlls/kernel/profile.c: + Fixed white space handling on the last line (reported by Jeremy + White). + Avoid parsing the same line twice when it contains trailing spaces. + + * dlls/user/tests/win.c: Lauri Tulmin + Add tests for repainting windows with CS_PARENTDC class style. + + * dlls/kernel/thread.c, dlls/ntdll/ntdll.spec, dlls/ntdll/ntdll_misc.h, + dlls/ntdll/server.c, dlls/ntdll/thread.c, include/wine/server.h, + include/winternl.h: + Use the new RtlExitUserThread function instead of exporting + wine_server_exit_thread. + + * dlls/mshtml/oleobj.c, dlls/mshtml/tests/htmldoc.c: + Jacek Caban + Added QueryStatus implementation. + + * dlls/wldap32/compare.c, dlls/wldap32/winldap_private.h: + Hans Leidekker + Don't rely on ldap structure when headers are not available. + + * dlls/wldap32/wldap32.rc, dlls/wldap32/wldap32_De.rc: + Henning Gerhardt + Add German resource file for WLDAP32. + + * dlls/mshtml/htmldoc.c, dlls/mshtml/main.c, + dlls/mshtml/mshtml_private.h, dlls/mshtml/protocol.c: + Jacek Caban + Added DllCanUnloadNow implementation. + + * dlls/dsound/mixer.c: Alex Villacís Lasso + Prevent dsb->buf_mixpos from ever remaining past dsb->buflen even if + not in DSBPLAY_LOOPING case, to prevent assertion failure in + DSOUND_MixInBuffer. + + * dlls/comctl32/listview.c: Vitaly Lipatov + Use STATEIMAGEINDEX / INDEXTOSTATEIMAGEMASK instead of bit + operations. + +2005-08-01 Alexandre Julliard + + * dlls/advapi32/advapi32.spec, dlls/gdi/gdi32.spec, + dlls/kernel/kernel32.spec, dlls/ntdll/ntdll.spec, + dlls/user/user32.spec: + Added commented out stubs for a bunch of new functions. + + * include/winbase.h: Properly sort the function prototypes. + + * dlls/mshtml/Makefile.in: Fixed the build without make depend. + + * dlls/usp10/usp10.spec: Properly sort the spec file entries. + + * dlls/wldap32/Makefile.in, dlls/wldap32/compare.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_compare* functions. + + * dlls/ntdll/cdrom.c: Vitaliy Margolen + Fixed IOCTL_SCSI_GET_ADDRESS. + + * dlls/comctl32/dpa.c, dlls/comctl32/tests/dpa.c: + Fixed regression in DPA_Search. + + * dlls/mshtml/.cvsignore, dlls/mshtml/Makefile.in, + dlls/mshtml/htmldoc.c, dlls/mshtml/main.c, + dlls/mshtml/mshtml_private.h, dlls/mshtml/nsembed.c, + dlls/mshtml/nsiface.idl, dlls/mshtml/persist.c, dlls/mshtml/view.c: + Jacek Caban + - Use Gecko to render HTML. + - Get rid of Mozilla ActiveX Control in MSHTML. + + * dlls/wldap32/.cvsignore, dlls/wldap32/Makefile.in, + dlls/wldap32/error.c, dlls/wldap32/main.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.rc, + dlls/wldap32/wldap32.spec, dlls/wldap32/wldap32_En.rc: + Hans Leidekker + Implement ldap_err2string. + + * dlls/wined3d/device.c, dlls/wined3d/drawprim.c, + dlls/wined3d/stateblock.c, dlls/wined3d/utils.c, + dlls/wined3d/wined3d_private.h: + Oliver Stieber + Separate the setting of the DirectX texture and sampler states from + the setting of OpenGL states (now in applyTextureStateState and + applySamplerState). + + * dlls/kernel/tests/sync.c: + Felix Nawothnig + Fix sync tests on Win98/ME. + + * dlls/kernel/tests/module.c: + Felix Nawothnig + Fix module tests on Win9x. + + * dlls/winsock/ws2_32.spec: Andreas Mohr + Sync ws2_32.spec with XP. + + * dlls/ddraw/device_opengl.c, dlls/ddraw/surface_dib.c, + dlls/ddraw/texture.c: + Mike McCormack + Warning fixes. + + * dlls/hhctrl.ocx/Makefile.in, dlls/hhctrl.ocx/help.c, + dlls/hhctrl.ocx/hhctrl.c: + James Hawkins + Add beginnings of the Help viewer. + + * libs/unicode/mbtowc.c: Mike McCormack + gcc 4.0 warning fix. + + * dlls/wined3d/basetexture.c, dlls/wined3d/device.c, + dlls/wined3d/drawprim.c, dlls/wined3d/stateblock.c: + Oliver Stieber + Separate the management of DirectX states and openGL states. + + * dlls/usp10/usp10.c, dlls/usp10/usp10.spec, include/usp10.h: + Oliver Stieber + Added stubbed support for ScriptGetFontProperties. + + * dlls/comctl32/dpa.c, dlls/comctl32/tests/dpa.c: + Felix Nawothnig + Fix DPA_Search for sorted arrays. + +2005-07-30 Alexandre Julliard + + * dlls/wined3d/directx.c: Oliver Stieber + Fixed an off by one error in enumdisplaymodes, allowing sims 2 to + start up. + + * server/fd.c: + Added a separate device object to keep track of inodes that are on the + same device. + + * dlls/wined3d/drawprim.c, dlls/wined3d/wined3d_private.h: + Oliver Stieber + Tidy up some of the formatting in drawprim and add missing strided + data. + + * dlls/wined3d/device.c, dlls/wined3d/directx.c: + Oliver Stieber + Validate that the texture is no larger than the graphics cards largest + supported texture. + + * dlls/kernel/tests/comm.c: + Felix Nawothnig + Fix comm tests on Win9x. + + * programs/regsvr32/regsvr32.c: + Andreas Mohr + Improve regsvr32 output. + + * dlls/version/info.c: Paul Vriens + Remove the no longer used ConvertVersionInfo32To16 function. + Add a (forgotten) RtlFreeUnicodeString. + + * dlls/kernel/tests/thread.c: + Felix Nawothnig + Fix remaining thread tests on WinME. + + * dlls/shell32/shlview.c: Jozef Stefanka + Fixed browsing to other directories in Word 2003 file open + dialog. Double clicking on a folder in the File->Open dialog works + now. + +2005-07-29 Alexandre Julliard + + * programs/winecfg/Fr.rc: Jonathan Ernst + Fixed control size and placement. + + * programs/winecfg/De.rc: Stefan Dösinger + Correct the sizes of some controls in the German resources. + + * server/trace.c, tools/make_requests: + Automatically generate the list of error names in make_requests. + + * dlls/dbghelp/dbghelp.c, dlls/dbghelp/dbghelp.spec, include/dbghelp.h: + Peter Oberndorfer + Added stub for SymSetParentWindow. + + * dlls/user/listbox.c, dlls/user/tests/listbox.c: + Dmitry Timoshkov + - Add an ownerdrawn listbox test, which confirms that on WM_DRAWITEM + parent receives a clipbox equal to a listbox's client area. + - WM_DRAWITEM message contains 0 in wparam (at least on win2k). + + * dlls/dinput/joystick_linuxinput.c: + Daniel Remenak + Correctly enumerate evdev joysticks when enumeration is restricted + with DIEDFL_FORCEFEEDBACK. + + * server/queue.c: Removed a no longer used variable. + + * server/handle.c, server/thread.c: Fixed a couple of error codes. + + * configure, configure.ac, dlls/dinput/joystick_linuxinput.c, + include/config.h.in: + Daniel Remenak + Detect force-feedback-capable linux event device joysticks and return + DIDC_FORCEFEEDBACK when queried for capabilities. + + * dlls/shlwapi/istream.c, dlls/shlwapi/regstream.c, + dlls/shlwapi/tests/shreg.c: + Mike McCormack + gcc 4.0 warning fixes. + + * dlls/version/info.c: Paul Vriens + Cleanup whitespace. + Conversion fixes. + + * dlls/msacm/winemp3/interface.c, dlls/msacm/winemp3/mpegl3.c, + dlls/msacm/winemp3/mpglib.h, dlls/winmm/winealsa/midi.c, + dlls/winmm/wineoss/dsrender.c, dlls/winmm/wineoss/midi.c: + Mike McCormack + gcc 4.0 warning fixes. + +2005-07-28 Alexandre Julliard + + * dlls/ntdll/error.c: Added names for a bunch of status values. + + * include/winerror.h: Added a few error codes. + + * dlls/wined3d/device.c, dlls/wined3d/directx.c, + dlls/wined3d/surface.c: + Mike McCormack + Signed warning fixes. + + * include/xmldom.idl: Mike McCormack + Fix some typos in the idl definitions. + + * dlls/version/info.c: Paul Vriens + New function VersionInfo32_QueryValue. + Made functions static. + + * server/fd.c: + Renamed fd to unix_fd in the closed_fd structure to make the code a + bit clearer. + + * include/xmldom.idl: Mike McCormack + Add a definition for the IXMLDOMElement interface. + + * dlls/kernel/lcformat.c: Dmitry Timoshkov + Implement EnumDateFormatsEx. + + * dlls/version/info.c, include/winver.h: + Paul Vriens + VerQueryValue returns BOOL not DWORD. + + * dlls/ole32/storage32.c: Remove duplicate definition of FILE_BEGIN. + + * dlls/advapi32/registry.c, dlls/comctl32/comctl32undoc.c, + dlls/shlwapi/reg.c, include/winreg.h: + Steven Edwards + Correct RegCreateKeyEx[A/W] prototype to match the PSDK. + + * dlls/d3d8/device.c, dlls/d3d8/directx.c, dlls/d3d8/drawprim.c, + dlls/d3d8/surface.c: + Mike McCormack + Fix sign warnings. + + * dlls/d3d9/d3d9_private.h, dlls/wined3d/wined3d_private.h: + Mike McCormack + gcc 4.0 -Wpointer-sign fixes. + + * dlls/kernel/lcformat.c, dlls/kernel/tests/locale.c: + Dmitry Timoshkov + - Reimplement EnumTimeFormats, make it work for all available + locales. + - Add a test for EnumTimeFormats + + * dlls/wined3d/vertexdeclaration.c: + Oliver Stieber + Return all elements when getDeclaration is called with pnumelements + set to 0. + + * dlls/comctl32/treeview.c: Frank Richter + Add theming for treeview control. + + * dlls/comctl32/tab.c: Frank Richter + Add theming support for the tab control. + + * dlls/oleaut32/typelib.c: Robert Shearman + - A name in an SLTG typelib only beginning with 0xff is the indicator + of an offset, instead of any non alpha-numeric character. + - Any dispatch interface should have the fixed vtable size, not just + dual ones. + - Warn when ITypeInfo_GetDocumentation fails. + + * dlls/version/info.c: Paul Vriens + Cleanup print_vffi_debug. + +2005-07-27 Alexandre Julliard + + * configure, configure.ac, dlls/Makefile.in, dlls/mcicda/.cvsignore, + dlls/mcicda/Makefile.in, dlls/mcicda/mcicda.c, + dlls/mcicda/mcicda.spec, tools/winapi/win32.api, tools/wine.inf: + Rémi Assailly + Moved mcicda to the top-level dlls directory. + + * dlls/uxtheme/draw.c: Frank Richter + Implementation for GetThemePartSize() (not entirely equivalent to + native uxtheme, but sensibly useable). + + * dlls/wined3d/device.c, dlls/wined3d/swapchain.c, + dlls/wined3d/wined3d_private.h, include/wine/wined3d_interface.h: + Oliver Stieber + Changed swapchains held by the device from an array to a linked + list. Also provide a notification function that that the swapchain can + be removed when it is released. + + * dlls/x11drv/window.c: + There's no need to update the event mask in X11DRV_sync_window_style, + it never changes. + + * dlls/devenum/mediacatenum.c, dlls/qcap/capturegraph.c, + dlls/quartz/filesource.c, dlls/quartz/filtermapper.c, + dlls/quartz/parser.c, dlls/quartz/pin.c: + Replace the ICOM_THIS_From macros by inline functions. + + * dlls/comctl32/header.c, dlls/comctl32/listview.c: + Frank Richter + Since OpenThemeData() should return 0 in case theming is disabled + globally or for the application we don't need to check that when + calling OpenThemeData(). + + * dlls/wldap32/Makefile.in, dlls/wldap32/error.c, + dlls/wldap32/winldap_private.h, dlls/wldap32/wldap32.spec: + Hans Leidekker + Implement ldap_perror, ldap_result2error and LdapMapErrorToWin32. + + * dlls/uxtheme/property.c: Frank Richter + Make GetThemeMargins() return default values (0 margin) if the + function does not succeed. + + * dlls/kernel/lcformat.c, dlls/kernel/tests/locale.c: + Dmitry Timoshkov + - Reimplement EnumDateFormats, make it work for all available + locales. + - Add a test for EnumDateFormats. + + * dlls/version/info.c: Paul Vriens + Remove 32bit references/checks in VERSION_GetFileVersionInfo_16. + + * dlls/oleaut32/olefont.c, dlls/oleaut32/olepicture.c, + dlls/oleaut32/typelib.c, dlls/oleaut32/typelib2.c: + Replace the ICOM_THIS_From macros by inline functions. + + * dlls/ole32/antimoniker.c, dlls/ole32/compositemoniker.c, + dlls/ole32/datacache.c, dlls/ole32/defaulthandler.c, + dlls/ole32/errorinfo.c, dlls/ole32/filemoniker.c, + dlls/ole32/ftmarshal.c, dlls/ole32/itemmoniker.c, + dlls/ole32/moniker.c, dlls/ole32/moniker.h, dlls/ole32/stg_prop.c: + Replace the _ICOM_THIS_From macros by inline functions the way it's + already done in shelllink.c. + + * dlls/comctl32/progress.c: Frank Richter + Split up the drawing code into a set of smaller functions and also + moved some common computations into helper functions. All that to + facilitate the implementation of the forthcoming theming support. + + * dlls/winmm/winealsa/midi.c: Johannes Koch + Fixed pitch bending in the midi driver. + + * dlls/version/info.c: Paul Vriens + Remove wrong check. + + * dlls/commdlg/filedlgbrowser.c, dlls/commdlg/filedlgbrowser.h, + dlls/shell32/autocomplete.c, dlls/shell32/cpanelfolder.c, + dlls/shell32/folders.c, dlls/shell32/shfldr_fs.c, + dlls/shell32/shfldr_mycomp.c, dlls/shell32/shlview.c: + Replace the _ICOM_THIS_From macros by inline functions the way it's + already done in shelllink.c. + + * configure, configure.ac, dlls/Makefile.in, dlls/usp10/.cvsignore, + dlls/usp10/Makefile.in, dlls/usp10/usp10.c, dlls/usp10/usp10.spec, + include/usp10.h: + Steven Edwards + Add stub implementation of the Uniscribe Script Processor. + + * dlls/comctl32/Makefile.in, dlls/comctl32/comctl32.h, + dlls/comctl32/commctrl.c, dlls/comctl32/theming.c: + Frank Richter + Added some generic code to allow subclassing (for the purpose of + theming) of standard controls. + + * dlls/kernel/tests/module.c: Paul Vriens + Fix some tests for win9x and winME. + + * dlls/winmm/winealsa/audio.c: + Vitaliy Margolen + Remove all wait_for_poll associated stuff that is no longer needed. + + * include/winnt.h: Huw Davies + Add the 'flag' types: FCHAR, FSHORT and FLONG. + +2005-07-26 Alexandre Julliard + + * dlls/d3dxof/d3dxof_private.h, dlls/ddraw/clipper.c, + dlls/ddraw/ddraw_hal.c, dlls/ddraw/ddraw_main.c, + dlls/ddraw/ddraw_thunks.c, dlls/ddraw/ddraw_user.c, + dlls/ddraw/device_opengl.c, dlls/ddraw/direct3d_opengl.c, + dlls/ddraw/executebuffer.c, dlls/ddraw/light.c, + dlls/ddraw/material.c, dlls/ddraw/palette_hal.c, + dlls/ddraw/palette_main.c, dlls/ddraw/surface_dib.c, + dlls/ddraw/surface_fakezbuffer.c, dlls/ddraw/surface_gamma.c, + dlls/ddraw/surface_hal.c, dlls/ddraw/surface_main.c, + dlls/ddraw/surface_thunks.c, dlls/ddraw/surface_user.c, + dlls/ddraw/texture.c, dlls/ddraw/vertexbuffer.c, + dlls/ddraw/viewport.c, include/objbase.h: + Make CONST_VTABLE the default in the Wine source. + + * dlls/shell32/shelllink.c: + Get rid of the _ICOM_THIS macros and call the inline function + directly instead. + + * dlls/wined3d/device.c, dlls/wined3d/utils.c, + dlls/wined3d/wined3d_private.h: + Oliver Stieber + DirectX uses a R/Z transform to translate a texture but under OpenGL a + Q transform must be used instead. + + * tools/winebuild/spec32.c: + Print a warning when a generated import library doesn't export + anything useful. + + * dlls/wined3d/cubetexture.c, dlls/wined3d/device.c, + dlls/wined3d/surface.c, dlls/wined3d/swapchain.c, + dlls/wined3d/texture.c, dlls/wined3d/volumetexture.c: + Oliver Stieber + Remove a load of IWineD3DSurface * casts that are no longer required. + + * dlls/d3d9/stateblock.c, dlls/wined3d/basetexture.c, + dlls/wined3d/device.c, dlls/wined3d/directx.c, + dlls/wined3d/stateblock.c, dlls/wined3d/volumetexture.c, + dlls/wined3d/wined3d_private.h, include/wine/wined3d_interface.h, + include/wine/wined3d_types.h: + Oliver Stieber + Makes sure any internal reference counting is passed onto the parent, + any objects referenced by the internal stateblock are released when + the stateblock is released (we don't reference count while a + stateblock is recording, so recorded stateblocks have no references to + clean up). + + * dlls/avifil32/editstream.c, dlls/dmime/segment.c, + dlls/dmloader/dmloader_private.h, dlls/dmloader/loader.c, + dlls/dmloader/loaderstream.c, dlls/dplayx/dplaysp.h, + dlls/dplayx/lobbysp.h, dlls/ole32/ifs.h, dlls/shell32/shellfolder.h, + include/d3d.h, include/d3d8.h, include/d3d9.h, include/d3dx8core.h, + include/ddraw.h, include/dinput.h, include/dmplugin.h, + include/dmusicc.h, include/dmusici.h, include/dmusics.h, + include/dpaddr.h, include/dplay.h, include/dplay8.h, + include/dplobby.h, include/dsdriver.h, include/dsound.h, + include/dxdiag.h, include/dxfile.h, include/mapidefs.h, + include/mapiutil.h, include/mapix.h, include/objbase.h, + include/objsel.h, include/oledlg.h, include/shlobj.h, + include/shlwapi.h, include/vfw.h, include/wine/wined3d_interface.h: + Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of + duplicate typedefs. + + * dlls/comctl32/header.c: Filip Navara + Use ReleaseDC instead of DeleteDC on DC handle. + + * dlls/version/info.c: Paul Vriens + Rename bText to wType. + + * dlls/wldap32/init.c: Hans Leidekker + Improve error handling for the init functions. + + * dlls/user/message.c: Phil Krylov + Translate the whole wparam to/from Unicode. + + * dlls/Makefile.in, dlls/amstream/.cvsignore, + dlls/amstream/Makefile.in, dlls/comcat/.cvsignore, + dlls/comcat/Makefile.in, dlls/devenum/.cvsignore, + dlls/devenum/Makefile.in, dlls/dmband/.cvsignore, + dlls/dmband/Makefile.in, dlls/dmcompos/.cvsignore, + dlls/dmcompos/Makefile.in, dlls/dmime/.cvsignore, + dlls/dmime/Makefile.in, dlls/dmloader/.cvsignore, + dlls/dmloader/Makefile.in, dlls/dmscript/.cvsignore, + dlls/dmscript/Makefile.in, dlls/dmstyle/.cvsignore, + dlls/dmstyle/Makefile.in, dlls/dmsynth/.cvsignore, + dlls/dmsynth/Makefile.in, dlls/dmusic/.cvsignore, + dlls/dmusic/Makefile.in, dlls/dpnhpast/.cvsignore, + dlls/dpnhpast/Makefile.in, dlls/dswave/.cvsignore, + dlls/dswave/Makefile.in, dlls/dxdiagn/.cvsignore, + dlls/dxdiagn/Makefile.in, dlls/msnet32/.cvsignore, + dlls/msnet32/Makefile.in, dlls/qcap/.cvsignore, + dlls/qcap/Makefile.in: + Don't generate import libraries for dlls that don't export anything. + + * dlls/winspool/Ru.rc: Dmitry Timoshkov + Avoid an orthographic error by rephrasing the message. + + * dlls/wldap32/search.c, dlls/wldap32/winldap_private.h, + include/winldap.h: + Hans Leidekker + Correct prototype for ldap_search_ext_s. + Improve error handling for the search functions. + + * dlls/version/info.c: Paul Vriens + Forward GetFileVersionInfoA to GetFileVersionInfoW. + + * DEVELOPERS-HINTS, configure, configure.ac, dlls/Makefile.in, + dlls/objsel/.cvsignore, dlls/objsel/Makefile.in, + dlls/objsel/factory.c, dlls/objsel/objsel.c, dlls/objsel/objsel.rc, + dlls/objsel/objsel.spec, dlls/objsel/objsel_private.h, + dlls/objsel/regsvr.c, dlls/uuid/uuid.c, include/Makefile.in, + include/objsel.h: + Thomas Weidenmueller + Added stubs for objsel.dll and objsel.h. + + * dlls/wined3d/wined3d_main.c: + Oliver Stieber + Correct a regression issue with per-app settings. + + * dlls/winspool/Ru.rc, dlls/winspool/winspool.rc: + Dmitrij Sinukov + Added Russian resources. + + * dlls/wined3d/device.c, dlls/wined3d/resource.c, + dlls/wined3d/wined3d_private.h, include/wine/wined3d_interface.h: + Oliver Stieber + Implement resource tracking, require for reset and evict managed + resources and provides extra sanity checks. + + * dlls/version/tests/info.c: Paul Vriens + Cleanup and some additional tests. + + * DEVELOPERS-HINTS: Dimi Paun + Resync with the latest DLLs that were added and/or moved. + + * dlls/riched20/caret.c, dlls/riched20/editor.c, + dlls/riched20/editor.h: + Phil Krylov + Implemented EM_CHARFROMPOS RichEdit message. + + * dlls/riched20/writer.c: Phil Krylov + Generate ending \par in RTF output of RichEdit when streaming out a + whole document. + + * dlls/mshtml/tests/htmldoc.c: Jacek Caban + Tests crash fix. + + * dlls/winmm/winealsa/audio.c: Robert Shearman + wait_for_poll can go into an infinite loop. Remove it and replace it + with snd_pcm_drain which is more likely to do what the original author + intended. + + * dlls/wldap32/bind.c, dlls/wldap32/winldap_private.h: + Hans Leidekker + Improve error handling for the bind functions. + +2005-07-25 Alexandre Julliard + + * VERSION, configure, ANNOUNCE, ChangeLog: Release 20050725. + +---------------------------------------------------------------- 2005-07-25 Alexandre Julliard * dlls/comctl32/updown.c: Frank Richter diff -urN wine-20050725/DEVELOPERS-HINTS wine-20050830/DEVELOPERS-HINTS --- wine-20050725/DEVELOPERS-HINTS 2005-07-13 13:56:15.000000000 +0200 +++ wine-20050830/DEVELOPERS-HINTS 2005-08-23 20:14:52.000000000 +0200 @@ -14,6 +14,7 @@ DLLs (under dlls/): ------------------- + activeds/ - Active Directory Service Interface advapi32/ - Crypto, systeminfo, security, eventlogging advpack/ - Reads and verifies .INF files amstream/ - MultiMedia Streams @@ -73,6 +74,7 @@ kernel/ - The Windows kernel lzexpand/ - Lempel-Ziv compression/decompression mapi32/ - Mail interface + midimap/ - MIDI mapper mlang/ - Multi Language Support mmdevldr.vxd/ - MMDEVLDR VxD implementation monodebg.vxd/ - MONODEBG VxD implementation @@ -97,10 +99,13 @@ msvidc32/ - Microsoft Video-1 Decoder msvideo/ - 16 bit video manager mswsock/ - Misc networking + msxml3/ - MSXML Class Factory netapi32/ - Network interface newdev/ - New Hardware Device Library ntdll/ - NT implementation of kernel calls + objsel/ - Object Picker Dialog odbc32/ - Open DataBase Connectivity driver manager + odbccp32/ - Open DataBase Connectivity driver installer ole32/ - 32 bit OLE 2.0 libraries oleacc/ - OLE accessibility support oleaut32/ - 32 bit OLE 2.0 automation @@ -118,7 +123,7 @@ richedit/ - Rich text editing control rpcrt4/ - Remote Procedure Call runtime rsabase/ - RSA encryption - rsaenh/ - Crypto API that provides algorithms for DES, 3DES, and RSA among others + rsaenh/ - Crypto API (DES, 3DES, RSA, etc.) secur32/ - Contains Windows Security functions sensapi/ - System Event Notification Service serialui/ - Serial port property pages @@ -128,6 +133,7 @@ shfolder/ - Shell folder service shlwapi/ - Shell Light-Weight interface snmpapi/ - SNMP protocol interface (networking) + stdole2.tlb/ - OLE Automation typelib stdole32.tlb/ - Standard OLE typelib sti/ - Still Image service tapi32/ - Telephone interface @@ -135,8 +141,9 @@ twain/ - TWAIN Imaging device communications unicows/ - Unicows replacement (Unicode layer for Win9x) url/ - Internet shortcut shell extension - urlmon/ - URL Moniker allows binding to a URL (like KIO/gnome-vfs) + urlmon/ - URL Moniker allows binding to a URL user/ - Window management, standard controls, etc. + usp10/ - Uniscribe Script Processor uxtheme/ - Theme library vdhcp.vxd/ - VDHCP VxD implementation vdmdbg/ - Virtual DOS machine debug library @@ -149,7 +156,7 @@ win32s/ - 32-bit function access for 16-bit systems winaspi/ - 16 bit Advanced SCSI Peripheral Interface wined3d/ - Wine internal Direct3D helper - winedos/ - DOS features and BIOS calls (interrupts) (wine specific) + winedos/ - DOS features and BIOS calls (Wine specific) wineps/ - Postscript driver (Wine specific) wininet/ - Internet extensions winmm/ - Multimedia (16 & 32 bit) @@ -159,7 +166,6 @@ winmm/mcicda/ - MCI audio CD driver winmm/mciseq/ - MCI MIDI driver winmm/mciwave/ - MCI wave driver - winmm/midimap/ - MIDI mapper winmm/wavemap/ - Audio mapper winmm/winealsa/ - ALSA audio driver winmm/winearts/ - aRts audio driver @@ -218,10 +224,9 @@ dlls/dxerr8/ - DirectX 8 error import lib dlls/dxerr9/ - DirectX 9 error import lib dlls/dxguid/ - DirectX UUID import lib - dlls/strmiids/ - Exports class (CLSIDs) and interface (IIDs) identifiers + dlls/strmiids/ - Exports class CLSIDs and interface IIDs dlls/uuid/ - Windows-compatible UUID import lib documentation/ - some documentation - documentation/samples/ - sample configuration files include/ - Windows standard includes include/msvcrt/ - MSVC compatible libc headers include/wine/ - Wine specific headers diff -urN wine-20050725/Make.rules.in wine-20050830/Make.rules.in --- wine-20050725/Make.rules.in 2005-07-20 19:48:26.000000000 +0200 +++ wine-20050830/Make.rules.in 2005-08-11 19:12:19.000000000 +0200 @@ -17,6 +17,7 @@ # SUBDIRS : subdirectories that contain a Makefile # EXTRASUBDIRS : subdirectories that do not contain a Makefile # INSTALLSUBDIRS : subdirectories to run make install/uninstall into +# MODCFLAGS : extra CFLAGS for this module # First some useful definitions @@ -47,6 +48,7 @@ AS = @AS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +PRELINK = @PRELINK@ RM = rm -f MV = mv LINT = @LINT@ @@ -54,7 +56,7 @@ FONTFORGE = @FONTFORGE@ INCLUDES = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL) EXTRACFLAGS = @EXTRACFLAGS@ -ALLCFLAGS = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) +ALLCFLAGS = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS) ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS) IDLFLAGS = $(INCLUDES) $(DEFS) $(EXTRAIDLFLAGS) MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755 diff -urN wine-20050725/Makefile.in wine-20050830/Makefile.in --- wine-20050725/Makefile.in 2005-06-15 20:12:15.000000000 +0200 +++ wine-20050830/Makefile.in 2005-08-03 21:15:03.000000000 +0200 @@ -5,6 +5,7 @@ # distclean: also remove all files created by configure # test: run tests # testclean: clean test results to force running all tests again +# crosstest: build tests as native windows applications (requires MinGW) # install-lib: install libraries needed to run applications # install-dev: install development environment # install: install everything diff -urN wine-20050725/VERSION wine-20050830/VERSION --- wine-20050725/VERSION 2005-07-25 14:22:05.000000000 +0200 +++ wine-20050830/VERSION 2005-08-30 12:58:42.000000000 +0200 @@ -1 +1 @@ -Wine version 20050725 +Wine version 20050830 diff -urN wine-20050725/configure wine-20050830/configure --- wine-20050725/configure 2005-07-25 14:22:05.000000000 +0200 +++ wine-20050830/configure 2005-08-30 12:58:42.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 20050725. +# Generated by GNU Autoconf 2.59 for Wine 20050830. # # Report bugs to . # @@ -269,8 +269,8 @@ # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='20050725' -PACKAGE_STRING='Wine 20050725' +PACKAGE_VERSION='20050830' +PACKAGE_STRING='Wine 20050830' PACKAGE_BUGREPORT='wine-devel@winehq.org' ac_unique_file="server/atom.c" @@ -311,8 +311,8 @@ # 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 LIBPTHREAD XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS GLUT_LIBS GLUT32FILES NASLIBS CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS LCMSLIBS LDAPLIBS ft_devel ft_devel2 FREETYPELIBS FREETYPEINCL FONTSSUBDIRS ARTSCCONFIG ARTSLIBS ARTSINCL ALSALIBS AUDIOIOLIBS EXTRACFLAGS 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 ALLOCA LIBOBJS LTLIBOBJS' -ac_subst_files='MAKE_RULES MAKE_DLL_RULES MAKE_TEST_RULES MAKE_LIB_RULES MAKE_PROG_RULES' +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_files='MAKE_RULES MAKE_DLL_RULES MAKE_IMPLIB_RULES MAKE_TEST_RULES MAKE_LIB_RULES MAKE_PROG_RULES' # Initialize some variables set by options. ac_init_help= @@ -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 20050725 to adapt to many kinds of systems. +\`configure' configures Wine 20050830 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 20050725:";; + short | recursive ) echo "Configuration of Wine 20050830:";; esac cat <<\_ACEOF @@ -984,7 +984,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -Wine configure 20050725 +Wine configure 20050830 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 20050725, which was +It was created by Wine $as_me 20050830, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -5640,6 +5640,93 @@ done test -n "$FONTFORGE" || FONTFORGE="false" +for ac_prog in pkg-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$PKG_CONFIG"; then + ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PKG_CONFIG="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +PKG_CONFIG=$ac_cv_prog_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$PKG_CONFIG" && break +done +test -n "$PKG_CONFIG" || PKG_CONFIG="false" + + +case $host_cpu in + *i[3456789]86*) + for ac_prog in prelink +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_PRELINK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$PRELINK"; then + ac_cv_prog_PRELINK="$PRELINK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /sbin /usr/sbin $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PRELINK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +PRELINK=$ac_cv_prog_PRELINK +if test -n "$PRELINK"; then + echo "$as_me:$LINENO: result: $PRELINK" >&5 +echo "${ECHO_T}$PRELINK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$PRELINK" && break +done +test -n "$PRELINK" || PRELINK="false" + + ;; +esac @@ -5789,181 +5876,6 @@ fi -for ac_func in iswalnum -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - 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 - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - -echo "$as_me:$LINENO: checking for iswalnum in -lw" >&5 -echo $ECHO_N "checking for iswalnum in -lw... $ECHO_C" >&6 -if test "${ac_cv_lib_w_iswalnum+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lw $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 iswalnum (); -int -main () -{ -iswalnum (); - ; - 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_w_iswalnum=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_w_iswalnum=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_w_iswalnum" >&5 -echo "${ECHO_T}$ac_cv_lib_w_iswalnum" >&6 -if test $ac_cv_lib_w_iswalnum = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBW 1 -_ACEOF - - LIBS="-lw $LIBS" - -fi - -fi -done - - for ac_func in gethostbyname do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -6776,7 +6688,7 @@ fi - +XLIB="" XFILES="" @@ -6787,6 +6699,7 @@ OPENGL_LIBS="" + echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then @@ -7113,13 +7026,28 @@ + + + + + + + + + + + for ac_header in \ IOKit/IOKitLib.h \ + alsa/asoundlib.h \ arpa/inet.h \ arpa/nameser.h \ asm/types.h \ + capi20.h \ cups/cups.h \ + curses.h \ direct.h \ + dlfcn.h \ elf.h \ float.h \ fontconfig/fontconfig.h \ @@ -7130,10 +7058,12 @@ jack/jack.h \ jpeglib.h \ lber.h \ - lcms/lcms.h \ lcms.h \ + lcms/lcms.h \ ldap.h \ + libaudioio.h \ link.h \ + linux/capi.h \ linux/cdrom.h \ linux/compiler.h \ linux/hdreg.h \ @@ -7147,7 +7077,9 @@ mach/machine.h \ machine/cpu.h \ machine/limits.h \ + machine/soundcard.h \ mntent.h \ + ncurses.h \ netdb.h \ netinet/in.h \ netinet/in_systm.h \ @@ -7160,19 +7092,22 @@ pwd.h \ regex.h \ sched.h \ - scsi/sg.h \ scsi/scsi.h \ scsi/scsi_ioctl.h \ + scsi/sg.h \ + soundcard.h \ stdint.h \ strings.h \ + sys/asoundlib.h \ sys/cdio.h \ sys/elf32.h \ - sys/errno.h \ sys/epoll.h \ + sys/errno.h \ sys/exec_elf.h \ sys/filio.h \ sys/ioctl.h \ sys/ipc.h \ + sys/limits.h \ sys/link.h \ sys/lwp.h \ sys/mman.h \ @@ -7187,7 +7122,7 @@ sys/signal.h \ sys/socket.h \ sys/sockio.h \ - sys/statfs.h \ + sys/soundcard.h \ sys/statvfs.h \ sys/strtio.h \ sys/syscall.h \ @@ -7196,11 +7131,11 @@ sys/times.h \ sys/uio.h \ sys/un.h \ - sys/vfs.h \ sys/vm86.h \ sys/wait.h \ syscall.h \ termios.h \ + unicode/ubidi.h \ unistd.h \ utime.h \ valgrind/memcheck.h @@ -7419,172 +7354,29 @@ CPPFLAGS="$CPPFLAGS $X_CFLAGS" -for ac_header in X11/Xlib.h + + + + + + + + + +for ac_header in X11/Xlib.h \ + X11/XKBlib.h \ + X11/Xutil.h \ + X11/extensions/shape.h \ + X11/extensions/XInput.h \ + X11/extensions/XShm.h \ + X11/extensions/Xrandr.h \ + X11/extensions/Xrender.h \ + X11/extensions/xf86dga.h \ + X11/extensions/xf86vmode.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - 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 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#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 - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to wine-devel@winehq.org ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -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 - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - - - - - - - - - - -for ac_header in X11/XKBlib.h \ - X11/Xutil.h \ - X11/extensions/shape.h \ - X11/extensions/XInput.h \ - X11/extensions/XShm.h \ - X11/extensions/Xrandr.h \ - X11/extensions/Xrender.h \ - X11/extensions/xf86dga.h \ - X11/extensions/xf86vmode.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 +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 @@ -7594,10 +7386,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - #ifdef HAVE_X11_XUTIL_H - # include - #endif +#ifdef HAVE_X11_XLIB_H +# include +#endif +#ifdef HAVE_X11_XUTIL_H +# include +#endif #include <$ac_header> _ACEOF @@ -8149,37 +7943,29 @@ fi - -fi - -done - if test "x$with_opengl" != "xno" then -for ac_header in GL/gl.h GL/glx.h + +for ac_header in GL/gl.h GL/glx.h GL/glext.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 +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 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#ifdef HAVE_GL_GLX_H +# include +#endif + #include <$ac_header> _ACEOF rm -f conftest.$ac_objext @@ -8203,221 +7989,78 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no +eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +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 -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF +fi + +done + + if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes" + then + echo "$as_me:$LINENO: checking for up-to-date OpenGL version" >&5 +echo $ECHO_N "checking for up-to-date OpenGL version... $ECHO_C" >&6 +if test "${wine_cv_opengl_version_OK+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. */ -#include <$ac_header> +#include +int +main () +{ +GLenum test = GL_UNSIGNED_SHORT_5_6_5; + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + (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 + wine_cv_opengl_version_OK="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no +wine_cv_opengl_version_OK="no" + fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to wine-devel@winehq.org ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -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 - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes" - then - -for ac_header in GL/glext.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. */ -#include - -#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 - -fi - -done - - echo "$as_me:$LINENO: checking for up-to-date OpenGL version" >&5 -echo $ECHO_N "checking for up-to-date OpenGL version... $ECHO_C" >&6 -if test "${wine_cv_opengl_version_OK+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. */ -#include -int -main () -{ -GLenum test = GL_UNSIGNED_SHORT_5_6_5; - ; - return 0; -} -_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 - wine_cv_opengl_version_OK="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -wine_cv_opengl_version_OK="no" - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $wine_cv_opengl_version_OK" >&5 @@ -8949,11 +8592,19 @@ X_LIBS="" fi -CURSESLIBS="" -if test "x$with_curses" != "xno" + +XML2LIBS="" + +XML2INCL="" + +if test "$PKG_CONFIG" != "false" then + ac_save_CPPFLAGS="$CPPFLAGS" + ac_xml_libs="`$PKG_CONFIG --libs libxml-2.0`" + ac_xml_cflags="`$PKG_CONFIG --cflags libxml-2.0`" + CPPFLAGS="$CPPFLAGS $ac_xml_cflags" -for ac_header in ncurses.h +for ac_header in libxml/parser.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -9096,13 +8747,13 @@ cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - echo "$as_me:$LINENO: checking for waddch in -lncurses" >&5 -echo $ECHO_N "checking for waddch in -lncurses... $ECHO_C" >&6 -if test "${ac_cv_lib_ncurses_waddch+set}" = set; then + echo "$as_me:$LINENO: checking for xmlParseMemory in -lxml2" >&5 +echo $ECHO_N "checking for xmlParseMemory in -lxml2... $ECHO_C" >&6 +if test "${ac_cv_lib_xml2_xmlParseMemory+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lncurses $LIBS" +LIBS="-lxml2 $ac_xml_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9116,11 +8767,11 @@ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char waddch (); +char xmlParseMemory (); int main () { -waddch (); +xmlParseMemory (); ; return 0; } @@ -9146,55 +8797,61 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_ncurses_waddch=yes + ac_cv_lib_xml2_xmlParseMemory=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ncurses_waddch=no +ac_cv_lib_xml2_xmlParseMemory=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_ncurses_waddch" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_waddch" >&6 -if test $ac_cv_lib_ncurses_waddch = yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlParseMemory" >&5 +echo "${ECHO_T}$ac_cv_lib_xml2_xmlParseMemory" >&6 +if test $ac_cv_lib_xml2_xmlParseMemory = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBNCURSES 1 +#define HAVE_LIBXML2 1 _ACEOF - CURSESLIBS="-lncurses" -else + XML2LIBS="$ac_xml_libs" + XML2INCL="$ac_xml_cflags" +fi -for ac_header in curses.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - 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 "$as_me:$LINENO: checking for xmlReadMemory in -lxml2" >&5 +echo $ECHO_N "checking for xmlReadMemory in -lxml2... $ECHO_C" >&6 +if test "${ac_cv_lib_xml2_xmlReadMemory+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxml2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + +/* 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 xmlReadMemory (); +int +main () +{ +xmlReadMemory (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +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 @@ -9207,111 +8864,121 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { 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_header_compiler=yes + ac_cv_lib_xml2_xmlReadMemory=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no +ac_cv_lib_xml2_xmlReadMemory=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +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_xml2_xmlReadMemory" >&5 +echo "${ECHO_T}$ac_cv_lib_xml2_xmlReadMemory" >&6 +if test $ac_cv_lib_xml2_xmlReadMemory = yes; then -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >>confdefs.h <<\_ACEOF +#define HAVE_XMLREADMEMORY 1 +_ACEOF + +fi + + +fi + +done + + CPPFLAGS="$ac_save_CPPFLAGS" +fi + +CURSESLIBS="" +if test "x$with_curses" != "xno" +then + if test "$ac_cv_header_ncurses_h" = "yes" + then + echo "$as_me:$LINENO: checking for waddch in -lncurses" >&5 +echo $ECHO_N "checking for waddch in -lncurses... $ECHO_C" >&6 +if test "${ac_cv_lib_ncurses_waddch+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + +/* 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 waddch (); +int +main () +{ +waddch (); + ; + 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + (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_ncurses_waddch=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no +ac_cv_lib_ncurses_waddch=no fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to wine-devel@winehq.org ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -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 - eval "$as_ac_Header=\$ac_header_preproc" +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: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_waddch" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_waddch" >&6 +if test $ac_cv_lib_ncurses_waddch = yes; then -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBNCURSES 1 _ACEOF - echo "$as_me:$LINENO: checking for waddch in -lcurses" >&5 + + CURSESLIBS="-lncurses" +fi + + elif test "$ac_cv_header_curses_h" = "yes" + then + echo "$as_me:$LINENO: checking for waddch in -lcurses" >&5 echo $ECHO_N "checking for waddch in -lcurses... $ECHO_C" >&6 if test "${ac_cv_lib_curses_waddch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9380,19 +9047,10 @@ #define HAVE_LIBCURSES 1 _ACEOF - CURSESLIBS="-lcurses" -fi - -fi - -done - -fi - + CURSESLIBS="-lcurses" fi -done - + fi fi @@ -9432,11 +9090,12 @@ echo "${ECHO_T}no" >&6 fi -if test "$sane_devel" = "no" +SANELIBS="" + +SANEINCL="" + +if test "$sane_devel" != "no" then - SANELIBS="" - SANEINCL="" -else SANELIBS="`$sane_devel --libs`" SANEINCL="`$sane_devel --cflags`" ac_save_CPPFLAGS="$CPPFLAGS" @@ -9664,36 +9323,33 @@ CPPFLAGS="$ac_save_CPPFLAGS" fi - - - -for ac_header in unicode/ubidi.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - 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 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF +if test "$ac_cv_header_unicode_ubidi_h" = "yes" +then + saved_libs="$LIBS" + ICU_LIB_DIR="${ICU_LIB_DIR-/usr/lib}" + ICUUC_LIB="${ICUUC_LIB-$ICU_LIB_DIR/libsicuuc.a}" + ICUDATA_LIB="${ICUDATA_LIB-$ICU_LIB_DIR/libsicudata.a}" + echo "$as_me:$LINENO: checking whether can link with ICU libraries $ICUUC_LIB and $ICUDATA_LIB" >&5 +echo $ECHO_N "checking whether can link with ICU libraries $ICUUC_LIB and $ICUDATA_LIB... $ECHO_C" >&6 + LIBS="$LIBS $ICUUC_LIB $ICUDATA_LIB -lstdc++ -lgcc_s" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#include +int +main () +{ +ubidi_open() + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +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 @@ -9706,241 +9362,93 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { 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_header_compiler=yes + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ICU 1 +_ACEOF + + ICULIBS="$ICUUC_LIB $ICUDATA_LIB -lstdc++ -lgcc_s" + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$saved_libs" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +LCMSLIBS="" + +if test "$ac_cv_header_lcms_h" = "yes" -o "$ac_cv_header_lcms_lcms_h" = "yes" +then + echo "$as_me:$LINENO: checking for cmsOpenProfileFromFile in -llcms" >&5 +echo $ECHO_N "checking for cmsOpenProfileFromFile in -llcms... $ECHO_C" >&6 +if test "${ac_cv_lib_lcms_cmsOpenProfileFromFile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llcms $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> + +/* 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 cmsOpenProfileFromFile (); +int +main () +{ +cmsOpenProfileFromFile (); + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + (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_lcms_cmsOpenProfileFromFile=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to wine-devel@winehq.org ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -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 - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -if test "$ac_cv_header_unicode_ubidi_h" = "yes" -then - saved_libs="$LIBS" - ICU_LIB_DIR="${ICU_LIB_DIR-/usr/lib}" - ICUUC_LIB="${ICUUC_LIB-$ICU_LIB_DIR/libsicuuc.a}" - ICUDATA_LIB="${ICUDATA_LIB-$ICU_LIB_DIR/libsicudata.a}" - echo "$as_me:$LINENO: checking whether can link with ICU libraries $ICUUC_LIB and $ICUDATA_LIB" >&5 -echo $ECHO_N "checking whether can link with ICU libraries $ICUUC_LIB and $ICUDATA_LIB... $ECHO_C" >&6 - LIBS="$LIBS $ICUUC_LIB $ICUDATA_LIB -lstdc++ -lgcc_s" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -ubidi_open() - ; - 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 - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ICU 1 -_ACEOF - - ICULIBS="$ICUUC_LIB $ICUDATA_LIB -lstdc++ -lgcc_s" - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$saved_libs" -fi - -LCMSLIBS="" - -if test "$ac_cv_header_lcms_h" = "yes" -o "$ac_cv_header_lcms_lcms_h" = "yes" -then - echo "$as_me:$LINENO: checking for cmsOpenProfileFromFile in -llcms" >&5 -echo $ECHO_N "checking for cmsOpenProfileFromFile in -llcms... $ECHO_C" >&6 -if test "${ac_cv_lib_lcms_cmsOpenProfileFromFile+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-llcms $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 cmsOpenProfileFromFile (); -int -main () -{ -cmsOpenProfileFromFile (); - ; - 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_lcms_cmsOpenProfileFromFile=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_lcms_cmsOpenProfileFromFile=no +ac_cv_lib_lcms_cmsOpenProfileFromFile=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -10103,6 +9611,10 @@ fi +FREETYPELIBS="" + +FREETYPEINCL="" + echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5 echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6 if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then @@ -10174,8 +9686,6 @@ if test "$ft_lib" = "no" then - FREETYPELIBS="" - FREETYPEINCL="" wine_cv_msg_freetype=no else # Extract the first word of "freetype-config", so it can be a program name with args. @@ -10259,8 +9769,6 @@ fi if test "$ft_devel" = "no" then - FREETYPELIBS="" - FREETYPEINCL="" wine_cv_msg_freetype=yes else FREETYPELIBS=`$ft_devel --libs` @@ -10404,8 +9912,6 @@ fi fi - - if test "$FONTFORGE" != "false" -a -n "$FREETYPELIBS" then FONTSSUBDIRS="fonts" @@ -10911,195 +10417,89 @@ LIBS="$ac_save_LIBS" +# Extract the first word of "artsc-config", so it can be a program name with args. +set dummy artsc-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ARTSCCONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ARTSCCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ARTSCCONFIG="$ARTSCCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ARTSCCONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; +esac +fi +ARTSCCONFIG=$ac_cv_path_ARTSCCONFIG +if test -n "$ARTSCCONFIG"; then + echo "$as_me:$LINENO: result: $ARTSCCONFIG" >&5 +echo "${ECHO_T}$ARTSCCONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -for ac_header in sys/soundcard.h machine/soundcard.h soundcard.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - 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 +if test x$ARTSCCONFIG != x -a x$ARTSCCONFIG != x'"$ARTSCCONFIG"'; +then + ARTSC_CFLAGS="" + for i in `$ARTSCCONFIG --cflags` + do + case "$i" in + -I*) ARTSC_CFLAGS="$ARTSC_CFLAGS $i";; + esac + done + ARTSC_LIBS=`$ARTSCCONFIG --libs` + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $ARTSC_CFLAGS" + echo "$as_me:$LINENO: checking for arts_init in -lartsc" >&5 +echo $ECHO_N "checking for arts_init in -lartsc... $ECHO_C" >&6 +if test "${ac_cv_lib_artsc_arts_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lartsc $ARTSC_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#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 - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to wine-devel@winehq.org ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -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 - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - break -fi - -done - - -echo "$as_me:$LINENO: checking for Open Sound System" >&5 -echo $ECHO_N "checking for Open Sound System... $ECHO_C" >&6 -if test "${ac_cv_c_opensoundsystem+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. */ - - #if defined(HAVE_SYS_SOUNDCARD_H) - #include - #elif defined(HAVE_MACHINE_SOUNDCARD_H) - #include - #elif defined(HAVE_SOUNDCARD_H) - #include - #endif +/* 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 arts_init (); int main () { - - -/* check for one of the Open Sound System specific SNDCTL_ defines */ -#if !defined(SNDCTL_DSP_STEREO) -#error No open sound system -#endif - +arts_init (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +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 @@ -11112,63 +10512,37 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { 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_opensoundsystem="yes" + ac_cv_lib_artsc_arts_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_opensoundsystem="no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_lib_artsc_arts_init=no fi -echo "$as_me:$LINENO: result: $ac_cv_c_opensoundsystem" >&5 -echo "${ECHO_T}$ac_cv_c_opensoundsystem" >&6 - -if test "$ac_cv_c_opensoundsystem" = "yes" -then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_OSS 1 -_ACEOF - +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - -echo "$as_me:$LINENO: checking for Open Sound System/MIDI interface" >&5 -echo $ECHO_N "checking for Open Sound System/MIDI interface... $ECHO_C" >&6 -if test "${ac_cv_c_opensoundsystem_midi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +echo "$as_me:$LINENO: result: $ac_cv_lib_artsc_arts_init" >&5 +echo "${ECHO_T}$ac_cv_lib_artsc_arts_init" >&6 +if test $ac_cv_lib_artsc_arts_init = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - - #if defined(HAVE_SYS_SOUNDCARD_H) - #include - #elif defined(HAVE_MACHINE_SOUNDCARD_H) - #include - #elif defined(HAVE_SOUNDCARD_H) - #include - #endif - +#include int main () { - - -/* check for one of the Open Sound System specific SNDCTL_SEQ defines */ -#if !defined(SNDCTL_SEQ_SYNC) -#error No open sound system MIDI interface -#endif - +arts_stream_t stream; ; return 0; } @@ -11194,37 +10568,36 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_c_opensoundsystem_midi="yes" + ARTSLIBS=$ARTSC_LIBS + + ARTSINCL=$ARTSC_CFLAGS + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ARTS 1 +_ACEOF + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_opensoundsystem_midi="no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_opensoundsystem_midi" >&5 -echo "${ECHO_T}$ac_cv_c_opensoundsystem_midi" >&6 - -if test "$ac_cv_c_opensoundsystem_midi" = "yes" -then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_OSS_MIDI 1 -_ACEOF + CFLAGS="$save_CFLAGS" fi -# Extract the first word of "artsc-config", so it can be a program name with args. -set dummy artsc-config; ac_word=$2 +# Extract the first word of "esd-config", so it can be a program name with args. +set dummy esd-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_ARTSCCONFIG+set}" = set; then +if test "${ac_cv_path_ESDCONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $ARTSCCONFIG in + case $ESDCONFIG in [\\/]* | ?:[\\/]*) - ac_cv_path_ARTSCCONFIG="$ARTSCCONFIG" # Let the user override the test with a path. + ac_cv_path_ESDCONFIG="$ESDCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11234,7 +10607,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ARTSCCONFIG="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_ESDCONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11244,35 +10617,35 @@ ;; esac fi -ARTSCCONFIG=$ac_cv_path_ARTSCCONFIG +ESDCONFIG=$ac_cv_path_ESDCONFIG -if test -n "$ARTSCCONFIG"; then - echo "$as_me:$LINENO: result: $ARTSCCONFIG" >&5 -echo "${ECHO_T}$ARTSCCONFIG" >&6 +if test -n "$ESDCONFIG"; then + echo "$as_me:$LINENO: result: $ESDCONFIG" >&5 +echo "${ECHO_T}$ESDCONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi -if test x$ARTSCCONFIG != x -a x$ARTSCCONFIG != x'"$ARTSCCONFIG"'; +if test x$ESDCONFIG != x -a x$ESDCONFIG != x'"$ESDCONFIG"'; then - ARTSC_CFLAGS="" - for i in `$ARTSCCONFIG --cflags` + ESD_CFLAGS="" + for i in `$ESDCONFIG --cflags` do case "$i" in - -I*) ARTSC_CFLAGS="$ARTSC_CFLAGS $i";; + -I*) ESD_CFLAGS="$ESD_CFLAGS $i";; esac done - ARTSC_LIBS=`$ARTSCCONFIG --libs` + ESD_LIBS=`$ESDCONFIG --libs` save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ARTSC_CFLAGS" - echo "$as_me:$LINENO: checking for arts_init in -lartsc" >&5 -echo $ECHO_N "checking for arts_init in -lartsc... $ECHO_C" >&6 -if test "${ac_cv_lib_artsc_arts_init+set}" = set; then + CFLAGS="$CFLAGS $ESD_CFLAGS" + echo "$as_me:$LINENO: checking for esd_open_sound in -lesd" >&5 +echo $ECHO_N "checking for esd_open_sound in -lesd... $ECHO_C" >&6 +if test "${ac_cv_lib_esd_esd_open_sound+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lartsc $ARTSC_LIBS $LIBS" +LIBS="-lesd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11286,11 +10659,11 @@ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char arts_init (); +char esd_open_sound (); int main () { -arts_init (); +esd_open_sound (); ; return 0; } @@ -11316,38 +10689,70 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_artsc_arts_init=yes + ac_cv_lib_esd_esd_open_sound=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_artsc_arts_init=no +ac_cv_lib_esd_esd_open_sound=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_artsc_arts_init" >&5 -echo "${ECHO_T}$ac_cv_lib_artsc_arts_init" >&6 -if test $ac_cv_lib_artsc_arts_init = yes; then - cat >conftest.$ac_ext <<_ACEOF +echo "$as_me:$LINENO: result: $ac_cv_lib_esd_esd_open_sound" >&5 +echo "${ECHO_T}$ac_cv_lib_esd_esd_open_sound" >&6 +if test $ac_cv_lib_esd_esd_open_sound = yes; then + ESDLIBS=$ESD_LIBS + + ESDINCL=$ESD_CFLAGS + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ESD 1 +_ACEOF + +fi + + CFLAGS="$save_CFLAGS" +fi + +ALSALIBS="" + +if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes" +then + echo "$as_me:$LINENO: checking for snd_pcm_hw_params_get_access in -lasound" >&5 +echo $ECHO_N "checking for snd_pcm_hw_params_get_access in -lasound... $ECHO_C" >&6 +if test "${ac_cv_lib_asound_snd_pcm_hw_params_get_access+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lasound $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include + +/* 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 snd_pcm_hw_params_get_access (); int main () { -arts_stream_t stream; +snd_pcm_hw_params_get_access (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +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 @@ -11360,59 +10765,44 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { 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 - ARTSLIBS=$ARTSC_LIBS - - ARTSINCL=$ARTSC_CFLAGS - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ARTS 1 -_ACEOF - + ac_cv_lib_asound_snd_pcm_hw_params_get_access=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_asound_snd_pcm_hw_params_get_access=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - CFLAGS="$save_CFLAGS" -fi - -ALSALIBS="" - - - -for ac_header in alsa/asoundlib.h sys/asoundlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - 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 +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: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF +echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_pcm_hw_params_get_access" >&5 +echo "${ECHO_T}$ac_cv_lib_asound_snd_pcm_hw_params_get_access" >&6 +if test $ac_cv_lib_asound_snd_pcm_hw_params_get_access = yes; then + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#ifdef HAVE_ALSA_ASOUNDLIB_H +#include +#elif defined(HAVE_SYS_ASOUNDLIB_H) +#include +#endif +int +main () +{ +int ret = snd_pcm_hw_params_get_access(NULL, NULL) + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -11435,118 +10825,34 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALSA 1 _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + + ALSALIBS="-lasound" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to wine-devel@winehq.org ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -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 - eval "$as_ac_Header=\$ac_header_preproc" +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 fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - break -fi -done -if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes" +AUDIOIOLIBS="" + +if test "$ac_cv_header_libaudioio_h" = "yes" then - echo "$as_me:$LINENO: checking for snd_pcm_hw_params_get_access in -lasound" >&5 -echo $ECHO_N "checking for snd_pcm_hw_params_get_access in -lasound... $ECHO_C" >&6 -if test "${ac_cv_lib_asound_snd_pcm_hw_params_get_access+set}" = set; then + echo "$as_me:$LINENO: checking for AudioIOGetVersion in -laudioio" >&5 +echo $ECHO_N "checking for AudioIOGetVersion in -laudioio... $ECHO_C" >&6 +if test "${ac_cv_lib_audioio_AudioIOGetVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lasound $LIBS" +LIBS="-laudioio $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11560,11 +10866,11 @@ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char snd_pcm_hw_params_get_access (); +char AudioIOGetVersion (); int main () { -snd_pcm_hw_params_get_access (); +AudioIOGetVersion (); ; return 0; } @@ -11590,753 +10896,106 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_asound_snd_pcm_hw_params_get_access=yes + ac_cv_lib_audioio_AudioIOGetVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_asound_snd_pcm_hw_params_get_access=no +ac_cv_lib_audioio_AudioIOGetVersion=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_asound_snd_pcm_hw_params_get_access" >&5 -echo "${ECHO_T}$ac_cv_lib_asound_snd_pcm_hw_params_get_access" >&6 -if test $ac_cv_lib_asound_snd_pcm_hw_params_get_access = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef HAVE_ALSA_ASOUNDLIB_H -#include -#elif defined(HAVE_SYS_ASOUNDLIB_H) -#include -#endif -int -main () -{ -int ret = snd_pcm_hw_params_get_access(NULL, NULL) - ; - return 0; -} -_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 +echo "$as_me:$LINENO: result: $ac_cv_lib_audioio_AudioIOGetVersion" >&5 +echo "${ECHO_T}$ac_cv_lib_audioio_AudioIOGetVersion" >&6 +if test $ac_cv_lib_audioio_AudioIOGetVersion = yes; then + AUDIOIOLIBS="-laudioio" cat >>confdefs.h <<\_ACEOF -#define HAVE_ALSA 1 +#define HAVE_LIBAUDIOIO 1 _ACEOF - ALSALIBS="-lasound" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi fi -AUDIOIOLIBS="" - - -for ac_header in libaudioio.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - 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 +if test "$ac_cv_header_capi20_h" = "yes" -a "$ac_cv_header_linux_capi_h" = "yes" +then + echo "$as_me:$LINENO: checking for capi20_register in -lcapi20" >&5 +echo $ECHO_N "checking for capi20_register in -lcapi20... $ECHO_C" >&6 +if test "${ac_cv_lib_capi20_capi20_register+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#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 - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to wine-devel@winehq.org ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -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 - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -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 AudioIOGetVersion in -laudioio" >&5 -echo $ECHO_N "checking for AudioIOGetVersion in -laudioio... $ECHO_C" >&6 -if test "${ac_cv_lib_audioio_AudioIOGetVersion+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-laudioio $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 AudioIOGetVersion (); -int -main () -{ -AudioIOGetVersion (); - ; - 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_audioio_AudioIOGetVersion=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_audioio_AudioIOGetVersion=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_audioio_AudioIOGetVersion" >&5 -echo "${ECHO_T}$ac_cv_lib_audioio_AudioIOGetVersion" >&6 -if test $ac_cv_lib_audioio_AudioIOGetVersion = yes; then - AUDIOIOLIBS="-laudioio" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBAUDIOIO 1 -_ACEOF - -fi - -fi - -done - - - - -for ac_header in capi20.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - 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 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#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 - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to wine-devel@winehq.org ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -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 - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - - -for ac_header in linux/capi.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - 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 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#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 - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to wine-devel@winehq.org ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -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 - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -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 capi20_register in -lcapi20" >&5 -echo $ECHO_N "checking for capi20_register in -lcapi20... $ECHO_C" >&6 -if test "${ac_cv_lib_capi20_capi20_register+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcapi20 $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 capi20_register (); -int -main () -{ -capi20_register (); - ; - 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_capi20_capi20_register=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_capi20_capi20_register=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_capi20_capi20_register" >&5 -echo "${ECHO_T}$ac_cv_lib_capi20_capi20_register" >&6 -if test $ac_cv_lib_capi20_capi20_register = yes; then - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_CAPI4LINUX 1 -_ACEOF - - -fi - - -fi - -done - - -fi - -done - - - -echo "$as_me:$LINENO: checking whether mmap64 works defined as mmap" >&5 -echo $ECHO_N "checking whether mmap64 works defined as mmap... $ECHO_C" >&6 -if test "${ac_cv_mmap64_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_mmap64_works="no" -else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcapi20 $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #define _FILE_OFFSET_BITS 64 - #include - #include - #include - #include - #include - - int main(int argc,char **argv) { - int fd = open("conftest.map",O_CREAT|O_RDWR,0600); - if (fd == -1) exit(1); - - unlink("conftest.map"); - - write(fd,"test",4); - - if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) && - (errno == EINVAL) - ) { - exit(1); - } - close(fd); - fprintf(stderr,"success!\n"); - exit(0); - } - - +/* 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 capi20_register (); +int +main () +{ +capi20_register (); + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext +rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&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='./conftest$ac_exeext' + (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_mmap64_works="yes" + ac_cv_lib_capi20_capi20_register=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_mmap64_works="no" -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +ac_cv_lib_capi20_capi20_register=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_mmap64_works" >&5 -echo "${ECHO_T}$ac_cv_mmap64_works" >&6 - -if test "$ac_cv_mmap64_works" = "yes" -then +echo "$as_me:$LINENO: result: $ac_cv_lib_capi20_capi20_register" >&5 +echo "${ECHO_T}$ac_cv_lib_capi20_capi20_register" >&6 +if test $ac_cv_lib_capi20_capi20_register = yes; then cat >>confdefs.h <<\_ACEOF -#define _FILE_OFFSET_BITS 64 +#define HAVE_CAPI4LINUX 1 _ACEOF fi +fi + EXTRACFLAGS="" @@ -12708,6 +11367,74 @@ then EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith" fi + + BUILTINFLAG="" + + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + echo "$as_me:$LINENO: checking for builtin wchar inlines" >&5 +echo $ECHO_N "checking for builtin wchar inlines... $ECHO_C" >&6 +if test "${ac_cv_c_builtin_wchar_ctype+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. */ + +int +main () +{ +int iswlower(unsigned short); + ; + return 0; +} +_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 + ac_cv_c_builtin_wchar_ctype=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_builtin_wchar_ctype=yes +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_builtin_wchar_ctype" >&5 +echo "${ECHO_T}$ac_cv_c_builtin_wchar_ctype" >&6 + CFLAGS="$saved_CFLAGS" + if test "$ac_cv_c_builtin_wchar_ctype" = "yes" + then + BUILTINFLAG="" + for builtin in \ + iswalnum iswalpha iswcntrl iswdigit iswgraph iswlower \ + iswprint iswpunct iswspace iswupper iswxdigit towlower towupper + do + BUILTINFLAG="$BUILTINFLAG -fno-builtin-$builtin" + done + fi fi @@ -13136,154 +11863,12 @@ LIBEXT="dll" fi IMPLIBEXT="a" - WIN16_FILES="" - WIN16_INSTALL="" - ;; - *) - -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - 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 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#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 - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to wine-devel@winehq.org ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -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 - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + WIN16_FILES="" + WIN16_INSTALL="" + ;; + *) + if test "$ac_cv_header_dlfcn_h" = "yes" + then for ac_func in dlopen do @@ -13460,12 +12045,9 @@ fi done -else - LIBEXT="a" -fi - -done - + else + LIBEXT="a" + fi if test "$LIBEXT" = "so" then @@ -15576,315 +14158,23 @@ ac_get_soname_save_LIBS=$LIBS LIBS="-lcapi20 $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 capi20_isinstalled (); -int -main () -{ -capi20_isinstalled (); - ; - 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_soname_capi20=`$ac_cv_path_LDD conftest$ac_exeext | grep libcapi20\\.$LIBEXT | sed "s/^.*\(libcapi20\.$LIBEXT[^ ]*\).*$/\1/"` - if test "x$ac_cv_lib_soname_capi20" = "x" - then - ac_cv_lib_soname_capi20="libcapi20.$LIBEXT" - fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_soname_capi20="libcapi20.$LIBEXT" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_get_soname_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_soname_capi20" >&5 -echo "${ECHO_T}$ac_cv_lib_soname_capi20" >&6 -if test "x$ac_cv_lib_soname_capi20" != xNONE -then -cat >>confdefs.h <<_ACEOF -#define SONAME_LIBCAPI20 "$ac_cv_lib_soname_capi20" -_ACEOF -fi -fi - - - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 -if test "${ac_cv_working_alloca_h+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. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - ; - 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_working_alloca_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_working_alloca_h=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 -if test $ac_cv_working_alloca_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 -if test "${ac_cv_func_alloca_works+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 __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - ; - 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_func_alloca_works=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_alloca_works=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - -ALLOCA=alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 -if test "${ac_cv_os_cray+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. */ -#if defined(CRAY) && ! defined(CRAY2) -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif +/* 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 capi20_isinstalled (); int main () { -return f != $ac_func; +capi20_isinstalled (); ; return 0; } @@ -15910,96 +14200,32 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + ac_cv_lib_soname_capi20=`$ac_cv_path_LDD conftest$ac_exeext | grep libcapi20\\.$LIBEXT | sed "s/^.*\(libcapi20\.$LIBEXT[^ ]*\).*$/\1/"` + if test "x$ac_cv_lib_soname_capi20" = "x" + then + ac_cv_lib_soname_capi20="libcapi20.$LIBEXT" + fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" +ac_cv_lib_soname_capi20="libcapi20.$LIBEXT" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_get_soname_save_LIBS fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - +echo "$as_me:$LINENO: result: $ac_cv_lib_soname_capi20" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_capi20" >&6 +if test "x$ac_cv_lib_soname_capi20" != xNONE +then cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 -if test "${ac_cv_c_stack_direction+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} - -int -main () -{ - exit (find_stack_direction () < 0); -} +#define SONAME_LIBCAPI20 "$ac_cv_lib_soname_capi20" _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./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_stack_direction=1 -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 - -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF -fi @@ -16226,7 +14452,9 @@ -for ac_header in sys/mount.h sys/user.h + + +for ac_header in sys/mount.h sys/statfs.h sys/user.h sys/vfs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 @@ -16294,7 +14522,8 @@ -for ac_header in net/if.h net/if_arp.h net/if_dl.h net/if_types.h net/route.h + +for ac_header in net/if.h net/if_arp.h net/if_dl.h net/if_types.h net/route.h netipx/ipx.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 @@ -16490,7 +14719,7 @@ -for ac_header in linux/videodev.h +for ac_header in linux/ipx.h linux/videodev.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 @@ -16557,143 +14786,6 @@ -echo "$as_me:$LINENO: checking for GNU style IPX support" >&5 -echo $ECHO_N "checking for GNU style IPX support... $ECHO_C" >&6 -if test "${ac_cv_c_ipx_gnu+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. */ -#include - #ifdef HAVE_SYS_SOCKET_H - # include - #endif - #include -int -main () -{ -((struct sockaddr_ipx *)0)->sipx_family == AF_IPX - ; - return 0; -} -_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 - ac_cv_c_ipx_gnu="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_ipx_gnu="no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_ipx_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_ipx_gnu" >&6 -if test "$ac_cv_c_ipx_gnu" = "yes" -then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_IPX_GNU 1 -_ACEOF - -fi - -if test "$ac_cv_c_ipx_gnu" = "no" -then - echo "$as_me:$LINENO: checking for linux style IPX support" >&5 -echo $ECHO_N "checking for linux style IPX support... $ECHO_C" >&6 -if test "${ac_cv_c_ipx_linux+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. */ -#include - #ifdef HAVE_SYS_SOCKET_H - # include - #endif - #include - #include -int -main () -{ -((struct sockaddr_ipx *)0)->sipx_family == AF_IPX - ; - return 0; -} -_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 - ac_cv_c_ipx_linux="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_ipx_linux="no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_ipx_linux" >&5 -echo "${ECHO_T}$ac_cv_c_ipx_linux" >&6 - if test "$ac_cv_c_ipx_linux" = "yes" - then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_IPX_LINUX 1 -_ACEOF - - fi -fi - - echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then @@ -17506,9 +15598,9 @@ fi -echo "$as_me:$LINENO: checking whether linux/input.h is for real" >&5 -echo $ECHO_N "checking whether linux/input.h is for real... $ECHO_C" >&6 -if test "${wine_cv_linux_input_h+set}" = set; then +echo "$as_me:$LINENO: checking for struct ff_effect.direction" >&5 +echo $ECHO_N "checking for struct ff_effect.direction... $ECHO_C" >&6 +if test "${ac_cv_member_struct_ff_effect_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -17517,17 +15609,62 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - - #include +#ifdef HAVE_LINUX_INPUT_H +#include +#endif int main () { +static struct ff_effect ac_aggr; +if (ac_aggr.direction) +return 0; + ; + return 0; +} +_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 + ac_cv_member_struct_ff_effect_direction=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - int foo = EVIOCGBIT(EV_ABS,42); - int bar = BTN_PINKIE; - int fortytwo = 42; +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_LINUX_INPUT_H +#include +#endif +int +main () +{ +static struct ff_effect ac_aggr; +if (sizeof ac_aggr.direction) +return 0; ; return 0; } @@ -17553,26 +15690,28 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - wine_cv_linux_input_h=yes + ac_cv_member_struct_ff_effect_direction=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -wine_cv_linux_input_h=no +ac_cv_member_struct_ff_effect_direction=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi -echo "$as_me:$LINENO: result: $wine_cv_linux_input_h" >&5 -echo "${ECHO_T}$wine_cv_linux_input_h" >&6 - if test "$wine_cv_linux_input_h" = "yes" - then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_member_struct_ff_effect_direction" >&5 +echo "${ECHO_T}$ac_cv_member_struct_ff_effect_direction" >&6 +if test $ac_cv_member_struct_ff_effect_direction = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_CORRECT_LINUXINPUT_H 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_FF_EFFECT_DIRECTION 1 _ACEOF - fi + +fi + echo "$as_me:$LINENO: checking for sigaddset" >&5 echo $ECHO_N "checking for sigaddset... $ECHO_C" >&6 @@ -20186,8 +18325,6 @@ ac_config_commands="$ac_config_commands include/wine" - ac_config_commands="$ac_config_commands programs/regedit/tests" - MAKE_RULES=Make.rules @@ -20195,6 +18332,9 @@ MAKE_DLL_RULES=dlls/Makedll.rules +MAKE_IMPLIB_RULES=dlls/Makeimplib.rules + + MAKE_TEST_RULES=dlls/Maketest.rules @@ -20204,7 +18344,7 @@ MAKE_PROG_RULES=programs/Makeprog.rules - ac_config_files="$ac_config_files Make.rules dlls/Makedll.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/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/winemp3/Makefile dlls/msacm/tests/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/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/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/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/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/wined3d/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/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/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/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 @@ -20569,7 +18709,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by Wine $as_me 20050725, which was +This file was extended by Wine $as_me 20050830, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20632,7 +18772,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Wine config.status 20050725 +Wine config.status 20050830 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -20737,6 +18877,7 @@ # Handling of arguments. "Make.rules" ) CONFIG_FILES="$CONFIG_FILES Make.rules" ;; "dlls/Makedll.rules" ) CONFIG_FILES="$CONFIG_FILES dlls/Makedll.rules" ;; + "dlls/Makeimplib.rules" ) CONFIG_FILES="$CONFIG_FILES dlls/Makeimplib.rules" ;; "dlls/Maketest.rules" ) CONFIG_FILES="$CONFIG_FILES dlls/Maketest.rules" ;; "libs/Makelib.rules" ) CONFIG_FILES="$CONFIG_FILES libs/Makelib.rules" ;; "programs/Makeprog.rules" ) CONFIG_FILES="$CONFIG_FILES programs/Makeprog.rules" ;; @@ -20817,6 +18958,9 @@ "dlls/lzexpand/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/lzexpand/tests/Makefile" ;; "dlls/mapi32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mapi32/Makefile" ;; "dlls/mapi32/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mapi32/tests/Makefile" ;; + "dlls/mciavi32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mciavi32/Makefile" ;; + "dlls/mcicda/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mcicda/Makefile" ;; + "dlls/mciseq/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mciseq/Makefile" ;; "dlls/midimap/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/midimap/Makefile" ;; "dlls/mlang/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mlang/Makefile" ;; "dlls/mlang/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mlang/tests/Makefile" ;; @@ -20827,8 +18971,8 @@ "dlls/msacm/imaadp32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msacm/imaadp32/Makefile" ;; "dlls/msacm/msadp32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msacm/msadp32/Makefile" ;; "dlls/msacm/msg711/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msacm/msg711/Makefile" ;; - "dlls/msacm/winemp3/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msacm/winemp3/Makefile" ;; "dlls/msacm/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msacm/tests/Makefile" ;; + "dlls/msacm/winemp3/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msacm/winemp3/Makefile" ;; "dlls/mscms/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mscms/Makefile" ;; "dlls/mscms/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mscms/tests/Makefile" ;; "dlls/msdmo/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msdmo/Makefile" ;; @@ -20849,11 +18993,14 @@ "dlls/msvidc32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msvidc32/Makefile" ;; "dlls/msvideo/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msvideo/Makefile" ;; "dlls/mswsock/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mswsock/Makefile" ;; + "dlls/msxml3/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msxml3/Makefile" ;; + "dlls/msxml3/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msxml3/tests/Makefile" ;; "dlls/netapi32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/netapi32/Makefile" ;; "dlls/netapi32/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/netapi32/tests/Makefile" ;; "dlls/newdev/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/newdev/Makefile" ;; "dlls/ntdll/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ntdll/Makefile" ;; "dlls/ntdll/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ntdll/tests/Makefile" ;; + "dlls/objsel/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/objsel/Makefile" ;; "dlls/odbc32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/odbc32/Makefile" ;; "dlls/odbccp32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/odbccp32/Makefile" ;; "dlls/ole32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ole32/Makefile" ;; @@ -20882,6 +19029,7 @@ "dlls/rsaenh/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/rsaenh/Makefile" ;; "dlls/rsaenh/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/rsaenh/tests/Makefile" ;; "dlls/secur32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/secur32/Makefile" ;; + "dlls/secur32/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/secur32/tests/Makefile" ;; "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" ;; @@ -20905,6 +19053,7 @@ "dlls/urlmon/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/urlmon/tests/Makefile" ;; "dlls/user/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/user/Makefile" ;; "dlls/user/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/user/tests/Makefile" ;; + "dlls/usp10/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/usp10/Makefile" ;; "dlls/uuid/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/uuid/Makefile" ;; "dlls/uxtheme/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/uxtheme/Makefile" ;; "dlls/vdhcp.vxd/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/vdhcp.vxd/Makefile" ;; @@ -20918,6 +19067,7 @@ "dlls/vwin32.vxd/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/vwin32.vxd/Makefile" ;; "dlls/win32s/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/win32s/Makefile" ;; "dlls/winaspi/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winaspi/Makefile" ;; + "dlls/winecrt0/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winecrt0/Makefile" ;; "dlls/wined3d/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/wined3d/Makefile" ;; "dlls/winedos/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winedos/Makefile" ;; "dlls/wineps/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/wineps/Makefile" ;; @@ -20925,16 +19075,13 @@ "dlls/wininet/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/wininet/tests/Makefile" ;; "dlls/winmm/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/Makefile" ;; "dlls/winmm/joystick/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/joystick/Makefile" ;; - "dlls/winmm/mcianim/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/mcianim/Makefile" ;; - "dlls/winmm/mciavi/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/mciavi/Makefile" ;; - "dlls/winmm/mcicda/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/mcicda/Makefile" ;; - "dlls/winmm/mciseq/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/mciseq/Makefile" ;; "dlls/winmm/mciwave/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/mciwave/Makefile" ;; "dlls/winmm/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/tests/Makefile" ;; "dlls/winmm/wavemap/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/wavemap/Makefile" ;; "dlls/winmm/winealsa/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/winealsa/Makefile" ;; "dlls/winmm/winearts/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/winearts/Makefile" ;; "dlls/winmm/wineaudioio/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/wineaudioio/Makefile" ;; + "dlls/winmm/wineesd/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/wineesd/Makefile" ;; "dlls/winmm/winejack/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/winejack/Makefile" ;; "dlls/winmm/winenas/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/winenas/Makefile" ;; "dlls/winmm/wineoss/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/wineoss/Makefile" ;; @@ -21006,7 +19153,6 @@ "dlls/user/resources" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/user/resources" ;; "dlls/wineps/data" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/wineps/data" ;; "include/wine" ) CONFIG_COMMANDS="$CONFIG_COMMANDS include/wine" ;; - "programs/regedit/tests" ) CONFIG_COMMANDS="$CONFIG_COMMANDS programs/regedit/tests" ;; "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -21150,6 +19296,8 @@ s,@LINT@,$LINT,;t t s,@LINTFLAGS@,$LINTFLAGS,;t t s,@FONTFORGE@,$FONTFORGE,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@PRELINK@,$PRELINK,;t t s,@LIBPTHREAD@,$LIBPTHREAD,;t t s,@XLIB@,$XLIB,;t t s,@XFILES@,$XFILES,;t t @@ -21159,6 +19307,8 @@ s,@GLUT_LIBS@,$GLUT_LIBS,;t t s,@GLUT32FILES@,$GLUT32FILES,;t t s,@NASLIBS@,$NASLIBS,;t t +s,@XML2LIBS@,$XML2LIBS,;t t +s,@XML2INCL@,$XML2INCL,;t t s,@CURSESLIBS@,$CURSESLIBS,;t t s,@sane_devel@,$sane_devel,;t t s,@SANELIBS@,$SANELIBS,;t t @@ -21166,17 +19316,21 @@ s,@ICULIBS@,$ICULIBS,;t t s,@LCMSLIBS@,$LCMSLIBS,;t t s,@LDAPLIBS@,$LDAPLIBS,;t t -s,@ft_devel@,$ft_devel,;t t -s,@ft_devel2@,$ft_devel2,;t t s,@FREETYPELIBS@,$FREETYPELIBS,;t t s,@FREETYPEINCL@,$FREETYPEINCL,;t t +s,@ft_devel@,$ft_devel,;t t +s,@ft_devel2@,$ft_devel2,;t t s,@FONTSSUBDIRS@,$FONTSSUBDIRS,;t t s,@ARTSCCONFIG@,$ARTSCCONFIG,;t t s,@ARTSLIBS@,$ARTSLIBS,;t t s,@ARTSINCL@,$ARTSINCL,;t t +s,@ESDCONFIG@,$ESDCONFIG,;t t +s,@ESDLIBS@,$ESDLIBS,;t t +s,@ESDINCL@,$ESDINCL,;t t s,@ALSALIBS@,$ALSALIBS,;t t s,@AUDIOIOLIBS@,$AUDIOIOLIBS,;t t s,@EXTRACFLAGS@,$EXTRACFLAGS,;t t +s,@BUILTINFLAG@,$BUILTINFLAG,;t t s,@DLLEXT@,$DLLEXT,;t t s,@DLLFLAGS@,$DLLFLAGS,;t t s,@DLLIBS@,$DLLIBS,;t t @@ -21201,13 +19355,14 @@ s,@WINE_BINARIES@,$WINE_BINARIES,;t t s,@MAIN_BINARY@,$MAIN_BINARY,;t t s,@LDD@,$LDD,;t t -s,@ALLOCA@,$ALLOCA,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t /@MAKE_RULES@/r $MAKE_RULES s,@MAKE_RULES@,,;t t /@MAKE_DLL_RULES@/r $MAKE_DLL_RULES s,@MAKE_DLL_RULES@,,;t t +/@MAKE_IMPLIB_RULES@/r $MAKE_IMPLIB_RULES +s,@MAKE_IMPLIB_RULES@,,;t t /@MAKE_TEST_RULES@/r $MAKE_TEST_RULES s,@MAKE_TEST_RULES@,,;t t /@MAKE_LIB_RULES@/r $MAKE_LIB_RULES @@ -21802,8 +19957,6 @@ echo "$as_me: creating dlls/wineps/data" >&6;} && mkdir "dlls/wineps/data") ;; include/wine ) test -d "include/wine" || ({ echo "$as_me:$LINENO: creating include/wine" >&5 echo "$as_me: creating include/wine" >&6;} && mkdir "include/wine") ;; - programs/regedit/tests ) test -d "programs/regedit/tests" || ({ echo "$as_me:$LINENO: creating programs/regedit/tests" >&5 -echo "$as_me: creating programs/regedit/tests" >&6;} && mkdir "programs/regedit/tests") ;; esac done _ACEOF @@ -21863,13 +20016,19 @@ echo "*** enable Wine to use TrueType fonts." fi -if test -z "$ALSALIBS" -a -z "$ARTSC_LIBS" -a -z "$AUDIOIOLIBS" -a \ - -z "$ac_cv_lib_soname_jack" -a -z "$NASLIBS" -a \ - "$ac_cv_c_opensoundsystem" = "no" +if test -z "$ALSALIBS" -a \ + -z "$ARTSC_LIBS" -a \ + -z "$AUDIOIOLIBS" -a \ + -z "$NASLIBS" -a \ + -z "$ESD_LIBS" -a \ + -z "$ac_cv_lib_soname_jack" -a \ + "$ac_cv_header_sys_soundcard_h" != "yes" -a \ + "$ac_cv_header_machine_soundcard_h" != "yes" -a \ + "$ac_cv_header_soundcard_h" != "yes" then echo "*** No sound system was found. Windows applications will be silent." echo "*** The currently supported sound systems are:" - echo "*** ALSA, ARTS, AudioIO, Jack, NAS and OSS" + echo "*** ALSA, ARTS, EsounD, AudioIO, Jack, NAS and OSS" fi echo diff -urN wine-20050725/configure.ac wine-20050830/configure.ac --- wine-20050725/configure.ac 2005-07-25 13:12:11.000000000 +0200 +++ wine-20050830/configure.ac 2005-08-25 14:14:13.000000000 +0200 @@ -134,6 +134,13 @@ dnl Check for various programs AC_CHECK_PROGS(FONTFORGE, fontforge, false) +AC_CHECK_PROGS(PKG_CONFIG, pkg-config, false) + +case $host_cpu in + *i[[3456789]]86*) + AC_CHECK_PROGS(PRELINK, prelink, false, [/sbin /usr/sbin $PATH]) + ;; +esac dnl **** Check for some libraries **** @@ -141,8 +148,6 @@ AC_CHECK_LIB(i386,i386_set_ldt) dnl Check for -lossaudio for NetBSD AC_CHECK_LIB(ossaudio,_oss_ioctl) -dnl Check for -lw for Solaris -AC_CHECK_FUNCS(iswalnum,,AC_CHECK_LIB(w,iswalnum)) dnl Check for -lnsl for Solaris AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname)) dnl Check for -lsocket for Solaris @@ -158,25 +163,25 @@ dnl Check for -lpthread AC_CHECK_LIB(pthread,pthread_create,AC_SUBST(LIBPTHREAD,"-lpthread")) -AC_SUBST(XLIB) -AC_SUBST(XFILES) -XFILES="" -AC_SUBST(OPENGLFILES) -OPENGLFILES="" -AC_SUBST(GLU32FILES) -GLU32FILES="" -AC_SUBST(OPENGL_LIBS) -OPENGL_LIBS="" +AC_SUBST(XLIB,"") +AC_SUBST(XFILES,"") +AC_SUBST(OPENGLFILES,"") +AC_SUBST(GLU32FILES,"") +AC_SUBST(OPENGL_LIBS,"") dnl **** Check for header files **** AC_CHECK_HEADERS(\ IOKit/IOKitLib.h \ + alsa/asoundlib.h \ arpa/inet.h \ arpa/nameser.h \ asm/types.h \ + capi20.h \ cups/cups.h \ + curses.h \ direct.h \ + dlfcn.h \ elf.h \ float.h \ fontconfig/fontconfig.h \ @@ -187,10 +192,12 @@ jack/jack.h \ jpeglib.h \ lber.h \ - lcms/lcms.h \ lcms.h \ + lcms/lcms.h \ ldap.h \ + libaudioio.h \ link.h \ + linux/capi.h \ linux/cdrom.h \ linux/compiler.h \ linux/hdreg.h \ @@ -204,7 +211,9 @@ mach/machine.h \ machine/cpu.h \ machine/limits.h \ + machine/soundcard.h \ mntent.h \ + ncurses.h \ netdb.h \ netinet/in.h \ netinet/in_systm.h \ @@ -217,19 +226,22 @@ pwd.h \ regex.h \ sched.h \ - scsi/sg.h \ scsi/scsi.h \ scsi/scsi_ioctl.h \ + scsi/sg.h \ + soundcard.h \ stdint.h \ strings.h \ + sys/asoundlib.h \ sys/cdio.h \ sys/elf32.h \ - sys/errno.h \ sys/epoll.h \ + sys/errno.h \ sys/exec_elf.h \ sys/filio.h \ sys/ioctl.h \ sys/ipc.h \ + sys/limits.h \ sys/link.h \ sys/lwp.h \ sys/mman.h \ @@ -244,7 +256,7 @@ sys/signal.h \ sys/socket.h \ sys/sockio.h \ - sys/statfs.h \ + sys/soundcard.h \ sys/statvfs.h \ sys/strtio.h \ sys/syscall.h \ @@ -253,11 +265,11 @@ sys/times.h \ sys/uio.h \ sys/un.h \ - sys/vfs.h \ sys/vm86.h \ sys/wait.h \ syscall.h \ termios.h \ + unicode/ubidi.h \ unistd.h \ utime.h \ valgrind/memcheck.h @@ -273,21 +285,22 @@ CPPFLAGS="$CPPFLAGS $X_CFLAGS" dnl *** All of the following tests require X11/Xlib.h - AC_CHECK_HEADERS(X11/Xlib.h, - [ - AC_CHECK_HEADERS([X11/XKBlib.h \ - X11/Xutil.h \ - X11/extensions/shape.h \ - X11/extensions/XInput.h \ - X11/extensions/XShm.h \ - X11/extensions/Xrandr.h \ - X11/extensions/Xrender.h \ - X11/extensions/xf86dga.h \ - X11/extensions/xf86vmode.h],,, - [#include - #ifdef HAVE_X11_XUTIL_H - # include - #endif]) + AC_CHECK_HEADERS([X11/Xlib.h \ + X11/XKBlib.h \ + X11/Xutil.h \ + X11/extensions/shape.h \ + X11/extensions/XInput.h \ + X11/extensions/XShm.h \ + X11/extensions/Xrandr.h \ + X11/extensions/Xrender.h \ + X11/extensions/xf86dga.h \ + X11/extensions/xf86vmode.h],,, +[#ifdef HAVE_X11_XLIB_H +# include +#endif +#ifdef HAVE_X11_XUTIL_H +# include +#endif]) dnl *** Check for X keyboard extension if test "$ac_cv_header_X11_XKBlib_h" = "yes" @@ -350,16 +363,17 @@ [Define if Xrender has the XRenderSetPictureTransform function])],, $X_LIBS -lXext -lX11 $X_EXTRA_LIBS) fi - ] - ) dnl *** End of X11/Xlib.h check + dnl *** End of X11/Xlib.h check dnl Check for the presence of OpenGL if test "x$with_opengl" != "xno" then - AC_CHECK_HEADERS(GL/gl.h GL/glx.h) + AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h,,, +[#ifdef HAVE_GL_GLX_H +# include +#endif]) if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes" then - AC_CHECK_HEADERS(GL/glext.h,,,[#include ]) dnl Check for some problems due to old Mesa versions AC_CACHE_CHECK([for up-to-date OpenGL version], wine_cv_opengl_version_OK, AC_TRY_COMPILE( @@ -424,28 +438,51 @@ X_LIBS="" fi +dnl **** Check for libxml2 **** + +AC_SUBST(XML2LIBS,"") +AC_SUBST(XML2INCL,"") +if test "$PKG_CONFIG" != "false" +then + ac_save_CPPFLAGS="$CPPFLAGS" + ac_xml_libs="`$PKG_CONFIG --libs libxml-2.0`" + ac_xml_cflags="`$PKG_CONFIG --cflags libxml-2.0`" + CPPFLAGS="$CPPFLAGS $ac_xml_cflags" + AC_CHECK_HEADERS(libxml/parser.h, + [AC_CHECK_LIB(xml2, xmlParseMemory, + [AC_DEFINE(HAVE_LIBXML2, 1, [Define if you have the libxml2 library]) + 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])]) + ]) + CPPFLAGS="$ac_save_CPPFLAGS" +fi + dnl **** Check which curses lib to use *** CURSESLIBS="" if test "x$with_curses" != "xno" then - AC_CHECK_HEADERS(ncurses.h, - [AC_CHECK_LIB(ncurses,waddch, + if test "$ac_cv_header_ncurses_h" = "yes" + then + AC_CHECK_LIB(ncurses,waddch, [AC_DEFINE(HAVE_LIBNCURSES, 1, [Define if you have the ncurses library (-lncurses)]) - CURSESLIBS="-lncurses"], - [AC_CHECK_HEADERS(curses.h, - [AC_CHECK_LIB(curses,waddch, - [AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have the curses library (-lcurses)]) - CURSESLIBS="-lcurses"])])])]) + CURSESLIBS="-lncurses"]) + elif test "$ac_cv_header_curses_h" = "yes" + then + AC_CHECK_LIB(curses,waddch, + [AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have the curses library (-lcurses)]) + CURSESLIBS="-lcurses"]) + fi fi AC_SUBST(CURSESLIBS) dnl **** Check for SANE **** AC_CHECK_PROG(sane_devel,sane-config,sane-config,no) -if test "$sane_devel" = "no" +AC_SUBST(SANELIBS,"") +AC_SUBST(SANEINCL,"") +if test "$sane_devel" != "no" then - SANELIBS="" - SANEINCL="" -else SANELIBS="`$sane_devel --libs`" SANEINCL="`$sane_devel --cflags`" ac_save_CPPFLAGS="$CPPFLAGS" @@ -462,11 +499,8 @@ LIBS="$ac_save_LIBS" CPPFLAGS="$ac_save_CPPFLAGS" fi -AC_SUBST(SANELIBS) -AC_SUBST(SANEINCL) dnl **** Check for the ICU library **** -AC_CHECK_HEADERS(unicode/ubidi.h) if test "$ac_cv_header_unicode_ubidi_h" = "yes" then saved_libs="$LIBS" @@ -503,11 +537,11 @@ fi dnl **** Check for FreeType 2 **** +AC_SUBST(FREETYPELIBS,"") +AC_SUBST(FREETYPEINCL,"") AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$X_LIBS) if test "$ft_lib" = "no" then - FREETYPELIBS="" - FREETYPEINCL="" wine_cv_msg_freetype=no else AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no) @@ -521,8 +555,6 @@ fi if test "$ft_devel" = "no" then - FREETYPELIBS="" - FREETYPEINCL="" wine_cv_msg_freetype=yes else FREETYPELIBS=`$ft_devel --libs` @@ -561,8 +593,6 @@ fi fi fi -AC_SUBST(FREETYPELIBS) -AC_SUBST(FREETYPEINCL) dnl Only build the fonts dir if we have both freetype and fontforge if test "$FONTFORGE" != "false" -a -n "$FREETYPELIBS" @@ -640,55 +670,6 @@ ) LIBS="$ac_save_LIBS" -dnl **** Check for Open Sound System **** -AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break) - -AC_CACHE_CHECK([for Open Sound System], - ac_cv_c_opensoundsystem, - AC_TRY_COMPILE([ - #if defined(HAVE_SYS_SOUNDCARD_H) - #include - #elif defined(HAVE_MACHINE_SOUNDCARD_H) - #include - #elif defined(HAVE_SOUNDCARD_H) - #include - #endif - ],[ - -/* check for one of the Open Sound System specific SNDCTL_ defines */ -#if !defined(SNDCTL_DSP_STEREO) -#error No open sound system -#endif -],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no")) - -if test "$ac_cv_c_opensoundsystem" = "yes" -then - AC_DEFINE(HAVE_OSS, 1, [Define if you have the Open Sound system]) -fi - -AC_CACHE_CHECK([for Open Sound System/MIDI interface], - ac_cv_c_opensoundsystem_midi, - AC_TRY_COMPILE([ - #if defined(HAVE_SYS_SOUNDCARD_H) - #include - #elif defined(HAVE_MACHINE_SOUNDCARD_H) - #include - #elif defined(HAVE_SOUNDCARD_H) - #include - #endif - ],[ - -/* check for one of the Open Sound System specific SNDCTL_SEQ defines */ -#if !defined(SNDCTL_SEQ_SYNC) -#error No open sound system MIDI interface -#endif -],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no")) - -if test "$ac_cv_c_opensoundsystem_midi" = "yes" -then - AC_DEFINE(HAVE_OSS_MIDI, 1, [Define if you have the Open Sound system (MIDI interface)]) -fi - dnl **** Check for aRts Sound Server **** AC_PATH_PROG(ARTSCCONFIG, artsc-config) if test x$ARTSCCONFIG != x -a x$ARTSCCONFIG != x'"$ARTSCCONFIG"'; @@ -712,9 +693,29 @@ CFLAGS="$save_CFLAGS" fi +dnl **** Check for EsounD **** +AC_PATH_PROG(ESDCONFIG, esd-config) +if test x$ESDCONFIG != x -a x$ESDCONFIG != x'"$ESDCONFIG"'; +then + ESD_CFLAGS="" + for i in `$ESDCONFIG --cflags` + do + case "$i" in + -I*) ESD_CFLAGS="$ESD_CFLAGS $i";; + esac + done + ESD_LIBS=`$ESDCONFIG --libs` + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $ESD_CFLAGS" + AC_CHECK_LIB(esd,esd_open_sound, + [AC_SUBST(ESDLIBS, $ESD_LIBS) + AC_SUBST(ESDINCL, $ESD_CFLAGS) + AC_DEFINE(HAVE_ESD, 1, [Define if you have EsounD sound server])]) + CFLAGS="$save_CFLAGS" +fi + dnl **** Check for ALSA 1.x **** AC_SUBST(ALSALIBS,"") -AC_CHECK_HEADERS(alsa/asoundlib.h sys/asoundlib.h, break) if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes" then AC_CHECK_LIB(asound,snd_pcm_hw_params_get_access, @@ -731,58 +732,18 @@ dnl **** Check for libaudioio (which can be used to get solaris audio support) **** AC_SUBST(AUDIOIOLIBS,"") -AC_CHECK_HEADERS(libaudioio.h, - [AC_CHECK_LIB(audioio,AudioIOGetVersion, +if test "$ac_cv_header_libaudioio_h" = "yes" +then + AC_CHECK_LIB(audioio,AudioIOGetVersion, [AUDIOIOLIBS="-laudioio" - AC_DEFINE(HAVE_LIBAUDIOIO, 1, [Define if you have libaudioIO])])]) + AC_DEFINE(HAVE_LIBAUDIOIO, 1, [Define if you have libaudioIO])]) +fi dnl **** Check for capi4linux **** -AC_CHECK_HEADERS(capi20.h,[ - AC_CHECK_HEADERS(linux/capi.h,[ - AC_CHECK_LIB(capi20,capi20_register,[ - AC_DEFINE(HAVE_CAPI4LINUX,1,[Define if you have capi4linux libs and headers]) - ]) - ]) -]) - -dnl **** Check for broken glibc mmap64 **** - -AC_CACHE_CHECK( [whether mmap64 works defined as mmap], ac_cv_mmap64_works, - AC_TRY_RUN([ - #define _FILE_OFFSET_BITS 64 - #include - #include - #include - #include - #include - - int main(int argc,char **argv) { - int fd = open("conftest.map",O_CREAT|O_RDWR,0600); - if (fd == -1) exit(1); - - unlink("conftest.map"); - - write(fd,"test",4); - - if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) && - (errno == EINVAL) - ) { - exit(1); - } - close(fd); - fprintf(stderr,"success!\n"); - exit(0); - } - - ], - ac_cv_mmap64_works="yes", - ac_cv_mmap64_works="no", - ac_cv_mmap64_works="no") ) - -if test "$ac_cv_mmap64_works" = "yes" +if test "$ac_cv_header_capi20_h" = "yes" -a "$ac_cv_header_linux_capi_h" = "yes" then - AC_DEFINE(_FILE_OFFSET_BITS, 64, [Set this to 64 to enable 64-bit file support on Linux]) + AC_CHECK_LIB(capi20,capi20_register,[AC_DEFINE(HAVE_CAPI4LINUX,1,[Define if you have capi4linux libs and headers])]) fi dnl **** Check for gcc specific options **** @@ -860,6 +821,25 @@ then EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith" fi + + AC_SUBST(BUILTINFLAG,"") + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + AC_CACHE_CHECK([for builtin wchar inlines], ac_cv_c_builtin_wchar_ctype, + AC_TRY_COMPILE([], + [int iswlower(unsigned short);], + [ac_cv_c_builtin_wchar_ctype=no],[ac_cv_c_builtin_wchar_ctype=yes])) + CFLAGS="$saved_CFLAGS" + if test "$ac_cv_c_builtin_wchar_ctype" = "yes" + then + BUILTINFLAG="" + for builtin in \ + iswalnum iswalpha iswcntrl iswdigit iswgraph iswlower \ + iswprint iswpunct iswspace iswupper iswxdigit towlower towupper + do + BUILTINFLAG="$BUILTINFLAG -fno-builtin-$builtin" + done + fi fi dnl **** Check how to define a function in assembly code **** @@ -928,13 +908,16 @@ WIN16_INSTALL="" ;; *) - AC_CHECK_HEADERS(dlfcn.h, - [AC_CHECK_FUNCS(dlopen,, + if test "$ac_cv_header_dlfcn_h" = "yes" + then + AC_CHECK_FUNCS(dlopen,, [AC_CHECK_LIB(dl,dlopen, [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen]) DLLIBS="-ldl"], - [LIBEXT="a"])])], - [LIBEXT="a"]) + [LIBEXT="a"])]) + else + LIBEXT="a" + fi if test "$LIBEXT" = "so" then @@ -1120,7 +1103,6 @@ dnl **** Check for functions **** -AC_FUNC_ALLOCA() AC_CHECK_FUNCS(\ _lwp_create \ _lwp_self \ @@ -1186,13 +1168,13 @@ dnl **** Checks for headers that depend on other ones **** -AC_CHECK_HEADERS(sys/mount.h sys/user.h,,, +AC_CHECK_HEADERS([sys/mount.h sys/statfs.h sys/user.h sys/vfs.h],,, [#include #if HAVE_SYS_PARAM_H # include #endif]) -AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h net/route.h],,, +AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h net/route.h netipx/ipx.h],,, [#include #if HAVE_SYS_SOCKET_H # include @@ -1212,9 +1194,7 @@ AC_CHECK_HEADERS(ucontext.h,,,[#include ]) -dnl **** Check for v4l(2) headers **** - -AC_CHECK_HEADERS(linux/videodev.h,,, +AC_CHECK_HEADERS([linux/ipx.h linux/videodev.h],,, [#ifdef HAVE_SYS_TIME_H #include #endif @@ -1223,44 +1203,6 @@ #include #endif]) -dnl **** Check for IPX headers (currently Linux only) **** - -AC_CACHE_CHECK([for GNU style IPX support], ac_cv_c_ipx_gnu, - AC_TRY_COMPILE( - [#include - #ifdef HAVE_SYS_SOCKET_H - # include - #endif - #include ], - [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX], - [ac_cv_c_ipx_gnu="yes"], - [ac_cv_c_ipx_gnu="no"]) - ) -if test "$ac_cv_c_ipx_gnu" = "yes" -then - AC_DEFINE(HAVE_IPX_GNU, 1, [Define if IPX should use netipx/ipx.h from libc]) -fi - -if test "$ac_cv_c_ipx_gnu" = "no" -then - AC_CACHE_CHECK([for linux style IPX support], ac_cv_c_ipx_linux, - AC_TRY_COMPILE( - [#include - #ifdef HAVE_SYS_SOCKET_H - # include - #endif - #include - #include ], - [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX], - [ac_cv_c_ipx_linux="yes"], - [ac_cv_c_ipx_linux="no"]) - ) - if test "$ac_cv_c_ipx_linux" = "yes" - then - AC_DEFINE(HAVE_IPX_LINUX, 1, [Define if IPX includes are taken from Linux kernel]) - fi -fi - dnl **** Check for types **** AC_C_CONST @@ -1269,25 +1211,10 @@ AC_CHECK_TYPES([sigset_t],,,[#include ]) AC_CHECK_TYPES([request_sense],,,[#include ]) -AC_CACHE_CHECK([whether linux/input.h is for real], - wine_cv_linux_input_h, - AC_TRY_COMPILE([ - #include - ] , [ - int foo = EVIOCGBIT(EV_ABS,42); - int bar = BTN_PINKIE; - int fortytwo = 42; - ], - wine_cv_linux_input_h=yes, - wine_cv_linux_input_h=no, - no - ) - ) - if test "$wine_cv_linux_input_h" = "yes" - then - AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H, 1, - [Define if we have linux/input.h AND it contains the INPUT event API]) - fi +AC_CHECK_MEMBERS([struct ff_effect.direction],,, +[#ifdef HAVE_LINUX_INPUT_H +#include +#endif]) AC_CACHE_CHECK([for sigaddset],wine_cv_have_sigaddset, AC_TRY_LINK([#include ],[sigset_t set; sigaddset(&set,SIGTERM);], @@ -1513,7 +1440,6 @@ WINE_CONFIG_EXTRA_DIR(dlls/user/resources) WINE_CONFIG_EXTRA_DIR(dlls/wineps/data) WINE_CONFIG_EXTRA_DIR(include/wine) -WINE_CONFIG_EXTRA_DIR(programs/regedit/tests) MAKE_RULES=Make.rules AC_SUBST_FILE(MAKE_RULES) @@ -1521,6 +1447,9 @@ MAKE_DLL_RULES=dlls/Makedll.rules AC_SUBST_FILE(MAKE_DLL_RULES) +MAKE_IMPLIB_RULES=dlls/Makeimplib.rules +AC_SUBST_FILE(MAKE_IMPLIB_RULES) + MAKE_TEST_RULES=dlls/Maketest.rules AC_SUBST_FILE(MAKE_TEST_RULES) @@ -1533,6 +1462,7 @@ AC_CONFIG_FILES([ Make.rules dlls/Makedll.rules +dlls/Makeimplib.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules @@ -1613,6 +1543,9 @@ 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 @@ -1623,8 +1556,8 @@ dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile -dlls/msacm/winemp3/Makefile dlls/msacm/tests/Makefile +dlls/msacm/winemp3/Makefile dlls/mscms/Makefile dlls/mscms/tests/Makefile dlls/msdmo/Makefile @@ -1645,11 +1578,14 @@ 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 @@ -1678,6 +1614,7 @@ dlls/rsaenh/Makefile dlls/rsaenh/tests/Makefile dlls/secur32/Makefile +dlls/secur32/tests/Makefile dlls/sensapi/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile @@ -1701,6 +1638,7 @@ dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile +dlls/usp10/Makefile dlls/uuid/Makefile dlls/uxtheme/Makefile dlls/vdhcp.vxd/Makefile @@ -1714,6 +1652,7 @@ dlls/vwin32.vxd/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile +dlls/winecrt0/Makefile dlls/wined3d/Makefile dlls/winedos/Makefile dlls/wineps/Makefile @@ -1721,16 +1660,13 @@ dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile -dlls/winmm/mcianim/Makefile -dlls/winmm/mciavi/Makefile -dlls/winmm/mcicda/Makefile -dlls/winmm/mciseq/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 @@ -1824,13 +1760,19 @@ echo "*** enable Wine to use TrueType fonts." fi -if test -z "$ALSALIBS" -a -z "$ARTSC_LIBS" -a -z "$AUDIOIOLIBS" -a \ - -z "$ac_cv_lib_soname_jack" -a -z "$NASLIBS" -a \ - "$ac_cv_c_opensoundsystem" = "no" +if test -z "$ALSALIBS" -a \ + -z "$ARTSC_LIBS" -a \ + -z "$AUDIOIOLIBS" -a \ + -z "$NASLIBS" -a \ + -z "$ESD_LIBS" -a \ + -z "$ac_cv_lib_soname_jack" -a \ + "$ac_cv_header_sys_soundcard_h" != "yes" -a \ + "$ac_cv_header_machine_soundcard_h" != "yes" -a \ + "$ac_cv_header_soundcard_h" != "yes" then echo "*** No sound system was found. Windows applications will be silent." echo "*** The currently supported sound systems are:" - echo "*** ALSA, ARTS, AudioIO, Jack, NAS and OSS" + echo "*** ALSA, ARTS, EsounD, AudioIO, Jack, NAS and OSS" fi echo diff -urN wine-20050725/dlls/.cvsignore wine-20050830/dlls/.cvsignore --- wine-20050725/dlls/.cvsignore 2002-08-09 03:22:40.000000000 +0200 +++ wine-20050830/dlls/.cvsignore 2005-08-25 14:14:13.000000000 +0200 @@ -1,3 +1,4 @@ Makedll.rules Makefile +Makeimplib.rules Maketest.rules diff -urN wine-20050725/dlls/Makedll.rules.in wine-20050830/dlls/Makedll.rules.in --- wine-20050725/dlls/Makedll.rules.in 2005-05-10 15:21:04.000000000 +0200 +++ wine-20050830/dlls/Makedll.rules.in 2005-08-27 12:33:27.000000000 +0200 @@ -32,7 +32,7 @@ # Rules for .so files $(MODULE).so: $(MAINSPEC) $(ALL_OBJS) Makefile.in - $(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -shared $(SRCDIR)/$(MAINSPEC) $(ALL_OBJS) $(SUBSYSTEM:%=-Wb,--subsystem,%) -o $@ $(DLL_LDPATH) $(ALL_IMPORTS:%=-l%) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS) + $(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -shared $(SRCDIR)/$(MAINSPEC) $(ALL_OBJS) $(SUBSYSTEM:%=-Wb,--subsystem,%) $(BASEADDRESS:%=-Wl,--image-base,%) -o $@ $(DLL_LDPATH) $(ALL_IMPORTS:%=-l%) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS) # Rules for .dll files @@ -67,7 +67,7 @@ $(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) -lm && $(RM) checklink $(MAINSPEC).c $(MAINSPEC).o + $(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 checklink:: $(WIN16_FILES:%=__checklink16__%) @@ -80,7 +80,7 @@ # Rule to explicitly generate the .spec.c 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%) + $(WINEBUILD) $(DEFS) $(DLLFLAGS) --dll -o $@ --export $(SRCDIR)/$(MAINSPEC) $(SUBSYSTEM:%=--subsystem %) $(ALL_OBJS) $(DLL_LDPATH) $(ALL_IMPORTS:%=-l%) $(DELAYIMPORTS:%=-d%) $(DLLDIR)/libwinecrt0.a # Rules for auto documentation diff -urN wine-20050725/dlls/Makefile.in wine-20050830/dlls/Makefile.in --- wine-20050725/dlls/Makefile.in 2005-07-21 13:31:56.000000000 +0200 +++ wine-20050830/dlls/Makefile.in 2005-08-26 10:52:06.000000000 +0200 @@ -70,6 +70,9 @@ kernel \ lzexpand \ mapi32 \ + mciavi32 \ + mcicda \ + mciseq \ midimap \ mlang \ mmdevldr.vxd \ @@ -95,9 +98,11 @@ msvidc32 \ msvideo \ mswsock \ + msxml3 \ netapi32 \ newdev \ ntdll \ + objsel \ odbc32 \ odbccp32 \ ole32 \ @@ -136,6 +141,7 @@ url \ urlmon \ user \ + usp10 \ uxtheme \ vdhcp.vxd \ vdmdbg \ @@ -152,15 +158,12 @@ wininet \ winmm \ winmm/joystick \ - winmm/mcianim \ - winmm/mciavi \ - winmm/mcicda \ - winmm/mciseq \ winmm/mciwave \ winmm/wavemap \ winmm/winealsa \ winmm/winearts \ winmm/wineaudioio \ + winmm/wineesd \ winmm/winejack \ winmm/winenas \ winmm/wineoss \ @@ -174,26 +177,30 @@ wsock32 \ wtsapi32 +IMPLIBSUBDIRS = \ + dxerr8 \ + dxerr9 \ + dxguid \ + strmiids \ + uuid \ + winecrt0 + SUBDIRS = \ $(BASEDIRS) \ + $(IMPLIBSUBDIRS) \ d3d8 \ d3d9 \ d3dx8 \ ddraw \ - dxerr8 \ - dxerr9 \ - dxguid \ glu32 \ glut32 \ opengl32 \ - strmiids \ - uuid \ wined3d \ x11drv BUILDSUBDIRS = $(BASEDIRS) $(EXTRADIRS) -INSTALLSUBDIRS = $(BUILDSUBDIRS) +INSTALLSUBDIRS = $(BUILDSUBDIRS) $(IMPLIBSUBDIRS) @MAKE_RULES@ @@ -312,12 +319,12 @@ libdxguid.a \ libstrmiids.a \ libuuid.a \ + libwinecrt0.a \ lz32.dll.so \ mapi32.dll.so \ - mcianim.drv.so \ - mciavi.drv.so \ - mcicda.drv.so \ - mciseq.drv.so \ + mciavi32.dll.so \ + mcicda.dll.so \ + mciseq.dll.so \ mciwave.drv.so \ midimap.dll.so \ mlang.dll.so \ @@ -343,9 +350,11 @@ msvfw32.dll.so \ msvidc32.dll.so \ mswsock.dll.so \ + msxml3.dll.so \ netapi32.dll.so \ newdev.dll.so \ ntdll.dll.so \ + objsel.dll.so \ odbc32.dll.so \ odbccp32.dll.so \ ole32.dll.so \ @@ -383,6 +392,7 @@ url.dll.so \ urlmon.dll.so \ user32.dll.so \ + usp10.dll.so \ uxtheme.dll.so \ vdhcp.vxd.so \ vdmdbg.dll.so \ @@ -397,6 +407,7 @@ winearts.drv.so \ wineaudioio.drv.so \ winedos.dll.so \ + wineesd.drv.so \ winejack.drv.so \ winemp3.acm.so \ winenas.drv.so \ @@ -641,17 +652,14 @@ mapi32.dll.so: mapi32/mapi32.dll.so $(RM) $@ && $(LN_S) mapi32/mapi32.dll.so $@ -mcianim.drv.so: winmm/mcianim/mcianim.drv.so - $(RM) $@ && $(LN_S) winmm/mcianim/mcianim.drv.so $@ +mciavi32.dll.so: mciavi32/mciavi32.dll.so + $(RM) $@ && $(LN_S) mciavi32/mciavi32.dll.so $@ -mciavi.drv.so: winmm/mciavi/mciavi.drv.so - $(RM) $@ && $(LN_S) winmm/mciavi/mciavi.drv.so $@ +mcicda.dll.so: mcicda/mcicda.dll.so + $(RM) $@ && $(LN_S) mcicda/mcicda.dll.so $@ -mcicda.drv.so: winmm/mcicda/mcicda.drv.so - $(RM) $@ && $(LN_S) winmm/mcicda/mcicda.drv.so $@ - -mciseq.drv.so: winmm/mciseq/mciseq.drv.so - $(RM) $@ && $(LN_S) winmm/mciseq/mciseq.drv.so $@ +mciseq.dll.so: mciseq/mciseq.dll.so + $(RM) $@ && $(LN_S) mciseq/mciseq.dll.so $@ mciwave.drv.so: winmm/mciwave/mciwave.drv.so $(RM) $@ && $(LN_S) winmm/mciwave/mciwave.drv.so $@ @@ -734,6 +742,9 @@ mswsock.dll.so: mswsock/mswsock.dll.so $(RM) $@ && $(LN_S) mswsock/mswsock.dll.so $@ +msxml3.dll.so: msxml3/msxml3.dll.so + $(RM) $@ && $(LN_S) msxml3/msxml3.dll.so $@ + netapi32.dll.so: netapi32/netapi32.dll.so $(RM) $@ && $(LN_S) netapi32/netapi32.dll.so $@ @@ -743,6 +754,9 @@ ntdll.dll.so: ntdll/ntdll.dll.so $(RM) $@ && $(LN_S) ntdll/ntdll.dll.so $@ +objsel.dll.so: objsel/objsel.dll.so + $(RM) $@ && $(LN_S) objsel/objsel.dll.so $@ + odbc32.dll.so: odbc32/odbc32.dll.so $(RM) $@ && $(LN_S) odbc32/odbc32.dll.so $@ @@ -887,6 +901,9 @@ mouse.drv.so user.exe.so : user32.dll.so $(RM) $@ && $(LN_S) user32.dll.so $@ +usp10.dll.so: usp10/usp10.dll.so + $(RM) $@ && $(LN_S) usp10/usp10.dll.so $@ + uxtheme.dll.so: uxtheme/uxtheme.dll.so $(RM) $@ && $(LN_S) uxtheme/uxtheme.dll.so $@ @@ -941,6 +958,9 @@ wprocs.dll.so : winedos.dll.so $(RM) $@ && $(LN_S) winedos.dll.so $@ +wineesd.drv.so: winmm/wineesd/wineesd.drv.so + $(RM) $@ && $(LN_S) winmm/wineesd/wineesd.drv.so $@ + winejack.drv.so: winmm/winejack/winejack.drv.so $(RM) $@ && $(LN_S) winmm/winejack/winejack.drv.so $@ @@ -1031,6 +1051,9 @@ libuuid.a: uuid/libuuid.a $(RM) $@ && $(LN_S) uuid/libuuid.a $@ +libwinecrt0.a: winecrt0/libwinecrt0.a + $(RM) $@ && $(LN_S) winecrt0/libwinecrt0.a $@ + # Import libraries @@ -1044,11 +1067,8 @@ liblz32.$(IMPLIBEXT) \ libmsacm32.$(IMPLIBEXT) \ libmsvfw32.$(IMPLIBEXT) \ - libntdll.$(IMPLIBEXT) \ libolecli32.$(IMPLIBEXT) \ libolesvr32.$(IMPLIBEXT) \ - libriched32.$(IMPLIBEXT) \ - libtwain_32.$(IMPLIBEXT) \ libuser32.$(IMPLIBEXT) \ libw32skrnl.$(IMPLIBEXT) \ libwinnls32.$(IMPLIBEXT) \ @@ -1058,14 +1078,14 @@ libdxerr9.a \ libdxguid.a \ libstrmiids.a \ - libuuid.a + libuuid.a \ + libwinecrt0.a IMPORT_LIBS = \ $(IMPORT_SYMLINKS) \ activeds/libactiveds.$(IMPLIBEXT) \ advapi32/libadvapi32.$(IMPLIBEXT) \ advpack/libadvpack.$(IMPLIBEXT) \ - amstream/libamstream.$(IMPLIBEXT) \ atl/libatl.$(IMPLIBEXT) \ avicap32/libavicap32.$(IMPLIBEXT) \ avifil32/libavifil32.$(IMPLIBEXT) \ @@ -1073,7 +1093,6 @@ capi2032/libcapi2032.$(IMPLIBEXT) \ cards/libcards.$(IMPLIBEXT) \ cfgmgr32/libcfgmgr32.$(IMPLIBEXT) \ - comcat/libcomcat.$(IMPLIBEXT) \ comctl32/libcomctl32.$(IMPLIBEXT) \ commdlg/libcomdlg32.$(IMPLIBEXT) \ crtdll/libcrtdll.$(IMPLIBEXT) \ @@ -1089,35 +1108,21 @@ dbghelp/libdbghelp.$(IMPLIBEXT) \ dciman32/libdciman32.$(IMPLIBEXT) \ ddraw/libddraw.$(IMPLIBEXT) \ - devenum/libdevenum.$(IMPLIBEXT) \ dinput/libdinput.$(IMPLIBEXT) \ dinput/libdinput.$(STATIC_IMPLIBEXT) \ dinput8/libdinput8.$(IMPLIBEXT) \ - dmband/libdmband.$(IMPLIBEXT) \ - dmcompos/libdmcompos.$(IMPLIBEXT) \ - dmime/libdmime.$(IMPLIBEXT) \ - dmloader/libdmloader.$(IMPLIBEXT) \ - dmscript/libdmscript.$(IMPLIBEXT) \ - dmstyle/libdmstyle.$(IMPLIBEXT) \ - dmsynth/libdmsynth.$(IMPLIBEXT) \ - dmusic/libdmusic.$(IMPLIBEXT) \ dmusic32/libdmusic32.$(IMPLIBEXT) \ dplay/libdplay.$(IMPLIBEXT) \ dplayx/libdplayx.$(IMPLIBEXT) \ dpnet/libdpnet.$(IMPLIBEXT) \ - dpnhpast/libdpnhpast.$(IMPLIBEXT) \ dsound/libdsound.$(IMPLIBEXT) \ - dswave/libdswave.$(IMPLIBEXT) \ - dxdiagn/libdxdiagn.$(IMPLIBEXT) \ gdi/libgdi32.$(IMPLIBEXT) \ glu32/libglu32.$(IMPLIBEXT) \ glut32/libglut32.$(IMPLIBEXT) \ - iccvid/libiccvid.$(IMPLIBEXT) \ icmp/libicmp.$(IMPLIBEXT) \ imagehlp/libimagehlp.$(IMPLIBEXT) \ imm32/libimm32.$(IMPLIBEXT) \ iphlpapi/libiphlpapi.$(IMPLIBEXT) \ - itss/libitss.$(IMPLIBEXT) \ kernel/libkernel32.$(IMPLIBEXT) \ lzexpand/liblz32.$(IMPLIBEXT) \ mapi32/libmapi32.$(IMPLIBEXT) \ @@ -1129,14 +1134,11 @@ mshtml/libmshtml.$(IMPLIBEXT) \ msi/libmsi.$(IMPLIBEXT) \ msimg32/libmsimg32.$(IMPLIBEXT) \ - msnet32/libmsnet32.$(IMPLIBEXT) \ - msrle32/libmsrle32.$(IMPLIBEXT) \ msvcrt/libmsvcrt.$(IMPLIBEXT) \ msvcrt20/libmsvcrt20.$(IMPLIBEXT) \ msvcrt40/libmsvcrt40.$(IMPLIBEXT) \ msvcrtd/libmsvcrtd.$(IMPLIBEXT) \ msvideo/libmsvfw32.$(IMPLIBEXT) \ - msvidc32/libmsvidc32.$(IMPLIBEXT) \ mswsock/libmswsock.$(IMPLIBEXT) \ netapi32/libnetapi32.$(IMPLIBEXT) \ newdev/libnewdev.$(IMPLIBEXT) \ @@ -1153,11 +1155,9 @@ opengl32/libopengl32.$(IMPLIBEXT) \ powrprof/libpowrprof.$(IMPLIBEXT) \ psapi/libpsapi.$(IMPLIBEXT) \ - qcap/libqcap.$(IMPLIBEXT) \ quartz/libquartz.$(IMPLIBEXT) \ rasapi32/librasapi32.$(IMPLIBEXT) \ riched20/libriched20.$(IMPLIBEXT) \ - richedit/libriched32.$(IMPLIBEXT) \ rpcrt4/librpcrt4.$(IMPLIBEXT) \ rsabase/librsabase.$(IMPLIBEXT) \ rsaenh/librsaenh.$(IMPLIBEXT) \ @@ -1172,11 +1172,11 @@ snmpapi/libsnmpapi.$(IMPLIBEXT) \ sti/libsti.$(IMPLIBEXT) \ tapi32/libtapi32.$(IMPLIBEXT) \ - twain/libtwain_32.$(IMPLIBEXT) \ unicows/libunicows.$(IMPLIBEXT) \ url/liburl.$(IMPLIBEXT) \ urlmon/liburlmon.$(IMPLIBEXT) \ user/libuser32.$(IMPLIBEXT) \ + usp10/libusp10.$(IMPLIBEXT) \ uxtheme/libuxtheme.$(IMPLIBEXT) \ vdmdbg/libvdmdbg.$(IMPLIBEXT) \ version/libversion.$(IMPLIBEXT) \ @@ -1207,9 +1207,6 @@ advpack/libadvpack.$(IMPLIBEXT): advpack/advpack.spec $(WINEBUILD) @cd advpack && $(MAKE) libadvpack.$(IMPLIBEXT) -amstream/libamstream.$(IMPLIBEXT): amstream/amstream.spec $(WINEBUILD) - @cd amstream && $(MAKE) libamstream.$(IMPLIBEXT) - atl/libatl.$(IMPLIBEXT): atl/atl.spec $(WINEBUILD) @cd atl && $(MAKE) libatl.$(IMPLIBEXT) @@ -1231,9 +1228,6 @@ cfgmgr32/libcfgmgr32.$(IMPLIBEXT): cfgmgr32/cfgmgr32.spec $(WINEBUILD) @cd cfgmgr32 && $(MAKE) libcfgmgr32.$(IMPLIBEXT) -comcat/libcomcat.$(IMPLIBEXT): comcat/comcat.spec $(WINEBUILD) - @cd comcat && $(MAKE) libcomcat.$(IMPLIBEXT) - comctl32/libcomctl32.$(IMPLIBEXT): comctl32/comctl32.spec $(WINEBUILD) @cd comctl32 && $(MAKE) libcomctl32.$(IMPLIBEXT) @@ -1279,9 +1273,6 @@ ddraw/libddraw.$(IMPLIBEXT): ddraw/ddraw.spec $(WINEBUILD) @cd ddraw && $(MAKE) libddraw.$(IMPLIBEXT) -devenum/libdevenum.$(IMPLIBEXT): devenum/devenum.spec $(WINEBUILD) - @cd devenum && $(MAKE) libdevenum.$(IMPLIBEXT) - dinput/libdinput.$(IMPLIBEXT): dinput/dinput.spec $(WINEBUILD) @cd dinput && $(MAKE) libdinput.$(IMPLIBEXT) @@ -1291,30 +1282,6 @@ dinput8/libdinput8.$(IMPLIBEXT): dinput8/dinput8.spec $(WINEBUILD) @cd dinput8 && $(MAKE) libdinput8.$(IMPLIBEXT) -dmband/libdmband.$(IMPLIBEXT): dmband/dmband.spec $(WINEBUILD) - @cd dmband && $(MAKE) libdmband.$(IMPLIBEXT) - -dmcompos/libdmcompos.$(IMPLIBEXT): dmcompos/dmcompos.spec $(WINEBUILD) - @cd dmcompos && $(MAKE) libdmcompos.$(IMPLIBEXT) - -dmime/libdmime.$(IMPLIBEXT): dmime/dmime.spec $(WINEBUILD) - @cd dmime && $(MAKE) libdmime.$(IMPLIBEXT) - -dmloader/libdmloader.$(IMPLIBEXT): dmloader/dmloader.spec $(WINEBUILD) - @cd dmloader && $(MAKE) libdmloader.$(IMPLIBEXT) - -dmscript/libdmscript.$(IMPLIBEXT): dmscript/dmscript.spec $(WINEBUILD) - @cd dmscript && $(MAKE) libdmscript.$(IMPLIBEXT) - -dmstyle/libdmstyle.$(IMPLIBEXT): dmstyle/dmstyle.spec $(WINEBUILD) - @cd dmstyle && $(MAKE) libdmstyle.$(IMPLIBEXT) - -dmsynth/libdmsynth.$(IMPLIBEXT): dmsynth/dmsynth.spec $(WINEBUILD) - @cd dmsynth && $(MAKE) libdmsynth.$(IMPLIBEXT) - -dmusic/libdmusic.$(IMPLIBEXT): dmusic/dmusic.spec $(WINEBUILD) - @cd dmusic && $(MAKE) libdmusic.$(IMPLIBEXT) - dmusic32/libdmusic32.$(IMPLIBEXT): dmusic32/dmusic32.spec $(WINEBUILD) @cd dmusic32 && $(MAKE) libdmusic32.$(IMPLIBEXT) @@ -1327,18 +1294,9 @@ dpnet/libdpnet.$(IMPLIBEXT): dpnet/dpnet.spec $(WINEBUILD) @cd dpnet && $(MAKE) libdpnet.$(IMPLIBEXT) -dpnhpast/libdpnhpast.$(IMPLIBEXT): dpnhpast/dpnhpast.spec $(WINEBUILD) - @cd dpnhpast && $(MAKE) libdpnhpast.$(IMPLIBEXT) - dsound/libdsound.$(IMPLIBEXT): dsound/dsound.spec $(WINEBUILD) @cd dsound && $(MAKE) libdsound.$(IMPLIBEXT) -dswave/libdswave.$(IMPLIBEXT): dswave/dswave.spec $(WINEBUILD) - @cd dswave && $(MAKE) libdswave.$(IMPLIBEXT) - -dxdiagn/libdxdiagn.$(IMPLIBEXT): dxdiagn/dxdiagn.spec $(WINEBUILD) - @cd dxdiagn && $(MAKE) libdxdiagn.$(IMPLIBEXT) - gdi/libgdi32.$(IMPLIBEXT): gdi/gdi32.spec $(WINEBUILD) @cd gdi && $(MAKE) libgdi32.$(IMPLIBEXT) @@ -1348,9 +1306,6 @@ glut32/libglut32.$(IMPLIBEXT): glut32/glut32.spec $(WINEBUILD) @cd glut32 && $(MAKE) libglut32.$(IMPLIBEXT) -iccvid/libiccvid.$(IMPLIBEXT): iccvid/iccvid.spec $(WINEBUILD) - @cd iccvid && $(MAKE) libiccvid.$(IMPLIBEXT) - icmp/libicmp.$(IMPLIBEXT): icmp/icmp.spec $(WINEBUILD) @cd icmp && $(MAKE) libicmp.$(IMPLIBEXT) @@ -1363,9 +1318,6 @@ iphlpapi/libiphlpapi.$(IMPLIBEXT): iphlpapi/iphlpapi.spec $(WINEBUILD) @cd iphlpapi && $(MAKE) libiphlpapi.$(IMPLIBEXT) -itss/libitss.$(IMPLIBEXT): itss/itss.spec $(WINEBUILD) - @cd itss && $(MAKE) libitss.$(IMPLIBEXT) - kernel/libkernel32.$(IMPLIBEXT): kernel/kernel32.spec $(WINEBUILD) @cd kernel && $(MAKE) libkernel32.$(IMPLIBEXT) @@ -1399,12 +1351,6 @@ msimg32/libmsimg32.$(IMPLIBEXT): msimg32/msimg32.spec $(WINEBUILD) @cd msimg32 && $(MAKE) libmsimg32.$(IMPLIBEXT) -msnet32/libmsnet32.$(IMPLIBEXT): msnet32/msnet32.spec $(WINEBUILD) - @cd msnet32 && $(MAKE) libmsnet32.$(IMPLIBEXT) - -msrle32/libmsrle32.$(IMPLIBEXT): msrle32/msrle32.spec $(WINEBUILD) - @cd msrle32 && $(MAKE) libmsrle32.$(IMPLIBEXT) - msvcrt/libmsvcrt.$(IMPLIBEXT): msvcrt/msvcrt.spec $(WINEBUILD) @cd msvcrt && $(MAKE) libmsvcrt.$(IMPLIBEXT) @@ -1420,9 +1366,6 @@ msvideo/libmsvfw32.$(IMPLIBEXT): msvideo/msvfw32.spec $(WINEBUILD) @cd msvideo && $(MAKE) libmsvfw32.$(IMPLIBEXT) -msvidc32/libmsvidc32.$(IMPLIBEXT): msvidc32/msvidc32.spec $(WINEBUILD) - @cd msvidc32 && $(MAKE) libmsvidc32.$(IMPLIBEXT) - mswsock/libmswsock.$(IMPLIBEXT): mswsock/mswsock.spec $(WINEBUILD) @cd mswsock && $(MAKE) libmswsock.$(IMPLIBEXT) @@ -1471,9 +1414,6 @@ psapi/libpsapi.$(IMPLIBEXT): psapi/psapi.spec $(WINEBUILD) @cd psapi && $(MAKE) libpsapi.$(IMPLIBEXT) -qcap/libqcap.$(IMPLIBEXT): qcap/qcap.spec $(WINEBUILD) - @cd qcap && $(MAKE) libqcap.$(IMPLIBEXT) - quartz/libquartz.$(IMPLIBEXT): quartz/quartz.spec $(WINEBUILD) @cd quartz && $(MAKE) libquartz.$(IMPLIBEXT) @@ -1483,9 +1423,6 @@ riched20/libriched20.$(IMPLIBEXT): riched20/riched20.spec $(WINEBUILD) @cd riched20 && $(MAKE) libriched20.$(IMPLIBEXT) -richedit/libriched32.$(IMPLIBEXT): richedit/riched32.spec $(WINEBUILD) - @cd richedit && $(MAKE) libriched32.$(IMPLIBEXT) - rpcrt4/librpcrt4.$(IMPLIBEXT): rpcrt4/rpcrt4.spec $(WINEBUILD) @cd rpcrt4 && $(MAKE) librpcrt4.$(IMPLIBEXT) @@ -1528,9 +1465,6 @@ tapi32/libtapi32.$(IMPLIBEXT): tapi32/tapi32.spec $(WINEBUILD) @cd tapi32 && $(MAKE) libtapi32.$(IMPLIBEXT) -twain/libtwain_32.$(IMPLIBEXT): twain/twain_32.spec $(WINEBUILD) - @cd twain && $(MAKE) libtwain_32.$(IMPLIBEXT) - unicows/libunicows.$(IMPLIBEXT): unicows/unicows.spec $(WINEBUILD) @cd unicows && $(MAKE) libunicows.$(IMPLIBEXT) @@ -1543,6 +1477,9 @@ user/libuser32.$(IMPLIBEXT): user/user32.spec $(WINEBUILD) @cd user && $(MAKE) libuser32.$(IMPLIBEXT) +usp10/libusp10.$(IMPLIBEXT): usp10/usp10.spec $(WINEBUILD) + @cd usp10 && $(MAKE) libusp10.$(IMPLIBEXT) + uxtheme/libuxtheme.$(IMPLIBEXT): uxtheme/uxtheme.spec $(WINEBUILD) @cd uxtheme && $(MAKE) libuxtheme.$(IMPLIBEXT) @@ -1618,21 +1555,12 @@ libmsvfw32.$(IMPLIBEXT): msvideo/libmsvfw32.$(IMPLIBEXT) $(RM) $@ && $(LN_S) msvideo/libmsvfw32.$(IMPLIBEXT) $@ -libntdll.$(IMPLIBEXT): ntdll/libntdll.$(IMPLIBEXT) - $(RM) $@ && $(LN_S) ntdll/libntdll.$(IMPLIBEXT) $@ - libolecli32.$(IMPLIBEXT): olecli/libolecli32.$(IMPLIBEXT) $(RM) $@ && $(LN_S) olecli/libolecli32.$(IMPLIBEXT) $@ libolesvr32.$(IMPLIBEXT): olesvr/libolesvr32.$(IMPLIBEXT) $(RM) $@ && $(LN_S) olesvr/libolesvr32.$(IMPLIBEXT) $@ -libriched32.$(IMPLIBEXT): richedit/libriched32.$(IMPLIBEXT) - $(RM) $@ && $(LN_S) richedit/libriched32.$(IMPLIBEXT) $@ - -libtwain_32.$(IMPLIBEXT): twain/libtwain_32.$(IMPLIBEXT) - $(RM) $@ && $(LN_S) twain/libtwain_32.$(IMPLIBEXT) $@ - libuser32.$(IMPLIBEXT): user/libuser32.$(IMPLIBEXT) $(RM) $@ && $(LN_S) user/libuser32.$(IMPLIBEXT) $@ @@ -1715,10 +1643,9 @@ kernel/kernel32.dll.so: kernel lzexpand/lz32.dll.so: lzexpand mapi32/mapi32.dll.so: mapi32 -winmm/mcianim/mcianim.drv.so: winmm/mcianim -winmm/mciavi/mciavi.drv.so: winmm/mciavi -winmm/mcicda/mcicda.drv.so: winmm/mcicda -winmm/mciseq/mciseq.drv.so: winmm/mciseq +mciavi32/mciavi32.dll.so: mciavi32 +mcicda/mcicda.dll.so: mcicda +mciseq/mciseq.dll.so: mciseq winmm/mciwave/mciwave.drv.so: winmm/mciwave midimap/midimap.dll.so: midimap mlang/mlang.dll.so: mlang @@ -1744,9 +1671,11 @@ msvideo/msvfw32.dll.so: msvideo msvidc32/msvidc32.dll.so: msvidc32 mswsock/mswsock.dll.so: mswsock +msxml3/msxml3.dll.so: msxml3 netapi32/netapi32.dll.so: netapi32 newdev/newdev.dll.so: newdev ntdll/ntdll.dll.so: ntdll +objsel/objsel.dll.so: objsel odbc32/odbc32.dll.so: odbc32 odbccp32/odbccp32.dll.so: odbccp32 ole32/ole32.dll.so: ole32 @@ -1785,6 +1714,7 @@ url/url.dll.so: url urlmon/urlmon.dll.so: urlmon user/user32.dll.so: user +usp10/usp10.dll.so: usp10 uxtheme/uxtheme.dll.so: uxtheme vdhcp.vxd/vdhcp.vxd.so: vdhcp.vxd vdmdbg/vdmdbg.dll.so: vdmdbg @@ -1800,6 +1730,7 @@ winmm/wineaudioio/wineaudioio.drv.so: winmm/wineaudioio wined3d/wined3d.dll.so: wined3d winedos/winedos.dll.so: winedos +winmm/wineesd/wineesd.drv.so: winmm/wineesd winmm/winejack/winejack.drv.so: winmm/winejack msacm/winemp3/winemp3.acm.so: msacm/winemp3 winmm/winenas/winenas.drv.so: winmm/winenas @@ -1824,6 +1755,7 @@ dxguid/libdxguid.a: dxguid strmiids/libstrmiids.a: strmiids uuid/libuuid.a: uuid +winecrt0/libwinecrt0.a: winecrt0 # Rules for auto documentation diff -urN wine-20050725/dlls/Makeimplib.rules.in wine-20050830/dlls/Makeimplib.rules.in --- wine-20050725/dlls/Makeimplib.rules.in 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/Makeimplib.rules.in 2005-08-25 14:14:13.000000000 +0200 @@ -0,0 +1,39 @@ +# Global rules for building a static import library -*-Makefile-*- +# +# Each individual makefile should define the following variables: +# MODULE : name of the main module being built +# +# plus all variables required by the global Make.rules.in +# + +DLLDEFS = @DLLDEFS@ +DLLFLAGS = @DLLFLAGS@ +DEFS = -D__WINESRC__ $(DLLDEFS) $(EXTRADEFS) + +@MAKE_RULES@ + +all: $(MODULE) + +# Rules for .a library + +$(MODULE): $(OBJS) Makefile.in + $(RM) $@ + $(AR) $@ $(OBJS) + $(RANLIB) $@ + +# Rules for installation + +install install-dev:: $(MODULE) + $(MKINSTALLDIRS) $(dlldir) + $(INSTALL_DATA) $(MODULE) $(dlldir)/$(MODULE) + +uninstall:: + [ ! -d $(dlldir) ] || (cd $(dlldir) && $(RM) $(MODULE)) + +# Misc. rules + +.PHONY: man doc-html doc-sgml + +man doc-html doc-sgml: + +# End of global library rules diff -urN wine-20050725/dlls/Maketest.rules.in wine-20050830/dlls/Maketest.rules.in --- wine-20050725/dlls/Maketest.rules.in 2005-05-10 15:21:04.000000000 +0200 +++ wine-20050830/dlls/Maketest.rules.in 2005-08-02 16:36:13.000000000 +0200 @@ -19,14 +19,12 @@ TESTPROGRAM = $(MODULE)$(DLLEXT) RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(TOPOBJDIR) -p $(TESTPROGRAM) -C_SRCS = $(CTESTS) -EXTRA_SRCS = $(TESTLIST) -EXTRA_OBJS = $(TESTLIST:.c=.o) +C_SRCS = $(CTESTS) $(TESTLIST) ALL_LIBS = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS) DLL_LDPATH = -L$(DLLDIR) $(IMPORTS:%=-L$(DLLDIR)/%) CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe -CROSSOBJS = $(C_SRCS:.c=.cross.o) $(RC_SRCS:.rc=.res.cross.o) $(TESTLIST:.c=.cross.o) +CROSSOBJS = $(C_SRCS:.c=.cross.o) $(RC_SRCS:.rc=.res.cross.o) CROSSCC = @CROSSCC@ CROSSWINDRES = @CROSSWINDRES@ diff -urN wine-20050725/dlls/activeds/Makefile.in wine-20050830/dlls/activeds/Makefile.in --- wine-20050725/dlls/activeds/Makefile.in 2005-06-13 13:47:46.000000000 +0200 +++ wine-20050830/dlls/activeds/Makefile.in 2005-08-25 17:27:44.000000000 +0200 @@ -4,6 +4,7 @@ VPATH = @srcdir@ MODULE = activeds.dll IMPORTLIB = libactiveds.$(IMPLIBEXT) +IMPORTS = kernel32 C_SRCS = activeds_main.c diff -urN wine-20050725/dlls/advapi32/advapi32.spec wine-20050830/dlls/advapi32/advapi32.spec --- wine-20050725/dlls/advapi32/advapi32.spec 2005-07-18 17:10:22.000000000 +0200 +++ wine-20050830/dlls/advapi32/advapi32.spec 2005-08-01 16:59:26.000000000 +0200 @@ -7,12 +7,24 @@ @ stdcall AccessCheckAndAuditAlarmA(str ptr str str ptr long ptr long ptr ptr ptr) @ stdcall AccessCheckAndAuditAlarmW(wstr ptr wstr wstr ptr long ptr long ptr ptr ptr) @ stdcall AccessCheckByType(ptr ptr long long ptr long ptr ptr ptr ptr ptr) +# @ stub AccessCheckByTypeAndAuditAlarmA +# @ stub AccessCheckByTypeAndAuditAlarmW +# @ stub AccessCheckByTypeResultList +# @ stub AccessCheckByTypeResultListAndAuditAlarmA +# @ stub AccessCheckByTypeResultListAndAuditAlarmByHandleA +# @ stub AccessCheckByTypeResultListAndAuditAlarmByHandleW +# @ stub AccessCheckByTypeResultListAndAuditAlarmW @ stdcall AddAccessAllowedAce (ptr long long ptr) @ stdcall AddAccessAllowedAceEx (ptr long long long ptr) +# @ stub AddAccessAllowedObjectAce @ stdcall AddAccessDeniedAce(ptr long long ptr) @ stdcall AddAccessDeniedAceEx(ptr long long long ptr) +# @ stub AddAccessDeniedObjectAce @ stdcall AddAce(ptr long long ptr long) @ stdcall AddAuditAccessAce(ptr long long ptr long long) +# @ stub AddAuditAccessAceEx +# @ stub AddAuditAccessObjectAce +# @ stub AddUsersToEncryptedFile @ stdcall AdjustTokenGroups(long long ptr long ptr ptr) @ stdcall AdjustTokenPrivileges(long long ptr long ptr ptr) @ stdcall AllocateAndInitializeSid(ptr long long long long long long long long long ptr) @@ -23,6 +35,10 @@ @ stdcall BackupEventLogW (long wstr) @ stdcall BuildExplicitAccessWithNameA(ptr str long long long) @ stdcall BuildExplicitAccessWithNameW(ptr wstr long long long) +# @ stub BuildImpersonateExplicitAccessWithNameA +# @ stub BuildImpersonateExplicitAccessWithNameW +# @ stub BuildImpersonateTrusteeA +# @ stub BuildImpersonateTrusteeW @ stdcall BuildSecurityDescriptorA(ptr ptr long ptr long ptr ptr ptr ptr) @ stdcall BuildSecurityDescriptorW(ptr ptr long ptr long ptr ptr ptr ptr) @ stdcall BuildTrusteeWithNameA(ptr str) @@ -33,6 +49,7 @@ @ stdcall BuildTrusteeWithObjectsAndSidW(ptr ptr ptr ptr ptr) @ stdcall BuildTrusteeWithSidA(ptr ptr) @ stdcall BuildTrusteeWithSidW(ptr ptr) +# @ stub CancelOverlappedAccess @ stdcall ChangeServiceConfig2A(long long ptr) @ stdcall ChangeServiceConfig2W(long long ptr) @ stdcall ChangeServiceConfigA(long long long long wstr str ptr str str str str) @@ -40,23 +57,80 @@ @ stdcall CheckTokenMembership(long ptr ptr) @ stdcall ClearEventLogA (long str) @ stdcall ClearEventLogW (long wstr) +# @ stub CloseCodeAuthzLevel +# @ stub CloseEncryptedFileRaw @ stdcall CloseEventLog (long) @ stdcall CloseServiceHandle(long) +# @ stub CloseTrace @ stdcall CommandLineFromMsiDescriptor(wstr wstr ptr) +# @ stub ComputeAccessTokenFromCodeAuthzLevel @ stdcall ControlService(long long ptr) +# @ stub ControlTraceA +# @ stub ControlTraceW +# @ stub ConvertAccessToSecurityDescriptorA +# @ stub ConvertAccessToSecurityDescriptorW +# @ stub ConvertSDToStringSDRootDomainA +# @ stub ConvertSDToStringSDRootDomainW +# @ stub ConvertSecurityDescriptorToAccessA +# @ stub ConvertSecurityDescriptorToAccessNamedA +# @ stub ConvertSecurityDescriptorToAccessNamedW +# @ stub ConvertSecurityDescriptorToAccessW +# @ stub ConvertSecurityDescriptorToStringSecurityDescriptorA +# @ stub ConvertSecurityDescriptorToStringSecurityDescriptorW @ stdcall ConvertSidToStringSidA(ptr ptr) @ stdcall ConvertSidToStringSidW(ptr ptr) +# @ stub ConvertStringSDToSDDomainA +# @ stub ConvertStringSDToSDDomainW +# @ stub ConvertStringSDToSDRootDomainA +# @ stub ConvertStringSDToSDRootDomainW @ stdcall ConvertStringSecurityDescriptorToSecurityDescriptorA(str long ptr ptr) @ stdcall ConvertStringSecurityDescriptorToSecurityDescriptorW(wstr long ptr ptr) @ stdcall ConvertStringSidToSidA(ptr ptr) @ stdcall ConvertStringSidToSidW(ptr ptr) +# @ stub ConvertToAutoInheritPrivateObjectSecurity @ stdcall CopySid(long ptr ptr) +# @ stub CreateCodeAuthzLevel @ stdcall CreatePrivateObjectSecurity(ptr ptr ptr long long ptr) +# @ stub CreatePrivateObjectSecurityEx +# @ stub CreatePrivateObjectSecurityWithMultipleInheritance @ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr) +# @ stub CreateProcessAsUserSecure @ stdcall CreateProcessAsUserW(long str str ptr ptr long long ptr str ptr ptr) +# @ stub CreateProcessWithLogonW +# @ stub CreateRestrictedToken @ stdcall CreateServiceA(long ptr ptr long long long long ptr ptr ptr ptr ptr ptr) @ stdcall CreateServiceW (long ptr ptr long long long long ptr ptr ptr ptr ptr ptr) +# @ stub CreateTraceInstanceId +# @ stub CreateWellKnownSid +# @ stub CredDeleteA +# @ stub CredDeleteW +# @ stub CredEnumerateA +# @ stub CredEnumerateW +# @ stub CredFree +# @ stub CredGetSessionTypes +# @ stub CredGetTargetInfoA +# @ stub CredGetTargetInfoW +# @ stub CredIsMarshaledCredentialA +# @ stub CredIsMarshaledCredentialW +# @ stub CredMarshalCredentialA +# @ stub CredMarshalCredentialW @ stub CredProfileLoaded +# @ stub CredReadA +# @ stub CredReadDomainCredentialsA +# @ stub CredReadDomainCredentialsW +# @ stub CredReadW +# @ stub CredRenameA +# @ stub CredRenameW +# @ stub CredUnmarshalCredentialA +# @ stub CredUnmarshalCredentialW +# @ stub CredWriteA +# @ stub CredWriteDomainCredentialsA +# @ stub CredWriteDomainCredentialsW +# @ stub CredWriteW +# @ stub CredpConvertCredential +# @ stub CredpConvertTargetInfo +# @ stub CredpDecodeCredential +# @ stub CredpEncodeCredential @ stdcall CryptAcquireContextA(ptr str str long long) @ stdcall CryptAcquireContextW(ptr wstr wstr long long) @ stdcall CryptContextAddRef(long ptr long) @@ -102,48 +176,103 @@ @ stdcall DeleteService(long) @ stdcall DeregisterEventSource(long) @ stdcall DestroyPrivateObjectSecurity(ptr) +# @ stub DuplicateEncryptionInfoFile @ stdcall DuplicateToken(long long ptr) @ stdcall DuplicateTokenEx(long long ptr long long ptr) +# @ stub ElfBackupEventLogFileA +# @ stub ElfBackupEventLogFileW +# @ stub ElfChangeNotify +# @ stub ElfClearEventLogFileA +# @ stub ElfClearEventLogFileW +# @ stub ElfCloseEventLog @ stub ElfDeregisterEventSource @ stub ElfDeregisterEventSourceW +# @ stub ElfFlushEventLog +# @ stub ElfNumberOfRecords +# @ stub ElfOldestRecord +# @ stub ElfOpenBackupEventLogA +# @ stub ElfOpenBackupEventLogW +# @ stub ElfOpenEventLogA +# @ stub ElfOpenEventLogW +# @ stub ElfReadEventLogA +# @ stub ElfReadEventLogW +# @ stub ElfRegisterEventSourceA @ stub ElfRegisterEventSourceW +# @ stub ElfReportEventA @ stub ElfReportEventW +# @ stub EnableTrace @ stdcall EncryptFileA(str) @ stdcall EncryptFileW(wstr) +# @ stub EncryptedFileKeyInfo +# @ stub EncryptionDisable @ stdcall EnumDependentServicesA(long long ptr long ptr ptr) @ stdcall EnumDependentServicesW(long long ptr long ptr ptr) @ stub EnumServiceGroupA @ stub EnumServiceGroupW @ stdcall EnumServicesStatusA (long long long ptr long ptr ptr ptr) +# @ stub EnumServicesStatusExA +# @ stub EnumServicesStatusExW @ stdcall EnumServicesStatusW (long long long ptr long ptr ptr ptr) +# @ stub EnumerateTraceGuids +# @ stub EqualDomainSid @ stdcall EqualPrefixSid(ptr ptr) @ stdcall EqualSid(ptr ptr) +# @ stub FileEncryptionStatusA +# @ stub FileEncryptionStatusW @ stdcall FindFirstFreeAce(ptr ptr) +# @ stub FlushTraceA +# @ stub FlushTraceW +# @ stub FreeEncryptedFileKeyInfo +# @ stub FreeEncryptionCertificateHashList +# @ stub FreeInheritedFromArray @ stdcall FreeSid(ptr) +# @ stub GetAccessPermissionsForObjectA +# @ stub GetAccessPermissionsForObjectW @ stdcall GetAce(ptr long ptr) @ stdcall GetAclInformation(ptr ptr long long) +# @ stub GetAuditedPermissionsFromAclA +# @ stub GetAuditedPermissionsFromAclW @ stdcall GetCurrentHwProfileA(ptr) @ stdcall GetCurrentHwProfileW(ptr) @ stdcall GetEffectiveRightsFromAclA(ptr ptr ptr) +# @ stub GetEffectiveRightsFromAclW +# @ stub GetEventLogInformation @ stdcall GetExplicitEntriesFromAclA(ptr ptr ptr) @ stdcall GetExplicitEntriesFromAclW(ptr ptr ptr) @ stdcall GetFileSecurityA(str long ptr long ptr) @ stdcall GetFileSecurityW(wstr long ptr long ptr) +# @ stub GetInformationCodeAuthzLevelW +# @ stub GetInformationCodeAuthzPolicyW +# @ stub GetInheritanceSourceA +# @ stub GetInheritanceSourceW @ stdcall GetKernelObjectSecurity(long long ptr long ptr) @ stdcall GetLengthSid(ptr) +# @ stub GetLocalManagedApplicationData +# @ stub GetLocalManagedApplications +# @ stub GetManagedApplicationCategories +# @ stub GetManagedApplications @ stub GetMangledSiteSid +# @ stub GetMultipleTrusteeA +# @ stub GetMultipleTrusteeOperationA +# @ stub GetMultipleTrusteeOperationW +# @ stub GetMultipleTrusteeW @ stdcall GetNamedSecurityInfoA (str long long ptr ptr ptr ptr ptr) +# @ stub GetNamedSecurityInfoExA +# @ stub GetNamedSecurityInfoExW @ stdcall GetNamedSecurityInfoW (wstr long long ptr ptr ptr ptr ptr) @ stdcall GetNumberOfEventLogRecords (long ptr) @ stdcall GetOldestEventLogRecord (long ptr) +# @ stub GetOverlappedAccessResults @ stdcall GetPrivateObjectSecurity(ptr long ptr long ptr) @ stdcall GetSecurityDescriptorControl (ptr ptr ptr) @ stdcall GetSecurityDescriptorDacl (ptr ptr ptr ptr) @ stdcall GetSecurityDescriptorGroup(ptr ptr ptr) @ stdcall GetSecurityDescriptorLength(ptr) @ stdcall GetSecurityDescriptorOwner(ptr ptr ptr) +# @ stub GetSecurityDescriptorRMControl @ stdcall GetSecurityDescriptorSacl (ptr ptr ptr ptr) @ stdcall GetSecurityInfo (long long long ptr ptr ptr ptr ptr) +# @ stub GetSecurityInfoExA @ stdcall GetSecurityInfoExW (long long long wstr wstr ptr ptr wstr wstr) @ stdcall GetServiceDisplayNameA(ptr str ptr ptr) @ stdcall GetServiceDisplayNameW(ptr wstr ptr ptr) @@ -155,6 +284,9 @@ @ stdcall GetSidSubAuthorityCount(ptr) @ stub GetSiteSidFromToken @ stdcall GetTokenInformation(long long ptr long ptr) +# @ stub GetTraceEnableFlags +# @ stub GetTraceEnableLevel +# @ stub GetTraceLoggerHandle @ stdcall GetTrusteeFormA(ptr) @ stdcall GetTrusteeFormW(ptr) @ stdcall GetTrusteeNameA(ptr) @@ -163,8 +295,16 @@ @ stdcall GetTrusteeTypeW(ptr) @ stdcall GetUserNameA(ptr ptr) @ stdcall GetUserNameW(ptr ptr) +# @ stub GetWindowsAccountDomainSid +# @ stub I_ScGetCurrentGroupStateW +# @ stub I_ScIsSecurityProcess +# @ stub I_ScPnPGetServiceName +# @ stub I_ScSendTSMessage @ stub I_ScSetServiceBit @ stub I_ScSetServiceBitsA +# @ stub I_ScSetServiceBitsW +# @ stub IdentifyCodeAuthzLevelW +# @ stub ImpersonateAnonymousToken @ stdcall ImpersonateLoggedOnUser(long) @ stdcall ImpersonateNamedPipeClient(long) @ stdcall ImpersonateSelf(long) @@ -179,11 +319,15 @@ @ stub IsProcessRestricted @ stdcall IsTextUnicode(ptr long ptr) @ stdcall IsTokenRestricted(long) +# @ stub IsTokenUntrusted @ stdcall IsValidAcl(ptr) @ stdcall IsValidSecurityDescriptor(ptr) @ stdcall IsValidSid(ptr) +# @ stub IsWellKnownSid @ stdcall LockServiceDatabase(ptr) @ stdcall LogonUserA(str str str long long ptr) +# @ stub LogonUserExA +# @ stub LogonUserExW @ stdcall LogonUserW(wstr wstr wstr long long ptr) @ stdcall LookupAccountNameA(str str ptr ptr ptr ptr ptr) @ stdcall LookupAccountNameW(wstr wstr ptr ptr ptr ptr ptr) @@ -195,37 +339,68 @@ @ stdcall LookupPrivilegeNameW(wstr ptr ptr long) @ stdcall LookupPrivilegeValueA(ptr ptr ptr) @ stdcall LookupPrivilegeValueW(ptr ptr ptr) +# @ stub LookupSecurityDescriptorPartsA +# @ stub LookupSecurityDescriptorPartsW +# @ stub LsaAddAccountRights @ stub LsaAddPrivilegesToAccount +# @ stub LsaClearAuditLog @ stdcall LsaClose(ptr) @ stub LsaCreateAccount @ stub LsaCreateSecret @ stub LsaCreateTrustedDomain +# @ stub LsaCreateTrustedDomainEx @ stub LsaDelete +# @ stub LsaDeleteTrustedDomain +# @ stub LsaEnumerateAccountRights @ stub LsaEnumerateAccounts +# @ stub LsaEnumerateAccountsWithUserRight @ stub LsaEnumeratePrivileges @ stub LsaEnumeratePrivilegesOfAccount @ stdcall LsaEnumerateTrustedDomains(long ptr ptr long ptr) +# @ stub LsaEnumerateTrustedDomainsEx @ stdcall LsaFreeMemory(ptr) +# @ stub LsaGetQuotasForAccount +# @ stub LsaGetRemoteUserName @ stub LsaGetSystemAccessAccount +# @ stub LsaGetUserName @ stub LsaICLookupNames +# @ stub LsaICLookupNamesWithCreds @ stub LsaICLookupSids +# @ stub LsaICLookupSidsWithCreds +# @ stub LsaLookupNames2 @ stdcall LsaLookupNames(long long ptr ptr ptr) @ stub LsaLookupPrivilegeDisplayName +# @ stub LsaLookupPrivilegeName +# @ stub LsaLookupPrivilegeValue @ stdcall LsaLookupSids(ptr long ptr ptr ptr) @ stdcall LsaNtStatusToWinError(long) @ stub LsaOpenAccount @ stdcall LsaOpenPolicy(long long long long) +# @ stub LsaOpenPolicySce @ stub LsaOpenSecret @ stub LsaOpenTrustedDomain +# @ stub LsaOpenTrustedDomainByName +# @ stub LsaQueryDomainInformationPolicy +# @ stub LsaQueryForestTrustInformation @ stub LsaQueryInfoTrustedDomain @ stdcall LsaQueryInformationPolicy(ptr long ptr) @ stub LsaQuerySecret +# @ stub LsaQuerySecurityObject +# @ stub LsaQueryTrustedDomainInfo +# @ stub LsaQueryTrustedDomainInfoByName +# @ stub LsaRemoveAccountRights @ stub LsaRemovePrivilegesFromAccount @ stdcall LsaRetrievePrivateData(ptr ptr ptr) +# @ stub LsaSetDomainInformationPolicy +# @ stub LsaSetForestTrustInformation @ stdcall LsaSetInformationPolicy(long long ptr) @ stub LsaSetInformationTrustedDomain +# @ stub LsaSetQuotasForAccount @ stub LsaSetSecret +# @ stub LsaSetSecurityObject @ stub LsaSetSystemAccessAccount +# @ stub LsaSetTrustedDomainInfoByName +# @ stub LsaSetTrustedDomainInformation @ stdcall LsaStorePrivateData(ptr ptr ptr) @ stdcall MD4Final(ptr) @ stdcall MD4Init(ptr) @@ -233,6 +408,9 @@ @ stdcall MD5Final(ptr) @ stdcall MD5Init(ptr) @ stdcall MD5Update(ptr ptr long) +# @ stub MSChapSrvChangePassword2 +# @ stub MSChapSrvChangePassword +# @ stub MakeAbsoluteSD2 @ stdcall MakeAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall MakeSelfRelativeSD(ptr ptr ptr) @ stdcall MapGenericMask(ptr ptr) @@ -240,12 +418,16 @@ @ stdcall NotifyChangeEventLog (long long) @ stdcall ObjectCloseAuditAlarmA(str ptr long) @ stdcall ObjectCloseAuditAlarmW(wstr ptr long) +# @ stub ObjectDeleteAuditAlarmA +# @ stub ObjectDeleteAuditAlarmW @ stdcall ObjectOpenAuditAlarmA(str ptr str str ptr long long long ptr long long ptr) @ stdcall ObjectOpenAuditAlarmW(wstr ptr wstr wstr ptr long long long ptr long long ptr) @ stdcall ObjectPrivilegeAuditAlarmA(str ptr long long ptr long) @ stdcall ObjectPrivilegeAuditAlarmW(wstr ptr long long ptr long) @ stdcall OpenBackupEventLogA (str str) @ stdcall OpenBackupEventLogW (wstr wstr) +# @ stub OpenEncryptedFileRawA +# @ stub OpenEncryptedFileRawW @ stdcall OpenEventLogA (str str) @ stdcall OpenEventLogW (wstr wstr) @ stdcall OpenProcessToken(long long ptr) @@ -254,9 +436,18 @@ @ stdcall OpenServiceA(long str long) @ stdcall OpenServiceW(long wstr long) @ stdcall OpenThreadToken(long long long ptr) +# @ stub OpenTraceA +# @ stub OpenTraceW @ stdcall PrivilegeCheck(ptr ptr ptr) @ stdcall PrivilegedServiceAuditAlarmA(str str long ptr long) @ stdcall PrivilegedServiceAuditAlarmW(wstr wstr long ptr long) +# @ stub ProcessIdleTasks +# @ stub ProcessTrace +# @ stub QueryAllTracesA +# @ stub QueryAllTracesW +# @ stub QueryRecoveryAgentsOnEncryptedFile +# @ stub QueryServiceConfig2A +# @ stub QueryServiceConfig2W @ stdcall QueryServiceConfigA(long ptr long ptr) @ stdcall QueryServiceConfigW(long ptr long ptr) @ stdcall QueryServiceLockStatusA(long ptr long ptr) @@ -264,7 +455,11 @@ @ stdcall QueryServiceObjectSecurity(long long ptr long ptr) @ stdcall QueryServiceStatus(long ptr) @ stdcall QueryServiceStatusEx (long long ptr long ptr) +# @ stub QueryTraceA +# @ stub QueryTraceW +# @ stub QueryUsersOnEncryptedFile @ stdcall QueryWindows31FilesMigration(long) +# @ stub ReadEncryptedFileRaw @ stdcall ReadEventLogA (long long long ptr long ptr ptr) @ stdcall ReadEventLogW (long long long ptr long ptr ptr) @ stdcall RegCloseKey(long) @@ -278,6 +473,7 @@ @ stdcall RegDeleteKeyW(long wstr) @ stdcall RegDeleteValueA(long str) @ stdcall RegDeleteValueW(long wstr) +# @ stub RegDisablePredefinedCache @ stdcall RegEnumKeyA(long long ptr long) @ stdcall RegEnumKeyExA(long long ptr ptr ptr ptr ptr ptr) @ stdcall RegEnumKeyExW(long long ptr ptr ptr ptr ptr ptr) @@ -297,6 +493,7 @@ @ stdcall RegOpenKeyExW(long wstr long long ptr) @ stdcall RegOpenKeyW(long wstr ptr) @ stdcall RegOpenUserClassesRoot(ptr long long ptr) +# @ stub RegOverridePredefKey @ stdcall RegQueryInfoKeyA(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall RegQueryInfoKeyW(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall RegQueryMultipleValuesA(long ptr long ptr ptr) @@ -311,6 +508,8 @@ @ stdcall RegRestoreKeyA(long str long) @ stdcall RegRestoreKeyW(long wstr long) @ stdcall RegSaveKeyA(long ptr ptr) +# @ stub RegSaveKeyExA +# @ stub RegSaveKeyExW @ stdcall RegSaveKeyW(long ptr ptr) @ stdcall RegSetKeySecurity(long long ptr) @ stdcall RegSetValueA(long str long ptr long) @@ -321,37 +520,76 @@ @ stdcall RegUnLoadKeyW(long wstr) @ stdcall RegisterEventSourceA(ptr ptr) @ stdcall RegisterEventSourceW(ptr ptr) +# @ stub RegisterIdleTask @ stdcall RegisterServiceCtrlHandlerA (ptr ptr) +# @ stub RegisterServiceCtrlHandlerExA +# @ stub RegisterServiceCtrlHandlerExW @ stdcall RegisterServiceCtrlHandlerW (ptr ptr) @ stdcall RegisterTraceGuidsA(ptr ptr ptr long ptr str str ptr) @ stdcall RegisterTraceGuidsW(ptr ptr ptr long ptr wstr wstr ptr) +# @ stub RemoveTraceCallback +# @ stub RemoveUsersFromEncryptedFile @ stdcall ReportEventA (long long long long ptr long long str ptr) @ stdcall ReportEventW (long long long long ptr long long wstr ptr) @ stdcall RevertToSelf() +# @ stub SaferCloseLevel +# @ stub SaferComputeTokenFromLevel +# @ stub SaferCreateLevel +# @ stub SaferGetLevelInformation +# @ stub SaferGetPolicyInformation +# @ stub SaferIdentifyLevel +# @ stub SaferRecordEventLogEntry +# @ stub SaferSetLevelInformation +# @ stub SaferSetPolicyInformation +# @ stub SaferiChangeRegistryScope +# @ stub SaferiCompareTokenLevels +# @ stub SaferiIsExecutableFileType +# @ stub SaferiPopulateDefaultsInRegistry +# @ stub SaferiRecordEventLogEntry +# @ stub SaferiReplaceProcessThreadTokens +# @ stub SaferiSearchMatchingHashRules @ stdcall SetAclInformation(ptr ptr long long) +# @ stub SetEntriesInAccessListA +# @ stub SetEntriesInAccessListW @ stdcall SetEntriesInAclA(long ptr ptr ptr) @ stdcall SetEntriesInAclW(long ptr ptr ptr) +# @ stub SetEntriesInAuditListA +# @ stub SetEntriesInAuditListW @ stdcall SetFileSecurityA(str long ptr ) @ stdcall SetFileSecurityW(wstr long ptr) +# @ stub SetInformationCodeAuthzLevelW +# @ stub SetInformationCodeAuthzPolicyW @ stdcall SetKernelObjectSecurity(long long ptr) @ stdcall SetNamedSecurityInfoA(str long ptr ptr ptr ptr ptr) +# @ stub SetNamedSecurityInfoExA +# @ stub SetNamedSecurityInfoExW @ stdcall SetNamedSecurityInfoW(wstr long ptr ptr ptr ptr ptr) @ stdcall SetPrivateObjectSecurity(long ptr ptr ptr long) +# @ stub SetPrivateObjectSecurityEx @ stdcall SetSecurityDescriptorControl(ptr long long) @ stdcall SetSecurityDescriptorDacl(ptr long ptr long) @ stdcall SetSecurityDescriptorGroup (ptr ptr long) @ stdcall SetSecurityDescriptorOwner (ptr ptr long) +# @ stub SetSecurityDescriptorRMControl @ stdcall SetSecurityDescriptorSacl(ptr long ptr long) @ stdcall SetSecurityInfo (long long long ptr ptr ptr ptr) +# @ stub SetSecurityInfoExA +# @ stub SetSecurityInfoExW @ stdcall SetServiceBits(long long long long) @ stdcall SetServiceObjectSecurity(long long ptr) @ stdcall SetServiceStatus(long long) @ stdcall SetThreadToken (ptr ptr) @ stdcall SetTokenInformation (long long ptr long) +# @ stub SetTraceCallback +# @ stub SetUserFileEncryptionKey @ stdcall StartServiceA(long long ptr) @ stdcall StartServiceCtrlDispatcherA(ptr) @ stdcall StartServiceCtrlDispatcherW(ptr) @ stdcall StartServiceW(long long ptr) +# @ stub StartTraceA +# @ stub StartTraceW +# @ stub StopTraceA +# @ stub StopTraceW @ stdcall SynchronizeWindows31FilesAndWindowsNTRegistry(long long long long) @ stub SystemFunction001 @ stub SystemFunction002 @@ -395,12 +633,52 @@ @ stub TraceEventInstance @ stub TraceMessage @ stub TraceMessageVa +# @ stub TreeResetNamedSecurityInfoA +# @ stub TreeResetNamedSecurityInfoW +# @ stub TrusteeAccessToObjectA +# @ stub TrusteeAccessToObjectW +# @ stub UninstallApplication @ stdcall UnlockServiceDatabase (ptr) +# @ stub UnregisterIdleTask @ stub UnregisterTraceGuids @ stub UpdateTraceA @ stub UpdateTraceW @ stub WdmWmiServiceMain @ stub WmiCloseBlock +# @ stub WmiCloseTraceWithCursor +# @ stub WmiConvertTimestamp +# @ stub WmiDevInstToInstanceNameA +# @ stub WmiDevInstToInstanceNameW +# @ stub WmiEnumerateGuids +# @ stub WmiExecuteMethodA +# @ stub WmiExecuteMethodW +# @ stub WmiFileHandleToInstanceNameA +# @ stub WmiFileHandleToInstanceNameW +# @ stub WmiFreeBuffer +# @ stub WmiGetFirstTraceOffset +# @ stub WmiGetNextEvent +# @ stub WmiGetTraceHeader +# @ stub WmiMofEnumerateResourcesA +# @ stub WmiMofEnumerateResourcesW +# @ stub WmiNotificationRegistrationA +# @ stub WmiNotificationRegistrationW @ stub WmiOpenBlock +# @ stub WmiOpenTraceWithCursor +# @ stub WmiParseTraceEvent +# @ stub WmiQueryAllDataA +# @ stub WmiQueryAllDataMultipleA +# @ stub WmiQueryAllDataMultipleW +# @ stub WmiQueryAllDataW +# @ stub WmiQueryGuidInformation +# @ stub WmiQuerySingleInstanceA +# @ stub WmiQuerySingleInstanceMultipleA +# @ stub WmiQuerySingleInstanceMultipleW @ stub WmiQuerySingleInstanceW +# @ stub WmiReceiveNotificationsA +# @ stub WmiReceiveNotificationsW +# @ stub WmiSetSingleInstanceA @ stub WmiSetSingleInstanceW +# @ stub WmiSetSingleItemA +# @ stub WmiSetSingleItemW +# @ stub Wow64Win32ApiEntry +# @ stub WriteEncryptedFileRaw diff -urN wine-20050725/dlls/advapi32/crypt.c wine-20050830/dlls/advapi32/crypt.c --- wine-20050725/dlls/advapi32/crypt.c 2005-07-18 11:07:57.000000000 +0200 +++ wine-20050830/dlls/advapi32/crypt.c 2005-08-15 11:44:34.000000000 +0200 @@ -25,6 +25,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include @@ -536,7 +537,7 @@ PCRYPTPROV pProv = (PCRYPTPROV)hProv; BOOL ret = TRUE; - TRACE("(0x%lx, %08ld)\n", hProv, dwFlags); + TRACE("(0x%lx, %08lx)\n", hProv, dwFlags); if (!pProv) { @@ -816,7 +817,7 @@ PCRYPTPROV prov; PCRYPTHASH orghash, newhash; - TRACE("(0x%lx, %p, %08ld, %p)\n", hHash, pdwReserved, dwFlags, phHash); + TRACE("(0x%lx, %p, %08lx, %p)\n", hHash, pdwReserved, dwFlags, phHash); orghash = (PCRYPTHASH)hHash; if (!orghash || pdwReserved || !phHash || !orghash->pProvider || @@ -862,7 +863,7 @@ PCRYPTPROV prov; PCRYPTKEY orgkey, newkey; - TRACE("(0x%lx, %p, %08ld, %p)\n", hKey, pdwReserved, dwFlags, phKey); + TRACE("(0x%lx, %p, %08lx, %p)\n", hKey, pdwReserved, dwFlags, phKey); orgkey = (PCRYPTKEY)hKey; if (!orgkey || pdwReserved || !phKey || !orgkey->pProvider || @@ -918,7 +919,7 @@ PCRYPTKEY key = (PCRYPTKEY)hKey; PCRYPTHASH hash = (PCRYPTHASH)hHash; - TRACE("(0x%lx, 0x%lx, %d, %08ld, %p, %p, %ld)\n", hKey, hHash, Final, dwFlags, pbData, pdwDataLen, dwBufLen); + TRACE("(0x%lx, 0x%lx, %d, %08lx, %p, %p, %ld)\n", hKey, hHash, Final, dwFlags, pbData, pdwDataLen, dwBufLen); if (!key || !pdwDataLen || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1023,7 +1024,7 @@ DWORD strlen; BOOL ret; /* = FALSE; */ - TRACE("(%ld, %p, %08ld, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, + TRACE("(%ld, %p, %08lx, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, pdwProvType, pszProvName, pcbProvName); strlen = *pcbProvName * sizeof(WCHAR); @@ -1069,7 +1070,7 @@ PSTR keyname, ch; DWORD result; - TRACE("(%ld, %p, %08ld, %p, %p, %p)\n", dwIndex, pdwReserved, + TRACE("(%ld, %p, %08lx, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, pdwProvType, pszTypeName, pcbTypeName); if (pdwReserved || !pdwProvType || !pcbTypeName) @@ -1118,7 +1119,7 @@ DWORD strlen; BOOL ret; - TRACE("(%ld, %p, %08ld, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, + TRACE("(%ld, %p, %08lx, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, pdwProvType, pszTypeName, pcbTypeName); strlen = *pcbTypeName / sizeof(WCHAR); if ( pszTypeName && !(str = CRYPT_Alloc(strlen)) ) @@ -1160,7 +1161,7 @@ PCRYPTPROV prov; PCRYPTKEY key = (PCRYPTKEY)hKey, expkey = (PCRYPTKEY)hExpKey; - TRACE("(0x%lx, 0x%lx, %ld, %08ld, %p, %p)\n", hKey, hExpKey, dwBlobType, dwFlags, pbData, pdwDataLen); + TRACE("(0x%lx, 0x%lx, %ld, %08lx, %p, %p)\n", hKey, hExpKey, dwBlobType, dwFlags, pbData, pdwDataLen); if (!key || !pdwDataLen || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1190,7 +1191,7 @@ PCRYPTPROV prov = (PCRYPTPROV)hProv; PCRYPTKEY key; - TRACE("(0x%lx, %d, %08ld, %p)\n", hProv, Algid, dwFlags, phKey); + TRACE("(0x%lx, %d, %08lx, %p)\n", hProv, Algid, dwFlags, phKey); if (!prov) CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); @@ -1281,7 +1282,7 @@ DWORD strlen; BOOL ret = FALSE; - TRACE("(%ld, %p, %08ld, %p, %p)\n", dwProvType, pdwReserved, dwFlags, pszProvName, pcbProvName); + TRACE("(%ld, %p, %08lx, %p, %p)\n", dwProvType, pdwReserved, dwFlags, pszProvName, pcbProvName); strlen = *pcbProvName / sizeof(WCHAR); if ( pszProvName && !(str = CRYPT_Alloc(strlen)) ) @@ -1321,7 +1322,7 @@ PCRYPTPROV prov; PCRYPTHASH hash = (PCRYPTHASH)hHash; - TRACE("(0x%lx, %ld, %p, %p, %08ld)\n", hHash, dwParam, pbData, pdwDataLen, dwFlags); + TRACE("(0x%lx, %ld, %p, %p, %08lx)\n", hHash, dwParam, pbData, pdwDataLen, dwFlags); if (!hash || !pdwDataLen || !hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1356,7 +1357,7 @@ PCRYPTPROV prov; PCRYPTKEY key = (PCRYPTKEY)hKey; - TRACE("(0x%lx, %ld, %p, %p, %08ld)\n", hKey, dwParam, pbData, pdwDataLen, dwFlags); + TRACE("(0x%lx, %ld, %p, %p, %08lx)\n", hKey, dwParam, pbData, pdwDataLen, dwFlags); if (!key || !pdwDataLen || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1390,7 +1391,7 @@ { PCRYPTPROV prov = (PCRYPTPROV)hProv; - TRACE("(0x%lx, %ld, %p, %p, %08ld)\n", hProv, dwParam, pbData, pdwDataLen, dwFlags); + TRACE("(0x%lx, %ld, %p, %p, %08lx)\n", hProv, dwParam, pbData, pdwDataLen, dwFlags); if (!prov || prov->dwMagic != MAGIC_CRYPTPROV) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1460,7 +1461,7 @@ PCRYPTHASH hash = (PCRYPTHASH)hHash; PCRYPTPROV prov; - TRACE("(0x%lx, %p, %ld, %08ld)\n", hHash, pbData, dwDataLen, dwFlags); + TRACE("(0x%lx, %p, %ld, %08lx)\n", hHash, pbData, dwDataLen, dwFlags); if (!hash) CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); @@ -1489,7 +1490,7 @@ PCRYPTKEY key = (PCRYPTKEY)hKey; PCRYPTPROV prov; - TRACE("(0x%lx, 0x%lx, %08ld)\n", hHash, hKey, dwFlags); + TRACE("(0x%lx, 0x%lx, %08lx)\n", hHash, hKey, dwFlags); if (!hash || !key) CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); @@ -1522,7 +1523,7 @@ PCRYPTPROV prov = (PCRYPTPROV)hProv; PCRYPTKEY pubkey = (PCRYPTKEY)hPubKey, importkey; - TRACE("(0x%lx, %p, %ld, 0x%lx, %08ld, %p)\n", hProv, pbData, dwDataLen, hPubKey, dwFlags, phKey); + TRACE("(0x%lx, %p, %ld, 0x%lx, %08lx, %p)\n", hProv, pbData, dwDataLen, hPubKey, dwFlags, phKey); if (!prov || !pbData || !dwDataLen || !phKey || prov->dwMagic != MAGIC_CRYPTPROV) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1570,7 +1571,7 @@ PCRYPTHASH hash = (PCRYPTHASH)hHash; PCRYPTPROV prov; - TRACE("(0x%lx, %ld, %s, %08ld, %p, %p)\n", + TRACE("(0x%lx, %ld, %s, %08lx, %p, %p)\n", hHash, dwKeySpec, debugstr_w(sDescription), dwFlags, pbSignature, pdwSigLen); if (!hash) @@ -1594,7 +1595,7 @@ LPWSTR wsDescription; BOOL result; - TRACE("(0x%lx, %ld, %s, %08ld, %p, %p)\n", + TRACE("(0x%lx, %ld, %s, %08lx, %p, %p)\n", hHash, dwKeySpec, debugstr_a(sDescription), dwFlags, pbSignature, pdwSigLen); CRYPT_ANSIToUnicode(sDescription, &wsDescription, -1); @@ -1624,7 +1625,7 @@ PCRYPTPROV prov; PCRYPTHASH hash = (PCRYPTHASH)hHash; - TRACE("(0x%lx, %ld, %p, %08ld)\n", hHash, dwParam, pbData, dwFlags); + TRACE("(0x%lx, %ld, %p, %08lx)\n", hHash, dwParam, pbData, dwFlags); if (!hash || !pbData || !hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1654,7 +1655,7 @@ PCRYPTPROV prov; PCRYPTKEY key = (PCRYPTKEY)hKey; - TRACE("(0x%lx, %ld, %p, %08ld)\n", hKey, dwParam, pbData, dwFlags); + TRACE("(0x%lx, %ld, %p, %08lx)\n", hKey, dwParam, pbData, dwFlags); if (!key || !pbData || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1714,7 +1715,7 @@ HKEY hProvKey, hTypeKey; PSTR keyname; - TRACE("(%s, %ld, %p, %08ld)\n", pszProvName, dwProvType, pdwReserved, dwFlags); + TRACE("(%s, %ld, %p, %08lx)\n", pszProvName, dwProvType, pdwReserved, dwFlags); if (!pszProvName || pdwReserved) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); @@ -1778,7 +1779,7 @@ BOOL ret = FALSE; PSTR str = NULL; - TRACE("(%s, %ld, %p, %08ld)\n", debugstr_w(pszProvName), dwProvType, pdwReserved, dwFlags); + TRACE("(%s, %ld, %p, %08lx)\n", debugstr_w(pszProvName), dwProvType, pdwReserved, dwFlags); if (CRYPT_UnicodeToANSI(pszProvName, &str, -1)) { @@ -1807,7 +1808,7 @@ { PCRYPTPROV prov = (PCRYPTPROV)hProv; - TRACE("(0x%lx, %ld, %p, %08ld)\n", hProv, dwParam, pbData, dwFlags); + TRACE("(0x%lx, %ld, %p, %08lx)\n", hProv, dwParam, pbData, dwFlags); if (!prov) CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); @@ -1863,7 +1864,7 @@ PCRYPTKEY key = (PCRYPTKEY)hPubKey; PCRYPTPROV prov; - TRACE("(0x%lx, %p, %ld, 0x%lx, %s, %08ld)\n", hHash, pbSignature, + TRACE("(0x%lx, %p, %ld, 0x%lx, %s, %08lx)\n", hHash, pbSignature, dwSigLen, hPubKey, debugstr_w(sDescription), dwFlags); if (!hash || !key) @@ -1891,7 +1892,7 @@ LPWSTR wsDescription; BOOL result; - TRACE("(0x%lx, %p, %ld, 0x%lx, %s, %08ld)\n", hHash, pbSignature, + TRACE("(0x%lx, %p, %ld, 0x%lx, %s, %08lx)\n", hHash, pbSignature, dwSigLen, hPubKey, debugstr_a(sDescription), dwFlags); CRYPT_ANSIToUnicode(sDescription, &wsDescription, -1); diff -urN wine-20050725/dlls/advapi32/crypt_lmhash.c wine-20050830/dlls/advapi32/crypt_lmhash.c --- wine-20050725/dlls/advapi32/crypt_lmhash.c 2004-10-04 22:42:05.000000000 +0200 +++ wine-20050830/dlls/advapi32/crypt_lmhash.c 2005-08-27 12:00:39.000000000 +0200 @@ -49,7 +49,7 @@ NTSTATUS WINAPI SystemFunction006( LPCSTR password, LPSTR hash ) { - CRYPT_LMhash( hash, password, strlen(password) ); + CRYPT_LMhash( (unsigned char*)hash, (unsigned char*)password, strlen(password) ); return STATUS_SUCCESS; } diff -urN wine-20050725/dlls/advapi32/crypt_sha.c wine-20050830/dlls/advapi32/crypt_sha.c --- wine-20050725/dlls/advapi32/crypt_sha.c 2004-12-15 11:56:21.000000000 +0100 +++ wine-20050830/dlls/advapi32/crypt_sha.c 2005-08-27 12:00:39.000000000 +0200 @@ -49,7 +49,7 @@ #define R4(v,w,x,y,z,i) z+=f4(w,x,y)+blk1(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); /* Hash a single 512-bit block. This is the core of the algorithm. */ -void SHA1Transform(ULONG State[5], CHAR Buffer[64]) +void SHA1Transform(ULONG State[5], UCHAR Buffer[64]) { ULONG a, b, c, d, e; ULONG *Block; @@ -178,7 +178,7 @@ Count = (ULONG*)(Buffer + Pad); Count[0] = DWORD2BE(LengthHi); Count[1] = DWORD2BE(LengthLo); - A_SHAUpdate(Context, Buffer, Pad + 8); + A_SHAUpdate(Context, (PCHAR)Buffer, Pad + 8); for (Index = 0; Index < 5; Index++) Result[Index] = DWORD2BE(Context->State[Index]); diff -urN wine-20050725/dlls/advapi32/registry.c wine-20050830/dlls/advapi32/registry.c --- wine-20050725/dlls/advapi32/registry.c 2005-07-18 17:10:22.000000000 +0200 +++ wine-20050830/dlls/advapi32/registry.c 2005-08-27 12:00:39.000000000 +0200 @@ -147,7 +147,7 @@ * * See RegCreateKeyExA. */ -DWORD WINAPI RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD reserved, LPCWSTR class, +DWORD WINAPI RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD reserved, LPWSTR class, DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa, PHKEY retkey, LPDWORD dispos ) { @@ -195,7 +195,7 @@ * FIXME * MAXIMUM_ALLOWED in access mask not supported by server */ -DWORD WINAPI RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, LPCSTR class, +DWORD WINAPI RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, LPSTR class, DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa, PHKEY retkey, LPDWORD dispos ) { @@ -991,7 +991,7 @@ if (type == REG_SZ) { if (!data) return ERROR_INVALID_PARAMETER; - count = strlen(data) + 1; + count = strlen((const char *)data) + 1; } } else if (count && is_string(type)) @@ -1005,9 +1005,9 @@ if (is_string( type )) /* need to convert to Unicode */ { DWORD lenW; - RtlMultiByteToUnicodeSize( &lenW, data, count ); + RtlMultiByteToUnicodeSize( &lenW, (const char *)data, count ); if (!(dataW = HeapAlloc( GetProcessHeap(), 0, lenW ))) return ERROR_OUTOFMEMORY; - RtlMultiByteToUnicodeN( dataW, lenW, NULL, data, count ); + RtlMultiByteToUnicodeN( dataW, lenW, NULL, (const char *)data, count ); count = lenW; data = (BYTE *)dataW; } @@ -1232,7 +1232,7 @@ if (len > *count) status = STATUS_BUFFER_OVERFLOW; else { - RtlUnicodeToMultiByteN( data, len, NULL, (WCHAR *)(buf_ptr + info_size), + RtlUnicodeToMultiByteN( (char*)data, len, NULL, (WCHAR *)(buf_ptr + info_size), total_size - info_size ); /* if the type is REG_SZ and data is not 0-terminated * and there is enough space in the buffer NT appends a \0 */ @@ -1285,7 +1285,7 @@ { if ((ret = RegOpenKeyW( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; } - ret = RegQueryValueExW( subkey, NULL, NULL, NULL, (LPBYTE)data, count ); + ret = RegQueryValueExW( subkey, NULL, NULL, NULL, (LPBYTE)data, (LPDWORD)count ); if (subkey != hkey) RegCloseKey( subkey ); if (ret == ERROR_FILE_NOT_FOUND) { @@ -1314,7 +1314,7 @@ { if ((ret = RegOpenKeyA( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; } - ret = RegQueryValueExA( subkey, NULL, NULL, NULL, (LPBYTE)data, count ); + ret = RegQueryValueExA( subkey, NULL, NULL, NULL, (LPBYTE)data, (LPDWORD)count ); if (subkey != hkey) RegCloseKey( subkey ); if (ret == ERROR_FILE_NOT_FOUND) { @@ -1731,7 +1731,7 @@ if (len > *count) status = STATUS_BUFFER_OVERFLOW; else { - RtlUnicodeToMultiByteN( data, len, NULL, (WCHAR *)(buf_ptr + info->DataOffset), + RtlUnicodeToMultiByteN( (char*)data, len, NULL, (WCHAR *)(buf_ptr + info->DataOffset), total_size - info->DataOffset ); /* if the type is REG_SZ and data is not 0-terminated * and there is enough space in the buffer NT appends a \0 */ diff -urN wine-20050725/dlls/advapi32/security.c wine-20050830/dlls/advapi32/security.c --- wine-20050725/dlls/advapi32/security.c 2005-07-06 12:37:50.000000000 +0200 +++ wine-20050830/dlls/advapi32/security.c 2005-08-22 11:18:48.000000000 +0200 @@ -2663,8 +2663,7 @@ if (SecurityDescriptor) { - SecurityDescriptor->Owner = (PSID) ((DWORD) lpNext - - (DWORD) SecurityDescriptor); + SecurityDescriptor->Owner = (PSID)(lpNext - (LPBYTE)SecurityDescriptor); lpNext += bytes; /* Advance to next token */ } @@ -2682,8 +2681,7 @@ if (SecurityDescriptor) { - SecurityDescriptor->Group = (PSID) ((DWORD) lpNext - - (DWORD) SecurityDescriptor); + SecurityDescriptor->Group = (PSID)(lpNext - (LPBYTE)SecurityDescriptor); lpNext += bytes; /* Advance to next token */ } @@ -2703,8 +2701,7 @@ if (SecurityDescriptor) { SecurityDescriptor->Control |= SE_DACL_PRESENT | flags; - SecurityDescriptor->Dacl = (PACL) ((DWORD) lpNext - - (DWORD) SecurityDescriptor); + SecurityDescriptor->Dacl = (PACL)(lpNext - (LPBYTE)SecurityDescriptor); lpNext += bytes; /* Advance to next token */ } @@ -2724,8 +2721,7 @@ if (SecurityDescriptor) { SecurityDescriptor->Control |= SE_SACL_PRESENT | flags; - SecurityDescriptor->Sacl = (PACL) ((DWORD) lpNext - - (DWORD) SecurityDescriptor); + SecurityDescriptor->Sacl = (PACL)(lpNext - (LPBYTE)SecurityDescriptor); lpNext += bytes; /* Advance to next token */ } diff -urN wine-20050725/dlls/advapi32/service.c wine-20050830/dlls/advapi32/service.c --- wine-20050725/dlls/advapi32/service.c 2005-07-06 21:08:05.000000000 +0200 +++ wine-20050830/dlls/advapi32/service.c 2005-08-27 12:00:39.000000000 +0200 @@ -895,7 +895,7 @@ service_data *service; BOOL r = TRUE; - TRACE("%lx %lx %lx %lx %lx %lx %lx %lx\n", hService, + TRACE("%p %lx %lx %lx %lx %lx %lx %lx\n", hService, lpStatus->dwServiceType, lpStatus->dwCurrentState, lpStatus->dwControlsAccepted, lpStatus->dwWin32ExitCode, lpStatus->dwServiceSpecificExitCode, lpStatus->dwCheckPoint, @@ -1511,7 +1511,7 @@ return r; } - hLock = LockServiceDatabase(hsvc->scm); + hLock = LockServiceDatabase((SC_HANDLE)hsvc->scm); if (!hLock) return r; @@ -1637,7 +1637,7 @@ CHAR str_buffer[ MAX_PATH ]; LONG r; DWORD type, val, sz, total, n; - LPBYTE p; + LPSTR p; TRACE("%p %p %ld %p\n", hService, lpServiceConfig, cbBufSize, pcbBytesNeeded); @@ -1715,7 +1715,7 @@ lpServiceConfig->dwErrorControl = val; /* now do the strings */ - p = (LPBYTE) &lpServiceConfig[1]; + p = (LPSTR) &lpServiceConfig[1]; n = total - sizeof (QUERY_SERVICE_CONFIGA); sz = sizeof(str_buffer); @@ -1725,7 +1725,7 @@ sz = ExpandEnvironmentStringsA(str_buffer, p, n); if( 0 == sz || sz > n ) return FALSE; - lpServiceConfig->lpBinaryPathName = (LPSTR) p; + lpServiceConfig->lpBinaryPathName = p; p += sz; n -= sz; } @@ -1739,7 +1739,7 @@ r = RegQueryValueExA( hKey, szGroup, 0, &type, (LPBYTE)p, &sz ); if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) ) { - lpServiceConfig->lpLoadOrderGroup = (LPSTR) p; + lpServiceConfig->lpLoadOrderGroup = p; p += sz; n -= sz; } @@ -1748,7 +1748,7 @@ r = RegQueryValueExA( hKey, szDependencies, 0, &type, (LPBYTE)p, &sz ); if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) ) { - lpServiceConfig->lpDependencies = (LPSTR) p; + lpServiceConfig->lpDependencies = p; p += sz; n -= sz; } @@ -2224,7 +2224,7 @@ BOOL bSetBitsOn, BOOL bUpdateImmediately) { - FIXME("%08lx %08lx %x %x\n", hServiceStatus, dwServiceBits, + FIXME("%p %08lx %x %x\n", hServiceStatus, dwServiceBits, bSetBitsOn, bUpdateImmediately); return TRUE; } diff -urN wine-20050725/dlls/advapi32/tests/crypt_lmhash.c wine-20050830/dlls/advapi32/tests/crypt_lmhash.c --- wine-20050725/dlls/advapi32/tests/crypt_lmhash.c 2005-06-20 16:18:05.000000000 +0200 +++ wine-20050830/dlls/advapi32/tests/crypt_lmhash.c 2005-08-27 12:00:39.000000000 +0200 @@ -29,9 +29,9 @@ static void test_SystemFunction006(void) { - static unsigned char lmhash[16 + 1]; + char lmhash[16 + 1]; - unsigned char passwd[] = { 's','e','c','r','e','t', 0, 0, 0, 0, 0, 0, 0, 0 }; + char passwd[] = { 's','e','c','r','e','t', 0, 0, 0, 0, 0, 0, 0, 0 }; unsigned char expect[] = { 0x85, 0xf5, 0x28, 0x9f, 0x09, 0xdc, 0xa7, 0xeb, 0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee }; diff -urN wine-20050725/dlls/advapi32/tests/crypt_md4.c wine-20050830/dlls/advapi32/tests/crypt_md4.c --- wine-20050725/dlls/advapi32/tests/crypt_md4.c 2005-06-13 12:00:37.000000000 +0200 +++ wine-20050830/dlls/advapi32/tests/crypt_md4.c 2005-08-27 12:00:39.000000000 +0200 @@ -51,7 +51,7 @@ "In our business there is Sin" "In our bodies, there is Die"; - int size = strlen( message ); + int size = sizeof(message) - 1; HMODULE module; MD4_CTX ctx; diff -urN wine-20050725/dlls/advapi32/tests/crypt_md5.c wine-20050830/dlls/advapi32/tests/crypt_md5.c --- wine-20050725/dlls/advapi32/tests/crypt_md5.c 2005-06-13 12:00:37.000000000 +0200 +++ wine-20050830/dlls/advapi32/tests/crypt_md5.c 2005-08-27 12:00:39.000000000 +0200 @@ -51,7 +51,7 @@ "In our business there is Sin" "In our bodies, there is Die"; - int size = strlen( message ); + int size = sizeof(message) - 1; HMODULE module; MD5_CTX ctx; diff -urN wine-20050725/dlls/advpack/advpack.spec wine-20050830/dlls/advpack/advpack.spec --- wine-20050725/dlls/advpack/advpack.spec 2005-07-11 20:01:48.000000000 +0200 +++ wine-20050830/dlls/advpack/advpack.spec 2005-08-09 12:31:35.000000000 +0200 @@ -3,7 +3,7 @@ @ stub CloseINFEngine @ stdcall DelNode(str long) @ stdcall DelNodeRunDLL32(ptr ptr str long) -@ stdcall DllMain(long long ptr) +@ stdcall -private DllMain(long long ptr) @ stdcall DoInfInstall(ptr) @ stdcall ExecuteCab(ptr ptr ptr) @ stub ExtractFiles diff -urN wine-20050725/dlls/advpack/tests/advpack.c wine-20050830/dlls/advpack/tests/advpack.c --- wine-20050725/dlls/advpack/tests/advpack.c 2005-06-20 16:18:05.000000000 +0200 +++ wine-20050830/dlls/advpack/tests/advpack.c 2005-08-15 12:47:31.000000000 +0200 @@ -61,6 +61,9 @@ currDirLen = GetCurrentDirectoryA(sizeof(currDir) / sizeof(CHAR), currDir); assert(currDirLen > 0 && currDirLen < sizeof(currDir) / sizeof(CHAR)); + if(currDir[currDirLen - 1] == '\\') + currDir[--currDirLen] = 0; + /* Simple tests; these should fail. */ hr = pDelNode(NULL, 0); ok (hr == E_FAIL, "DelNode called with NULL pathname should return E_FAIL\n"); diff -urN wine-20050725/dlls/amstream/.cvsignore wine-20050830/dlls/amstream/.cvsignore --- wine-20050725/dlls/amstream/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050830/dlls/amstream/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile amstream.dll.dbg.c -libamstream.def version.res diff -urN wine-20050725/dlls/amstream/Makefile.in wine-20050830/dlls/amstream/Makefile.in --- wine-20050725/dlls/amstream/Makefile.in 2005-05-09 16:42:36.000000000 +0200 +++ wine-20050830/dlls/amstream/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = amstream.dll -IMPORTLIB = libamstream.$(IMPLIBEXT) IMPORTS = ole32 user32 advapi32 kernel32 EXTRALIBS = -lstrmiids -luuid diff -urN wine-20050725/dlls/amstream/amstream.spec wine-20050830/dlls/amstream/amstream.spec --- wine-20050725/dlls/amstream/amstream.spec 2004-03-09 02:29:57.000000000 +0100 +++ wine-20050830/dlls/amstream/amstream.spec 2005-08-08 19:35:29.000000000 +0200 @@ -1,4 +1,4 @@ -@ stdcall -private DllCanUnloadNow() AMSTREAM_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) AMSTREAM_DllGetClassObject -@ stdcall -private DllRegisterServer() AMSTREAM_DllRegisterServer -@ stdcall -private DllUnregisterServer() AMSTREAM_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/amstream/main.c wine-20050830/dlls/amstream/main.c --- wine-20050725/dlls/amstream/main.c 2005-07-11 16:24:53.000000000 +0200 +++ wine-20050830/dlls/amstream/main.c 2005-08-08 19:35:29.000000000 +0200 @@ -167,7 +167,7 @@ * Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG, * E_UNEXPECTED */ -DWORD WINAPI AMSTREAM_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { int i; IClassFactoryImpl *factory; @@ -205,7 +205,7 @@ /*********************************************************************** * DllCanUnloadNow (AMSTREAM.@) */ -HRESULT WINAPI AMSTREAM_DllCanUnloadNow() +HRESULT WINAPI DllCanUnloadNow(void) { return dll_ref != 0 ? S_FALSE : S_OK; } diff -urN wine-20050725/dlls/amstream/regsvr.c wine-20050830/dlls/amstream/regsvr.c --- wine-20050725/dlls/amstream/regsvr.c 2004-03-09 02:29:57.000000000 +0100 +++ wine-20050830/dlls/amstream/regsvr.c 2005-08-08 19:35:29.000000000 +0200 @@ -526,7 +526,7 @@ /*********************************************************************** * DllRegisterServer (AMSTREAM.@) */ -HRESULT WINAPI AMSTREAM_DllRegisterServer(void) +HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -541,7 +541,7 @@ /*********************************************************************** * DllUnregisterServer (AMSTREAM.@) */ -HRESULT WINAPI AMSTREAM_DllUnregisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; diff -urN wine-20050725/dlls/atl/atl.spec wine-20050830/dlls/atl/atl.spec --- wine-20050725/dlls/atl/atl.spec 2005-03-17 11:24:42.000000000 +0100 +++ wine-20050830/dlls/atl/atl.spec 2005-08-08 19:35:29.000000000 +0200 @@ -1,7 +1,7 @@ -1 stdcall -private DllCanUnloadNow() ATL_DllCanUnloadNow -2 stdcall -private DllGetClassObject(ptr ptr ptr) ATL_DllGetClassObject -3 stdcall -private DllRegisterServer() ATL_DllRegisterServer -4 stdcall -private DllUnregisterServer() ATL_DllUnregisterServer +1 stdcall -private DllCanUnloadNow() +2 stdcall -private DllGetClassObject(ptr ptr ptr) +3 stdcall -private DllRegisterServer() +4 stdcall -private DllUnregisterServer() 10 stdcall AtlAdvise(ptr ptr ptr ptr) 11 stdcall AtlUnadvise(ptr ptr long) 12 stdcall AtlFreeMarshalStream(ptr) diff -urN wine-20050725/dlls/atl/atl_main.c wine-20050830/dlls/atl/atl_main.c --- wine-20050725/dlls/atl/atl_main.c 2005-04-22 21:04:18.000000000 +0200 +++ wine-20050830/dlls/atl/atl_main.c 2005-08-24 20:13:24.000000000 +0200 @@ -49,14 +49,24 @@ return TRUE; } +#define ATLVer1Size 100 + HRESULT WINAPI AtlModuleInit(_ATL_MODULEA* pM, _ATL_OBJMAP_ENTRYA* p, HINSTANCE h) { INT i; + UINT size; FIXME("SEMI-STUB (%p %p %p)\n",pM,p,h); - memset(pM,0,sizeof(_ATL_MODULEA)); - pM->cbSize = sizeof(_ATL_MODULEA); + size = pM->cbSize; + if (size != sizeof(_ATL_MODULEA) && size != ATLVer1Size) + { + FIXME("Unknown structure version (size %i)\n",size); + return E_INVALIDARG; + } + + memset(pM,0,pM->cbSize); + pM->cbSize = size; pM->m_hInst = h; pM->m_hInstResource = h; pM->m_hInstTypeLib = h; @@ -65,11 +75,15 @@ /* call mains */ i = 0; - while (pM->m_pObjMap[i].pclsid != NULL) + if (pM->m_pObjMap != NULL && size > ATLVer1Size) { - TRACE("Initializing object %i\n",i); - p[i].pfnObjectMain(TRUE); - i++; + while (pM->m_pObjMap[i].pclsid != NULL) + { + TRACE("Initializing object %i %p\n",i,p[i].pfnObjectMain); + if (p[i].pfnObjectMain) + p[i].pfnObjectMain(TRUE); + i++; + } } return S_OK; @@ -166,27 +180,6 @@ } /*********************************************************************** - * AtlModuleUpdateRegistryFromResourceD [ATL.@] - * - */ -HRESULT WINAPI AtlModuleUpdateRegistryFromResourceD(_ATL_MODULEW* pM, LPCOLESTR lpszRes, - BOOL bRegister, struct _ATL_REGMAP_ENTRY* pMapEntries, IRegistrar* pReg) -{ - HINSTANCE hInst = pM->m_hInst; - /* everything inside this function below this point - * should go into atl71.AtlUpdateRegistryFromResourceD - */ - WCHAR module_name[MAX_PATH]; - - GetModuleFileNameW(hInst, module_name, MAX_PATH); - - FIXME("stub %p (%s), %s, %d, %p, %p\n", hInst, debugstr_w(module_name), - debugstr_w(lpszRes), bRegister, pMapEntries, pReg); - - return S_OK; -} - -/*********************************************************************** * AtlModuleRegisterServer [ATL.@] * */ diff -urN wine-20050725/dlls/atl/registrar.c wine-20050830/dlls/atl/registrar.c --- wine-20050725/dlls/atl/registrar.c 2005-07-11 16:24:53.000000000 +0200 +++ wine-20050830/dlls/atl/registrar.c 2005-08-22 12:20:23.000000000 +0200 @@ -31,6 +31,7 @@ #define ATL_INITGUID #include "atliface.h" +#include "atlbase.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -633,7 +634,7 @@ { Registrar *This = (Registrar*)iface; TRACE("(%p)->(%s %d %s)\n", iface, debugstr_w(resFileName), nID, debugstr_w(szType)); - return resource_register(This, resFileName, (LPOLESTR)nID, szType, TRUE); + return resource_register(This, resFileName, MAKEINTRESOURCEW(nID), szType, TRUE); } static HRESULT WINAPI Registrar_ResourceUnregister(IRegistrar* iface, LPCOLESTR resFileName, @@ -641,7 +642,7 @@ { Registrar *This = (Registrar*)iface; TRACE("(%p)->(%s %d %s)\n", This, debugstr_w(resFileName), nID, debugstr_w(szType)); - return resource_register(This, resFileName, (LPOLESTR)nID, szType, FALSE); + return resource_register(This, resFileName, MAKEINTRESOURCEW(nID), szType, FALSE); } static const IRegistrarVtbl RegistrarVtbl = { @@ -736,9 +737,9 @@ static IClassFactory RegistrarCF = { &IRegistrarCFVtbl }; /************************************************************** - * DllGetClassObject implementation + * DllGetClassObject (ATL.2) */ -HRESULT WINAPI ATL_DllGetClassObject(REFCLSID clsid, REFIID riid, LPVOID *ppvObject) +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, LPVOID *ppvObject) { TRACE("(%s %s %p)", debugstr_guid(clsid), debugstr_guid(riid), ppvObject); @@ -753,14 +754,13 @@ extern HINSTANCE hInst; -static HRESULT do_register_server(BOOL do_register) +static HRESULT do_register_dll_server(LPCOLESTR wszDll, LPCOLESTR wszId, BOOL do_register) { WCHAR buf[MAX_PATH]; HRESULT hres; IRegistrar *pRegistrar; static const WCHAR wszModule[] = {'M','O','D','U','L','E',0}; - static const WCHAR wszDll[] = {'a','t','l','.','d','l','l',0}; static const WCHAR wszRegistry[] = {'R','E','G','I','S','T','R','Y',0}; static const WCHAR wszCLSID_ATLRegistrar[] = {'C','L','S','I','D','_','A','T','L','R','e','g','i','s','t','r','a','r',0}; @@ -772,18 +772,55 @@ IRegistrar_AddReplacement(pRegistrar, wszCLSID_ATLRegistrar, buf); if(do_register) - hres = IRegistrar_ResourceRegister(pRegistrar, wszDll, 1, wszRegistry); + hres = IRegistrar_ResourceRegisterSz(pRegistrar, wszDll, wszId, wszRegistry); else - hres = IRegistrar_ResourceUnregister(pRegistrar, wszDll, 1, wszRegistry); + hres = IRegistrar_ResourceUnregisterSz(pRegistrar, wszDll, wszId, wszRegistry); IRegistrar_Release(pRegistrar); return hres; } +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); +} + +/*********************************************************************** + * AtlModuleUpdateRegistryFromResourceD [ATL.@] + * + */ +HRESULT WINAPI AtlModuleUpdateRegistryFromResourceD(_ATL_MODULEW* pM, LPCOLESTR lpszRes, + BOOL bRegister, struct _ATL_REGMAP_ENTRY* pMapEntries, IRegistrar* pReg) +{ + HINSTANCE lhInst = pM->m_hInst; + /* everything inside this function below this point + * should go into atl71.AtlUpdateRegistryFromResourceD + */ + WCHAR module_name[MAX_PATH]; + + if(pMapEntries || pReg) { + FIXME("MapEntries and Registrar parameter not supported\n"); + return E_FAIL; + } + + if(!GetModuleFileNameW(lhInst, module_name, MAX_PATH)) { + FIXME("hinst %p: did not get module name\n", + lhInst); + return E_FAIL; + } + + TRACE("%p (%s), %s, %d, %p, %p\n", hInst, debugstr_w(module_name), + debugstr_w(lpszRes), bRegister, pMapEntries, pReg); + + return do_register_dll_server(module_name, lpszRes, bRegister); +} + /*********************************************************************** * DllRegisterServer (ATL.@) */ -HRESULT WINAPI ATL_DllRegisterServer(void) +HRESULT WINAPI DllRegisterServer(void) { TRACE("\n"); return do_register_server(TRUE); @@ -792,7 +829,7 @@ /*********************************************************************** * DllRegisterServer (ATL.@) */ -HRESULT WINAPI ATL_DllUnregisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { TRACE("\n"); return do_register_server(FALSE); @@ -801,7 +838,7 @@ /*********************************************************************** * DllCanUnloadNow (ATL.@) */ -HRESULT WINAPI ATL_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { TRACE("dll_count = %lu\n", dll_count); return dll_count ? S_FALSE : S_OK; diff -urN wine-20050725/dlls/avicap32/avicap32_main.c wine-20050830/dlls/avicap32/avicap32_main.c --- wine-20050725/dlls/avicap32/avicap32_main.c 2005-04-27 11:46:25.000000000 +0200 +++ wine-20050830/dlls/avicap32/avicap32_main.c 2005-08-03 23:25:11.000000000 +0200 @@ -17,8 +17,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define COM_NO_WINDOWS_H #include "config.h" +#include "wine/port.h" + +#define COM_NO_WINDOWS_H + #include #include #include diff -urN wine-20050725/dlls/avifil32/avifil32.spec wine-20050830/dlls/avifil32/avifil32.spec --- wine-20050725/dlls/avifil32/avifil32.spec 2005-01-03 21:43:13.000000000 +0100 +++ wine-20050830/dlls/avifil32/avifil32.spec 2005-08-08 19:35:29.000000000 +0200 @@ -59,10 +59,10 @@ @ stdcall AVIStreamWriteData(ptr long ptr long) @ extern CLSID_AVISimpleUnMarshal @ stdcall CreateEditableStream(ptr ptr) -@ stdcall -private DllCanUnloadNow() AVIFILE_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) AVIFILE_DllGetClassObject -@ stdcall -private DllRegisterServer() AVIFILE_DllRegisterServer -@ stdcall -private DllUnregisterServer() AVIFILE_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() @ stdcall EditStreamClone(ptr ptr) @ stdcall EditStreamCopy(ptr ptr ptr ptr) @ stdcall EditStreamCut(ptr ptr ptr ptr) diff -urN wine-20050725/dlls/avifil32/avifile.c wine-20050830/dlls/avifil32/avifile.c --- wine-20050725/dlls/avifil32/avifile.c 2005-07-05 18:19:13.000000000 +0200 +++ wine-20050830/dlls/avifil32/avifile.c 2005-08-17 13:34:23.000000000 +0200 @@ -1086,7 +1086,7 @@ if (This->sInfo.dwSampleSize != 0) { /* fixed samplesize -- we can read over frame/block boundaries */ - ULONG block = start; + LONG block = start; LONG offset = 0; /* convert start sample to block,offset pair */ diff -urN wine-20050725/dlls/avifil32/editstream.c wine-20050830/dlls/avifil32/editstream.c --- wine-20050725/dlls/avifil32/editstream.c 2005-07-05 18:19:13.000000000 +0200 +++ wine-20050830/dlls/avifil32/editstream.c 2005-08-17 13:34:23.000000000 +0200 @@ -40,7 +40,6 @@ /***********************************************************************/ /* internal interface to get access to table of stream in an editable stream */ -typedef struct IEditStreamInternal IEditStreamInternal; typedef struct _EditStreamTable { PAVISTREAM pStream; /* stream which contains the data */ @@ -553,7 +552,7 @@ IAVIEditStreamImpl *pEdit = NULL; PAVISTREAM pStream; DWORD startPos, endPos, streamNr, nStreams; - LONG n; + ULONG n; TRACE("(%p,%p,%p,%p,%ld,%ld)\n",iface,plStart,plLength, pSource,lStart,lLength); diff -urN wine-20050725/dlls/avifil32/factory.c wine-20050830/dlls/avifil32/factory.c --- wine-20050725/dlls/avifil32/factory.c 2005-05-27 22:17:37.000000000 +0200 +++ wine-20050830/dlls/avifil32/factory.c 2005-08-15 12:48:51.000000000 +0200 @@ -182,7 +182,7 @@ /*********************************************************************** * DllGetClassObject (AVIFIL32.@) */ -HRESULT WINAPI AVIFILE_DllGetClassObject(const CLSID* pclsid,REFIID piid,LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID pclsid, REFIID piid, LPVOID *ppv) { TRACE("(%s,%s,%p)\n", debugstr_guid(pclsid), debugstr_guid(piid), ppv); @@ -195,7 +195,7 @@ /***************************************************************************** * DllCanUnloadNow (AVIFIL32.@) */ -DWORD WINAPI AVIFILE_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { return ((AVIFILE_bLocked || AVIFILE_uUseCount) ? S_FALSE : S_OK); } @@ -205,7 +205,7 @@ */ BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved) { - TRACE("(%p,%lu,%p)\n", hInstDll, fdwReason, lpvReserved); + TRACE("(%p,%ld,%p)\n", hInstDll, fdwReason, lpvReserved); switch (fdwReason) { case DLL_PROCESS_ATTACH: diff -urN wine-20050725/dlls/avifil32/regsvr.c wine-20050830/dlls/avifil32/regsvr.c --- wine-20050725/dlls/avifil32/regsvr.c 2003-09-06 01:08:44.000000000 +0200 +++ wine-20050830/dlls/avifil32/regsvr.c 2005-08-08 19:35:29.000000000 +0200 @@ -552,7 +552,7 @@ /*********************************************************************** * DllRegisterServer (AVIFILE.@) */ -HRESULT WINAPI AVIFILE_DllRegisterServer(void) +HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -567,7 +567,7 @@ /*********************************************************************** * DllUnregisterServer (AVIFILE.@) */ -HRESULT WINAPI AVIFILE_DllUnregisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; diff -urN wine-20050725/dlls/cabinet/cabinet.h wine-20050830/dlls/cabinet/cabinet.h --- wine-20050725/dlls/cabinet/cabinet.h 2005-06-24 14:16:37.000000000 +0200 +++ wine-20050830/dlls/cabinet/cabinet.h 2005-08-27 12:00:39.000000000 +0200 @@ -324,15 +324,15 @@ cab_ULONG cDataBlocks; cab_ULONG cbFileRemainer; /* uncompressed, yet to be written data */ /* of spanned file of a spanning folder of a spanning cabinet */ - cab_UBYTE szFileNameCFDATA1[CB_MAX_FILENAME]; + char szFileNameCFDATA1[CB_MAX_FILENAME]; int handleCFDATA1; - cab_UBYTE szFileNameCFFILE1[CB_MAX_FILENAME]; + char szFileNameCFFILE1[CB_MAX_FILENAME]; int handleCFFILE1; - cab_UBYTE szFileNameCFDATA2[CB_MAX_FILENAME]; + char szFileNameCFDATA2[CB_MAX_FILENAME]; int handleCFDATA2; - cab_UBYTE szFileNameCFFILE2[CB_MAX_FILENAME]; + char szFileNameCFFILE2[CB_MAX_FILENAME]; int handleCFFILE2; - cab_UBYTE szFileNameCFFOLDER[CB_MAX_FILENAME]; + char szFileNameCFFOLDER[CB_MAX_FILENAME]; int handleCFFOLDER; cab_ULONG sizeFileCFDATA1; cab_ULONG sizeFileCFFILE1; diff -urN wine-20050725/dlls/cabinet/cabinet.spec wine-20050830/dlls/cabinet/cabinet.spec --- wine-20050725/dlls/cabinet/cabinet.spec 2003-12-08 22:40:49.000000000 +0100 +++ wine-20050830/dlls/cabinet/cabinet.spec 2005-08-08 19:35:29.000000000 +0200 @@ -1,5 +1,5 @@ 1 stub GetDllVersion -2 stdcall DllGetVersion (ptr) CABINET_DllGetVersion +2 stdcall -private DllGetVersion (ptr) 3 stdcall Extract(ptr str) 4 stub DeleteExtractedFiles 10 cdecl FCICreate(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) diff -urN wine-20050725/dlls/cabinet/cabinet_main.c wine-20050830/dlls/cabinet/cabinet_main.c --- wine-20050725/dlls/cabinet/cabinet_main.c 2005-06-07 22:06:39.000000000 +0200 +++ wine-20050830/dlls/cabinet/cabinet_main.c 2005-08-08 19:35:29.000000000 +0200 @@ -52,7 +52,7 @@ * NOTES * Supposedly returns version from IE6SP1RP1 */ -HRESULT WINAPI CABINET_DllGetVersion (DLLVERSIONINFO *pdvi) +HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi) { WARN("hmmm... not right version number \"5.1.1106.1\"?\n"); diff -urN wine-20050725/dlls/comcat/.cvsignore wine-20050830/dlls/comcat/.cvsignore --- wine-20050725/dlls/comcat/.cvsignore 2005-05-07 14:39:58.000000000 +0200 +++ wine-20050830/dlls/comcat/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile comcat.dll.dbg.c -libcomcat.def version.res diff -urN wine-20050725/dlls/comcat/Makefile.in wine-20050830/dlls/comcat/Makefile.in --- wine-20050725/dlls/comcat/Makefile.in 2005-05-09 16:42:36.000000000 +0200 +++ wine-20050830/dlls/comcat/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = comcat.dll -IMPORTLIB = libcomcat.$(IMPLIBEXT) IMPORTS = ole32 user32 advapi32 kernel32 EXTRALIBS = $(LIBUNICODE) -luuid diff -urN wine-20050725/dlls/comcat/comcat.spec wine-20050830/dlls/comcat/comcat.spec --- wine-20050725/dlls/comcat/comcat.spec 2003-07-30 05:48:56.000000000 +0200 +++ wine-20050830/dlls/comcat/comcat.spec 2005-08-08 19:35:29.000000000 +0200 @@ -1,4 +1,4 @@ -@ stdcall -private DllCanUnloadNow() COMCAT_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) COMCAT_DllGetClassObject -@ stdcall -private DllRegisterServer() COMCAT_DllRegisterServer -@ stdcall -private DllUnregisterServer() COMCAT_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/comcat/comcat_main.c wine-20050830/dlls/comcat/comcat_main.c --- wine-20050725/dlls/comcat/comcat_main.c 2005-07-11 16:24:53.000000000 +0200 +++ wine-20050830/dlls/comcat/comcat_main.c 2005-08-08 19:35:29.000000000 +0200 @@ -34,7 +34,7 @@ /*********************************************************************** * DllGetClassObject (COMCAT.@) */ -HRESULT WINAPI COMCAT_DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) { *ppv = NULL; if (IsEqualGUID(rclsid, &CLSID_StdComponentCategoriesMgr)) { @@ -47,7 +47,7 @@ /*********************************************************************** * DllCanUnloadNow (COMCAT.@) */ -HRESULT WINAPI COMCAT_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { return dll_ref != 0 ? S_FALSE : S_OK; } diff -urN wine-20050725/dlls/comcat/regsvr.c wine-20050830/dlls/comcat/regsvr.c --- wine-20050725/dlls/comcat/regsvr.c 2004-02-27 07:08:33.000000000 +0100 +++ wine-20050830/dlls/comcat/regsvr.c 2005-08-08 19:35:29.000000000 +0200 @@ -447,7 +447,7 @@ /*********************************************************************** * DllRegisterServer (COMCAT.@) */ -HRESULT WINAPI COMCAT_DllRegisterServer() +HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -462,7 +462,7 @@ /*********************************************************************** * DllUnregisterServer (COMCAT.@) */ -HRESULT WINAPI COMCAT_DllUnregisterServer() +HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; diff -urN wine-20050725/dlls/comctl32/Makefile.in wine-20050830/dlls/comctl32/Makefile.in --- wine-20050725/dlls/comctl32/Makefile.in 2005-07-18 12:31:06.000000000 +0200 +++ wine-20050830/dlls/comctl32/Makefile.in 2005-08-19 12:05:34.000000000 +0200 @@ -31,10 +31,15 @@ propsheet.c \ rebar.c \ smoothscroll.c \ - string.c \ status.c \ + string.c \ syslink.c \ tab.c \ + theme_combo.c \ + theme_dialog.c \ + theme_edit.c \ + theme_listbox.c \ + theming.c \ toolbar.c \ tooltips.c \ trackbar.c \ diff -urN wine-20050725/dlls/comctl32/animate.c wine-20050830/dlls/comctl32/animate.c --- wine-20050725/dlls/comctl32/animate.c 2005-03-25 21:49:00.000000000 +0100 +++ wine-20050830/dlls/comctl32/animate.c 2005-08-30 12:07:18.000000000 +0200 @@ -53,7 +53,7 @@ HMODULE hModule; HIC (WINAPI *fnICOpen)(DWORD, DWORD, UINT); LRESULT (WINAPI *fnICClose)(HIC); - LRESULT (WINAPI *fnICSendMessage)(HIC, UINT, DWORD, DWORD); + LRESULT (WINAPI *fnICSendMessage)(HIC, UINT, DWORD_PTR, DWORD_PTR); DWORD (WINAPIV *fnICDecompress)(HIC,DWORD,LPBITMAPINFOHEADER,LPVOID,LPBITMAPINFOHEADER,LPVOID); } fnIC; @@ -139,7 +139,8 @@ { infoPtr->hMMio = mmioOpenW(lpName, 0, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE); - return (BOOL)infoPtr->hMMio; + if(!infoPtr->hMMio) return FALSE; + return TRUE; } @@ -655,14 +656,14 @@ } outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, - (DWORD)infoPtr->inbih, 0L); + (DWORD_PTR)infoPtr->inbih, 0L); infoPtr->outbih = Alloc(outSize); if (!infoPtr->outbih) return FALSE; if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, - (DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != outSize) + (DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != outSize) { WARN("Can't get output BIH\n"); return FALSE; @@ -673,7 +674,7 @@ return FALSE; if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN, - (DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != ICERR_OK) { + (DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != ICERR_OK) { WARN("Can't begin decompression\n"); return FALSE; } @@ -696,10 +697,10 @@ if (!hInstance) hInstance = (HINSTANCE)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_HINSTANCE); - if (HIWORD(lpszName)) - { - TRACE("(\"%s\");\n", debugstr_w(lpszName)); + TRACE("(%s)\n", debugstr_w(lpszName)); + if (HIWORD(lpszName)) + { if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName)) { TRACE("No AVI resource found!\n"); @@ -712,9 +713,7 @@ } else { - TRACE("(%u);\n", (WORD)(DWORD)lpszName); - - if (!ANIMATE_LoadResW(infoPtr, hInstance, MAKEINTRESOURCEW((INT)lpszName))) + if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName)) { WARN("No AVI resource found!\n"); return FALSE; diff -urN wine-20050725/dlls/comctl32/comboex.c wine-20050830/dlls/comctl32/comboex.c --- wine-20050725/dlls/comctl32/comboex.c 2005-05-04 12:37:17.000000000 +0200 +++ wine-20050830/dlls/comctl32/comboex.c 2005-08-30 12:07:18.000000000 +0200 @@ -839,10 +839,10 @@ } -static DWORD COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index) +static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index) { CBE_ITEMDATA *item1, *item2; - DWORD ret = 0; + DWORD_PTR ret = 0; item1 = get_item_data(infoPtr, index); if ((item1 != NULL) && ((LRESULT)item1 != CB_ERR)) { @@ -854,7 +854,7 @@ if (item1->mask & CBEIF_LPARAM) ret = item1->lParam; TRACE("returning 0x%08lx\n", ret); } else { - ret = (DWORD)item1; + ret = (DWORD_PTR)item1; TRACE("non-valid result from combo, returning 0x%08lx\n", ret); } return ret; @@ -878,7 +878,7 @@ } -static DWORD COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT index, DWORD data) +static DWORD_PTR COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT index, DWORD_PTR data) { CBE_ITEMDATA *item1, *item2; @@ -894,8 +894,8 @@ TRACE("setting lparam to 0x%08lx\n", data); return 0; } - TRACE("non-valid result from combo 0x%08lx\n", (DWORD)item1); - return (LRESULT)item1; + TRACE("non-valid result from combo %p\n", item1); + return (DWORD_PTR)item1; } @@ -1136,10 +1136,10 @@ n = SendMessageW (infoPtr->hwndCombo, CB_GETCOUNT, 0, 0); for (cursel = 0; cursel < n; cursel++){ item = get_item_data(infoPtr, cursel); - if ((INT)item == CB_ERR) break; + if ((INT_PTR)item == CB_ERR) break; if (!cmptext(COMBOEX_GetText(infoPtr, item), wintext)) break; } - if ((cursel == n) || ((INT)item == CB_ERR)) { + if ((cursel == n) || ((INT_PTR)item == CB_ERR)) { TRACE("failed to find match??? item=%p cursel=%d\n", item, cursel); if (infoPtr->hwndEdit) @@ -1149,7 +1149,7 @@ } else { item = get_item_data(infoPtr, cursel); - if ((INT)item == CB_ERR) { + if ((INT_PTR)item == CB_ERR) { TRACE("failed to find match??? item=%p cursel=%d\n", item, cursel); if (infoPtr->hwndEdit) @@ -2223,7 +2223,7 @@ return COMBOEX_SetCursel (infoPtr, (INT)wParam); case CB_SETITEMDATA: - return COMBOEX_SetItemData (infoPtr, (INT)wParam, (DWORD)lParam); + return COMBOEX_SetItemData (infoPtr, (INT)wParam, (DWORD_PTR)lParam); case CB_SETITEMHEIGHT: return COMBOEX_SetItemHeight (infoPtr, (INT)wParam, (UINT)lParam); diff -urN wine-20050725/dlls/comctl32/comctl32.h wine-20050830/dlls/comctl32/comctl32.h --- wine-20050725/dlls/comctl32/comctl32.h 2005-06-09 11:50:56.000000000 +0200 +++ wine-20050830/dlls/comctl32/comctl32.h 2005-07-27 12:54:49.000000000 +0200 @@ -249,4 +249,8 @@ to->wMilliseconds = from->wMilliseconds; } +extern void THEMING_Initialize(void); +extern LRESULT THEMING_CallOriginalClass(HWND, UINT, WPARAM, LPARAM); +extern void THEMING_SetSubclassData(HWND, ULONG_PTR); + #endif /* __WINE_COMCTL32_H */ diff -urN wine-20050725/dlls/comctl32/comctl32.spec wine-20050830/dlls/comctl32/comctl32.spec --- wine-20050725/dlls/comctl32/comctl32.spec 2005-02-23 16:41:14.000000000 +0100 +++ wine-20050830/dlls/comctl32/comctl32.spec 2005-08-08 19:35:29.000000000 +0200 @@ -123,8 +123,8 @@ @ stdcall CreateStatusWindowW(long wstr long long) @ stdcall CreateToolbarEx(long long long long long long ptr long long long long long long) @ stdcall DestroyPropertySheetPage(long) -@ stdcall DllGetVersion(ptr) COMCTL32_DllGetVersion -@ stdcall DllInstall(long ptr) COMCTL32_DllInstall +@ stdcall -private DllGetVersion(ptr) +@ stdcall -private DllInstall(long wstr) @ stdcall DrawStatusText(long ptr ptr long) DrawStatusTextA @ stdcall DrawStatusTextW(long ptr wstr long) @ stdcall FlatSB_EnableScrollBar (long long long) diff -urN wine-20050725/dlls/comctl32/comctl32undoc.c wine-20050830/dlls/comctl32/comctl32undoc.c --- wine-20050725/dlls/comctl32/comctl32undoc.c 2005-07-06 12:32:18.000000000 +0200 +++ wine-20050830/dlls/comctl32/comctl32undoc.c 2005-08-30 12:07:18.000000000 +0200 @@ -274,7 +274,6 @@ HKEY newkey; WCHAR realname[2]; LPWINEMRUITEM witem; - static const WCHAR emptyW[] = {'\0'}; /* or should we do the following instead of RegOpenKeyEx: */ @@ -287,7 +286,7 @@ err); if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, 0, - emptyW, + NULL, REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, 0, @@ -653,7 +652,6 @@ WCHAR realname[2]; LPWINEMRUITEM witem; DWORD type; - static const WCHAR emptyW[] = {'\0'}; /* get space to save indices that will turn into names * but in order of most to least recently used @@ -668,16 +666,16 @@ /* open the sub key */ if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, 0, - emptyW, + NULL, REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, 0, &newkey, &dwdisp))) { /* error - what to do ??? */ - ERR("(%lu %lu %lx %lx \"%s\" %p): Could not open key, error=%d\n", + ERR("(%lu %lu %lx %p %s %p): Could not open key, error=%d\n", mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags, - (DWORD)mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey), + mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey), mp->extview.lpfnCompare, err); return 0; } @@ -718,9 +716,9 @@ else mp->cursize = 0; - TRACE("(%lu %lu %lx %lx \"%s\" %p): Current Size = %ld\n", + TRACE("(%lu %lu %lx %p %s %p): Current Size = %ld\n", mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags, - (DWORD)mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey), + mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey), mp->extview.lpfnCompare, mp->cursize); return (HANDLE)mp; } diff -urN wine-20050725/dlls/comctl32/commctrl.c wine-20050830/dlls/comctl32/commctrl.c --- wine-20050725/dlls/comctl32/commctrl.c 2005-06-09 11:50:56.000000000 +0200 +++ wine-20050830/dlls/comctl32/commctrl.c 2005-08-30 12:07:18.000000000 +0200 @@ -119,7 +119,7 @@ COMCTL32_hModule = (HMODULE)hinstDLL; /* add global subclassing atom (used by 'tooltip' and 'updown') */ - COMCTL32_wSubclass = (LPWSTR)(DWORD)GlobalAddAtomW (strCC32SubclassInfo); + COMCTL32_wSubclass = (LPWSTR)(DWORD_PTR)GlobalAddAtomW (strCC32SubclassInfo); TRACE("Subclassing atom added: %p\n", COMCTL32_wSubclass); /* create local pattern brush */ @@ -144,6 +144,9 @@ TRACKBAR_Register (); TREEVIEW_Register (); UPDOWN_Register (); + + /* subclass user32 controls */ + THEMING_Initialize (); break; case DLL_PROCESS_DETACH: @@ -305,7 +308,7 @@ */ BOOL WINAPI -ShowHideMenuCtl (HWND hwnd, UINT uFlags, LPINT lpInfo) +ShowHideMenuCtl (HWND hwnd, UINT_PTR uFlags, LPINT lpInfo) { LPINT lpMenuId; @@ -322,9 +325,9 @@ while (*lpMenuId != uFlags) lpMenuId += 2; - if (GetMenuState ((HMENU)lpInfo[1], uFlags, MF_BYCOMMAND) & MFS_CHECKED) { + if (GetMenuState ((HMENU)(DWORD_PTR)lpInfo[1], uFlags, MF_BYCOMMAND) & MFS_CHECKED) { /* uncheck menu item */ - CheckMenuItem ((HMENU)lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_UNCHECKED); + CheckMenuItem ((HMENU)(DWORD_PTR)lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_UNCHECKED); /* hide control */ lpMenuId++; @@ -333,7 +336,7 @@ } else { /* check menu item */ - CheckMenuItem ((HMENU)lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_CHECKED); + CheckMenuItem ((HMENU)(DWORD_PTR)lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_CHECKED); /* show control */ lpMenuId++; @@ -373,8 +376,8 @@ INT *lpRun; HWND hwndCtrl; - TRACE("(0x%08lx 0x%08lx 0x%08lx)\n", - (DWORD)hwnd, (DWORD)lpRect, (DWORD)lpInfo); + TRACE("(%p %p %p)\n", + hwnd, lpRect, lpInfo); GetClientRect (hwnd, lpRect); lpRun = lpInfo; @@ -503,7 +506,7 @@ return CreateWindowA(STATUSCLASSNAMEA, text, style, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - parent, (HMENU)wid, 0, 0); + parent, (HMENU)(DWORD_PTR)wid, 0, 0); } @@ -529,7 +532,7 @@ return CreateWindowW(STATUSCLASSNAMEW, text, style, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - parent, (HMENU)wid, 0, 0); + parent, (HMENU)(DWORD_PTR)wid, 0, 0); } @@ -564,7 +567,7 @@ { HWND hUD = CreateWindowW (UPDOWN_CLASSW, 0, style, x, y, cx, cy, - parent, (HMENU)id, inst, 0); + parent, (HMENU)(DWORD_PTR)id, inst, 0); if (hUD) { SendMessageW (hUD, UDM_SETBUDDY, (WPARAM)buddy, 0); SendMessageW (hUD, UDM_SETRANGE, 0, MAKELONG(maxVal, minVal)); @@ -725,7 +728,7 @@ hwndTB = CreateWindowExW(0, TOOLBARCLASSNAMEW, NULL, style|WS_CHILD, 0,0,100,30, - hwnd, (HMENU)wID, COMCTL32_hModule, NULL); + hwnd, (HMENU)(DWORD_PTR)wID, COMCTL32_hModule, NULL); if(hwndTB) { TBADDBITMAP tbab; @@ -784,7 +787,7 @@ */ HBITMAP WINAPI -CreateMappedBitmap (HINSTANCE hInstance, INT idBitmap, UINT wFlags, +CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags, LPCOLORMAP lpColorMap, INT iNumMaps) { HGLOBAL hglb; @@ -931,8 +934,7 @@ * Returns version of a comctl32.dll from IE4.01 SP1. */ -HRESULT WINAPI -COMCTL32_DllGetVersion (DLLVERSIONINFO *pdvi) +HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi) { if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) { WARN("wrong DLLVERSIONINFO size from app\n"); @@ -960,7 +962,7 @@ * Success: S_OK * Failure: A HRESULT error */ -HRESULT WINAPI COMCTL32_DllInstall(BOOL bInstall, LPCWSTR cmdline) +HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline) { FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE", debugstr_w(cmdline)); diff -urN wine-20050725/dlls/comctl32/datetime.c wine-20050830/dlls/comctl32/datetime.c --- wine-20050725/dlls/comctl32/datetime.c 2005-05-24 14:34:30.000000000 +0200 +++ wine-20050830/dlls/comctl32/datetime.c 2005-08-22 11:20:36.000000000 +0200 @@ -1164,6 +1164,15 @@ static LRESULT +DATETIME_SetFont (DATETIME_INFO *infoPtr, HFONT font, BOOL repaint) +{ + infoPtr->hFont = font; + if (repaint) InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); + return 0; +} + + +static LRESULT DATETIME_Create (HWND hwnd, LPCREATESTRUCTW lpcs) { static const WCHAR SysMonthCal32W[] = { 'S', 'y', 's', 'M', 'o', 'n', 't', 'h', 'C', 'a', 'l', '3', '2', 0 }; @@ -1314,6 +1323,12 @@ case WM_STYLECHANGED: return DATETIME_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam); + case WM_SETFONT: + return DATETIME_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam); + + case WM_GETFONT: + return (LRESULT) infoPtr->hFont; + default: if ((uMsg >= WM_USER) && (uMsg < WM_APP)) ERR("unknown msg %04x wp=%08x lp=%08lx\n", diff -urN wine-20050725/dlls/comctl32/dpa.c wine-20050830/dlls/comctl32/dpa.c --- wine-20050725/dlls/comctl32/dpa.c 2005-07-08 13:30:28.000000000 +0200 +++ wine-20050830/dlls/comctl32/dpa.c 2005-08-01 16:50:37.000000000 +0200 @@ -787,11 +787,6 @@ * RETURNS * Success: index of the pointer in the array. * Failure: -1 - * - * NOTES - * Binary search taken from R.Sedgewick "Algorithms in C"! - * Function is NOT tested! - * If something goes wrong, blame HIM not ME! (Eric Kohl) */ INT WINAPI DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart, PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions) @@ -807,47 +802,34 @@ INT l, r, x, n; LPVOID *lpPtr; - TRACE("binary search\n"); - l = (nStart == -1) ? 0 : nStart; r = hdpa->nItemCount - 1; lpPtr = hdpa->ptrs; while (r >= l) { x = (l + r) / 2; n = (pfnCompare)(pFind, lpPtr[x], lParam); - if (n < 0) + if (n == 0) + return x; + else if (n < 0) r = x - 1; - else + else /* (n > 0) */ l = x + 1; - if (n == 0) { - TRACE("-- ret=%d\n", n); - return n; - } - } - - if (uOptions & (DPAS_INSERTBEFORE | DPAS_INSERTAFTER)) { - TRACE("-- ret=%d\n", l); - return l; } + if (uOptions & (DPAS_INSERTBEFORE|DPAS_INSERTAFTER)) return l; } else { /* array is not sorted --> use linear search */ LPVOID *lpPtr; INT nIndex; - TRACE("linear search\n"); - nIndex = (nStart == -1)? 0 : nStart; lpPtr = hdpa->ptrs; for (; nIndex < hdpa->nItemCount; nIndex++) { - if ((pfnCompare)(pFind, lpPtr[nIndex], lParam) == 0) { - TRACE("-- ret=%d\n", nIndex); + if ((pfnCompare)(pFind, lpPtr[nIndex], lParam) == 0) return nIndex; - } } } - TRACE("-- not found: ret=-1\n"); return -1; } diff -urN wine-20050725/dlls/comctl32/header.c wine-20050830/dlls/comctl32/header.c --- wine-20050725/dlls/comctl32/header.c 2005-07-25 13:09:09.000000000 +0200 +++ wine-20050830/dlls/comctl32/header.c 2005-08-30 12:07:18.000000000 +0200 @@ -87,6 +87,7 @@ HIMAGELIST himl; /* handle to an image list (may be 0) */ HEADER_ITEM *items; /* pointer to array of HEADER_ITEM's */ + INT *order; /* array of item IDs indexed by order */ BOOL bRectsValid; /* validity flag for bounding rectangles */ } HEADER_INFO; @@ -113,14 +114,10 @@ { HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); INT iorder = (INT)wParam; - UINT i; - if ((iorder <0) || iorder >infoPtr->uNumItem) + if ((iorder <0) || iorder >= infoPtr->uNumItem) return iorder; - for (i=0; iuNumItem; i++) - if (HEADER_IndexToOrder(hwnd,i) == iorder) - return i; - return iorder; + return infoPtr->order[iorder]; } static void @@ -339,7 +336,7 @@ } DeleteObject(hClipRgn); - DeleteDC(hClipDC); + ReleaseDC(hwnd, hClipDC); } if (((phdi->fmt & HDF_STRING) @@ -385,7 +382,7 @@ } x = rect.left; - for (i = 0; i < infoPtr->uNumItem; i++) { + for (i = 0; x <= rect.right && i < infoPtr->uNumItem; i++) { x = HEADER_DrawItem (hwnd, hdc, HEADER_OrderToIndex(hwnd,i), infoPtr->iHotItem == i); } @@ -416,7 +413,7 @@ hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject (SYSTEM_FONT); hOldFont = SelectObject (hdc, hFont); - HEADER_DrawItem (hwnd, hdc, iItem, FALSE); + HEADER_DrawItem (hwnd, hdc, iItem, infoPtr->iHotItem == iItem); SelectObject (hdc, hOldFont); } @@ -647,16 +644,19 @@ if (infoPtr->items[0].pszText) Free (infoPtr->items[0].pszText); Free (infoPtr->items); + Free(infoPtr->order); infoPtr->items = 0; + infoPtr->order = 0; infoPtr->uNumItem = 0; } else { HEADER_ITEM *oldItems = infoPtr->items; - HEADER_ITEM *pItem; INT i; INT iOrder; TRACE("Complex delete! [iItem=%d]\n", iItem); + for (i = 0; i < infoPtr->uNumItem; i++) + TRACE("%d: order=%d, iOrder=%d, ->iOrder=%d\n", i, infoPtr->order[i], infoPtr->items[i].iOrder, infoPtr->items[infoPtr->order[i]].iOrder); if (infoPtr->items[iItem].pszText) Free (infoPtr->items[iItem].pszText); iOrder = infoPtr->items[iItem].iOrder; @@ -676,11 +676,21 @@ } /* Correct the orders */ - for (i=infoPtr->uNumItem, pItem = infoPtr->items; i; i--, pItem++) + if (iOrder < infoPtr->uNumItem) { - if (pItem->iOrder > iOrder) - pItem->iOrder--; + memmove(&infoPtr->order[iOrder], &infoPtr->order[iOrder + 1], + (infoPtr->uNumItem - iOrder) * sizeof(INT)); + for (i = 0; i < infoPtr->uNumItem; i++) + { + if (infoPtr->order[i] > iItem) + infoPtr->order[i]--; + if (i >= iOrder) + infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i]; + } } + + for (i = 0; i < infoPtr->uNumItem; i++) + TRACE("%d: order=%d, iOrder=%d, ->iOrder=%d\n", i, infoPtr->order[i], infoPtr->items[i].iOrder, infoPtr->items[infoPtr->order[i]].iOrder); Free (oldItems); } @@ -850,14 +860,13 @@ static LRESULT HEADER_GetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam) { - int i; LPINT order = (LPINT) lParam; HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); if ((unsigned int)wParam uNumItem) return FALSE; - for (i=0; i<(int)wParam; i++) - *order++=HEADER_OrderToIndex(hwnd,i); + + memcpy(order, infoPtr->order, infoPtr->uNumItem * sizeof(INT)); return TRUE; } @@ -871,6 +880,7 @@ if ((unsigned int)wParam uNumItem) return FALSE; + memcpy(infoPtr->order, order, infoPtr->uNumItem * sizeof(INT)); for (i=0; i<(int)wParam; i++) { lpItem = &infoPtr->items[*order++]; @@ -923,10 +933,12 @@ if (infoPtr->uNumItem == 0) { infoPtr->items = Alloc (sizeof (HEADER_ITEM)); + infoPtr->order = Alloc(sizeof(INT)); infoPtr->uNumItem++; } else { HEADER_ITEM *oldItems = infoPtr->items; + INT *oldOrder = infoPtr->order; infoPtr->uNumItem++; infoPtr->items = Alloc (sizeof (HEADER_ITEM) * infoPtr->uNumItem); @@ -949,13 +961,21 @@ } } + infoPtr->order = Alloc(sizeof(INT) * infoPtr->uNumItem); + memcpy(infoPtr->order, oldOrder, iOrder * sizeof(INT)); + infoPtr->order[iOrder] = nItem; + memcpy(&infoPtr->order[iOrder + 1], &oldOrder[iOrder], + (infoPtr->uNumItem - iOrder - 1) * sizeof(INT)); + Free (oldItems); + Free(oldOrder); } - for (i=0; i < infoPtr->uNumItem; i++) + for (i = 0; i < infoPtr->uNumItem; i++) { - if (infoPtr->items[i].iOrder >= iOrder) - infoPtr->items[i].iOrder++; + if (i != iOrder && infoPtr->order[i] >= nItem) + infoPtr->order[i]++; + infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i]; } lpItem = &infoPtr->items[nItem]; @@ -1025,10 +1045,12 @@ if (infoPtr->uNumItem == 0) { infoPtr->items = Alloc (sizeof (HEADER_ITEM)); + infoPtr->order = Alloc(sizeof(INT)); infoPtr->uNumItem++; } else { HEADER_ITEM *oldItems = infoPtr->items; + INT *oldOrder = infoPtr->order; infoPtr->uNumItem++; infoPtr->items = Alloc (sizeof (HEADER_ITEM) * infoPtr->uNumItem); @@ -1051,13 +1073,21 @@ } } + infoPtr->order = Alloc(infoPtr->uNumItem * sizeof(INT)); + memcpy(infoPtr->order, oldOrder, iOrder * sizeof(INT)); + infoPtr->order[iOrder] = nItem; + memcpy(&infoPtr->order[iOrder + 1], &oldOrder[iOrder], + (infoPtr->uNumItem - iOrder - 1) * sizeof(INT)); + Free (oldItems); + Free(oldOrder); } - for (i=0; i < infoPtr->uNumItem; i++) + for (i = 0; i < infoPtr->uNumItem; i++) { - if (infoPtr->items[i].iOrder >= iOrder) - infoPtr->items[i].iOrder++; + if (i != iOrder && infoPtr->order[i] >= nItem) + infoPtr->order[i]++; + infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i]; } lpItem = &infoPtr->items[nItem]; @@ -1143,7 +1173,7 @@ HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HIMAGELIST himlOld; - TRACE("(himl 0x%x)\n", (int)himl); + TRACE("(himl %p)\n", himl); himlOld = infoPtr->himl; infoPtr->himl = himl; @@ -1224,7 +1254,27 @@ if (phdi->mask & HDI_ORDER) { - lpItem->iOrder = phdi->iOrder; + INT i, nMin, nMax; + + if (lpItem->iOrder < phdi->iOrder) + { + memmove(&infoPtr->order[lpItem->iOrder], + &infoPtr->order[lpItem->iOrder + 1], + (phdi->iOrder - lpItem->iOrder) * sizeof(INT)); + } + if (phdi->iOrder < lpItem->iOrder) + { + memmove(&infoPtr->order[phdi->iOrder + 1], + &infoPtr->order[phdi->iOrder], + (lpItem->iOrder - phdi->iOrder) * sizeof(INT)); + } + infoPtr->order[phdi->iOrder] = nItem; + nMin = min(lpItem->iOrder, phdi->iOrder); + nMax = max(lpItem->iOrder, phdi->iOrder); + for (i = nMin; i <= nMax; i++) + { + infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i]; + } } HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA, nItem, phdi->mask); @@ -1289,7 +1339,27 @@ if (phdi->mask & HDI_ORDER) { - lpItem->iOrder = phdi->iOrder; + INT i, nMin, nMax; + + if (lpItem->iOrder < phdi->iOrder) + { + memmove(&infoPtr->order[lpItem->iOrder], + &infoPtr->order[lpItem->iOrder + 1], + (phdi->iOrder - lpItem->iOrder) * sizeof(INT)); + } + if (phdi->iOrder < lpItem->iOrder) + { + memmove(&infoPtr->order[phdi->iOrder + 1], + &infoPtr->order[phdi->iOrder], + (lpItem->iOrder - phdi->iOrder) * sizeof(INT)); + } + infoPtr->order[phdi->iOrder] = nItem; + nMin = min(lpItem->iOrder, phdi->iOrder); + nMax = max(lpItem->iOrder, phdi->iOrder); + for (i = nMin; i <= nMax; i++) + { + infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i]; + } } HEADER_SendHeaderNotify(hwnd, HDN_ITEMCHANGEDW, nItem, phdi->mask); @@ -1320,7 +1390,6 @@ TEXTMETRICW tm; HFONT hOldFont; HDC hdc; - BOOL themingActive = IsAppThemed() && IsThemeActive(); infoPtr = (HEADER_INFO *)Alloc (sizeof(HEADER_INFO)); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); @@ -1329,6 +1398,7 @@ infoPtr->uNumItem = 0; infoPtr->hFont = 0; infoPtr->items = 0; + infoPtr->order = 0; infoPtr->bRectsValid = FALSE; infoPtr->hcurArrow = LoadCursorW (0, (LPWSTR)IDC_ARROW); infoPtr->hcurDivider = LoadCursorW (COMCTL32_hModule, MAKEINTRESOURCEW(IDC_DIVIDER)); @@ -1350,7 +1420,7 @@ SelectObject (hdc, hOldFont); ReleaseDC (0, hdc); - if (themingActive) OpenThemeData(hwnd, themeClass); + OpenThemeData(hwnd, themeClass); return 0; } @@ -1373,6 +1443,9 @@ Free (infoPtr->items); } + if (infoPtr->order) + Free(infoPtr->order); + if (infoPtr->himl) ImageList_Destroy (infoPtr->himl); @@ -1506,6 +1579,9 @@ lpItem= &infoPtr->items[infoPtr->iMoveItem]; lpItem->iOrder = newindex; + infoPtr->order[oldindex] = nItem; + infoPtr->order[newindex] = infoPtr->iMoveItem; + infoPtr->bRectsValid = FALSE; InvalidateRect(hwnd, NULL, FALSE); /* FIXME: Should some WM_NOTIFY be sent */ @@ -1581,6 +1657,22 @@ static LRESULT +HEADER_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam) +{ + HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); + /* Reset hot-tracked item when mouse leaves control. */ + INT oldHotItem = infoPtr->iHotItem; + HDC hdc = GetDC (hwnd); + + infoPtr->iHotItem = -1; + if (oldHotItem != -1) HEADER_RefreshItem (hwnd, hdc, oldHotItem); + ReleaseDC (hwnd, hdc); + + return 0; +} + + +static LRESULT HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) { HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); @@ -1589,28 +1681,35 @@ UINT flags; INT nItem, nWidth; HDC hdc; + /* With theming, hottracking is always enabled */ + BOOL hotTrackEnabled = + ((dwStyle & HDS_BUTTONS) && (dwStyle & HDS_HOTTRACK)) + || (GetWindowTheme (hwnd) != NULL); + INT oldHotItem = infoPtr->iHotItem; pt.x = (INT)(SHORT)LOWORD(lParam); pt.y = (INT)(SHORT)HIWORD(lParam); HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem); - if ((dwStyle & HDS_BUTTONS) && (dwStyle & HDS_HOTTRACK)) { + if (hotTrackEnabled) { if (flags & (HHT_ONHEADER | HHT_ONDIVIDER | HHT_ONDIVOPEN)) infoPtr->iHotItem = nItem; else infoPtr->iHotItem = -1; - InvalidateRect(hwnd, NULL, FALSE); } if (infoPtr->bCaptured) { if (infoPtr->bPressed) { + BOOL oldState = infoPtr->items[infoPtr->iMoveItem].bDown; if ((nItem == infoPtr->iMoveItem) && (flags == HHT_ONHEADER)) infoPtr->items[infoPtr->iMoveItem].bDown = TRUE; else infoPtr->items[infoPtr->iMoveItem].bDown = FALSE; - hdc = GetDC (hwnd); - HEADER_RefreshItem (hwnd, hdc, infoPtr->iMoveItem); - ReleaseDC (hwnd, hdc); + if (oldState != infoPtr->items[infoPtr->iMoveItem].bDown) { + hdc = GetDC (hwnd); + HEADER_RefreshItem (hwnd, hdc, infoPtr->iMoveItem); + ReleaseDC (hwnd, hdc); + } TRACE("Moving pressed item %d!\n", infoPtr->iMoveItem); } @@ -1643,8 +1742,18 @@ } } - if ((dwStyle & HDS_BUTTONS) && (dwStyle & HDS_HOTTRACK)) { - FIXME("hot track support!\n"); + if (hotTrackEnabled) { + TRACKMOUSEEVENT tme; + if (oldHotItem != infoPtr->iHotItem) { + hdc = GetDC (hwnd); + if (oldHotItem != -1) HEADER_RefreshItem (hwnd, hdc, oldHotItem); + if (infoPtr->iHotItem != -1) HEADER_RefreshItem (hwnd, hdc, infoPtr->iHotItem); + ReleaseDC (hwnd, hdc); + } + tme.cbSize = sizeof( tme ); + tme.dwFlags = TME_LEAVE; + tme.hwndTrack = hwnd; + TrackMouseEvent( &tme ); } return 0; @@ -1854,6 +1963,9 @@ case WM_LBUTTONUP: return HEADER_LButtonUp (hwnd, wParam, lParam); + case WM_MOUSELEAVE: + return HEADER_MouseLeave (hwnd, wParam, lParam); + case WM_MOUSEMOVE: return HEADER_MouseMove (hwnd, wParam, lParam); diff -urN wine-20050725/dlls/comctl32/imagelist.c wine-20050830/dlls/comctl32/imagelist.c --- wine-20050725/dlls/comctl32/imagelist.c 2005-07-14 12:15:59.000000000 +0200 +++ wine-20050830/dlls/comctl32/imagelist.c 2005-08-30 12:07:17.000000000 +0200 @@ -1084,8 +1084,8 @@ bMask = (himl->flags & ILC_MASK) && (fStyle & ILD_MASK) ; bBlend = (fStyle & (ILD_BLEND25 | ILD_BLEND50) ) && !bMask; - TRACE("himl(0x%lx) hbmMask(%p) iImage(%d) x(%d) y(%d) cx(%d) cy(%d)\n", - (DWORD)himl, himl->hbmMask, pimldp->i, pimldp->x, pimldp->y, cx, cy); + TRACE("himl(%p) hbmMask(%p) iImage(%d) x(%d) y(%d) cx(%d) cy(%d)\n", + himl, himl->hbmMask, pimldp->i, pimldp->x, pimldp->y, cx, cy); /* we will use these DCs to access the images and masks in the ImageList */ hImageListDC = himl->hdcImage; diff -urN wine-20050725/dlls/comctl32/ipaddress.c wine-20050830/dlls/comctl32/ipaddress.c --- wine-20050725/dlls/comctl32/ipaddress.c 2005-06-09 11:41:56.000000000 +0200 +++ wine-20050830/dlls/comctl32/ipaddress.c 2005-08-30 12:07:17.000000000 +0200 @@ -143,7 +143,7 @@ fgCol = COLOR_GRAYTEXT; } - FillRect (hdc, &rect, (HBRUSH) (bgCol+1)); + FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1)); DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); SetBkColor (hdc, GetSysColor(bgCol)); diff -urN wine-20050725/dlls/comctl32/listview.c wine-20050830/dlls/comctl32/listview.c --- wine-20050725/dlls/comctl32/listview.c 2005-07-25 13:09:38.000000000 +0200 +++ wine-20050830/dlls/comctl32/listview.c 2005-08-30 12:07:17.000000000 +0200 @@ -379,6 +379,9 @@ #define LV_FL_DT_FLAGS (DT_TOP | DT_NOPREFIX | DT_EDITCONTROL | DT_CENTER | DT_WORDBREAK | DT_NOCLIP) #define LV_SL_DT_FLAGS (DT_VCENTER | DT_NOPREFIX | DT_EDITCONTROL | DT_SINGLELINE | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS) +/* Image index from state */ +#define STATEIMAGEINDEX(x) (((x) & LVIS_STATEIMAGEMASK) >> 12) + /* The time in milliseconds to reset the search in the list */ #define KEY_DELAY 450 @@ -1243,8 +1246,8 @@ TRACE("building icon ranges:\n"); for (nItem = 0; nItem < infoPtr->nItemCount; nItem++) { - rcItem.left = (LONG)DPA_GetPtr(infoPtr->hdpaPosX, nItem); - rcItem.top = (LONG)DPA_GetPtr(infoPtr->hdpaPosY, nItem); + rcItem.left = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, nItem); + rcItem.top = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, nItem); rcItem.right = rcItem.left + infoPtr->nItemWidth; rcItem.bottom = rcItem.top + infoPtr->nItemHeight; if (IntersectRect(&rcTemp, &rcItem, &frame)) @@ -1841,8 +1844,8 @@ if ((uView == LVS_SMALLICON) || (uView == LVS_ICON)) { - lpptPosition->x = (LONG)DPA_GetPtr(infoPtr->hdpaPosX, nItem); - lpptPosition->y = (LONG)DPA_GetPtr(infoPtr->hdpaPosY, nItem); + lpptPosition->x = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, nItem); + lpptPosition->y = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, nItem); } else if (uView == LVS_LIST) { @@ -2218,8 +2221,8 @@ if (!isNew) { - old.x = (LONG)DPA_GetPtr(infoPtr->hdpaPosX, nItem); - old.y = (LONG)DPA_GetPtr(infoPtr->hdpaPosY, nItem); + old.x = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, nItem); + old.y = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, nItem); if (lppt->x == old.x && lppt->y == old.y) return TRUE; LISTVIEW_InvalidateItem(infoPtr, nItem); @@ -2227,8 +2230,8 @@ /* Allocating a POINTER for every item is too resource intensive, * so we'll keep the (x,y) in different arrays */ - if (!DPA_SetPtr(infoPtr->hdpaPosX, nItem, (void *)lppt->x)) return FALSE; - if (!DPA_SetPtr(infoPtr->hdpaPosY, nItem, (void *)lppt->y)) return FALSE; + if (!DPA_SetPtr(infoPtr->hdpaPosX, nItem, (void *)(LONG_PTR)lppt->x)) return FALSE; + if (!DPA_SetPtr(infoPtr->hdpaPosY, nItem, (void *)(LONG_PTR)lppt->y)) return FALSE; LISTVIEW_InvalidateItem(infoPtr, nItem); @@ -2307,8 +2310,8 @@ case LVS_SMALLICON: for (i = 0; i < infoPtr->nItemCount; i++) { - x = (LONG)DPA_GetPtr(infoPtr->hdpaPosX, i); - y = (LONG)DPA_GetPtr(infoPtr->hdpaPosY, i); + x = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, i); + y = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, i); lprcView->right = max(lprcView->right, x); lprcView->bottom = max(lprcView->bottom, y); } @@ -3729,7 +3732,7 @@ /* state icons */ if (infoPtr->himlState && !IsRectEmpty(&rcState)) { - UINT uStateImage = (lvItem.state & LVIS_STATEIMAGEMASK) >> 12; + UINT uStateImage = STATEIMAGEINDEX(lvItem.state); if (uStateImage) { TRACE("uStateImage=%d\n", uStateImage); @@ -6100,7 +6103,7 @@ lpht->flags |= LVHT_ONITEMICON; else if (PtInRect(&rcLabel, opt)) lpht->flags |= LVHT_ONITEMLABEL; - else if (infoPtr->himlState && ((lvItem.state & LVIS_STATEIMAGEMASK) >> 12) && PtInRect(&rcState, opt)) + else if (infoPtr->himlState && STATEIMAGEINDEX(lvItem.state) && PtInRect(&rcState, opt)) lpht->flags |= LVHT_ONITEMSTATEICON; if (lpht->flags & LVHT_ONITEM) lpht->flags &= ~LVHT_NOWHERE; @@ -6829,7 +6832,7 @@ * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure - * [I} hCurosr : the new hot cursor handle + * [I] hCursor : the new hot cursor handle * * RETURN: * Returns the previous hot cursor @@ -7516,7 +7519,6 @@ LISTVIEW_INFO *infoPtr; UINT uView = lpcs->style & LVS_TYPEMASK; LOGFONTW logFont; - BOOL themingActive = IsAppThemed() && IsThemeActive(); TRACE("(lpcs=%p)\n", lpcs); @@ -7599,7 +7601,7 @@ } } - if (themingActive) OpenThemeData(hwnd, themeClass); + OpenThemeData(hwnd, themeClass); return 0; @@ -8104,13 +8106,13 @@ * DESCRIPTION: * Processes mouse down messages (left mouse button). * - * PARAMETER(S): - * [I] infoPtr : valid pointer to the listview structure - * [I] wKey : key flag - * [I] x,y : mouse coordinate + * PARAMETERS: + * infoPtr [I ] valid pointer to the listview structure + * wKey [I ] key flag + * x,y [I ] mouse coordinate * * RETURN: - * Zero + * Zero */ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y) { @@ -8140,12 +8142,12 @@ { if ((infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES) && (lvHitTestInfo.flags & LVHT_ONITEMSTATEICON)) { - DWORD state = LISTVIEW_GetItemState(infoPtr, nItem, LVIS_STATEIMAGEMASK) >> 12; + DWORD state = STATEIMAGEINDEX(LISTVIEW_GetItemState(infoPtr, nItem, LVIS_STATEIMAGEMASK)); if(state == 1 || state == 2) { LVITEMW lvitem; state ^= 3; - lvitem.state = state << 12; + lvitem.state = INDEXTOSTATEIMAGEMASK(state); lvitem.stateMask = LVIS_STATEIMAGEMASK; LISTVIEW_SetItemState(infoPtr, nItem, &lvitem); } @@ -8219,13 +8221,13 @@ * DESCRIPTION: * Processes mouse up messages (left mouse button). * - * PARAMETER(S): - * [I] infoPtr : valid pointer to the listview structure - * [I] wKey : key flag - * [I] x,y : mouse coordinate + * PARAMETERS: + * infoPtr [I ] valid pointer to the listview structure + * wKey [I ] key flag + * x,y [I ] mouse coordinate * * RETURN: - * Zero + * Zero */ static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y) { @@ -8415,15 +8417,13 @@ static BOOL LISTVIEW_NCPaint(LISTVIEW_INFO *infoPtr, HRGN region) { HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - BOOL themingActive = IsAppThemed() && IsThemeActive(); - BOOL doTheming = themingActive && (theme != NULL); HDC dc; RECT r; HRGN cliprgn; int cxEdge = GetSystemMetrics (SM_CXEDGE), cyEdge = GetSystemMetrics (SM_CYEDGE); - if (!doTheming) return FALSE; + if (!theme) return FALSE; GetWindowRect(infoPtr->hwndSelf, &r); diff -urN wine-20050725/dlls/comctl32/monthcal.c wine-20050830/dlls/comctl32/monthcal.c --- wine-20050725/dlls/comctl32/monthcal.c 2005-06-09 11:50:56.000000000 +0200 +++ wine-20050830/dlls/comctl32/monthcal.c 2005-08-11 19:05:00.000000000 +0200 @@ -55,6 +55,8 @@ #include "winnls.h" #include "commctrl.h" #include "comctl32.h" +#include "uxtheme.h" +#include "tmschema.h" #include "wine/unicode.h" #include "wine/debug.h" @@ -125,6 +127,7 @@ /* Offsets of days in the week to the weekday of january 1 in a leap year */ static const int DayOfWeekTable[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}; +static const WCHAR themeClass[] = { 'S','c','r','o','l','l','b','a','r',0 }; #define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)GetWindowLongPtrW(hwnd, 0)) @@ -388,6 +391,45 @@ } +static void paint_button (MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext, + BOOL pressed, RECT* r) +{ + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); + + if (theme) + { + static const int states[] = { + /* Prev button */ + ABS_LEFTNORMAL, ABS_LEFTPRESSED, ABS_LEFTDISABLED, + /* Next button */ + ABS_RIGHTNORMAL, ABS_RIGHTPRESSED, ABS_RIGHTDISABLED + }; + int stateNum = btnNext ? 3 : 0; + if (pressed) + stateNum += 1; + else + { + DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE); + if (dwStyle & WS_DISABLED) stateNum += 2; + } + DrawThemeBackground (theme, hdc, SBP_ARROWBTN, states[stateNum], r, NULL); + } + else + { + int style = btnNext ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT; + if (pressed) + style |= DFCS_PUSHED; + else + { + DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE); + if (dwStyle & WS_DISABLED) style |= DFCS_INACTIVE; + } + + DrawFrameControl(hdc, r, DFC_SCROLL, style); + } +} + + static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, PAINTSTRUCT* ps) { static const WCHAR todayW[] = { 'T','o','d','a','y',':',0 }; @@ -434,27 +476,11 @@ /* if the previous button is pressed draw it depressed */ if(IntersectRect(&rcTemp, &(ps->rcPaint), prev)) - { - if((infoPtr->status & MC_PREVPRESSED)) - DrawFrameControl(hdc, prev, DFC_SCROLL, - DFCS_SCROLLLEFT | DFCS_PUSHED | - (dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0)); - else /* if the previous button is pressed draw it depressed */ - DrawFrameControl(hdc, prev, DFC_SCROLL, - DFCS_SCROLLLEFT |(dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0)); - } + paint_button (infoPtr, hdc, FALSE, infoPtr->status & MC_PREVPRESSED, prev); /* if next button is depressed draw it depressed */ if(IntersectRect(&rcTemp, &(ps->rcPaint), next)) - { - if((infoPtr->status & MC_NEXTPRESSED)) - DrawFrameControl(hdc, next, DFC_SCROLL, - DFCS_SCROLLRIGHT | DFCS_PUSHED | - (dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0)); - else /* if the next button is pressed draw it depressed */ - DrawFrameControl(hdc, next, DFC_SCROLL, - DFCS_SCROLLRIGHT |(dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0)); - } + paint_button (infoPtr, hdc, TRUE, infoPtr->status & MC_NEXTPRESSED, next); oldBkColor = SetBkColor(hdc, infoPtr->titlebk); SetTextColor(hdc, infoPtr->titletxt); @@ -1812,6 +1838,15 @@ return (LRESULT)hOldFont; } +/* update theme after a WM_THEMECHANGED message */ +static LRESULT theme_changed (MONTHCAL_INFO* infoPtr) +{ + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); + CloseThemeData (theme); + theme = OpenThemeData (infoPtr->hwndSelf, themeClass); + return 0; +} + /* FIXME: check whether dateMin/dateMax need to be adjusted. */ static LRESULT MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam) @@ -1857,6 +1892,8 @@ /* call MONTHCAL_UpdateSize to set all of the dimensions */ /* of the control */ MONTHCAL_UpdateSize(infoPtr); + + OpenThemeData (infoPtr->hwndSelf, themeClass); return 0; } @@ -1869,6 +1906,9 @@ if(infoPtr->monthdayState) Free(infoPtr->monthdayState); SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0); + + CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); + Free(infoPtr); return 0; } @@ -1987,6 +2027,9 @@ case WM_TIMER: return MONTHCAL_Timer(infoPtr, wParam); + + case WM_THEMECHANGED: + return theme_changed (infoPtr); case WM_DESTROY: return MONTHCAL_Destroy(infoPtr); diff -urN wine-20050725/dlls/comctl32/progress.c wine-20050830/dlls/comctl32/progress.c --- wine-20050725/dlls/comctl32/progress.c 2004-10-27 23:16:03.000000000 +0200 +++ wine-20050830/dlls/comctl32/progress.c 2005-08-23 12:02:25.000000000 +0200 @@ -38,6 +38,8 @@ #include "winnls.h" #include "commctrl.h" #include "comctl32.h" +#include "uxtheme.h" +#include "tmschema.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(progress); @@ -62,6 +64,70 @@ #define MARQUEE_LEDS 5 #define ID_MARQUEE_TIMER 1 +/* Helper to obtain size of a progress bar chunk ("led"). */ +static inline int get_led_size ( PROGRESS_INFO *infoPtr, LONG style, + const RECT* rect ) +{ + HTHEME theme = GetWindowTheme (infoPtr->Self); + if (theme) + { + int chunkSize; + if (SUCCEEDED( GetThemeInt( theme, 0, 0, TMT_PROGRESSCHUNKSIZE, &chunkSize ))) + return chunkSize; + } + + if (style & PBS_VERTICAL) + return MulDiv (rect->right - rect->left, 2, 3); + else + return MulDiv (rect->bottom - rect->top, 2, 3); +} + +/* Helper to obtain gap between progress bar chunks */ +static inline int get_led_gap ( PROGRESS_INFO *infoPtr ) +{ + HTHEME theme = GetWindowTheme (infoPtr->Self); + if (theme) + { + int spaceSize; + if (SUCCEEDED( GetThemeInt( theme, 0, 0, TMT_PROGRESSSPACESIZE, &spaceSize ))) + return spaceSize; + } + + return LED_GAP; +} + +/* Get client rect. Takes into account that theming needs no adjustment. */ +static inline void get_client_rect (HWND hwnd, RECT* rect) +{ + HTHEME theme = GetWindowTheme (hwnd); + GetClientRect (hwnd, rect); + if (!theme) + InflateRect(rect, -1, -1); + else + { + DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); + int part = (dwStyle & PBS_VERTICAL) ? PP_BARVERT : PP_BAR; + GetThemeBackgroundContentRect (theme, 0, part, 0, rect, rect); + } +} + +/* Compute the extend of the bar */ +static inline int get_bar_size( LONG style, const RECT* rect ) +{ + if (style & PBS_VERTICAL) + return rect->bottom - rect->top; + else + return rect->right - rect->left; +} + +/* Compute the pixel position of a progress value */ +static inline int get_bar_position( PROGRESS_INFO *infoPtr, LONG style, + const RECT* rect, INT value ) +{ + return MulDiv (value - infoPtr->MinVal, get_bar_size (style, rect), + infoPtr->MaxVal - infoPtr->MinVal); +} + /*********************************************************************** * PROGRESS_Invalidate * @@ -71,37 +137,214 @@ { LONG style = GetWindowLongW (infoPtr->Self, GWL_STYLE); RECT rect; - int oldPos, newPos, ledWidth; + int oldPos, newPos; + BOOL barSmooth = (style & PBS_SMOOTH) && !GetWindowTheme (infoPtr->Self); - GetClientRect (infoPtr->Self, &rect); - InflateRect(&rect, -1, -1); + get_client_rect( infoPtr->Self, &rect ); + + oldPos = get_bar_position( infoPtr, style, &rect, old ); + newPos = get_bar_position( infoPtr, style, &rect, new ); if (style & PBS_VERTICAL) { - oldPos = rect.bottom - MulDiv (old - infoPtr->MinVal, rect.bottom - rect.top, - infoPtr->MaxVal - infoPtr->MinVal); - newPos = rect.bottom - MulDiv (new - infoPtr->MinVal, rect.bottom - rect.top, - infoPtr->MaxVal - infoPtr->MinVal); - ledWidth = MulDiv (rect.right - rect.left, 2, 3); - rect.top = min( oldPos, newPos ); - rect.bottom = max( oldPos, newPos ); - if (!(style & PBS_SMOOTH)) rect.top -= ledWidth; - InvalidateRect( infoPtr->Self, &rect, oldPos < newPos ); + rect.top = rect.bottom - max( oldPos, newPos ); + rect.bottom = rect.bottom - min( oldPos, newPos ); + if (!barSmooth) rect.top -= + get_led_size (infoPtr, style, &rect) + get_led_gap (infoPtr); } else { - oldPos = rect.left + MulDiv (old - infoPtr->MinVal, rect.right - rect.left, - infoPtr->MaxVal - infoPtr->MinVal); - newPos = rect.left + MulDiv (new - infoPtr->MinVal, rect.right - rect.left, - infoPtr->MaxVal - infoPtr->MinVal); - ledWidth = MulDiv (rect.bottom - rect.top, 2, 3); rect.left = min( oldPos, newPos ); rect.right = max( oldPos, newPos ); - if (!(style & PBS_SMOOTH)) rect.right += ledWidth; - InvalidateRect( infoPtr->Self, &rect, oldPos > newPos ); + if (!barSmooth) rect.right += + get_led_size (infoPtr, style, &rect) + get_led_gap (infoPtr); + } + InvalidateRect( infoPtr->Self, &rect, oldPos > newPos ); +} + +/* Information for a progress bar drawing helper */ +typedef struct tagProgressDrawInfo +{ + HDC hdc; + RECT rect; + HBRUSH hbrBar; + HBRUSH hbrBk; + int ledW, ledGap; + HTHEME theme; + RECT bgRect; +} ProgressDrawInfo; + +typedef void (*ProgressDrawProc)(const ProgressDrawInfo* di, int start, int end); + +/* draw solid horizontal bar from 'start' to 'end' */ +static void draw_solid_bar_H (const ProgressDrawInfo* di, int start, int end) +{ + RECT r; + r.left = di->rect.left + start; + r.top = di->rect.top; + r.right = di->rect.left + end; + r.bottom = di->rect.bottom; + FillRect (di->hdc, &r, di->hbrBar); +} + +/* draw solid horizontal background from 'start' to 'end' */ +static void draw_solid_bkg_H (const ProgressDrawInfo* di, int start, int end) +{ + RECT r; + r.left = di->rect.left + start; + r.top = di->rect.top; + r.right = di->rect.left + end; + r.bottom = di->rect.bottom; + FillRect (di->hdc, &r, di->hbrBk); +} + +/* draw solid vertical bar from 'start' to 'end' */ +static void draw_solid_bar_V (const ProgressDrawInfo* di, int start, int end) +{ + RECT r; + r.left = di->rect.left; + r.top = di->rect.bottom - end; + r.right = di->rect.right; + r.bottom = di->rect.bottom - start; + FillRect (di->hdc, &r, di->hbrBar); +} + +/* draw solid vertical background from 'start' to 'end' */ +static void draw_solid_bkg_V (const ProgressDrawInfo* di, int start, int end) +{ + RECT r; + r.left = di->rect.left; + r.top = di->rect.bottom - end; + r.right = di->rect.right; + r.bottom = di->rect.bottom - start; + FillRect (di->hdc, &r, di->hbrBk); +} + +/* draw chunky horizontal bar from 'start' to 'end' */ +static void draw_chunk_bar_H (const ProgressDrawInfo* di, int start, int end) +{ + RECT r; + int right = di->rect.left + end; + r.left = di->rect.left + start; + r.top = di->rect.top; + r.bottom = di->rect.bottom; + while (r.left < right) + { + r.right = min (r.left + di->ledW, right); + FillRect (di->hdc, &r, di->hbrBar); + r.left = r.right; + r.right = min (r.left + di->ledGap, right); + FillRect (di->hdc, &r, di->hbrBk); + r.left = r.right; + } +} + +/* draw chunky vertical bar from 'start' to 'end' */ +static void draw_chunk_bar_V (const ProgressDrawInfo* di, int start, int end) +{ + RECT r; + int top = di->rect.bottom - end; + r.left = di->rect.left; + r.right = di->rect.right; + r.bottom = di->rect.bottom - start; + while (r.bottom > top) + { + r.top = max (r.bottom - di->ledW, top); + FillRect (di->hdc, &r, di->hbrBar); + r.bottom = r.top; + r.top = max (r.bottom - di->ledGap, top); + FillRect (di->hdc, &r, di->hbrBk); + r.bottom = r.top; } } +/* drawing functions for "classic" style */ +static const ProgressDrawProc drawProcClassic[8] = { + /* Smooth */ + /* Horizontal */ + draw_solid_bar_H, draw_solid_bkg_H, + /* Vertical */ + draw_solid_bar_V, draw_solid_bkg_V, + /* Chunky */ + /* Horizontal */ + draw_chunk_bar_H, draw_solid_bkg_H, + /* Vertical */ + draw_chunk_bar_V, draw_solid_bkg_V, +}; + +/* draw themed horizontal bar from 'start' to 'end' */ +static void draw_theme_bar_H (const ProgressDrawInfo* di, int start, int end) +{ + RECT r; + int right = di->rect.left + end; + r.left = di->rect.left + start; + r.top = di->rect.top; + r.bottom = di->rect.bottom; + while (r.left < right) + { + r.right = min (r.left + di->ledW, right); + DrawThemeBackground (di->theme, di->hdc, PP_CHUNK, 0, &r, NULL); + r.left = r.right; + r.right = min (r.left + di->ledGap, right); + DrawThemeBackground (di->theme, di->hdc, PP_BAR, 0, &di->bgRect, &r); + r.left = r.right; + } +} + +/* draw themed horizontal bar from 'start' to 'end' */ +static void draw_theme_bar_V (const ProgressDrawInfo* di, int start, int end) +{ + RECT r; + int top = di->rect.bottom - end; + r.left = di->rect.left; + r.right = di->rect.right; + r.bottom = di->rect.bottom - start; + while (r.bottom > top) + { + r.top = max (r.bottom - di->ledW, top); + DrawThemeBackground (di->theme, di->hdc, PP_CHUNKVERT, 0, &r, NULL); + r.bottom = r.top; + r.top = max (r.bottom - di->ledGap, top); + DrawThemeBackground (di->theme, di->hdc, PP_BARVERT, 0, &di->bgRect, &r); + r.bottom = r.top; + } +} + +/* draw themed horizontal background from 'start' to 'end' */ +static void draw_theme_bkg_H (const ProgressDrawInfo* di, int start, int end) +{ + RECT r; + r.left = di->rect.left + start; + r.top = di->rect.top; + r.right = di->rect.left + end; + r.bottom = di->rect.bottom; + DrawThemeBackground (di->theme, di->hdc, PP_BAR, 0, &di->bgRect, &r); +} + +/* draw themed vertical background from 'start' to 'end' */ +static void draw_theme_bkg_V (const ProgressDrawInfo* di, int start, int end) +{ + RECT r; + r.left = di->rect.left; + r.top = di->rect.bottom - end; + r.right = di->rect.right; + r.bottom = di->rect.bottom - start; + DrawThemeBackground (di->theme, di->hdc, PP_BARVERT, 0, &di->bgRect, &r); +} + +/* drawing functions for themed style */ +static const ProgressDrawProc drawProcThemed[8] = { + /* Smooth */ + /* Horizontal */ + draw_theme_bar_H, draw_theme_bkg_H, + /* Vertical */ + draw_theme_bar_V, draw_theme_bkg_V, + /* Chunky */ + /* Horizontal */ + draw_theme_bar_H, draw_theme_bkg_H, + /* Vertical */ + draw_theme_bar_V, draw_theme_bkg_V, +}; /*********************************************************************** * PROGRESS_Draw @@ -109,274 +352,119 @@ */ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc) { - HBRUSH hbrBar, hbrBk; - int rightBar, rightMost, ledWidth; - RECT rect; + int barSize; DWORD dwStyle; + BOOL barSmooth; + const ProgressDrawProc* drawProcs; + ProgressDrawInfo pdi; TRACE("(infoPtr=%p, hdc=%p)\n", infoPtr, hdc); + pdi.hdc = hdc; + pdi.theme = GetWindowTheme (infoPtr->Self); + /* get the required bar brush */ if (infoPtr->ColorBar == CLR_DEFAULT) - hbrBar = GetSysColorBrush(COLOR_HIGHLIGHT); + pdi.hbrBar = GetSysColorBrush(COLOR_HIGHLIGHT); else - hbrBar = CreateSolidBrush (infoPtr->ColorBar); + pdi.hbrBar = CreateSolidBrush (infoPtr->ColorBar); if (infoPtr->ColorBk == CLR_DEFAULT) - hbrBk = GetSysColorBrush(COLOR_3DFACE); + pdi.hbrBk = GetSysColorBrush(COLOR_3DFACE); else - hbrBk = CreateSolidBrush(infoPtr->ColorBk); - - /* get client rectangle */ - GetClientRect (infoPtr->Self, &rect); - FrameRect( hdc, &rect, hbrBk ); - InflateRect(&rect, -1, -1); + pdi.hbrBk = CreateSolidBrush(infoPtr->ColorBk); /* get the window style */ dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE); - /* compute extent of progress bar */ - if (dwStyle & PBS_VERTICAL) { - rightBar = rect.bottom - - MulDiv (infoPtr->CurVal - infoPtr->MinVal, - rect.bottom - rect.top, - infoPtr->MaxVal - infoPtr->MinVal); - ledWidth = MulDiv (rect.right - rect.left, 2, 3); - rightMost = rect.top; - } else { - rightBar = rect.left + - MulDiv (infoPtr->CurVal - infoPtr->MinVal, - rect.right - rect.left, - infoPtr->MaxVal - infoPtr->MinVal); - ledWidth = MulDiv (rect.bottom - rect.top, 2, 3); - rightMost = rect.right; + /* get client rectangle */ + GetClientRect (infoPtr->Self, &pdi.rect); + if (!pdi.theme) { + FrameRect( hdc, &pdi.rect, pdi.hbrBk ); + InflateRect(&pdi.rect, -1, -1); } + else + { + RECT cntRect; + int part = (dwStyle & PBS_VERTICAL) ? PP_BARVERT : PP_BAR; + + GetThemeBackgroundContentRect (pdi.theme, hdc, part, 0, &pdi.rect, + &cntRect); + + /* Exclude content rect - content background will be drawn later */ + ExcludeClipRect (hdc, cntRect.left, cntRect.top, + cntRect.right, cntRect.bottom); + if (IsThemeBackgroundPartiallyTransparent (pdi.theme, part, 0)) + DrawThemeParentBackground (infoPtr->Self, hdc, NULL); + DrawThemeBackground (pdi.theme, hdc, part, 0, &pdi.rect, NULL); + SelectClipRgn (hdc, NULL); + CopyRect (&pdi.rect, &cntRect); + } + + /* compute some drawing parameters */ + barSmooth = (dwStyle & PBS_SMOOTH) && !pdi.theme; + drawProcs = &((pdi.theme ? drawProcThemed : drawProcClassic)[(barSmooth ? 0 : 4) + + ((dwStyle & PBS_VERTICAL) ? 2 : 0)]); + barSize = get_bar_size( dwStyle, &pdi.rect ); + if (pdi.theme) + { + GetWindowRect( infoPtr->Self, &pdi.bgRect ); + ScreenToClient( infoPtr->Self, (POINT*)&pdi.bgRect ); + ScreenToClient( infoPtr->Self, (POINT*)&pdi.bgRect.right ); + } + + if (!barSmooth) + pdi.ledW = get_led_size( infoPtr, dwStyle, &pdi.rect); + pdi.ledGap = get_led_gap( infoPtr ); - /* now draw the bar */ - if (dwStyle & PBS_SMOOTH) + if (dwStyle & PBS_MARQUEE) { - if (dwStyle & PBS_VERTICAL) + const int ledW = !barSmooth ? (pdi.ledW + pdi.ledGap) : 1; + const int leds = (barSize + ledW - 1) / ledW; + const int ledMEnd = infoPtr->MarqueePos + MARQUEE_LEDS; + + if (ledMEnd > leds) { - if (dwStyle & PBS_MARQUEE) - { - INT old_top, old_bottom, ledMStart, leds; - old_top = rect.top; - old_bottom = rect.bottom; - - leds = rect.bottom - rect.top; - ledMStart = (infoPtr->MarqueePos + MARQUEE_LEDS) - leds; - - if(ledMStart > 0) - { - rect.top = max(rect.bottom - ledMStart, old_top); - FillRect(hdc, &rect, hbrBar); - rect.bottom = rect.top; - } - if(infoPtr->MarqueePos > 0) - { - rect.top = max(old_bottom - infoPtr->MarqueePos, old_top); - FillRect(hdc, &rect, hbrBk); - rect.bottom = rect.top; - } - if(rect.top >= old_top) - { - rect.top = max(rect.bottom - MARQUEE_LEDS, old_top); - FillRect(hdc, &rect, hbrBar); - rect.bottom = rect.top; - } - if(rect.top >= old_top) - { - rect.top = old_top; - FillRect(hdc, &rect, hbrBk); - } - } - else - { - INT old_top = rect.top; - rect.top = rightBar; - FillRect(hdc, &rect, hbrBar); - rect.bottom = rect.top; - rect.top = old_top; - FillRect(hdc, &rect, hbrBk); - } + /* case 1: the marquee bar extends over the end and wraps around to + * the start */ + const int gapStart = max((ledMEnd - leds) * ledW, 0); + const int gapEnd = min(infoPtr->MarqueePos * ledW, barSize); + + drawProcs[0]( &pdi, 0, gapStart); + drawProcs[1]( &pdi, gapStart, gapEnd); + drawProcs[0]( &pdi, gapEnd, barSize); } else { - if (dwStyle & PBS_MARQUEE) - { - INT old_left, old_right, ledMStart, leds; - old_left = rect.left; - old_right = rect.right; - - leds = rect.right - rect.left; - ledMStart = (infoPtr->MarqueePos + MARQUEE_LEDS) - leds; - rect.right = rect.left; - - if(ledMStart > 0) - { - rect.right = min(rect.left + ledMStart, old_right); - FillRect(hdc, &rect, hbrBar); - rect.left = rect.right; - } - if(infoPtr->MarqueePos > 0) - { - rect.right = min(old_left + infoPtr->MarqueePos, old_right); - FillRect(hdc, &rect, hbrBk); - rect.left = rect.right; - } - if(rect.right < old_right) - { - rect.right = min(rect.left + MARQUEE_LEDS, old_right); - FillRect(hdc, &rect, hbrBar); - rect.left = rect.right; - } - if(rect.right < old_right) - { - rect.right = old_right; - FillRect(hdc, &rect, hbrBk); - } - } - else - { - INT old_right = rect.right; - rect.right = rightBar; - FillRect(hdc, &rect, hbrBar); - rect.left = rect.right; - rect.right = old_right; - FillRect(hdc, &rect, hbrBk); - } + /* case 2: the marquee bar is between start and end */ + const int barStart = infoPtr->MarqueePos * ledW; + const int barEnd = min (ledMEnd * ledW, barSize); + + drawProcs[1]( &pdi, 0, barStart); + drawProcs[0]( &pdi, barStart, barEnd); + drawProcs[1]( &pdi, barEnd, barSize); } - } else { - if (dwStyle & PBS_VERTICAL) { - if (dwStyle & PBS_MARQUEE) - { - INT i, old_top, old_bottom, ledMStart, leds; - old_top = rect.top; - old_bottom = rect.bottom; - - leds = ((rect.bottom - rect.top) + (ledWidth + LED_GAP) - 1) / (ledWidth + LED_GAP); - ledMStart = (infoPtr->MarqueePos + MARQUEE_LEDS) - leds; - - while(ledMStart > 0) - { - rect.top = max(rect.bottom - ledWidth, old_top); - FillRect(hdc, &rect, hbrBar); - rect.bottom = rect.top; - rect.top -= LED_GAP; - if (rect.top <= old_top) break; - FillRect(hdc, &rect, hbrBk); - rect.bottom = rect.top; - ledMStart--; - } - if(infoPtr->MarqueePos > 0) - { - rect.top = max(old_bottom - (infoPtr->MarqueePos * (ledWidth + LED_GAP)), old_top); - FillRect(hdc, &rect, hbrBk); - rect.bottom = rect.top; - } - for(i = 0; i < MARQUEE_LEDS && rect.top >= old_top; i++) - { - rect.top = max(rect.bottom - ledWidth, old_top); - FillRect(hdc, &rect, hbrBar); - rect.bottom = rect.top; - rect.top -= LED_GAP; - if (rect.top <= old_top) break; - FillRect(hdc, &rect, hbrBk); - rect.bottom = rect.top; - } - if(rect.top >= old_top) - { - rect.top = old_top; - FillRect(hdc, &rect, hbrBk); - } - } - else - { - while(rect.bottom > rightBar) { - rect.top = rect.bottom - ledWidth; - if (rect.top < rightMost) - rect.top = rightMost; - FillRect(hdc, &rect, hbrBar); - rect.bottom = rect.top; - rect.top -= LED_GAP; - if (rect.top <= rightBar) break; - FillRect(hdc, &rect, hbrBk); - rect.bottom = rect.top; - } - } - rect.top = rightMost; - FillRect(hdc, &rect, hbrBk); - } else { - if (dwStyle & PBS_MARQUEE) - { - INT i, old_right, old_left, ledMStart, leds; - old_left = rect.left; - old_right = rect.right; - - leds = ((rect.right - rect.left) + ledWidth - 1) / (ledWidth + LED_GAP); - ledMStart = (infoPtr->MarqueePos + MARQUEE_LEDS) - leds; - rect.right = rect.left; - - while(ledMStart > 0) - { - rect.right = min(rect.left + ledWidth, old_right); - FillRect(hdc, &rect, hbrBar); - rect.left = rect.right; - rect.right += LED_GAP; - if (rect.right > old_right) break; - FillRect(hdc, &rect, hbrBk); - rect.left = rect.right; - ledMStart--; - } - if(infoPtr->MarqueePos > 0) - { - rect.right = min(old_left + (infoPtr->MarqueePos * (ledWidth + LED_GAP)), old_right); - FillRect(hdc, &rect, hbrBk); - rect.left = rect.right; - } - for(i = 0; i < MARQUEE_LEDS && rect.right < old_right; i++) - { - rect.right = min(rect.left + ledWidth, old_right); - FillRect(hdc, &rect, hbrBar); - rect.left = rect.right; - rect.right += LED_GAP; - if (rect.right > old_right) break; - FillRect(hdc, &rect, hbrBk); - rect.left = rect.right; - } - if(rect.right < old_right) - { - rect.right = old_right; - FillRect(hdc, &rect, hbrBk); - } - } - else - { - while(rect.left < rightBar) { - rect.right = rect.left + ledWidth; - if (rect.right > rightMost) - rect.right = rightMost; - FillRect(hdc, &rect, hbrBar); - rect.left = rect.right; - rect.right += LED_GAP; - if (rect.right >= rightBar) break; - FillRect(hdc, &rect, hbrBk); - rect.left = rect.right; - } - rect.right = rightMost; - FillRect(hdc, &rect, hbrBk); - } + } + else + { + int barEnd = get_bar_position( infoPtr, dwStyle, &pdi.rect, + infoPtr->CurVal); + if (!barSmooth) + { + const int ledW = pdi.ledW + pdi.ledGap; + barEnd = min (((barEnd + ledW - 1) / ledW) * ledW, barSize); } + drawProcs[0]( &pdi, 0, barEnd); + drawProcs[1]( &pdi, barEnd, barSize); } /* delete bar brush */ - if (infoPtr->ColorBar != CLR_DEFAULT) DeleteObject (hbrBar); - if (infoPtr->ColorBk != CLR_DEFAULT) DeleteObject (hbrBk); + if (infoPtr->ColorBar != CLR_DEFAULT) DeleteObject (pdi.hbrBar); + if (infoPtr->ColorBk != CLR_DEFAULT) DeleteObject (pdi.hbrBk); return 0; } - /*********************************************************************** * PROGRESS_Paint * Draw the progress bar. The background need not be erased. @@ -404,39 +492,19 @@ LONG style = GetWindowLongW (infoPtr->Self, GWL_STYLE); RECT rect; int ledWidth, leds; + HTHEME theme = GetWindowTheme (infoPtr->Self); + BOOL barSmooth = (style & PBS_SMOOTH) && !theme; - GetClientRect (infoPtr->Self, &rect); - InflateRect(&rect, -1, -1); + get_client_rect (infoPtr->Self, &rect); - if(!(style & PBS_SMOOTH)) - { - int width, height; - - if(style & PBS_VERTICAL) - { - width = rect.bottom - rect.top; - height = rect.right - rect.left; - } - else - { - height = rect.bottom - rect.top; - width = rect.right - rect.left; - } - ledWidth = MulDiv (height, 2, 3); - leds = (width + ledWidth - 1) / (ledWidth + LED_GAP); - } + if(!barSmooth) + ledWidth = get_led_size( infoPtr, style, &rect ) + + get_led_gap( infoPtr ); else - { ledWidth = 1; - if(style & PBS_VERTICAL) - { - leds = rect.bottom - rect.top; - } - else - { - leds = rect.right - rect.left; - } - } + + leds = (get_bar_size( style, &rect ) + ledWidth - 1) / + ledWidth; /* increment the marquee progress */ if(++infoPtr->MarqueePos >= leds) @@ -444,7 +512,8 @@ infoPtr->MarqueePos = 0; } - InvalidateRect(infoPtr->Self, &rect, TRUE); + InvalidateRect(infoPtr->Self, &rect, FALSE); + UpdateWindow(infoPtr->Self); } return 0; } @@ -496,6 +565,8 @@ WPARAM wParam, LPARAM lParam) { PROGRESS_INFO *infoPtr; + static const WCHAR themeClass[] = {'P','r','o','g','r','e','s','s',0}; + HTHEME theme; TRACE("hwnd=%p msg=%04x wparam=%x lParam=%lx\n", hwnd, message, wParam, lParam); @@ -508,8 +579,11 @@ case WM_CREATE: { DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); + + theme = OpenThemeData (hwnd, themeClass); + dwExStyle &= ~(WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE); - dwExStyle |= WS_EX_STATICEDGE; + if (!theme) dwExStyle |= WS_EX_STATICEDGE; SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle); /* Force recalculation of a non-client area */ SetWindowPos(hwnd, 0, 0, 0, 0, 0, @@ -531,6 +605,7 @@ infoPtr->ColorBar = CLR_DEFAULT; infoPtr->ColorBk = CLR_DEFAULT; infoPtr->Font = 0; + TRACE("Progress Ctrl creation, hwnd=%p\n", hwnd); return 0; } @@ -539,8 +614,13 @@ TRACE("Progress Ctrl destruction, hwnd=%p\n", hwnd); Free (infoPtr); SetWindowLongPtrW(hwnd, 0, 0); + theme = GetWindowTheme (hwnd); + CloseThemeData (theme); return 0; + case WM_ERASEBKGND: + return 1; + case WM_GETFONT: return (LRESULT)infoPtr->Font; @@ -553,6 +633,25 @@ case WM_TIMER: return PROGRESS_Timer (infoPtr, (INT)wParam); + case WM_THEMECHANGED: + { + DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); + + theme = GetWindowTheme (hwnd); + CloseThemeData (theme); + theme = OpenThemeData (hwnd, themeClass); + + /* WS_EX_STATICEDGE disappears when the control is themed */ + if (theme) + dwExStyle &= ~WS_EX_STATICEDGE; + else + dwExStyle |= WS_EX_STATICEDGE; + SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle); + + InvalidateRect (hwnd, NULL, FALSE); + return 0; + } + case PBM_DELTAPOS: { INT oldVal; @@ -562,6 +661,7 @@ PROGRESS_CoercePos (infoPtr); TRACE("PBM_DELTAPOS: current pos changed from %d to %d\n", oldVal, infoPtr->CurVal); PROGRESS_Invalidate( infoPtr, oldVal, infoPtr->CurVal ); + UpdateWindow( infoPtr->Self ); } return oldVal; } @@ -575,6 +675,7 @@ PROGRESS_CoercePos(infoPtr); TRACE("PBM_SETPOS: current pos changed from %d to %d\n", oldVal, infoPtr->CurVal); PROGRESS_Invalidate( infoPtr, oldVal, infoPtr->CurVal ); + UpdateWindow( infoPtr->Self ); } return oldVal; } @@ -601,6 +702,7 @@ { TRACE("PBM_STEPIT: current pos changed from %d to %d\n", oldVal, infoPtr->CurVal); PROGRESS_Invalidate( infoPtr, oldVal, infoPtr->CurVal ); + UpdateWindow( infoPtr->Self ); } return oldVal; } diff -urN wine-20050725/dlls/comctl32/propsheet.c wine-20050830/dlls/comctl32/propsheet.c --- wine-20050725/dlls/comctl32/propsheet.c 2005-07-18 12:31:06.000000000 +0200 +++ wine-20050830/dlls/comctl32/propsheet.c 2005-08-30 12:07:17.000000000 +0200 @@ -162,7 +162,7 @@ /****************************************************************************** * Prototypes */ -static int PROPSHEET_CreateDialog(PropSheetInfo* psInfo); +static INT_PTR PROPSHEET_CreateDialog(PropSheetInfo* psInfo); static BOOL PROPSHEET_SizeMismatch(HWND hwndDlg, PropSheetInfo* psInfo); static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo* psInfo); static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo); @@ -452,6 +452,9 @@ DWORD dwFlags; int width, height; + if (!lppsp) + return FALSE; + TRACE("\n"); psInfo->proppage[index].hpage = (HPROPSHEETPAGE)lppsp; psInfo->proppage[index].hwndPage = 0; @@ -591,7 +594,7 @@ if ( !HIWORD( lppsp->pszTitle ) ) { - if (!LoadStringW( lppsp->hInstance, (UINT)lppsp->pszTitle,szTitle,sizeof(szTitle) )) + if (!LoadStringW( lppsp->hInstance, (DWORD_PTR)lppsp->pszTitle,szTitle,sizeof(szTitle) )) { pTitle = pszNull; FIXME("Could not load resource #%04x?\n",LOWORD(lppsp->pszTitle)); @@ -640,7 +643,7 @@ * * Creates the actual property sheet. */ -int PROPSHEET_CreateDialog(PropSheetInfo* psInfo) +INT_PTR PROPSHEET_CreateDialog(PropSheetInfo* psInfo) { LRESULT ret; LPCVOID template; @@ -708,7 +711,7 @@ * -1 (error). */ if( psInfo->unicode ) { - ret = (int)CreateDialogIndirectParamW(psInfo->ppshheader.hInstance, + ret = (INT_PTR)CreateDialogIndirectParamW(psInfo->ppshheader.hInstance, (LPDLGTEMPLATEW) temp, psInfo->ppshheader.hwndParent, PROPSHEET_DialogProc, @@ -717,7 +720,7 @@ } else { - ret = (int)CreateDialogIndirectParamA(psInfo->ppshheader.hInstance, + ret = (INT_PTR)CreateDialogIndirectParamA(psInfo->ppshheader.hInstance, (LPDLGTEMPLATEA) temp, psInfo->ppshheader.hwndParent, PROPSHEET_DialogProc, @@ -827,8 +830,8 @@ rc.right -= rc.left; rc.bottom -= rc.top; - TRACE("setting tab %08lx, rc (0,0)-(%ld,%ld)\n", - (DWORD)hwndTabCtrl, rc.right, rc.bottom); + TRACE("setting tab %p, rc (0,0)-(%ld,%ld)\n", + hwndTabCtrl, rc.right, rc.bottom); SetWindowPos(hwndTabCtrl, 0, 0, 0, rc.right, rc.bottom, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); @@ -843,8 +846,8 @@ /* * Resize the property sheet. */ - TRACE("setting dialog %08lx, rc (0,0)-(%ld,%ld)\n", - (DWORD)hwndDlg, rc.right, rc.bottom); + TRACE("setting dialog %p, rc (0,0)-(%ld,%ld)\n", + hwndDlg, rc.right, rc.bottom); SetWindowPos(hwndDlg, 0, 0, 0, rc.right, rc.bottom, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); return TRUE; @@ -879,8 +882,8 @@ AdjustWindowRect(&rc, GetWindowLongW(hwndDlg, GWL_STYLE), FALSE); /* Resize the property sheet */ - TRACE("setting dialog %08lx, rc (0,0)-(%ld,%ld)\n", - (DWORD)hwndDlg, rc.right, rc.bottom); + TRACE("setting dialog %p, rc (0,0)-(%ld,%ld)\n", + hwndDlg, rc.right, rc.bottom); SetWindowPos(hwndDlg, 0, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); @@ -1361,7 +1364,7 @@ TRACE("%d items\n",nrofitems); while (nrofitems > 0) { - p = (WORD*)(((DWORD)p + 3) & ~3); /* DWORD align */ + p = (WORD*)(((DWORD_PTR)p + 3) & ~3); /* DWORD align */ /* skip header */ p += (istemplateex ? sizeof(MyDLGITEMTEMPLATEEX) : sizeof(DLGITEMTEMPLATE))/sizeof(WORD); @@ -1564,7 +1567,7 @@ !(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK)) { ((PropSheetInfo *)psInfo)->ppshheader.u4.hbmWatermark = - CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0); + CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0); } /* Same behavior as for watermarks */ @@ -1572,7 +1575,7 @@ !(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER)) { ((PropSheetInfo *)psInfo)->ppshheader.u5.hbmHeader = - CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0); + CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0); } } } @@ -2631,7 +2634,7 @@ TRACE("(%p, %d)\n", hwndDlg, iPageId); for (index = 0; index < psInfo->nPages; index++) { psp = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage; - if (psp->u.pszTemplate == (LPCWSTR)iPageId) + if (psp->u.pszTemplate == MAKEINTRESOURCEW(iPageId)) return index; } @@ -2799,9 +2802,9 @@ *| ID_PSREBOOTSYSTEM - The user must reboot the computer for the changes to take effect. *| ID_PSRESTARTWINDOWS - The user must restart Windows for the changes to take effect. */ -INT WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh) +INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh) { - int bRet = 0; + INT_PTR bRet = 0; PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR, sizeof(PropSheetInfo)); UINT i, n; @@ -2850,9 +2853,9 @@ * * See PropertySheetA. */ -INT WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh) +INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh) { - int bRet = 0; + INT_PTR bRet = 0; PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR, sizeof(PropSheetInfo)); UINT i, n; @@ -3238,7 +3241,7 @@ } else { - nLength = LoadStringW(ppshpage->hInstance, (UINT)ppshpage->pszHeaderTitle, + nLength = LoadStringW(ppshpage->hInstance, (UINT_PTR)ppshpage->pszHeaderTitle, szBuffer, 256); if (nLength != 0) { @@ -3262,7 +3265,7 @@ } else { - nLength = LoadStringW(ppshpage->hInstance, (UINT)ppshpage->pszHeaderSubTitle, + nLength = LoadStringW(ppshpage->hInstance, (UINT_PTR)ppshpage->pszHeaderSubTitle, szBuffer, 256); if (nLength != 0) { @@ -3440,7 +3443,7 @@ WCHAR szText[256]; if (LoadStringW(psInfo->ppshheader.hInstance, - (UINT)psInfo->ppshheader.pszCaption, szText, 255)) + (UINT_PTR)psInfo->ppshheader.pszCaption, szText, 255)) PROPSHEET_SetTitleW(hwnd, psInfo->ppshheader.dwFlags, szText); } else diff -urN wine-20050725/dlls/comctl32/rebar.c wine-20050830/dlls/comctl32/rebar.c --- wine-20050725/dlls/comctl32/rebar.c 2005-03-27 19:52:16.000000000 +0200 +++ wine-20050830/dlls/comctl32/rebar.c 2005-08-27 12:00:39.000000000 +0200 @@ -102,6 +102,8 @@ #include "winnls.h" #include "commctrl.h" #include "comctl32.h" +#include "uxtheme.h" +#include "tmschema.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(rebar); @@ -184,6 +186,7 @@ HFONT hFont; /* handle to the rebar's font */ SIZE imageSize; /* image size (image list) */ DWORD dwStyle; /* window style */ + DWORD orgStyle; /* original style (dwStyle may change) */ SIZE calcSize; /* calculated rebar size */ SIZE oldSize; /* previous calculated rebar size */ BOOL bUnicode; /* TRUE if this window is W type */ @@ -322,6 +325,7 @@ static CHAR line[200]; +static const WCHAR themeClass[] = { 'R','e','b','a','r',0 }; static CHAR * REBAR_FmtStyle( UINT style) @@ -542,6 +546,7 @@ HFONT hOldFont = 0; INT oldBkMode = 0; NMCUSTOMDRAW nmcd; + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); if (lpBand->fDraw & DRAW_TEXT) { hOldFont = SelectObject (hdc, infoPtr->hFont); @@ -567,7 +572,19 @@ /* draw gripper */ if (lpBand->fDraw & DRAW_GRIPPER) - DrawEdge (hdc, &lpBand->rcGripper, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE); + { + if (theme) + { + RECT rcGripper = lpBand->rcGripper; + int partId = (infoPtr->dwStyle & CCS_VERT) ? RP_GRIPPERVERT : RP_GRIPPER; + GetThemeBackgroundExtent (theme, hdc, partId, 0, &rcGripper, &rcGripper); + OffsetRect (&rcGripper, lpBand->rcGripper.left - rcGripper.left, + lpBand->rcGripper.top - rcGripper.top); + DrawThemeBackground (theme, hdc, partId, 0, &rcGripper, NULL); + } + else + DrawEdge (hdc, &lpBand->rcGripper, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE); + } /* draw caption image */ if (lpBand->fDraw & DRAW_IMAGE) { @@ -604,18 +621,32 @@ if (!IsRectEmpty(&lpBand->rcChevron)) { - if (lpBand->fDraw & DRAW_CHEVRONPUSHED) + if (theme) { - DrawEdge(hdc, &lpBand->rcChevron, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE); - REBAR_DrawChevron(hdc, lpBand->rcChevron.left+1, lpBand->rcChevron.top + 11, COLOR_WINDOWFRAME); + int stateId; + if (lpBand->fDraw & DRAW_CHEVRONPUSHED) + stateId = CHEVS_PRESSED; + else if (lpBand->fDraw & DRAW_CHEVRONHOT) + stateId = CHEVS_HOT; + else + stateId = CHEVS_NORMAL; + DrawThemeBackground (theme, hdc, RP_CHEVRON, stateId, &lpBand->rcChevron, NULL); } - else if (lpBand->fDraw & DRAW_CHEVRONHOT) + else { - DrawEdge(hdc, &lpBand->rcChevron, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE); - REBAR_DrawChevron(hdc, lpBand->rcChevron.left, lpBand->rcChevron.top + 10, COLOR_WINDOWFRAME); + if (lpBand->fDraw & DRAW_CHEVRONPUSHED) + { + DrawEdge(hdc, &lpBand->rcChevron, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE); + REBAR_DrawChevron(hdc, lpBand->rcChevron.left+1, lpBand->rcChevron.top + 11, COLOR_WINDOWFRAME); + } + else if (lpBand->fDraw & DRAW_CHEVRONHOT) + { + DrawEdge(hdc, &lpBand->rcChevron, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE); + REBAR_DrawChevron(hdc, lpBand->rcChevron.left, lpBand->rcChevron.top + 10, COLOR_WINDOWFRAME); + } + else + REBAR_DrawChevron(hdc, lpBand->rcChevron.left, lpBand->rcChevron.top + 10, COLOR_WINDOWFRAME); } - else - REBAR_DrawChevron(hdc, lpBand->rcChevron.left, lpBand->rcChevron.top + 10, COLOR_WINDOWFRAME); } if (lpBand->uCDret == (CDRF_NOTIFYPOSTPAINT | CDRF_NOTIFYITEMDRAW)) { @@ -2201,8 +2232,11 @@ UINT i; INT oldrow; HDC hdc = (HDC)wParam; - RECT rect; + RECT rect, cr; COLORREF old = CLR_NONE, new; + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); + + GetClientRect (infoPtr->hwndSelf, &cr); oldrow = -1; for(i=0; iuNumBands; i++) { @@ -2218,12 +2252,18 @@ if (infoPtr->dwStyle & CCS_VERT) { rcRowSep.right += SEP_WIDTH_SIZE; rcRowSep.bottom = infoPtr->calcSize.cy; - DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_RIGHT); + if (theme) + DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcRowSep, EDGE_ETCHED, BF_RIGHT, NULL); + else + DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_RIGHT); } else { rcRowSep.bottom += SEP_WIDTH_SIZE; rcRowSep.right = infoPtr->calcSize.cx; - DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_BOTTOM); + if (theme) + DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcRowSep, EDGE_ETCHED, BF_BOTTOM, NULL); + else + DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_BOTTOM); } TRACE ("drawing band separator bottom (%ld,%ld)-(%ld,%ld)\n", rcRowSep.left, rcRowSep.top, @@ -2237,11 +2277,17 @@ rcSep = lpBand->rcBand; if (infoPtr->dwStyle & CCS_VERT) { rcSep.bottom += SEP_WIDTH_SIZE; - DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_BOTTOM); + if (theme) + DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_BOTTOM, NULL); + else + DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_BOTTOM); } else { rcSep.right += SEP_WIDTH_SIZE; - DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_RIGHT); + if (theme) + DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_RIGHT, NULL); + else + DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_RIGHT); } TRACE("drawing band separator right (%ld,%ld)-(%ld,%ld)\n", rcSep.left, rcSep.top, rcSep.right, rcSep.bottom); @@ -2267,20 +2313,30 @@ new = RGB(0,128,0); #endif } - old = SetBkColor (hdc, new); rect = lpBand->rcBand; - TRACE("%s background color=0x%06lx, band (%ld,%ld)-(%ld,%ld), clip (%ld,%ld)-(%ld,%ld)\n", - (lpBand->clrBack == CLR_NONE) ? "none" : - ((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""), - GetBkColor(hdc), - lpBand->rcBand.left,lpBand->rcBand.top, - lpBand->rcBand.right,lpBand->rcBand.bottom, - clip->left, clip->top, - clip->right, clip->bottom); - ExtTextOutW (hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, 0); - if (lpBand->clrBack != CLR_NONE) - SetBkColor (hdc, old); + + if (theme) + { + /* When themed, the background color is ignored (but not a + * background bitmap */ + DrawThemeBackground (theme, hdc, 0, 0, &cr, &rect); + } + else + { + old = SetBkColor (hdc, new); + TRACE("%s background color=0x%06lx, band (%ld,%ld)-(%ld,%ld), clip (%ld,%ld)-(%ld,%ld)\n", + (lpBand->clrBack == CLR_NONE) ? "none" : + ((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""), + GetBkColor(hdc), + lpBand->rcBand.left,lpBand->rcBand.top, + lpBand->rcBand.right,lpBand->rcBand.bottom, + clip->left, clip->top, + clip->right, clip->bottom); + ExtTextOutW (hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, 0); + if (lpBand->clrBack != CLR_NONE) + SetBkColor (hdc, old); + } } return TRUE; } @@ -3759,6 +3815,7 @@ { LPCREATESTRUCTW cs = (LPCREATESTRUCTW) lParam; RECT wnrc1, clrc1; + HTHEME theme; if (TRACE_ON(rebar)) { GetWindowRect(infoPtr->hwndSelf, &wnrc1); @@ -3770,6 +3827,13 @@ } TRACE("created!\n"); + + if ((theme = OpenThemeData (infoPtr->hwndSelf, themeClass))) + { + /* native seems to clear WS_BORDER when themed */ + infoPtr->dwStyle &= ~WS_BORDER; + } + return 0; } @@ -3807,6 +3871,8 @@ DestroyCursor (infoPtr->hcurDrag); if(infoPtr->hDefaultFont) DeleteObject (infoPtr->hDefaultFont); SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); + + CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); /* free rebar info data */ Free (infoPtr); @@ -3869,7 +3935,7 @@ { REBAR_BAND *lpBand; UINT htFlags; - UINT iHitBand; + INT iHitBand; POINT ptMouseDown; ptMouseDown.x = (INT)LOWORD(lParam); ptMouseDown.y = (INT)HIWORD(lParam); @@ -4051,10 +4117,15 @@ inline static LRESULT REBAR_NCCalcSize (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { + HTHEME theme; if (infoPtr->dwStyle & WS_BORDER) { InflateRect((LPRECT)lParam, -GetSystemMetrics(SM_CXEDGE), -GetSystemMetrics(SM_CYEDGE)); } + else if ((theme = GetWindowTheme (infoPtr->hwndSelf))) + { + ((LPRECT)lParam)->top++; + } TRACE("new client=(%ld,%ld)-(%ld,%ld)\n", ((LPRECT)lParam)->left, ((LPRECT)lParam)->top, ((LPRECT)lParam)->right, ((LPRECT)lParam)->bottom); @@ -4117,6 +4188,8 @@ } infoPtr->NtfUnicode = (i == NFR_UNICODE) ? 1 : 0; + /* Stow away the original style */ + infoPtr->orgStyle = cs->style; /* add necessary styles to the requested styles */ infoPtr->dwStyle = cs->style | WS_VISIBLE | CCS_TOP; SetWindowLongW (hwnd, GWL_STYLE, infoPtr->dwStyle); @@ -4200,6 +4273,7 @@ { RECT rcWindow; HDC hdc; + HTHEME theme; if (infoPtr->dwStyle & WS_MINIMIZE) return 0; /* Nothing to do */ @@ -4217,6 +4291,19 @@ DrawEdge (hdc, &rcWindow, EDGE_ETCHED, BF_RECT); ReleaseDC( infoPtr->hwndSelf, hdc ); } + else if ((theme = GetWindowTheme (infoPtr->hwndSelf))) + { + /* adjust rectangle and draw the necessary edge */ + if (!(hdc = GetDCEx( infoPtr->hwndSelf, 0, DCX_USESTYLE | DCX_WINDOW ))) + return 0; + GetWindowRect (infoPtr->hwndSelf, &rcWindow); + OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top); + TRACE("rect (%ld,%ld)-(%ld,%ld)\n", + rcWindow.left, rcWindow.top, + rcWindow.right, rcWindow.bottom); + DrawThemeEdge (theme, hdc, 0, 0, &rcWindow, BDR_RAISEDINNER, BF_TOP, NULL); + ReleaseDC( infoPtr->hwndSelf, hdc ); + } return 0; } @@ -4456,11 +4543,25 @@ TRACE("current style=%08lx, styleOld=%08lx, style being set to=%08lx\n", infoPtr->dwStyle, ss->styleOld, ss->styleNew); - infoPtr->dwStyle = ss->styleNew; + infoPtr->orgStyle = infoPtr->dwStyle = ss->styleNew; + if (GetWindowTheme (infoPtr->hwndSelf)) + infoPtr->dwStyle &= ~WS_BORDER; return FALSE; } +/* update theme after a WM_THEMECHANGED message */ +static LRESULT theme_changed (REBAR_INFO* infoPtr) +{ + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); + CloseThemeData (theme); + theme = OpenThemeData (infoPtr->hwndSelf, themeClass); + /* WS_BORDER disappears when theming is enabled and reappears when + * disabled... */ + infoPtr->dwStyle &= ~WS_BORDER; + infoPtr->dwStyle |= theme ? 0 : (infoPtr->orgStyle & WS_BORDER); + return 0; +} static LRESULT REBAR_WindowPosChanged (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) @@ -4691,6 +4792,9 @@ case WM_STYLECHANGED: return REBAR_StyleChanged (infoPtr, wParam, lParam); + case WM_THEMECHANGED: + return theme_changed (infoPtr); + /* case WM_SYSCOLORCHANGE: supported according to ControlSpy */ /* "Applications that have brushes using the existing system colors should delete those brushes and recreate them using the new diff -urN wine-20050725/dlls/comctl32/status.c wine-20050830/dlls/comctl32/status.c --- wine-20050725/dlls/comctl32/status.c 2005-03-02 11:08:29.000000000 +0100 +++ wine-20050830/dlls/comctl32/status.c 2005-08-30 12:07:17.000000000 +0200 @@ -51,6 +51,8 @@ #include "winnls.h" #include "commctrl.h" #include "comctl32.h" +#include "uxtheme.h" +#include "tmschema.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(statusbar); @@ -94,6 +96,8 @@ #define VERT_BORDER 2 #define HORZ_GAP 2 +const static WCHAR themeClass[] = { 'S','t','a','t','u','s',0 }; + /* prototype */ static void STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr); @@ -104,13 +108,28 @@ } static void -STATUSBAR_DrawSizeGrip (HDC hdc, LPRECT lpRect) +STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect) { HPEN hPenFace, hPenShadow, hPenHighlight, hOldPen; POINT pt; INT i; TRACE("draw size grip %ld,%ld - %ld,%ld\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); + + if (theme) + { + RECT gripperRect; + SIZE gripperSize; + gripperRect = *lpRect; + if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect, + TS_DRAW, &gripperSize))) + { + gripperRect.left = gripperRect.right - gripperSize.cx; + gripperRect.top = gripperRect.bottom - gripperSize.cy; + if (SUCCEEDED (DrawThemeBackground(theme, hdc, SP_GRIPPER, 0, &gripperRect, NULL))) + return; + } + } pt.x = lpRect->right - 1; pt.y = lpRect->bottom - 1; @@ -153,6 +172,8 @@ { RECT r = part->bound; UINT border = BDR_SUNKENOUTER; + HTHEME theme = GetWindowTheme (infoPtr->Self); + int themePart = SP_PANE; TRACE("part bound %ld,%ld - %ld,%ld\n", r.left, r.top, r.right, r.bottom); if (part->style & SBT_POPOUT) @@ -160,7 +181,15 @@ else if (part->style & SBT_NOBORDERS) border = 0; - DrawEdge(hdc, &r, border, BF_RECT|BF_ADJUST); + if (theme) + { + if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) + && (infoPtr->simple || (itemID == (infoPtr->numParts-1)))) + themePart = SP_GRIPPERPANE; + DrawThemeBackground(theme, hdc, themePart, 0, &r, NULL); + } + else + DrawEdge(hdc, &r, border, BF_RECT|BF_ADJUST); if (part->style & SBT_OWNERDRAW) { DRAWITEMSTRUCT dis; @@ -170,7 +199,7 @@ dis.hwndItem = infoPtr->Self; dis.hDC = hdc; dis.rcItem = r; - dis.itemData = (INT)part->text; + dis.itemData = (ULONG_PTR)part->text; SendMessageW (infoPtr->Notify, WM_DRAWITEM, (WPARAM)dis.CtlID, (LPARAM)&dis); } else { if (part->hIcon) { @@ -190,6 +219,7 @@ { HBRUSH hbrBk; HFONT hOldFont; + HTHEME theme; TRACE("item %d\n", itemID); if (!IsWindowVisible (infoPtr->Self)) @@ -197,11 +227,22 @@ if (part->bound.right < part->bound.left) return; - if (infoPtr->clrBk != CLR_DEFAULT) - hbrBk = CreateSolidBrush (infoPtr->clrBk); + if ((theme = GetWindowTheme (infoPtr->Self))) + { + RECT cr; + GetClientRect (infoPtr->Self, &cr); + DrawThemeBackground(theme, hdc, 0, 0, &cr, &part->bound); + } else - hbrBk = GetSysColorBrush (COLOR_3DFACE); - FillRect(hdc, &part->bound, hbrBk); + { + if (infoPtr->clrBk != CLR_DEFAULT) + hbrBk = CreateSolidBrush (infoPtr->clrBk); + else + hbrBk = GetSysColorBrush (COLOR_3DFACE); + FillRect(hdc, &part->bound, hbrBk); + if (infoPtr->clrBk != CLR_DEFAULT) + DeleteObject (hbrBk); + } hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont); @@ -209,14 +250,11 @@ SelectObject (hdc, hOldFont); - if (infoPtr->clrBk != CLR_DEFAULT) - DeleteObject (hbrBk); - if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) { RECT rect; GetClientRect (infoPtr->Self, &rect); - STATUSBAR_DrawSizeGrip (hdc, &rect); + STATUSBAR_DrawSizeGrip (theme, hdc, &rect); } } @@ -228,6 +266,7 @@ RECT rect; HBRUSH hbrBk; HFONT hOldFont; + HTHEME theme; TRACE("\n"); if (!IsWindowVisible(infoPtr->Self)) @@ -237,11 +276,20 @@ GetClientRect (infoPtr->Self, &rect); - if (infoPtr->clrBk != CLR_DEFAULT) - hbrBk = CreateSolidBrush (infoPtr->clrBk); + if ((theme = GetWindowTheme (infoPtr->Self))) + { + DrawThemeBackground(theme, hdc, 0, 0, &rect, NULL); + } else - hbrBk = GetSysColorBrush (COLOR_3DFACE); - FillRect(hdc, &rect, hbrBk); + { + if (infoPtr->clrBk != CLR_DEFAULT) + hbrBk = CreateSolidBrush (infoPtr->clrBk); + else + hbrBk = GetSysColorBrush (COLOR_3DFACE); + FillRect(hdc, &rect, hbrBk); + if (infoPtr->clrBk != CLR_DEFAULT) + DeleteObject (hbrBk); + } hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont); @@ -255,11 +303,8 @@ SelectObject (hdc, hOldFont); - if (infoPtr->clrBk != CLR_DEFAULT) - DeleteObject (hbrBk); - if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) - STATUSBAR_DrawSizeGrip (hdc, &rect); + STATUSBAR_DrawSizeGrip (theme, hdc, &rect); return 0; } @@ -570,9 +615,26 @@ if (IsWindowVisible (infoPtr->Self)) { INT width, x, y; RECT parent_rect; + HTHEME theme; GetClientRect (infoPtr->Notify, &parent_rect); infoPtr->height = height + infoPtr->verticalBorder; + + if ((theme = GetWindowTheme (infoPtr->Self))) + { + /* Determine bar height from theme such that the content area is + * 'height' pixels large */ + HDC hdc = GetDC (infoPtr->Self); + RECT r; + memset (&r, 0, sizeof (r)); + r.bottom = height; + if (SUCCEEDED(GetThemeBackgroundExtent (theme, hdc, SP_PANE, 0, &r, &r))) + { + infoPtr->height = r.bottom - r.top; + } + ReleaseDC (infoPtr->Self, hdc); + } + width = parent_rect.right - parent_rect.left; x = parent_rect.left; y = parent_rect.bottom - infoPtr->height; @@ -820,6 +882,8 @@ if (infoPtr->hwndToolTip) DestroyWindow (infoPtr->hwndToolTip); + CloseThemeData (GetWindowTheme (infoPtr->Self)); + SetWindowLongPtrW(infoPtr->Self, 0, 0); Free (infoPtr); return 0; @@ -879,6 +943,8 @@ infoPtr->parts[0].x = -1; infoPtr->parts[0].style = 0; infoPtr->parts[0].hIcon = 0; + + OpenThemeData (hwnd, themeClass); if (IsWindowUnicode (hwnd)) { infoPtr->bUnicode = TRUE; @@ -901,11 +967,15 @@ } dwStyle = GetWindowLongW (hwnd, GWL_STYLE); + /* native seems to clear WS_BORDER, too */ + dwStyle &= ~WS_BORDER; /* statusbars on managed windows should not have SIZEGRIP style */ if ((dwStyle & SBARS_SIZEGRIP) && lpCreate->hwndParent && GetPropA( lpCreate->hwndParent, "__wine_x11_managed" )) - SetWindowLongW (hwnd, GWL_STYLE, dwStyle & ~SBARS_SIZEGRIP); + dwStyle &= ~SBARS_SIZEGRIP; + + SetWindowLongW (hwnd, GWL_STYLE, dwStyle); if ((hdc = GetDC (hwnd))) { TEXTMETRICW tm; @@ -940,9 +1010,26 @@ } if (!(dwStyle & CCS_NORESIZE)) { /* don't resize wnd if it doesn't want it ! */ + HTHEME theme; GetClientRect (infoPtr->Notify, &rect); width = rect.right - rect.left; infoPtr->height = textHeight + 4 + infoPtr->verticalBorder; + + if ((theme = GetWindowTheme (hwnd))) + { + /* Determine bar height from theme such that the content area is + * textHeight pixels large */ + HDC hdc = GetDC (hwnd); + RECT r; + memset (&r, 0, sizeof (r)); + r.bottom = textHeight; + if (SUCCEEDED(GetThemeBackgroundExtent (theme, hdc, SP_PANE, 0, &r, &r))) + { + infoPtr->height = r.bottom - r.top; + } + ReleaseDC (hwnd, hdc); + } + SetWindowPos(hwnd, 0, lpCreate->x, lpCreate->y - 1, width, infoPtr->height, SWP_NOZORDER); STATUSBAR_SetPartBounds (infoPtr); @@ -1102,6 +1189,16 @@ } +/* update theme after a WM_THEMECHANGED message */ +static LRESULT theme_changed (STATUS_INFO* infoPtr) +{ + HTHEME theme = GetWindowTheme (infoPtr->Self); + CloseThemeData (theme); + OpenThemeData (infoPtr->Self, themeClass); + return 0; +} + + static LRESULT STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd) { @@ -1264,6 +1361,9 @@ if (STATUSBAR_WMSize (infoPtr, (WORD)wParam)) return 0; return DefWindowProcW (hwnd, msg, wParam, lParam); + case WM_THEMECHANGED: + return theme_changed (infoPtr); + default: if ((msg >= WM_USER) && (msg < WM_APP)) ERR("unknown msg %04x wp=%04x lp=%08lx\n", diff -urN wine-20050725/dlls/comctl32/tab.c wine-20050830/dlls/comctl32/tab.c --- wine-20050725/dlls/comctl32/tab.c 2005-06-06 12:03:03.000000000 +0200 +++ wine-20050830/dlls/comctl32/tab.c 2005-08-30 12:07:17.000000000 +0200 @@ -73,6 +73,8 @@ #include "winnls.h" #include "commctrl.h" #include "comctl32.h" +#include "uxtheme.h" +#include "tmschema.h" #include "wine/debug.h" #include @@ -140,19 +142,26 @@ #define BUTTON_SPACINGX 3 #define BUTTON_SPACINGY 3 #define FLAT_BTN_SPACINGX 8 -#define DEFAULT_TAB_WIDTH 96 +#define DEFAULT_MIN_TAB_WIDTH 54 +#define DEFAULT_TAB_WIDTH_FIXED 96 +#define DEFAULT_PADDING_X 6 +#define EXTRA_ICON_PADDING 3 #define TAB_GetInfoPtr(hwnd) ((TAB_INFO *)GetWindowLongPtrW(hwnd,0)) /* Since items are variable sized, cannot directly access them */ #define TAB_GetItem(info,i) \ ((TAB_ITEM*)((LPBYTE)info->items + (i) * TAB_ITEM_SIZE(info))) +#define GET_DEFAULT_MIN_TAB_WIDTH(infoPtr) (DEFAULT_MIN_TAB_WIDTH - (DEFAULT_PADDING_X - (infoPtr)->uHItemPadding) * 2) + /****************************************************************************** * Hot-tracking timer constants */ #define TAB_HOTTRACK_TIMER 1 #define TAB_HOTTRACK_TIMER_INTERVAL 100 /* milliseconds */ +static const WCHAR themeClass[] = { 'T','a','b',0 }; + /****************************************************************************** * Prototypes */ @@ -325,7 +334,18 @@ if ( (infoPtr->uNumItem <= 0) || (itemIndex >= infoPtr->uNumItem) || (!((lStyle & TCS_MULTILINE) || (lStyle & TCS_VERTICAL)) && (itemIndex < infoPtr->leftmostVisible)) ) - return FALSE; + { + TRACE("Not Visible\n"); + /* need to initialize these to empty rects */ + if (itemRect) + { + memset(itemRect,0,sizeof(RECT)); + itemRect->bottom = infoPtr->tabHeight; + } + if (selectedRect) + memset(selectedRect,0,sizeof(RECT)); + return FALSE; + } /* * Avoid special cases in this procedure by assigning the "out" @@ -581,7 +601,8 @@ TAB_LButtonDown (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { POINT pt; - INT newItem, dummy; + INT newItem; + UINT dummy; if (infoPtr->hwndToolTip) TAB_RelayEvent (infoPtr->hwndToolTip, infoPtr->hwnd, @@ -658,6 +679,22 @@ ReleaseDC(infoPtr->hwnd, hdc); } +/* update a tab after hottracking - invalidate it or just redraw the interior, + * based on whether theming is used or not */ +static inline void hottrack_refresh (TAB_INFO* infoPtr, int tabIndex) +{ + if (tabIndex == -1) return; + + if (GetWindowTheme (infoPtr->hwnd)) + { + RECT rect; + TAB_InternalGetItemRect(infoPtr, tabIndex, &rect, NULL); + InvalidateRect (infoPtr->hwnd, &rect, FALSE); + } + else + TAB_DrawLoneItemInterior(infoPtr, tabIndex); +} + /****************************************************************************** * TAB_HotTrackTimerProc * @@ -674,7 +711,7 @@ ( HWND hwnd, /* handle of window for timer messages */ UINT uMsg, /* WM_TIMER message */ - UINT idEvent, /* timer identifier */ + UINT_PTR idEvent, /* timer identifier */ DWORD dwTime /* current system time */ ) { @@ -697,7 +734,7 @@ /* Redraw iHotTracked to look normal */ INT iRedraw = infoPtr->iHotTracked; infoPtr->iHotTracked = -1; - TAB_DrawLoneItemInterior(infoPtr, iRedraw); + hottrack_refresh (infoPtr, iRedraw); /* Kill this timer */ KillTimer(hwnd, TAB_HOTTRACK_TIMER); @@ -738,7 +775,8 @@ if (out_redrawEnter != NULL) *out_redrawEnter = -1; - if (GetWindowLongW(infoPtr->hwnd, GWL_STYLE) & TCS_HOTTRACK) + if ((GetWindowLongW(infoPtr->hwnd, GWL_STYLE) & TCS_HOTTRACK) + || GetWindowTheme (infoPtr->hwnd)) { POINT pt; UINT flags; @@ -816,10 +854,8 @@ ** status. */ TAB_RecalcHotTrack(infoPtr, &lParam, &redrawLeave, &redrawEnter); - if (redrawLeave != -1) - TAB_DrawLoneItemInterior(infoPtr, redrawLeave); - if (redrawEnter != -1) - TAB_DrawLoneItemInterior(infoPtr, redrawEnter); + hottrack_refresh (infoPtr, redrawLeave); + hottrack_refresh (infoPtr, redrawEnter); return 0; } @@ -1133,23 +1169,43 @@ /* Set the leftmost position of the tab. */ curr->rect.left = curItemLeftPos; - if ((lStyle & TCS_FIXEDWIDTH) || !curr->pszText) + if (lStyle & TCS_FIXEDWIDTH) { curr->rect.right = curr->rect.left + max(infoPtr->tabWidth, icon_width); } - else + else if (!curr->pszText) { - int num = 2; + /* If no text use minimum tab width including padding. */ + if (infoPtr->tabMinWidth < 0) + curr->rect.right = curr->rect.left + GET_DEFAULT_MIN_TAB_WIDTH(infoPtr); + else + { + curr->rect.right = curr->rect.left + infoPtr->tabMinWidth; + /* Add extra padding if icon is present */ + if (infoPtr->himl && infoPtr->tabMinWidth > 0 && infoPtr->tabMinWidth < DEFAULT_MIN_TAB_WIDTH + && infoPtr->uHItemPadding > 1) + curr->rect.right += EXTRA_ICON_PADDING * (infoPtr->uHItemPadding-1); + } + } + else + { + int tabwidth; /* Calculate how wide the tab is depending on the text it contains */ GetTextExtentPoint32W(hdc, curr->pszText, lstrlenW(curr->pszText), &size); - curr->rect.right = curr->rect.left + size.cx + icon_width + - num * infoPtr->uHItemPadding; - TRACE("for <%s>, l,r=%ld,%ld, num=%d\n", - debugstr_w(curr->pszText), curr->rect.left, curr->rect.right, num); + tabwidth = size.cx + icon_width + 2 * infoPtr->uHItemPadding; + + if (infoPtr->tabMinWidth < 0) + tabwidth = max(tabwidth, GET_DEFAULT_MIN_TAB_WIDTH(infoPtr)); + else + tabwidth = max(tabwidth, infoPtr->tabMinWidth); + + curr->rect.right = curr->rect.left + tabwidth; + TRACE("for <%s>, l,r=%ld,%ld\n", + debugstr_w(curr->pszText), curr->rect.left, curr->rect.right); } /* @@ -1438,7 +1494,8 @@ } else /* !TCS_BUTTONS */ { - FillRect(hdc, &rTemp, hbr); + if (!GetWindowTheme (infoPtr->hwnd)) + FillRect(hdc, &rTemp, hbr); } /* Cleanup */ @@ -1600,9 +1657,11 @@ * Setup for text output */ oldBkMode = SetBkMode(hdc, TRANSPARENT); - SetTextColor(hdc, (((iItem == infoPtr->iHotTracked) && !(lStyle & TCS_FLATBUTTONS)) | - (TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)) ? - comctl32_color.clrHighlight : comctl32_color.clrBtnText); + if (!GetWindowTheme (infoPtr->hwnd) || (lStyle & TCS_BUTTONS)) + SetTextColor(hdc, (((lStyle & TCS_HOTTRACK) && (iItem == infoPtr->iHotTracked) + && !(lStyle & TCS_FLATBUTTONS)) + | (TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)) ? + comctl32_color.clrHighlight : comctl32_color.clrBtnText); /* * if owner draw, tell the owner to draw @@ -1879,6 +1938,7 @@ INT clRight = 0; INT clBottom = 0; COLORREF bkgnd, corner; + HTHEME theme; /* * Get the rectangle for the item. @@ -1955,7 +2015,53 @@ */ fillRect = r; - if(lStyle & TCS_VERTICAL) + /* Draw themed tabs - but only if they are at the top. + * Windows draws even side or bottom tabs themed, with wacky results. + * However, since in Wine apps may get themed that did not opt in via + * a manifest avoid theming when we know the result will be wrong */ + if ((theme = GetWindowTheme (infoPtr->hwnd)) + && ((lStyle & (TCS_VERTICAL | TCS_BOTTOM)) == 0)) + { + const static int partIds[8] = { + /* Normal item */ + TABP_TABITEM, + TABP_TABITEMLEFTEDGE, + TABP_TABITEMRIGHTEDGE, + TABP_TABITEMBOTHEDGE, + /* Selected tab */ + TABP_TOPTABITEM, + TABP_TOPTABITEMLEFTEDGE, + TABP_TOPTABITEMRIGHTEDGE, + TABP_TOPTABITEMBOTHEDGE, + }; + int partIndex = 0; + int stateId = TIS_NORMAL; + + /* selected and unselected tabs have different parts */ + if (iItem == infoPtr->iSelected) + partIndex += 4; + /* The part also differs on the position of a tab on a line. + * "Visually" determining the position works well enough. */ + if(selectedRect.left == 0) + partIndex += 1; + if(selectedRect.right == clRight) + partIndex += 2; + + if (iItem == infoPtr->iSelected) + stateId = TIS_SELECTED; + else if (iItem == infoPtr->iHotTracked) + stateId = TIS_HOT; + else if (iItem == infoPtr->uFocus) + stateId = TIS_FOCUSED; + + /* Adjust rectangle for bottommost row */ + if (TAB_GetItem(infoPtr, iItem)->rect.top == infoPtr->uNumRows-1) + r.bottom += 3; + + DrawThemeBackground (theme, hdc, partIds[partIndex], stateId, &r, NULL); + GetThemeBackgroundContentRect (theme, hdc, partIds[partIndex], stateId, &r, &r); + } + else if(lStyle & TCS_VERTICAL) { /* These are for adjusting the drawing of a Selected tab */ /* The initial values are for the normal case of non-Selected */ @@ -2176,6 +2282,7 @@ { RECT rect; DWORD lStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE); + HTHEME theme = GetWindowTheme (infoPtr->hwnd); GetClientRect (infoPtr->hwnd, &rect); @@ -2198,7 +2305,10 @@ TRACE("border=(%ld,%ld)-(%ld,%ld)\n", rect.left, rect.top, rect.right, rect.bottom); - DrawEdge(hdc, &rect, EDGE_RAISED, BF_SOFT|BF_RECT); + if (theme) + DrawThemeBackground (theme, hdc, TABP_PANE, 0, &rect, NULL); + else + DrawEdge(hdc, &rect, EDGE_RAISED, BF_SOFT|BF_RECT); } /****************************************************************************** @@ -2564,7 +2674,7 @@ /* UNDOCUMENTED: If requested Width or Height is 0 this means that program wants to use auto size. */ if (lStyle & TCS_FIXEDWIDTH && (infoPtr->tabWidth != (INT)LOWORD(lParam))) { - infoPtr->tabWidth = max((INT)LOWORD(lParam), infoPtr->tabMinWidth); + infoPtr->tabWidth = (INT)LOWORD(lParam); bNeedPaint = TRUE; } @@ -2596,8 +2706,9 @@ if (infoPtr) { oldcx = infoPtr->tabMinWidth; - infoPtr->tabMinWidth = (cx==-1)?DEFAULT_TAB_WIDTH:cx; + infoPtr->tabMinWidth = cx; } + TAB_SetItemBounds(infoPtr); return oldcx; } @@ -2936,6 +3047,8 @@ } } + OpenThemeData (infoPtr->hwnd, themeClass); + /* * We need to get text information so we need a DC and we need to select * a font. @@ -2955,8 +3068,10 @@ infoPtr->uVItemPadding; /* Initialize the width of a tab. */ - infoPtr->tabWidth = DEFAULT_TAB_WIDTH; - infoPtr->tabMinWidth = 0; + if (dwStyle & TCS_FIXEDWIDTH) + infoPtr->tabWidth = DEFAULT_TAB_WIDTH_FIXED; + + infoPtr->tabMinWidth = -1; TRACE("tabH=%d, tabW=%d\n", infoPtr->tabHeight, infoPtr->tabWidth); @@ -2993,10 +3108,21 @@ if (infoPtr->iHotTracked >= 0) KillTimer(infoPtr->hwnd, TAB_HOTTRACK_TIMER); + CloseThemeData (GetWindowTheme (infoPtr->hwnd)); + Free (infoPtr); return 0; } +/* update theme after a WM_THEMECHANGED message */ +static LRESULT theme_changed (TAB_INFO* infoPtr) +{ + HTHEME theme = GetWindowTheme (infoPtr->hwnd); + CloseThemeData (theme); + OpenThemeData (infoPtr->hwnd, themeClass); + return 0; +} + static LRESULT TAB_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam) { if (!wParam) @@ -3176,6 +3302,9 @@ COMCTL32_RefreshSysColors(); return 0; + case WM_THEMECHANGED: + return theme_changed (infoPtr); + case WM_KILLFOCUS: case WM_SETFOCUS: TAB_FocusChanging(infoPtr); diff -urN wine-20050725/dlls/comctl32/tests/.cvsignore wine-20050830/dlls/comctl32/tests/.cvsignore --- wine-20050725/dlls/comctl32/tests/.cvsignore 2005-06-13 14:23:01.000000000 +0200 +++ wine-20050830/dlls/comctl32/tests/.cvsignore 2005-08-23 12:02:25.000000000 +0200 @@ -2,6 +2,7 @@ dpa.ok imagelist.ok mru.ok +progress.ok subclass.ok tab.ok testlist.c diff -urN wine-20050725/dlls/comctl32/tests/Makefile.in wine-20050830/dlls/comctl32/tests/Makefile.in --- wine-20050725/dlls/comctl32/tests/Makefile.in 2005-07-03 14:02:10.000000000 +0200 +++ wine-20050830/dlls/comctl32/tests/Makefile.in 2005-08-27 11:27:10.000000000 +0200 @@ -3,12 +3,13 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ TESTDLL = comctl32.dll -IMPORTS = comctl32 ole32 shlwapi user32 gdi32 advapi32 +IMPORTS = comctl32 ole32 shlwapi user32 gdi32 advapi32 kernel32 CTESTS = \ dpa.c \ imagelist.c \ mru.c \ + progress.c \ subclass.c \ tab.c \ treeview.c \ diff -urN wine-20050725/dlls/comctl32/tests/dpa.c wine-20050830/dlls/comctl32/tests/dpa.c --- wine-20050725/dlls/comctl32/tests/dpa.c 2005-07-11 12:59:42.000000000 +0200 +++ wine-20050830/dlls/comctl32/tests/dpa.c 2005-08-01 16:50:36.000000000 +0200 @@ -274,7 +274,7 @@ j = pDPA_GetPtrIndex(dpa, (PVOID)i); ok(j+1 == i, "j=%d i=%d\n", j, i); j = pDPA_Search(dpa, (PVOID)i, 0, CB_CmpLT, 0xdeadbeef, DPAS_SORTED); - if(i > 1) todo_wine ok(j+1 == i, "j=%d i=%d\n", j, i); + ok(j+1 == i, "j=%d i=%d\n", j, i); /* Linear searches respect iStart ... */ j = pDPA_Search(dpa, (PVOID)i, i+1, CB_CmpLT, 0xdeadbeef, 0); @@ -307,6 +307,10 @@ i = pDPA_Search(dpa, (PVOID)3, 0, CB_CmpLT, 0xdeadbeef, DPAS_SORTED|DPAS_INSERTBEFORE); ok(i == 2, "i=%d\n", i); + /* without DPAS_INSERTBEFORE/AFTER */ + i = pDPA_Search(dpa, (PVOID)3, 0, + CB_CmpLT, 0xdeadbeef, DPAS_SORTED); + ok(i == -1, "i=%d\n", i); /* Re-insert the item */ ret = pDPA_InsertPtr(dpa, 2, (PVOID)3); diff -urN wine-20050725/dlls/comctl32/tests/progress.c wine-20050830/dlls/comctl32/tests/progress.c --- wine-20050725/dlls/comctl32/tests/progress.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/comctl32/tests/progress.c 2005-08-23 12:02:25.000000000 +0200 @@ -0,0 +1,158 @@ +/* Unit tests for the progress bar control. + * + * Copyright 2005 Michael Kaufmann + * + * 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 "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "commctrl.h" + +#include "wine/test.h" + + +HWND hProgressParentWnd, hProgressWnd; +static char progressTestClass[] = "ProgressBarTestClass"; + + +LRESULT CALLBACK ProgressTestWndProc(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 update_window(HWND hWnd) +{ + UpdateWindow(hWnd); + ok(!GetUpdateRect(hWnd, NULL, FALSE), "GetUpdateRect must return zero after UpdateWindow\n"); +} + + +static void init(void) +{ + WNDCLASSA wc; + INITCOMMONCONTROLSEX icex; + RECT rect; + + icex.dwSize = sizeof(INITCOMMONCONTROLSEX); + icex.dwICC = ICC_PROGRESS_CLASS; + 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 = progressTestClass; + wc.lpfnWndProc = ProgressTestWndProc; + RegisterClassA(&wc); + + rect.left = 0; + rect.top = 0; + rect.right = 400; + rect.bottom = 20; + assert(AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE)); + + hProgressParentWnd = CreateWindowExA(0, progressTestClass, "Progress Bar Test", WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, GetModuleHandleA(NULL), 0); + assert(hProgressParentWnd != NULL); + + GetClientRect(hProgressParentWnd, &rect); + hProgressWnd = CreateWindowEx(0, PROGRESS_CLASS, "", WS_CHILD | WS_VISIBLE, + 0, 0, rect.right, rect.bottom, hProgressParentWnd, NULL, GetModuleHandleA(NULL), 0); + assert(hProgressWnd != NULL); + + ShowWindow(hProgressParentWnd, SW_SHOWNORMAL); + ok(GetUpdateRect(hProgressParentWnd, NULL, FALSE), "GetUpdateRect: There should be a region that needs to be updated\n"); + update_window(hProgressParentWnd); +} + + +static void cleanup(void) +{ + MSG msg; + + PostMessageA(hProgressParentWnd, WM_CLOSE, 0, 0); + while (GetMessageA(&msg,0,0,0)) { + TranslateMessage(&msg); + DispatchMessageA(&msg); + } + + UnregisterClassA(progressTestClass, GetModuleHandleA(NULL)); +} + + +/* + * Tests if a progress bar repaints itself immediately when it receives + * some specific messages. + */ +static void test_redraw(void) +{ + SendMessageA(hProgressWnd, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); + SendMessageA(hProgressWnd, PBM_SETPOS, 10, 0); + SendMessageA(hProgressWnd, PBM_SETSTEP, 20, 0); + update_window(hProgressWnd); + + /* PBM_SETPOS */ + ok(SendMessageA(hProgressWnd, PBM_SETPOS, 50, 0) == 10, "PBM_SETPOS must return the previous position\n"); + ok(!GetUpdateRect(hProgressWnd, NULL, FALSE), "PBM_SETPOS: The progress bar should be redrawn immediately\n"); + + /* PBM_DELTAPOS */ + ok(SendMessageA(hProgressWnd, PBM_DELTAPOS, 15, 0) == 50, "PBM_DELTAPOS must return the previous position\n"); + ok(!GetUpdateRect(hProgressWnd, NULL, FALSE), "PBM_DELTAPOS: The progress bar should be redrawn immediately\n"); + + /* PBM_SETPOS */ + ok(SendMessageA(hProgressWnd, PBM_SETPOS, 80, 0) == 65, "PBM_SETPOS must return the previous position\n"); + ok(!GetUpdateRect(hProgressWnd, NULL, FALSE), "PBM_SETPOS: The progress bar should be redrawn immediately\n"); + + /* PBM_STEPIT */ + ok(SendMessageA(hProgressWnd, PBM_STEPIT, 0, 0) == 80, "PBM_STEPIT must return the previous position\n"); + ok(!GetUpdateRect(hProgressWnd, NULL, FALSE), "PBM_STEPIT: The progress bar should be redrawn immediately\n"); + ok((UINT)SendMessageA(hProgressWnd, PBM_GETPOS, 0, 0) == 100, "PBM_GETPOS returned a wrong position\n"); + + /* PBM_SETRANGE and PBM_SETRANGE32: + Usually the progress bar doesn't repaint itself immediately. If the + position is not in the new range, it does. + Don't test this, it may change in future Windows versions. */ +} + + +START_TEST(progress) +{ + init(); + + test_redraw(); + + cleanup(); +} diff -urN wine-20050725/dlls/comctl32/tests/tab.c wine-20050830/dlls/comctl32/tests/tab.c --- wine-20050725/dlls/comctl32/tests/tab.c 2005-06-09 11:50:56.000000000 +0200 +++ wine-20050830/dlls/comctl32/tests/tab.c 2005-08-23 12:05:54.000000000 +0200 @@ -23,24 +23,37 @@ #include "wine/test.h" -#undef VISIBLE - +#define DEFAULT_MIN_TAB_WIDTH 54 #define TAB_DEFAULT_WIDTH 96 -#define TAB_PADDING_X 2 -#define TAB_PADDING_Y 2 +#define TAB_PADDING_X 6 +#define EXTRA_ICON_PADDING 3 + +#define TabWidthPadded(padd_x, num) (DEFAULT_MIN_TAB_WIDTH - (TAB_PADDING_X - (padd_x)) * num) -#ifdef VISIBLE -#define WAIT Sleep (1000) -#define REDRAW(hwnd) RedrawWindow (hwnd, NULL, 0, RDW_UPDATENOW) -#define trace_tab(str) trace(str) -#else -#define WAIT -#define REDRAW(hwnd) -#define trace_tab(str) -#endif +#define TabCheckSetSize(hwnd, SetWidth, SetHeight, ExpWidth, ExpHeight, Msg)\ + SendMessage (hwnd, TCM_SETITEMSIZE, 0,\ + (LPARAM) MAKELPARAM((SetWidth >= 0) ? SetWidth:0, (SetHeight >= 0) ? SetHeight:0));\ + if (winetest_interactive) RedrawWindow (hwnd, NULL, 0, RDW_UPDATENOW);\ + CheckSize(hwnd, ExpWidth, ExpHeight, Msg); + +#define CheckSize(hwnd,width,height,msg)\ + SendMessage (hwnd, TCM_GETITEMRECT, 0, (LPARAM) &rTab);\ + if ((width >= 0) && (height < 0))\ + ok (width == rTab.right - rTab.left, "%s: Expected width [%d] got [%ld]\n",\ + msg, (int)width, rTab.right - rTab.left);\ + else if ((height >= 0) && (width < 0))\ + ok (height == rTab.bottom - rTab.top, "%s: Expected height [%d] got [%ld]\n",\ + msg, (int)height, rTab.bottom - rTab.top);\ + else\ + ok ((width == rTab.right - rTab.left) &&\ + (height == rTab.bottom - rTab.top ),\ + "%s: Expected [%d,%d] got [%ld,%ld]\n", msg, (int)width, (int)height,\ + rTab.right - rTab.left, rTab.bottom - rTab.top); + +static HFONT hFont = 0; static HWND -create_tabcontrol (DWORD style) +create_tabcontrol (DWORD style, DWORD mask) { HWND handle; TCITEM tcNewTab; @@ -53,10 +66,11 @@ NULL, NULL, NULL, 0); assert (handle); - + SetWindowLong(handle, GWL_STYLE, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TCS_FOCUSNEVER | style); + SendMessage (handle, WM_SETFONT, 0, (LPARAM) hFont); - tcNewTab.mask = TCIF_TEXT | TCIF_IMAGE; + tcNewTab.mask = mask; tcNewTab.pszText = "Tab 1"; tcNewTab.iImage = 0; SendMessage (handle, TCM_INSERTITEM, 0, (LPARAM) &tcNewTab); @@ -67,131 +81,166 @@ tcNewTab.iImage = 2; SendMessage (handle, TCM_INSERTITEM, 2, (LPARAM) &tcNewTab); -#ifdef VISIBLE - ShowWindow (handle, SW_SHOW); -#endif - REDRAW(handle); - WAIT; + if (winetest_interactive) + { + ShowWindow (handle, SW_SHOW); + RedrawWindow (handle, NULL, 0, RDW_UPDATENOW); + Sleep (1000); + } return handle; } -static void CheckSize(HWND hwnd, INT width, INT height) -{ - RECT rTab, r1; - - r1.left=r1.top=r1.right=r1.bottom=0; - SendMessage (hwnd, TCM_GETITEMRECT, 0, (LPARAM) &rTab); - SendMessage (hwnd, TCM_ADJUSTRECT, FALSE, (LPARAM) &r1); - /* trace ("Got (%ld,%ld)-(%ld,%ld)\n", rTab.left, rTab.top, rTab.right, rTab.bottom); */ - trace (" (%ld,%ld)-(%ld,%ld)\n", r1.left, r1.top, r1.right, r1.bottom); - if ((width >= 0) && (height < 0)) - ok (width == rTab.right - rTab.left, "Expected [%d] got [%ld]\n", width, rTab.right - rTab.left); - else if ((height >= 0) && (width < 0)) - ok (height == rTab.bottom - rTab.top, "Expected [%d] got [%ld]\n", height, rTab.bottom - rTab.top); - else - ok ((width == rTab.right - rTab.left) && - (height == rTab.bottom - rTab.top ), - "Expected [%d,%d] got [%ld,%ld]\n", width, height, rTab.right - rTab.left, rTab.bottom - rTab.top); -} - -static void TabCheckSetSize(HWND hwnd, INT SetWidth, INT SetHeight, INT ExpWidth, INT ExpHeight) -{ - SendMessage (hwnd, TCM_SETITEMSIZE, 0, - (LPARAM) MAKELPARAM((SetWidth >= 0) ? SetWidth:0, (SetHeight >= 0) ? SetHeight:0)); - REDRAW(hwnd); - CheckSize(hwnd, ExpWidth, ExpHeight); - WAIT; -} - -START_TEST(tab) +static void test_tab(INT nMinTabWidth) { HWND hwTab; + RECT rTab; HIMAGELIST himl = ImageList_Create(21, 21, ILC_COLOR, 3, 4); + SIZE size; + HDC hdc; + HFONT hOldFont; + INT i; + + hwTab = create_tabcontrol(TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE); + SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); + + hdc = GetDC(hwTab); + hOldFont = SelectObject(hdc, (HFONT)SendMessage(hwTab, WM_GETFONT, 0, 0)); + GetTextExtentPoint32A(hdc, "Tab 1", strlen("Tab 1"), &size); + trace("Tab1 text size: size.cx=%ld size.cy=%ld\n", size.cx, size.cy); + SelectObject(hdc, hOldFont); + ReleaseDC(hwTab, hdc); + + trace (" TCS_FIXEDWIDTH tabs no icon...\n"); + CheckSize(hwTab, TAB_DEFAULT_WIDTH, -1, "default width"); + TabCheckSetSize(hwTab, 50, 20, 50, 20, "set size"); + TabCheckSetSize(hwTab, 0, 1, 0, 1, "min size"); - InitCommonControls(); + SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); + trace (" TCS_FIXEDWIDTH tabs with icon...\n"); + TabCheckSetSize(hwTab, 50, 30, 50, 30, "set size > icon"); + TabCheckSetSize(hwTab, 20, 20, 25, 20, "set size < icon"); + TabCheckSetSize(hwTab, 0, 1, 25, 1, "min size"); + + DestroyWindow (hwTab); - hwTab = create_tabcontrol(TCS_FIXEDWIDTH); + hwTab = create_tabcontrol(TCS_FIXEDWIDTH | TCS_BUTTONS, TCIF_TEXT|TCIF_IMAGE); + SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); - trace_tab ("Testing TCS_FIXEDWIDTH tabs no icon...\n"); - trace_tab (" default width...\n"); - CheckSize(hwTab, TAB_DEFAULT_WIDTH, -1); - trace_tab (" set size...\n"); - TabCheckSetSize(hwTab, 50, 20, 50, 20); - WAIT; - trace_tab (" min size...\n"); - TabCheckSetSize(hwTab, 0, 1, 0, 1); - WAIT; + trace (" TCS_FIXEDWIDTH buttons no icon...\n"); + CheckSize(hwTab, TAB_DEFAULT_WIDTH, -1, "default width"); + TabCheckSetSize(hwTab, 20, 20, 20, 20, "set size 1"); + TabCheckSetSize(hwTab, 10, 50, 10, 50, "set size 2"); + TabCheckSetSize(hwTab, 0, 1, 0, 1, "min size"); SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); - trace_tab ("Testing TCS_FIXEDWIDTH tabs with icon...\n"); - trace_tab (" set size > icon...\n"); - TabCheckSetSize(hwTab, 50, 30, 50, 30); - trace_tab (" set size < icon...\n"); - TabCheckSetSize(hwTab, 20, 20, 25, 20); - trace_tab (" min size...\n"); - TabCheckSetSize(hwTab, 0, 1, 25, 1); + trace (" TCS_FIXEDWIDTH buttons with icon...\n"); + TabCheckSetSize(hwTab, 50, 30, 50, 30, "set size > icon"); + TabCheckSetSize(hwTab, 20, 20, 25, 20, "set size < icon"); + TabCheckSetSize(hwTab, 0, 1, 25, 1, "min size"); + SendMessage(hwTab, TCM_SETPADDING, 0, MAKELPARAM(4,4)); + TabCheckSetSize(hwTab, 0, 1, 25, 1, "set padding, min size"); DestroyWindow (hwTab); - trace_tab ("Testing TCS_FIXEDWIDTH buttons no icon...\n"); - hwTab = create_tabcontrol(TCS_FIXEDWIDTH | TCS_BUTTONS); + hwTab = create_tabcontrol(TCS_FIXEDWIDTH | TCS_BOTTOM, TCIF_TEXT|TCIF_IMAGE); + SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); + + trace (" TCS_FIXEDWIDTH | TCS_BOTTOM tabs...\n"); + CheckSize(hwTab, TAB_DEFAULT_WIDTH, -1, "no icon, default width"); - trace_tab (" default width...\n"); - CheckSize(hwTab, TAB_DEFAULT_WIDTH, -1); - trace_tab (" set size 1...\n"); - TabCheckSetSize(hwTab, 20, 20, 20, 20); - trace_tab (" set size 2...\n"); - TabCheckSetSize(hwTab, 10, 50, 10, 50); - trace_tab (" min size...\n"); - TabCheckSetSize(hwTab, 0, 1, 0, 1); + TabCheckSetSize(hwTab, 20, 20, 20, 20, "no icon, set size 1"); + TabCheckSetSize(hwTab, 10, 50, 10, 50, "no icon, set size 2"); + TabCheckSetSize(hwTab, 0, 1, 0, 1, "no icon, min size"); SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); - trace_tab ("Testing TCS_FIXEDWIDTH buttons with icon...\n"); - trace_tab (" set size > icon...\n"); - TabCheckSetSize(hwTab, 50, 30, 50, 30); - trace_tab (" set size < icon...\n"); - TabCheckSetSize(hwTab, 20, 20, 25, 20); - trace_tab (" min size...\n"); - TabCheckSetSize(hwTab, 0, 1, 25, 1); - trace_tab (" Add padding...\n"); + TabCheckSetSize(hwTab, 50, 30, 50, 30, "with icon, set size > icon"); + TabCheckSetSize(hwTab, 20, 20, 25, 20, "with icon, set size < icon"); + TabCheckSetSize(hwTab, 0, 1, 25, 1, "with icon, min size"); SendMessage(hwTab, TCM_SETPADDING, 0, MAKELPARAM(4,4)); - trace_tab (" min size...\n"); - TabCheckSetSize(hwTab, 0, 1, 25, 1); + TabCheckSetSize(hwTab, 0, 1, 25, 1, "set padding, min size"); DestroyWindow (hwTab); - hwTab = create_tabcontrol(TCS_FIXEDWIDTH | TCS_BOTTOM); - trace_tab ("Testing TCS_FIXEDWIDTH | TCS_BOTTOM tabs no icon...\n"); + hwTab = create_tabcontrol(0, TCIF_TEXT|TCIF_IMAGE); + SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); - trace_tab (" default width...\n"); - CheckSize(hwTab, TAB_DEFAULT_WIDTH, -1); - trace_tab (" set size 1...\n"); - TabCheckSetSize(hwTab, 20, 20, 20, 20); - trace_tab (" set size 2...\n"); - TabCheckSetSize(hwTab, 10, 50, 10, 50); - trace_tab (" min size...\n"); - TabCheckSetSize(hwTab, 0, 1, 0, 1); + trace (" non fixed width, with text...\n"); + CheckSize(hwTab, max(size.cx +TAB_PADDING_X*2, (nMinTabWidth < 0) ? DEFAULT_MIN_TAB_WIDTH : nMinTabWidth), -1, + "no icon, default width"); + for (i=0; i<8; i++) + { + INT nTabWidth = (nMinTabWidth < 0) ? TabWidthPadded(i, 2) : nMinTabWidth; + + SendMessage(hwTab, TCM_SETIMAGELIST, 0, 0); + SendMessage(hwTab, TCM_SETPADDING, 0, MAKELPARAM(i,i)); + + TabCheckSetSize(hwTab, 50, 20, max(size.cx + i*2, nTabWidth), 20, "no icon, set size"); + TabCheckSetSize(hwTab, 0, 1, max(size.cx + i*2, nTabWidth), 1, "no icon, min size"); + + SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); + nTabWidth = (nMinTabWidth < 0) ? TabWidthPadded(i, 3) : nMinTabWidth; + + TabCheckSetSize(hwTab, 50, 30, max(size.cx + 21 + i*3, nTabWidth), 30, "with icon, set size > icon"); + TabCheckSetSize(hwTab, 20, 20, max(size.cx + 21 + i*3, nTabWidth), 20, "with icon, set size < icon"); + TabCheckSetSize(hwTab, 0, 1, max(size.cx + 21 + i*3, nTabWidth), 1, "with icon, min size"); + } + DestroyWindow (hwTab); - SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); - - trace_tab ("Testing TCS_FIXEDWIDTH | TCS_BOTTOM tabs with icon...\n"); - trace_tab (" set size > icon...\n"); - TabCheckSetSize(hwTab, 50, 30, 50, 30); - trace_tab (" set size < icon...\n"); - TabCheckSetSize(hwTab, 20, 20, 25, 20); - trace_tab (" min size...\n"); - TabCheckSetSize(hwTab, 0, 1, 25, 1); - trace_tab (" Add padding...\n"); - SendMessage(hwTab, TCM_SETPADDING, 0, MAKELPARAM(4,4)); - trace_tab (" min size...\n"); - TabCheckSetSize(hwTab, 0, 1, 25, 1); + hwTab = create_tabcontrol(0, TCIF_IMAGE); + SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); - DestroyWindow (hwTab); + trace (" non fixed width, no text...\n"); + CheckSize(hwTab, (nMinTabWidth < 0) ? DEFAULT_MIN_TAB_WIDTH : nMinTabWidth, -1, "no icon, default width"); + for (i=0; i<8; i++) + { + INT nTabWidth = (nMinTabWidth < 0) ? TabWidthPadded(i, 2) : nMinTabWidth; + + SendMessage(hwTab, TCM_SETIMAGELIST, 0, 0); + SendMessage(hwTab, TCM_SETPADDING, 0, MAKELPARAM(i,i)); + + TabCheckSetSize(hwTab, 50, 20, nTabWidth, 20, "no icon, set size"); + TabCheckSetSize(hwTab, 0, 1, nTabWidth, 1, "no icon, min size"); + + SendMessage(hwTab, TCM_SETIMAGELIST, 0, (LPARAM)himl); + if (i > 1 && nMinTabWidth > 0 && nMinTabWidth < DEFAULT_MIN_TAB_WIDTH) + nTabWidth += EXTRA_ICON_PADDING *(i-1); + + TabCheckSetSize(hwTab, 50, 30, nTabWidth, 30, "with icon, set size > icon"); + TabCheckSetSize(hwTab, 20, 20, nTabWidth, 20, "with icon, set size < icon"); + TabCheckSetSize(hwTab, 0, 1, nTabWidth, 1, "with icon, min size"); + } + DestroyWindow (hwTab); ImageList_Destroy(himl); + DeleteObject(hFont); +} + +START_TEST(tab) +{ + LOGFONTA logfont; + + lstrcpyA(logfont.lfFaceName, "Arial"); + memset(&logfont, 0, sizeof(logfont)); + logfont.lfHeight = -12; + logfont.lfWeight = FW_NORMAL; + logfont.lfCharSet = ANSI_CHARSET; + hFont = CreateFontIndirectA(&logfont); + + InitCommonControls(); + + trace ("Testing with default MinWidth\n"); + test_tab(-1); + trace ("Testing with MinWidth set to -3\n"); + test_tab(-3); + trace ("Testing with MinWidth set to 24\n"); + test_tab(24); + trace ("Testing with MinWidth set to 54\n"); + test_tab(54); + trace ("Testing with MinWidth set to 94\n"); + test_tab(94); } diff -urN wine-20050725/dlls/comctl32/tests/treeview.c wine-20050830/dlls/comctl32/tests/treeview.c --- wine-20050725/dlls/comctl32/tests/treeview.c 2005-07-06 17:46:47.000000000 +0200 +++ wine-20050830/dlls/comctl32/tests/treeview.c 2005-08-10 16:42:32.000000000 +0200 @@ -77,7 +77,7 @@ ins.hInsertAfter = TVI_ROOT; U(ins).item.mask = TVIF_TEXT; U(ins).item.pszText = "Root"; - hRoot = TreeView_InsertItemA(hTree, &ins); + hRoot = TreeView_InsertItem(hTree, &ins); assert(hRoot); AddItem('B'); @@ -85,7 +85,7 @@ ins.hInsertAfter = TVI_FIRST; U(ins).item.mask = TVIF_TEXT; U(ins).item.pszText = "Child"; - hChild = TreeView_InsertItemA(hTree, &ins); + hChild = TreeView_InsertItem(hTree, &ins); assert(hChild); AddItem('.'); diff -urN wine-20050725/dlls/comctl32/theme_combo.c wine-20050830/dlls/comctl32/theme_combo.c --- wine-20050725/dlls/comctl32/theme_combo.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/comctl32/theme_combo.c 2005-08-19 15:58:03.000000000 +0200 @@ -0,0 +1,319 @@ +/* + * Theming - Combo box control + * + * Copyright (c) 2005 by Frank Richter + * + * 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 "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "uxtheme.h" +#include "tmschema.h" +#include "comctl32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(themingcombo); + +/* Subclass-private state flags */ +#define STATE_NOREDRAW 1 +#define STATE_HOT 2 + +/* some constants for metrics, same as in user32 */ +#define COMBO_XBORDERSIZE 2 +#define COMBO_YBORDERSIZE 2 +#define COMBO_EDITBUTTONSPACE 0 +#define EDIT_CONTROL_PADDING 1 + +/* paint text of combobox, needed for read-only drop downs. */ +static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, COMBOBOXINFO* cbi) +{ + INT id, size = 0; + LPWSTR pText = NULL; + UINT itemState = ODS_COMBOBOXEDIT; + HFONT font = (HFONT)SendMessageW (hwnd, WM_GETFONT, 0, 0); + HFONT hPrevFont = (font) ? SelectObject(hdc, font) : 0; + RECT rectEdit; + BOOL focused = GetFocus () == hwnd; + BOOL dropped = cbi->stateButton == STATE_SYSTEM_PRESSED; + + TRACE("\n"); + + /* follow Windows combobox that sends a bunch of text + * inquiries to its listbox while processing WM_PAINT. */ + + if( (id = SendMessageW (cbi->hwndList, LB_GETCURSEL, 0, 0) ) != LB_ERR ) + { + size = SendMessageW (cbi->hwndList, LB_GETTEXTLEN, id, 0); + if (size == LB_ERR) + FIXME("LB_ERR probably not handled yet\n"); + if( (pText = HeapAlloc( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR))) ) + { + /* size from LB_GETTEXTLEN may be too large, from LB_GETTEXT is accurate */ + size=SendMessageW (cbi->hwndList, LB_GETTEXT, (WPARAM)id, (LPARAM)pText); + pText[size] = '\0'; /* just in case */ + } else return; + } + else + if( !(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) ) + return; + + /* + * Give ourselves some space. + */ + CopyRect (&rectEdit, &cbi->rcItem); + InflateRect( &rectEdit, -1, -1 ); + + if(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) + { + DRAWITEMSTRUCT dis; + HRGN clipRegion; + UINT ctlid = (UINT)GetWindowLongPtrW( hwnd, GWLP_ID ); + + /* setup state for DRAWITEM message. Owner will highlight */ + if ( focused && !dropped ) + itemState |= ODS_SELECTED | ODS_FOCUS; + + /* + * Save the current clip region. + * To retrieve the clip region, we need to create one "dummy" + * clip region. + */ + clipRegion = CreateRectRgnIndirect(&rectEdit); + + if (GetClipRgn(hdc, clipRegion)!=1) + { + DeleteObject(clipRegion); + clipRegion=NULL; + } + + if (!IsWindowEnabled(hwnd) & WS_DISABLED) itemState |= ODS_DISABLED; + + dis.CtlType = ODT_COMBOBOX; + dis.CtlID = ctlid; + dis.hwndItem = hwnd; + dis.itemAction = ODA_DRAWENTIRE; + dis.itemID = id; + dis.itemState = itemState; + dis.hDC = hdc; + dis.rcItem = rectEdit; + dis.itemData = SendMessageW(cbi->hwndList, LB_GETITEMDATA, + (WPARAM)id, 0 ); + + /* + * Clip the DC and have the parent draw the item. + */ + IntersectClipRect(hdc, + rectEdit.left, rectEdit.top, + rectEdit.right, rectEdit.bottom); + + SendMessageW(GetParent (hwnd), WM_DRAWITEM, ctlid, (LPARAM)&dis ); + + /* + * Reset the clipping region. + */ + SelectClipRgn(hdc, clipRegion); + } + else + { + static const WCHAR empty_stringW[] = { 0 }; + + if ( focused && !dropped ) { + + /* highlight */ + FillRect( hdc, &rectEdit, GetSysColorBrush(COLOR_HIGHLIGHT) ); + SetBkColor( hdc, GetSysColor( COLOR_HIGHLIGHT ) ); + SetTextColor( hdc, GetSysColor( COLOR_HIGHLIGHTTEXT ) ); + } + + ExtTextOutW( hdc, + rectEdit.left + 1, + rectEdit.top + 1, + ETO_OPAQUE | ETO_CLIPPED, + &rectEdit, + pText ? pText : empty_stringW , size, NULL ); + + if ( focused && !dropped ) + DrawFocusRect( hdc, &rectEdit ); + } + + if( hPrevFont ) + SelectObject(hdc, hPrevFont ); + + HeapFree( GetProcessHeap(), 0, pText ); +} + +/* paint the combobox */ +static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state) +{ + PAINTSTRUCT ps; + HDC hDC; + COMBOBOXINFO cbi; + DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); + + hDC = (hParamDC) ? hParamDC + : BeginPaint( hwnd, &ps); + + TRACE("hdc=%p\n", hDC); + + if( hDC && !(state & STATE_NOREDRAW) ) + { + RECT frameRect; + int buttonState; + + cbi.cbSize = sizeof (cbi); + SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi); + + /* paint border */ + if ((dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE) + GetClientRect (hwnd, &frameRect); + else + { + CopyRect (&frameRect, &cbi.rcItem); + + InflateRect(&frameRect, + EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE, + EDIT_CONTROL_PADDING + COMBO_YBORDERSIZE); + } + + DrawThemeBackground (theme, hDC, 0, + IsWindowEnabled (hwnd) ? CBXS_NORMAL : CBXS_DISABLED, &frameRect, NULL); + + /* paint button */ + if (cbi.stateButton != STATE_SYSTEM_INVISIBLE) + { + if (!IsWindowEnabled (hwnd)) + buttonState = CBXS_DISABLED; + else if (cbi.stateButton == STATE_SYSTEM_PRESSED) + buttonState = CBXS_PRESSED; + else if (state & STATE_HOT) + buttonState = CBXS_HOT; + else + buttonState = CBXS_NORMAL; + DrawThemeBackground (theme, hDC, CP_DROPDOWNBUTTON, buttonState, + &cbi.rcButton, NULL); + } + + /* paint text, if we need to */ + if ((dwStyle & CBS_DROPDOWNLIST) == CBS_DROPDOWNLIST) + paint_text (hwnd, hDC, dwStyle, &cbi); + } + + if( !hParamDC ) + EndPaint(hwnd, &ps); + + return 0; +} + + +/********************************************************************** + * The combo control subclass window proc. + */ +LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam, + ULONG_PTR dwRefData) +{ + const WCHAR* themeClass = WC_COMBOBOXW; + HTHEME theme; + LRESULT result; + + switch (msg) + { + case WM_CREATE: + result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + OpenThemeData( hwnd, themeClass ); + return result; + + case WM_DESTROY: + theme = GetWindowTheme( hwnd ); + CloseThemeData ( theme ); + return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + + case WM_THEMECHANGED: + theme = GetWindowTheme( hwnd ); + CloseThemeData ( theme ); + OpenThemeData( hwnd, themeClass ); + break; + + case WM_SYSCOLORCHANGE: + theme = GetWindowTheme( hwnd ); + if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + /* Do nothing. When themed, a WM_THEMECHANGED will be received, too, + * which will do the repaint. */ + break; + + case WM_PAINT: + theme = GetWindowTheme( hwnd ); + if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + return paint (theme, hwnd, (HDC)wParam, dwRefData); + + case WM_SETREDRAW: + /* Since there doesn't seem to be WM_GETREDRAW, do redraw tracking in + * the subclass as well. */ + if( wParam ) + dwRefData &= ~STATE_NOREDRAW; + else + dwRefData |= STATE_NOREDRAW; + THEMING_SetSubclassData (hwnd, dwRefData); + return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + + case WM_MOUSEMOVE: + { + /* Dropdown button hot-tracking */ + COMBOBOXINFO cbi; + POINT pt = {LOWORD(lParam), HIWORD(lParam)}; + + cbi.cbSize = sizeof (cbi); + SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi); + + if (cbi.stateButton != STATE_SYSTEM_INVISIBLE) + { + if (PtInRect (&cbi.rcButton, pt)) + { + if (!(dwRefData & STATE_HOT)) + { + dwRefData |= STATE_HOT; + THEMING_SetSubclassData (hwnd, dwRefData); + RedrawWindow (hwnd, &cbi.rcButton, 0, + RDW_INVALIDATE | RDW_UPDATENOW); + } + } + else + { + if (dwRefData & STATE_HOT) + { + dwRefData &= ~STATE_HOT; + THEMING_SetSubclassData (hwnd, dwRefData); + RedrawWindow (hwnd, &cbi.rcButton, 0, + RDW_INVALIDATE | RDW_UPDATENOW); + } + } + } + } + return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + + default: + /* Call old proc */ + return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + } + return 0; +} diff -urN wine-20050725/dlls/comctl32/theme_dialog.c wine-20050830/dlls/comctl32/theme_dialog.c --- wine-20050725/dlls/comctl32/theme_dialog.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/comctl32/theme_dialog.c 2005-08-25 17:20:48.000000000 +0200 @@ -0,0 +1,142 @@ +/* + * Theming - Dialogs + * + * Copyright (c) 2005 by Frank Richter + * + * 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 "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "uxtheme.h" +#include "tmschema.h" +#include "comctl32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(themingdialog); + +/********************************************************************** + * The dialog subclass window proc. + */ +LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, + WPARAM wParam, LPARAM lParam, + ULONG_PTR dwRefData) +{ + HTHEME theme = GetWindowTheme ( hWnd ); + static const WCHAR themeClass[] = { 'W','i','n','d','o','w',0 }; + BOOL themingActive = IsThemeDialogTextureEnabled (hWnd); + BOOL doTheming = themingActive && (theme != NULL); + LRESULT result; + + switch (msg) + { + case WM_CREATE: + result = THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); + theme = OpenThemeData( hWnd, themeClass ); + return result; + + case WM_DESTROY: + CloseThemeData ( theme ); + return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); + + case WM_THEMECHANGED: + CloseThemeData ( theme ); + OpenThemeData( hWnd, themeClass ); + InvalidateRect( hWnd, NULL, TRUE ); + return 0; + + case WM_SYSCOLORCHANGE: + if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); + /* Do nothing. When themed, a WM_THEMECHANGED will be received, too, + * which will do the repaint. */ + break; + + case WM_ERASEBKGND: + if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); + { + RECT rc; + DLGPROC dlgp = (DLGPROC)GetWindowLongPtrW (hWnd, DWLP_DLGPROC); + if (!dlgp (hWnd, msg, wParam, lParam)) + { + /* Draw background*/ + GetClientRect (hWnd, &rc); + if (IsThemePartDefined (theme, WP_DIALOG, 0)) + /* Although there is a theme for the WINDOW class/DIALOG part, + * but I[res] haven't seen Windows using it yet... Even when + * dialog theming is activated, the good ol' BTNFACE + * background seems to be used. */ +#if 0 + DrawThemeBackground (theme, (HDC)wParam, WP_DIALOG, 0, &rc, + NULL); +#endif + return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); + else + /* We might have gotten a TAB theme class, so check if we can + * draw as a tab page. */ + if (IsThemePartDefined (theme, TABP_BODY, 0)) + DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc, + NULL); + else + return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); + } + return 1; + } + + case WM_CTLCOLORSTATIC: + if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); + { + DLGPROC dlgp = (DLGPROC)GetWindowLongPtrW (hWnd, DWLP_DLGPROC); + LRESULT result = (LRESULT)dlgp (hWnd, msg, wParam, lParam); + if (!result) + { + /* Override defaults with more suitable values when themed */ + HDC controlDC = (HDC)wParam; + HWND controlWnd = (HWND)lParam; + WCHAR controlClass[32]; + RECT rc; + + GetClassNameW (controlWnd, controlClass, + sizeof(controlClass) / sizeof(controlClass[0])); + if (lstrcmpiW (controlClass, WC_STATICW) == 0) + { + /* Static control - draw parent background and set text to + * transparent, so it looks right on tab pages. */ + GetClientRect (controlWnd, &rc); + DrawThemeParentBackground (controlWnd, controlDC, &rc); + SetBkMode (controlDC, TRANSPARENT); + + /* Return NULL brush since we painted the BG already */ + return (LRESULT)GetStockObject (NULL_BRUSH); + } + else + return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); + + } + return result; + } + + default: + /* Call old proc */ + return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); + } + return 0; +} diff -urN wine-20050725/dlls/comctl32/theme_edit.c wine-20050830/dlls/comctl32/theme_edit.c --- wine-20050725/dlls/comctl32/theme_edit.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/comctl32/theme_edit.c 2005-08-19 15:58:03.000000000 +0200 @@ -0,0 +1,134 @@ +/* + * Theming - Edit control + * + * Copyright (c) 2005 by Frank Richter + * + * 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 "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "uxtheme.h" +#include "tmschema.h" +#include "comctl32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(themingedit); + +/* Draw themed border */ +static void nc_paint (HTHEME theme, HWND hwnd, HRGN region) +{ + HRGN cliprgn = region; + DWORD exStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); + if (exStyle & WS_EX_CLIENTEDGE) + { + HDC dc; + RECT r; + int cxEdge = GetSystemMetrics (SM_CXEDGE), + cyEdge = GetSystemMetrics (SM_CYEDGE); + int part = EP_EDITTEXT; + int state = ETS_NORMAL; + DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); + + if (!IsWindowEnabled (hwnd)) + state = ETS_DISABLED; + else if (dwStyle & ES_READONLY) + state = ETS_READONLY; + else if (GetFocus() == hwnd) + state = ETS_FOCUSED; + + GetWindowRect(hwnd, &r); + + /* New clipping region passed to default proc to exclude border */ + cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge, + r.right - cxEdge, r.bottom - cyEdge); + if (region != (HRGN)1) + CombineRgn (cliprgn, cliprgn, region, RGN_AND); + OffsetRect(&r, -r.left, -r.top); + + dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN); + OffsetRect(&r, -r.left, -r.top); + + if (IsThemeBackgroundPartiallyTransparent (theme, part, state)) + DrawThemeParentBackground(hwnd, dc, &r); + DrawThemeBackground (theme, dc, part, state, &r, 0); + ReleaseDC(hwnd, dc); + } + + /* Call default proc to get the scrollbars etc. also painted */ + DefWindowProcW (hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0); +} + +/********************************************************************** + * The edit control subclass window proc. + */ +LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam, + ULONG_PTR dwRefData) +{ + const WCHAR* themeClass = WC_EDITW; + HTHEME theme; + LRESULT result; + + switch (msg) + { + case WM_CREATE: + result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + OpenThemeData( hwnd, themeClass ); + return result; + + case WM_DESTROY: + theme = GetWindowTheme( hwnd ); + CloseThemeData ( theme ); + return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + + case WM_THEMECHANGED: + theme = GetWindowTheme( hwnd ); + CloseThemeData ( theme ); + OpenThemeData( hwnd, themeClass ); + break; + + case WM_SYSCOLORCHANGE: + theme = GetWindowTheme( hwnd ); + if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + /* Do nothing. When themed, a WM_THEMECHANGED will be received, too, + * which will do the repaint. */ + break; + + case WM_NCPAINT: + theme = GetWindowTheme( hwnd ); + if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + nc_paint (theme, hwnd, (HRGN)wParam); + break; + + case WM_ENABLE: + theme = GetWindowTheme( hwnd ); + if (theme) RedrawWindow (hwnd, NULL, NULL, + RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW); + return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + + default: + /* Call old proc */ + return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + } + return 0; +} diff -urN wine-20050725/dlls/comctl32/theme_listbox.c wine-20050830/dlls/comctl32/theme_listbox.c --- wine-20050725/dlls/comctl32/theme_listbox.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/comctl32/theme_listbox.c 2005-08-18 13:45:43.000000000 +0200 @@ -0,0 +1,118 @@ +/* + * Theming - List box control + * + * Copyright (c) 2005 by Frank Richter + * + * 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 "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "uxtheme.h" +#include "tmschema.h" +#include "comctl32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(theminglistbox); + +/* Draw themed border */ +static void nc_paint (HTHEME theme, HWND hwnd, HRGN region) +{ + HRGN cliprgn = region; + DWORD exStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); + if (exStyle & WS_EX_CLIENTEDGE) + { + HDC dc; + RECT r; + int cxEdge = GetSystemMetrics (SM_CXEDGE), + cyEdge = GetSystemMetrics (SM_CYEDGE); + + GetWindowRect(hwnd, &r); + + /* New clipping region passed to default proc to exclude border */ + cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge, + r.right - cxEdge, r.bottom - cyEdge); + if (region != (HRGN)1) + CombineRgn (cliprgn, cliprgn, region, RGN_AND); + OffsetRect(&r, -r.left, -r.top); + + dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN); + OffsetRect(&r, -r.left, -r.top); + + if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0)) + DrawThemeParentBackground(hwnd, dc, &r); + DrawThemeBackground (theme, dc, 0, 0, &r, 0); + ReleaseDC(hwnd, dc); + } + + /* Call default proc to get the scrollbars etc. painted */ + DefWindowProcW (hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0); +} + +/********************************************************************** + * The list control subclass window proc. + */ +LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam, + ULONG_PTR dwRefData) +{ + const WCHAR* themeClass = WC_LISTBOXW; + HTHEME theme; + LRESULT result; + + switch (msg) + { + case WM_CREATE: + result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + OpenThemeData( hwnd, themeClass ); + return result; + + case WM_DESTROY: + theme = GetWindowTheme( hwnd ); + CloseThemeData ( theme ); + return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + + case WM_THEMECHANGED: + theme = GetWindowTheme( hwnd ); + CloseThemeData ( theme ); + OpenThemeData( hwnd, themeClass ); + break; + + case WM_SYSCOLORCHANGE: + theme = GetWindowTheme( hwnd ); + if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + /* Do nothing. When themed, a WM_THEMECHANGED will be received, too, + * which will do the repaint. */ + break; + + case WM_NCPAINT: + theme = GetWindowTheme( hwnd ); + if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + nc_paint (theme, hwnd, (HRGN)wParam); + break; + + default: + /* Call old proc */ + return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); + } + return 0; +} diff -urN wine-20050725/dlls/comctl32/theming.c wine-20050830/dlls/comctl32/theming.c --- wine-20050725/dlls/comctl32/theming.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/comctl32/theming.c 2005-08-30 12:07:17.000000000 +0200 @@ -0,0 +1,169 @@ +/* + * Theming - Initialization + * + * Copyright (c) 2005 by Frank Richter + * + * 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 "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "comctl32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(theming); + +typedef LRESULT (CALLBACK* THEMING_SUBCLASSPROC)(HWND, UINT, WPARAM, LPARAM, + ULONG_PTR); + +extern LRESULT CALLBACK THEMING_ComboSubclassProc (HWND, UINT, WPARAM, LPARAM, + ULONG_PTR); +extern LRESULT CALLBACK THEMING_DialogSubclassProc (HWND, UINT, WPARAM, LPARAM, + ULONG_PTR); +extern LRESULT CALLBACK THEMING_EditSubclassProc (HWND, UINT, WPARAM, LPARAM, + ULONG_PTR); +extern LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND, UINT, WPARAM, LPARAM, + ULONG_PTR); + +static const WCHAR dialogClass[] = {'#','3','2','7','7','0',0}; +static const WCHAR comboLboxClass[] = {'C','o','m','b','o','L','b','o','x',0}; + +static const struct ThemingSubclass +{ + const WCHAR* className; + THEMING_SUBCLASSPROC subclassProc; +} subclasses[] = { + /* Note: list must be sorted by class name */ + {dialogClass, THEMING_DialogSubclassProc}, + {WC_COMBOBOXW, THEMING_ComboSubclassProc}, + {comboLboxClass, THEMING_ListBoxSubclassProc}, + {WC_EDITW, THEMING_EditSubclassProc}, + {WC_LISTBOXW, THEMING_ListBoxSubclassProc} +}; + +#define NUM_SUBCLASSES (sizeof(subclasses)/sizeof(subclasses[0])) + +static WNDPROC originalProcs[NUM_SUBCLASSES]; +static ATOM atRefDataProp; +static ATOM atSubclassProp; + +/* Generate a number of subclass window procs. + * With a single proc alone, we can't really reliably find out the superclass, + * so have one for each subclass. The subclass number is also stored in a prop + * since it's needed by THEMING_CallOriginalClass(). Then, the the subclass + * proc and ref data are fetched and the proc called. + */ +#define MAKE_SUBCLASS_PROC(N) \ +static LRESULT CALLBACK subclass_proc ## N (HWND wnd, UINT msg, \ + WPARAM wParam, LPARAM lParam) \ +{ \ + LRESULT result; \ + ULONG_PTR refData; \ + SetPropW (wnd, MAKEINTATOMW (atSubclassProp), (HANDLE)N); \ + refData = (ULONG_PTR)GetPropW (wnd, MAKEINTATOMW (atRefDataProp)); \ + TRACE ("%d; (%p, %x, %x, %lx, %lx)\n", N, wnd, msg, wParam, lParam, \ + refData); \ + result = subclasses[N].subclassProc (wnd, msg, wParam, lParam, refData);\ + TRACE ("result = %lx\n", result); \ + return result; \ +} + +MAKE_SUBCLASS_PROC(0) +MAKE_SUBCLASS_PROC(1) +MAKE_SUBCLASS_PROC(2) +MAKE_SUBCLASS_PROC(3) +MAKE_SUBCLASS_PROC(4) + +const static WNDPROC subclassProcs[NUM_SUBCLASSES] = { + subclass_proc0, + subclass_proc1, + subclass_proc2, + subclass_proc3, + subclass_proc4 +}; + +/*********************************************************************** + * THEMING_Initialize + * + * Register classes for standard controls that will shadow the system + * classes. + */ +void THEMING_Initialize (void) +{ + int i; + static const WCHAR subclassPropName[] = + { 'C','C','3','2','T','h','e','m','i','n','g','S','u','b','C','l',0 }; + static const WCHAR refDataPropName[] = + { 'C','C','3','2','T','h','e','m','i','n','g','D','a','t','a',0 }; + + atSubclassProp = GlobalAddAtomW (subclassPropName); + atRefDataProp = GlobalAddAtomW (refDataPropName); + + for (i = 0; i < NUM_SUBCLASSES; i++) + { + WNDCLASSEXW class; + + class.cbSize = sizeof(class); + class.style |= CS_GLOBALCLASS; + GetClassInfoExW (NULL, subclasses[i].className, &class); + originalProcs[i] = class.lpfnWndProc; + class.lpfnWndProc = subclassProcs[i]; + + if (!class.lpfnWndProc) + { + ERR("Missing proc for class %s\n", + debugstr_w (subclasses[i].className)); + continue; + } + + if (!RegisterClassExW (&class)) + { + ERR("Could not re-register class %s: %lx\n", + debugstr_w (subclasses[i].className), GetLastError ()); + } + else + { + TRACE("Re-registered class %s\n", + debugstr_w (subclasses[i].className)); + } + } +} + +/*********************************************************************** + * THEMING_CallOriginalClass + * + * Determines the original window proc and calls it. + */ +LRESULT THEMING_CallOriginalClass (HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + INT_PTR subclass = (INT_PTR)GetPropW (wnd, MAKEINTATOMW (atSubclassProp)); + WNDPROC oldProc = originalProcs[subclass]; + return CallWindowProcW (oldProc, wnd, msg, wParam, lParam); +} + +/*********************************************************************** + * THEMING_SetSubclassData + * + * Update the "refData" value of the subclassed window. + */ +void THEMING_SetSubclassData (HWND wnd, ULONG_PTR refData) +{ + SetPropW (wnd, MAKEINTATOMW (atRefDataProp), (HANDLE)refData); +} diff -urN wine-20050725/dlls/comctl32/toolbar.c wine-20050830/dlls/comctl32/toolbar.c --- wine-20050725/dlls/comctl32/toolbar.c 2005-07-22 21:57:44.000000000 +0200 +++ wine-20050830/dlls/comctl32/toolbar.c 2005-08-30 12:07:17.000000000 +0200 @@ -81,6 +81,8 @@ #include "winnls.h" #include "commctrl.h" #include "comctl32.h" +#include "uxtheme.h" +#include "tmschema.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(toolbar); @@ -96,7 +98,7 @@ BYTE bHot; BYTE bDropDownPressed; DWORD dwData; - INT iString; + INT_PTR iString; INT nRow; RECT rect; INT cx; /* manually set size */ @@ -238,6 +240,8 @@ #define GETHOTIMAGELIST(infoPtr, id) TOOLBAR_GetImageList(infoPtr->himlHot, infoPtr->cimlHot, id) #define GETDISIMAGELIST(infoPtr, id) TOOLBAR_GetImageList(infoPtr->himlDis, infoPtr->cimlDis, id) +static const WCHAR themeClass[] = { 'T','o','o','l','b','a','r',0 }; + static BOOL TOOLBAR_GetButtonInfo(TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb); static BOOL TOOLBAR_IsButtonRemovable(TOOLBAR_INFO *infoPtr, int iItem, PCUSTOMBUTTON btnInfo); static HIMAGELIST TOOLBAR_GetImageList(PIMLENTRY *pies, INT cies, INT id); @@ -693,7 +697,8 @@ draw_masked = TRUE; } } - else if ((tbcd->nmcd.uItemState & CDIS_HOT) && (infoPtr->dwStyle & TBSTYLE_FLAT)) + else if ((tbcd->nmcd.uItemState & CDIS_HOT) + && ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))) { /* if hot, attempt to draw with hot image list, if fails, use default image list */ @@ -814,6 +819,7 @@ DWORD ntfret; INT offset; INT oldBkMode; + HTHEME theme = GetWindowTheme (hwnd); rc = btnPtr->rect; CopyRect (&rcArrow, &rc); @@ -937,6 +943,13 @@ /* separator */ if (btnPtr->fsStyle & BTNS_SEP) { + if (theme) + { + DrawThemeBackground (theme, hdc, + (dwStyle & CCS_VERT) ? TP_SEPARATORVERT : TP_SEPARATOR, 0, + &tbcd.nmcd.rc, NULL); + } + else /* with the FLAT style, iBitmap is the width and has already */ /* been taken into consideration in calculating the width */ /* so now we need to draw the vertical separator */ @@ -963,7 +976,8 @@ ((tbcd.nmcd.uItemState & CDIS_CHECKED) || (tbcd.nmcd.uItemState & CDIS_INDETERMINATE))) TOOLBAR_DrawPattern (&rc, &tbcd); - if ((dwStyle & TBSTYLE_FLAT) && (tbcd.nmcd.uItemState & CDIS_HOT)) + if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) + && (tbcd.nmcd.uItemState & CDIS_HOT)) { if ( infoPtr->dwItemCDFlag & TBCDRF_HILITEHOTTRACK ) { @@ -977,10 +991,47 @@ } } - TOOLBAR_DrawFrame(infoPtr, &tbcd); + if (theme) + { + int partId = drawSepDropDownArrow ? TP_SPLITBUTTON : TP_BUTTON; + int stateId = TS_NORMAL; + + if (tbcd.nmcd.uItemState & CDIS_DISABLED) + stateId = TS_DISABLED; + else if (tbcd.nmcd.uItemState & CDIS_SELECTED) + stateId = TS_PRESSED; + else if (tbcd.nmcd.uItemState & CDIS_CHECKED) + stateId = (tbcd.nmcd.uItemState & CDIS_HOT) ? TS_HOTCHECKED : TS_HOT; + else if ((tbcd.nmcd.uItemState & CDIS_HOT) + || (drawSepDropDownArrow && btnPtr->bDropDownPressed)) + stateId = TS_HOT; + + DrawThemeBackground (theme, hdc, partId, stateId, &tbcd.nmcd.rc, NULL); + } + else + TOOLBAR_DrawFrame(infoPtr, &tbcd); if (drawSepDropDownArrow) - TOOLBAR_DrawSepDDArrow(infoPtr, &tbcd, &rcArrow, btnPtr->bDropDownPressed); + { + if (theme) + { + int stateId = TS_NORMAL; + + if (tbcd.nmcd.uItemState & CDIS_DISABLED) + stateId = TS_DISABLED; + else if (btnPtr->bDropDownPressed || (tbcd.nmcd.uItemState & CDIS_SELECTED)) + stateId = TS_PRESSED; + else if (tbcd.nmcd.uItemState & CDIS_CHECKED) + stateId = (tbcd.nmcd.uItemState & CDIS_HOT) ? TS_HOTCHECKED : TS_HOT; + else if (tbcd.nmcd.uItemState & CDIS_HOT) + stateId = TS_HOT; + + DrawThemeBackground (theme, hdc, TP_DROPDOWNBUTTON, stateId, &rcArrow, NULL); + DrawThemeBackground (theme, hdc, TP_SPLITBUTTONDROPDOWN, stateId, &rcArrow, NULL); + } + else + TOOLBAR_DrawSepDDArrow(infoPtr, &tbcd, &rcArrow, btnPtr->bDropDownPressed); + } oldBkMode = SetBkMode (hdc, tbcd.nStringBkMode); if (!(infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || (btnPtr->fsStyle & BTNS_SHOWTEXT)) @@ -2152,8 +2203,7 @@ return FALSE; /* UNDOCUMENTED: dialog hwnd immediately follows NMHDR */ - /* FIXME: this hack won't work on 64-bit - we need to declare a structure for this */ - nmtb.iItem = (int)hwnd; + memcpy(&nmtb.iItem, &hwnd, sizeof(hwnd)); /* Send TBN_INITCUSTOMIZE notification */ if (TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_INITCUSTOMIZE) == TBNRF_HIDEHELP) @@ -2454,7 +2504,7 @@ /* draw button */ if (!(infoPtr->dwStyle & TBSTYLE_FLAT)) - DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT); + DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT); /* draw image and text */ if ((btnInfo->btn.fsStyle & BTNS_SEP) == 0) { @@ -3602,7 +3652,7 @@ { TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); - if (!(infoPtr->dwStyle & TBSTYLE_FLAT)) + if (!((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))) return -1; if (infoPtr->nHotItem < 0) @@ -4668,7 +4718,7 @@ FIXME("wParam is %d. Perhaps image list index?\n", wParam); if ((LOWORD(lParam) <= 0) || (HIWORD(lParam)<=0)) - return FALSE; + lParam = MAKELPARAM(16, 15); if (infoPtr->nNumButtons > 0) WARN("%d buttons, undoc increase to bitmap size : %d-%d -> %d-%d\n", @@ -4724,7 +4774,7 @@ if (lptbbi->dwMask & TBIF_STYLE) btnPtr->fsStyle = lptbbi->fsStyle; - if ((lptbbi->dwMask & TBIF_TEXT) && ((INT)lptbbi->pszText != -1)) { + if ((lptbbi->dwMask & TBIF_TEXT) && ((INT_PTR)lptbbi->pszText != -1)) { if ((HIWORD(btnPtr->iString) == 0) || (btnPtr->iString == -1)) /* iString is index, zero it to make Str_SetPtr succeed */ btnPtr->iString=0; @@ -4778,7 +4828,7 @@ if (lptbbi->dwMask & TBIF_STYLE) btnPtr->fsStyle = lptbbi->fsStyle; - if ((lptbbi->dwMask & TBIF_TEXT) && ((INT)lptbbi->pszText != -1)) { + if ((lptbbi->dwMask & TBIF_TEXT) && ((INT_PTR)lptbbi->pszText != -1)) { if ((HIWORD(btnPtr->iString) == 0) || (btnPtr->iString == -1)) /* iString is index, zero it to make Str_SetPtr succeed */ btnPtr->iString=0; @@ -5037,7 +5087,7 @@ /* NOTE: an application can still remove the hot item even if anchor * highlighting is enabled */ - if (infoPtr->dwStyle & TBSTYLE_FLAT) + if ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) TOOLBAR_SetHotItemEx(infoPtr, wParam, HICF_OTHER); if (nOldHotItem < 0) @@ -5591,6 +5641,8 @@ TOOLBAR_SendNotify (&nmttc.hdr, infoPtr, NM_TOOLTIPSCREATED); } } + + OpenThemeData (hwnd, themeClass); TOOLBAR_CheckStyle (hwnd, dwStyle); @@ -5637,6 +5689,8 @@ /* delete default font */ if (infoPtr->hFont) DeleteObject (infoPtr->hDefaultFont); + + CloseThemeData (GetWindowTheme (hwnd)); /* free toolbar info data */ Free (infoPtr); @@ -5653,6 +5707,7 @@ NMTBCUSTOMDRAW tbcd; INT ret = FALSE; DWORD ntfret; + HTHEME theme = GetWindowTheme (hwnd); /* the app has told us not to redraw the toolbar */ if (!infoPtr->bDoRedraw) @@ -5681,7 +5736,7 @@ /* If the toolbar is "transparent" then pass the WM_ERASEBKGND up * to my parent for processing. */ - if (infoPtr->dwStyle & TBSTYLE_TRANSPARENT) { + if (theme || (infoPtr->dwStyle & TBSTYLE_TRANSPARENT)) { POINT pt, ptorig; HDC hdc = (HDC)wParam; HWND parent; @@ -6168,7 +6223,7 @@ INT nHit; TBUTTON_INFO *btnPtr; - if (infoPtr->dwStyle & TBSTYLE_FLAT) { + if ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) { /* fill in the TRACKMOUSEEVENT struct */ trackinfo.cbSize = sizeof(TRACKMOUSEEVENT); trackinfo.dwFlags = TME_QUERY; @@ -6197,7 +6252,8 @@ nHit = TOOLBAR_InternalHitTest (hwnd, &pt); - if ((infoPtr->dwStyle & TBSTYLE_FLAT) && (!infoPtr->bAnchor || (nHit >= 0))) + if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) + && (!infoPtr->bAnchor || (nHit >= 0))) TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE); if (infoPtr->nOldHit != nHit) @@ -6316,7 +6372,8 @@ * (Guy Albertelli 9/2001) * */ - if ((cs->style & TBSTYLE_FLAT) && !(cs->style & TBSTYLE_TRANSPARENT)) + if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) + && !(cs->style & TBSTYLE_TRANSPARENT)) styleadd |= TBSTYLE_TRANSPARENT; if (!(cs->style & (CCS_TOP | CCS_NOMOVEY))) { styleadd |= CCS_TOP; /* default to top */ @@ -6702,6 +6759,15 @@ } +/* update theme after a WM_THEMECHANGED message */ +static LRESULT theme_changed (HWND hwnd) +{ + HTHEME theme = GetWindowTheme (hwnd); + CloseThemeData (theme); + OpenThemeData (hwnd, themeClass); + return 0; +} + static LRESULT WINAPI ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -7084,6 +7150,9 @@ case WM_SYSCOLORCHANGE: return TOOLBAR_SysColorChange (hwnd); + + case WM_THEMECHANGED: + return theme_changed (hwnd); /* case WM_WININICHANGE: */ diff -urN wine-20050725/dlls/comctl32/tooltips.c wine-20050830/dlls/comctl32/tooltips.c --- wine-20050725/dlls/comctl32/tooltips.c 2005-04-18 12:30:57.000000000 +0200 +++ wine-20050830/dlls/comctl32/tooltips.c 2005-08-30 12:07:17.000000000 +0200 @@ -113,7 +113,7 @@ UINT uFlags; HWND hwnd; BOOL bNotifyUnicode; - UINT uId; + UINT_PTR uId; RECT rect; HINSTANCE hinst; LPWSTR lpszText; @@ -323,8 +323,8 @@ SendMessageW(toolPtr->hwnd, WM_NOTIFY, (WPARAM)toolPtr->uId, (LPARAM)&ttnmdi); - if (HIWORD((UINT)ttnmdi.lpszText) == 0) { - LoadStringW(ttnmdi.hinst, (UINT)ttnmdi.lpszText, + if (IS_INTRESOURCE(ttnmdi.lpszText)) { + LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText), infoPtr->szTipText, INFOTIPSIZE); if (ttnmdi.uFlags & TTF_DI_SETITEM) { toolPtr->hinst = ttnmdi.hinst; @@ -372,8 +372,8 @@ SendMessageW(toolPtr->hwnd, WM_NOTIFY, (WPARAM)toolPtr->uId, (LPARAM)&ttnmdi); - if (HIWORD((UINT)ttnmdi.lpszText) == 0) { - LoadStringW(ttnmdi.hinst, (UINT)ttnmdi.lpszText, + if (IS_INTRESOURCE(ttnmdi.lpszText)) { + LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText), infoPtr->szTipText, INFOTIPSIZE); if (ttnmdi.uFlags & TTF_DI_SETITEM) { toolPtr->hinst = ttnmdi.hinst; @@ -406,11 +406,11 @@ { TTTOOL_INFO *toolPtr = &infoPtr->tools[nTool]; - if (HIWORD((UINT)toolPtr->lpszText) == 0 && toolPtr->hinst) { + if (IS_INTRESOURCE(toolPtr->lpszText) && toolPtr->hinst) { /* load a resource */ TRACE("load res string %p %x\n", - toolPtr->hinst, (int)toolPtr->lpszText); - LoadStringW (toolPtr->hinst, (UINT)toolPtr->lpszText, + toolPtr->hinst, LOWORD(toolPtr->lpszText)); + LoadStringW (toolPtr->hinst, LOWORD(toolPtr->lpszText), infoPtr->szTipText, INFOTIPSIZE); } else if (toolPtr->lpszText) { @@ -1015,8 +1015,8 @@ toolPtr->rect = lpToolInfo->rect; toolPtr->hinst = lpToolInfo->hinst; - if (HIWORD(lpToolInfo->lpszText) == 0) { - TRACE("add string id %x!\n", (int)lpToolInfo->lpszText); + if (IS_INTRESOURCE(lpToolInfo->lpszText)) { + TRACE("add string id %x!\n", LOWORD(lpToolInfo->lpszText)); toolPtr->lpszText = (LPWSTR)lpToolInfo->lpszText; } else if (lpToolInfo->lpszText) { @@ -1106,8 +1106,8 @@ toolPtr->rect = lpToolInfo->rect; toolPtr->hinst = lpToolInfo->hinst; - if (HIWORD(lpToolInfo->lpszText) == 0) { - TRACE("add string id %x!\n", (int)lpToolInfo->lpszText); + if (IS_INTRESOURCE(lpToolInfo->lpszText)) { + TRACE("add string id %x\n", LOWORD(lpToolInfo->lpszText)); toolPtr->lpszText = (LPWSTR)lpToolInfo->lpszText; } else if (lpToolInfo->lpszText) { @@ -1173,7 +1173,7 @@ toolPtr = &infoPtr->tools[nTool]; if (toolPtr->lpszText) { if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) && - (HIWORD((INT)toolPtr->lpszText) != 0) ) + !IS_INTRESOURCE(toolPtr->lpszText) ) Free (toolPtr->lpszText); } @@ -2015,8 +2015,8 @@ toolPtr->rect = lpToolInfo->rect; toolPtr->hinst = lpToolInfo->hinst; - if (HIWORD(lpToolInfo->lpszText) == 0) { - TRACE("set string id %x!\n", (INT)lpToolInfo->lpszText); + if (IS_INTRESOURCE(lpToolInfo->lpszText)) { + TRACE("set string id %x\n", LOWORD(lpToolInfo->lpszText)); toolPtr->lpszText = (LPWSTR)lpToolInfo->lpszText; } else if (lpToolInfo->lpszText) { @@ -2024,7 +2024,7 @@ toolPtr->lpszText = LPSTR_TEXTCALLBACKW; else { if ( (toolPtr->lpszText) && - (HIWORD((INT)toolPtr->lpszText) != 0) ) { + !IS_INTRESOURCE(toolPtr->lpszText) ) { Free (toolPtr->lpszText); toolPtr->lpszText = NULL; } @@ -2072,8 +2072,8 @@ toolPtr->rect = lpToolInfo->rect; toolPtr->hinst = lpToolInfo->hinst; - if (HIWORD(lpToolInfo->lpszText) == 0) { - TRACE("set string id %x!\n", (INT)lpToolInfo->lpszText); + if (IS_INTRESOURCE(lpToolInfo->lpszText)) { + TRACE("set string id %x!\n", LOWORD(lpToolInfo->lpszText)); toolPtr->lpszText = lpToolInfo->lpszText; } else { @@ -2081,7 +2081,7 @@ toolPtr->lpszText = LPSTR_TEXTCALLBACKW; else { if ( (toolPtr->lpszText) && - (HIWORD((INT)toolPtr->lpszText) != 0) ) { + !IS_INTRESOURCE(toolPtr->lpszText) ) { Free (toolPtr->lpszText); toolPtr->lpszText = NULL; } @@ -2199,7 +2199,7 @@ /* copy tool text */ toolPtr->hinst = lpToolInfo->hinst; - if (HIWORD(lpToolInfo->lpszText) == 0){ + if (IS_INTRESOURCE(lpToolInfo->lpszText)){ toolPtr->lpszText = (LPWSTR)lpToolInfo->lpszText; } else if (lpToolInfo->lpszText) { @@ -2207,7 +2207,7 @@ toolPtr->lpszText = LPSTR_TEXTCALLBACKW; else { if ( (toolPtr->lpszText) && - (HIWORD((INT)toolPtr->lpszText) != 0) ) { + !IS_INTRESOURCE(toolPtr->lpszText) ) { Free (toolPtr->lpszText); toolPtr->lpszText = NULL; } @@ -2256,7 +2256,7 @@ /* copy tool text */ toolPtr->hinst = lpToolInfo->hinst; - if (HIWORD(lpToolInfo->lpszText) == 0){ + if (IS_INTRESOURCE(lpToolInfo->lpszText)){ toolPtr->lpszText = lpToolInfo->lpszText; } else if (lpToolInfo->lpszText) { @@ -2264,7 +2264,7 @@ toolPtr->lpszText = LPSTR_TEXTCALLBACKW; else { if ( (toolPtr->lpszText) && - (HIWORD((INT)toolPtr->lpszText) != 0) ) { + !IS_INTRESOURCE(toolPtr->lpszText) ) { Free (toolPtr->lpszText); toolPtr->lpszText = NULL; } @@ -2337,7 +2337,7 @@ toolPtr = &infoPtr->tools[i]; if (toolPtr->lpszText) { if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) && - (HIWORD((INT)toolPtr->lpszText) != 0) ) + !IS_INTRESOURCE(toolPtr->lpszText) ) { Free (toolPtr->lpszText); toolPtr->lpszText = NULL; diff -urN wine-20050725/dlls/comctl32/trackbar.c wine-20050830/dlls/comctl32/trackbar.c --- wine-20050725/dlls/comctl32/trackbar.c 2005-01-17 14:38:44.000000000 +0100 +++ wine-20050830/dlls/comctl32/trackbar.c 2005-08-15 12:24:00.000000000 +0200 @@ -41,6 +41,8 @@ #include "winuser.h" #include "winnls.h" #include "commctrl.h" +#include "uxtheme.h" +#include "tmschema.h" #include "wine/debug.h" #include "comctl32.h" @@ -90,6 +92,7 @@ #define TB_AUTO_PAGE_LEFT 16 #define TB_AUTO_PAGE_RIGHT 32 #define TB_AUTO_PAGE (TB_AUTO_PAGE_LEFT | TB_AUTO_PAGE_RIGHT) +#define TB_THUMB_HOT 64 /* mouse hovers above thumb */ /* helper defines for TRACKBAR_DrawTic */ #define TIC_EDGE 0x20 @@ -97,6 +100,8 @@ #define TIC_SELECTIONMARKMIN 0x100 #define TIC_SELECTIONMARK (TIC_SELECTIONMARKMAX | TIC_SELECTIONMARKMIN) +static const WCHAR themeClass[] = { 'T','r','a','c','k','b','a','r',0 }; + static inline int notify_customdraw(TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage) { @@ -466,12 +471,22 @@ TRACKBAR_DrawChannel (TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) { RECT rcChannel = infoPtr->rcChannel; + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - DrawEdge (hdc, &rcChannel, EDGE_SUNKEN, BF_RECT | BF_ADJUST); - if (dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */ - FillRect (hdc, &rcChannel, GetStockObject(WHITE_BRUSH)); - if (TRACKBAR_HasSelection(infoPtr)) - FillRect (hdc, &infoPtr->rcSelection, GetSysColorBrush(COLOR_HIGHLIGHT)); + if (theme) + { + DrawThemeBackground (theme, hdc, + (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_VERT) ? + TKP_TRACKVERT : TKP_TRACK, TKS_NORMAL, &rcChannel, 0); + } + else + { + DrawEdge (hdc, &rcChannel, EDGE_SUNKEN, BF_RECT | BF_ADJUST); + if (dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */ + FillRect (hdc, &rcChannel, GetStockObject(WHITE_BRUSH)); + if (TRACKBAR_HasSelection(infoPtr)) + FillRect (hdc, &infoPtr->rcSelection, GetSysColorBrush(COLOR_HIGHLIGHT)); + } } } @@ -567,8 +582,14 @@ int ticFlags = dwStyle & 0x0f; LOGPEN ticPen = { PS_SOLID, {1, 0}, GetSysColor (COLOR_3DDKSHADOW) }; HPEN hOldPen, hTicPen; + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - /* create the pen to draw the tics with */ + if (theme) + { + int part = (dwStyle & TBS_VERT) ? TKP_TICSVERT : TKP_TICS; + GetThemeColor (theme, part, TSS_NORMAL, TMT_COLOR, &ticPen.lopnColor); + } + /* create the pen to draw the tics with */ hTicPen = CreatePenIndirect(&ticPen); hOldPen = hTicPen ? SelectObject(hdc, hTicPen) : 0; @@ -604,6 +625,32 @@ POINT points[6]; int fillClr; int PointDepth; + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); + + if (theme) + { + int partId; + int stateId; + if (dwStyle & TBS_BOTH) + partId = (dwStyle & TBS_VERT) ? TKP_THUMBVERT : TKP_THUMB; + else if (dwStyle & TBS_LEFT) + partId = (dwStyle & TBS_VERT) ? TKP_THUMBLEFT : TKP_THUMBTOP; + else + partId = (dwStyle & TBS_VERT) ? TKP_THUMBRIGHT : TKP_THUMBBOTTOM; + + if (dwStyle & WS_DISABLED) + stateId = TUS_DISABLED; + else if (infoPtr->flags & TB_DRAG_MODE) + stateId = TUS_PRESSED; + else if (infoPtr->flags & TB_THUMB_HOT) + stateId = TUS_HOT; + else + stateId = TUS_NORMAL; + + DrawThemeBackground (theme, hdc, partId, stateId, &thumb, 0); + + return; + } fillClr = infoPtr->flags & TB_DRAG_MODE ? COLOR_BTNHILIGHT : COLOR_BTNFACE; oldbr = SelectObject (hdc, GetSysColorBrush(fillClr)); @@ -822,7 +869,10 @@ /* Erase backbround */ if (gcdrf == CDRF_DODEFAULT || notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) { - FillRect (hdc, &rcClient, GetSysColorBrush(COLOR_BTNFACE)); + if (GetWindowTheme (infoPtr->hwndSelf)) + DrawThemeParentBackground (infoPtr->hwndSelf, hdc, &rcClient); + else + FillRect (hdc, &rcClient, GetSysColorBrush(COLOR_BTNFACE)); if (gcdrf != CDRF_DODEFAULT) notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE); } @@ -1380,6 +1430,8 @@ SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW, 0, (LPARAM)&ti); } } + + OpenThemeData (hwnd, themeClass); return 0; } @@ -1394,6 +1446,7 @@ Free (infoPtr); SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); + CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); return 0; } @@ -1519,6 +1572,16 @@ } +/* update theme after a WM_THEMECHANGED message */ +static LRESULT theme_changed (TRACKBAR_INFO* infoPtr) +{ + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); + CloseThemeData (theme); + theme = OpenThemeData (infoPtr->hwndSelf, themeClass); + return 0; +} + + static LRESULT TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y) { @@ -1536,7 +1599,36 @@ return TRUE; } - if (!(infoPtr->flags & TB_DRAG_MODE)) return TRUE; + if (!(infoPtr->flags & TB_DRAG_MODE)) + { + if (GetWindowTheme (infoPtr->hwndSelf)) + { + DWORD oldFlags = infoPtr->flags; + POINT pt; + pt.x = x; + pt.y = y; + if (PtInRect (&infoPtr->rcThumb, pt)) + { + TRACKMOUSEEVENT tme; + tme.cbSize = sizeof( tme ); + tme.dwFlags = TME_LEAVE; + tme.hwndTrack = infoPtr->hwndSelf; + TrackMouseEvent( &tme ); + infoPtr->flags |= TB_THUMB_HOT; + } + else + { + TRACKMOUSEEVENT tme; + tme.cbSize = sizeof( tme ); + tme.dwFlags = TME_CANCEL; + tme.hwndTrack = infoPtr->hwndSelf; + TrackMouseEvent( &tme ); + infoPtr->flags &= ~TB_THUMB_HOT; + } + if (oldFlags != infoPtr->flags) InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE); + } + return TRUE; + } dragPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace, dwStyle & TBS_VERT); @@ -1778,6 +1870,11 @@ case WM_LBUTTONUP: return TRACKBAR_LButtonUp (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); + case WM_MOUSELEAVE: + infoPtr->flags &= ~TB_THUMB_HOT; + InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE); + return 0; + case WM_MOUSEMOVE: return TRACKBAR_MouseMove (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); @@ -1790,6 +1887,9 @@ case WM_SIZE: return TRACKBAR_Size (infoPtr, wParam, LOWORD(lParam), HIWORD(lParam)); + case WM_THEMECHANGED: + return theme_changed (infoPtr); + case WM_TIMER: return TRACKBAR_Timer (infoPtr, (INT)wParam, (TIMERPROC *)lParam); diff -urN wine-20050725/dlls/comctl32/treeview.c wine-20050830/dlls/comctl32/treeview.c --- wine-20050725/dlls/comctl32/treeview.c 2005-06-13 13:38:55.000000000 +0200 +++ wine-20050830/dlls/comctl32/treeview.c 2005-08-30 12:07:17.000000000 +0200 @@ -59,6 +59,8 @@ #include "winnls.h" #include "commctrl.h" #include "comctl32.h" +#include "uxtheme.h" +#include "tmschema.h" #include "wine/unicode.h" #include "wine/debug.h" @@ -196,6 +198,9 @@ #define ISVISIBLE(x) ((x)->visibleOrder >= 0) +static const WCHAR themeClass[] = { 'T','r','e','e','v','i','e','w',0 }; + + typedef VOID (*TREEVIEW_ItemEnumFunc)(TREEVIEW_INFO *, TREEVIEW_ITEM *,LPVOID); @@ -654,12 +659,13 @@ { HWND hwnd = infoPtr->hwnd; LPNMCUSTOMDRAW nmcd; - DWORD dwDrawStage, dwItemSpec; + DWORD dwDrawStage; + DWORD_PTR dwItemSpec; UINT uItemState; INT retval; dwDrawStage = CDDS_ITEM | uItemDrawState; - dwItemSpec = (DWORD)wineItem; + dwItemSpec = (DWORD_PTR)wineItem; uItemState = 0; if (wineItem->state & TVIS_SELECTED) uItemState |= CDIS_SELECTED; @@ -1233,11 +1239,11 @@ insertAfter = ptdi->hInsertAfter; /* Validate this now for convenience. */ - switch ((DWORD)insertAfter) + switch ((DWORD_PTR)insertAfter) { - case (DWORD)TVI_FIRST: - case (DWORD)TVI_LAST: - case (DWORD)TVI_SORT: + case (DWORD_PTR)TVI_FIRST: + case (DWORD_PTR)TVI_LAST: + case (DWORD_PTR)TVI_SORT: break; default: @@ -1269,9 +1275,9 @@ infoPtr->uNumItems++; - switch ((DWORD)insertAfter) + switch ((DWORD_PTR)insertAfter) { - case (DWORD)TVI_FIRST: + case (DWORD_PTR)TVI_FIRST: { TREEVIEW_ITEM *originalFirst = parentItem->firstChild; TREEVIEW_InsertBefore(newItem, parentItem->firstChild, parentItem); @@ -1280,7 +1286,7 @@ } break; - case (DWORD)TVI_LAST: + case (DWORD_PTR)TVI_LAST: TREEVIEW_InsertAfter(newItem, parentItem->lastChild, parentItem); break; @@ -1289,7 +1295,7 @@ TREEVIEW_InsertAfter(newItem, insertAfter, insertAfter->parent); break; - case (DWORD)TVI_SORT: + case (DWORD_PTR)TVI_SORT: { TREEVIEW_ITEM *aChild; TREEVIEW_ITEM *previousChild = NULL; @@ -2361,45 +2367,58 @@ { if (item->cChildren) { - LONG height = item->rect.bottom - item->rect.top; - LONG width = item->stateOffset - item->linesOffset; - LONG rectsize = min(height, width) / 4; - /* plussize = ceil(rectsize * 3/4) */ - LONG plussize = (rectsize + 1) * 3 / 4; - - HPEN hNewPen = CreatePen(PS_SOLID, 0, infoPtr->clrLine); - HPEN hOldPen = SelectObject(hdc, hNewPen); - - Rectangle(hdc, centerx - rectsize - 1, centery - rectsize - 1, - centerx + rectsize + 2, centery + rectsize + 2); - - SelectObject(hdc, hOldPen); - DeleteObject(hNewPen); - - if (height < 18 || width < 18) - { - MoveToEx(hdc, centerx - plussize + 1, centery, NULL); - LineTo(hdc, centerx + plussize, centery); - - if (!(item->state & TVIS_EXPANDED)) - { - MoveToEx(hdc, centerx, centery - plussize + 1, NULL); - LineTo(hdc, centerx, centery + plussize); - } - } - else - { - Rectangle(hdc, centerx - plussize + 1, centery - 1, - centerx + plussize, centery + 2); - - if (!(item->state & TVIS_EXPANDED)) - { - Rectangle(hdc, centerx - 1, centery - plussize + 1, - centerx + 2, centery + plussize); - SetPixel(hdc, centerx - 1, centery, infoPtr->clrBk); - SetPixel(hdc, centerx + 1, centery, infoPtr->clrBk); - } - } + HTHEME theme = GetWindowTheme(infoPtr->hwnd); + if (theme) + { + RECT glyphRect = item->rect; + glyphRect.left = item->linesOffset; + glyphRect.right = item->stateOffset; + DrawThemeBackground (theme, hdc, TVP_GLYPH, + (item->state & TVIS_EXPANDED) ? GLPS_OPENED : GLPS_CLOSED, + &glyphRect, NULL); + } + else + { + LONG height = item->rect.bottom - item->rect.top; + LONG width = item->stateOffset - item->linesOffset; + LONG rectsize = min(height, width) / 4; + /* plussize = ceil(rectsize * 3/4) */ + LONG plussize = (rectsize + 1) * 3 / 4; + + HPEN hNewPen = CreatePen(PS_SOLID, 0, infoPtr->clrLine); + HPEN hOldPen = SelectObject(hdc, hNewPen); + + Rectangle(hdc, centerx - rectsize - 1, centery - rectsize - 1, + centerx + rectsize + 2, centery + rectsize + 2); + + SelectObject(hdc, hOldPen); + DeleteObject(hNewPen); + + if (height < 18 || width < 18) + { + MoveToEx(hdc, centerx - plussize + 1, centery, NULL); + LineTo(hdc, centerx + plussize, centery); + + if (!(item->state & TVIS_EXPANDED)) + { + MoveToEx(hdc, centerx, centery - plussize + 1, NULL); + LineTo(hdc, centerx, centery + plussize); + } + } + else + { + Rectangle(hdc, centerx - plussize + 1, centery - 1, + centerx + plussize, centery + 2); + + if (!(item->state & TVIS_EXPANDED)) + { + Rectangle(hdc, centerx - 1, centery - plussize + 1, + centerx + 2, centery + plussize); + SetPixel(hdc, centerx - 1, centery, infoPtr->clrBk); + SetPixel(hdc, centerx + 1, centery, infoPtr->clrBk); + } + } + } } } SelectObject(hdc, hbrOld); @@ -2573,9 +2592,9 @@ /* Draw insertion mark if necessary */ if (infoPtr->insertMarkItem) - TRACE("item:%d,mark:%d\n", + TRACE("item:%d,mark:%p\n", TREEVIEW_GetItemIndex(infoPtr, wineItem), - (int)infoPtr->insertMarkItem); + infoPtr->insertMarkItem); if (wineItem == infoPtr->insertMarkItem) { @@ -2954,7 +2973,7 @@ /* Check for a valid handle to the parent item */ if (!TREEVIEW_ValidItem(infoPtr, parent)) { - ERR("invalid item hParent=%x\n", (INT)parent); + ERR("invalid item hParent=%p\n", parent); return FALSE; } @@ -3625,7 +3644,7 @@ TEXTMETRICW textMetric; static const WCHAR EditW[] = {'E','d','i','t',0}; - TRACE("%x %p\n", (unsigned)hwnd, hItem); + TRACE("%p %p\n", hwnd, hItem); if (!TREEVIEW_ValidItem(infoPtr, editItem)) return NULL; @@ -4952,6 +4971,8 @@ /* Make sure actual scrollbar state is consistent with uInternalStatus */ ShowScrollBar(hwnd, SB_VERT, FALSE); ShowScrollBar(hwnd, SB_HORZ, FALSE); + + OpenThemeData (hwnd, themeClass); return 0; } @@ -4971,9 +4992,12 @@ SetWindowLongPtrW(infoPtr->hwndEdit, GWLP_WNDPROC, (DWORD_PTR)infoPtr->wpEditOrig); + CloseThemeData (GetWindowTheme (infoPtr->hwnd)); + /* Deassociate treeview from the window before doing anything drastic. */ SetWindowLongPtrW(infoPtr->hwnd, 0, (DWORD_PTR)NULL); + DeleteObject(infoPtr->hDefaultFont); DeleteObject(infoPtr->hBoldFont); DeleteObject(infoPtr->hUnderlineFont); @@ -5201,6 +5225,40 @@ return 0; } +/* Draw themed border */ +static BOOL nc_paint (TREEVIEW_INFO *infoPtr, HRGN region) +{ + HTHEME theme = GetWindowTheme (infoPtr->hwnd); + HDC dc; + RECT r; + HRGN cliprgn; + int cxEdge = GetSystemMetrics (SM_CXEDGE), + cyEdge = GetSystemMetrics (SM_CYEDGE); + + if (!theme) return FALSE; + + GetWindowRect(infoPtr->hwnd, &r); + + cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge, + r.right - cxEdge, r.bottom - cyEdge); + if (region != (HRGN)1) + CombineRgn (cliprgn, cliprgn, region, RGN_AND); + OffsetRect(&r, -r.left, -r.top); + + dc = GetDCEx(infoPtr->hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN); + OffsetRect(&r, -r.left, -r.top); + + if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0)) + DrawThemeParentBackground(infoPtr->hwnd, dc, &r); + DrawThemeBackground (theme, dc, 0, 0, &r, 0); + ReleaseDC(infoPtr->hwnd, dc); + + /* Call default proc to get the scrollbars etc. painted */ + DefWindowProcW (infoPtr->hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0); + + return TRUE; +} + static LRESULT TREEVIEW_Notify(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { @@ -5346,6 +5404,15 @@ return 0; } +/* update theme after a WM_THEMECHANGED message */ +static LRESULT theme_changed (TREEVIEW_INFO* infoPtr) +{ + HTHEME theme = GetWindowTheme (infoPtr->hwnd); + CloseThemeData (theme); + OpenThemeData (infoPtr->hwnd, themeClass); + return 0; +} + static LRESULT WINAPI TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -5551,6 +5618,11 @@ else return 0; + case WM_NCPAINT: + if (nc_paint (infoPtr, (HRGN)wParam)) + return 0; + goto def; + case WM_NOTIFY: return TREEVIEW_Notify(infoPtr, wParam, lParam); @@ -5590,6 +5662,9 @@ case WM_TIMER: return TREEVIEW_HandleTimer(infoPtr, wParam); + case WM_THEMECHANGED: + return theme_changed (infoPtr); + case WM_VSCROLL: return TREEVIEW_VScroll(infoPtr, wParam); diff -urN wine-20050725/dlls/commdlg/cdlg32.c wine-20050830/dlls/commdlg/cdlg32.c --- wine-20050725/dlls/commdlg/cdlg32.c 2005-02-25 15:07:58.000000000 +0100 +++ wine-20050830/dlls/commdlg/cdlg32.c 2005-08-15 12:48:51.000000000 +0200 @@ -73,7 +73,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved) { - TRACE("(%p, %08lx, %p)\n", hInstance, Reason, Reserved); + TRACE("(%p, %ld, %p)\n", hInstance, Reason, Reserved); switch(Reason) { diff -urN wine-20050725/dlls/commdlg/filedlg.c wine-20050830/dlls/commdlg/filedlg.c --- wine-20050725/dlls/commdlg/filedlg.c 2005-07-05 16:11:04.000000000 +0200 +++ wine-20050830/dlls/commdlg/filedlg.c 2005-08-12 12:33:06.000000000 +0200 @@ -1711,8 +1711,9 @@ * * If the function succeeds, the return value is nonzero. */ -#define ONOPEN_OPEN 1 -#define ONOPEN_SEARCH 2 +#define ONOPEN_BROWSE 1 +#define ONOPEN_OPEN 2 +#define ONOPEN_SEARCH 3 static void FILEDLG95_OnOpenMessage(HWND hwnd, int idCaption, int idText) { WCHAR strMsgTitle[MAX_PATH]; @@ -1739,15 +1740,15 @@ TRACE("hwnd=%p\n", hwnd); - if(BrowseSelectedFolder(hwnd)) - return FALSE; - /* get the files from the edit control */ nFileCount = FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed, '\0'); /* try if the user selected a folder in the shellview */ if(nFileCount == 0) + { + BrowseSelectedFolder(hwnd); return FALSE; + } if(nFileCount > 1) { @@ -1808,7 +1809,12 @@ lpstrPathAndFile: cleaned up path */ - nOpenAction = ONOPEN_OPEN; + if (nFileCount && + (fodInfos->ofnInfos->Flags & OFN_NOVALIDATE) && + !(fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST)) + nOpenAction = ONOPEN_OPEN; + else + nOpenAction = ONOPEN_BROWSE; /* don't apply any checks with OFN_NOVALIDATE */ { @@ -1842,7 +1848,8 @@ *p = 0; lpszTemp = lpszTemp + strlenW(lpwstrTemp); - if(*lpszTemp==0) + /* There are no wildcards when OFN_NOVALIDATE is set */ + if(*lpszTemp==0 && !(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE)) { static const WCHAR wszWild[] = { '*', '?', 0 }; /* if the last element is a wildcard do a search */ @@ -1941,7 +1948,6 @@ int iPos; LPWSTR lpszTemp = PathFindFileNameW(lpstrPathAndFile); DWORD len; - IPersistFolder2 * ppf2; /* replace the current filter */ if(fodInfos->ShellInfos.lpstrCurrentFilter) @@ -1953,7 +1959,12 @@ /* set the filter cb to the extension when possible */ if(-1 < (iPos = FILEDLG95_FILETYPE_SearchExt(fodInfos->DlgInfos.hwndFileTypeCB, lpszTemp))) CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB, iPos); - + } + /* fall through */ + case ONOPEN_BROWSE: /* browse to the highest folder we could bind to */ + TRACE("ONOPEN_BROWSE\n"); + { + IPersistFolder2 * ppf2; if(SUCCEEDED(IShellFolder_QueryInterface( lpsf, &IID_IPersistFolder2, (LPVOID*)&ppf2))) { LPITEMIDLIST pidlCurrent; @@ -1963,11 +1974,10 @@ { IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidlCurrent, SBSP_ABSOLUTE); } - else + else if( nOpenAction == ONOPEN_SEARCH ) { IShellView_Refresh(fodInfos->Shell.FOIShellView); } - SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE); COMDLG32_SHFree(pidlCurrent); } } @@ -1985,51 +1995,48 @@ fodInfos->ofnInfos->Flags &= ~OFN_READONLY; /* Attach the file extension with file name*/ - - if(!PathIsDirectoryW(lpstrPathAndFile)) + ext = PathFindExtensionW(lpstrPathAndFile); + if (! *ext) { - if((ext = PathFindExtensionW(lpstrPathAndFile)) == NULL) - { - /* if no extension is specified with file name, then */ - /* attach the extension from file filter or default one */ + /* if no extension is specified with file name, then */ + /* attach the extension from file filter or default one */ - WCHAR *filterExt = NULL; - LPWSTR lpstrFilter = NULL; - static const WCHAR szwDot[] = {'.',0}; - int PathLength = strlenW(lpstrPathAndFile); + WCHAR *filterExt = NULL; + LPWSTR lpstrFilter = NULL; + static const WCHAR szwDot[] = {'.',0}; + int PathLength = strlenW(lpstrPathAndFile); - /* Attach the dot*/ - strcatW(lpstrPathAndFile, szwDot); + /* Attach the dot*/ + strcatW(lpstrPathAndFile, szwDot); - /*Get the file extension from file type filter*/ - lpstrFilter = (LPWSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, - fodInfos->ofnInfos->nFilterIndex-1); - - if (lpstrFilter != (LPWSTR)CB_ERR) /* control is not empty */ - filterExt = PathFindExtensionW(lpstrFilter); - - if ( filterExt && *filterExt ) /* attach the file extension from file type filter*/ - strcatW(lpstrPathAndFile, filterExt + 1); - else if ( fodInfos->defext ) /* attach the default file extension*/ - strcatW(lpstrPathAndFile, fodInfos->defext); - - /* In Open dialog: if file does not exist try without extension */ - if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) && !PathFileExistsW(lpstrPathAndFile)) - lpstrPathAndFile[PathLength] = '\0'; - } - - if (fodInfos->defext) /* add default extension */ - { - /* Set/clear the output OFN_EXTENSIONDIFFERENT flag */ - if (*ext) - ext++; - if (!lstrcmpiW(fodInfos->defext, ext)) - fodInfos->ofnInfos->Flags &= ~OFN_EXTENSIONDIFFERENT; - else - fodInfos->ofnInfos->Flags |= OFN_EXTENSIONDIFFERENT; - } + /*Get the file extension from file type filter*/ + lpstrFilter = (LPWSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, + fodInfos->ofnInfos->nFilterIndex-1); + + if (lpstrFilter != (LPWSTR)CB_ERR) /* control is not empty */ + filterExt = PathFindExtensionW(lpstrFilter); + + if ( filterExt && *filterExt ) /* attach the file extension from file type filter*/ + strcatW(lpstrPathAndFile, filterExt + 1); + else if ( fodInfos->defext ) /* attach the default file extension*/ + strcatW(lpstrPathAndFile, fodInfos->defext); + + /* In Open dialog: if file does not exist try without extension */ + if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) && !PathFileExistsW(lpstrPathAndFile)) + lpstrPathAndFile[PathLength] = '\0'; } + if (fodInfos->defext) /* add default extension */ + { + /* Set/clear the output OFN_EXTENSIONDIFFERENT flag */ + if (*ext) + ext++; + if (!lstrcmpiW(fodInfos->defext, ext)) + fodInfos->ofnInfos->Flags &= ~OFN_EXTENSIONDIFFERENT; + else + fodInfos->ofnInfos->Flags |= OFN_EXTENSIONDIFFERENT; + } + /* In Save dialog: check if the file already exists */ if (fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG && fodInfos->ofnInfos->Flags & OFN_OVERWRITEPROMPT @@ -3201,6 +3208,9 @@ TRACE("sv=%p index=%u\n", doSelected, nPidlIndex); + if (!doSelected) + return NULL; + /* Set the FORMATETC structure*/ SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); diff -urN wine-20050725/dlls/commdlg/filedlgbrowser.c wine-20050830/dlls/commdlg/filedlgbrowser.c --- wine-20050725/dlls/commdlg/filedlgbrowser.c 2005-07-05 16:11:04.000000000 +0200 +++ wine-20050830/dlls/commdlg/filedlgbrowser.c 2005-07-27 13:10:53.000000000 +0200 @@ -55,6 +55,16 @@ } IShellBrowserImpl; +static inline IShellBrowserImpl *impl_from_ICommDlgBrowser( ICommDlgBrowser *iface ) +{ + return (IShellBrowserImpl *)((char*)iface - FIELD_OFFSET(IShellBrowserImpl, lpVtblCommDlgBrowser)); +} + +static inline IShellBrowserImpl *impl_from_IServiceProvider( IServiceProvider *iface ) +{ + return (IShellBrowserImpl *)((char*)iface - FIELD_OFFSET(IShellBrowserImpl, lpVtblServiceProvider)); +} + /************************************************************************** * vtable */ @@ -728,11 +738,11 @@ REFIID riid, LPVOID *ppvObj) { - _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface); + IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface); TRACE("(%p)\n", This); - return IShellBrowserImpl_QueryInterface(This,riid,ppvObj); + return IShellBrowserImpl_QueryInterface((IShellBrowser *)This,riid,ppvObj); } /************************************************************************** @@ -740,11 +750,11 @@ */ static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface) { - _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface); + IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface); TRACE("(%p)\n", This); - return IShellBrowserImpl_AddRef(This); + return IShellBrowserImpl_AddRef((IShellBrowser *)This); } /************************************************************************** @@ -752,11 +762,11 @@ */ static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface) { - _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface); + IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface); TRACE("(%p)\n", This); - return IShellBrowserImpl_Release(This); + return IShellBrowserImpl_Release((IShellBrowser *)This); } /************************************************************************** @@ -770,7 +780,7 @@ LPITEMIDLIST pidl; FileOpenDlgInfos *fodInfos; - _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface); + IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface); TRACE("(%p)\n", This); @@ -812,7 +822,7 @@ ULONG uChange) { - _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface); + IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface); TRACE("(%p shv=%p)\n", This, ppshv); @@ -855,7 +865,7 @@ STRRET str; WCHAR szPathW[MAX_PATH]; - _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface); + IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface); TRACE("(%p)\n", This); @@ -895,7 +905,7 @@ { FileOpenDlgInfos *fodInfos; - _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface); + IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface); fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView); @@ -942,11 +952,11 @@ REFIID riid, LPVOID *ppvObj) { - _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface); + IShellBrowserImpl *This = impl_from_IServiceProvider(iface); FIXME("(%p)\n", This); - return IShellBrowserImpl_QueryInterface(This,riid,ppvObj); + return IShellBrowserImpl_QueryInterface((IShellBrowser *)This,riid,ppvObj); } /************************************************************************** @@ -954,11 +964,11 @@ */ static ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider * iface) { - _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface); + IShellBrowserImpl *This = impl_from_IServiceProvider(iface); FIXME("(%p)\n", This); - return IShellBrowserImpl_AddRef(This); + return IShellBrowserImpl_AddRef((IShellBrowser *)This); } /************************************************************************** @@ -966,11 +976,11 @@ */ static ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface) { - _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface); + IShellBrowserImpl *This = impl_from_IServiceProvider(iface); FIXME("(%p)\n", This); - return IShellBrowserImpl_Release(This); + return IShellBrowserImpl_Release((IShellBrowser *)This); } /************************************************************************** @@ -990,14 +1000,14 @@ REFIID riid, void** ppv) { - _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface); + IShellBrowserImpl *This = impl_from_IServiceProvider(iface); FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) ); *ppv = NULL; if(guidService && IsEqualIID(guidService, &SID_STopLevelBrowser)) { - return IShellBrowserImpl_QueryInterface(This,riid,ppv); + return IShellBrowserImpl_QueryInterface((IShellBrowser *)This,riid,ppv); } FIXME("(%p) unknown interface requested\n", This); return E_NOINTERFACE; diff -urN wine-20050725/dlls/commdlg/filedlgbrowser.h wine-20050830/dlls/commdlg/filedlgbrowser.h --- wine-20050725/dlls/commdlg/filedlgbrowser.h 2005-06-07 22:03:30.000000000 +0200 +++ wine-20050830/dlls/commdlg/filedlgbrowser.h 2005-07-27 13:10:53.000000000 +0200 @@ -37,11 +37,6 @@ /*********************************************************************** * Defines and global variables */ -#define _ICommDlgBrowser_Offset ((int)(&(((IShellBrowserImpl*)0)->lpVtblCommDlgBrowser))) -#define _ICOM_THIS_FromICommDlgBrowser(class, name) class* This = (class*)(((char*)name)-_ICommDlgBrowser_Offset); - -#define _IServiceProvider_Offset ((int)(&(((IShellBrowserImpl*)0)->lpVtblServiceProvider))) -#define _ICOM_THIS_FromIServiceProvider(class, name) class* This = (class*)(((char*)name)-_IServiceProvider_Offset); /* dialog internal property */ diff -urN wine-20050725/dlls/commdlg/printdlg.c wine-20050830/dlls/commdlg/printdlg.c --- wine-20050725/dlls/commdlg/printdlg.c 2005-07-07 20:23:45.000000000 +0200 +++ wine-20050830/dlls/commdlg/printdlg.c 2005-08-25 21:23:43.000000000 +0200 @@ -2968,7 +2968,7 @@ HDC hdc; HBRUSH hbrush, holdbrush; PageSetupDataA *pda; - int papersize=0, orientation=0; /* FIXME: set this values */ + int papersize=0, orientation=0; /* FIXME: set this values for user paint hook */ double scalx, scaly; #define CALLPAINTHOOK(msg,lprc) PRINTDLG_DefaultPagePaintHook( hWnd, msg, (WPARAM)hdc, (LPARAM)lprc, pda) @@ -3085,11 +3085,8 @@ /* FIXME: Paint hook. Must it be at begin of initializtion or at end? */ res = TRUE; if (pda->dlga->Flags & PSD_ENABLEPAGESETUPHOOK) { - res = pda->dlga->lpfnPageSetupHook(hDlg,uMsg,wParam,(LPARAM)pda->dlga); - if (!res) { + if (!pda->dlga->lpfnPageSetupHook(hDlg,uMsg,wParam,(LPARAM)pda->dlga)) FIXME("Setup page hook failed?\n"); - res = TRUE; - } } /* if printer button disabled */ @@ -3102,11 +3099,14 @@ EnableWindow(GetDlgItem(hDlg, edt6), FALSE); EnableWindow(GetDlgItem(hDlg, edt7), FALSE); } - /* width larger as height -> landscape */ - if (pda->dlga->ptPaperSize.x > pda->dlga->ptPaperSize.y) + /* Set orientation radiobutton properly */ + dm = GlobalLock(pda->dlga->hDevMode); + if (dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE) CheckRadioButton(hDlg, rad1, rad2, rad2); else /* this is default if papersize is not set */ CheckRadioButton(hDlg, rad1, rad2, rad1); + GlobalUnlock(pda->dlga->hDevMode); + /* if orientation disabled */ if (pda->dlga->Flags & PSD_DISABLEORIENTATION) { EnableWindow(GetDlgItem(hDlg,rad1),FALSE); @@ -3151,6 +3151,11 @@ GlobalUnlock(pda->pdlg.hDevMode); pda->curdlg.ptPaperSize.x = _c_10mm2size(pda->dlga, pda->curdlg.ptPaperSize.x); pda->curdlg.ptPaperSize.y = _c_10mm2size(pda->dlga, pda->curdlg.ptPaperSize.y); + if (IsDlgButtonChecked(hDlg, rad2) == BST_CHECKED) { /* Landscape orientation */ + DWORD tmp = pda->curdlg.ptPaperSize.y; + pda->curdlg.ptPaperSize.y = pda->curdlg.ptPaperSize.x; + pda->curdlg.ptPaperSize.x = tmp; + } } else WARN("GlobalLock(pda->pdlg.hDevMode) fail? hDevMode=%ld", (DWORD)pda->pdlg.hDevMode); /* Drawing paper prev */ diff -urN wine-20050725/dlls/crtdll/Makefile.in wine-20050830/dlls/crtdll/Makefile.in --- wine-20050725/dlls/crtdll/Makefile.in 2005-05-09 16:42:35.000000000 +0200 +++ wine-20050830/dlls/crtdll/Makefile.in 2005-08-11 19:12:19.000000000 +0200 @@ -6,6 +6,7 @@ IMPORTLIB = libcrtdll.$(IMPLIBEXT) IMPORTS = msvcrt kernel32 EXTRALIBS = $(LIBUNICODE) +MODCFLAGS = @BUILTINFLAG@ EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt C_SRCS = \ diff -urN wine-20050725/dlls/crypt32/Makefile.in wine-20050830/dlls/crypt32/Makefile.in --- wine-20050725/dlls/crypt32/Makefile.in 2005-05-24 11:58:26.000000000 +0200 +++ wine-20050830/dlls/crypt32/Makefile.in 2005-08-18 12:59:47.000000000 +0200 @@ -5,7 +5,7 @@ VPATH = @srcdir@ MODULE = crypt32.dll IMPORTLIB = libcrypt32.$(IMPLIBEXT) -IMPORTS = advapi32 kernel32 +IMPORTS = advapi32 kernel32 ntdll C_SRCS = \ cert.c \ diff -urN wine-20050725/dlls/crypt32/cert.c wine-20050830/dlls/crypt32/cert.c --- wine-20050725/dlls/crypt32/cert.c 2005-07-07 22:27:55.000000000 +0200 +++ wine-20050830/dlls/crypt32/cert.c 2005-08-30 11:59:03.000000000 +0200 @@ -15,6 +15,17 @@ * 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 + * + * FIXME: + * - As you can see in the stubs below, support for CRLs and CTLs is missing. + * Mostly this should be copy-paste work, and some code (e.g. extended + * properties) could be shared between them. + * - Opening a cert store provider should be morphed to support loading + * external DLLs. + * - The concept of physical stores and locations isn't implemented. (This + * doesn't mean registry stores et al aren't implemented. See the PSDK for + * registering and enumerating physical stores and locations.) + * - Many flags, options and whatnot are unimplemented. */ #include #include "windef.h" @@ -22,54 +33,794 @@ #include "winreg.h" #include "wincrypt.h" #include "wine/debug.h" +#include "wine/list.h" +#include "crypt32_private.h" WINE_DEFAULT_DEBUG_CHANNEL(crypt); #define WINE_CRYPTCERTSTORE_MAGIC 0x74726563 +/* 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 WINE_CRYPTCERTSTORE; + +typedef struct WINE_CRYPTCERTSTORE * (*StoreOpenFunc)(HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara); + +struct _WINE_CERT_CONTEXT_REF; + +/* Called to enumerate the next certificate in a store. The returned pointer + * must be newly allocated (via HeapAlloc): CertFreeCertificateContext frees + * it. + */ +typedef struct _WINE_CERT_CONTEXT_REF * (*EnumCertFunc) + (struct WINE_CRYPTCERTSTORE *store, struct _WINE_CERT_CONTEXT_REF *pPrev); + +struct _WINE_CERT_CONTEXT; +/* Called to create a new reference to an existing cert context. Should call + * CRYPT_InitCertRef to make sure the reference count is properly updated. + * If the store does not provide any additional allocated data (that is, does + * not need to implement a FreeCertFunc), it may use CRYPT_CreateCertRef for + * this. + */ +typedef struct _WINE_CERT_CONTEXT_REF * (*CreateRefFunc) + (struct _WINE_CERT_CONTEXT *context, HCERTSTORE store); + +/* Optional, called when a cert context reference is being freed. Don't free + * the ref pointer itself, CertFreeCertificateContext does that. + */ +typedef void (*FreeCertFunc)(struct _WINE_CERT_CONTEXT_REF *ref); + +typedef enum _CertStoreType { + StoreTypeMem, + StoreTypeCollection, + StoreTypeReg, + StoreTypeDummy, +} CertStoreType; + +/* A cert store is polymorphic through the use of function pointers. A type + * is still needed to distinguish collection stores from other types. + * On the function pointers: + * - closeStore is called when the store's ref count becomes 0 + * - addCert is called with a PWINE_CERT_CONTEXT as the second parameter + * - control is optional, but should be implemented by any store that supports + * persistence + */ typedef struct WINE_CRYPTCERTSTORE { - DWORD dwMagic; -} WINECRYPT_CERTSTORE; + DWORD dwMagic; + LONG ref; + DWORD dwOpenFlags; + HCRYPTPROV cryptProv; + CertStoreType type; + PFN_CERT_STORE_PROV_CLOSE closeStore; + PFN_CERT_STORE_PROV_WRITE_CERT addCert; + CreateRefFunc createCertRef; + EnumCertFunc enumCert; + PFN_CERT_STORE_PROV_DELETE_CERT deleteCert; + FreeCertFunc freeCert; /* optional */ + PFN_CERT_STORE_PROV_CONTROL control; /* optional */ +} WINECRYPT_CERTSTORE, *PWINECRYPT_CERTSTORE; + +/* A certificate context has pointers to data that are owned by this module, + * so rather than duplicate the data every time a certificate context is + * copied, I keep a reference count to the data. Thus I have two data + * structures, the "true" certificate context (that has the reference count) + * and a reference certificate context, that has a pointer to the true context. + * Each one can be cast to a PCERT_CONTEXT, though you'll usually be dealing + * with the reference version. + */ +typedef struct _WINE_CERT_CONTEXT +{ + CERT_CONTEXT cert; + LONG ref; + CRITICAL_SECTION cs; + struct list extendedProperties; +} WINE_CERT_CONTEXT, *PWINE_CERT_CONTEXT; +typedef struct _WINE_CERT_CONTEXT_REF +{ + CERT_CONTEXT cert; + WINE_CERT_CONTEXT *context; +} WINE_CERT_CONTEXT_REF, *PWINE_CERT_CONTEXT_REF; -/* - * CertOpenStore - * - * System Store CA is - * HKLM\\Software\\Microsoft\\SystemCertificates\\CA\\ - * Certificates\\ - * "Blob" = REG_BINARY - * CRLs\\ - * "Blob" = REG_BINARY - * CTLs\\ - * "Blob" = REG_BINARY - */ -HCERTSTORE WINAPI CertOpenStore( LPCSTR lpszStoreProvider, - DWORD dwMsgAndCertEncodingType, HCRYPTPROV hCryptProv, - DWORD dwFlags, const void* pvPara ) +/* An extended certificate property in serialized form is prefixed by this + * header. + */ +typedef struct _WINE_CERT_PROP_HEADER { - WINECRYPT_CERTSTORE *hcs; + DWORD propID; + DWORD unknown; /* always 1 */ + DWORD cb; +} WINE_CERT_PROP_HEADER, *PWINE_CERT_PROP_HEADER; - FIXME("%s %08lx %08lx %08lx %p stub\n", debugstr_a(lpszStoreProvider), - dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara); +/* Stores an extended property in a cert. */ +typedef struct _WINE_CERT_PROPERTY +{ + WINE_CERT_PROP_HEADER hdr; + LPBYTE pbData; + struct list entry; +} WINE_CERT_PROPERTY, *PWINE_CERT_PROPERTY; + +/* A mem store has a list of these. They're also returned by the mem store + * during enumeration. + */ +typedef struct _WINE_CERT_LIST_ENTRY +{ + WINE_CERT_CONTEXT_REF cert; + struct list entry; +} WINE_CERT_LIST_ENTRY, *PWINE_CERT_LIST_ENTRY; + +typedef struct _WINE_MEMSTORE +{ + WINECRYPT_CERTSTORE hdr; + CRITICAL_SECTION cs; + struct list certs; +} WINE_MEMSTORE, *PWINE_MEMSTORE; + +typedef struct _WINE_STORE_LIST_ENTRY +{ + PWINECRYPT_CERTSTORE store; + DWORD dwUpdateFlags; + DWORD dwPriority; + struct list entry; +} WINE_STORE_LIST_ENTRY, *PWINE_STORE_LIST_ENTRY; + +/* Returned by a collection store during enumeration. + * Note: relies on the list entry being valid after use, which a number of + * conditions might make untrue (reentrancy, closing a collection store before + * continuing an enumeration on it, ...). The tests seem to indicate this + * sort of unsafety is okay, since Windows isn't well-behaved in these + * scenarios either. + */ +typedef struct _WINE_COLLECTION_CERT_CONTEXT +{ + WINE_CERT_CONTEXT_REF cert; + PWINE_STORE_LIST_ENTRY entry; + PWINE_CERT_CONTEXT_REF childContext; +} WINE_COLLECTION_CERT_CONTEXT, *PWINE_COLLECTION_CERT_CONTEXT; + +typedef struct _WINE_COLLECTIONSTORE +{ + WINECRYPT_CERTSTORE hdr; + CRITICAL_SECTION cs; + struct list stores; +} WINE_COLLECTIONSTORE, *PWINE_COLLECTIONSTORE; + +/* Like CertGetCertificateContextProperty, but operates directly on the + * WINE_CERT_CONTEXT. Doesn't support special-case properties, since they + * are handled by CertGetCertificateContextProperty, and are particular to the + * store in which the property exists (which is separate from the context.) + */ +static BOOL WINAPI CRYPT_GetCertificateContextProperty( + PWINE_CERT_CONTEXT context, DWORD dwPropId, void *pvData, DWORD *pcbData); + +/* Like CertSetCertificateContextProperty, but operates directly on the + * WINE_CERT_CONTEXT. Doesn't handle special cases, since they're handled by + * CertSetCertificateContextProperty anyway. + */ +static BOOL WINAPI CRYPT_SetCertificateContextProperty( + PWINE_CERT_CONTEXT context, DWORD dwPropId, DWORD dwFlags, const void *pvData); - if( lpszStoreProvider == CERT_STORE_PROV_SYSTEM_A ) +static void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, HCRYPTPROV hCryptProv, + DWORD dwFlags, CertStoreType type) +{ + store->ref = 1; + store->dwMagic = WINE_CRYPTCERTSTORE_MAGIC; + store->type = type; + if (!hCryptProv) { - FIXME("pvPara = %s\n", debugstr_a( (LPCSTR) pvPara ) ); + hCryptProv = CRYPT_GetDefaultProvider(); + dwFlags |= CERT_STORE_NO_CRYPT_RELEASE_FLAG; } - else if ( lpszStoreProvider == CERT_STORE_PROV_SYSTEM_W ) + store->cryptProv = hCryptProv; + store->dwOpenFlags = dwFlags; +} + +/* Initializes the reference ref to point to pCertContext, which is assumed to + * be a PWINE_CERT_CONTEXT, and increments pCertContext's reference count. + * Also sets the hCertStore member of the reference to store. + */ +static void CRYPT_InitCertRef(PWINE_CERT_CONTEXT_REF ref, + PWINE_CERT_CONTEXT context, HCERTSTORE store) +{ + TRACE("(%p, %p)\n", ref, context); + memcpy(&ref->cert, context, sizeof(ref->cert)); + ref->context = context; + InterlockedIncrement(&context->ref); + ref->cert.hCertStore = store; +} + +static PWINE_CERT_CONTEXT_REF CRYPT_CreateCertRef(PWINE_CERT_CONTEXT context, + HCERTSTORE store) +{ + PWINE_CERT_CONTEXT_REF pCertRef = HeapAlloc(GetProcessHeap(), 0, + sizeof(WINE_CERT_CONTEXT_REF)); + + if (pCertRef) + CRYPT_InitCertRef(pCertRef, context, store); + return pCertRef; +} + +static BOOL WINAPI CRYPT_MemAddCert(HCERTSTORE store, PCCERT_CONTEXT pCert, + DWORD dwAddDisposition) +{ + WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store; + BOOL add = FALSE, ret; + + TRACE("(%p, %p, %ld)\n", store, pCert, dwAddDisposition); + + switch (dwAddDisposition) { - FIXME("pvPara = %s\n", debugstr_w( (LPCWSTR) pvPara ) ); + case CERT_STORE_ADD_ALWAYS: + add = TRUE; + break; + case CERT_STORE_ADD_NEW: + { + BYTE hashToAdd[20], hash[20]; + DWORD size = sizeof(hashToAdd); + + ret = CRYPT_GetCertificateContextProperty((PWINE_CERT_CONTEXT)pCert, + CERT_HASH_PROP_ID, hashToAdd, &size); + if (ret) + { + PWINE_CERT_LIST_ENTRY cursor; + + /* Add if no cert with the same hash is found. */ + add = TRUE; + EnterCriticalSection(&ms->cs); + LIST_FOR_EACH_ENTRY(cursor, &ms->certs, WINE_CERT_LIST_ENTRY, entry) + { + size = sizeof(hash); + ret = CertGetCertificateContextProperty(&cursor->cert.cert, + CERT_HASH_PROP_ID, hash, &size); + if (ret && !memcmp(hashToAdd, hash, size)) + { + TRACE("found matching certificate, not adding\n"); + SetLastError(CRYPT_E_EXISTS); + add = FALSE; + break; + } + } + LeaveCriticalSection(&ms->cs); + } + break; } + case CERT_STORE_ADD_REPLACE_EXISTING: + { + BYTE hashToAdd[20], hash[20]; + DWORD size = sizeof(hashToAdd); - hcs = HeapAlloc( GetProcessHeap(), 0, sizeof (WINECRYPT_CERTSTORE) ); - if( !hcs ) - return NULL; + add = TRUE; + ret = CRYPT_GetCertificateContextProperty((PWINE_CERT_CONTEXT)pCert, + CERT_HASH_PROP_ID, hashToAdd, &size); + if (ret) + { + PWINE_CERT_LIST_ENTRY cursor, next; + + /* Look for existing cert to delete */ + EnterCriticalSection(&ms->cs); + LIST_FOR_EACH_ENTRY_SAFE(cursor, next, &ms->certs, + WINE_CERT_LIST_ENTRY, entry) + { + size = sizeof(hash); + ret = CertGetCertificateContextProperty(&cursor->cert.cert, + CERT_HASH_PROP_ID, hash, &size); + if (ret && !memcmp(hashToAdd, hash, size)) + { + TRACE("found matching certificate, replacing\n"); + list_remove(&cursor->entry); + CertFreeCertificateContext((PCCERT_CONTEXT)cursor); + break; + } + } + LeaveCriticalSection(&ms->cs); + } + break; + } + default: + FIXME("Unimplemented add disposition %ld\n", dwAddDisposition); + add = FALSE; + } + if (add) + { + PWINE_CERT_LIST_ENTRY entry = HeapAlloc(GetProcessHeap(), 0, + sizeof(WINE_CERT_LIST_ENTRY)); - hcs->dwMagic = WINE_CRYPTCERTSTORE_MAGIC; + if (entry) + { + TRACE("adding %p\n", entry); + CRYPT_InitCertRef(&entry->cert, (PWINE_CERT_CONTEXT)pCert, store); + list_init(&entry->entry); + EnterCriticalSection(&ms->cs); + list_add_tail(&ms->certs, &entry->entry); + LeaveCriticalSection(&ms->cs); + ret = TRUE; + } + else + ret = FALSE; + } + else + ret = FALSE; + return ret; +} + +static PWINE_CERT_CONTEXT_REF CRYPT_MemEnumCert(PWINECRYPT_CERTSTORE store, + PWINE_CERT_CONTEXT_REF pPrev) +{ + WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store; + PWINE_CERT_LIST_ENTRY prevEntry = (PWINE_CERT_LIST_ENTRY)pPrev, ret; + struct list *listNext; + + TRACE("(%p, %p)\n", store, pPrev); + EnterCriticalSection(&ms->cs); + if (prevEntry) + { + listNext = list_next(&ms->certs, &prevEntry->entry); + CertFreeCertificateContext((PCCERT_CONTEXT)pPrev); + } + else + listNext = list_next(&ms->certs, &ms->certs); + if (listNext) + { + ret = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_CERT_LIST_ENTRY)); + memcpy(ret, LIST_ENTRY(listNext, WINE_CERT_LIST_ENTRY, entry), + sizeof(WINE_CERT_LIST_ENTRY)); + InterlockedIncrement(&ret->cert.context->ref); + } + else + { + SetLastError(CRYPT_E_NOT_FOUND); + ret = NULL; + } + LeaveCriticalSection(&ms->cs); - return (HCERTSTORE) hcs; + TRACE("returning %p\n", ret); + return (PWINE_CERT_CONTEXT_REF)ret; +} + +static BOOL WINAPI CRYPT_MemDeleteCert(HCERTSTORE hCertStore, + PCCERT_CONTEXT pCertContext, DWORD dwFlags) +{ + WINE_MEMSTORE *store = (WINE_MEMSTORE *)hCertStore; + WINE_CERT_CONTEXT_REF *ref = (WINE_CERT_CONTEXT_REF *)pCertContext; + PWINE_CERT_LIST_ENTRY cert, next; + BOOL ret; + + /* Find the entry associated with the passed-in context, since the + * passed-in context may not be a list entry itself (e.g. if it came from + * CertDuplicateCertificateContext.) Pointing to the same context is + * a sufficient test of equality. + */ + EnterCriticalSection(&store->cs); + LIST_FOR_EACH_ENTRY_SAFE(cert, next, &store->certs, WINE_CERT_LIST_ENTRY, + entry) + { + if (cert->cert.context == ref->context) + { + TRACE("removing %p\n", cert); + /* FIXME: this isn't entirely thread-safe, the entry itself isn't + * protected. + */ + list_remove(&cert->entry); + cert->entry.prev = cert->entry.next = &store->certs; + CertFreeCertificateContext((PCCERT_CONTEXT)cert); + break; + } + } + ret = TRUE; + LeaveCriticalSection(&store->cs); + return ret; +} + +static void WINAPI CRYPT_MemCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) +{ + WINE_MEMSTORE *store = (WINE_MEMSTORE *)hCertStore; + PWINE_CERT_LIST_ENTRY cert, next; + + TRACE("(%p, %08lx)\n", store, dwFlags); + if (dwFlags) + FIXME("Unimplemented flags: %08lx\n", dwFlags); + + /* Note that CertFreeCertificateContext calls HeapFree on the passed-in + * pointer if its ref-count reaches zero. That's okay here because there + * aren't any allocated data outside of the WINE_CERT_CONTEXT_REF portion + * of the CertListEntry. + */ + LIST_FOR_EACH_ENTRY_SAFE(cert, next, &store->certs, WINE_CERT_LIST_ENTRY, + entry) + { + TRACE("removing %p\n", cert); + list_remove(&cert->entry); + CertFreeCertificateContext((PCCERT_CONTEXT)cert); + } + DeleteCriticalSection(&store->cs); + HeapFree(GetProcessHeap(), 0, store); +} + +static WINECRYPT_CERTSTORE *CRYPT_MemOpenStore(HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara) +{ + PWINE_MEMSTORE store; + + TRACE("(%ld, %08lx, %p)\n", hCryptProv, dwFlags, pvPara); + + if (dwFlags & CERT_STORE_DELETE_FLAG) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + store = NULL; + } + else + { + store = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(WINE_MEMSTORE)); + if (store) + { + CRYPT_InitStore(&store->hdr, hCryptProv, dwFlags, StoreTypeMem); + store->hdr.closeStore = CRYPT_MemCloseStore; + store->hdr.addCert = CRYPT_MemAddCert; + store->hdr.createCertRef = CRYPT_CreateCertRef; + store->hdr.enumCert = CRYPT_MemEnumCert; + store->hdr.deleteCert = CRYPT_MemDeleteCert; + store->hdr.freeCert = NULL; + InitializeCriticalSection(&store->cs); + list_init(&store->certs); + } + } + return (PWINECRYPT_CERTSTORE)store; +} + +static BOOL WINAPI CRYPT_CollectionAddCert(HCERTSTORE store, + PCCERT_CONTEXT pCert, DWORD dwAddDisposition) +{ + PWINE_COLLECTIONSTORE cs = (PWINE_COLLECTIONSTORE)store; + PWINE_STORE_LIST_ENTRY entry, next; + BOOL ret; + + TRACE("(%p, %p, %ld)\n", store, pCert, dwAddDisposition); + + ret = FALSE; + EnterCriticalSection(&cs->cs); + LIST_FOR_EACH_ENTRY_SAFE(entry, next, &cs->stores, WINE_STORE_LIST_ENTRY, + entry) + { + if (entry->dwUpdateFlags & CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG) + { + ret = entry->store->addCert(entry->store, pCert, dwAddDisposition); + break; + } + } + LeaveCriticalSection(&cs->cs); + SetLastError(ret ? ERROR_SUCCESS : HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED)); + return ret; +} + +static PWINE_CERT_CONTEXT_REF CRYPT_CollectionCreateCertRef( + PWINE_CERT_CONTEXT context, HCERTSTORE store) +{ + PWINE_COLLECTION_CERT_CONTEXT ret = HeapAlloc(GetProcessHeap(), 0, + sizeof(WINE_COLLECTION_CERT_CONTEXT)); + + if (ret) + { + /* Initialize to empty for now, just make sure the size is right */ + CRYPT_InitCertRef((PWINE_CERT_CONTEXT_REF)ret, context, store); + ret->entry = NULL; + ret->childContext = NULL; + } + return (PWINE_CERT_CONTEXT_REF)ret; +} + +static void WINAPI CRYPT_CollectionCloseStore(HCERTSTORE store, DWORD dwFlags) +{ + PWINE_COLLECTIONSTORE cs = (PWINE_COLLECTIONSTORE)store; + PWINE_STORE_LIST_ENTRY entry, next; + + TRACE("(%p, %08lx)\n", store, dwFlags); + + LIST_FOR_EACH_ENTRY_SAFE(entry, next, &cs->stores, WINE_STORE_LIST_ENTRY, + entry) + { + TRACE("closing %p\n", entry); + CertCloseStore((HCERTSTORE)entry->store, dwFlags); + HeapFree(GetProcessHeap(), 0, entry); + } + DeleteCriticalSection(&cs->cs); + HeapFree(GetProcessHeap(), 0, cs); +} + +/* Advances a collection enumeration by one cert, if possible, where advancing + * means: + * - calling the current store's enumeration function once, and returning + * the enumerated cert if one is returned + * - moving to the next store if the current store has no more items, and + * recursively calling itself to get the next item. + * Returns NULL if the collection contains no more items or on error. + * Assumes the collection store's lock is held. + */ +static PWINE_COLLECTION_CERT_CONTEXT CRYPT_CollectionAdvanceEnum( + PWINE_COLLECTIONSTORE store, PWINE_STORE_LIST_ENTRY storeEntry, + PWINE_COLLECTION_CERT_CONTEXT pPrev) +{ + PWINE_COLLECTION_CERT_CONTEXT ret; + PWINE_CERT_CONTEXT_REF child; + + TRACE("(%p, %p, %p)\n", store, storeEntry, pPrev); + + if (pPrev) + { + child = storeEntry->store->enumCert((HCERTSTORE)storeEntry->store, + pPrev->childContext); + if (child) + { + ret = pPrev; + memcpy(&ret->cert, child, sizeof(WINE_CERT_CONTEXT_REF)); + ret->cert.cert.hCertStore = (HCERTSTORE)store; + InterlockedIncrement(&ret->cert.context->ref); + ret->childContext = child; + } + else + { + struct list *storeNext = list_next(&store->stores, + &storeEntry->entry); + + pPrev->childContext = NULL; + CertFreeCertificateContext((PCCERT_CONTEXT)pPrev); + if (storeNext) + { + storeEntry = LIST_ENTRY(storeNext, WINE_STORE_LIST_ENTRY, + entry); + ret = CRYPT_CollectionAdvanceEnum(store, storeEntry, NULL); + } + else + { + SetLastError(CRYPT_E_NOT_FOUND); + ret = NULL; + } + } + } + else + { + child = storeEntry->store->enumCert((HCERTSTORE)storeEntry->store, + NULL); + if (child) + { + ret = (PWINE_COLLECTION_CERT_CONTEXT)CRYPT_CollectionCreateCertRef( + child->context, store); + if (ret) + { + ret->entry = storeEntry; + ret->childContext = child; + } + else + CertFreeCertificateContext((PCCERT_CONTEXT)child); + } + else + { + struct list *storeNext = list_next(&store->stores, + &storeEntry->entry); + + if (storeNext) + { + storeEntry = LIST_ENTRY(storeNext, WINE_STORE_LIST_ENTRY, + entry); + ret = CRYPT_CollectionAdvanceEnum(store, storeEntry, NULL); + } + else + { + SetLastError(CRYPT_E_NOT_FOUND); + ret = NULL; + } + } + } + TRACE("returning %p\n", ret); + return ret; +} + +static PWINE_CERT_CONTEXT_REF CRYPT_CollectionEnumCert( + PWINECRYPT_CERTSTORE store, PWINE_CERT_CONTEXT_REF pPrev) +{ + PWINE_COLLECTIONSTORE cs = (PWINE_COLLECTIONSTORE)store; + PWINE_COLLECTION_CERT_CONTEXT prevEntry = + (PWINE_COLLECTION_CERT_CONTEXT)pPrev, ret; + + TRACE("(%p, %p)\n", store, pPrev); + + if (prevEntry) + { + EnterCriticalSection(&cs->cs); + ret = CRYPT_CollectionAdvanceEnum(cs, prevEntry->entry, prevEntry); + LeaveCriticalSection(&cs->cs); + } + else + { + EnterCriticalSection(&cs->cs); + if (!list_empty(&cs->stores)) + { + PWINE_STORE_LIST_ENTRY storeEntry; + + storeEntry = LIST_ENTRY(cs->stores.next, WINE_STORE_LIST_ENTRY, + entry); + ret = CRYPT_CollectionAdvanceEnum(cs, storeEntry, prevEntry); + } + else + { + SetLastError(CRYPT_E_NOT_FOUND); + ret = NULL; + } + LeaveCriticalSection(&cs->cs); + } + TRACE("returning %p\n", ret); + return (PWINE_CERT_CONTEXT_REF)ret; +} + +static BOOL WINAPI CRYPT_CollectionDeleteCert(HCERTSTORE hCertStore, + PCCERT_CONTEXT pCertContext, DWORD dwFlags) +{ + PWINE_COLLECTION_CERT_CONTEXT context = + (PWINE_COLLECTION_CERT_CONTEXT)pCertContext; + BOOL ret; + + TRACE("(%p, %p, %08lx)\n", hCertStore, pCertContext, dwFlags); + + ret = CertDeleteCertificateFromStore((PCCERT_CONTEXT)context->childContext); + if (ret) + { + context->childContext = NULL; + CertFreeCertificateContext((PCCERT_CONTEXT)context); + } + return ret; +} + +static void CRYPT_CollectionFreeCert(PWINE_CERT_CONTEXT_REF ref) +{ + PWINE_COLLECTION_CERT_CONTEXT context = (PWINE_COLLECTION_CERT_CONTEXT)ref; + + TRACE("(%p)\n", ref); + + if (context->childContext) + CertFreeCertificateContext((PCCERT_CONTEXT)context->childContext); +} + +static WINECRYPT_CERTSTORE *CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara) +{ + PWINE_COLLECTIONSTORE store; + + if (dwFlags & CERT_STORE_DELETE_FLAG) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + store = NULL; + } + else + { + store = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(WINE_COLLECTIONSTORE)); + if (store) + { + CRYPT_InitStore(&store->hdr, hCryptProv, dwFlags, + StoreTypeCollection); + store->hdr.closeStore = CRYPT_CollectionCloseStore; + store->hdr.addCert = CRYPT_CollectionAddCert; + store->hdr.createCertRef = CRYPT_CollectionCreateCertRef; + store->hdr.enumCert = CRYPT_CollectionEnumCert; + store->hdr.deleteCert = CRYPT_CollectionDeleteCert; + store->hdr.freeCert = CRYPT_CollectionFreeCert; + InitializeCriticalSection(&store->cs); + list_init(&store->stores); + } + } + return (PWINECRYPT_CERTSTORE)store; +} + +static void WINAPI CRYPT_DummyCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) +{ + HeapFree(GetProcessHeap(), 0, (PWINECRYPT_CERTSTORE)hCertStore); +} + +static BOOL WINAPI CRYPT_DummyAddCert(HCERTSTORE store, PCCERT_CONTEXT pCert, + DWORD dwAddDisposition) +{ + return FALSE; +} + +static PWINE_CERT_CONTEXT_REF CRYPT_DummyEnumCert(PWINECRYPT_CERTSTORE store, + PWINE_CERT_CONTEXT_REF pPrev) +{ + return NULL; +} + +static BOOL WINAPI CRYPT_DummyDeleteCert(HCERTSTORE hCertStore, + PCCERT_CONTEXT pCertContext, DWORD dwFlags) +{ + return TRUE; +} + +static WINECRYPT_CERTSTORE *CRYPT_DummyOpenStore(HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara) +{ + PWINECRYPT_CERTSTORE store; + + TRACE("(%ld, %08lx, %p)\n", hCryptProv, dwFlags, pvPara); + + if (dwFlags & CERT_STORE_DELETE_FLAG) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + store = NULL; + } + else + { + store = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(WINECRYPT_CERTSTORE)); + if (store) + { + 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; + } + } + return (PWINECRYPT_CERTSTORE)store; +} + + +HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, + DWORD dwMsgAndCertEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, + const void* pvPara) +{ + WINECRYPT_CERTSTORE *hcs; + StoreOpenFunc openFunc = NULL; + + TRACE("(%s, %08lx, %08lx, %08lx, %p)\n", debugstr_a(lpszStoreProvider), + dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara); + + if (!HIWORD(lpszStoreProvider)) + { + switch (LOWORD(lpszStoreProvider)) + { + case (int)CERT_STORE_PROV_MEMORY: + openFunc = CRYPT_MemOpenStore; + break; + case (int)CERT_STORE_PROV_COLLECTION: + openFunc = CRYPT_CollectionOpenStore; + break; + case (int)CERT_STORE_PROV_REG: + case (int)CERT_STORE_PROV_SYSTEM_A: + case (int)CERT_STORE_PROV_SYSTEM_W: + openFunc = CRYPT_DummyOpenStore; + break; + default: + if (LOWORD(lpszStoreProvider)) + FIXME("unimplemented type %d\n", LOWORD(lpszStoreProvider)); + } + } + else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_MEMORY)) + openFunc = CRYPT_MemOpenStore; + else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM)) + openFunc = CRYPT_DummyOpenStore; + else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_COLLECTION)) + openFunc = CRYPT_CollectionOpenStore; + else + { + FIXME("unimplemented type %s\n", lpszStoreProvider); + openFunc = NULL; + } + + if (!openFunc) + { + /* FIXME: need to look for an installed provider for this type */ + SetLastError(ERROR_FILE_NOT_FOUND); + hcs = NULL; + } + else + hcs = openFunc(hCryptProv, dwFlags, pvPara); + return (HCERTSTORE)hcs; } HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV hProv, @@ -88,12 +839,6 @@ CERT_SYSTEM_STORE_USERS, szSubSystemProtocol ); } -PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrev) -{ - FIXME("(%p,%p)\n", hCertStore, pPrev); - return NULL; -} - BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, DWORD dwSaveAs, DWORD dwSaveTo, void* pvSaveToPara, DWORD dwFlags) { @@ -110,6 +855,7 @@ TRACE("%08lx %p %08lx\n", dwCertEncodingType, pbCrlEncoded, cbCrlEncoded); + /* FIXME: semi-stub, need to use CryptDecodeObjectEx to decode the CRL. */ pcrl = HeapAlloc( GetProcessHeap(), 0, sizeof (CRL_CONTEXT) ); if( !pcrl ) return NULL; @@ -130,6 +876,570 @@ return pcrl; } +/* Decodes the encoded certificate and creates the certificate context for it. + * The reference count is initially zero, so you must create a reference to it + * to avoid leaking memory. + */ +static PWINE_CERT_CONTEXT CRYPT_CreateCertificateContext( + DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded) +{ + PWINE_CERT_CONTEXT cert = NULL; + BOOL ret; + 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); + if (ret) + { + BYTE *data = NULL; + + cert = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_CERT_CONTEXT)); + if (!cert) + goto end; + data = HeapAlloc(GetProcessHeap(), 0, cbCertEncoded); + if (!data) + { + HeapFree(GetProcessHeap(), 0, cert); + cert = NULL; + goto end; + } + memcpy(data, pbCertEncoded, cbCertEncoded); + cert->cert.dwCertEncodingType = dwCertEncodingType; + cert->cert.pbCertEncoded = data; + cert->cert.cbCertEncoded = cbCertEncoded; + cert->cert.pCertInfo = certInfo; + cert->cert.hCertStore = 0; + cert->ref = 0; + InitializeCriticalSection(&cert->cs); + list_init(&cert->extendedProperties); + } + +end: + return cert; +} + +static void CRYPT_FreeCert(PWINE_CERT_CONTEXT context) +{ + PWINE_CERT_PROPERTY prop, next; + + 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) + { + list_remove(&prop->entry); + HeapFree(GetProcessHeap(), 0, prop->pbData); + HeapFree(GetProcessHeap(), 0, prop); + } +} + +PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType, + const BYTE *pbCertEncoded, DWORD cbCertEncoded) +{ + PWINE_CERT_CONTEXT cert; + PWINE_CERT_CONTEXT_REF ret = NULL; + + TRACE("(%08lx, %p, %ld)\n", dwCertEncodingType, pbCertEncoded, + cbCertEncoded); + + cert = CRYPT_CreateCertificateContext(dwCertEncodingType, pbCertEncoded, + cbCertEncoded); + if (cert) + ret = CRYPT_CreateCertRef(cert, 0); + return (PCCERT_CONTEXT)ret; +} + +/* Since the properties are stored in a list, this is a tad inefficient + * (O(n^2)) since I have to find the previous position every time. + */ +DWORD WINAPI CertEnumCertificateContextProperties(PCCERT_CONTEXT pCertContext, + DWORD dwPropId) +{ + PWINE_CERT_CONTEXT_REF ref = (PWINE_CERT_CONTEXT_REF)pCertContext; + DWORD ret; + + TRACE("(%p, %ld)\n", pCertContext, dwPropId); + + EnterCriticalSection(&ref->context->cs); + if (dwPropId) + { + PWINE_CERT_PROPERTY cursor = NULL; + + LIST_FOR_EACH_ENTRY(cursor, &ref->context->extendedProperties, + WINE_CERT_PROPERTY, entry) + { + if (cursor->hdr.propID == dwPropId) + break; + } + if (cursor) + { + if (cursor->entry.next != &ref->context->extendedProperties) + ret = LIST_ENTRY(cursor->entry.next, WINE_CERT_PROPERTY, + entry)->hdr.propID; + else + ret = 0; + } + else + ret = 0; + } + else if (!list_empty(&ref->context->extendedProperties)) + ret = LIST_ENTRY(ref->context->extendedProperties.next, + WINE_CERT_PROPERTY, entry)->hdr.propID; + else + ret = 0; + LeaveCriticalSection(&ref->context->cs); + return ret; +} + +static BOOL WINAPI CRYPT_GetCertificateContextProperty( + PWINE_CERT_CONTEXT context, DWORD dwPropId, void *pvData, DWORD *pcbData) +{ + PWINE_CERT_PROPERTY prop; + BOOL ret, found; + + TRACE("(%p, %ld, %p, %p)\n", context, dwPropId, pvData, pcbData); + + EnterCriticalSection(&context->cs); + ret = FALSE; + found = FALSE; + LIST_FOR_EACH_ENTRY(prop, &context->extendedProperties, + WINE_CERT_PROPERTY, entry) + { + if (prop->hdr.propID == dwPropId) + { + if (!pvData) + { + *pcbData = prop->hdr.cb; + ret = TRUE; + } + else if (*pcbData < prop->hdr.cb) + { + SetLastError(ERROR_MORE_DATA); + *pcbData = prop->hdr.cb; + } + else + { + memcpy(pvData, prop->pbData, prop->hdr.cb); + *pcbData = prop->hdr.cb; + ret = TRUE; + } + found = TRUE; + } + break; + } + if (!found) + { + /* Implicit properties */ + switch (dwPropId) + { + case CERT_SHA1_HASH_PROP_ID: + ret = CryptHashCertificate(0, CALG_SHA1, 0, + context->cert.pbCertEncoded, context->cert.cbCertEncoded, pvData, + pcbData); + if (ret) + { + CRYPT_DATA_BLOB blob = { *pcbData, pvData }; + + ret = CRYPT_SetCertificateContextProperty(context, dwPropId, + 0, &blob); + } + break; + case CERT_KEY_PROV_INFO_PROP_ID: + case CERT_MD5_HASH_PROP_ID: + case CERT_SIGNATURE_HASH_PROP_ID: + case CERT_KEY_IDENTIFIER_PROP_ID: + case CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID: + case CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID: + case CERT_SUBJECT_NAME_MD5_HASH_PROP_ID: + FIXME("implicit property %ld\n", dwPropId); + break; + } + } + LeaveCriticalSection(&context->cs); + TRACE("returning %d\n", ret); + return ret; +} + +BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, + DWORD dwPropId, void *pvData, DWORD *pcbData) +{ + PWINE_CERT_CONTEXT_REF ref = (PWINE_CERT_CONTEXT_REF)pCertContext; + BOOL ret; + + TRACE("(%p, %ld, %p, %p)\n", pCertContext, dwPropId, pvData, pcbData); + + /* Special cases for invalid/special prop IDs. + */ + switch (dwPropId) + { + case 0: + case CERT_CERT_PROP_ID: + case CERT_CRL_PROP_ID: + case CERT_CTL_PROP_ID: + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return FALSE; + case CERT_ACCESS_STATE_PROP_ID: + if (!pvData) + { + *pcbData = sizeof(DWORD); + return TRUE; + } + else if (*pcbData < sizeof(DWORD)) + { + SetLastError(ERROR_MORE_DATA); + *pcbData = sizeof(DWORD); + return FALSE; + } + else + { + DWORD state = 0; + + if (pCertContext->hCertStore) + { + PWINECRYPT_CERTSTORE store = + (PWINECRYPT_CERTSTORE)pCertContext->hCertStore; + + /* Take advantage of knowledge of the stores to answer the + * access state question + */ + if (store->type != StoreTypeReg || + !(store->dwOpenFlags & CERT_STORE_READONLY_FLAG)) + state |= CERT_ACCESS_STATE_WRITE_PERSIST_FLAG; + } + *(DWORD *)pvData = state; + return TRUE; + } + } + + ret = CRYPT_GetCertificateContextProperty(ref->context, dwPropId, + pvData, pcbData); + TRACE("returning %d\n", ret); + return ret; +} + +/* Copies cbData bytes from pbData to the context's property with ID + * dwPropId. + */ +static BOOL CRYPT_SaveCertificateContextProperty(PWINE_CERT_CONTEXT context, + DWORD dwPropId, const BYTE *pbData, size_t cbData) +{ + BOOL ret = FALSE; + LPBYTE data; + + if (cbData) + { + data = HeapAlloc(GetProcessHeap(), 0, cbData); + if (data) + memcpy(data, pbData, cbData); + } + else + data = NULL; + if (!cbData || data) + { + PWINE_CERT_PROPERTY prop; + + EnterCriticalSection(&context->cs); + LIST_FOR_EACH_ENTRY(prop, &context->extendedProperties, + WINE_CERT_PROPERTY, entry) + { + if (prop->hdr.propID == dwPropId) + break; + } + if (prop && prop->entry.next != &context->extendedProperties) + { + HeapFree(GetProcessHeap(), 0, prop->pbData); + prop->hdr.cb = cbData; + prop->pbData = cbData ? data : NULL; + ret = TRUE; + } + else + { + prop = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_CERT_PROPERTY)); + if (prop) + { + prop->hdr.propID = dwPropId; + prop->hdr.unknown = 1; + prop->hdr.cb = cbData; + list_init(&prop->entry); + prop->pbData = cbData ? data : NULL; + list_add_tail(&context->extendedProperties, &prop->entry); + ret = TRUE; + } + else + HeapFree(GetProcessHeap(), 0, data); + } + LeaveCriticalSection(&context->cs); + } + return ret; +} + +static BOOL WINAPI CRYPT_SetCertificateContextProperty( + PWINE_CERT_CONTEXT context, DWORD dwPropId, DWORD dwFlags, const void *pvData) +{ + BOOL ret = FALSE; + + TRACE("(%p, %ld, %08lx, %p)\n", context, dwPropId, dwFlags, pvData); + + if (!pvData) + { + PWINE_CERT_PROPERTY prop, next; + + EnterCriticalSection(&context->cs); + LIST_FOR_EACH_ENTRY_SAFE(prop, next, &context->extendedProperties, + WINE_CERT_PROPERTY, entry) + { + if (prop->hdr.propID == dwPropId) + { + list_remove(&prop->entry); + HeapFree(GetProcessHeap(), 0, prop->pbData); + HeapFree(GetProcessHeap(), 0, prop); + } + } + LeaveCriticalSection(&context->cs); + ret = TRUE; + } + else + { + switch (dwPropId) + { + 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: + { + PCRYPT_DATA_BLOB blob = (PCRYPT_DATA_BLOB)pvData; + + ret = CRYPT_SaveCertificateContextProperty(context, dwPropId, + blob->pbData, blob->cbData); + break; + } + case CERT_DATE_STAMP_PROP_ID: + ret = CRYPT_SaveCertificateContextProperty(context, dwPropId, + pvData, sizeof(FILETIME)); + break; + default: + FIXME("%ld: stub\n", dwPropId); + } + } + TRACE("returning %d\n", ret); + return ret; +} + +BOOL WINAPI CertSetCertificateContextProperty(PCCERT_CONTEXT pCertContext, + DWORD dwPropId, DWORD dwFlags, const void *pvData) +{ + PWINE_CERT_CONTEXT_REF ref = (PWINE_CERT_CONTEXT_REF)pCertContext; + BOOL ret; + + TRACE("(%p, %ld, %08lx, %p)\n", pCertContext, dwPropId, dwFlags, pvData); + + /* Handle special cases for "read-only"/invalid prop IDs. Windows just + * crashes on most of these, I'll be safer. + */ + switch (dwPropId) + { + case 0: + case CERT_ACCESS_STATE_PROP_ID: + case CERT_CERT_PROP_ID: + case CERT_CRL_PROP_ID: + case CERT_CTL_PROP_ID: + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return FALSE; + } + ret = CRYPT_SetCertificateContextProperty(ref->context, dwPropId, + dwFlags, pvData); + TRACE("returning %d\n", ret); + return ret; +} + +/* Only the reference portion of the context is duplicated. The returned + * context has the cert store set to 0, to prevent the store's certificate free + * function from getting called on partial data. + * FIXME: is this okay? Needs a test. + */ +PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext( + PCCERT_CONTEXT pCertContext) +{ + PWINE_CERT_CONTEXT_REF ref = (PWINE_CERT_CONTEXT_REF)pCertContext, ret; + + TRACE("(%p)\n", pCertContext); + if (ref) + { + ret = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_CERT_CONTEXT_REF)); + if (ret) + { + memcpy(ret, ref, sizeof(*ret)); + ret->cert.hCertStore = 0; + InterlockedIncrement(&ret->context->ref); + } + } + else + ret = NULL; + return (PCCERT_CONTEXT)ret; +} + +BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, + PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, + PCCERT_CONTEXT *ppStoreContext) +{ + PWINECRYPT_CERTSTORE store = (PWINECRYPT_CERTSTORE)hCertStore; + PWINE_CERT_CONTEXT_REF ref = (PWINE_CERT_CONTEXT_REF)pCertContext; + PWINE_CERT_CONTEXT cert; + BOOL ret; + + TRACE("(%p, %p, %08lx, %p)\n", hCertStore, pCertContext, + dwAddDisposition, ppStoreContext); + + /* FIXME: some tests needed to verify return codes */ + if (!store) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if (store->dwMagic != WINE_CRYPTCERTSTORE_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + cert = CRYPT_CreateCertificateContext(ref->context->cert.dwCertEncodingType, + ref->context->cert.pbCertEncoded, ref->context->cert.cbCertEncoded); + if (cert) + { + PWINE_CERT_PROPERTY prop; + + ret = TRUE; + EnterCriticalSection(&ref->context->cs); + LIST_FOR_EACH_ENTRY(prop, &ref->context->extendedProperties, + WINE_CERT_PROPERTY, entry) + { + ret = CRYPT_SaveCertificateContextProperty(cert, prop->hdr.propID, + prop->pbData, prop->hdr.cb); + if (!ret) + break; + } + LeaveCriticalSection(&ref->context->cs); + if (ret) + { + ret = store->addCert(store, (PCCERT_CONTEXT)cert, dwAddDisposition); + if (ret && ppStoreContext) + *ppStoreContext = (PCCERT_CONTEXT)store->createCertRef(cert, + hCertStore); + } + if (!ret) + CRYPT_FreeCert(cert); + } + else + ret = FALSE; + return ret; +} + +BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore, + DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded, + DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext) +{ + WINECRYPT_CERTSTORE *hcs = (WINECRYPT_CERTSTORE *)hCertStore; + BOOL ret; + + TRACE("(%p, %08lx, %p, %ld, %08lx, %p)\n", hCertStore, dwCertEncodingType, + pbCertEncoded, cbCertEncoded, dwAddDisposition, ppCertContext); + + if (!hcs) + ret = FALSE; + else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC) + ret = FALSE; + else + { + PWINE_CERT_CONTEXT cert = CRYPT_CreateCertificateContext( + dwCertEncodingType, pbCertEncoded, cbCertEncoded); + + if (cert) + { + ret = hcs->addCert(hcs, (PCCERT_CONTEXT)cert, dwAddDisposition); + if (ret && ppCertContext) + *ppCertContext = (PCCERT_CONTEXT)hcs->createCertRef(cert, + hCertStore); + if (!ret) + CRYPT_FreeCert(cert); + } + else + ret = FALSE; + } + return ret; +} + +PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, + PCCERT_CONTEXT pPrev) +{ + WINECRYPT_CERTSTORE *hcs = (WINECRYPT_CERTSTORE *)hCertStore; + PWINE_CERT_CONTEXT_REF prev = (PWINE_CERT_CONTEXT_REF)pPrev; + PCCERT_CONTEXT ret; + + TRACE("(%p, %p)\n", hCertStore, pPrev); + if (!hCertStore) + ret = NULL; + else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC) + ret = NULL; + else + ret = (PCCERT_CONTEXT)hcs->enumCert(hcs, prev); + return ret; +} + +BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext) +{ + BOOL ret; + + TRACE("(%p)\n", pCertContext); + + if (!pCertContext) + ret = TRUE; + else if (!pCertContext->hCertStore) + ret = TRUE; + else + { + PWINECRYPT_CERTSTORE hcs = + (PWINECRYPT_CERTSTORE)pCertContext->hCertStore; + + if (!hcs) + ret = TRUE; + else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC) + ret = FALSE; + else + ret = hcs->deleteCert(hcs, pCertContext, 0); + } + return ret; +} + +BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore, + DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded, + DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext) +{ + FIXME("(%p, %08lx, %p, %ld, %08lx, %p): stub\n", hCertStore, + dwCertEncodingType, pbCrlEncoded, cbCrlEncoded, dwAddDisposition, + ppCrlContext); + return FALSE; +} + BOOL WINAPI CertAddCRLContextToStore( HCERTSTORE hCertStore, PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition, PCCRL_CONTEXT* ppStoreContext ) @@ -146,26 +1456,237 @@ return TRUE; } -BOOL WINAPI CertCloseStore( HCERTSTORE hCertStore, DWORD dwFlags ) +BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext) +{ + FIXME("(%p): stub\n", pCrlContext); + return TRUE; +} + +PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore, + PCCRL_CONTEXT pPrev) +{ + FIXME("(%p, %p): stub\n", hCertStore, pPrev); + return NULL; +} + +PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwCertEncodingType, + const BYTE* pbCtlEncoded, DWORD cbCtlEncoded) +{ + FIXME("(%08lx, %p, %08lx): stub\n", dwCertEncodingType, pbCtlEncoded, + cbCtlEncoded); + return NULL; +} + +BOOL WINAPI CertAddEncodedCTLToStore(HCERTSTORE hCertStore, + DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded, + DWORD dwAddDisposition, PCCTL_CONTEXT *ppCtlContext) +{ + FIXME("(%p, %08lx, %p, %ld, %08lx, %p): stub\n", hCertStore, + dwMsgAndCertEncodingType, pbCtlEncoded, cbCtlEncoded, dwAddDisposition, + ppCtlContext); + return FALSE; +} + +BOOL WINAPI CertAddCTLContextToStore(HCERTSTORE hCertStore, + PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition, + PCCTL_CONTEXT* ppStoreContext) +{ + FIXME("(%p, %p, %08lx, %p): stub\n", hCertStore, pCtlContext, + dwAddDisposition, ppStoreContext); + return TRUE; +} + +BOOL WINAPI CertFreeCTLContext(PCCTL_CONTEXT pCtlContext) +{ + FIXME("(%p): stub\n", pCtlContext ); + return TRUE; +} + +BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext) +{ + FIXME("(%p): stub\n", pCtlContext); + return TRUE; +} + +PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore, + PCCTL_CONTEXT pPrev) +{ + FIXME("(%p, %p): stub\n", hCertStore, pPrev); + return NULL; +} + + +BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) { WINECRYPT_CERTSTORE *hcs = (WINECRYPT_CERTSTORE *) hCertStore; - FIXME("%p %08lx\n", hCertStore, dwFlags ); + TRACE("(%p, %08lx)\n", hCertStore, dwFlags); + if( ! hCertStore ) - return FALSE; + return TRUE; if ( hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC ) return FALSE; - hcs->dwMagic = 0; - HeapFree( GetProcessHeap(), 0, hCertStore ); + if (InterlockedDecrement(&hcs->ref) == 0) + { + TRACE("freeing %p\n", hcs); + hcs->dwMagic = 0; + if (!(hcs->dwOpenFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG)) + CryptReleaseContext(hcs->cryptProv, 0); + hcs->closeStore(hcs, dwFlags); + } + else + TRACE("%p's ref count is %ld\n", hcs, hcs->ref); + return TRUE; +} +BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags, + DWORD dwCtrlType, void const *pvCtrlPara) +{ + FIXME("(%p, %08lx, %ld, %p): stub\n", hCertStore, dwFlags, dwCtrlType, + pvCtrlPara); return TRUE; } -BOOL WINAPI CertFreeCertificateContext( PCCERT_CONTEXT pCertContext ) +BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext, + DWORD dwPropId, void *pvData, DWORD *pcbData) +{ + FIXME("(%p, %ld, %p, %p): stub\n", pCRLContext, dwPropId, pvData, pcbData); + return FALSE; +} + +BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext, + DWORD dwPropId, DWORD dwFlags, const void *pvData) +{ + FIXME("(%p, %ld, %08lx, %p): stub\n", pCRLContext, dwPropId, dwFlags, + pvData); + return FALSE; +} + +BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext, + DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement) +{ + FIXME("(%p, %08lx, %p, %p): stub\n", pCrlContext, dwFlags, pbElement, + pcbElement); + return FALSE; +} + +BOOL WINAPI CertGetCTLContextProperty(PCCTL_CONTEXT pCTLContext, + DWORD dwPropId, void *pvData, DWORD *pcbData) +{ + FIXME("(%p, %ld, %p, %p): stub\n", pCTLContext, dwPropId, pvData, pcbData); + return FALSE; +} + +BOOL WINAPI CertSetCTLContextProperty(PCCTL_CONTEXT pCTLContext, + DWORD dwPropId, DWORD dwFlags, const void *pvData) +{ + FIXME("(%p, %ld, %08lx, %p): stub\n", pCTLContext, dwPropId, dwFlags, + pvData); + return FALSE; +} + +BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext, + DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement) +{ + FIXME("(%p, %08lx, %p, %p): stub\n", pCtlContext, dwFlags, pbElement, + pcbElement); + return FALSE; +} + +BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext, + DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement) +{ + BOOL ret; + + TRACE("(%p, %08lx, %p, %p)\n", pCertContext, dwFlags, pbElement, + pcbElement); + + if (pCertContext) + { + PWINE_CERT_CONTEXT_REF ref = (PWINE_CERT_CONTEXT_REF)pCertContext; + DWORD bytesNeeded = sizeof(WINE_CERT_PROP_HEADER) + + pCertContext->cbCertEncoded; + PWINE_CERT_PROPERTY prop; + + EnterCriticalSection(&ref->context->cs); + LIST_FOR_EACH_ENTRY(prop, &ref->context->extendedProperties, + WINE_CERT_PROPERTY, entry) + bytesNeeded += sizeof(WINE_CERT_PROP_HEADER) + prop->hdr.cb; + if (!pbElement) + { + *pcbElement = bytesNeeded; + ret = TRUE; + } + else if (*pcbElement < bytesNeeded) + { + *pcbElement = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + PWINE_CERT_PROP_HEADER hdr; + + LIST_FOR_EACH_ENTRY(prop, &ref->context->extendedProperties, + WINE_CERT_PROPERTY, entry) + { + memcpy(pbElement, &prop->hdr, sizeof(WINE_CERT_PROP_HEADER)); + pbElement += sizeof(WINE_CERT_PROP_HEADER); + if (prop->hdr.cb) + { + memcpy(pbElement, prop->pbData, prop->hdr.cb); + pbElement += prop->hdr.cb; + } + } + hdr = (PWINE_CERT_PROP_HEADER)pbElement; + hdr->propID = CERT_CERT_PROP_ID; + hdr->unknown = 1; + hdr->cb = pCertContext->cbCertEncoded; + memcpy(pbElement + sizeof(WINE_CERT_PROP_HEADER), + pCertContext->pbCertEncoded, pCertContext->cbCertEncoded); + ret = TRUE; + } + LeaveCriticalSection(&ref->context->cs); + } + else + ret = FALSE; + return ret; +} + +BOOL WINAPI CertAddSerializedElementToStore(HCERTSTORE hCertStore, + const BYTE *pbElement, DWORD cbElement, DWORD dwAddDisposition, DWORD dwFlags, + DWORD dwContextTypeFlags, DWORD *pdwContentType, const void **ppvContext) { - FIXME("%p stub\n", pCertContext); + FIXME("(%p, %p, %ld, %08lx, %08lx, %08lx, %p, %p): stub\n", hCertStore, + pbElement, cbElement, dwAddDisposition, dwFlags, dwContextTypeFlags, + pdwContentType, ppvContext); + return FALSE; +} + +BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext) +{ + TRACE("(%p)\n", pCertContext); + + if (pCertContext) + { + PWINE_CERT_CONTEXT_REF ref = (PWINE_CERT_CONTEXT_REF)pCertContext; + PWINECRYPT_CERTSTORE store = (PWINECRYPT_CERTSTORE)ref->cert.hCertStore; + + if (InterlockedDecrement(&ref->context->ref) == 0) + { + TRACE("freeing %p\n", ref->context); + CRYPT_FreeCert(ref->context); + } + else + 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); + HeapFree(GetProcessHeap(), 0, ref); + } return TRUE; } @@ -179,6 +1700,112 @@ return NULL; } +BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore, + HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority) +{ + PWINE_COLLECTIONSTORE collection = (PWINE_COLLECTIONSTORE)hCollectionStore; + WINECRYPT_CERTSTORE *sibling = (WINECRYPT_CERTSTORE *)hSiblingStore; + PWINE_STORE_LIST_ENTRY entry; + BOOL ret; + + TRACE("(%p, %p, %08lx, %ld)\n", hCollectionStore, hSiblingStore, + dwUpdateFlags, dwPriority); + + if (!collection || !sibling) + return TRUE; + if (collection->hdr.dwMagic != WINE_CRYPTCERTSTORE_MAGIC) + { + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return FALSE; + } + if (collection->hdr.type != StoreTypeCollection) + { + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return FALSE; + } + if (sibling->dwMagic != WINE_CRYPTCERTSTORE_MAGIC) + { + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return FALSE; + } + + entry = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_STORE_LIST_ENTRY)); + if (entry) + { + InterlockedIncrement(&sibling->ref); + TRACE("sibling %p's ref count is %ld\n", sibling, sibling->ref); + entry->store = sibling; + entry->dwUpdateFlags = dwUpdateFlags; + entry->dwPriority = dwPriority; + list_init(&entry->entry); + TRACE("%p: adding %p, priority %ld\n", collection, entry, dwPriority); + EnterCriticalSection(&collection->cs); + if (dwPriority) + { + PWINE_STORE_LIST_ENTRY cursor; + BOOL added = FALSE; + + LIST_FOR_EACH_ENTRY(cursor, &collection->stores, + WINE_STORE_LIST_ENTRY, entry) + { + if (cursor->dwPriority < dwPriority) + { + list_add_before(&cursor->entry, &entry->entry); + added = TRUE; + break; + } + } + if (!added) + list_add_tail(&collection->stores, &entry->entry); + } + else + list_add_tail(&collection->stores, &entry->entry); + LeaveCriticalSection(&collection->cs); + ret = TRUE; + } + else + ret = FALSE; + return ret; +} + +void WINAPI CertRemoveStoreFromCollection(HCERTSTORE hCollectionStore, + HCERTSTORE hSiblingStore) +{ + PWINE_COLLECTIONSTORE collection = (PWINE_COLLECTIONSTORE)hCollectionStore; + WINECRYPT_CERTSTORE *sibling = (WINECRYPT_CERTSTORE *)hSiblingStore; + PWINE_STORE_LIST_ENTRY store, next; + + TRACE("(%p, %p)\n", hCollectionStore, hSiblingStore); + + if (!collection || !sibling) + return; + if (collection->hdr.dwMagic != WINE_CRYPTCERTSTORE_MAGIC) + { + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return; + } + if (collection->hdr.type != StoreTypeCollection) + return; + if (sibling->dwMagic != WINE_CRYPTCERTSTORE_MAGIC) + { + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return; + } + EnterCriticalSection(&collection->cs); + LIST_FOR_EACH_ENTRY_SAFE(store, next, &collection->stores, + WINE_STORE_LIST_ENTRY, entry) + { + if (store->store == sibling) + { + list_remove(&store->entry); + CertCloseStore(store->store, 0); + HeapFree(GetProcessHeap(), 0, store); + break; + } + } + LeaveCriticalSection(&collection->cs); +} + PCRYPT_ATTRIBUTE WINAPI CertFindAttribute(LPCSTR pszObjId, DWORD cAttr, CRYPT_ATTRIBUTE rgAttr[]) { @@ -267,3 +1894,32 @@ } return ret; } + +BOOL WINAPI CryptHashCertificate(HCRYPTPROV hCryptProv, ALG_ID Algid, + DWORD dwFlags, const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash, + DWORD *pcbComputedHash) +{ + BOOL ret = TRUE; + HCRYPTHASH hHash = 0; + + TRACE("(%ld, %d, %08lx, %p, %ld, %p, %p)\n", hCryptProv, Algid, dwFlags, + pbEncoded, cbEncoded, pbComputedHash, pcbComputedHash); + + if (!hCryptProv) + hCryptProv = CRYPT_GetDefaultProvider(); + if (!Algid) + Algid = CALG_SHA1; + if (ret) + { + ret = CryptCreateHash(hCryptProv, Algid, 0, 0, &hHash); + if (ret) + { + ret = CryptHashData(hHash, pbEncoded, cbEncoded, 0); + if (ret) + ret = CryptGetHashParam(hHash, HP_HASHVAL, pbComputedHash, + pcbComputedHash, 0); + CryptDestroyHash(hHash); + } + } + return ret; +} diff -urN wine-20050725/dlls/crypt32/crypt32.spec wine-20050830/dlls/crypt32/crypt32.spec --- wine-20050725/dlls/crypt32/crypt32.spec 2005-07-07 22:27:55.000000000 +0200 +++ wine-20050830/dlls/crypt32/crypt32.spec 2005-08-26 10:46:48.000000000 +0200 @@ -1,36 +1,37 @@ @ stdcall CertAddCRLContextToStore(long ptr long ptr) -@ stub CertAddCTLContextToStore -@ stub CertAddCertificateContextToStore -@ stub CertAddEncodedCRLToStore -@ stub CertAddEncodedCTLToStore -@ stub CertAddEncodedCertificateToStore +@ stdcall CertAddCTLContextToStore(long ptr long ptr) +@ stdcall CertAddCertificateContextToStore(long ptr long ptr) +@ stdcall CertAddEncodedCRLToStore(long long ptr long long ptr) +@ stdcall CertAddEncodedCTLToStore(long long ptr long long ptr) +@ stdcall CertAddEncodedCertificateToStore(long long ptr long long ptr) @ stub CertAddEncodedCertificateToSystemStoreA @ stub CertAddEncodedCertificateToSystemStoreW @ stub CertAddEnhancedKeyUsageIdentifier -@ stub CertAddSerializedElementToStore -@ stub CertAddStoreToCollection +@ stdcall CertAddSerializedElementToStore(ptr ptr long long long long ptr ptr) +@ stdcall CertAddStoreToCollection(ptr ptr long long) @ stdcall CertAlgIdToOID(long) @ stdcall CertCloseStore(ptr long) @ stub CertCompareCertificate @ stub CertCompareCertificateName @ stub CertCompareIntegerBlob @ stub CertComparePublicKeyInfo -@ stub CertControlStore +@ stdcall CertControlStore(long long long ptr) @ stdcall CertCreateCRLContext(long ptr long) -@ stub CertCreateCTLContext +@ stdcall CertCreateCTLContext(long ptr long) @ stub CertCreateCertificateChainEngine -@ stub CertCreateCertificateContext -@ stub CertDeleteCRLFromStore -@ stub CertDeleteCTLFromStore -@ stub CertDeleteCertificateFromStore +@ stdcall CertCreateCertificateContext(long ptr long) +@ stdcall CertDeleteCRLFromStore(ptr) +@ stdcall CertDeleteCTLFromStore(ptr) +@ stdcall CertDeleteCertificateFromStore(ptr) @ stub CertDuplicateCRLContext @ stub CertDuplicateCTLContext -@ stub CertDuplicateCertificateContext +@ stdcall CertDuplicateCertificateContext(ptr) @ stub CertDuplicateStore @ stub CertEnumCRLContextProperties +@ stdcall CertEnumCRLsInStore(ptr ptr) @ stub CertEnumCTLContextProperties -@ stub CertEnumCTLsInStore -@ stub CertEnumCertificateContextProperties +@ stdcall CertEnumCTLsInStore(ptr ptr) +@ stdcall CertEnumCertificateContextProperties(ptr long) @ stdcall CertEnumCertificatesInStore(long ptr) @ stdcall CertFindAttribute(str long ptr) @ stub CertFindCTLInStore @@ -39,15 +40,15 @@ @ stdcall CertFindRDNAttr(str ptr) @ stub CertFindSubjectInCTL @ stdcall CertFreeCRLContext(ptr) -@ stub CertFreeCTLContext +@ stdcall CertFreeCTLContext(ptr) @ stub CertFreeCertificateChain @ stub CertFreeCertificateChainEngine @ stdcall CertFreeCertificateContext(ptr) -@ stub CertGetCRLContextProperty +@ stdcall CertGetCRLContextProperty(ptr long ptr ptr) @ stub CertGetCRLFromStore -@ stub CertGetCTLContextProperty +@ stdcall CertGetCTLContextProperty(ptr long ptr ptr) @ stub CertGetCertificateChain -@ stub CertGetCertificateContextProperty +@ stdcall CertGetCertificateContextProperty(ptr long ptr ptr) @ stub CertGetEnhancedKeyUsage @ stub CertGetIntendedKeyUsage @ stub CertGetIssuerCertificateFromStore @@ -63,13 +64,14 @@ @ stub CertRDNValueToStrA @ stub CertRDNValueToStrW @ stub CertRemoveEnhancedKeyUsageIdentifier +@ stdcall CertRemoveStoreFromCollection(long long) @ stdcall CertSaveStore(long long long long ptr long) -@ stub CertSerializeCRLStoreElement -@ stub CertSerializeCTLStoreElement -@ stub CertSerializeCertificateStoreElement -@ stub CertSetCRLContextProperty -@ stub CertSetCTLContextProperty -@ stub CertSetCertificateContextProperty +@ stdcall CertSerializeCRLStoreElement(ptr long ptr ptr) +@ stdcall CertSerializeCTLStoreElement(ptr long ptr ptr) +@ stdcall CertSerializeCertificateStoreElement(ptr long ptr ptr) +@ stdcall CertSetCRLContextProperty(ptr long long ptr) +@ stdcall CertSetCTLContextProperty(ptr long long ptr) +@ stdcall CertSetCertificateContextProperty(ptr long long ptr) @ stub CertSetEnhancedKeyUsage @ stub CertStrToNameA @ stub CertStrToNameW @@ -108,7 +110,7 @@ @ stub CryptGetMessageSignerCount @ stub CryptGetOIDFunctionAddress @ stdcall CryptGetOIDFunctionValue(long str str wstr ptr ptr ptr) -@ stub CryptHashCertificate +@ stdcall CryptHashCertificate(long long long ptr long ptr ptr) @ stub CryptHashMessage @ stub CryptHashPublicKeyInfo @ stub CryptHashToBeSigned diff -urN wine-20050725/dlls/crypt32/crypt32_private.h wine-20050830/dlls/crypt32/crypt32_private.h --- wine-20050725/dlls/crypt32/crypt32_private.h 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/crypt32/crypt32_private.h 2005-08-25 11:52:00.000000000 +0200 @@ -0,0 +1,27 @@ +/* + * Copyright 2005 Juan Lang + * + * 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 __CRYPT32_PRIVATE_H__ +#define __CRYPT32_PRIVATE_H__ + +/* Returns a handle to the default crypto provider; loads it if necessary. + * Returns NULL on failure. + */ +HCRYPTPROV CRYPT_GetDefaultProvider(void); + +#endif diff -urN wine-20050725/dlls/crypt32/encode.c wine-20050830/dlls/crypt32/encode.c --- wine-20050725/dlls/crypt32/encode.c 2005-07-14 12:14:22.000000000 +0200 +++ wine-20050830/dlls/crypt32/encode.c 2005-08-29 16:12:44.000000000 +0200 @@ -35,6 +35,9 @@ #include #include #include + +#define NONAMELESSUNION + #include "windef.h" #include "winbase.h" #include "excpt.h" @@ -59,6 +62,9 @@ #define ASN_UTCTIME (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x17) #define ASN_GENERALTIME (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x18) +#define ASN_FLAGS_MASK 0xf0 +#define ASN_TYPE_MASK 0x0f + WINE_DEFAULT_DEBUG_CHANNEL(crypt); static const WCHAR szDllName[] = { 'D','l','l',0 }; @@ -119,7 +125,11 @@ static BOOL WINAPI CRYPT_AsnDecodePubKeyInfo(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo); -static BOOL WINAPI CRYPT_AsnDecodeExtensions(DWORD dwCertEncodingType, +/* Like CRYPT_AsnDecodeExtensions, except assumes rgExtension is set ahead of + * time, doesn't do memory allocation, and doesn't do exception handling. + * (This isn't intended to be the externally-called one.) + */ +static BOOL WINAPI CRYPT_AsnDecodeExtensionsInternal(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo); static BOOL WINAPI CRYPT_AsnDecodeOid(const BYTE *pbEncoded, DWORD cbEncoded, @@ -242,7 +252,7 @@ /* write the values */ if (pszOverrideFuncName) - RegSetValueExA(hKey, "FuncName", 0, REG_SZ, pszOverrideFuncName, + RegSetValueExA(hKey, "FuncName", 0, REG_SZ, (const BYTE*)pszOverrideFuncName, lstrlenA(pszOverrideFuncName) + 1); RegSetValueExW(hKey, szDllName, 0, REG_SZ, (const BYTE*) pwszDll, (lstrlenW(pwszDll) + 1) * sizeof (WCHAR)); @@ -419,9 +429,9 @@ HMODULE lib; CryptEncodeObjectFunc pCryptEncodeObject; - TRACE("(0x%08lx, %s, %p, %p, %p)\n", - dwCertEncodingType, HIWORD(lpszStructType) ? debugstr_a(lpszStructType) : - "(integer value)", pvStructInfo, pbEncoded, pcbEncoded); + TRACE("(0x%08lx, %s, %p, %p, %p)\n", dwCertEncodingType, + debugstr_a(lpszStructType), pvStructInfo, pbEncoded, + pcbEncoded); if (!pbEncoded && !pcbEncoded) { @@ -835,6 +845,156 @@ return ret; } +static BOOL WINAPI CRYPT_AsnEncodeCRLEntry(const CRL_ENTRY *entry, + BYTE *pbEncoded, DWORD *pcbEncoded) +{ + struct AsnEncodeSequenceItem items[3] = { + { &entry->SerialNumber, CRYPT_AsnEncodeInteger, 0 }, + { &entry->RevocationDate, CRYPT_AsnEncodeChoiceOfTime, 0 }, + { 0 } + }; + DWORD cItem = 2; + BOOL ret; + + TRACE("%p, %p, %p\n", entry, pbEncoded, pcbEncoded); + + if (entry->cExtension) + { + items[cItem].pvStructInfo = &entry->cExtension; + items[cItem].encodeFunc = CRYPT_AsnEncodeExtensions; + cItem++; + } + + ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, items, cItem, 0, NULL, + pbEncoded, pcbEncoded); + + TRACE("returning %d (%08lx)\n", ret, GetLastError()); + return ret; +} + +static BOOL WINAPI CRYPT_AsnEncodeCRLEntries(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + DWORD cCRLEntry = *(const DWORD *)pvStructInfo; + DWORD bytesNeeded, dataLen, lenBytes, i; + const CRL_ENTRY *rgCRLEntry = *(const CRL_ENTRY **) + ((const BYTE *)pvStructInfo + sizeof(DWORD)); + BOOL ret = TRUE; + + for (i = 0, dataLen = 0; ret && i < cCRLEntry; i++) + { + DWORD size; + + ret = CRYPT_AsnEncodeCRLEntry(&rgCRLEntry[i], NULL, &size); + if (ret) + dataLen += size; + } + CRYPT_EncodeLen(dataLen, NULL, &lenBytes); + bytesNeeded = 1 + lenBytes + dataLen; + if (!pbEncoded) + *pcbEncoded = bytesNeeded; + else + { + if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, + pcbEncoded, bytesNeeded))) + { + if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) + pbEncoded = *(BYTE **)pbEncoded; + *pbEncoded++ = ASN_SEQUENCEOF; + CRYPT_EncodeLen(dataLen, pbEncoded, &lenBytes); + pbEncoded += lenBytes; + for (i = 0; i < cCRLEntry; i++) + { + DWORD size = dataLen; + + ret = CRYPT_AsnEncodeCRLEntry(&rgCRLEntry[i], pbEncoded, &size); + pbEncoded += size; + dataLen -= size; + } + } + } + return ret; +} + +static BOOL WINAPI CRYPT_AsnEncodeCRLVersion(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + const DWORD *ver = (const DWORD *)pvStructInfo; + BOOL ret; + + /* CRL_V1 is not encoded */ + if (*ver == CRL_V1) + { + *pcbEncoded = 0; + ret = TRUE; + } + else + ret = CRYPT_AsnEncodeInt(dwCertEncodingType, X509_INTEGER, ver, + dwFlags, pEncodePara, pbEncoded, pcbEncoded); + return ret; +} + +/* Like in Windows, this blithely ignores the validity of the passed-in + * CRL_INFO, and just encodes it as-is. The resulting encoded data may not + * decode properly, see CRYPT_AsnDecodeCRLInfo. + */ +static BOOL WINAPI CRYPT_AsnEncodeCRLInfo(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + BOOL ret; + + __TRY + { + const CRL_INFO *info = (const CRL_INFO *)pvStructInfo; + struct AsnEncodeSequenceItem items[7] = { + { &info->dwVersion, CRYPT_AsnEncodeCRLVersion, 0 }, + { &info->SignatureAlgorithm, CRYPT_AsnEncodeAlgorithmId, 0 }, + { &info->Issuer, CRYPT_CopyEncodedBlob, 0 }, + { &info->ThisUpdate, CRYPT_AsnEncodeChoiceOfTime, 0 }, + { 0 } + }; + struct AsnConstructedItem constructed = { 0 }; + DWORD cItem = 4; + + if (info->NextUpdate.dwLowDateTime || info->NextUpdate.dwHighDateTime) + { + items[cItem].pvStructInfo = &info->NextUpdate; + items[cItem].encodeFunc = CRYPT_AsnEncodeChoiceOfTime; + cItem++; + } + if (info->cCRLEntry) + { + items[cItem].pvStructInfo = &info->cCRLEntry; + items[cItem].encodeFunc = CRYPT_AsnEncodeCRLEntries; + cItem++; + } + 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; + cItem++; + } + + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, cItem, + dwFlags, pEncodePara, pbEncoded, pcbEncoded); + } + __EXCEPT(page_fault) + { + SetLastError(STATUS_ACCESS_VIOLATION); + ret = FALSE; + } + __ENDTRY + return ret; +} + static BOOL CRYPT_AsnEncodeExtension(CERT_EXTENSION *ext, BYTE *pbEncoded, DWORD *pcbEncoded) { @@ -1328,6 +1488,171 @@ return ret; } +static BOOL CRYPT_AsnEncodeAltNameEntry(const CERT_ALT_NAME_ENTRY *entry, + BYTE *pbEncoded, DWORD *pcbEncoded) +{ + BOOL ret; + DWORD dataLen; + + ret = TRUE; + switch (entry->dwAltNameChoice) + { + case CERT_ALT_NAME_RFC822_NAME: + case CERT_ALT_NAME_DNS_NAME: + case CERT_ALT_NAME_URL: + if (entry->u.pwszURL) + { + DWORD i; + + /* Not + 1: don't encode the NULL-terminator */ + dataLen = lstrlenW(entry->u.pwszURL); + for (i = 0; ret && i < dataLen; i++) + { + if (entry->u.pwszURL[i] > 0x7f) + { + SetLastError(CRYPT_E_INVALID_IA5_STRING); + ret = FALSE; + *pcbEncoded = i; + } + } + } + else + dataLen = 0; + break; + case CERT_ALT_NAME_IP_ADDRESS: + dataLen = entry->u.IPAddress.cbData; + break; + case CERT_ALT_NAME_REGISTERED_ID: + /* FIXME: encode OID */ + case CERT_ALT_NAME_OTHER_NAME: + case CERT_ALT_NAME_DIRECTORY_NAME: + FIXME("name type %ld unimplemented\n", entry->dwAltNameChoice); + return FALSE; + default: + SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)); + return FALSE; + } + if (ret) + { + DWORD bytesNeeded, lenBytes; + + CRYPT_EncodeLen(dataLen, NULL, &lenBytes); + bytesNeeded = 1 + dataLen + lenBytes; + if (!pbEncoded) + *pcbEncoded = bytesNeeded; + else if (*pcbEncoded < bytesNeeded) + { + SetLastError(ERROR_MORE_DATA); + *pcbEncoded = bytesNeeded; + ret = FALSE; + } + else + { + *pbEncoded++ = ASN_CONTEXT | (entry->dwAltNameChoice - 1); + CRYPT_EncodeLen(dataLen, pbEncoded, &lenBytes); + pbEncoded += lenBytes; + switch (entry->dwAltNameChoice) + { + case CERT_ALT_NAME_RFC822_NAME: + case CERT_ALT_NAME_DNS_NAME: + case CERT_ALT_NAME_URL: + { + DWORD i; + + for (i = 0; i < dataLen; i++) + *pbEncoded++ = (BYTE)entry->u.pwszURL[i]; + break; + } + case CERT_ALT_NAME_IP_ADDRESS: + memcpy(pbEncoded, entry->u.IPAddress.pbData, dataLen); + break; + } + if (ret) + *pcbEncoded = bytesNeeded; + } + } + return ret; +} + +static BOOL WINAPI CRYPT_AsnEncodeAltName(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + BOOL ret; + + __TRY + { + const CERT_ALT_NAME_INFO *info = + (const CERT_ALT_NAME_INFO *)pvStructInfo; + + DWORD bytesNeeded, dataLen, lenBytes, i; + + ret = TRUE; + /* FIXME: should check that cAltEntry is not bigger than 0xff, since we + * can't encode an erroneous entry index if it's bigger than this. + */ + for (i = 0, dataLen = 0; ret && i < info->cAltEntry; i++) + { + DWORD len; + + ret = CRYPT_AsnEncodeAltNameEntry(&info->rgAltEntry[i], NULL, + &len); + if (ret) + dataLen += len; + } + if (ret) + { + CRYPT_EncodeLen(dataLen, NULL, &lenBytes); + bytesNeeded = 1 + lenBytes + dataLen; + if (!pbEncoded) + { + *pcbEncoded = bytesNeeded; + ret = TRUE; + } + else + { + if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, + pbEncoded, pcbEncoded, bytesNeeded))) + { + if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) + pbEncoded = *(BYTE **)pbEncoded; + *pbEncoded++ = ASN_SEQUENCEOF; + CRYPT_EncodeLen(dataLen, pbEncoded, &lenBytes); + pbEncoded += lenBytes; + for (i = 0; ret && i < info->cAltEntry; i++) + { + DWORD len = dataLen; + + ret = CRYPT_AsnEncodeAltNameEntry(&info->rgAltEntry[i], + pbEncoded, &len); + if (ret) + { + 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; + } + } + } + } + } + } + __EXCEPT(page_fault) + { + SetLastError(STATUS_ACCESS_VIOLATION); + ret = FALSE; + } + __ENDTRY + return ret; +} + static BOOL WINAPI CRYPT_AsnEncodeBasicConstraints2(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) @@ -1905,10 +2230,9 @@ HMODULE lib = NULL; CryptEncodeObjectExFunc encodeFunc = NULL; - TRACE("(0x%08lx, %s, %p, 0x%08lx, %p, %p, %p)\n", - dwCertEncodingType, HIWORD(lpszStructType) ? debugstr_a(lpszStructType) : - "(integer value)", pvStructInfo, dwFlags, pEncodePara, pvEncoded, - pcbEncoded); + TRACE("(0x%08lx, %s, %p, 0x%08lx, %p, %p, %p)\n", dwCertEncodingType, + debugstr_a(lpszStructType), pvStructInfo, dwFlags, pEncodePara, + pvEncoded, pcbEncoded); if (!pvEncoded && !pcbEncoded) { @@ -1935,6 +2259,9 @@ case (WORD)X509_CERT_TO_BE_SIGNED: encodeFunc = CRYPT_AsnEncodeCertInfo; break; + case (WORD)X509_CERT_CRL_TO_BE_SIGNED: + encodeFunc = CRYPT_AsnEncodeCRLInfo; + break; case (WORD)X509_EXTENSIONS: encodeFunc = CRYPT_AsnEncodeExtensions; break; @@ -1944,6 +2271,9 @@ case (WORD)X509_PUBLIC_KEY_INFO: encodeFunc = CRYPT_AsnEncodePubKeyInfo; break; + case (WORD)X509_ALTERNATE_NAME: + encodeFunc = CRYPT_AsnEncodeAltName; + break; case (WORD)X509_BASIC_CONSTRAINTS2: encodeFunc = CRYPT_AsnEncodeBasicConstraints2; break; @@ -1991,6 +2321,16 @@ encodeFunc = CRYPT_AsnEncodeOctets; else if (!strcmp(lpszStructType, szOID_BASIC_CONSTRAINTS2)) encodeFunc = CRYPT_AsnEncodeBasicConstraints2; + else if (!strcmp(lpszStructType, szOID_ISSUER_ALT_NAME)) + encodeFunc = CRYPT_AsnEncodeAltName; + else if (!strcmp(lpszStructType, szOID_ISSUER_ALT_NAME2)) + encodeFunc = CRYPT_AsnEncodeAltName; + else if (!strcmp(lpszStructType, szOID_NEXT_UPDATE_LOCATION)) + encodeFunc = CRYPT_AsnEncodeAltName; + else if (!strcmp(lpszStructType, szOID_SUBJECT_ALT_NAME)) + encodeFunc = CRYPT_AsnEncodeAltName; + else if (!strcmp(lpszStructType, szOID_SUBJECT_ALT_NAME2)) + encodeFunc = CRYPT_AsnEncodeAltName; else TRACE("OID %s not found or unimplemented, looking for DLL\n", debugstr_a(lpszStructType)); @@ -2015,10 +2355,9 @@ HMODULE lib; CryptDecodeObjectFunc pCryptDecodeObject; - TRACE("(0x%08lx, %s, %p, %ld, 0x%08lx, %p, %p)\n", - dwCertEncodingType, HIWORD(lpszStructType) ? debugstr_a(lpszStructType) : - "(integer value)", pbEncoded, cbEncoded, dwFlags, pvStructInfo, - pcbStructInfo); + TRACE("(0x%08lx, %s, %p, %ld, 0x%08lx, %p, %p)\n", dwCertEncodingType, + debugstr_a(lpszStructType), pbEncoded, cbEncoded, dwFlags, + pvStructInfo, pcbStructInfo); if (!pvStructInfo && !pcbStructInfo) { @@ -2142,6 +2481,9 @@ * offset: * A sequence is decoded into a struct. The offset member is the * offset of this item within that struct. + * decodeFunc: + * The decoder function to use. If this is NULL, then the member isn't + * decoded, but minSize space is reserved for it. * minSize: * The minimum amount of space occupied after decoding. You must set this. * hasPointer, pointerOffset, minSize: @@ -2165,6 +2507,9 @@ /* This decodes an arbitrary sequence into a contiguous block of memory * (basically, a struct.) Each element being decoded is described by a struct * AsnDecodeSequenceItem, see above. + * startingPointer is an optional pointer to the first place where dynamic + * data will be stored. If you know the starting offset, you may pass it + * 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. @@ -2172,10 +2517,13 @@ static BOOL CRYPT_AsnDecodeSequence(DWORD dwCertEncodingType, struct AsnDecodeSequenceItem items[], DWORD cItem, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, - void *pvStructInfo, DWORD *pcbStructInfo) + void *pvStructInfo, DWORD *pcbStructInfo, void *startingPointer) { BOOL ret; + TRACE("%p, %ld, %p, %ld, %08lx, %p, %p, %ld\n", items, cItem, pbEncoded, + cbEncoded, dwFlags, pDecodePara, pvStructInfo, *pcbStructInfo); + if (pbEncoded[0] == ASN_SEQUENCE) { DWORD dataLen; @@ -2199,26 +2547,31 @@ { BYTE nextItemLenBytes = GET_LEN_BYTES(ptr[1]); - ret = items[i].decodeFunc(dwCertEncodingType, NULL, - ptr, 1 + nextItemLenBytes + nextItemLen, - dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, NULL, - &items[i].size); - if (ret) + if (items[i].decodeFunc) { - /* Account for alignment padding */ - bytesNeeded += items[i].size; - if (items[i].size % sizeof(DWORD)) - bytesNeeded += sizeof(DWORD) - - items[i].size % sizeof(DWORD); - ptr += 1 + nextItemLenBytes + nextItemLen; + ret = items[i].decodeFunc(dwCertEncodingType, NULL, + ptr, 1 + nextItemLenBytes + nextItemLen, + dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, NULL, + &items[i].size); + if (ret) + { + /* Account for alignment padding */ + bytesNeeded += items[i].size; + if (items[i].size % sizeof(DWORD)) + bytesNeeded += sizeof(DWORD) - + items[i].size % sizeof(DWORD); + ptr += 1 + nextItemLenBytes + nextItemLen; + } + else if (items[i].optional && + GetLastError() == CRYPT_E_ASN1_BADTAG) + { + bytesNeeded += items[i].minSize; + SetLastError(NOERROR); + ret = TRUE; + } } - else if (items[i].optional && - GetLastError() == CRYPT_E_ASN1_BADTAG) - { + else bytesNeeded += items[i].minSize; - SetLastError(NOERROR); - ret = TRUE; - } } } else if (items[i].optional) @@ -2240,7 +2593,10 @@ if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) pvStructInfo = *(BYTE **)pvStructInfo; - nextData = (BYTE *)pvStructInfo + minSize; + if (startingPointer) + nextData = (BYTE *)startingPointer; + else + nextData = (BYTE *)pvStructInfo + minSize; memset(pvStructInfo, 0, minSize); ptr = pbEncoded + 1 + lenBytes; for (i = 0; ret && i < cItem; i++) @@ -2255,11 +2611,14 @@ if (items[i].hasPointer) *(BYTE **)((BYTE *)pvStructInfo + items[i].pointerOffset) = nextData; - 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 (items[i].decodeFunc) + ret = items[i].decodeFunc(dwCertEncodingType, + NULL, ptr, 1 + nextItemLenBytes + nextItemLen, + dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, + (BYTE *)pvStructInfo + items[i].offset, + &items[i].size); + else + items[i].size = items[i].minSize; if (ret) { if (items[i].hasPointer && @@ -2296,6 +2655,7 @@ SetLastError(CRYPT_E_ASN1_BADTAG); ret = FALSE; } + TRACE("returning %d (%08lx)\n", ret, GetLastError()); return ret; } @@ -2379,6 +2739,9 @@ { BOOL ret = TRUE; + TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); + __TRY { struct AsnDecodeSequenceItem items[] = { @@ -2398,7 +2761,7 @@ items[2].decodeFunc = CRYPT_AsnDecodeBitsInternal; ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, - pDecodePara, pvStructInfo, pcbStructInfo); + pDecodePara, pvStructInfo, pcbStructInfo, NULL); } __EXCEPT(page_fault) { @@ -2451,7 +2814,7 @@ ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, - pDecodePara, pvStructInfo, pcbStructInfo); + pDecodePara, pvStructInfo, pcbStructInfo, NULL); return ret; } @@ -2461,6 +2824,9 @@ { BOOL ret = TRUE; + TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); + __TRY { struct AsnDecodeSequenceItem items[] = { @@ -2489,14 +2855,14 @@ { offsetof(CERT_INFO, SubjectUniqueId), CRYPT_AsnDecodeBitsInternal, sizeof(CRYPT_BIT_BLOB), TRUE, TRUE, offsetof(CERT_INFO, SubjectUniqueId.pbData), 0 }, - { offsetof(CERT_INFO, cExtension), CRYPT_AsnDecodeExtensions, + { offsetof(CERT_INFO, cExtension), CRYPT_AsnDecodeExtensionsInternal, sizeof(CERT_EXTENSIONS), TRUE, TRUE, offsetof(CERT_INFO, rgExtension), 0 }, }; ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, - pDecodePara, pvStructInfo, pcbStructInfo); + pDecodePara, pvStructInfo, pcbStructInfo, NULL); } __EXCEPT(page_fault) { @@ -2507,21 +2873,203 @@ 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) +static BOOL CRYPT_AsnDecodeCRLEntry(const BYTE *pbEncoded, DWORD cbEncoded, + DWORD dwFlags, PCRL_ENTRY entry, DWORD *pcbEntry) { - BOOL ret = TRUE; + BOOL ret; + struct AsnDecodeSequenceItem items[] = { + { offsetof(CRL_ENTRY, SerialNumber), CRYPT_AsnDecodeIntegerInternal, + sizeof(CRYPT_INTEGER_BLOB), FALSE, TRUE, offsetof(CRL_ENTRY, + SerialNumber.pbData), 0 }, + { offsetof(CRL_ENTRY, RevocationDate), CRYPT_AsnDecodeChoiceOfTime, + sizeof(FILETIME), FALSE, FALSE, 0 }, + { offsetof(CRL_ENTRY, cExtension), CRYPT_AsnDecodeExtensionsInternal, + sizeof(CERT_EXTENSIONS), TRUE, TRUE, offsetof(CRL_ENTRY, + rgExtension), 0 }, + }; - if (pbEncoded[0] == ASN_SEQUENCE) - { - DWORD dataLen, bytesNeeded; + TRACE("%p, %ld, %08lx, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, entry, + *pcbEntry); - if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) - { - BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]), oidLenBytes = 0; + ret = CRYPT_AsnDecodeSequence(X509_ASN_ENCODING, items, + sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, + NULL, entry, pcbEntry, entry ? entry->SerialNumber.pbData : NULL); + TRACE("Returning %d (%08lx)\n", ret, GetLastError()); + return ret; +} - bytesNeeded = sizeof(CERT_EXTENSION); +typedef struct _WINE_CRL_ENTRIES { + DWORD cCRLEntry; + PCRL_ENTRY rgCRLEntry; +} WINE_CRL_ENTRIES, *PWINE_CRL_ENTRIES; + +/* Warning: assumes pvStructInfo is a WINE_CRL_ENTRIES whose rgCRLEntry has + * been set prior to calling. + */ +static BOOL WINAPI CRYPT_AsnDecodeCRLEntries(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_SEQUENCEOF) + { + DWORD dataLen, bytesNeeded; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + { + DWORD cCRLEntry = 0; + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + + bytesNeeded = sizeof(WINE_CRL_ENTRIES); + if (dataLen) + { + const BYTE *ptr; + DWORD size; + + for (ptr = pbEncoded + 1 + lenBytes; ret && + ptr - pbEncoded - 1 - lenBytes < dataLen; ) + { + size = 0; + ret = CRYPT_AsnDecodeCRLEntry(ptr, + cbEncoded - (ptr - pbEncoded), dwFlags, NULL, &size); + if (ret) + { + DWORD nextLen; + + cCRLEntry++; + bytesNeeded += size; + ret = CRYPT_GetLen(ptr, + cbEncoded - (ptr - pbEncoded), &nextLen); + if (ret) + ptr += nextLen + 1 + GET_LEN_BYTES(ptr[1]); + } + } + } + if (ret) + { + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, + pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded))) + { + DWORD size, i; + BYTE *nextData; + const BYTE *ptr; + PWINE_CRL_ENTRIES entries; + + if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) + pvStructInfo = *(BYTE **)pvStructInfo; + *pcbStructInfo = bytesNeeded; + entries = (PWINE_CRL_ENTRIES)pvStructInfo; + entries->cCRLEntry = cCRLEntry; + assert(entries->rgCRLEntry); + nextData = (BYTE *)entries->rgCRLEntry + + entries->cCRLEntry * sizeof(CRL_ENTRY); + for (i = 0, ptr = pbEncoded + 1 + lenBytes; ret && + i < cCRLEntry && ptr - pbEncoded - 1 - lenBytes < + dataLen; i++) + { + entries->rgCRLEntry[i].SerialNumber.pbData = nextData; + size = bytesNeeded; + ret = CRYPT_AsnDecodeCRLEntry(ptr, + cbEncoded - (ptr - pbEncoded), dwFlags, + &entries->rgCRLEntry[i], &size); + if (ret) + { + DWORD nextLen; + + bytesNeeded -= size; + /* Increment nextData by the difference of the + * minimum size and the actual size. + */ + if (size > sizeof(CRL_ENTRY)) + nextData += size - sizeof(CRL_ENTRY); + ret = CRYPT_GetLen(ptr, + cbEncoded - (ptr - pbEncoded), &nextLen); + if (ret) + ptr += nextLen + 1 + GET_LEN_BYTES(ptr[1]); + } + } + } + } + } + } + else + { + SetLastError(CRYPT_E_ASN1_BADTAG); + ret = FALSE; + } + TRACE("Returning %d (%08lx)\n", ret, GetLastError()); + return ret; +} + +static BOOL WINAPI CRYPT_AsnDecodeCRLInfo(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret = TRUE; + + TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); + + __TRY + { + struct AsnDecodeSequenceItem items[] = { + { offsetof(CRL_INFO, dwVersion), CRYPT_AsnDecodeCertVersion, + 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 }, + { offsetof(CRL_INFO, Issuer), CRYPT_AsnDecodeDerBlob, + sizeof(CRYPT_DER_BLOB), FALSE, TRUE, offsetof(CRL_INFO, + Issuer.pbData) }, + { offsetof(CRL_INFO, ThisUpdate), CRYPT_AsnDecodeChoiceOfTime, + sizeof(FILETIME), FALSE, FALSE, 0 }, + { offsetof(CRL_INFO, NextUpdate), CRYPT_AsnDecodeChoiceOfTime, + sizeof(FILETIME), TRUE, FALSE, 0 }, + { offsetof(CRL_INFO, cCRLEntry), CRYPT_AsnDecodeCRLEntries, + sizeof(WINE_CRL_ENTRIES), TRUE, TRUE, offsetof(CRL_INFO, + rgCRLEntry), 0 }, + /* Note that the extensions are ignored by MS, so I'll ignore them too + */ + { offsetof(CRL_INFO, cExtension), NULL, + sizeof(CERT_EXTENSIONS), TRUE, FALSE, 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); + ret = FALSE; + } + __ENDTRY + + TRACE("Returning %d (%08lx)\n", ret, GetLastError()); + 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) +{ + BOOL ret = TRUE; + + if (pbEncoded[0] == ASN_SEQUENCE) + { + DWORD dataLen, bytesNeeded; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + { + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]), oidLenBytes = 0; + + bytesNeeded = sizeof(CERT_EXTENSION); if (dataLen) { const BYTE *ptr = pbEncoded + 1 + lenBytes; @@ -2574,7 +3122,7 @@ &ext->Value, &dataLen); if (ret) { - ext->pszObjId = ext->Value.pbData + + ext->pszObjId = (LPSTR)ext->Value.pbData + ext->Value.cbData; ptr = pbEncoded + 1 + lenBytes; ret = CRYPT_AsnDecodeOid(ptr, @@ -2601,40 +3149,97 @@ return ret; } -static BOOL WINAPI CRYPT_AsnDecodeExtensions(DWORD dwCertEncodingType, +static BOOL WINAPI CRYPT_AsnDecodeExtensionsInternal(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { BOOL ret = TRUE; - __TRY + if (pbEncoded[0] == ASN_SEQUENCEOF) { - if (pbEncoded[0] == ASN_SEQUENCEOF) + DWORD dataLen, bytesNeeded; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) { - DWORD dataLen, bytesNeeded; + DWORD cExtension = 0; + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); - if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + bytesNeeded = sizeof(CERT_EXTENSIONS); + if (dataLen) { - DWORD cExtension = 0; - BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + const BYTE *ptr; + DWORD size; - bytesNeeded = sizeof(CERT_EXTENSIONS); - if (dataLen) + for (ptr = pbEncoded + 1 + lenBytes; ret && + ptr - pbEncoded - 1 - lenBytes < dataLen; ) { + ret = CRYPT_AsnDecodeExtension(ptr, + cbEncoded - (ptr - pbEncoded), dwFlags, NULL, &size); + if (ret) + { + DWORD nextLen; + + cExtension++; + bytesNeeded += size; + ret = CRYPT_GetLen(ptr, + cbEncoded - (ptr - pbEncoded), &nextLen); + if (ret) + ptr += nextLen + 1 + GET_LEN_BYTES(ptr[1]); + } + } + } + if (ret) + { + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if (*pcbStructInfo < bytesNeeded) + { + SetLastError(ERROR_MORE_DATA); + *pcbStructInfo = bytesNeeded; + ret = FALSE; + } + else + { + DWORD size, i; + BYTE *nextData; const BYTE *ptr; - DWORD size; + CERT_EXTENSIONS *exts; - for (ptr = pbEncoded + 1 + lenBytes; ret && - ptr - pbEncoded - 1 - lenBytes < dataLen; ) + *pcbStructInfo = bytesNeeded; + exts = (CERT_EXTENSIONS *)pvStructInfo; + exts->cExtension = cExtension; + assert(exts->rgExtension); + nextData = (BYTE *)exts->rgExtension + + exts->cExtension * sizeof(CERT_EXTENSION); + for (i = 0, ptr = pbEncoded + 1 + lenBytes; ret && + i < cExtension && ptr - pbEncoded - 1 - lenBytes < + dataLen; i++) { + exts->rgExtension[i].Value.pbData = nextData; + size = bytesNeeded; ret = CRYPT_AsnDecodeExtension(ptr, - cbEncoded - (ptr - pbEncoded), dwFlags, NULL, &size); + cbEncoded - (ptr - pbEncoded), dwFlags, + &exts->rgExtension[i], &size); if (ret) { DWORD nextLen; - cExtension++; - bytesNeeded += size; + 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; ret = CRYPT_GetLen(ptr, cbEncoded - (ptr - pbEncoded), &nextLen); if (ret) @@ -2642,70 +3247,46 @@ } } } - if (ret) - { - if (!pvStructInfo) - *pcbStructInfo = bytesNeeded; - else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, - pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded))) - { - DWORD size, i; - BYTE *nextData; - const BYTE *ptr; - CERT_EXTENSIONS *exts; - - if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) - pvStructInfo = *(BYTE **)pvStructInfo; - *pcbStructInfo = bytesNeeded; - exts = (CERT_EXTENSIONS *)pvStructInfo; - exts->cExtension = cExtension; - exts->rgExtension = (CERT_EXTENSION *)((BYTE *)exts + - sizeof(CERT_EXTENSIONS)); - nextData = (BYTE *)exts->rgExtension + - exts->cExtension * sizeof(CERT_EXTENSION); - for (i = 0, ptr = pbEncoded + 1 + lenBytes; ret && - i < cExtension && ptr - pbEncoded - 1 - lenBytes < - dataLen; i++) - { - exts->rgExtension[i].Value.pbData = nextData; - size = bytesNeeded; - ret = CRYPT_AsnDecodeExtension(ptr, - cbEncoded - (ptr - pbEncoded), dwFlags, - &exts->rgExtension[i], &size); - if (ret) - { - 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; - ret = CRYPT_GetLen(ptr, - cbEncoded - (ptr - pbEncoded), &nextLen); - if (ret) - ptr += nextLen + 1 + GET_LEN_BYTES(ptr[1]); - } - } - } - } } } - else + } + else + { + SetLastError(CRYPT_E_ASN1_BADTAG); + ret = FALSE; + } + return ret; +} + +static BOOL WINAPI CRYPT_AsnDecodeExtensions(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret = TRUE; + + __TRY + { + ret = CRYPT_AsnDecodeExtensionsInternal(dwCertEncodingType, + lpszStructType, pbEncoded, cbEncoded, + dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, NULL, pcbStructInfo); + if (ret && pvStructInfo) { - SetLastError(CRYPT_E_ASN1_BADTAG); - ret = FALSE; + ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, pvStructInfo, + pcbStructInfo, *pcbStructInfo); + if (ret) + { + CERT_EXTENSIONS *exts; + + if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) + pvStructInfo = *(BYTE **)pvStructInfo; + exts = (CERT_EXTENSIONS *)pvStructInfo; + exts->rgExtension = (CERT_EXTENSION *)((BYTE *)exts + + sizeof(CERT_EXTENSIONS)); + ret = CRYPT_AsnDecodeExtensionsInternal(dwCertEncodingType, + lpszStructType, pbEncoded, cbEncoded, + dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, pvStructInfo, + pcbStructInfo); + } } } __EXCEPT(page_fault) @@ -3024,7 +3605,7 @@ (LPSTR)(attr->Value.pbData + attr->Value.cbData); else - attr->pszObjId = originalData; + attr->pszObjId = (LPSTR)originalData; size = bytesNeeded - size; ret = CRYPT_AsnDecodeOid( pbEncoded + objIdOfset, @@ -3355,17 +3936,17 @@ { memcpy(algo->Parameters.pbData, ptr, algo->Parameters.cbData); - algo->pszObjId = algo->Parameters.pbData + + algo->pszObjId = (LPSTR)algo->Parameters.pbData + algo->Parameters.cbData; } else { algo->Parameters.pbData = (BYTE *)ptr; - algo->pszObjId = algo->Parameters.pbData; + algo->pszObjId = (LPSTR)algo->Parameters.pbData; } } else - algo->pszObjId = algo->Parameters.pbData; + algo->pszObjId = (LPSTR)algo->Parameters.pbData; ptr = pbEncoded + 1 + lenBytes; ret = CRYPT_AsnDecodeOid(ptr, cbEncoded - (ptr - pbEncoded), @@ -3410,7 +3991,7 @@ ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, - pDecodePara, pvStructInfo, pcbStructInfo); + pDecodePara, pvStructInfo, pcbStructInfo, NULL); } __EXCEPT(page_fault) { @@ -3466,6 +4047,211 @@ return ret; } +static BOOL CRYPT_AsnDecodeAltNameEntry(const BYTE *pbEncoded, DWORD cbEncoded, + DWORD dwFlags, CERT_ALT_NAME_ENTRY *entry, DWORD *pcbEntry) +{ + DWORD dataLen, lenBytes, bytesNeeded = sizeof(CERT_ALT_NAME_ENTRY); + BOOL ret; + + if (cbEncoded < 2) + { + SetLastError(CRYPT_E_ASN1_CORRUPT); + return FALSE; + } + if ((pbEncoded[0] & ASN_FLAGS_MASK) != ASN_CONTEXT) + { + SetLastError(CRYPT_E_ASN1_BADTAG); + return FALSE; + } + lenBytes = GET_LEN_BYTES(pbEncoded[1]); + if (1 + lenBytes > cbEncoded) + { + SetLastError(CRYPT_E_ASN1_CORRUPT); + return FALSE; + } + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + { + switch (pbEncoded[0] & ASN_TYPE_MASK) + { + case 1: /* rfc822Name */ + case 2: /* dNSName */ + case 6: /* uniformResourceIdentifier */ + bytesNeeded += (dataLen + 1) * sizeof(WCHAR); + break; + case 7: /* iPAddress */ + bytesNeeded += dataLen; + break; + case 8: /* registeredID */ + /* FIXME: decode as OID */ + case 0: /* otherName */ + case 4: /* directoryName */ + FIXME("stub\n"); + SetLastError(CRYPT_E_ASN1_BADTAG); + ret = FALSE; + break; + case 3: /* x400Address, unimplemented */ + case 5: /* ediPartyName, unimplemented */ + SetLastError(CRYPT_E_ASN1_BADTAG); + ret = FALSE; + break; + default: + SetLastError(CRYPT_E_ASN1_CORRUPT); + ret = FALSE; + } + if (ret) + { + if (!entry) + *pcbEntry = bytesNeeded; + else if (*pcbEntry < bytesNeeded) + { + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + /* MS used values one greater than the asn1 ones.. sigh */ + entry->dwAltNameChoice = (pbEncoded[0] & 0x7f) + 1; + switch (pbEncoded[0] & ASN_TYPE_MASK) + { + case 1: /* rfc822Name */ + case 2: /* dNSName */ + case 6: /* uniformResourceIdentifier */ + { + DWORD i; + + for (i = 0; i < dataLen; i++) + entry->u.pwszURL[i] = (WCHAR)pbEncoded[1 + lenBytes + i]; + entry->u.pwszURL[i] = 0; + break; + } + case 7: /* iPAddress */ + /* The next data pointer is in the pwszURL spot, that is, + * the first 4 bytes. Need to move it to the next spot. + */ + entry->u.IPAddress.pbData = (LPBYTE)entry->u.pwszURL; + entry->u.IPAddress.cbData = dataLen; + memcpy(entry->u.IPAddress.pbData, pbEncoded + 1 + lenBytes, + dataLen); + break; + } + } + } + } + return ret; +} + +static BOOL WINAPI CRYPT_AsnDecodeAltName(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret = TRUE; + + __TRY + { + if (pbEncoded[0] == ASN_SEQUENCEOF) + { + DWORD dataLen; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + { + DWORD bytesNeeded, cEntry = 0; + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + + bytesNeeded = sizeof(CERT_ALT_NAME_INFO); + if (dataLen) + { + const BYTE *ptr; + + for (ptr = pbEncoded + 1 + lenBytes; ret && + ptr - pbEncoded - 1 - lenBytes < dataLen; ) + { + DWORD size; + + ret = CRYPT_AsnDecodeAltNameEntry(ptr, + cbEncoded - (ptr - pbEncoded), dwFlags, NULL, &size); + if (ret) + { + DWORD nextLen; + + cEntry++; + bytesNeeded += size; + ret = CRYPT_GetLen(ptr, + cbEncoded - (ptr - pbEncoded), &nextLen); + if (ret) + ptr += nextLen + 1 + GET_LEN_BYTES(ptr[1]); + } + } + } + if (ret) + { + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, + pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded))) + { + CERT_ALT_NAME_INFO *info; + + if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) + pvStructInfo = *(BYTE **)pvStructInfo; + info = (CERT_ALT_NAME_INFO *)pvStructInfo; + info->cAltEntry = 0; + if (cEntry == 0) + info->rgAltEntry = NULL; + else + { + DWORD size, i; + BYTE *nextData; + const BYTE *ptr; + + info->rgAltEntry = + (CERT_ALT_NAME_ENTRY *)((BYTE *)pvStructInfo + + sizeof(CERT_ALT_NAME_INFO)); + nextData = (BYTE *)info->rgAltEntry + + cEntry * sizeof(CERT_ALT_NAME_ENTRY); + for (i = 0, ptr = pbEncoded + 1 + lenBytes; ret && + i < cEntry && ptr - pbEncoded - 1 - lenBytes < + dataLen; i++) + { + info->rgAltEntry[i].u.pwszURL = (LPWSTR)nextData; + size = bytesNeeded; + ret = CRYPT_AsnDecodeAltNameEntry(ptr, + cbEncoded - (ptr - pbEncoded), dwFlags, + &info->rgAltEntry[i], &size); + if (ret) + { + DWORD nextLen; + + info->cAltEntry++; + nextData += size - + sizeof(CERT_ALT_NAME_ENTRY); + bytesNeeded -= size; + ret = CRYPT_GetLen(ptr, + cbEncoded - (ptr - pbEncoded), &nextLen); + if (ret) + ptr += nextLen + 1 + + GET_LEN_BYTES(ptr[1]); + } + } + } + } + } + } + } + else + { + SetLastError(CRYPT_E_ASN1_BADTAG); + ret = FALSE; + } + } + __EXCEPT(page_fault) + { + SetLastError(STATUS_ACCESS_VIOLATION); + ret = FALSE; + } + __ENDTRY + 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) @@ -3634,8 +4420,8 @@ { BOOL ret; - TRACE("(%p, %ld, 0x%08lx, %p, %p, %p)\n", pbEncoded, cbEncoded, dwFlags, - pDecodePara, pvStructInfo, pcbStructInfo); + TRACE("(%p, %ld, 0x%08lx, %p, %p, %ld)\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); if (pbEncoded[0] == ASN_BITSTRING) { @@ -3825,8 +4611,10 @@ DWORD i; for (i = 0; i < blob->cbData; i++) + { blob->pbData[i] = *(pbEncoded + 1 + lenBytes + dataLen - i - 1); + } } } } @@ -4287,12 +5075,6 @@ { BOOL ret; - if (!pvStructInfo) - { - *pcbStructInfo = sizeof(FILETIME); - return TRUE; - } - __TRY { if (pbEncoded[0] == ASN_UTCTIME) @@ -4430,9 +5212,8 @@ CryptDecodeObjectExFunc decodeFunc = NULL; TRACE("(0x%08lx, %s, %p, %ld, 0x%08lx, %p, %p, %p)\n", - dwCertEncodingType, HIWORD(lpszStructType) ? debugstr_a(lpszStructType) : - "(integer value)", pbEncoded, cbEncoded, dwFlags, pDecodePara, - pvStructInfo, pcbStructInfo); + dwCertEncodingType, debugstr_a(lpszStructType), pbEncoded, + cbEncoded, dwFlags, pDecodePara, pvStructInfo, pcbStructInfo); if (!pvStructInfo && !pcbStructInfo) { @@ -4469,6 +5250,9 @@ case (WORD)X509_CERT_TO_BE_SIGNED: decodeFunc = CRYPT_AsnDecodeCertInfo; break; + case (WORD)X509_CERT_CRL_TO_BE_SIGNED: + decodeFunc = CRYPT_AsnDecodeCRLInfo; + break; case (WORD)X509_EXTENSIONS: decodeFunc = CRYPT_AsnDecodeExtensions; break; @@ -4478,6 +5262,9 @@ case (WORD)X509_PUBLIC_KEY_INFO: decodeFunc = CRYPT_AsnDecodePubKeyInfo; break; + case (WORD)X509_ALTERNATE_NAME: + decodeFunc = CRYPT_AsnDecodeAltName; + break; case (WORD)X509_BASIC_CONSTRAINTS2: decodeFunc = CRYPT_AsnDecodeBasicConstraints2; break; @@ -4525,6 +5312,16 @@ decodeFunc = CRYPT_AsnDecodeOctets; else if (!strcmp(lpszStructType, szOID_BASIC_CONSTRAINTS2)) decodeFunc = CRYPT_AsnDecodeBasicConstraints2; + else if (!strcmp(lpszStructType, szOID_ISSUER_ALT_NAME)) + decodeFunc = CRYPT_AsnDecodeAltName; + else if (!strcmp(lpszStructType, szOID_ISSUER_ALT_NAME2)) + decodeFunc = CRYPT_AsnDecodeAltName; + else if (!strcmp(lpszStructType, szOID_NEXT_UPDATE_LOCATION)) + decodeFunc = CRYPT_AsnDecodeAltName; + else if (!strcmp(lpszStructType, szOID_SUBJECT_ALT_NAME)) + decodeFunc = CRYPT_AsnDecodeAltName; + else if (!strcmp(lpszStructType, szOID_SUBJECT_ALT_NAME2)) + decodeFunc = CRYPT_AsnDecodeAltName; else TRACE("OID %s not found or unimplemented, looking for DLL\n", debugstr_a(lpszStructType)); diff -urN wine-20050725/dlls/crypt32/main.c wine-20050830/dlls/crypt32/main.c --- wine-20050725/dlls/crypt32/main.c 2005-06-14 13:38:36.000000000 +0200 +++ wine-20050830/dlls/crypt32/main.c 2005-08-25 11:52:00.000000000 +0200 @@ -27,10 +27,32 @@ #include "winreg.h" #include "winnls.h" #include "mssip.h" +#include "crypt32_private.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(crypt); +static HCRYPTPROV hDefProv; + +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_DETACH: + if (hDefProv) CryptReleaseContext(hDefProv, 0); + break; + } + return TRUE; +} + +HCRYPTPROV CRYPT_GetDefaultProvider(void) +{ + if (!hDefProv) + CryptAcquireContextW(&hDefProv, NULL, MS_ENHANCED_PROV_W, + PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); + return hDefProv; +} + /* this function is called by Internet Explorer when it is about to verify a downloaded component */ BOOL WINAPI I_CryptCreateLruCache(DWORD x, DWORD y) { diff -urN wine-20050725/dlls/crypt32/protectdata.c wine-20050830/dlls/crypt32/protectdata.c --- wine-20050725/dlls/crypt32/protectdata.c 2005-05-30 11:56:57.000000000 +0200 +++ wine-20050830/dlls/crypt32/protectdata.c 2005-08-29 11:38:19.000000000 +0200 @@ -52,7 +52,10 @@ #define CRYPT32_PROTECTDATA_KEY_CALG CALG_RC2 #define CRYPT32_PROTECTDATA_SALT_LEN 16 -#define CRYPT32_PROTECTDATA_SECRET "I'm hunting wabbits" +static const BYTE crypt32_protectdata_secret[] = { + 'I','\'','m',' ','h','u','n','t','i','n','g',' ', + 'w','a','b','b','i','t','s',0 +}; /* * The data format returned by the real Windows CryptProtectData seems @@ -513,7 +516,7 @@ * implementation of CryptProtectData. */ if (pInfo->info0.cbData!=strlen(crypt_magic_str)+1 || - strcmp(pInfo->info0.pbData,crypt_magic_str) != 0) + strcmp( (LPCSTR)pInfo->info0.pbData,crypt_magic_str) != 0) { ERR("info0 magic value not matched !\n"); status=FALSE; @@ -562,7 +565,7 @@ blob->cbData=0; } else { - strcpy(blob->pbData, str); + strcpy((LPSTR)blob->pbData, str); } return blob->pbData; @@ -743,9 +746,9 @@ * - randomness (from the salt) * - user-supplied entropy */ - if ((szUsername && !CryptHashData(hSaltHash,szUsername,dwUsernameLen,0)) || - !CryptHashData(hSaltHash,CRYPT32_PROTECTDATA_SECRET, - strlen(CRYPT32_PROTECTDATA_SECRET),0) || + if ((szUsername && !CryptHashData(hSaltHash,(LPBYTE)szUsername,dwUsernameLen,0)) || + !CryptHashData(hSaltHash,crypt32_protectdata_secret, + sizeof(crypt32_protectdata_secret)-1,0) || !CryptHashData(hSaltHash,salt->pbData,salt->cbData,0) || (pOptionalEntropy && !CryptHashData(hSaltHash, pOptionalEntropy->pbData, @@ -791,7 +794,7 @@ if (pOptionalEntropy) { TRACE_DATA_BLOB(pOptionalEntropy); - TRACE(" %s\n",debugstr_an(pOptionalEntropy->pbData,pOptionalEntropy->cbData)); + TRACE(" %s\n",debugstr_an((LPCSTR)pOptionalEntropy->pbData,pOptionalEntropy->cbData)); } } diff -urN wine-20050725/dlls/crypt32/tests/.cvsignore wine-20050830/dlls/crypt32/tests/.cvsignore --- wine-20050725/dlls/crypt32/tests/.cvsignore 2005-06-14 13:38:36.000000000 +0200 +++ wine-20050830/dlls/crypt32/tests/.cvsignore 2005-08-25 11:51:59.000000000 +0200 @@ -1,4 +1,5 @@ Makefile +cert.ok encode.ok main.ok protectdata.ok diff -urN wine-20050725/dlls/crypt32/tests/Makefile.in wine-20050830/dlls/crypt32/tests/Makefile.in --- wine-20050725/dlls/crypt32/tests/Makefile.in 2005-06-14 13:38:36.000000000 +0200 +++ wine-20050830/dlls/crypt32/tests/Makefile.in 2005-08-27 11:27:10.000000000 +0200 @@ -3,9 +3,10 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ TESTDLL = crypt32.dll -IMPORTS = crypt32 +IMPORTS = crypt32 kernel32 CTESTS = \ + cert.c \ encode.c \ main.c \ protectdata.c diff -urN wine-20050725/dlls/crypt32/tests/cert.c wine-20050830/dlls/crypt32/tests/cert.c --- wine-20050725/dlls/crypt32/tests/cert.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/crypt32/tests/cert.c 2005-08-30 11:59:03.000000000 +0200 @@ -0,0 +1,679 @@ +/* + * crypt32 cert functions tests + * + * Copyright 2005 Juan Lang + * + * 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 +#include +#include +#include + +#include "wine/test.h" + +static void testCryptHashCert(void) +{ + static const BYTE emptyHash[] = { 0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, + 0x0d, 0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18, 0x90, 0xaf, 0xd8, 0x07, + 0x09 }; + static const BYTE knownHash[] = { 0xae, 0x9d, 0xbf, 0x6d, 0xf5, 0x46, 0xee, + 0x8b, 0xc5, 0x7a, 0x13, 0xba, 0xc2, 0xb1, 0x04, 0xf2, 0xbf, 0x52, 0xa8, + 0xa2 }; + static const BYTE toHash[] = "abcdefghijklmnopqrstuvwxyz0123456789.,;!?:"; + BOOL ret; + BYTE hash[20]; + DWORD hashLen = sizeof(hash); + + /* NULL buffer and nonzero length crashes + ret = CryptHashCertificate(0, 0, 0, NULL, size, hash, &hashLen); + empty hash length also crashes + ret = CryptHashCertificate(0, 0, 0, buf, size, hash, NULL); + */ + /* Test empty hash */ + ret = CryptHashCertificate(0, 0, 0, toHash, sizeof(toHash), NULL, + &hashLen); + ok(ret, "CryptHashCertificate failed: %08lx\n", GetLastError()); + ok(hashLen == sizeof(hash), + "Got unexpected size of hash %ld, expected %d\n", hashLen, sizeof(hash)); + /* Test with empty buffer */ + ret = CryptHashCertificate(0, 0, 0, NULL, 0, hash, &hashLen); + ok(ret, "CryptHashCertificate failed: %08lx\n", GetLastError()); + ok(!memcmp(hash, emptyHash, sizeof(emptyHash)), + "Unexpected hash of nothing\n"); + /* Test a known value */ + ret = CryptHashCertificate(0, 0, 0, toHash, sizeof(toHash), hash, + &hashLen); + ok(ret, "CryptHashCertificate failed: %08lx\n", GetLastError()); + ok(!memcmp(hash, knownHash, sizeof(knownHash)), "Unexpected hash\n"); +} + +static const BYTE emptyCert[] = { 0x30, 0x00 }; +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 signedBigCert[] = { + 0x30, 0x81, 0x93, 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, 0x30, 0x02, 0x06, + 0x00, 0x03, 0x11, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, + 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }; +static const BYTE serializedCert[] = { 0x20, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 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 }; + +static void testMemStore(void) +{ + HCERTSTORE store1, store2; + PCCERT_CONTEXT context; + BOOL ret; + + /* NULL provider */ + store1 = CertOpenStore(0, 0, 0, 0, NULL); + ok(!store1 && GetLastError() == ERROR_FILE_NOT_FOUND, + "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError()); + /* weird flags */ + store1 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_DELETE_FLAG, NULL); + ok(!store1 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED, + "Expected ERROR_CALL_NOT_IMPLEMENTED, got %ld\n", GetLastError()); + + /* normal */ + store1 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store1 != NULL, "CertOpenStore failed: %ld\n", GetLastError()); + /* open existing doesn't */ + store2 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_OPEN_EXISTING_FLAG, NULL); + ok(store2 != NULL, "CertOpenStore failed: %ld\n", GetLastError()); + ok(store1 != store2, "Expected different stores\n"); + + /* add a bogus (empty) cert */ + context = NULL; + ret = CertAddEncodedCertificateToStore(store1, X509_ASN_ENCODING, emptyCert, + sizeof(emptyCert), CERT_STORE_ADD_ALWAYS, &context); + /* Windows returns CRYPT_E_ASN1_EOD, but accept CRYPT_E_ASN1_CORRUPT as + * well (because matching errors is tough in this case) + */ + ok(!ret && (GetLastError() == CRYPT_E_ASN1_EOD || GetLastError() == + 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() == + CRYPT_E_ASN1_CORRUPT), + "Expected CRYPT_E_ASN1_EOD 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); + ok(ret, "CertAddEncodedCertificateToStore failed: %08lx\n", GetLastError()); + ok(context != NULL, "Expected a valid cert context\n"); + if (context) + { + DWORD size; + BYTE *buf; + + ok(context->cbCertEncoded == sizeof(bigCert) - 1, + "Expected cert of %d bytes, got %ld\n", sizeof(bigCert) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert, sizeof(bigCert) - 1), + "Unexpected encoded cert in context\n"); + ok(context->hCertStore == store1, "Unexpected store\n"); + + /* check serializing this element */ + /* These crash + ret = CertSerializeCertificateStoreElement(NULL, 0, NULL, NULL); + ret = CertSerializeCertificateStoreElement(context, 0, NULL, NULL); + ret = CertSerializeCertificateStoreElement(NULL, 0, NULL, &size); + */ + /* apparently flags are ignored */ + ret = CertSerializeCertificateStoreElement(context, 1, NULL, &size); + ok(ret, "CertSerializeCertificateStoreElement failed: %08lx\n", + GetLastError()); + buf = HeapAlloc(GetProcessHeap(), 0, size); + if (buf) + { + ret = CertSerializeCertificateStoreElement(context, 0, buf, &size); + ok(size == sizeof(serializedCert), "Expected size %d, got %ld\n", + sizeof(serializedCert), size); + ok(!memcmp(serializedCert, buf, size), + "Unexpected serialized cert\n"); + HeapFree(GetProcessHeap(), 0, buf); + } + + ret = CertFreeCertificateContext(context); + ok(ret, "CertFreeCertificateContext failed: %08lx\n", GetLastError()); + } + /* verify the cert's in store1 */ + context = CertEnumCertificatesInStore(store1, NULL); + ok(context != NULL, "Expected a valid context\n"); + context = CertEnumCertificatesInStore(store1, context); + ok(!context && GetLastError() == CRYPT_E_NOT_FOUND, + "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError()); + /* verify store2 (the "open existing" mem store) is still empty */ + context = CertEnumCertificatesInStore(store2, NULL); + ok(!context, "Expected an empty store\n"); + /* delete the cert from store1, and check it's empty */ + context = CertEnumCertificatesInStore(store1, NULL); + if (context) + { + /* Deleting a bitwise copy crashes with an access to an uninitialized + * pointer, so a cert context has some special data out there in memory + * someplace + CERT_CONTEXT copy; + memcpy(©, context, sizeof(copy)); + ret = CertDeleteCertificateFromStore(©); + */ + PCCERT_CONTEXT copy = CertDuplicateCertificateContext(context); + + ok(copy != NULL, "CertDuplicateCertificateContext failed: %08lx\n", + GetLastError()); + ret = CertDeleteCertificateFromStore(context); + ok(ret, "CertDeleteCertificateFromStore failed: %08lx\n", + GetLastError()); + /* try deleting a copy */ + ret = CertDeleteCertificateFromStore(copy); + ok(ret, "CertDeleteCertificateFromStore failed: %08lx\n", + GetLastError()); + /* check that the store is empty */ + context = CertEnumCertificatesInStore(store1, NULL); + ok(!context, "Expected an empty store\n"); + } + + /* close an empty store */ + ret = CertCloseStore(NULL, 0); + ok(ret, "CertCloseStore failed: %ld\n", GetLastError()); + ret = CertCloseStore(store1, 0); + ok(ret, "CertCloseStore failed: %ld\n", GetLastError()); + ret = CertCloseStore(store2, 0); + ok(ret, "CertCloseStore failed: %ld\n", GetLastError()); + + /* This seems nonsensical, but you can open a read-only mem store, only + * it isn't read-only + */ + store1 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_READONLY_FLAG, NULL); + ok(store1 != NULL, "CertOpenStore failed: %ld\n", GetLastError()); + /* yep, this succeeds */ + ret = CertAddEncodedCertificateToStore(store1, X509_ASN_ENCODING, bigCert, + sizeof(bigCert) - 1, 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(bigCert) - 1, + "Expected cert of %d bytes, got %ld\n", sizeof(bigCert) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert, sizeof(bigCert) - 1), + "Unexpected encoded cert in context\n"); + ok(context->hCertStore == store1, "Unexpected store\n"); + ret = CertDeleteCertificateFromStore(context); + ok(ret, "CertDeleteCertificateFromStore failed: %08lx\n", + GetLastError()); + } + CertCloseStore(store1, 0); +} + +static const BYTE bigCert2[] = "\x30\x7a\x02\x01\x01\x30\x02\x06\x00" + "\x30\x15\x31\x13\x30\x11\x06\x03\x55\x04\x03\x13\x0a\x41\x6c\x65\x78\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\x41\x6c\x65\x78" + "\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 void testCollectionStore(void) +{ + HCERTSTORE store1, store2, collection, collection2; + PCCERT_CONTEXT context; + BOOL ret; + + collection = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + + /* Try adding a cert to any empty collection */ + ret = CertAddEncodedCertificateToStore(collection, X509_ASN_ENCODING, + bigCert, sizeof(bigCert) - 1, CERT_STORE_ADD_ALWAYS, NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED), + "Expected HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED), got %08lx\n", + GetLastError()); + + /* Create and add a cert to a memory store */ + store1 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + ret = CertAddEncodedCertificateToStore(store1, X509_ASN_ENCODING, + bigCert, sizeof(bigCert) - 1, CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCertificateToStore failed: %08lx\n", GetLastError()); + /* Add the memory store to the collection, without allowing adding */ + ret = CertAddStoreToCollection(collection, store1, 0, 0); + ok(ret, "CertAddStoreToCollection failed: %08lx\n", GetLastError()); + /* Verify the cert is in the collection */ + context = CertEnumCertificatesInStore(collection, NULL); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + ok(context->hCertStore == collection, "Unexpected store\n"); + CertFreeCertificateContext(context); + } + /* Check that adding to the collection isn't allowed */ + ret = CertAddEncodedCertificateToStore(collection, X509_ASN_ENCODING, + bigCert2, sizeof(bigCert2) - 1, CERT_STORE_ADD_ALWAYS, NULL); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED), + "Expected HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED), got %08lx\n", + GetLastError()); + + /* Create a new memory store */ + store2 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + /* Try adding a store to a non-collection store */ + ret = CertAddStoreToCollection(store1, store2, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* Try adding some bogus stores */ + /* This crashes in Windows + ret = CertAddStoreToCollection(0, store2, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + */ + /* This "succeeds"... */ + ret = CertAddStoreToCollection(collection, 0, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + ok(ret, "CertAddStoreToCollection failed: %08lx\n", GetLastError()); + /* while this crashes. + ret = CertAddStoreToCollection(collection, 1, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + */ + + /* Add it to the collection, this time allowing adding */ + ret = CertAddStoreToCollection(collection, store2, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + ok(ret, "CertAddStoreToCollection failed: %08lx\n", GetLastError()); + /* Check that adding to the collection is allowed */ + ret = CertAddEncodedCertificateToStore(collection, X509_ASN_ENCODING, + bigCert2, sizeof(bigCert2) - 1, CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCertificateToStore failed: %08lx\n", GetLastError()); + /* Now check that it was actually added to store2 */ + context = CertEnumCertificatesInStore(store2, NULL); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + ok(context->hCertStore == store2, "Unexpected store\n"); + CertFreeCertificateContext(context); + } + /* Check that the collection has both bigCert and bigCert2. bigCert comes + * first because store1 was added first. + */ + context = CertEnumCertificatesInStore(collection, NULL); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + ok(context->hCertStore == collection, "Unexpected store\n"); + ok(context->cbCertEncoded == sizeof(bigCert) - 1, + "Expected size %d, got %ld\n", sizeof(bigCert) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), + "Unexpected cert\n"); + context = CertEnumCertificatesInStore(collection, context); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + ok(context->hCertStore == collection, "Unexpected store\n"); + ok(context->cbCertEncoded == sizeof(bigCert2) - 1, + "Expected size %d, got %ld\n", sizeof(bigCert2) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert2, + context->cbCertEncoded), "Unexpected cert\n"); + context = CertEnumCertificatesInStore(collection, context); + ok(!context, "Unexpected cert\n"); + } + } + /* close store2, and check that the collection is unmodified */ + CertCloseStore(store2, 0); + context = CertEnumCertificatesInStore(collection, NULL); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + ok(context->hCertStore == collection, "Unexpected store\n"); + ok(context->cbCertEncoded == sizeof(bigCert) - 1, + "Expected size %d, got %ld\n", sizeof(bigCert) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), + "Unexpected cert\n"); + context = CertEnumCertificatesInStore(collection, context); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + ok(context->hCertStore == collection, "Unexpected store\n"); + ok(context->cbCertEncoded == sizeof(bigCert2) - 1, + "Expected size %d, got %ld\n", sizeof(bigCert2) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert2, + context->cbCertEncoded), "Unexpected cert\n"); + context = CertEnumCertificatesInStore(collection, context); + ok(!context, "Unexpected cert\n"); + } + } + + /* Adding a collection to a collection is legal */ + collection2 = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + ret = CertAddStoreToCollection(collection2, collection, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + ok(ret, "CertAddStoreToCollection failed: %08lx\n", GetLastError()); + /* check the contents of collection2 */ + context = CertEnumCertificatesInStore(collection2, NULL); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + ok(context->hCertStore == collection2, "Unexpected store\n"); + ok(context->cbCertEncoded == sizeof(bigCert) - 1, + "Expected size %d, got %ld\n", sizeof(bigCert) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), + "Unexpected cert\n"); + context = CertEnumCertificatesInStore(collection2, context); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + ok(context->hCertStore == collection2, "Unexpected store\n"); + ok(context->cbCertEncoded == sizeof(bigCert2) - 1, + "Expected size %d, got %ld\n", sizeof(bigCert2) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert2, + context->cbCertEncoded), "Unexpected cert\n"); + context = CertEnumCertificatesInStore(collection2, context); + ok(!context, "Unexpected cert\n"); + } + } + + /* I'd like to test closing the collection in the middle of enumeration, + * but my tests have been inconsistent. The first time calling + * CertEnumCertificatesInStore on a closed collection succeeded, while the + * second crashed. So anything appears to be fair game. + * I'd also like to test removing a store from a collection in the middle + * of an enumeration, but my tests in Windows have been inconclusive. + * In one scenario it worked. In another scenario, about a third of the + * time this leads to "random" crashes elsewhere in the code. This + * probably means this is not allowed. + */ + + CertCloseStore(store1, 0); + CertCloseStore(collection, 0); + CertCloseStore(collection2, 0); + + /* Add the same cert to two memory stores, then put them in a collection */ + store1 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store1 != 0, "CertOpenStore failed: %08lx\n", GetLastError()); + store2 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store2 != 0, "CertOpenStore failed: %08lx\n", GetLastError()); + + ret = CertAddEncodedCertificateToStore(store1, X509_ASN_ENCODING, + bigCert, sizeof(bigCert) - 1, CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCertificateToStore failed: %08lx\n", GetLastError()); + ret = CertAddEncodedCertificateToStore(store2, X509_ASN_ENCODING, + bigCert, sizeof(bigCert) - 1, CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCertificateToStore failed: %08lx\n", GetLastError()); + collection = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(collection != 0, "CertOpenStore failed: %08lx\n", GetLastError()); + + ret = CertAddStoreToCollection(collection, store1, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + ok(ret, "CertAddStoreToCollection failed: %08lx\n", GetLastError()); + ret = CertAddStoreToCollection(collection, store2, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + ok(ret, "CertAddStoreToCollection failed: %08lx\n", GetLastError()); + + /* Check that the collection has two copies of the same cert */ + context = CertEnumCertificatesInStore(collection, NULL); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + ok(context->hCertStore == collection, "Unexpected store\n"); + ok(context->cbCertEncoded == sizeof(bigCert) - 1, + "Expected size %d, got %ld\n", sizeof(bigCert) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), + "Unexpected cert\n"); + context = CertEnumCertificatesInStore(collection, context); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + ok(context->hCertStore == collection, "Unexpected store\n"); + ok(context->cbCertEncoded == sizeof(bigCert) - 1, + "Expected size %d, got %ld\n", sizeof(bigCert) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), + "Unexpected cert\n"); + context = CertEnumCertificatesInStore(collection, context); + ok(context == NULL, "Unexpected cert\n"); + } + } + + /* The following would check whether I can delete an identical cert, rather + * than one enumerated from the store. It crashes, so that means I must + * only call CertDeleteCertificateFromStore with contexts enumerated from + * the store. + context = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, + sizeof(bigCert) - 1); + ok(context != NULL, "CertCreateCertificateContext failed: %08lx\n", + GetLastError()); + if (context) + { + ret = CertDeleteCertificateFromStore(collection, context); + printf("ret is %d, GetLastError is %08lx\n", ret, GetLastError()); + CertFreeCertificateContext(context); + } + */ + + /* Now check deleting from the collection. */ + context = CertEnumCertificatesInStore(collection, NULL); + ok(context != NULL, "Expected a valid context\n"); + if (context) + { + CertDeleteCertificateFromStore(context); + /* store1 should now be empty */ + context = CertEnumCertificatesInStore(store1, NULL); + ok(!context, "Unexpected cert\n"); + /* and there should be one certificate in the collection */ + context = CertEnumCertificatesInStore(collection, NULL); + ok(context != NULL, "Expected a valid cert\n"); + if (context) + { + ok(context->hCertStore == collection, "Unexpected store\n"); + ok(context->cbCertEncoded == sizeof(bigCert) - 1, + "Expected size %d, got %ld\n", sizeof(bigCert) - 1, + context->cbCertEncoded); + ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), + "Unexpected cert\n"); + } + context = CertEnumCertificatesInStore(collection, context); + ok(context == NULL, "Unexpected cert\n"); + } + + /* Finally, test removing stores from the collection. No return value, so + * it's a bit funny to test. + */ + /* This crashes + CertRemoveStoreFromCollection(NULL, NULL); + */ + /* This "succeeds," no crash, no last error set */ + SetLastError(0xdeadbeef); + CertRemoveStoreFromCollection(store2, collection); + ok(GetLastError() == 0xdeadbeef, + "Didn't expect an error to be set: %08lx\n", GetLastError()); + + /* After removing store2, the collection should be empty */ + SetLastError(0xdeadbeef); + CertRemoveStoreFromCollection(collection, store2); + ok(GetLastError() == 0xdeadbeef, + "Didn't expect an error to be set: %08lx\n", GetLastError()); + context = CertEnumCertificatesInStore(collection, NULL); + ok(!context, "Unexpected cert\n"); + + CertCloseStore(collection, 0); + CertCloseStore(store2, 0); + CertCloseStore(store1, 0); +} + +static void testCertProperties(void) +{ + PCCERT_CONTEXT context = CertCreateCertificateContext(X509_ASN_ENCODING, + bigCert, sizeof(bigCert) - 1); + + ok(context != NULL, "CertCreateCertificateContext failed: %08lx\n", + GetLastError()); + if (context) + { + DWORD propID, numProps, access, size; + BOOL ret; + BYTE hash[20] = { 0 }, hashProperty[20]; + CRYPT_DATA_BLOB blob; + + /* This crashes + propID = CertEnumCertificateContextProperties(NULL, 0); + */ + + propID = 0; + numProps = 0; + do { + propID = CertEnumCertificateContextProperties(context, propID); + if (propID) + numProps++; + } while (propID != 0); + ok(numProps == 0, "Expected 0 properties, got %ld\n", numProps); + + /* Tests with a NULL cert context. Prop ID 0 fails.. */ + ret = CertSetCertificateContextProperty(NULL, 0, 0, NULL); + ok(!ret && GetLastError() == + HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* while this just crashes. + ret = CertSetCertificateContextProperty(NULL, + CERT_KEY_PROV_HANDLE_PROP_ID, 0, NULL); + */ + + ret = CertSetCertificateContextProperty(context, 0, 0, NULL); + ok(!ret && GetLastError() == + HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* Can't set the cert property directly, this crashes. + ret = CertSetCertificateContextProperty(context, + CERT_CERT_PROP_ID, 0, bigCert2); + */ + + /* This crashes. + ret = CertGetCertificateContextProperty(context, + CERT_ACCESS_STATE_PROP_ID, 0, NULL); + */ + size = sizeof(access); + ret = CertGetCertificateContextProperty(context, + CERT_ACCESS_STATE_PROP_ID, &access, &size); + ok(ret, "CertGetCertificateContextProperty failed: %08lx\n", + GetLastError()); + ok(!(access & CERT_ACCESS_STATE_WRITE_PERSIST_FLAG), + "Didn't expect a persisted cert\n"); + /* Trying to set this "read only" property crashes. + access |= CERT_ACCESS_STATE_WRITE_PERSIST_FLAG; + ret = CertSetCertificateContextProperty(context, + CERT_ACCESS_STATE_PROP_ID, 0, &access); + */ + + /* Can I set the hash to an invalid hash? */ + blob.pbData = hash; + blob.cbData = sizeof(hash); + ret = CertSetCertificateContextProperty(context, CERT_HASH_PROP_ID, 0, + &blob); + ok(ret, "CertSetCertificateContextProperty failed: %08lx\n", + GetLastError()); + size = sizeof(hashProperty); + ret = CertGetCertificateContextProperty(context, CERT_HASH_PROP_ID, + hashProperty, &size); + ok(!memcmp(hashProperty, hash, sizeof(hash)), "Unexpected hash\n"); + /* Delete the (bogus) hash, and get the real one */ + ret = CertSetCertificateContextProperty(context, CERT_HASH_PROP_ID, 0, + NULL); + ok(ret, "CertSetCertificateContextProperty failed: %08lx\n", + GetLastError()); + size = sizeof(hash); + ret = CryptHashCertificate(0, 0, 0, bigCert, sizeof(bigCert) - 1, + hash, &size); + ok(ret, "CryptHashCertificate failed: %08lx\n", GetLastError()); + ret = CertGetCertificateContextProperty(context, CERT_HASH_PROP_ID, + hashProperty, &size); + ok(ret, "CertGetCertificateContextProperty failed: %08lx\n", + GetLastError()); + ok(!memcmp(hash, hashProperty, sizeof(hash)), "Unexpected hash\n"); + + /* Now that the hash property is set, we should get one property when + * enumerating. + */ + propID = 0; + numProps = 0; + do { + propID = CertEnumCertificateContextProperties(context, propID); + if (propID) + numProps++; + } while (propID != 0); + ok(numProps == 1, "Expected 1 properties, got %ld\n", numProps); + + CertFreeCertificateContext(context); + } +} + +START_TEST(cert) +{ + testCryptHashCert(); + + /* various combinations of CertOpenStore */ + testMemStore(); + testCollectionStore(); + + testCertProperties(); +} diff -urN wine-20050725/dlls/crypt32/tests/encode.c wine-20050830/dlls/crypt32/tests/encode.c --- wine-20050725/dlls/crypt32/tests/encode.c 2005-07-14 12:14:22.000000000 +0200 +++ wine-20050830/dlls/crypt32/tests/encode.c 2005-08-29 16:12:44.000000000 +0200 @@ -184,7 +184,6 @@ static const char bigInt[] = { 2, 5, 0xff, 0xfe, 0xff, 0xfe, 0xff }; static const char testStr[] = { 0x16, 4, 't', 'e', 's', 't' }; static const BYTE longForm[] = { 2, 0x81, 0x01, 0x01 }; - static const BYTE tooBig[] = { 0x02, 0x84, 0xff, 0xff, 0xff, 0xff }; static const BYTE bigBogus[] = { 0x02, 0x84, 0x01, 0xff, 0xff, 0xf9 }; BYTE *buf = NULL; DWORD bufSize = 0; @@ -303,15 +302,15 @@ } /* Try to decode some bogus large items */ /* The buffer size is smaller than the encoded length, so this should fail - * with CRYPT_E_ASN1_EOD if it's being decoded. It's failing with - * CRYPT_E_ASN1_LARGE, meaning there's a limit on the size decoded. - * The magic limit under XP seems to be 0x061a8000 bytes--more than this - * fails with CRYPT_E_ASN1_LARGE. - */ + * with CRYPT_E_ASN1_EOD if it's being decoded. + * Under XP it fails with CRYPT_E_ASN1_LARGE, which means there's a limit + * on the size decoded, but in ME it fails with CRYPT_E_ASN1_EOD or crashes. + * So this test unfortunately isn't useful. ret = CryptDecodeObjectEx(dwEncoding, X509_MULTI_BYTE_INTEGER, tooBig, 0x7fffffff, CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); ok(!ret && GetLastError() == CRYPT_E_ASN1_LARGE, "Expected CRYPT_E_ASN1_LARGE, got %08lx\n", GetLastError()); + */ /* This will try to decode the buffer and overflow it, check that it's * caught. */ @@ -834,6 +833,229 @@ } } +static const BYTE emptyAltName[] = { 0x30, 0x00 }; +static const BYTE emptyURL[] = { 0x30, 0x02, 0x86, 0x00 }; +static const WCHAR url[] = { 'h','t','t','p',':','/','/','w','i','n','e', + 'h','q','.','o','r','g',0 }; +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 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 }; +static const BYTE localhost[] = { 127, 0, 0, 1 }; +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; + DWORD size = 0; + BOOL ret; + + /* Test with empty info */ + ret = CryptEncodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + if (buf) + { + ok(size == sizeof(emptyAltName), "Expected size %d, got %ld\n", + sizeof(emptyAltName), size); + ok(!memcmp(buf, emptyAltName, size), "Unexpected value\n"); + LocalFree(buf); + } + /* Test with an empty entry */ + info.cAltEntry = 1; + info.rgAltEntry = &entry; + ret = CryptEncodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx\n", + GetLastError()); + /* Test with an empty pointer */ + entry.dwAltNameChoice = CERT_ALT_NAME_URL; + ret = CryptEncodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + if (buf) + { + ok(size == sizeof(emptyURL), "Expected size %d, got %ld\n", + sizeof(emptyURL), size); + ok(!memcmp(buf, emptyURL, size), "Unexpected value\n"); + LocalFree(buf); + } + /* Test with a real URL */ + U(entry).pwszURL = (LPWSTR)url; + ret = CryptEncodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + if (buf) + { + ok(size == sizeof(encodedURL), "Expected size %d, got %ld\n", + sizeof(encodedURL), size); + ok(!memcmp(buf, encodedURL, size), "Unexpected value\n"); + LocalFree(buf); + } + /* Now with the URL containing an invalid IA5 char */ + U(entry).pwszURL = (LPWSTR)nihongo; + 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()); + /* Now with the URL missing a scheme */ + U(entry).pwszURL = (LPWSTR)dnsName; + ret = CryptEncodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + /* This succeeds, but it shouldn't, so don't worry about conforming */ + LocalFree(buf); + } + /* Now with a DNS name */ + entry.dwAltNameChoice = CERT_ALT_NAME_DNS_NAME; + ret = CryptEncodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + ok(size == sizeof(encodedDnsName), "Expected size %d, got %ld\n", + sizeof(encodedDnsName), size); + ok(!memcmp(buf, encodedDnsName, size), "Unexpected value\n"); + LocalFree(buf); + } + /* Test with an IP address */ + entry.dwAltNameChoice = CERT_ALT_NAME_IP_ADDRESS; + U(entry).IPAddress.cbData = sizeof(localhost); + U(entry).IPAddress.pbData = (LPBYTE)localhost; + ret = CryptEncodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + if (buf) + { + ok(size == sizeof(encodedIPAddr), "Expected size %d, got %ld\n", + sizeof(encodedIPAddr), size); + ok(!memcmp(buf, encodedIPAddr, size), "Unexpected value\n"); + LocalFree(buf); + } +} + +static void test_decodeAltName(DWORD dwEncoding) +{ + static const BYTE unimplementedType[] = { 0x30, 0x06, 0x85, 0x04, 0x7f, + 0x00, 0x00, 0x01 }; + static const BYTE bogusType[] = { 0x30, 0x06, 0x89, 0x04, 0x7f, 0x00, 0x00, + 0x01 }; + BOOL ret; + BYTE *buf = NULL; + DWORD bufSize = 0; + CERT_ALT_NAME_INFO *info; + + /* Test some bogus ones first */ + ret = CryptDecodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, + unimplementedType, sizeof(unimplementedType), CRYPT_DECODE_ALLOC_FLAG, + NULL, (BYTE *)&buf, &bufSize); + ok(!ret && GetLastError() == CRYPT_E_ASN1_BADTAG, + "Expected CRYPT_E_ASN1_BADTAG, got %08lx\n", GetLastError()); + ret = CryptDecodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, + bogusType, sizeof(bogusType), CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, + &bufSize); + ok(!ret && GetLastError() == CRYPT_E_ASN1_CORRUPT, + "Expected CRYPT_E_ASN1_CORRUPT, got %08lx\n", GetLastError()); + /* Now expected cases */ + ret = CryptDecodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, emptyAltName, + emptyAltName[1] + 2, CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, + &bufSize); + ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + info = (CERT_ALT_NAME_INFO *)buf; + + ok(info->cAltEntry == 0, "Expected 0 entries, got %ld\n", + info->cAltEntry); + LocalFree(buf); + } + ret = CryptDecodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, emptyURL, + emptyURL[1] + 2, CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, + &bufSize); + ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + info = (CERT_ALT_NAME_INFO *)buf; + + ok(info->cAltEntry == 1, "Expected 1 entries, got %ld\n", + info->cAltEntry); + ok(info->rgAltEntry[0].dwAltNameChoice == CERT_ALT_NAME_URL, + "Expected CERT_ALT_NAME_URL, got %ld\n", + info->rgAltEntry[0].dwAltNameChoice); + ok(U(info->rgAltEntry[0]).pwszURL == NULL || !*U(info->rgAltEntry[0]).pwszURL, + "Expected empty URL\n"); + LocalFree(buf); + } + ret = CryptDecodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, encodedURL, + encodedURL[1] + 2, CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, + &bufSize); + ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + info = (CERT_ALT_NAME_INFO *)buf; + + ok(info->cAltEntry == 1, "Expected 1 entries, got %ld\n", + info->cAltEntry); + ok(info->rgAltEntry[0].dwAltNameChoice == CERT_ALT_NAME_URL, + "Expected CERT_ALT_NAME_URL, got %ld\n", + info->rgAltEntry[0].dwAltNameChoice); + ok(!lstrcmpW(U(info->rgAltEntry[0]).pwszURL, url), "Unexpected URL\n"); + LocalFree(buf); + } + ret = CryptDecodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, encodedDnsName, + encodedDnsName[1] + 2, CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, + &bufSize); + ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + info = (CERT_ALT_NAME_INFO *)buf; + + ok(info->cAltEntry == 1, "Expected 1 entries, got %ld\n", + info->cAltEntry); + ok(info->rgAltEntry[0].dwAltNameChoice == CERT_ALT_NAME_DNS_NAME, + "Expected CERT_ALT_NAME_DNS_NAME, got %ld\n", + info->rgAltEntry[0].dwAltNameChoice); + ok(!lstrcmpW(U(info->rgAltEntry[0]).pwszDNSName, dnsName), + "Unexpected DNS name\n"); + LocalFree(buf); + } + ret = CryptDecodeObjectEx(dwEncoding, X509_ALTERNATE_NAME, encodedIPAddr, + encodedIPAddr[1] + 2, CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, + &bufSize); + ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + info = (CERT_ALT_NAME_INFO *)buf; + + ok(info->cAltEntry == 1, "Expected 1 entries, got %ld\n", + info->cAltEntry); + ok(info->rgAltEntry[0].dwAltNameChoice == CERT_ALT_NAME_IP_ADDRESS, + "Expected CERT_ALT_NAME_IP_ADDRESS, got %ld\n", + info->rgAltEntry[0].dwAltNameChoice); + ok(U(info->rgAltEntry[0]).IPAddress.cbData == sizeof(localhost), + "Unexpected IP address length %ld\n", + U(info->rgAltEntry[0]).IPAddress.cbData); + ok(!memcmp(U(info->rgAltEntry[0]).IPAddress.pbData, localhost, + sizeof(localhost)), "Unexpected IP address value\n"); + LocalFree(buf); + } +} + struct encodedOctets { const BYTE *val; @@ -1590,13 +1812,16 @@ /* 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, + ok(!ret && (GetLastError() == CRYPT_E_ASN1_CORRUPT || + GetLastError() == CRYPT_E_ASN1_BADTAG), "Expected CRYPT_E_ASN1_CORRUPT, got %08lx\n", GetLastError()); } /* Now check with serial number, subject and issuer specified */ @@ -1696,6 +1921,244 @@ } } +static const BYTE v1CRL[] = { 0x30, 0x15, 0x30, 0x02, 0x06, 0x00, 0x18, 0x0f, + 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x5a }; +static const BYTE v2CRL[] = { 0x30, 0x18, 0x02, 0x01, 0x01, 0x30, 0x02, 0x06, + 0x00, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x5a }; +static const BYTE v1CRLWithIssuer[] = { 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 }; +static const BYTE v1CRLWithIssuerAndEmptyEntry[] = { 0x30, 0x43, 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, 0x15, 0x30, 0x13, 0x02, 0x00, 0x18, 0x0f, 0x31, 0x36, + 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a }; +static const BYTE v1CRLWithIssuerAndEntry[] = { 0x30, 0x44, 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, 0x16, 0x30, 0x14, 0x02, 0x01, 0x01, 0x18, 0x0f, 0x31, 0x36, + 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a }; +static const BYTE v1CRLWithExt[] = { 0x30, 0x5a, 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, 0x2c, 0x30, 0x2a, 0x02, 0x01, 0x01, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, + 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x14, + 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, + 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 }; + +static void test_encodeCRLToBeSigned(DWORD dwEncoding) +{ + BOOL ret; + BYTE *buf = NULL; + DWORD size = 0; + CRL_INFO info = { 0 }; + CRL_ENTRY entry = { { 0 }, { 0 }, 0, 0 }; + + /* Test with a V1 CRL */ + ret = CryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + ok(size == sizeof(v1CRL), "Expected size %d, got %ld\n", + sizeof(v1CRL), size); + ok(!memcmp(buf, v1CRL, size), "Got unexpected value\n"); + LocalFree(buf); + } + /* Test v2 CRL */ + info.dwVersion = CRL_V2; + ret = CryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + ok(size == v2CRL[1] + 2, "Expected size %d, got %ld\n", + v2CRL[1] + 2, size); + ok(!memcmp(buf, v2CRL, size), "Got unexpected value\n"); + LocalFree(buf); + } + /* v1 CRL with a name */ + info.dwVersion = CRL_V1; + info.Issuer.cbData = sizeof(encodedCommonName); + info.Issuer.pbData = (BYTE *)encodedCommonName; + ret = CryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + ok(size == sizeof(v1CRLWithIssuer), "Expected size %d, got %ld\n", + sizeof(v1CRLWithIssuer), size); + ok(!memcmp(buf, v1CRLWithIssuer, size), "Got unexpected value\n"); + LocalFree(buf); + } + /* v1 CRL with a name and a NULL entry pointer */ + info.cCRLEntry = 1; + ret = CryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08lx\n", GetLastError()); + /* now set an empty entry */ + info.rgCRLEntry = &entry; + ret = CryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + if (buf) + { + ok(size == sizeof(v1CRLWithIssuerAndEmptyEntry), + "Expected size %d, got %ld\n", sizeof(v1CRLWithIssuerAndEmptyEntry), + size); + ok(!memcmp(buf, v1CRLWithIssuerAndEmptyEntry, size), + "Got unexpected value\n"); + LocalFree(buf); + } + /* an entry with a serial number */ + entry.SerialNumber.cbData = sizeof(serialNum); + entry.SerialNumber.pbData = (BYTE *)serialNum; + ret = CryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + if (buf) + { + ok(size == sizeof(v1CRLWithIssuerAndEntry), + "Expected size %d, got %ld\n", sizeof(v1CRLWithIssuerAndEntry), size); + ok(!memcmp(buf, v1CRLWithIssuerAndEntry, size), + "Got unexpected value\n"); + LocalFree(buf); + } + /* and finally, an entry with an extension */ + entry.cExtension = 1; + entry.rgExtension = &criticalExt; + ret = CryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + ok(size == sizeof(v1CRLWithExt), "Expected size %d, got %ld\n", + sizeof(v1CRLWithExt), size); + ok(!memcmp(buf, v1CRLWithExt, size), "Got unexpected value\n"); + LocalFree(buf); + } +} + +static void test_decodeCRLToBeSigned(DWORD dwEncoding) +{ + static const BYTE *corruptCRLs[] = { v1CRL, v2CRL }; + BOOL ret; + BYTE *buf = NULL; + DWORD size = 0, i; + + for (i = 0; i < sizeof(corruptCRLs) / sizeof(corruptCRLs[0]); i++) + { + 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), + "Expected CRYPT_E_ASN1_CORRUPT, got %08lx\n", GetLastError()); + } + /* at a minimum, a CRL must contain an issuer: */ + ret = CryptDecodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, + v1CRLWithIssuer, v1CRLWithIssuer[1] + 2, CRYPT_DECODE_ALLOC_FLAG, NULL, + (BYTE *)&buf, &size); + ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + CRL_INFO *info = (CRL_INFO *)buf; + + ok(size >= sizeof(CRL_INFO), "Expected size at least %d, got %ld\n", + sizeof(CRL_INFO), size); + ok(info->cCRLEntry == 0, "Expected 0 CRL entries, got %ld\n", + info->cCRLEntry); + ok(info->Issuer.cbData == sizeof(encodedCommonName), + "Expected issuer of %d bytes, got %ld\n", sizeof(encodedCommonName), + info->Issuer.cbData); + ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData), + "Unexpected issuer\n"); + LocalFree(buf); + } + /* check decoding with an empty CRL entry */ + ret = CryptDecodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, + v1CRLWithIssuerAndEmptyEntry, v1CRLWithIssuerAndEmptyEntry[1] + 2, + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + todo_wine ok(!ret && GetLastError() == CRYPT_E_ASN1_CORRUPT, + "Expected CRYPT_E_ASN1_CORRUPT, got %08lx\n", GetLastError()); + /* with a real CRL entry */ + ret = CryptDecodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, + v1CRLWithIssuerAndEntry, v1CRLWithIssuerAndEntry[1] + 2, + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + CRL_INFO *info = (CRL_INFO *)buf; + CRL_ENTRY *entry; + + ok(size >= sizeof(CRL_INFO), "Expected size at least %d, got %ld\n", + sizeof(CRL_INFO), size); + ok(info->cCRLEntry == 1, "Expected 1 CRL entries, got %ld\n", + info->cCRLEntry); + ok(info->rgCRLEntry != NULL, "Expected a valid CRL entry array\n"); + entry = info->rgCRLEntry; + ok(entry->SerialNumber.cbData == 1, + "Expected serial number size 1, got %ld\n", + entry->SerialNumber.cbData); + ok(*entry->SerialNumber.pbData == *serialNum, + "Expected serial number %d, got %d\n", *serialNum, + *entry->SerialNumber.pbData); + ok(info->Issuer.cbData == sizeof(encodedCommonName), + "Expected issuer of %d bytes, got %ld\n", sizeof(encodedCommonName), + 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, + v1CRLWithExt, sizeof(v1CRLWithExt), CRYPT_DECODE_ALLOC_FLAG, + NULL, (BYTE *)&buf, &size); + ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); + if (buf) + { + CRL_INFO *info = (CRL_INFO *)buf; + CRL_ENTRY *entry; + + ok(size >= sizeof(CRL_INFO), "Expected size at least %d, got %ld\n", + sizeof(CRL_INFO), size); + ok(info->cCRLEntry == 1, "Expected 1 CRL entries, got %ld\n", + info->cCRLEntry); + ok(info->rgCRLEntry != NULL, "Expected a valid CRL entry array\n"); + entry = info->rgCRLEntry; + ok(entry->SerialNumber.cbData == 1, + "Expected serial number size 1, got %ld\n", + entry->SerialNumber.cbData); + ok(*entry->SerialNumber.pbData == *serialNum, + "Expected serial number %d, got %d\n", *serialNum, + *entry->SerialNumber.pbData); + ok(info->Issuer.cbData == sizeof(encodedCommonName), + "Expected issuer of %d bytes, got %ld\n", sizeof(encodedCommonName), + info->Issuer.cbData); + ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData), + "Unexpected issuer\n"); + /* Oddly, the extensions don't seem to be decoded. Is this just an MS + * bug, or am I missing something? + */ + ok(info->cExtension == 0, "Expected 0 extensions, got %ld\n", + info->cExtension); + } +} + static void test_registerOIDFunction(void) { static const WCHAR bogusDll[] = { 'b','o','g','u','s','.','d','l','l',0 }; @@ -1766,6 +2229,8 @@ test_decodeFiletime(encodings[i]); test_encodeName(encodings[i]); test_decodeName(encodings[i]); + test_encodeAltName(encodings[i]); + test_decodeAltName(encodings[i]); test_encodeOctets(encodings[i]); test_decodeOctets(encodings[i]); test_encodeBits(encodings[i]); @@ -1782,6 +2247,8 @@ test_decodeCertToBeSigned(encodings[i]); test_encodeCert(encodings[i]); test_decodeCert(encodings[i]); + test_encodeCRLToBeSigned(encodings[i]); + test_decodeCRLToBeSigned(encodings[i]); } test_registerOIDFunction(); } diff -urN wine-20050725/dlls/crypt32/tests/main.c wine-20050830/dlls/crypt32/tests/main.c --- wine-20050725/dlls/crypt32/tests/main.c 2005-07-07 22:27:55.000000000 +0200 +++ wine-20050830/dlls/crypt32/tests/main.c 2005-08-29 11:38:19.000000000 +0200 @@ -116,9 +116,8 @@ static void test_findAttribute(void) { PCRYPT_ATTRIBUTE ret; - CRYPT_ATTR_BLOB blobs[] = { - { 3, "\x02\x01\x01" }, - }; + BYTE blobbin[] = {0x02,0x01,0x01}; + CRYPT_ATTR_BLOB blobs[] = { { sizeof blobbin, blobbin }, }; CRYPT_ATTRIBUTE attr = { "1.2.3", sizeof(blobs) / sizeof(blobs[0]), blobs }; /* returns NULL, last error not set */ @@ -158,7 +157,8 @@ static void test_findExtension(void) { PCERT_EXTENSION ret; - CERT_EXTENSION ext = { "1.2.3", TRUE, { 3, "\x02\x01\x01" } }; + BYTE blobbin[] = {0x02,0x01,0x01}; + CERT_EXTENSION ext = { "1.2.3", TRUE, { sizeof blobbin, blobbin } }; /* returns NULL, last error not set */ SetLastError(0xdeadbeef); @@ -197,8 +197,9 @@ static void test_findRDNAttr(void) { PCERT_RDN_ATTR ret; + BYTE bin[] = { 0x16,0x09,'J','u','a','n',' ','L','a','n','g' }; CERT_RDN_ATTR attrs[] = { - { "1.2.3", CERT_RDN_IA5_STRING, { 11, "\x16\x09Juan Lang" } }, + { "1.2.3", CERT_RDN_IA5_STRING, { sizeof bin, bin } }, }; CERT_RDN rdns[] = { { sizeof(attrs) / sizeof(attrs[0]), attrs }, diff -urN wine-20050725/dlls/crypt32/tests/protectdata.c wine-20050830/dlls/crypt32/tests/protectdata.c --- wine-20050725/dlls/crypt32/tests/protectdata.c 2005-05-24 11:58:26.000000000 +0200 +++ wine-20050830/dlls/crypt32/tests/protectdata.c 2005-08-29 11:38:19.000000000 +0200 @@ -144,7 +144,7 @@ ok(plain.pbData!=NULL,"Plain DATA_BLOB missing data\n"); ok(plain.cbData==strlen(secret)+1,"Plain DATA_BLOB wrong length\n"); - ok(!strcmp(plain.pbData,secret),"Plain does not match secret\n"); + ok(!strcmp((const char*)plain.pbData,secret),"Plain does not match secret\n"); ok(data_desc!=NULL,"Description not allocated\n"); ok(!lstrcmpW(data_desc,desc),"Description does not match\n"); @@ -171,7 +171,7 @@ ok(plain.pbData!=NULL,"Plain DATA_BLOB missing data\n"); ok(plain.cbData==strlen(secret)+1,"Plain DATA_BLOB wrong length\n"); - ok(!strcmp(plain.pbData,secret),"Plain does not match secret\n"); + ok(!strcmp((const char*)plain.pbData,secret),"Plain does not match secret\n"); ok(data_desc!=NULL,"Description not allocated\n"); ok(!lstrcmpW(data_desc,desc),"Description does not match\n"); @@ -191,7 +191,7 @@ ok(plain.pbData!=NULL,"Plain DATA_BLOB missing data\n"); ok(plain.cbData==strlen(secret2)+1,"Plain DATA_BLOB wrong length\n"); - ok(!strcmp(plain.pbData,secret2),"Plain does not match secret\n"); + ok(!strcmp((const char*)plain.pbData,secret2),"Plain does not match secret\n"); ok(data_desc!=NULL,"Description not allocated\n"); ok(data_desc[0]=='\0',"Description not empty\n"); diff -urN wine-20050725/dlls/d3d8/device.c wine-20050830/dlls/d3d8/device.c --- wine-20050725/dlls/d3d8/device.c 2005-07-14 14:19:53.000000000 +0200 +++ wine-20050830/dlls/d3d8/device.c 2005-07-28 12:16:54.000000000 +0200 @@ -1175,7 +1175,7 @@ D3DLOCKED_RECT lockedRect; RECT wantedRect; GLint prev_store; - GLenum prev_read; + GLint prev_read; IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; @@ -2667,8 +2667,8 @@ case D3DRS_STENCILFAIL : { GLenum fail ; - GLenum zpass ; - GLenum zfail ; + GLint zpass ; + GLint zfail ; fail = StencilOp(Value); glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, &zpass); @@ -2683,8 +2683,8 @@ break; case D3DRS_STENCILZFAIL : { - GLenum fail ; - GLenum zpass ; + GLint fail ; + GLint zpass ; GLenum zfail ; glGetIntegerv(GL_STENCIL_FAIL, &fail); @@ -2700,9 +2700,9 @@ break; case D3DRS_STENCILPASS : { - GLenum fail ; + GLint fail ; GLenum zpass ; - GLenum zfail ; + GLint zfail ; glGetIntegerv(GL_STENCIL_FAIL, &fail); checkGLcall("glGetIntegerv(GL_STENCIL_FAIL, &fail);"); diff -urN wine-20050725/dlls/d3d8/directx.c wine-20050830/dlls/d3d8/directx.c --- wine-20050725/dlls/d3d8/directx.c 2005-06-30 20:19:33.000000000 +0200 +++ wine-20050830/dlls/d3d8/directx.c 2005-08-29 11:32:44.000000000 +0200 @@ -236,7 +236,7 @@ This->gl_info.glx_version = ((major & 0x0000FFFF) << 16) | (minor & 0x0000FFFF); gl_string = glXGetClientString(display, GLX_VENDOR); } else { - gl_string = glGetString(GL_VENDOR); + gl_string = (const char*) glGetString(GL_VENDOR); } if (strstr(gl_string, "NVIDIA")) { @@ -249,7 +249,7 @@ TRACE_(d3d_caps)("found GL_VENDOR (%s)->(0x%04x)\n", debugstr_a(gl_string), This->gl_info.gl_vendor); - gl_string = glGetString(GL_VERSION); + gl_string = (const char*) glGetString(GL_VERSION); switch (This->gl_info.gl_vendor) { case VENDOR_NVIDIA: gl_string_cursor = strstr(gl_string, "NVIDIA"); @@ -312,7 +312,7 @@ FIXME_(d3d_caps)("found GL_VERSION (%s)->(0x%08lx)\n", debugstr_a(gl_string), This->gl_info.gl_driver_version); - gl_string = glGetString(GL_RENDERER); + gl_string = (const char*) glGetString(GL_RENDERER); strcpy(This->gl_info.gl_renderer, gl_string); switch (This->gl_info.gl_vendor) { @@ -366,7 +366,7 @@ TRACE_(d3d_caps)("Lights support - max lights=%d\n", gl_max); /* Parse the gl supported features, in theory enabling parts of our code appropriately */ - GL_Extensions = glGetString(GL_EXTENSIONS); + GL_Extensions = (const char*) glGetString(GL_EXTENSIONS); TRACE_(d3d_caps)("GL_Extensions reported:\n"); if (NULL == GL_Extensions) { @@ -526,7 +526,7 @@ } } -#define USE_GL_FUNC(type, pfn) This->gl_info.pfn = (type) glXGetProcAddressARB(#pfn); +#define USE_GL_FUNC(type, pfn) This->gl_info.pfn = (type) glXGetProcAddressARB( (const GLubyte *) #pfn); GL_EXT_FUNCS_GEN; #undef USE_GL_FUNC @@ -552,7 +552,7 @@ } } -#define USE_GL_FUNC(type, pfn) This->gl_info.pfn = (type) glXGetProcAddressARB(#pfn); +#define USE_GL_FUNC(type, pfn) This->gl_info.pfn = (type) glXGetProcAddressARB( (const GLubyte *) #pfn); GLX_EXT_FUNCS_GEN; #undef USE_GL_FUNC @@ -667,7 +667,7 @@ /* Allocate an associated WineD3DDevice object */ localParameters.BackBufferWidth = &pPresentationParameters->BackBufferWidth; localParameters.BackBufferHeight = &pPresentationParameters->BackBufferHeight; - localParameters.BackBufferFormat = &pPresentationParameters->BackBufferFormat; + localParameters.BackBufferFormat = (WINED3DFORMAT *)&pPresentationParameters->BackBufferFormat; localParameters.BackBufferCount = &pPresentationParameters->BackBufferCount; localParameters.MultiSampleType = &pPresentationParameters->MultiSampleType; localParameters.MultiSampleQuality = NULL; /* New at dx9 */ @@ -675,7 +675,7 @@ localParameters.hDeviceWindow = &pPresentationParameters->hDeviceWindow; localParameters.Windowed = &pPresentationParameters->Windowed; localParameters.EnableAutoDepthStencil = &pPresentationParameters->EnableAutoDepthStencil; - localParameters.AutoDepthStencilFormat = &pPresentationParameters->AutoDepthStencilFormat; + localParameters.AutoDepthStencilFormat = (WINED3DFORMAT *)&pPresentationParameters->AutoDepthStencilFormat; localParameters.Flags = &pPresentationParameters->Flags; localParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.PresentationInterval = &pPresentationParameters->FullScreen_PresentationInterval; /* Renamed in dx9 */ diff -urN wine-20050725/dlls/d3d8/drawprim.c wine-20050830/dlls/d3d8/drawprim.c --- wine-20050725/dlls/d3d8/drawprim.c 2005-07-14 14:19:53.000000000 +0200 +++ wine-20050830/dlls/d3d8/drawprim.c 2005-07-28 12:16:54.000000000 +0200 @@ -1375,7 +1375,7 @@ IDirect3DVertexShaderImpl* vertex_shader = NULL; int i; int NumVertexes; - int glPrimType; + GLenum glPrimType; int maxAttribs; IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; diff -urN wine-20050725/dlls/d3d8/surface.c wine-20050830/dlls/d3d8/surface.c --- wine-20050725/dlls/d3d8/surface.c 2005-05-27 22:17:36.000000000 +0200 +++ wine-20050830/dlls/d3d8/surface.c 2005-08-03 23:25:11.000000000 +0200 @@ -21,6 +21,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include @@ -205,7 +206,7 @@ if (This == This->Device->backBuffer || This == This->Device->renderTarget || This == This->Device->frontBuffer) { GLint prev_store; - GLenum prev_read; + GLint prev_read; ENTER_GL(); @@ -329,7 +330,7 @@ if (This == This->Device->backBuffer || This == This->Device->frontBuffer || This == This->Device->renderTarget) { GLint prev_store; - GLenum prev_draw; + GLint prev_draw; GLint prev_rasterpos[4]; ENTER_GL(); diff -urN wine-20050725/dlls/d3d9/cubetexture.c wine-20050830/dlls/d3d9/cubetexture.c --- wine-20050725/dlls/d3d9/cubetexture.c 2005-07-11 22:38:27.000000000 +0200 +++ wine-20050830/dlls/d3d9/cubetexture.c 2005-08-23 11:34:57.000000000 +0200 @@ -209,9 +209,11 @@ const IDirect3DCubeTexture9Vtbl Direct3DCubeTexture9_Vtbl = { + /* IUnknown */ IDirect3DCubeTexture9Impl_QueryInterface, IDirect3DCubeTexture9Impl_AddRef, IDirect3DCubeTexture9Impl_Release, + /* IDirect3DResource9 */ IDirect3DCubeTexture9Impl_GetDevice, IDirect3DCubeTexture9Impl_SetPrivateData, IDirect3DCubeTexture9Impl_GetPrivateData, @@ -220,6 +222,7 @@ IDirect3DCubeTexture9Impl_GetPriority, IDirect3DCubeTexture9Impl_PreLoad, IDirect3DCubeTexture9Impl_GetType, + /* IDirect3DBaseTexture9 */ IDirect3DCubeTexture9Impl_SetLOD, IDirect3DCubeTexture9Impl_GetLOD, IDirect3DCubeTexture9Impl_GetLevelCount, diff -urN wine-20050725/dlls/d3d9/d3d9.spec wine-20050830/dlls/d3d9/d3d9.spec --- wine-20050725/dlls/d3d9/d3d9.spec 2003-07-01 03:09:17.000000000 +0200 +++ wine-20050830/dlls/d3d9/d3d9.spec 2005-08-23 11:34:57.000000000 +0200 @@ -1,5 +1,5 @@ @ stdcall D3D9GetSWInfo() @ stdcall DebugSetMute() @ stdcall Direct3DCreate9(long) -@ stdcall ValidatePixelShader(ptr ptr) -@ stdcall ValidateVertexShader(ptr ptr) +@ stdcall ValidatePixelShader(ptr long long ptr) +@ stdcall ValidateVertexShader(ptr long long ptr) diff -urN wine-20050725/dlls/d3d9/d3d9_main.c wine-20050830/dlls/d3d9/d3d9_main.c --- wine-20050725/dlls/d3d9/d3d9_main.c 2005-05-06 21:38:50.000000000 +0200 +++ wine-20050830/dlls/d3d9/d3d9_main.c 2005-08-23 11:34:57.000000000 +0200 @@ -2,7 +2,8 @@ * Direct3D 9 * * Copyright 2002-2003 Jason Edmeades - * Raphael Junqueira + * Copyright 2002-2003 Raphael Junqueira + * Copyright 2005 Oliver Stieber * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +25,7 @@ #include "initguid.h" #include "d3d9_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DEFAULT_DEBUG_CHANNEL(d3d9); void (*wine_tsx11_lock_ptr)(void) = NULL; void (*wine_tsx11_unlock_ptr)(void) = NULL; @@ -72,15 +73,15 @@ /*********************************************************************** * ValidateVertexShader (D3D9.@) */ -BOOL WINAPI ValidateVertexShader(LPVOID what, LPVOID toto) { - FIXME("(void): stub: %p %p\n", what, toto); +BOOL WINAPI ValidateVertexShader(LPVOID pFunction, int param1, int param2, LPVOID toto/* result? */) { + FIXME("(void): stub: %p %d %d %p\n", pFunction, param1, param2, toto); return TRUE; } /*********************************************************************** * ValidatePixelShader (D3D9.@) */ -BOOL WINAPI ValidatePixelShader(LPVOID what, LPVOID toto) { - FIXME("(void): stub: %p %p\n", what, toto); +BOOL WINAPI ValidatePixelShader(LPVOID pFunction, int param1, int param2, LPVOID toto/* result?*/) { + FIXME("(void): stub: %p %d %d %p\n", pFunction, param1, param2, toto); return TRUE; } diff -urN wine-20050725/dlls/d3d9/d3d9_private.h wine-20050830/dlls/d3d9/d3d9_private.h --- wine-20050725/dlls/d3d9/d3d9_private.h 2005-07-08 13:29:21.000000000 +0200 +++ wine-20050830/dlls/d3d9/d3d9_private.h 2005-08-23 11:34:57.000000000 +0200 @@ -27,7 +27,6 @@ # error You must include config.h to use this header #endif -/* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES */ #include #define NONAMELESSUNION @@ -35,19 +34,10 @@ #define COBJMACROS #include "windef.h" #include "winbase.h" -#include "wingdi.h" #include "winuser.h" #include "wine/debug.h" #include "wine/unicode.h" -#define XMD_H -#include -#include -#ifdef HAVE_GL_GLEXT_H -# include -#endif -#undef XMD_H - #undef APIENTRY #undef CALLBACK #undef WINAPI @@ -57,41 +47,11 @@ #define WINAPI __stdcall #define APIENTRY WINAPI +#include "gdi.h" #include "d3d9.h" #include "d3d9_private.h" #include "wine/wined3d_interface.h" -/* X11 locking */ - -extern void (*wine_tsx11_lock_ptr)(void); -extern void (*wine_tsx11_unlock_ptr)(void); - -/* As GLX relies on X, this is needed */ -#define ENTER_GL() wine_tsx11_lock_ptr() -#define LEAVE_GL() wine_tsx11_unlock_ptr() - -#include - -#include "windef.h" -#include "winbase.h" -#include "d3d9.h" - -/* Device caps */ -#define MAX_PALETTES 256 -#define MAX_STREAMS 16 -#define MAX_ACTIVE_LIGHTS 8 -#define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES -#define MAX_LEVELS 256 - -/* Other useful values */ -#define HIGHEST_RENDER_STATE D3DRS_BLENDOPALPHA -#define HIGHEST_TEXTURE_STATE 29 -#define HIGHEST_TRANSFORMSTATE 512 -#define D3DSBT_RECORDED 0xfffffffe - -#define D3D_VSHADER_MAX_CONSTANTS 96 -#define D3D_PSHADER_MAX_CONSTANTS 32 - /* =========================================================================== Macros =========================================================================== */ @@ -174,61 +134,8 @@ _pWineCaps->MaxVertexShader30InstructionSlots = &_pD3D9Caps->MaxVertexShader30InstructionSlots; \ _pWineCaps->MaxPixelShader30InstructionSlots = &_pD3D9Caps->MaxPixelShader30InstructionSlots; -/* Direct3D9 Interfaces: */ -typedef struct IDirect3D9Impl IDirect3D9Impl; -typedef struct IDirect3DDevice9Impl IDirect3DDevice9Impl; -typedef struct IDirect3DBaseTexture9Impl IDirect3DBaseTexture9Impl; -typedef struct IDirect3DTexture9Impl IDirect3DTexture9Impl; -typedef struct IDirect3DVolumeTexture9Impl IDirect3DVolumeTexture9Impl; -typedef struct IDirect3DCubeTexture9Impl IDirect3DCubeTexture9Impl; -typedef struct IDirect3DVertexBuffer9Impl IDirect3DVertexBuffer9Impl; -typedef struct IDirect3DIndexBuffer9Impl IDirect3DIndexBuffer9Impl; -typedef struct IDirect3DSurface9Impl IDirect3DSurface9Impl; -typedef struct IDirect3DResource9Impl IDirect3DResource9Impl; -typedef struct IDirect3DVolume9Impl IDirect3DVolume9Impl; -typedef struct IDirect3DVertexShader9Impl IDirect3DVertexShader9Impl; -typedef struct IDirect3DVertexDeclaration9Impl IDirect3DVertexDeclaration9Impl; - - -#define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f) -#define D3DCOLOR_G(dw) (((float) (((dw) >> 8) & 0xFF)) / 255.0f) -#define D3DCOLOR_B(dw) (((float) (((dw) >> 0) & 0xFF)) / 255.0f) -#define D3DCOLOR_A(dw) (((float) (((dw) >> 24) & 0xFF)) / 255.0f) - -#define D3DCOLORTOCOLORVALUE(dw, col) \ - (col).r = D3DCOLOR_R(dw); \ - (col).g = D3DCOLOR_G(dw); \ - (col).b = D3DCOLOR_B(dw); \ - (col).a = D3DCOLOR_A(dw); - -#define D3DCOLORTOVECTOR4(dw, vec) \ - (vec).x = D3DCOLOR_R(dw); \ - (vec).y = D3DCOLOR_G(dw); \ - (vec).z = D3DCOLOR_B(dw); \ - (vec).w = D3DCOLOR_A(dw); - -#define D3DCOLORTOGLFLOAT4(dw, vec) \ - (vec)[0] = D3DCOLOR_R(dw); \ - (vec)[1] = D3DCOLOR_G(dw); \ - (vec)[2] = D3DCOLOR_B(dw); \ - (vec)[3] = D3DCOLOR_A(dw); - -typedef struct D3DSHADERVECTORF { - float x; - float y; - float z; - float w; -} D3DSHADERVECTORF; - -typedef struct D3DSHADERVECTORI { - int x; - int y; - int z; - int w; -} D3DSHADERVECTORI; - /* =========================================================================== - The interfactes themselves + D3D9 interfactes =========================================================================== */ /* ---------- */ @@ -243,38 +150,16 @@ /***************************************************************************** * IDirect3D implementation structure */ -struct IDirect3D9Impl +typedef struct IDirect3D9Impl { /* IUnknown fields */ const IDirect3D9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* The WineD3D device */ IWineD3D *WineD3D; - /* IDirect3D9 fields */ -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirect3D9Impl_QueryInterface(LPDIRECT3D9 iface,REFIID refiid,LPVOID *obj); -extern ULONG WINAPI IDirect3D9Impl_AddRef(LPDIRECT3D9 iface); -extern ULONG WINAPI IDirect3D9Impl_Release(LPDIRECT3D9 iface); - -/* IDirect3d9: */ -extern HRESULT WINAPI IDirect3D9Impl_RegisterSoftwareDevice(LPDIRECT3D9 iface, void* pInitializeFunction); -extern UINT WINAPI IDirect3D9Impl_GetAdapterCount(LPDIRECT3D9 iface); -extern HRESULT WINAPI IDirect3D9Impl_GetAdapterIdentifier(LPDIRECT3D9 iface, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier); -extern UINT WINAPI IDirect3D9Impl_GetAdapterModeCount(LPDIRECT3D9 iface, UINT Adapter, D3DFORMAT Format); -extern HRESULT WINAPI IDirect3D9Impl_EnumAdapterModes(LPDIRECT3D9 iface, UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode); -extern HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(LPDIRECT3D9 iface, UINT Adapter, D3DDISPLAYMODE* pMode); -extern HRESULT WINAPI IDirect3D9Impl_CheckDeviceType(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed); -extern HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat); -extern HRESULT WINAPI IDirect3D9Impl_CheckDeviceMultiSampleType(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels); -extern HRESULT WINAPI IDirect3D9Impl_CheckDepthStencilMatch(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat); -extern HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormatConversion(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat); -extern HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps); -extern HMONITOR WINAPI IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9 iface, UINT Adapter); -extern HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface); +} IDirect3D9Impl; /* ---------------- */ /* IDirect3DDevice9 */ @@ -288,113 +173,31 @@ /***************************************************************************** * IDirect3DDevice9 implementation structure */ -struct IDirect3DDevice9Impl +typedef struct IDirect3DDevice9Impl { /* IUnknown fields */ const IDirect3DDevice9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DDevice9 fields */ IWineD3DDevice *WineD3DDevice; - /* FIXME: To be sorted out during move */ - IDirect3DSurface9Impl *frontBuffer; - IDirect3DSurface9Impl *backBuffer; - IDirect3DSurface9Impl *depthStencilBuffer; - - IDirect3DSurface9Impl *renderTarget; - IDirect3DSurface9Impl *stencilBufferTarget; -}; +} IDirect3DDevice9Impl; -/* IUnknown: */ -extern HRESULT WINAPI IDirect3DDevice9Impl_QueryInterface(LPDIRECT3DDEVICE9 iface, REFIID refiid, LPVOID *obj); -extern ULONG WINAPI IDirect3DDevice9Impl_AddRef(LPDIRECT3DDEVICE9 iface); -extern ULONG WINAPI IDirect3DDevice9Impl_Release(LPDIRECT3DDEVICE9 iface); /* IDirect3DDevice9: */ -extern HRESULT WINAPI IDirect3DDevice9Impl_TestCooperativeLevel(LPDIRECT3DDEVICE9 iface); -extern UINT WINAPI IDirect3DDevice9Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE9 iface); -extern HRESULT WINAPI IDirect3DDevice9Impl_EvictManagedRessources(LPDIRECT3DDEVICE9 iface); extern HRESULT WINAPI IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9 iface, IDirect3D9** ppD3D9); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetDeviceCaps(LPDIRECT3DDEVICE9 iface, D3DCAPS9* pCaps); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE* pMode); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetCreationParameters(LPDIRECT3DDEVICE9 iface, D3DDEVICE_CREATION_PARAMETERS* pParameters); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetCursorProperties(LPDIRECT3DDEVICE9 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap); -extern void WINAPI IDirect3DDevice9Impl_SetCursorPosition(LPDIRECT3DDEVICE9 iface, int XScreenSpace, int YScreenSpace, DWORD Flags); -extern BOOL WINAPI IDirect3DDevice9Impl_ShowCursor(LPDIRECT3DDEVICE9 iface, BOOL bShow); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain); extern HRESULT WINAPI IDirect3DDevice9Impl_GetSwapChain(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSwapChain9** pSwapChain); extern UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(LPDIRECT3DDEVICE9 iface); -extern HRESULT WINAPI IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters); -extern HRESULT WINAPI IDirect3DDevice9Impl_Present(LPDIRECT3DDEVICE9 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetBackBuffer(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetRasterStatus(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetDialogBoxMode(LPDIRECT3DDEVICE9 iface, BOOL bEnableDialogs); -extern void WINAPI IDirect3DDevice9Impl_SetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp); -extern void WINAPI IDirect3DDevice9Impl_GetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DGAMMARAMP* pRamp); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateVolumeTexture(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateCubeTexture(LPDIRECT3DDEVICE9 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle); -extern HRESULT WINAPI IDirect3DDevice9Impl_CreateRenderTarget(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle); -extern HRESULT WINAPI IDirect3DDevice9Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle); -extern HRESULT WINAPI IDirect3DDevice9Impl_UpdateSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint); -extern HRESULT WINAPI IDirect3DDevice9Impl_UpdateTexture(LPDIRECT3DDEVICE9 iface, IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTargetData(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetFrontBufferData(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSurface9* pDestSurface); -extern HRESULT WINAPI IDirect3DDevice9Impl_StretchRects(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter); -extern HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color); -extern HRESULT WINAPI IDirect3DDevice9Impl_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pNewZStencilSurface); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9** ppZStencilSurface); -extern HRESULT WINAPI IDirect3DDevice9Impl_BeginScene(LPDIRECT3DDEVICE9 iface); -extern HRESULT WINAPI IDirect3DDevice9Impl_EndScene(LPDIRECT3DDEVICE9 iface); -extern HRESULT WINAPI IDirect3DDevice9Impl_Clear(LPDIRECT3DDEVICE9 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix); -extern HRESULT WINAPI IDirect3DDevice9Impl_MultiplyTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetViewport(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetViewport(LPDIRECT3DDEVICE9 iface, D3DVIEWPORT9* pViewport); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetMaterial(LPDIRECT3DDEVICE9 iface, CONST D3DMATERIAL9* pMaterial); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetMaterial(LPDIRECT3DDEVICE9 iface, D3DMATERIAL9* pMaterial); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST D3DLIGHT9* pLight); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, D3DLIGHT9* pLight); -extern HRESULT WINAPI IDirect3DDevice9Impl_LightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL Enable); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetLightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL* pEnable); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST float* pPlane); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, float* pPlane); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD* pValue); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateStateBlock(LPDIRECT3DDEVICE9 iface, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB); extern HRESULT WINAPI IDirect3DDevice9Impl_BeginStateBlock(LPDIRECT3DDEVICE9 iface); extern HRESULT WINAPI IDirect3DDevice9Impl_EndStateBlock(LPDIRECT3DDEVICE9 iface, IDirect3DStateBlock9** ppSB); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetClipStatus(LPDIRECT3DDEVICE9 iface, CONST D3DCLIPSTATUS9* pClipStatus); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetClipStatus(LPDIRECT3DDEVICE9 iface, D3DCLIPSTATUS9* pClipStatus); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9** ppTexture); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9* pTexture); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value); -extern HRESULT WINAPI IDirect3DDevice9Impl_ValidateDevice(LPDIRECT3DDEVICE9 iface, DWORD* pNumPasses); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, PALETTEENTRY* pEntries); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT *PaletteNumber); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetScissorRect(LPDIRECT3DDEVICE9 iface, CONST RECT* pRect); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetScissorRect(LPDIRECT3DDEVICE9 iface, RECT* pRect); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface, BOOL bSoftware); -extern BOOL WINAPI IDirect3DDevice9Impl_GetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetNPatchMode(LPDIRECT3DDEVICE9 iface, float nSegments); -extern float WINAPI IDirect3DDevice9Impl_GetNPatchMode(LPDIRECT3DDEVICE9 iface); -extern HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount); -extern HRESULT WINAPI IDirect3DDevice9Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount); -extern HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride); -extern HRESULT WINAPI IDirect3DDevice9Impl_DrawIndexedPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride); -extern HRESULT WINAPI IDirect3DDevice9Impl_ProcessVertices(LPDIRECT3DDEVICE9 iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9 iface, CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl); extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(LPDIRECT3DDEVICE9 iface, IDirect3DVertexDeclaration9* pDecl); extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(LPDIRECT3DDEVICE9 iface, IDirect3DVertexDeclaration9** ppDecl); @@ -411,10 +214,6 @@ extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount); extern HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride); extern HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, UINT Divider); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, UINT* Divider); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9* pIndexData); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9** ppIndexData); extern HRESULT WINAPI IDirect3DDevice9Impl_CreatePixelShader(LPDIRECT3DDEVICE9 iface, CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader); extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9* pShader); extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9** ppShader); @@ -424,9 +223,6 @@ extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount); extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount); extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount); -extern HRESULT WINAPI IDirect3DDevice9Impl_DrawRectPatch(LPDIRECT3DDEVICE9 iface, UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo); -extern HRESULT WINAPI IDirect3DDevice9Impl_DrawTriPatch(LPDIRECT3DDEVICE9 iface, UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo); -extern HRESULT WINAPI IDirect3DDevice9Impl_DeletePatch(LPDIRECT3DDEVICE9 iface, UINT Handle); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateQuery(LPDIRECT3DDEVICE9 iface, D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery); @@ -442,31 +238,16 @@ /***************************************************************************** * IDirect3DVolume9 implementation structure */ -struct IDirect3DVolume9Impl +typedef struct IDirect3DVolume9Impl { /* IUnknown fields */ const IDirect3DVolume9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DVolume9 fields */ IWineD3DVolume *wineD3DVolume; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirect3DVolume9Impl_QueryInterface(LPDIRECT3DVOLUME9 iface, REFIID refiid, LPVOID* obj); -extern ULONG WINAPI IDirect3DVolume9Impl_AddRef(LPDIRECT3DVOLUME9 iface); -extern ULONG WINAPI IDirect3DVolume9Impl_Release(LPDIRECT3DVOLUME9 iface); - -/* IDirect3DVolume9: */ -extern HRESULT WINAPI IDirect3DVolume9Impl_GetDevice(LPDIRECT3DVOLUME9 iface, IDirect3DDevice9** ppDevice); -extern HRESULT WINAPI IDirect3DVolume9Impl_SetPrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags); -extern HRESULT WINAPI IDirect3DVolume9Impl_GetPrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData); -extern HRESULT WINAPI IDirect3DVolume9Impl_FreePrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid); -extern HRESULT WINAPI IDirect3DVolume9Impl_GetContainer(LPDIRECT3DVOLUME9 iface, REFIID riid, void** ppContainer); -extern HRESULT WINAPI IDirect3DVolume9Impl_GetDesc(LPDIRECT3DVOLUME9 iface, D3DVOLUME_DESC* pDesc); -extern HRESULT WINAPI IDirect3DVolume9Impl_LockBox(LPDIRECT3DVOLUME9 iface, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags); -extern HRESULT WINAPI IDirect3DVolume9Impl_UnlockBox(LPDIRECT3DVOLUME9 iface); - + +} IDirect3DVolume9Impl; /* ------------------- */ /* IDirect3DSwapChain9 */ @@ -484,10 +265,11 @@ { /* IUnknown fields */ const IDirect3DSwapChain9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DSwapChain9 fields */ IWineD3DSwapChain *wineD3DSwapChain; + } IDirect3DSwapChain9Impl; /* ------------------ */ @@ -502,15 +284,15 @@ /***************************************************************************** * IDirect3DResource9 implementation structure */ -struct IDirect3DResource9Impl +typedef struct IDirect3DResource9Impl { /* IUnknown fields */ const IDirect3DResource9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DResource9 fields */ IWineD3DResource *wineD3DResource; -}; +} IDirect3DResource9Impl; /* IUnknown: */ extern HRESULT WINAPI IDirect3DResource9Impl_QueryInterface(LPDIRECT3DRESOURCE9 iface,REFIID refiid,LPVOID *obj); @@ -540,40 +322,16 @@ /***************************************************************************** * IDirect3DSurface9 implementation structure */ -struct IDirect3DSurface9Impl +typedef struct IDirect3DSurface9Impl { /* IUnknown fields */ const IDirect3DSurface9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DResource9 fields */ IWineD3DSurface *wineD3DSurface; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirect3DSurface9Impl_QueryInterface(LPDIRECT3DSURFACE9 iface, REFIID refiid, LPVOID* obj); -extern ULONG WINAPI IDirect3DSurface9Impl_AddRef(LPDIRECT3DSURFACE9 iface); -extern ULONG WINAPI IDirect3DSurface9Impl_Release(LPDIRECT3DSURFACE9 iface); - -/* IDirect3DSurface9: (Inherited from IDirect3DResource9) */ -extern HRESULT WINAPI IDirect3DSurface9Impl_GetDevice(LPDIRECT3DSURFACE9 iface, IDirect3DDevice9** ppDevice); -extern HRESULT WINAPI IDirect3DSurface9Impl_SetPrivateData(LPDIRECT3DSURFACE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags); -extern HRESULT WINAPI IDirect3DSurface9Impl_GetPrivateData(LPDIRECT3DSURFACE9 iface, REFGUID refguid, void* pData,DWORD* pSizeOfData); -extern HRESULT WINAPI IDirect3DSurface9Impl_FreePrivateData(LPDIRECT3DSURFACE9 iface, REFGUID refguid); -extern DWORD WINAPI IDirect3DSurface9Impl_SetPriority(LPDIRECT3DSURFACE9 iface, DWORD PriorityNew); -extern DWORD WINAPI IDirect3DSurface9Impl_GetPriority(LPDIRECT3DSURFACE9 iface); -extern void WINAPI IDirect3DSurface9Impl_PreLoad(LPDIRECT3DSURFACE9 iface); -extern D3DRESOURCETYPE WINAPI IDirect3DSurface9Impl_GetType(LPDIRECT3DSURFACE9 iface); - -/* IDirect3DSurface9: */ -extern HRESULT WINAPI IDirect3DSurface9Impl_GetContainer(LPDIRECT3DSURFACE9 iface, REFIID riid, void** ppContainer); -extern HRESULT WINAPI IDirect3DSurface9Impl_GetDesc(LPDIRECT3DSURFACE9 iface, D3DSURFACE_DESC *pDesc); -extern HRESULT WINAPI IDirect3DSurface9Impl_LockRect(LPDIRECT3DSURFACE9 iface, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags); -extern HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(LPDIRECT3DSURFACE9 iface); -extern HRESULT WINAPI IDirect3DSurface9Impl_GetDC(LPDIRECT3DSURFACE9 iface, HDC* phdc); -extern HRESULT WINAPI IDirect3DSurface9Impl_ReleaseDC(LPDIRECT3DSURFACE9 iface, HDC hdc); - +} IDirect3DSurface9Impl; /* ---------------------- */ /* IDirect3DVertexBuffer9 */ @@ -587,36 +345,15 @@ /***************************************************************************** * IDirect3DVertexBuffer9 implementation structure */ -struct IDirect3DVertexBuffer9Impl +typedef struct IDirect3DVertexBuffer9Impl { /* IUnknown fields */ const IDirect3DVertexBuffer9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DResource9 fields */ IWineD3DVertexBuffer *wineD3DVertexBuffer; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirect3DVertexBuffer9Impl_QueryInterface(LPDIRECT3DVERTEXBUFFER9 iface,REFIID refiid,LPVOID *obj); -extern ULONG WINAPI IDirect3DVertexBuffer9Impl_AddRef(LPDIRECT3DVERTEXBUFFER9 iface); -extern ULONG WINAPI IDirect3DVertexBuffer9Impl_Release(LPDIRECT3DVERTEXBUFFER9 iface); - -/* IDirect3DVertexBuffer9: (Inherited from IDirect3DResource9) */ -extern HRESULT WINAPI IDirect3DVertexBuffer9Impl_GetDevice(LPDIRECT3DVERTEXBUFFER9 iface, IDirect3DDevice9** ppDevice); -extern HRESULT WINAPI IDirect3DVertexBuffer9Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags); -extern HRESULT WINAPI IDirect3DVertexBuffer9Impl_GetPrivateData(LPDIRECT3DVERTEXBUFFER9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData); -extern HRESULT WINAPI IDirect3DVertexBuffer9Impl_FreePrivateData(LPDIRECT3DVERTEXBUFFER9 iface, REFGUID refguid); -extern DWORD WINAPI IDirect3DVertexBuffer9Impl_SetPriority(LPDIRECT3DVERTEXBUFFER9 iface, DWORD PriorityNew); -extern DWORD WINAPI IDirect3DVertexBuffer9Impl_GetPriority(LPDIRECT3DVERTEXBUFFER9 iface); -extern void WINAPI IDirect3DVertexBuffer9Impl_PreLoad(LPDIRECT3DVERTEXBUFFER9 iface); -extern D3DRESOURCETYPE WINAPI IDirect3DVertexBuffer9Impl_GetType(LPDIRECT3DVERTEXBUFFER9 iface); - -/* IDirect3DVertexBuffer9: */ -extern HRESULT WINAPI IDirect3DVertexBuffer9Impl_Lock(LPDIRECT3DVERTEXBUFFER9 iface, UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags); -extern HRESULT WINAPI IDirect3DVertexBuffer9Impl_Unlock(LPDIRECT3DVERTEXBUFFER9 iface); -extern HRESULT WINAPI IDirect3DVertexBuffer9Impl_GetDesc(LPDIRECT3DVERTEXBUFFER9 iface, D3DVERTEXBUFFER_DESC *pDesc); - +} IDirect3DVertexBuffer9Impl; /* --------------------- */ /* IDirect3DIndexBuffer9 */ @@ -630,36 +367,16 @@ /***************************************************************************** * IDirect3DIndexBuffer9 implementation structure */ -struct IDirect3DIndexBuffer9Impl +typedef struct IDirect3DIndexBuffer9Impl { /* IUnknown fields */ const IDirect3DIndexBuffer9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DResource9 fields */ IWineD3DIndexBuffer *wineD3DIndexBuffer; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirect3DIndexBuffer9Impl_QueryInterface(LPDIRECT3DINDEXBUFFER9 iface,REFIID refiid,LPVOID *obj); -extern ULONG WINAPI IDirect3DIndexBuffer9Impl_AddRef(LPDIRECT3DINDEXBUFFER9 iface); -extern ULONG WINAPI IDirect3DIndexBuffer9Impl_Release(LPDIRECT3DINDEXBUFFER9 iface); - -/* IDirect3DIndexBuffer9: (Inherited from IDirect3DResource9) */ -extern HRESULT WINAPI IDirect3DIndexBuffer9Impl_GetDevice(LPDIRECT3DINDEXBUFFER9 iface, IDirect3DDevice9** ppDevice); -extern HRESULT WINAPI IDirect3DIndexBuffer9Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags); -extern HRESULT WINAPI IDirect3DIndexBuffer9Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData); -extern HRESULT WINAPI IDirect3DIndexBuffer9Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER9 iface, REFGUID refguid); -extern DWORD WINAPI IDirect3DIndexBuffer9Impl_SetPriority(LPDIRECT3DINDEXBUFFER9 iface, DWORD PriorityNew); -extern DWORD WINAPI IDirect3DIndexBuffer9Impl_GetPriority(LPDIRECT3DINDEXBUFFER9 iface); -extern void WINAPI IDirect3DIndexBuffer9Impl_PreLoad(LPDIRECT3DINDEXBUFFER9 iface); -extern D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer9Impl_GetType(LPDIRECT3DINDEXBUFFER9 iface); - -/* IDirect3DIndexBuffer9: */ -extern HRESULT WINAPI IDirect3DIndexBuffer9Impl_Lock(LPDIRECT3DINDEXBUFFER9 iface, UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags); -extern HRESULT WINAPI IDirect3DIndexBuffer9Impl_Unlock(LPDIRECT3DINDEXBUFFER9 iface); -extern HRESULT WINAPI IDirect3DIndexBuffer9Impl_GetDesc(LPDIRECT3DINDEXBUFFER9 iface, D3DINDEXBUFFER_DESC *pDesc); +} IDirect3DIndexBuffer9Impl; /* --------------------- */ /* IDirect3DBaseTexture9 */ @@ -673,15 +390,16 @@ /***************************************************************************** * IDirect3DBaseTexture9 implementation structure */ -struct IDirect3DBaseTexture9Impl +typedef struct IDirect3DBaseTexture9Impl { /* IUnknown fields */ const IDirect3DBaseTexture9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DResource9 fields */ IWineD3DBaseTexture *wineD3DBaseTexture; -}; + +} IDirect3DBaseTexture9Impl; /* IUnknown: */ extern HRESULT WINAPI IDirect3DBaseTexture9Impl_QueryInterface(LPDIRECT3DBASETEXTURE9 iface,REFIID refiid,LPVOID *obj); @@ -719,45 +437,16 @@ /***************************************************************************** * IDirect3DCubeTexture9 implementation structure */ -struct IDirect3DCubeTexture9Impl +typedef struct IDirect3DCubeTexture9Impl { /* IUnknown fields */ const IDirect3DCubeTexture9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DResource9 fields */ IWineD3DCubeTexture *wineD3DCubeTexture; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_QueryInterface(LPDIRECT3DCUBETEXTURE9 iface,REFIID refiid,LPVOID *obj); -extern ULONG WINAPI IDirect3DCubeTexture9Impl_AddRef(LPDIRECT3DCUBETEXTURE9 iface); -extern ULONG WINAPI IDirect3DCubeTexture9Impl_Release(LPDIRECT3DCUBETEXTURE9 iface); - -/* IDirect3DCubeTexture9: (Inherited from IDirect3DResource9) */ -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_GetDevice(LPDIRECT3DCUBETEXTURE9 iface, IDirect3DDevice9** ppDevice); -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags); -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_GetPrivateData(LPDIRECT3DCUBETEXTURE9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData); -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_FreePrivateData(LPDIRECT3DCUBETEXTURE9 iface, REFGUID refguid); -extern DWORD WINAPI IDirect3DCubeTexture9Impl_SetPriority(LPDIRECT3DCUBETEXTURE9 iface, DWORD PriorityNew); -extern DWORD WINAPI IDirect3DCubeTexture9Impl_GetPriority(LPDIRECT3DCUBETEXTURE9 iface); -extern void WINAPI IDirect3DCubeTexture9Impl_PreLoad(LPDIRECT3DCUBETEXTURE9 iface); -extern D3DRESOURCETYPE WINAPI IDirect3DCubeTexture9Impl_GetType(LPDIRECT3DCUBETEXTURE9 iface); - -/* IDirect3DCubeTexture9: (Inherited from IDirect3DBaseTexture9) */ -extern DWORD WINAPI IDirect3DCubeTexture9Impl_SetLOD(LPDIRECT3DCUBETEXTURE9 iface, DWORD LODNew); -extern DWORD WINAPI IDirect3DCubeTexture9Impl_GetLOD(LPDIRECT3DCUBETEXTURE9 iface); -extern DWORD WINAPI IDirect3DCubeTexture9Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE9 iface); -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_SetAutoGenFilterType(LPDIRECT3DCUBETEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType); -extern D3DTEXTUREFILTERTYPE WINAPI IDirect3DCubeTexture9Impl_GetAutoGenFilterType(LPDIRECT3DCUBETEXTURE9 iface); -extern void WINAPI IDirect3DCubeTexture9Impl_GenerateMipSubLevels(LPDIRECT3DCUBETEXTURE9 iface); - -/* IDirect3DCubeTexture9 */ -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE9 iface, UINT Level, D3DSURFACE_DESC* pDesc); -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE9 iface, D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface9** ppCubeMapSurface); -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_LockRect(LPDIRECT3DCUBETEXTURE9 iface, D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags); -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_UnlockRect(LPDIRECT3DCUBETEXTURE9 iface, D3DCUBEMAP_FACES FaceType, UINT Level); -extern HRESULT WINAPI IDirect3DCubeTexture9Impl_AddDirtyRect(LPDIRECT3DCUBETEXTURE9 iface, D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect); + +} IDirect3DCubeTexture9Impl; /* ----------------- */ @@ -772,47 +461,16 @@ /***************************************************************************** * IDirect3DTexture9 implementation structure */ -struct IDirect3DTexture9Impl +typedef struct IDirect3DTexture9Impl { /* IUnknown fields */ const IDirect3DTexture9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DResource9 fields */ IWineD3DTexture *wineD3DTexture; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirect3DTexture9Impl_QueryInterface(LPDIRECT3DTEXTURE9 iface,REFIID refiid,LPVOID *obj); -extern ULONG WINAPI IDirect3DTexture9Impl_AddRef(LPDIRECT3DTEXTURE9 iface); -extern ULONG WINAPI IDirect3DTexture9Impl_Release(LPDIRECT3DTEXTURE9 iface); - -/* IDirect3DTexture9: (Inherited from IDirect3DResource9) */ -extern HRESULT WINAPI IDirect3DTexture9Impl_GetDevice(LPDIRECT3DTEXTURE9 iface, IDirect3DDevice9** ppDevice); -extern HRESULT WINAPI IDirect3DTexture9Impl_SetPrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags); -extern HRESULT WINAPI IDirect3DTexture9Impl_GetPrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData); -extern HRESULT WINAPI IDirect3DTexture9Impl_FreePrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid); -extern DWORD WINAPI IDirect3DTexture9Impl_SetPriority(LPDIRECT3DTEXTURE9 iface, DWORD PriorityNew); -extern DWORD WINAPI IDirect3DTexture9Impl_GetPriority(LPDIRECT3DTEXTURE9 iface); -extern void WINAPI IDirect3DTexture9Impl_PreLoad(LPDIRECT3DTEXTURE9 iface); -extern D3DRESOURCETYPE WINAPI IDirect3DTexture9Impl_GetType(LPDIRECT3DTEXTURE9 iface); - -/* IDirect3DTexture9: (Inherited from IDirect3DBaseTexture9) */ -extern DWORD WINAPI IDirect3DTexture9Impl_SetLOD(LPDIRECT3DTEXTURE9 iface, DWORD LODNew); -extern DWORD WINAPI IDirect3DTexture9Impl_GetLOD(LPDIRECT3DTEXTURE9 iface); -extern DWORD WINAPI IDirect3DTexture9Impl_GetLevelCount(LPDIRECT3DTEXTURE9 iface); -extern HRESULT WINAPI IDirect3DTexture9Impl_SetAutoGenFilterType(LPDIRECT3DTEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType); -extern D3DTEXTUREFILTERTYPE WINAPI IDirect3DTexture9Impl_GetAutoGenFilterType(LPDIRECT3DTEXTURE9 iface); -extern void WINAPI IDirect3DTexture9Impl_GenerateMipSubLevels(LPDIRECT3DTEXTURE9 iface); - -/* IDirect3DTexture9: */ -extern HRESULT WINAPI IDirect3DTexture9Impl_GetLevelDesc(LPDIRECT3DTEXTURE9 iface, UINT Level, D3DSURFACE_DESC* pDesc); -extern HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE9 iface, UINT Level, IDirect3DSurface9** ppSurfaceLevel); -extern HRESULT WINAPI IDirect3DTexture9Impl_LockRect(LPDIRECT3DTEXTURE9 iface, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags); -extern HRESULT WINAPI IDirect3DTexture9Impl_UnlockRect(LPDIRECT3DTEXTURE9 iface, UINT Level); -extern HRESULT WINAPI IDirect3DTexture9Impl_AddDirtyRect(LPDIRECT3DTEXTURE9 iface, CONST RECT* pDirtyRect); - +} IDirect3DTexture9Impl; /* ----------------------- */ /* IDirect3DVolumeTexture9 */ @@ -826,46 +484,16 @@ /***************************************************************************** * IDirect3DVolumeTexture9 implementation structure */ -struct IDirect3DVolumeTexture9Impl +typedef struct IDirect3DVolumeTexture9Impl { /* IUnknown fields */ const IDirect3DVolumeTexture9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DResource9 fields */ IWineD3DVolumeTexture *wineD3DVolumeTexture; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE9 iface,REFIID refiid,LPVOID *obj); -extern ULONG WINAPI IDirect3DVolumeTexture9Impl_AddRef(LPDIRECT3DVOLUMETEXTURE9 iface); -extern ULONG WINAPI IDirect3DVolumeTexture9Impl_Release(LPDIRECT3DVOLUMETEXTURE9 iface); - -/* IDirect3DVolumeTexture9: (Inherited from IDirect3DResource9) */ -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE9 iface, IDirect3DDevice9** ppDevice); -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags); -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData); -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE9 iface, REFGUID refguid); -extern DWORD WINAPI IDirect3DVolumeTexture9Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE9 iface, DWORD PriorityNew); -extern DWORD WINAPI IDirect3DVolumeTexture9Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE9 iface); -extern void WINAPI IDirect3DVolumeTexture9Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE9 iface); -extern D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture9Impl_GetType(LPDIRECT3DVOLUMETEXTURE9 iface); - -/* IDirect3DVolumeTexture9: (Inherited from IDirect3DBaseTexture9) */ -extern DWORD WINAPI IDirect3DVolumeTexture9Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE9 iface, DWORD LODNew); -extern DWORD WINAPI IDirect3DVolumeTexture9Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE9 iface); -extern DWORD WINAPI IDirect3DVolumeTexture9Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE9 iface); -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_SetAutoGenFilterType(LPDIRECT3DVOLUMETEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType); -extern D3DTEXTUREFILTERTYPE WINAPI IDirect3DVolumeTexture9Impl_GetAutoGenFilterType(LPDIRECT3DVOLUMETEXTURE9 iface); -extern void WINAPI IDirect3DVolumeTexture9Impl_GenerateMipSubLevels(LPDIRECT3DVOLUMETEXTURE9 iface); - -/* IDirect3DVolumeTexture9: */ -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, D3DVOLUME_DESC *pDesc); -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, IDirect3DVolume9** ppVolumeLevel); -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_LockBox(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags); -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level); -extern HRESULT WINAPI IDirect3DVolumeTexture9Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE9 iface, CONST D3DBOX* pDirtyBox); - + +} IDirect3DVolumeTexture9Impl; /* ----------------------- */ /* IDirect3DStateBlock9 */ @@ -882,10 +510,11 @@ typedef struct IDirect3DStateBlock9Impl { /* IUnknown fields */ const IDirect3DStateBlock9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DStateBlock9 fields */ IWineD3DStateBlock *wineD3DStateBlock; + } IDirect3DStateBlock9Impl; @@ -899,26 +528,17 @@ extern const IDirect3DVertexDeclaration9Vtbl Direct3DVertexDeclaration9_Vtbl; /***************************************************************************** - * IDirect3DVertexShaderDeclaration implementation structure + * IDirect3DVertexDeclaration implementation structure */ -struct IDirect3DVertexDeclaration9Impl { +typedef struct IDirect3DVertexDeclaration9Impl { /* IUnknown fields */ const IDirect3DVertexDeclaration9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DVertexDeclaration9 fields */ IWineD3DVertexDeclaration *wineD3DVertexDeclaration; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirect3DVertexDeclaration9Impl_QueryInterface(LPDIRECT3DVERTEXDECLARATION9 iface, REFIID refiid, LPVOID* obj); -extern ULONG WINAPI IDirect3DVertexDeclaration9Impl_AddRef(LPDIRECT3DVERTEXDECLARATION9 iface); -extern ULONG WINAPI IDirect3DVertexDeclaration9Impl_Release(LPDIRECT3DVERTEXDECLARATION9 iface); - -/* IDirect3DVertexDeclaration9: */ -extern HRESULT WINAPI IDirect3DVertexDeclaration9Impl_GetDevice(LPDIRECT3DVERTEXDECLARATION9 iface, IDirect3DDevice9** ppDevice); -extern HRESULT WINAPI IDirect3DVertexDeclaration9Impl_GetDeclaration(LPDIRECT3DVERTEXDECLARATION9 iface, D3DVERTEXELEMENT9* pDecl, UINT* pNumElements); - + +} IDirect3DVertexDeclaration9Impl; /* ---------------------- */ /* IDirect3DVertexShader9 */ @@ -932,35 +552,15 @@ /***************************************************************************** * IDirect3DVertexShader implementation structure */ -struct IDirect3DVertexShader9Impl { +typedef struct IDirect3DVertexShader9Impl { /* IUnknown fields */ const IDirect3DVertexShader9Vtbl *lpVtbl; - DWORD ref; - - /* IDirect3DVertexDeclaration9 fields */ - IDirect3DDevice9Impl* Device; + LONG ref; - DWORD* function; - UINT functionLength; - DWORD usage; /* 0 || D3DUSAGE_SOFTWAREPROCESSING */ - DWORD version; - /* run time datas */ - /* - VSHADERDATA* data; - VSHADERINPUTDATA input; - VSHADEROUTPUTDATA output; - */ -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirect3DVertexShader9Impl_QueryInterface(LPDIRECT3DVERTEXSHADER9 iface, REFIID refiid, LPVOID* obj); -extern ULONG WINAPI IDirect3DVertexShader9Impl_AddRef(LPDIRECT3DVERTEXSHADER9 iface); -extern ULONG WINAPI IDirect3DVertexShader9Impl_Release(LPDIRECT3DVERTEXSHADER9 iface); - -/* IDirect3DVertexShader9: */ -extern HRESULT WINAPI IDirect3DVertexShader9Impl_GetDevice(LPDIRECT3DVERTEXSHADER9 iface, IDirect3DDevice9** ppDevice); -extern HRESULT WINAPI IDirect3DVertexShader9Impl_GetFunction(LPDIRECT3DVERTEXSHADER9 iface, VOID* pData, UINT* pSizeOfData); + /* IDirect3DVertexShader9 fields */ + IWineD3DVertexShader *wineD3DVertexShader; +} IDirect3DVertexShader9Impl; /* --------------------- */ /* IDirect3DPixelShader9 */ @@ -977,7 +577,7 @@ typedef struct IDirect3DPixelShader9Impl { /* IUnknown fields */ const IDirect3DPixelShader9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DPixelShader9 fields */ IWineD3DPixelShader *wineD3DPixelShader; @@ -999,10 +599,11 @@ typedef struct IDirect3DQuery9Impl { /* IUnknown fields */ const IDirect3DQuery9Vtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDirect3DQuery9 fields */ IWineD3DQuery *wineD3DQuery; + } IDirect3DQuery9Impl; diff -urN wine-20050725/dlls/d3d9/device.c wine-20050830/dlls/d3d9/device.c --- wine-20050725/dlls/d3d9/device.c 2005-07-07 22:35:05.000000000 +0200 +++ wine-20050830/dlls/d3d9/device.c 2005-08-23 11:34:57.000000000 +0200 @@ -32,7 +32,7 @@ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirect3DDevice9)) { - IDirect3DDevice9Impl_AddRef(iface); + IUnknown_AddRef(iface); *ppobj = This; return D3D_OK; } @@ -168,7 +168,7 @@ localParameters.BackBufferWidth = &pPresentationParameters->BackBufferWidth; localParameters.BackBufferHeight = &pPresentationParameters->BackBufferHeight; - localParameters.BackBufferFormat = &pPresentationParameters->BackBufferFormat; + localParameters.BackBufferFormat = (WINED3DFORMAT *)&pPresentationParameters->BackBufferFormat; localParameters.BackBufferCount = &pPresentationParameters->BackBufferCount; localParameters.MultiSampleType = &pPresentationParameters->MultiSampleType; localParameters.MultiSampleQuality = &pPresentationParameters->MultiSampleQuality; @@ -176,7 +176,7 @@ localParameters.hDeviceWindow = &pPresentationParameters->hDeviceWindow; localParameters.Windowed = &pPresentationParameters->Windowed; localParameters.EnableAutoDepthStencil = &pPresentationParameters->EnableAutoDepthStencil; - localParameters.AutoDepthStencilFormat = &pPresentationParameters->AutoDepthStencilFormat; + localParameters.AutoDepthStencilFormat = (WINED3DFORMAT *)&pPresentationParameters->AutoDepthStencilFormat; localParameters.Flags = &pPresentationParameters->Flags; localParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.PresentationInterval = &pPresentationParameters->PresentationInterval; @@ -813,9 +813,11 @@ const IDirect3DDevice9Vtbl Direct3DDevice9_Vtbl = { + /* IUnknown */ IDirect3DDevice9Impl_QueryInterface, IDirect3DDevice9Impl_AddRef, IDirect3DDevice9Impl_Release, + /* IDirect3DDevice9 */ IDirect3DDevice9Impl_TestCooperativeLevel, IDirect3DDevice9Impl_GetAvailableTextureMem, IDirect3DDevice9Impl_EvictManagedResources, diff -urN wine-20050725/dlls/d3d9/directx.c wine-20050830/dlls/d3d9/directx.c --- wine-20050725/dlls/d3d9/directx.c 2005-06-23 13:05:24.000000000 +0200 +++ wine-20050830/dlls/d3d9/directx.c 2005-08-23 11:34:57.000000000 +0200 @@ -22,7 +22,7 @@ #include "config.h" #include "d3d9_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DEFAULT_DEBUG_CHANNEL(d3d9); /* IDirect3D9 IUnknown parts follow: */ HRESULT WINAPI IDirect3D9Impl_QueryInterface(LPDIRECT3D9 iface, REFIID riid, LPVOID* ppobj) @@ -31,7 +31,7 @@ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirect3D9)) { - IDirect3D9Impl_AddRef(iface); + IUnknown_AddRef(iface); *ppobj = This; return D3D_OK; } @@ -294,7 +294,7 @@ /* Allocate an associated WineD3DDevice object */ localParameters.BackBufferWidth = &pPresentationParameters->BackBufferWidth; localParameters.BackBufferHeight = &pPresentationParameters->BackBufferHeight; - localParameters.BackBufferFormat = &pPresentationParameters->BackBufferFormat; + localParameters.BackBufferFormat = (WINED3DFORMAT *)&pPresentationParameters->BackBufferFormat; localParameters.BackBufferCount = &pPresentationParameters->BackBufferCount; localParameters.MultiSampleType = &pPresentationParameters->MultiSampleType; localParameters.MultiSampleQuality = &pPresentationParameters->MultiSampleQuality; @@ -302,7 +302,7 @@ localParameters.hDeviceWindow = &pPresentationParameters->hDeviceWindow; localParameters.Windowed = &pPresentationParameters->Windowed; localParameters.EnableAutoDepthStencil = &pPresentationParameters->EnableAutoDepthStencil; - localParameters.AutoDepthStencilFormat = &pPresentationParameters->AutoDepthStencilFormat; + localParameters.AutoDepthStencilFormat = (WINED3DFORMAT *)&pPresentationParameters->AutoDepthStencilFormat; localParameters.Flags = &pPresentationParameters->Flags; localParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.PresentationInterval = &pPresentationParameters->PresentationInterval; @@ -323,9 +323,11 @@ const IDirect3D9Vtbl Direct3D9_Vtbl = { + /* IUnknown */ IDirect3D9Impl_QueryInterface, IDirect3D9Impl_AddRef, IDirect3D9Impl_Release, + /* IDirect3D9 */ IDirect3D9Impl_RegisterSoftwareDevice, IDirect3D9Impl_GetAdapterCount, IDirect3D9Impl_GetAdapterIdentifier, diff -urN wine-20050725/dlls/d3d9/indexbuffer.c wine-20050830/dlls/d3d9/indexbuffer.c --- wine-20050725/dlls/d3d9/indexbuffer.c 2005-05-27 22:17:36.000000000 +0200 +++ wine-20050830/dlls/d3d9/indexbuffer.c 2005-08-23 11:34:57.000000000 +0200 @@ -133,9 +133,11 @@ const IDirect3DIndexBuffer9Vtbl Direct3DIndexBuffer9_Vtbl = { + /* IUnknown */ IDirect3DIndexBuffer9Impl_QueryInterface, IDirect3DIndexBuffer9Impl_AddRef, IDirect3DIndexBuffer9Impl_Release, + /* IDirect3DResource9 */ IDirect3DIndexBuffer9Impl_GetDevice, IDirect3DIndexBuffer9Impl_SetPrivateData, IDirect3DIndexBuffer9Impl_GetPrivateData, @@ -144,6 +146,7 @@ IDirect3DIndexBuffer9Impl_GetPriority, IDirect3DIndexBuffer9Impl_PreLoad, IDirect3DIndexBuffer9Impl_GetType, + /* IDirect3DIndexBuffer9 */ IDirect3DIndexBuffer9Impl_Lock, IDirect3DIndexBuffer9Impl_Unlock, IDirect3DIndexBuffer9Impl_GetDesc diff -urN wine-20050725/dlls/d3d9/pixelshader.c wine-20050830/dlls/d3d9/pixelshader.c --- wine-20050725/dlls/d3d9/pixelshader.c 2005-07-08 13:29:21.000000000 +0200 +++ wine-20050830/dlls/d3d9/pixelshader.c 2005-08-23 11:34:57.000000000 +0200 @@ -22,7 +22,7 @@ #include "config.h" #include "d3d9_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); +WINE_DEFAULT_DEBUG_CHANNEL(d3d9); /* IDirect3DPixelShader9 IUnknown parts follow: */ HRESULT WINAPI IDirect3DPixelShader9Impl_QueryInterface(LPDIRECT3DPIXELSHADER9 iface, REFIID riid, LPVOID* ppobj) { @@ -84,9 +84,11 @@ const IDirect3DPixelShader9Vtbl Direct3DPixelShader9_Vtbl = { + /* IUnknown */ IDirect3DPixelShader9Impl_QueryInterface, IDirect3DPixelShader9Impl_AddRef, IDirect3DPixelShader9Impl_Release, + /* IDirect3DPixelShader9 */ IDirect3DPixelShader9Impl_GetDevice, IDirect3DPixelShader9Impl_GetFunction }; @@ -101,24 +103,24 @@ FIXME("(%p) Relay (disabled)\n", This); *ppShader = NULL; return D3D_OK; - if(ppShader == NULL){ + if (ppShader == NULL) { TRACE("(%p) Invalid call\n", This); return D3DERR_INVALIDCALL; } object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if(NULL == object){ + if (NULL == object) { return E_OUTOFMEMORY; - }else{ + } else { object->ref = 1; object->lpVtbl = &Direct3DPixelShader9_Vtbl; hrc = IWineD3DDevice_CreatePixelShader(This->WineD3DDevice, pFunction, &object->wineD3DPixelShader , (IUnknown *)object); - if(hrc != D3D_OK){ + if (hrc != D3D_OK) { FIXME("(%p) call to IWineD3DDevice_CreatePixelShader failed\n", This); HeapFree(GetProcessHeap(), 0 , object); *ppShader = NULL; - }else{ + } else { *ppShader = (IDirect3DPixelShader9*) object; } @@ -142,15 +144,17 @@ HRESULT hrc = D3D_OK; TRACE("(%p) Relay\n", This); - if(ppShader == NULL){ + if (ppShader == NULL) { TRACE("(%p) Invalid call\n", This); return D3DERR_INVALIDCALL; } hrc = IWineD3DDevice_GetPixelShader(This->WineD3DDevice, &object); - if(hrc == D3D_OK && object != NULL){ + if (hrc == D3D_OK && object != NULL) { hrc = IWineD3DPixelShader_GetParent(object, (IUnknown **)ppShader); IWineD3DPixelShader_Release(object); + } else { + *ppShader = NULL; } TRACE("(%p) : returning %p\n", This, *ppShader); diff -urN wine-20050725/dlls/d3d9/stateblock.c wine-20050830/dlls/d3d9/stateblock.c --- wine-20050725/dlls/d3d9/stateblock.c 2005-07-11 12:59:41.000000000 +0200 +++ wine-20050830/dlls/d3d9/stateblock.c 2005-08-23 11:34:57.000000000 +0200 @@ -23,7 +23,7 @@ #include "config.h" #include "d3d9_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DEFAULT_DEBUG_CHANNEL(d3d9); /* IDirect3DStateBlock9 IUnknown parts follow: */ HRESULT WINAPI IDirect3DStateBlock9Impl_QueryInterface(LPDIRECT3DSTATEBLOCK9 iface, REFIID riid, LPVOID* ppobj) { @@ -112,7 +112,7 @@ object->lpVtbl = &Direct3DStateBlock9_Vtbl; object->ref = 1; - hrc=IWineD3DDevice_CreateStateBlock(This->WineD3DDevice,Type,&object->wineD3DStateBlock,(IUnknown*)object); + hrc = IWineD3DDevice_CreateStateBlock(This->WineD3DDevice, (WINED3DSTATEBLOCKTYPE)Type, &object->wineD3DStateBlock, (IUnknown*)object); if(hrc != D3D_OK){ FIXME("(%p) Call to IWineD3DDevice_CreateStateBlock failed.\n", This); HeapFree(GetProcessHeap(), 0, object); diff -urN wine-20050725/dlls/d3d9/surface.c wine-20050830/dlls/d3d9/surface.c --- wine-20050725/dlls/d3d9/surface.c 2005-07-11 22:38:27.000000000 +0200 +++ wine-20050830/dlls/d3d9/surface.c 2005-08-23 11:34:57.000000000 +0200 @@ -137,7 +137,7 @@ IUnknown_Release(myContainer); } else if(D3D_OK == IUnknown_QueryInterface(IWineContainer, &IID_IWineD3DSwapChain, (void **)&myContainer)){ - IWineD3DBaseTexture_GetParent((IWineD3DBaseTexture *)IWineContainer, &IUnknownParent); + IWineD3DSwapChain_GetParent((IWineD3DSwapChain *)IWineContainer, &IUnknownParent); IUnknown_Release(myContainer); }else{ FIXME("Container is of unknown interface\n"); @@ -206,9 +206,11 @@ const IDirect3DSurface9Vtbl Direct3DSurface9_Vtbl = { + /* IUnknown */ IDirect3DSurface9Impl_QueryInterface, IDirect3DSurface9Impl_AddRef, IDirect3DSurface9Impl_Release, + /* IDirect3DResource9 */ IDirect3DSurface9Impl_GetDevice, IDirect3DSurface9Impl_SetPrivateData, IDirect3DSurface9Impl_GetPrivateData, @@ -217,6 +219,7 @@ IDirect3DSurface9Impl_GetPriority, IDirect3DSurface9Impl_PreLoad, IDirect3DSurface9Impl_GetType, + /* IDirect3DSurface9 */ IDirect3DSurface9Impl_GetContainer, IDirect3DSurface9Impl_GetDesc, IDirect3DSurface9Impl_LockRect, diff -urN wine-20050725/dlls/d3d9/swapchain.c wine-20050830/dlls/d3d9/swapchain.c --- wine-20050725/dlls/d3d9/swapchain.c 2005-06-23 13:05:24.000000000 +0200 +++ wine-20050830/dlls/d3d9/swapchain.c 2005-08-23 11:34:57.000000000 +0200 @@ -57,6 +57,7 @@ TRACE("(%p) : ReleaseRef to %ld\n", This, ref); if (ref == 0) { + IWineD3DSwapChain_Release(This->wineD3DSwapChain); HeapFree(GetProcessHeap(), 0, This); } return ref; @@ -160,7 +161,7 @@ /* Allocate an associated WineD3DDevice object */ localParameters.BackBufferWidth = &pPresentationParameters->BackBufferWidth; localParameters.BackBufferHeight = &pPresentationParameters->BackBufferHeight; - localParameters.BackBufferFormat = &pPresentationParameters->BackBufferFormat; + localParameters.BackBufferFormat = (WINED3DFORMAT *)&pPresentationParameters->BackBufferFormat; localParameters.BackBufferCount = &pPresentationParameters->BackBufferCount; localParameters.MultiSampleType = &pPresentationParameters->MultiSampleType; localParameters.MultiSampleQuality = &pPresentationParameters->MultiSampleQuality; @@ -168,7 +169,7 @@ localParameters.hDeviceWindow = &pPresentationParameters->hDeviceWindow; localParameters.Windowed = &pPresentationParameters->Windowed; localParameters.EnableAutoDepthStencil = &pPresentationParameters->EnableAutoDepthStencil; - localParameters.AutoDepthStencilFormat = &pPresentationParameters->AutoDepthStencilFormat; + localParameters.AutoDepthStencilFormat = (WINED3DFORMAT *)&pPresentationParameters->AutoDepthStencilFormat; localParameters.Flags = &pPresentationParameters->Flags; localParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.PresentationInterval = &pPresentationParameters->PresentationInterval; @@ -183,7 +184,7 @@ *pSwapChain = (IDirect3DSwapChain9 *)object; } TRACE("(%p) returning %p\n", This, *pSwapChain); - return D3D_OK; + return hrc; } HRESULT WINAPI IDirect3DDevice9Impl_GetSwapChain(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) { diff -urN wine-20050725/dlls/d3d9/texture.c wine-20050830/dlls/d3d9/texture.c --- wine-20050725/dlls/d3d9/texture.c 2005-07-11 22:38:27.000000000 +0200 +++ wine-20050830/dlls/d3d9/texture.c 2005-08-23 11:34:57.000000000 +0200 @@ -206,9 +206,11 @@ const IDirect3DTexture9Vtbl Direct3DTexture9_Vtbl = { + /* IUnknown */ IDirect3DTexture9Impl_QueryInterface, IDirect3DTexture9Impl_AddRef, IDirect3DTexture9Impl_Release, + /* IDirect3DResource9 */ IDirect3DTexture9Impl_GetDevice, IDirect3DTexture9Impl_SetPrivateData, IDirect3DTexture9Impl_GetPrivateData, @@ -217,13 +219,14 @@ IDirect3DTexture9Impl_GetPriority, IDirect3DTexture9Impl_PreLoad, IDirect3DTexture9Impl_GetType, - + /* IDirect3dBaseTexture9 */ IDirect3DTexture9Impl_SetLOD, IDirect3DTexture9Impl_GetLOD, IDirect3DTexture9Impl_GetLevelCount, IDirect3DTexture9Impl_SetAutoGenFilterType, IDirect3DTexture9Impl_GetAutoGenFilterType, IDirect3DTexture9Impl_GenerateMipSubLevels, + /* IDirect3DTexture9 */ IDirect3DTexture9Impl_GetLevelDesc, IDirect3DTexture9Impl_GetSurfaceLevel, IDirect3DTexture9Impl_LockRect, diff -urN wine-20050725/dlls/d3d9/vertexbuffer.c wine-20050830/dlls/d3d9/vertexbuffer.c --- wine-20050725/dlls/d3d9/vertexbuffer.c 2005-05-27 22:17:36.000000000 +0200 +++ wine-20050830/dlls/d3d9/vertexbuffer.c 2005-08-23 11:34:57.000000000 +0200 @@ -134,9 +134,11 @@ const IDirect3DVertexBuffer9Vtbl Direct3DVertexBuffer9_Vtbl = { + /* IUnknown */ IDirect3DVertexBuffer9Impl_QueryInterface, IDirect3DVertexBuffer9Impl_AddRef, IDirect3DVertexBuffer9Impl_Release, + /* IDirect3DResource9 */ IDirect3DVertexBuffer9Impl_GetDevice, IDirect3DVertexBuffer9Impl_SetPrivateData, IDirect3DVertexBuffer9Impl_GetPrivateData, @@ -145,6 +147,7 @@ IDirect3DVertexBuffer9Impl_GetPriority, IDirect3DVertexBuffer9Impl_PreLoad, IDirect3DVertexBuffer9Impl_GetType, + /* IDirect3DVertexBuffer9 */ IDirect3DVertexBuffer9Impl_Lock, IDirect3DVertexBuffer9Impl_Unlock, IDirect3DVertexBuffer9Impl_GetDesc diff -urN wine-20050725/dlls/d3d9/vertexshader.c wine-20050830/dlls/d3d9/vertexshader.c --- wine-20050725/dlls/d3d9/vertexshader.c 2005-07-05 18:17:31.000000000 +0200 +++ wine-20050830/dlls/d3d9/vertexshader.c 2005-08-23 11:34:57.000000000 +0200 @@ -22,7 +22,7 @@ #include "config.h" #include "d3d9_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); +WINE_DEFAULT_DEBUG_CHANNEL(d3d9); /* IDirect3DVertexShader9 IUnknown parts follow: */ HRESULT WINAPI IDirect3DVertexShader9Impl_QueryInterface(LPDIRECT3DVERTEXSHADER9 iface, REFIID riid, LPVOID* ppobj) { @@ -30,7 +30,7 @@ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirect3DVertexShader9)) { - IDirect3DVertexShader9Impl_AddRef(iface); + IUnknown_AddRef(iface); *ppobj = This; return D3D_OK; } @@ -55,6 +55,7 @@ TRACE("(%p) : ReleaseRef to %ld\n", This, ref); if (ref == 0) { + IWineD3DVertexShader_Release(This->wineD3DVertexShader); HeapFree(GetProcessHeap(), 0, This); } return ref; @@ -63,24 +64,35 @@ /* IDirect3DVertexShader9 Interface follow: */ HRESULT WINAPI IDirect3DVertexShader9Impl_GetDevice(LPDIRECT3DVERTEXSHADER9 iface, IDirect3DDevice9** ppDevice) { IDirect3DVertexShader9Impl *This = (IDirect3DVertexShader9Impl *)iface; - TRACE("(%p) : returning %p\n", This, This->Device); - *ppDevice = (LPDIRECT3DDEVICE9) This->Device; - IDirect3DDevice9Impl_AddRef(*ppDevice); - return D3D_OK; + IWineD3DDevice *myDevice = NULL; + HRESULT hr = D3D_OK; + TRACE("(%p) : Relay\n", This); + + if (D3D_OK == (hr = IWineD3DVertexShader_GetDevice(This->wineD3DVertexShader, &myDevice) && myDevice != NULL)) { + hr = IWineD3DDevice_GetParent(myDevice, (IUnknown **)ppDevice); + IWineD3DDevice_Release(myDevice); + } else { + *ppDevice = NULL; + } + TRACE("(%p) returing (%p)", This, *ppDevice); + return hr; } HRESULT WINAPI IDirect3DVertexShader9Impl_GetFunction(LPDIRECT3DVERTEXSHADER9 iface, VOID* pData, UINT* pSizeOfData) { IDirect3DVertexShader9Impl *This = (IDirect3DVertexShader9Impl *)iface; - FIXME("(%p) : stub\n", This); - return D3D_OK; + + TRACE("(%p) : Relay\n", This); + return IWineD3DVertexShader_GetFunction(This->wineD3DVertexShader, pData, pSizeOfData); } const IDirect3DVertexShader9Vtbl Direct3DVertexShader9_Vtbl = { + /* IUnknown */ IDirect3DVertexShader9Impl_QueryInterface, IDirect3DVertexShader9Impl_AddRef, IDirect3DVertexShader9Impl_Release, + /* IDirect3DVertexShader9 */ IDirect3DVertexShader9Impl_GetDevice, IDirect3DVertexShader9Impl_GetFunction }; @@ -89,152 +101,95 @@ /* IDirect3DDevice9 IDirect3DVertexShader9 Methods follow: */ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexShader(LPDIRECT3DDEVICE9 iface, CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; - FIXME("(%p) : stub\n", This); - return D3D_OK; + HRESULT hrc = D3D_OK; + IDirect3DVertexShader9Impl *object; + + /* Setup a stub object for now */ + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + TRACE("(%p) : pFunction(%p), ppShader(%p)\n", This, pFunction, ppShader); + if (NULL == object) { + FIXME("Allocation of memory failed\n"); + *ppShader = NULL; + return D3DERR_OUTOFVIDEOMEMORY; + } + + object->ref = 1; + object->lpVtbl = &Direct3DVertexShader9_Vtbl; + hrc= IWineD3DDevice_CreateVertexShader(This->WineD3DDevice, pFunction, &object->wineD3DVertexShader, (IUnknown *)object); + + if (FAILED(hrc)) { + /* free up object */ + FIXME("Call to IWineD3DDevice_CreateVertexShader failed\n"); + HeapFree(GetProcessHeap(), 0, object); + *ppShader = NULL; + }else{ + *ppShader = (IDirect3DVertexShader9 *)object; + } + + TRACE("(%p) : returning %p\n", This, *ppShader); + return hrc; } HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9* pShader) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; - /* TODO: implement stateblocks */ - - FIXME("Disabled %p\n", This); - /* Handle recording of state blocks */ - /** - * TODO: merge HAL shaders context switching from prototype - */ - return D3D_OK; + HRESULT hrc = D3D_OK; + + TRACE("(%p) : Relay \n", This); + hrc = IWineD3DDevice_SetVertexShader(This->WineD3DDevice, pShader==NULL?NULL:((IDirect3DVertexShader9Impl *)pShader)->wineD3DVertexShader); + + TRACE("(%p) : returning hr(%lu) \n", This, hrc); + return hrc; } HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9** ppShader) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; - TRACE("(%p) : GetVertexShader returning\n", This); - *ppShader = NULL; - return D3D_OK; + IWineD3DVertexShader *pShader; + HRESULT hrc = D3D_OK; + + TRACE("(%p) : Relay device@%p \n", This, This->WineD3DDevice); + hrc = IWineD3DDevice_GetVertexShader(This->WineD3DDevice, &pShader); + if(hrc == D3D_OK){ + hrc = IWineD3DVertexShader_GetParent(pShader, (IUnknown **)ppShader); + IWineD3DVertexShader_Release(pShader); + } else { + WARN("(%p) : Call to IWineD3DDevice_GetVertexShader failed %lu (device %p)\n", This, hrc, This->WineD3DDevice); + } + TRACE("(%p) : returning %p\n", This, *ppShader); + return hrc; } HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT Register, CONST float* pConstantData, UINT Vector4fCount) { - IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; -#if 0 - if (Register + Vector4fCount > D3D_VSHADER_MAX_CONSTANTS) { - ERR("(%p) : SetVertexShaderConstant C[%u] invalid\n", This, Register); - return D3DERR_INVALIDCALL; - } - if (NULL == pConstantData) { - return D3DERR_INVALIDCALL; - } - if (Vector4fCount > 1) { - CONST FLOAT* f = pConstantData; - UINT i; - TRACE("(%p) : SetVertexShaderConstant C[%u..%u]=\n", This, Register, Register + Vector4fCount - 1); - for (i = 0; i < Vector4fCount; ++i) { - TRACE("{%f, %f, %f, %f}\n", f[0], f[1], f[2], f[3]); - f += 4; - } - } else { - const FLOAT* f = (const FLOAT*) pConstantData; - TRACE("(%p) : SetVertexShaderConstant, C[%u]={%f, %f, %f, %f}\n", This, Register, f[0], f[1], f[2], f[3]); - } - This->UpdateStateBlock->Changed.vertexShaderConstant = TRUE; - memcpy(&This->UpdateStateBlock->vertexShaderConstantF[Register], pConstantData, Vector4fCount * 4 * sizeof(FLOAT)); -#endif - FIXME("(%p) : stub\n", This); - return D3D_OK; + IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; + TRACE("(%p) : Relay\n", This); + return IWineD3DDevice_SetVertexShaderConstantF(This->WineD3DDevice, Register, pConstantData, Vector4fCount); } HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT Register, float* pConstantData, UINT Vector4fCount) { - IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; -#if 0 - TRACE("(%p) : C[%u] count=%u\n", This, Register, Vector4fCount); - if (Register + Vector4fCount > D3D_VSHADER_MAX_CONSTANTS) { - return D3DERR_INVALIDCALL; - } - if (NULL == pConstantData) { - return D3DERR_INVALIDCALL; - } - memcpy(pConstantData, &This->UpdateStateBlock->vertexShaderConstantF[Register], Vector4fCount * 4 * sizeof(FLOAT)); -#endif - FIXME("(%p) : stub\n", This); - return D3D_OK; + IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; + TRACE("(%p) : Relay\n", This); + return IWineD3DDevice_GetVertexShaderConstantF(This->WineD3DDevice, Register, pConstantData, Vector4fCount); } HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT Register, CONST int* pConstantData, UINT Vector4iCount) { - IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; -#if 0 - if (Register + Vector4iCount > D3D_VSHADER_MAX_CONSTANTS) { - ERR("(%p) : SetVertexShaderConstantI C[%u] invalid\n", This, Register); - return D3DERR_INVALIDCALL; - } - if (NULL == pConstantData) { - return D3DERR_INVALIDCALL; - } - if (Vector4iCount > 1) { - CONST int* f = pConstantData; - UINT i; - TRACE("(%p) : SetVertexShaderConstantI C[%u..%u]=\n", This, Register, Register + Vector4iCount - 1); - for (i = 0; i < Vector4iCount; ++i) { - TRACE("{%d, %d, %d, %d}\n", f[0], f[1], f[2], f[3]); - f += 4; - } - } else { - CONST int* f = pConstantData; - TRACE("(%p) : SetVertexShaderConstantI, C[%u]={%i, %i, %i, %i}\n", This, Register, f[0], f[1], f[2], f[3]); - } - This->UpdateStateBlock->Changed.vertexShaderConstant = TRUE; - memcpy(&This->UpdateStateBlock->vertexShaderConstantI[Register], pConstantData, Vector4iCount * 4 * sizeof(int)); -#endif - FIXME("(%p) : stub\n", This); - return D3D_OK; + IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; + TRACE("(%p) : Relay\n", This); + return IWineD3DDevice_SetVertexShaderConstantI(This->WineD3DDevice, Register, pConstantData, Vector4iCount); } HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT Register, int* pConstantData, UINT Vector4iCount) { - IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; -#if 0 - TRACE("(%p) : C[%u] count=%u\n", This, Register, Vector4iCount); - if (Register + Vector4iCount > D3D_VSHADER_MAX_CONSTANTS) { - return D3DERR_INVALIDCALL; - } - if (NULL == pConstantData) { - return D3DERR_INVALIDCALL; - } - memcpy(pConstantData, &This->UpdateStateBlock->vertexShaderConstantI[Register], Vector4iCount * 4 * sizeof(FLOAT)); -#endif - FIXME("(%p) : stub\n", This); - return D3D_OK; + IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; + TRACE("(%p) : Relay\n", This); + return IWineD3DDevice_GetVertexShaderConstantI(This->WineD3DDevice, Register, pConstantData, Vector4iCount); } HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT Register, CONST BOOL* pConstantData, UINT BoolCount) { - IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; -#if 0 - UINT i; - - if (Register + BoolCount > D3D_VSHADER_MAX_CONSTANTS) { - ERR("(%p) : SetVertexShaderConstantB C[%u] invalid\n", This, Register); - return D3DERR_INVALIDCALL; - } - if (NULL == pConstantData) { - return D3DERR_INVALIDCALL; - } - if (BoolCount > 1) { - CONST BOOL* f = pConstantData; - TRACE("(%p) : SetVertexShaderConstantB C[%u..%u]=\n", This, Register, Register + BoolCount - 1); - for (i = 0; i < BoolCount; ++i) { - TRACE("{%u}\n", f[i]); - } - } else { - CONST BOOL* f = pConstantData; - TRACE("(%p) : SetVertexShaderConstantB, C[%u]={%u}\n", This, Register, f[0]); - } - This->UpdateStateBlock->Changed.vertexShaderConstant = TRUE; - for (i = 0; i < BoolCount; ++i) { - This->UpdateStateBlock->vertexShaderConstantB[Register] = pConstantData[i]; - } -#endif - FIXME("(%p) : stub\n", This); - return D3D_OK; + IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; + TRACE("(%p) : Relay\n", This); + return IWineD3DDevice_SetVertexShaderConstantB(This->WineD3DDevice, Register, pConstantData, BoolCount); } HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT Register, BOOL* pConstantData, UINT BoolCount) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; - FIXME("(%p) : stub\n", This); - return D3D_OK; + TRACE("(%p) : Relay\n", This); + return IWineD3DDevice_GetVertexShaderConstantB(This->WineD3DDevice, Register, pConstantData, BoolCount); } diff -urN wine-20050725/dlls/d3d9/volume.c wine-20050830/dlls/d3d9/volume.c --- wine-20050725/dlls/d3d9/volume.c 2005-05-27 22:17:36.000000000 +0200 +++ wine-20050830/dlls/d3d9/volume.c 2005-08-23 11:34:57.000000000 +0200 @@ -115,7 +115,7 @@ TRACE("(%p) Relay\n", This); /* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */ - wined3ddesc.Format = &pDesc->Format; + wined3ddesc.Format = (WINED3DFORMAT *)&pDesc->Format; wined3ddesc.Type = &pDesc->Type; wined3ddesc.Usage = &pDesc->Usage; wined3ddesc.Pool = &pDesc->Pool; @@ -141,9 +141,11 @@ const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl = { + /* IUnknown */ IDirect3DVolume9Impl_QueryInterface, IDirect3DVolume9Impl_AddRef, IDirect3DVolume9Impl_Release, + /* IDirect3DVolume9 */ IDirect3DVolume9Impl_GetDevice, IDirect3DVolume9Impl_SetPrivateData, IDirect3DVolume9Impl_GetPrivateData, diff -urN wine-20050725/dlls/d3d9/volumetexture.c wine-20050830/dlls/d3d9/volumetexture.c --- wine-20050725/dlls/d3d9/volumetexture.c 2005-05-27 22:17:36.000000000 +0200 +++ wine-20050830/dlls/d3d9/volumetexture.c 2005-08-23 11:34:57.000000000 +0200 @@ -158,7 +158,7 @@ TRACE("(%p) Relay\n", This); /* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */ - wined3ddesc.Format = &pDesc->Format; + wined3ddesc.Format = (WINED3DFORMAT *)&pDesc->Format; wined3ddesc.Type = &pDesc->Type; wined3ddesc.Usage = &pDesc->Usage; wined3ddesc.Pool = &pDesc->Pool; @@ -206,9 +206,11 @@ const IDirect3DVolumeTexture9Vtbl Direct3DVolumeTexture9_Vtbl = { + /* IUnknown */ IDirect3DVolumeTexture9Impl_QueryInterface, IDirect3DVolumeTexture9Impl_AddRef, IDirect3DVolumeTexture9Impl_Release, + /* IDirect3DResource9 */ IDirect3DVolumeTexture9Impl_GetDevice, IDirect3DVolumeTexture9Impl_SetPrivateData, IDirect3DVolumeTexture9Impl_GetPrivateData, @@ -217,12 +219,14 @@ IDirect3DVolumeTexture9Impl_GetPriority, IDirect3DVolumeTexture9Impl_PreLoad, IDirect3DVolumeTexture9Impl_GetType, + /* IDirect3DBaseTexture9 */ IDirect3DVolumeTexture9Impl_SetLOD, IDirect3DVolumeTexture9Impl_GetLOD, IDirect3DVolumeTexture9Impl_GetLevelCount, IDirect3DVolumeTexture9Impl_SetAutoGenFilterType, IDirect3DVolumeTexture9Impl_GetAutoGenFilterType, IDirect3DVolumeTexture9Impl_GenerateMipSubLevels, + /* IDirect3DVolumeTexture9 */ IDirect3DVolumeTexture9Impl_GetLevelDesc, IDirect3DVolumeTexture9Impl_GetVolumeLevel, IDirect3DVolumeTexture9Impl_LockBox, diff -urN wine-20050725/dlls/d3dim/Makefile.in wine-20050830/dlls/d3dim/Makefile.in --- wine-20050725/dlls/d3dim/Makefile.in 2005-05-09 16:42:35.000000000 +0200 +++ wine-20050830/dlls/d3dim/Makefile.in 2005-08-25 17:27:44.000000000 +0200 @@ -4,6 +4,7 @@ VPATH = @srcdir@ MODULE = d3dim.dll IMPORTLIB = libd3dim.$(IMPLIBEXT) +IMPORTS = kernel32 C_SRCS = d3dim_main.c diff -urN wine-20050725/dlls/d3drm/Makefile.in wine-20050830/dlls/d3drm/Makefile.in --- wine-20050725/dlls/d3drm/Makefile.in 2005-05-09 16:42:35.000000000 +0200 +++ wine-20050830/dlls/d3drm/Makefile.in 2005-08-25 17:27:44.000000000 +0200 @@ -4,6 +4,7 @@ VPATH = @srcdir@ MODULE = d3drm.dll IMPORTLIB = libd3drm.$(IMPLIBEXT) +IMPORTS = kernel32 C_SRCS = d3drm_main.c diff -urN wine-20050725/dlls/d3dxof/d3dxof.spec wine-20050830/dlls/d3dxof/d3dxof.spec --- wine-20050725/dlls/d3dxof/d3dxof.spec 2004-06-03 02:03:23.000000000 +0200 +++ wine-20050830/dlls/d3dxof/d3dxof.spec 2005-08-08 19:35:29.000000000 +0200 @@ -1,3 +1,3 @@ @ stdcall DirectXFileCreate(ptr) -@ stdcall -private DllCanUnloadNow() D3DXOF_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) D3DXOF_DllGetClassObject +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) diff -urN wine-20050725/dlls/d3dxof/d3dxof_private.h wine-20050830/dlls/d3dxof/d3dxof_private.h --- wine-20050725/dlls/d3dxof/d3dxof_private.h 2005-07-12 19:03:19.000000000 +0200 +++ wine-20050830/dlls/d3dxof/d3dxof_private.h 2005-07-26 22:10:51.000000000 +0200 @@ -24,8 +24,6 @@ #ifndef __D3DXOF_PRIVATE_INCLUDED__ #define __D3DXOF_PRIVATE_INCLUDED__ -#define CONST_VTABLE - #include #include "windef.h" diff -urN wine-20050725/dlls/d3dxof/main.c wine-20050830/dlls/d3dxof/main.c --- wine-20050725/dlls/d3dxof/main.c 2005-07-12 19:03:19.000000000 +0200 +++ wine-20050830/dlls/d3dxof/main.c 2005-08-08 19:35:29.000000000 +0200 @@ -183,7 +183,7 @@ * Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG, * E_UNEXPECTED */ -DWORD WINAPI D3DXOF_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { int i; IClassFactoryImpl *factory; @@ -221,7 +221,7 @@ /*********************************************************************** * DllCanUnloadNow (D3DXOF.@) */ -HRESULT WINAPI D3DXOF_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { return dll_ref != 0 ? S_FALSE : S_OK; } diff -urN wine-20050725/dlls/d3dxof/regsvr.c wine-20050830/dlls/d3dxof/regsvr.c --- wine-20050725/dlls/d3dxof/regsvr.c 2004-06-03 02:03:23.000000000 +0200 +++ wine-20050830/dlls/d3dxof/regsvr.c 2005-08-08 19:35:29.000000000 +0200 @@ -526,7 +526,7 @@ /*********************************************************************** * DllRegisterServer (D3DXOF.@) */ -HRESULT WINAPI D3DXOF_DllRegisterServer(void) +HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -541,7 +541,7 @@ /*********************************************************************** * DllUnregisterServer (D3DXOF.@) */ -HRESULT WINAPI D3DXOF_DllUnregisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; diff -urN wine-20050725/dlls/dbghelp/dbghelp.c wine-20050830/dlls/dbghelp/dbghelp.c --- wine-20050725/dlls/dbghelp/dbghelp.c 2005-03-28 16:17:52.000000000 +0200 +++ wine-20050830/dlls/dbghelp/dbghelp.c 2005-07-29 16:42:37.000000000 +0200 @@ -282,6 +282,17 @@ } /****************************************************************** + * SymSetParentWindow (DBGHELP.@) + * + */ +BOOL WINAPI SymSetParentWindow(HWND hwnd) +{ + /* Save hwnd so it can be used as parent window */ + FIXME("(%p): stub\n", hwnd); + return TRUE; +} + +/****************************************************************** * SymSetContext (DBGHELP.@) * */ diff -urN wine-20050725/dlls/dbghelp/dbghelp.spec wine-20050830/dlls/dbghelp/dbghelp.spec --- wine-20050725/dlls/dbghelp/dbghelp.spec 2005-06-23 11:57:11.000000000 +0200 +++ wine-20050830/dlls/dbghelp/dbghelp.spec 2005-07-29 16:42:37.000000000 +0200 @@ -80,6 +80,7 @@ @ stub SymRegisterFunctionEntryCallback @ stdcall SymSetContext(long ptr ptr) @ stdcall SymSetOptions(long) +@ stdcall SymSetParentWindow(long) @ stdcall SymSetSearchPath(long str) @ stub SymSetSymWithAddr64 @ stub SymUnDName64 diff -urN wine-20050725/dlls/dbghelp/elf_module.c wine-20050830/dlls/dbghelp/elf_module.c --- wine-20050725/dlls/dbghelp/elf_module.c 2005-07-07 14:03:57.000000000 +0200 +++ wine-20050830/dlls/dbghelp/elf_module.c 2005-08-29 11:46:32.000000000 +0200 @@ -20,6 +20,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include @@ -1431,11 +1432,22 @@ return FALSE; } +BOOL elf_fetch_file_info(const char* name, DWORD* base, + DWORD* size, DWORD* checksum) +{ + return FALSE; +} + BOOL elf_read_wine_loader_dbg_info(struct process* pcs) { return FALSE; } +BOOL elf_enum_modules(HANDLE hProc, elf_enum_modules_cb cb, void* user) +{ + return FALSE; +} + struct module* elf_load_module(struct process* pcs, const char* name, DWORD addr) { return NULL; diff -urN wine-20050725/dlls/dciman32/dciman32.spec wine-20050830/dlls/dciman32/dciman32.spec --- wine-20050725/dlls/dciman32/dciman32.spec 2005-04-15 18:11:56.000000000 +0200 +++ wine-20050830/dlls/dciman32/dciman32.spec 2005-08-09 12:31:35.000000000 +0200 @@ -11,7 +11,7 @@ @ stub DCISetClipList @ stub DCISetDestination @ stub DCISetSrcDestClip -@ stdcall DllEntryPoint(long long ptr) DllMain +@ stdcall -private DllEntryPoint(long long ptr) DllMain @ stub GetDCRegionData @ stub GetWindowRegionData @ stub WinWatchClose diff -urN wine-20050725/dlls/ddraw/clipper.c wine-20050830/dlls/ddraw/clipper.c --- wine-20050725/dlls/ddraw/clipper.c 2005-06-03 13:30:11.000000000 +0200 +++ wine-20050830/dlls/ddraw/clipper.c 2005-07-26 22:10:51.000000000 +0200 @@ -24,8 +24,6 @@ #include #include -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "wingdi.h" diff -urN wine-20050725/dlls/ddraw/ddraw.spec wine-20050830/dlls/ddraw/ddraw.spec --- wine-20050725/dlls/ddraw/ddraw.spec 2005-06-22 20:38:24.000000000 +0200 +++ wine-20050830/dlls/ddraw/ddraw.spec 2005-08-08 19:35:29.000000000 +0200 @@ -10,10 +10,10 @@ @ stdcall DirectDrawEnumerateExA(ptr ptr long) @ stdcall DirectDrawEnumerateExW(ptr ptr long) @ stdcall DirectDrawEnumerateW(ptr ptr) -@ stdcall -private DllCanUnloadNow() DDRAW_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) DDRAW_DllGetClassObject -@ stdcall -private DllRegisterServer() DDRAW_DllRegisterServer -@ stdcall -private DllUnregisterServer() DDRAW_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() @ stub GetNextMipMap @ stub GetSurfaceFromDC @ stub HeapVidMemAllocAligned diff -urN wine-20050725/dlls/ddraw/ddraw_hal.c wine-20050830/dlls/ddraw/ddraw_hal.c --- wine-20050725/dlls/ddraw/ddraw_hal.c 2005-06-04 11:34:54.000000000 +0200 +++ wine-20050830/dlls/ddraw/ddraw_hal.c 2005-07-26 22:10:51.000000000 +0200 @@ -23,8 +23,6 @@ #include #include -#define CONST_VTABLE - #include "wine/debug.h" #include "windef.h" #include "winbase.h" diff -urN wine-20050725/dlls/ddraw/ddraw_main.c wine-20050830/dlls/ddraw/ddraw_main.c --- wine-20050725/dlls/ddraw/ddraw_main.c 2005-06-06 17:51:50.000000000 +0200 +++ wine-20050830/dlls/ddraw/ddraw_main.c 2005-07-26 22:10:51.000000000 +0200 @@ -56,8 +56,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "winerror.h" #include "windef.h" #include "winbase.h" diff -urN wine-20050725/dlls/ddraw/ddraw_thunks.c wine-20050830/dlls/ddraw/ddraw_thunks.c --- wine-20050725/dlls/ddraw/ddraw_thunks.c 2005-06-04 11:34:54.000000000 +0200 +++ wine-20050830/dlls/ddraw/ddraw_thunks.c 2005-07-26 22:10:51.000000000 +0200 @@ -17,8 +17,6 @@ */ #include -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "wingdi.h" diff -urN wine-20050725/dlls/ddraw/ddraw_user.c wine-20050830/dlls/ddraw/ddraw_user.c --- wine-20050725/dlls/ddraw/ddraw_user.c 2005-06-04 11:34:54.000000000 +0200 +++ wine-20050830/dlls/ddraw/ddraw_user.c 2005-07-26 22:10:51.000000000 +0200 @@ -26,8 +26,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "wingdi.h" diff -urN wine-20050725/dlls/ddraw/device_opengl.c wine-20050830/dlls/ddraw/device_opengl.c --- wine-20050725/dlls/ddraw/device_opengl.c 2005-07-03 13:21:32.000000000 +0200 +++ wine-20050830/dlls/ddraw/device_opengl.c 2005-08-22 20:58:27.000000000 +0200 @@ -30,8 +30,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "winerror.h" @@ -379,7 +377,7 @@ return cb(interface_name, device_name, &ddesc, context); } -ULONG WINAPI +static ULONG WINAPI GL_IDirect3DDeviceImpl_7_3T_2T_1T_Release(LPDIRECT3DDEVICE7 iface) { ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface); @@ -694,7 +692,7 @@ return enum_texture_format_OpenGL(lpD3DEnumTextureProc, NULL, lpArg, This->version); } -HRESULT WINAPI +static HRESULT WINAPI GL_IDirect3DDeviceImpl_7_3T_EnumTextureFormats(LPDIRECT3DDEVICE7 iface, LPD3DENUMPIXELFORMATSCALLBACK lpD3DEnumPixelProc, LPVOID lpArg) @@ -704,7 +702,7 @@ return enum_texture_format_OpenGL(NULL, lpD3DEnumPixelProc, lpArg, This->version); } -HRESULT WINAPI +static HRESULT WINAPI GL_IDirect3DDeviceImpl_7_3T_2T_SetRenderState(LPDIRECT3DDEVICE7 iface, D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState) @@ -719,7 +717,7 @@ return DD_OK; } -HRESULT WINAPI +static HRESULT WINAPI GL_IDirect3DDeviceImpl_7_3T_2T_GetRenderState(LPDIRECT3DDEVICE7 iface, D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState) @@ -735,7 +733,7 @@ return DD_OK; } -HRESULT WINAPI +static HRESULT WINAPI GL_IDirect3DDeviceImpl_3_2T_GetLightState(LPDIRECT3DDEVICE3 iface, D3DLIGHTSTATETYPE dwLightStateType, LPDWORD lpdwLightState) @@ -786,7 +784,7 @@ return DD_OK; } -HRESULT WINAPI +static HRESULT WINAPI GL_IDirect3DDeviceImpl_3_2T_SetLightState(LPDIRECT3DDEVICE3 iface, D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState) @@ -2403,7 +2401,7 @@ return DD_OK; } -HRESULT WINAPI +static HRESULT WINAPI GL_IDirect3DDeviceImpl_7_GetCaps(LPDIRECT3DDEVICE7 iface, LPD3DDEVICEDESC7 lpD3DHELDevDesc) { @@ -2632,7 +2630,7 @@ return D3D_OK; } -HRESULT WINAPI +static HRESULT WINAPI GL_IDirect3DDeviceImpl_7_SetViewport(LPDIRECT3DDEVICE7 iface, LPD3DVIEWPORT7 lpData) { @@ -3037,7 +3035,7 @@ if (dwFlags & DDBLT_COLORFILL) { /* This is easy to handle for the D3D Device... */ DWORD color; - GLenum prev_draw; + GLint prev_draw; /* The color as given in the Blt function is in the format of the frame-buffer... * 'clear' expect it in ARGB format => we need to do some conversion :-) @@ -3112,7 +3110,7 @@ /* Both are 3D devices and using the same GL device and the Blt is without color-keying */ D3DRECT src_rect; int width, height; - GLenum prev_draw; + GLint prev_draw; WINE_GL_BUFFER_TYPE src_buffer_type; IDirect3DDeviceGLImpl *gl_d3d_dev = (IDirect3DDeviceGLImpl *) This->d3ddevice; BOOLEAN initial; @@ -3233,7 +3231,7 @@ (this prevents calling glReadPixels) */ D3DRECT src_rect; int width, height; - GLenum prev_draw; + GLint prev_draw; IDirect3DDeviceGLImpl *gl_d3d_dev = (IDirect3DDeviceGLImpl *) This->d3ddevice; BOOLEAN initial; DWORD opt_bitmap; @@ -3342,7 +3340,7 @@ IDirectDrawSurfaceImpl *src_impl = ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, src); IDirect3DDeviceGLImpl *gl_d3d_dev = (IDirect3DDeviceGLImpl *) This->d3ddevice; WINE_GL_BUFFER_TYPE buffer_type; - GLenum prev_draw; + GLint prev_draw; DWORD opt_bitmap; BOOLEAN initial; int width, height, x, y; @@ -3946,7 +3944,7 @@ /* First, check if we need to do anything. For the backbuffer, flushing is done at the next 3D activity. */ if ((This->lastlocktype & DDLOCK_READONLY) == 0) { if (buffer_type == WINE_GL_BUFFER_FRONT) { - GLenum prev_draw; + GLint prev_draw; TRACE(" flushing front buffer immediately on screen.\n"); @@ -4344,6 +4342,7 @@ return FALSE; } gl_context = glXCreateContext(display, vis, NULL, GL_TRUE); + XFree(vis); if (gl_context == NULL) { LEAVE_GL(); @@ -4413,12 +4412,12 @@ glGetIntegerv(GL_MAX_TEXTURE_UNITS_WINE, &(GL_extensions.max_texture_units)); TRACE(" - multi-texturing (%d stages)\n", GL_extensions.max_texture_units); /* We query the ARB version to be the most portable we can... */ - GL_extensions.glActiveTexture = pglXGetProcAddressARB("glActiveTextureARB"); - GL_extensions.glMultiTexCoord[0] = pglXGetProcAddressARB("glMultiTexCoord1fvARB"); - GL_extensions.glMultiTexCoord[1] = pglXGetProcAddressARB("glMultiTexCoord2fvARB"); - GL_extensions.glMultiTexCoord[2] = pglXGetProcAddressARB("glMultiTexCoord3fvARB"); - GL_extensions.glMultiTexCoord[3] = pglXGetProcAddressARB("glMultiTexCoord4fvARB"); - GL_extensions.glClientActiveTexture = pglXGetProcAddressARB("glClientActiveTextureARB"); + GL_extensions.glActiveTexture = pglXGetProcAddressARB( (const GLubyte *) "glActiveTextureARB"); + GL_extensions.glMultiTexCoord[0] = pglXGetProcAddressARB( (const GLubyte *) "glMultiTexCoord1fvARB"); + GL_extensions.glMultiTexCoord[1] = pglXGetProcAddressARB( (const GLubyte *) "glMultiTexCoord2fvARB"); + GL_extensions.glMultiTexCoord[2] = pglXGetProcAddressARB( (const GLubyte *) "glMultiTexCoord3fvARB"); + GL_extensions.glMultiTexCoord[3] = pglXGetProcAddressARB( (const GLubyte *) "glMultiTexCoord4fvARB"); + GL_extensions.glClientActiveTexture = pglXGetProcAddressARB( (const GLubyte *) "glClientActiveTextureARB"); } else { GL_extensions.max_texture_units = 0; } @@ -4426,8 +4425,8 @@ if (strstr(glExtensions, "GL_EXT_texture_compression_s3tc")) { TRACE(" - S3TC compression supported\n"); GL_extensions.s3tc_compressed_texture = TRUE; - GL_extensions.glCompressedTexImage2D = pglXGetProcAddressARB("glCompressedTexImage2DARB"); - GL_extensions.glCompressedTexSubImage2D = pglXGetProcAddressARB("glCompressedTexSubImage2DARB"); + GL_extensions.glCompressedTexImage2D = pglXGetProcAddressARB( (const GLubyte *) "glCompressedTexImage2DARB"); + GL_extensions.glCompressedTexSubImage2D = pglXGetProcAddressARB( (const GLubyte *) "glCompressedTexSubImage2DARB"); } } diff -urN wine-20050725/dlls/ddraw/direct3d_opengl.c wine-20050830/dlls/ddraw/direct3d_opengl.c --- wine-20050725/dlls/ddraw/direct3d_opengl.c 2005-06-06 17:51:50.000000000 +0200 +++ wine-20050830/dlls/ddraw/direct3d_opengl.c 2005-07-26 22:10:51.000000000 +0200 @@ -31,8 +31,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "wingdi.h" diff -urN wine-20050725/dlls/ddraw/executebuffer.c wine-20050830/dlls/ddraw/executebuffer.c --- wine-20050725/dlls/ddraw/executebuffer.c 2005-06-06 17:51:50.000000000 +0200 +++ wine-20050830/dlls/ddraw/executebuffer.c 2005-07-26 22:10:51.000000000 +0200 @@ -27,8 +27,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "winerror.h" diff -urN wine-20050725/dlls/ddraw/light.c wine-20050830/dlls/ddraw/light.c --- wine-20050725/dlls/ddraw/light.c 2005-06-06 17:51:50.000000000 +0200 +++ wine-20050830/dlls/ddraw/light.c 2005-07-26 22:10:51.000000000 +0200 @@ -25,8 +25,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "winerror.h" diff -urN wine-20050725/dlls/ddraw/main.c wine-20050830/dlls/ddraw/main.c --- wine-20050725/dlls/ddraw/main.c 2005-07-11 15:21:17.000000000 +0200 +++ wine-20050830/dlls/ddraw/main.c 2005-08-08 19:35:29.000000000 +0200 @@ -560,7 +560,7 @@ * Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG, * E_UNEXPECTED */ -DWORD WINAPI DDRAW_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { unsigned int i; IClassFactoryImpl *factory; @@ -603,7 +603,8 @@ * Success: S_OK * Failure: S_FALSE */ -DWORD WINAPI DDRAW_DllCanUnloadNow(void) { +HRESULT WINAPI DllCanUnloadNow(void) +{ FIXME("(void): stub\n"); return S_FALSE; } diff -urN wine-20050725/dlls/ddraw/material.c wine-20050830/dlls/ddraw/material.c --- wine-20050725/dlls/ddraw/material.c 2005-06-06 17:51:50.000000000 +0200 +++ wine-20050830/dlls/ddraw/material.c 2005-07-26 22:10:51.000000000 +0200 @@ -25,8 +25,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "winerror.h" diff -urN wine-20050725/dlls/ddraw/palette_hal.c wine-20050830/dlls/ddraw/palette_hal.c --- wine-20050725/dlls/ddraw/palette_hal.c 2005-06-03 13:30:11.000000000 +0200 +++ wine-20050830/dlls/ddraw/palette_hal.c 2005-07-26 22:10:51.000000000 +0200 @@ -24,8 +24,6 @@ #include #include -#define CONST_VTABLE - #include "ddraw_private.h" WINE_DEFAULT_DEBUG_CHANNEL(ddraw); diff -urN wine-20050725/dlls/ddraw/palette_main.c wine-20050830/dlls/ddraw/palette_main.c --- wine-20050725/dlls/ddraw/palette_main.c 2005-06-03 13:30:11.000000000 +0200 +++ wine-20050830/dlls/ddraw/palette_main.c 2005-07-26 22:10:51.000000000 +0200 @@ -25,8 +25,6 @@ #include #include -#define CONST_VTABLE - #include "ddraw_private.h" WINE_DEFAULT_DEBUG_CHANNEL(ddraw); diff -urN wine-20050725/dlls/ddraw/regsvr.c wine-20050830/dlls/ddraw/regsvr.c --- wine-20050725/dlls/ddraw/regsvr.c 2003-09-06 01:08:41.000000000 +0200 +++ wine-20050830/dlls/ddraw/regsvr.c 2005-08-08 19:35:29.000000000 +0200 @@ -467,7 +467,7 @@ /*********************************************************************** * DllRegisterServer (DDRAW.@) */ -HRESULT WINAPI DDRAW_DllRegisterServer() +HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -482,7 +482,7 @@ /*********************************************************************** * DllUnregisterServer (DDRAW.@) */ -HRESULT WINAPI DDRAW_DllUnregisterServer() +HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; diff -urN wine-20050725/dlls/ddraw/surface_dib.c wine-20050830/dlls/ddraw/surface_dib.c --- wine-20050725/dlls/ddraw/surface_dib.c 2005-07-11 12:59:41.000000000 +0200 +++ wine-20050830/dlls/ddraw/surface_dib.c 2005-08-22 11:20:51.000000000 +0200 @@ -20,6 +20,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include @@ -28,8 +29,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "winerror.h" #include "wine/debug.h" #include "ddraw_private.h" @@ -412,8 +411,8 @@ int width = ddesc->dwWidth; int height = ddesc->dwHeight; int x,y; - char* dst = (char*) ddesc->lpSurface; - char* src = (char*) sdesc->lpSurface; + unsigned char* dst = (unsigned char*) ddesc->lpSurface; + unsigned char* src = (unsigned char*) sdesc->lpSurface; for (x = 0; x < width; x++) for (y =0; y < height; y++) { DWORD pixel = 0; @@ -435,8 +434,8 @@ int width = ddesc->dwWidth; int height = ddesc->dwHeight; int x,y; - char* dst = (char*) ddesc->lpSurface; - char* src = (char*) sdesc->lpSurface; + unsigned char* dst = (unsigned char*) ddesc->lpSurface; + unsigned char* src = (unsigned char*) sdesc->lpSurface; for (x = 0; x < width; x++) for (y =0; y < height; y++) { DWORD pixel = 0; @@ -458,8 +457,8 @@ int width = ddesc->dwWidth; int height = ddesc->dwHeight; int x,y; - char* dst = (char*) ddesc->lpSurface; - char* src = (char*) sdesc->lpSurface; + unsigned char* dst = (unsigned char*) ddesc->lpSurface; + unsigned char* src = (unsigned char*) sdesc->lpSurface; for (x = 0; x < width; x++) for (y =0; y < height; y++) { DWORD pixel = 0; @@ -820,7 +819,7 @@ } } else { LONG dstyinc = ddesc.u1.lPitch, dstxinc = bpp; - DWORD keylow = 0, keyhigh = 0; + DWORD keylow = 0, keyhigh = 0, keymask = 0xFFFFFFFF; if (dwFlags & (DDBLT_KEYSRC | DDBLT_KEYDEST | DDBLT_KEYSRCOVERRIDE | DDBLT_KEYDESTOVERRIDE)) { if (dwFlags & DDBLT_KEYSRC) { @@ -836,7 +835,8 @@ keylow = lpbltfx->ddckDestColorkey.dwColorSpaceLowValue; keyhigh = lpbltfx->ddckDestColorkey.dwColorSpaceHighValue; } - dwFlags &= ~(DDBLT_KEYSRC | DDBLT_KEYDEST | DDBLT_KEYSRCOVERRIDE | DDBLT_KEYDESTOVERRIDE); + keymask = sdesc.u4.ddpfPixelFormat.u2.dwRBitMask | sdesc.u4.ddpfPixelFormat.u3.dwGBitMask | sdesc.u4.ddpfPixelFormat.u4.dwBBitMask; + dwFlags &= ~(DDBLT_KEYSRC | DDBLT_KEYDEST | DDBLT_KEYSRCOVERRIDE | DDBLT_KEYDESTOVERRIDE); } if (dwFlags & DDBLT_DDFX) { @@ -920,7 +920,7 @@ dx = d; \ for (x = sx = 0; x < dstwidth; x++, sx += xinc) { \ tmp = s[sx >> 16]; \ - if (tmp < keylow || tmp > keyhigh) dx[0] = tmp; \ + if ((tmp & keymask) < keylow || (tmp & keymask) > keyhigh) dx[0] = tmp; \ dx = (type*)(((LPBYTE)dx)+dstxinc); \ } \ d = (type*)(((LPBYTE)d)+dstyinc); \ @@ -939,7 +939,7 @@ DWORD pixel; s = sbuf+3*(sx>>16); pixel = s[0]|(s[1]<<8)|(s[2]<<16); - if (pixel < keylow || pixel > keyhigh){ + if ((pixel & keymask) < keylow || (pixel & keymask) > keyhigh) { dx[0] = (pixel )&0xff; dx[1] = (pixel>> 8)&0xff; dx[2] = (pixel>>16)&0xff; diff -urN wine-20050725/dlls/ddraw/surface_fakezbuffer.c wine-20050830/dlls/ddraw/surface_fakezbuffer.c --- wine-20050725/dlls/ddraw/surface_fakezbuffer.c 2005-06-05 19:50:49.000000000 +0200 +++ wine-20050830/dlls/ddraw/surface_fakezbuffer.c 2005-07-26 22:10:51.000000000 +0200 @@ -31,8 +31,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "wingdi.h" diff -urN wine-20050725/dlls/ddraw/surface_gamma.c wine-20050830/dlls/ddraw/surface_gamma.c --- wine-20050725/dlls/ddraw/surface_gamma.c 2005-06-05 19:50:49.000000000 +0200 +++ wine-20050830/dlls/ddraw/surface_gamma.c 2005-07-26 22:10:51.000000000 +0200 @@ -23,8 +23,6 @@ #include #include -#define CONST_VTABLE - #include "wine/debug.h" #include "ddraw_private.h" diff -urN wine-20050725/dlls/ddraw/surface_hal.c wine-20050830/dlls/ddraw/surface_hal.c --- wine-20050725/dlls/ddraw/surface_hal.c 2005-06-05 19:50:49.000000000 +0200 +++ wine-20050830/dlls/ddraw/surface_hal.c 2005-07-26 22:10:51.000000000 +0200 @@ -25,8 +25,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "wine/debug.h" #include "ddraw_private.h" diff -urN wine-20050725/dlls/ddraw/surface_main.c wine-20050830/dlls/ddraw/surface_main.c --- wine-20050725/dlls/ddraw/surface_main.c 2005-06-06 17:51:50.000000000 +0200 +++ wine-20050830/dlls/ddraw/surface_main.c 2005-08-03 23:25:11.000000000 +0200 @@ -19,13 +19,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" +#include "wine/port.h" #include #include #define COBJMACROS -#define CONST_VTABLE - #define NONAMELESSUNION #define NONAMELESSSTRUCT diff -urN wine-20050725/dlls/ddraw/surface_thunks.c wine-20050830/dlls/ddraw/surface_thunks.c --- wine-20050725/dlls/ddraw/surface_thunks.c 2005-06-05 19:50:49.000000000 +0200 +++ wine-20050830/dlls/ddraw/surface_thunks.c 2005-07-26 22:10:51.000000000 +0200 @@ -19,8 +19,6 @@ #include "config.h" #include -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "wingdi.h" diff -urN wine-20050725/dlls/ddraw/surface_user.c wine-20050830/dlls/ddraw/surface_user.c --- wine-20050725/dlls/ddraw/surface_user.c 2005-06-05 19:50:49.000000000 +0200 +++ wine-20050830/dlls/ddraw/surface_user.c 2005-07-26 22:10:51.000000000 +0200 @@ -23,8 +23,6 @@ #include #include -#define CONST_VTABLE - #include "winerror.h" #include "wine/debug.h" #include "ddraw_private.h" diff -urN wine-20050725/dlls/ddraw/tests/d3d.c wine-20050830/dlls/ddraw/tests/d3d.c --- wine-20050725/dlls/ddraw/tests/d3d.c 2005-06-20 16:18:05.000000000 +0200 +++ wine-20050830/dlls/ddraw/tests/d3d.c 2005-08-25 21:19:46.000000000 +0200 @@ -41,14 +41,18 @@ } -static void CreateDirect3D(void) +static BOOL CreateDirect3D(void) { HRESULT rc; DDSURFACEDESC2 ddsd; rc = pDirectDrawCreateEx(NULL, (void**)&lpDD, &IID_IDirectDraw7, NULL); - ok(rc==DD_OK, "DirectDrawCreateEx returned: %lx\n", rc); + ok(rc==DD_OK || rc==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %lx\n", rc); + if (!lpDD) { + trace("DirectDrawCreateEx() failed with an error %lx\n", rc); + return FALSE; + } rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_NORMAL); ok(rc==DD_OK, "SetCooperativeLevel returned: %lx\n", rc); @@ -67,7 +71,13 @@ rc = IDirect3D7_CreateDevice(lpD3D, &IID_IDirect3DTnLHalDevice, lpDDS, &lpD3DDevice); - ok(rc==D3D_OK, "CreateDevice returned: %lx\n", rc); + ok(rc==D3D_OK || rc==DDERR_NOPALETTEATTACHED || rc==E_OUTOFMEMORY, "CreateDevice returned: %lx\n", rc); + if (!lpD3DDevice) { + trace("IDirect3D7::CreateDevice() failed with an error %lx\n", rc); + return FALSE; + } + + return TRUE; } static void ReleaseDirect3D(void) @@ -197,7 +207,10 @@ return; } - CreateDirect3D(); + if(!CreateDirect3D()) { + trace("Skipping tests\n"); + return; + } LightTest(); ReleaseDirect3D(); } diff -urN wine-20050725/dlls/ddraw/tests/dsurface.c wine-20050830/dlls/ddraw/tests/dsurface.c --- wine-20050725/dlls/ddraw/tests/dsurface.c 2005-06-20 16:18:05.000000000 +0200 +++ wine-20050830/dlls/ddraw/tests/dsurface.c 2005-08-17 11:52:56.000000000 +0200 @@ -2,6 +2,7 @@ * Unit tests for (a few) ddraw surface functions * * Copyright (C) 2005 Antoine Chavasse (a.chavasse@gmail.com) + * Copyright (C) 2005 Christian Costa * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -153,10 +154,77 @@ IDirectDrawSurface_Release(lpDDSMipMapTest); } +static void SrcColorKey32BlitTest(void) +{ + LPDIRECTDRAWSURFACE lpSrc; + LPDIRECTDRAWSURFACE lpDst; + DDSURFACEDESC ddsd; + DDSURFACEDESC ddsd2; + LPDWORD lpData; + HRESULT rc; + + ddsd2.dwSize = sizeof(ddsd2); + ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat); + + ddsd.dwSize = sizeof(ddsd); + ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + ddsd.dwWidth = 800; + ddsd.dwHeight = 600; + ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32; + U2(ddsd.ddpfPixelFormat).dwRBitMask = 0xFF0000; + U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x00FF00; + U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x0000FF; + rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDst, NULL); + ok(rc==DD_OK,"CreateSurface returned: %lx\n",rc); + + ddsd.dwFlags |= DDSD_CKSRCBLT; + ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = 0xFF00FF; + ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = 0xFF00FF; + rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpSrc, NULL); + ok(rc==DD_OK,"CreateSurface returned: %lx\n",rc); + + rc = IDirectDrawSurface_Lock(lpDst, NULL, &ddsd2, DDLOCK_WAIT, NULL); + ok(rc==DD_OK,"Lock returned: %lx\n",rc); + lpData = (LPDWORD)ddsd2.lpSurface; + lpData[0] = 0xCCCCCCCC; + lpData[1] = 0xCCCCCCCC; + lpData[2] = 0xCCCCCCCC; + lpData[3] = 0xCCCCCCCC; + rc = IDirectDrawSurface_Unlock(lpDst, NULL); + ok(rc==DD_OK,"Unlock returned: %lx\n",rc); + + rc = IDirectDrawSurface_Lock(lpSrc, NULL, &ddsd2, DDLOCK_WAIT, NULL); + ok(rc==DD_OK,"Lock returned: %lx\n",rc); + lpData = (LPDWORD)ddsd2.lpSurface; + lpData[0] = 0x77010203; + lpData[1] = 0x00010203; + lpData[2] = 0x77FF00FF; + lpData[3] = 0x00FF00FF; + rc = IDirectDrawSurface_Unlock(lpSrc, NULL); + ok(rc==DD_OK,"Unlock returned: %lx\n",rc); + + IDirectDrawSurface_Blt(lpDst, NULL, lpSrc, NULL, DDBLT_KEYSRC, NULL); + + rc = IDirectDrawSurface_Lock(lpDst, NULL, &ddsd2, DDLOCK_WAIT, NULL); + ok(rc==DD_OK,"Lock returned: %lx\n",rc); + lpData = (LPDWORD)ddsd2.lpSurface; + ok((lpData[0]==0x77010203)&&(lpData[1]==0x00010203)&&(lpData[2]==0xCCCCCCCC)&&(lpData[3]==0xCCCCCCCC), + "Destination data after blitting is not correct\n"); + rc = IDirectDrawSurface_Unlock(lpDst, NULL); + ok(rc==DD_OK,"Unlock returned: %lx\n",rc); + + IDirectDrawSurface_Release(lpSrc); + IDirectDrawSurface_Release(lpDst); +} + START_TEST(dsurface) { CreateDirectDraw(); MipMapCreationTest(); + SrcColorKey32BlitTest(); ReleaseDirectDraw(); } diff -urN wine-20050725/dlls/ddraw/texture.c wine-20050830/dlls/ddraw/texture.c --- wine-20050725/dlls/ddraw/texture.c 2005-06-06 17:51:50.000000000 +0200 +++ wine-20050830/dlls/ddraw/texture.c 2005-08-03 23:25:11.000000000 +0200 @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include @@ -26,8 +27,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "winerror.h" @@ -342,7 +341,7 @@ IDirect3DTextureGLImpl *glThis = (IDirect3DTextureGLImpl *) This->tex_private; if (glThis->dirty_flag == SURFACE_GL) { - GLuint cur_tex; + GLint cur_tex; TRACE(" flushing GL texture back to memory.\n"); @@ -388,7 +387,7 @@ /* This is a blt without color keying... We can use the direct copy. */ RECT rsrc2; DWORD width, height; - GLuint cur_tex; + GLint cur_tex; IDirect3DTextureGLImpl *gl_surf_ptr = surf_ptr->tex_private; int y; @@ -544,7 +543,7 @@ IDirect3DTextureGLImpl *glThis = (IDirect3DTextureGLImpl *) This->tex_private; if (glThis->dirty_flag == SURFACE_GL) { - GLuint cur_tex; + GLint cur_tex; TRACE(" flushing GL texture back to memory.\n"); diff -urN wine-20050725/dlls/ddraw/vertexbuffer.c wine-20050830/dlls/ddraw/vertexbuffer.c --- wine-20050725/dlls/ddraw/vertexbuffer.c 2005-06-12 12:43:11.000000000 +0200 +++ wine-20050830/dlls/ddraw/vertexbuffer.c 2005-07-26 22:10:51.000000000 +0200 @@ -21,8 +21,6 @@ #include "config.h" #include -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "winerror.h" diff -urN wine-20050725/dlls/ddraw/viewport.c wine-20050830/dlls/ddraw/viewport.c --- wine-20050725/dlls/ddraw/viewport.c 2005-06-06 17:51:50.000000000 +0200 +++ wine-20050830/dlls/ddraw/viewport.c 2005-07-26 22:10:51.000000000 +0200 @@ -25,8 +25,6 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define CONST_VTABLE - #include "windef.h" #include "winbase.h" #include "winerror.h" diff -urN wine-20050725/dlls/devenum/.cvsignore wine-20050830/dlls/devenum/.cvsignore --- wine-20050725/dlls/devenum/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050830/dlls/devenum/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile devenum.dll.dbg.c devenum.res -libdevenum.def diff -urN wine-20050725/dlls/devenum/Makefile.in wine-20050830/dlls/devenum/Makefile.in --- wine-20050725/dlls/devenum/Makefile.in 2005-05-18 20:25:12.000000000 +0200 +++ wine-20050830/dlls/devenum/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = devenum.dll -IMPORTLIB = libdevenum.$(IMPLIBEXT) IMPORTS = ole32 oleaut32 avicap32 winmm user32 advapi32 kernel32 EXTRALIBS = -lstrmiids -luuid $(LIBUNICODE) diff -urN wine-20050725/dlls/devenum/mediacatenum.c wine-20050830/dlls/devenum/mediacatenum.c --- wine-20050725/dlls/devenum/mediacatenum.c 2005-07-11 16:24:53.000000000 +0200 +++ wine-20050830/dlls/devenum/mediacatenum.c 2005-07-27 17:18:15.000000000 +0200 @@ -29,9 +29,6 @@ #include "wine/debug.h" - -/* #define ICOM_THIS_From_IROTData(class, name) class* This = (class*)(((char*)name)-sizeof(void*)) */ - WINE_DEFAULT_DEBUG_CHANNEL(devenum); static ULONG WINAPI DEVENUM_IEnumMoniker_AddRef(LPENUMMONIKER iface); diff -urN wine-20050725/dlls/dinput/dinput.spec wine-20050830/dlls/dinput/dinput.spec --- wine-20050725/dlls/dinput/dinput.spec 2005-06-22 20:38:23.000000000 +0200 +++ wine-20050830/dlls/dinput/dinput.spec 2005-08-08 19:35:29.000000000 +0200 @@ -1,7 +1,7 @@ @ stdcall DirectInputCreateA(long long ptr ptr) @ stdcall DirectInputCreateEx(long long ptr ptr ptr) @ stdcall DirectInputCreateW(long long ptr ptr) -@ stdcall -private DllCanUnloadNow() DINPUT_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) DINPUT_DllGetClassObject -@ stdcall -private DllRegisterServer() DINPUT_DllRegisterServer -@ stdcall -private DllUnregisterServer() DINPUT_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dinput/dinput_main.c wine-20050830/dlls/dinput/dinput_main.c --- wine-20050725/dlls/dinput/dinput_main.c 2005-05-30 12:01:11.000000000 +0200 +++ wine-20050830/dlls/dinput/dinput_main.c 2005-08-08 19:35:29.000000000 +0200 @@ -617,7 +617,7 @@ { /* IUnknown fields */ const IClassFactoryVtbl *lpVtbl; - DWORD ref; + LONG ref; } IClassFactoryImpl; static HRESULT WINAPI DICF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { @@ -678,7 +678,7 @@ /*********************************************************************** * DllCanUnloadNow (DINPUT.@) */ -HRESULT WINAPI DINPUT_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { FIXME("(void): stub\n"); @@ -688,8 +688,7 @@ /*********************************************************************** * DllGetClassObject (DINPUT.@) */ -HRESULT WINAPI DINPUT_DllGetClassObject(REFCLSID rclsid, REFIID riid, - LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) { diff -urN wine-20050725/dlls/dinput/dinput_private.h wine-20050830/dlls/dinput/dinput_private.h --- wine-20050725/dlls/dinput/dinput_private.h 2005-05-30 12:01:11.000000000 +0200 +++ wine-20050830/dlls/dinput/dinput_private.h 2005-08-03 13:03:05.000000000 +0200 @@ -30,7 +30,7 @@ struct IDirectInputImpl { const void *lpVtbl; - DWORD ref; + LONG ref; /* Used to have an unique sequence number for all the events */ DWORD evsequence; diff -urN wine-20050725/dlls/dinput/joystick_linux.c wine-20050830/dlls/dinput/joystick_linux.c --- wine-20050725/dlls/dinput/joystick_linux.c 2005-07-05 13:05:51.000000000 +0200 +++ wine-20050830/dlls/dinput/joystick_linux.c 2005-08-29 11:38:19.000000000 +0200 @@ -89,7 +89,7 @@ struct JoystickImpl { const void *lpVtbl; - DWORD ref; + LONG ref; GUID guid; char dev[32]; @@ -254,10 +254,10 @@ inline static DWORD get_config_key( HKEY defkey, HKEY appkey, const char *name, char *buffer, DWORD size ) { - if (appkey && !RegQueryValueExA( appkey, name, 0, NULL, buffer, &size )) + if (appkey && !RegQueryValueExA( appkey, name, 0, NULL, (LPBYTE)buffer, &size )) return 0; - if (defkey && !RegQueryValueExA( defkey, name, 0, NULL, buffer, &size )) + if (defkey && !RegQueryValueExA( defkey, name, 0, NULL, (LPBYTE)buffer, &size )) return 0; return ERROR_FILE_NOT_FOUND; diff -urN wine-20050725/dlls/dinput/joystick_linuxinput.c wine-20050830/dlls/dinput/joystick_linuxinput.c --- wine-20050725/dlls/dinput/joystick_linuxinput.c 2005-07-22 11:05:19.000000000 +0200 +++ wine-20050830/dlls/dinput/joystick_linuxinput.c 2005-08-08 13:17:25.000000000 +0200 @@ -3,6 +3,7 @@ * Copyright 1998,2000 Marcus Meissner * Copyright 1998,1999 Lionel Ulmer * Copyright 2000-2001 TransGaming Technologies Inc. + * Copyright 2005 Daniel Remenak * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -43,6 +44,9 @@ #endif #ifdef HAVE_LINUX_INPUT_H # include +# if defined(EVIOCGBIT) && defined(EV_ABS) && defined(BTN_PINKIE) +# define HAVE_CORRECT_LINUXINPUT_H +# endif #endif #include "wine/debug.h" @@ -97,6 +101,10 @@ BOOL overflow; DIJOYSTATE2 js; + /* Force feedback variables */ + BOOL has_ff; + int num_effects; + /* data returned by the EVIOCGABS() ioctl */ int axes[ABS_MAX+1][5]; @@ -107,9 +115,11 @@ #define AXE_ABSFLAT 4 - /* data returned by EVIOCGBIT for EV_ABS and EV_KEY */ + /* data returned by EVIOCGBIT for caps, EV_ABS, EV_KEY, and EV_FF */ + BYTE evbits[(EV_MAX+7)/8]; BYTE absbits[(ABS_MAX+7)/8]; BYTE keybits[(KEY_MAX+7)/8]; + BYTE ffbits[(FF_MAX+7)/8]; }; /* This GUID is slightly different from the linux joystick one. Take note. */ @@ -124,17 +134,24 @@ #define test_bit(arr,bit) (((BYTE*)arr)[bit>>3]&(1<<(bit&7))) -static int joydev_have(void) +static int joydev_have(BOOL require_ff) { - int i, fd; + int i, fd, flags, num_effects; int havejoy = 0; for (i=0;i<64;i++) { char buf[200]; BYTE absbits[(ABS_MAX+7)/8],keybits[(KEY_MAX+7)/8]; + BYTE evbits[(EV_MAX+7)/8],ffbits[(FF_MAX+7)/8]; sprintf(buf,EVDEVPREFIX"%d",i); - if (-1!=(fd=open(buf,O_RDONLY))) { + + if (require_ff) + flags = O_RDWR; + else + flags = O_RDONLY; + + if (-1!=(fd=open(buf,flags))) { if (-1==ioctl(fd,EVIOCGBIT(EV_ABS,sizeof(absbits)),absbits)) { perror("EVIOCGBIT EV_ABS"); close(fd); @@ -145,6 +162,23 @@ close(fd); continue; } + + /* test for force feedback if it's required */ + if (require_ff) { + if ((-1==ioctl(fd,EVIOCGBIT(0,sizeof(evbits)),evbits))) { + perror("EVIOCGBIT 0"); + close(fd); + continue; + } + if ( (!test_bit(evbits,EV_FF)) + || (-1==ioctl(fd,EVIOCGBIT(EV_FF,sizeof(ffbits)),ffbits)) + || (-1==ioctl(fd,EVIOCGEFFECTS,&num_effects)) + || (num_effects <= 0)) { + close(fd); + continue; + } + } + /* A true joystick has at least axis X and Y, and at least 1 * button. copied from linux/drivers/input/joydev.c */ if (test_bit(absbits,ABS_X) && test_bit(absbits,ABS_Y) && @@ -176,10 +210,12 @@ (((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 0x0800)))) return FALSE; +#ifndef HAVE_STRUCT_FF_EFFECT_DIRECTION if (dwFlags & DIEDFL_FORCEFEEDBACK) return FALSE; +#endif - havejoy = joydev_have(); + havejoy = joydev_have(dwFlags & DIEDFL_FORCEFEEDBACK); if (!havejoy) return FALSE; @@ -214,10 +250,12 @@ (((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 0x0800)))) return FALSE; +#ifndef HAVE_STRUCT_FF_EFFECT_DIRECTION if (dwFlags & DIEDFL_FORCEFEEDBACK) return FALSE; +#endif - havejoy = joydev_have(); + havejoy = joydev_have(dwFlags & DIEDFL_FORCEFEEDBACK); if (!havejoy) return FALSE; @@ -269,7 +307,7 @@ { int havejoy = 0; - havejoy = joydev_have(); + havejoy = joydev_have(FALSE); if (!havejoy) return DIERR_DEVICENOTREG; @@ -296,7 +334,7 @@ { int havejoy = 0; - havejoy = joydev_have(); + havejoy = joydev_have(FALSE); if (!havejoy) return DIERR_DEVICENOTREG; @@ -379,19 +417,32 @@ int i; JoystickImpl *This = (JoystickImpl *)iface; char buf[200]; + BOOL readonly = TRUE; TRACE("(this=%p)\n",This); if (This->joyfd!=-1) return 0; for (i=0;i<64;i++) { sprintf(buf,EVDEVPREFIX"%d",i); - if (-1==(This->joyfd=open(buf,O_RDONLY))) { - if (errno==ENODEV) - return DIERR_NOTFOUND; - perror(buf); - continue; + if (-1==(This->joyfd=open(buf,O_RDWR))) { + if (-1==(This->joyfd=open(buf,O_RDONLY))) { + /* Couldn't open the device at all */ + if (errno==ENODEV) + return DIERR_NOTFOUND; + perror(buf); + continue; + } + else { + /* Couldn't open in r/w but opened in read-only. */ + WARN("Could not open %s in read-write mode. Force feedback will be disabled.\n",buf); + } } - if ((-1!=ioctl(This->joyfd,EVIOCGBIT(EV_ABS,sizeof(This->absbits)),This->absbits)) && + else { + /* Opened device in read-write */ + readonly = FALSE; + } + if ((-1!=ioctl(This->joyfd,EVIOCGBIT(0,sizeof(This->evbits)),This->evbits)) && + (-1!=ioctl(This->joyfd,EVIOCGBIT(EV_ABS,sizeof(This->absbits)),This->absbits)) && (-1!=ioctl(This->joyfd,EVIOCGBIT(EV_KEY,sizeof(This->keybits)),This->keybits)) && (test_bit(This->absbits,ABS_X) && test_bit(This->absbits,ABS_Y) && (test_bit(This->keybits,BTN_TRIGGER)|| @@ -407,6 +458,30 @@ if (This->joyfd==-1) return DIERR_NOTFOUND; + This->has_ff = FALSE; + This->num_effects = 0; + +#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION + if (!readonly && test_bit(This->evbits, EV_FF)) { + if (-1!=ioctl(This->joyfd,EVIOCGBIT(EV_FF,sizeof(This->ffbits)),This->ffbits)) { + if (-1!=ioctl(This->joyfd,EVIOCGEFFECTS,&This->num_effects) + && This->num_effects > 0) { + This->has_ff = TRUE; + TRACE("Joystick seems to be capable of force feedback.\n"); + } + else { + TRACE("Joystick does not support any effects, disabling force feedback.\n"); + } + } + else { + TRACE("Could not get EV_FF bits; disabling force feedback.\n"); + } + } + else { + TRACE("Force feedback disabled (device is readonly or joystick incapable).\n"); + } +#endif + for (i=0;iabsbits,i)) { if (-1==ioctl(This->joyfd,EVIOCGABS(i),&(This->axes[i]))) @@ -779,6 +854,9 @@ buttons=0; for (i=0;ikeybits,i)) buttons++; + if (This->has_ff) + lpDIDevCaps->dwFlags |= DIDC_FORCEFEEDBACK; + lpDIDevCaps->dwAxes = axes; lpDIDevCaps->dwButtons = buttons; diff -urN wine-20050725/dlls/dinput/keyboard.c wine-20050830/dlls/dinput/keyboard.c --- wine-20050725/dlls/dinput/keyboard.c 2005-05-30 12:01:11.000000000 +0200 +++ wine-20050830/dlls/dinput/keyboard.c 2005-08-03 13:03:05.000000000 +0200 @@ -47,7 +47,7 @@ struct SysKeyboardImpl { const void *lpVtbl; - DWORD ref; + LONG ref; GUID guid; IDirectInputImpl* dinput; @@ -87,7 +87,7 @@ }; static CRITICAL_SECTION keyboard_crit = { &critsect_debug, -1, 0, 0, 0, 0 }; -static DWORD keyboard_users = 0; +static LONG keyboard_users = 0; static HHOOK keyboard_hook = NULL; LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam ) diff -urN wine-20050725/dlls/dinput/mouse.c wine-20050830/dlls/dinput/mouse.c --- wine-20050725/dlls/dinput/mouse.c 2005-05-30 12:01:11.000000000 +0200 +++ wine-20050830/dlls/dinput/mouse.c 2005-08-03 13:03:05.000000000 +0200 @@ -109,7 +109,7 @@ struct SysMouseImpl { const void *lpVtbl; - DWORD ref; + LONG ref; GUID guid; IDirectInputImpl *dinput; diff -urN wine-20050725/dlls/dinput/regsvr.c wine-20050830/dlls/dinput/regsvr.c --- wine-20050725/dlls/dinput/regsvr.c 2004-04-06 22:09:46.000000000 +0200 +++ wine-20050830/dlls/dinput/regsvr.c 2005-08-08 19:35:29.000000000 +0200 @@ -530,7 +530,7 @@ /*********************************************************************** * DllRegisterServer (DINPUT.@) */ -HRESULT WINAPI DINPUT_DllRegisterServer(void) +HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -545,7 +545,7 @@ /*********************************************************************** * DllUnregisterServer (DINPUT.@) */ -HRESULT WINAPI DINPUT_DllUnregisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; diff -urN wine-20050725/dlls/dinput8/Makefile.in wine-20050830/dlls/dinput8/Makefile.in --- wine-20050725/dlls/dinput8/Makefile.in 2005-05-09 16:42:35.000000000 +0200 +++ wine-20050830/dlls/dinput8/Makefile.in 2005-08-29 17:11:37.000000000 +0200 @@ -4,7 +4,7 @@ VPATH = @srcdir@ MODULE = dinput8.dll IMPORTLIB = libdinput8.$(IMPLIBEXT) -IMPORTS = dinput +IMPORTS = dinput kernel32 EXTRALIBS = -luuid C_SRCS = \ diff -urN wine-20050725/dlls/dinput8/dinput8.spec wine-20050830/dlls/dinput8/dinput8.spec --- wine-20050725/dlls/dinput8/dinput8.spec 2003-07-30 05:48:56.000000000 +0200 +++ wine-20050830/dlls/dinput8/dinput8.spec 2005-08-08 19:35:29.000000000 +0200 @@ -1,5 +1,5 @@ @ stdcall DirectInput8Create(long long ptr ptr ptr) -@ stdcall -private DllCanUnloadNow() DINPUT8_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) DINPUT8_DllGetClassObject -@ stdcall -private DllRegisterServer() DINPUT8_DllRegisterServer -@ stdcall -private DllUnregisterServer() DINPUT8_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dinput8/dinput8_main.c wine-20050830/dlls/dinput8/dinput8_main.c --- wine-20050725/dlls/dinput8/dinput8_main.c 2003-09-06 01:08:40.000000000 +0200 +++ wine-20050830/dlls/dinput8/dinput8_main.c 2005-08-08 19:35:29.000000000 +0200 @@ -43,7 +43,7 @@ /*********************************************************************** * DllCanUnloadNow (DINPUT8.@) */ -HRESULT WINAPI DINPUT8_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { FIXME("(void): stub\n"); @@ -53,8 +53,7 @@ /*********************************************************************** * DllGetClassObject (DINPUT8.@) */ -HRESULT WINAPI DINPUT8_DllGetClassObject(REFCLSID rclsid, REFIID riid, - LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { FIXME("(%p, %p, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); @@ -65,7 +64,7 @@ /*********************************************************************** * DllRegisterServer (DINPUT8.@) */ -HRESULT WINAPI DINPUT8_DllRegisterServer(void) +HRESULT WINAPI DllRegisterServer(void) { FIXME("(void): stub\n"); @@ -75,7 +74,7 @@ /*********************************************************************** * DllUnregisterServer (DINPUT8.@) */ -HRESULT WINAPI DINPUT8_DllUnregisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { FIXME("(void): stub\n"); diff -urN wine-20050725/dlls/dmband/.cvsignore wine-20050830/dlls/dmband/.cvsignore --- wine-20050725/dlls/dmband/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050830/dlls/dmband/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dmband.dll.dbg.c -libdmband.def version.res diff -urN wine-20050725/dlls/dmband/Makefile.in wine-20050830/dlls/dmband/Makefile.in --- wine-20050725/dlls/dmband/Makefile.in 2005-05-09 16:42:35.000000000 +0200 +++ wine-20050830/dlls/dmband/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dmband.dll -IMPORTLIB = libdmband.$(IMPLIBEXT) IMPORTS = ole32 user32 advapi32 kernel32 EXTRALIBS = -ldxguid -luuid diff -urN wine-20050725/dlls/dmband/dmband.spec wine-20050830/dlls/dmband/dmband.spec --- wine-20050725/dlls/dmband/dmband.spec 2003-07-30 05:48:56.000000000 +0200 +++ wine-20050830/dlls/dmband/dmband.spec 2005-08-08 19:35:29.000000000 +0200 @@ -1,4 +1,4 @@ -@ stdcall -private DllCanUnloadNow() DMBAND_DllCanUnloadNow -@ stdcall -private DllGetClassObject(long long ptr) DMBAND_DllGetClassObject -@ stdcall -private DllRegisterServer() DMBAND_DllRegisterServer -@ stdcall -private DllUnregisterServer() DMBAND_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dmband/dmband_main.c wine-20050830/dlls/dmband/dmband_main.c --- wine-20050725/dlls/dmband/dmband_main.c 2005-05-30 12:01:11.000000000 +0200 +++ wine-20050830/dlls/dmband/dmband_main.c 2005-08-10 16:45:58.000000000 +0200 @@ -148,21 +148,23 @@ /****************************************************************** - * DllCanUnloadNow (DMBAND.1) + * DllCanUnloadNow (DMBAND.@) * * */ -HRESULT WINAPI DMBAND_DllCanUnloadNow(void) { +HRESULT WINAPI DllCanUnloadNow(void) +{ return DMBAND_refCount != 0 ? S_FALSE : S_OK; } /****************************************************************** - * DllGetClassObject (DMBAND.2) + * DllGetClassObject (DMBAND.@) * * */ -HRESULT WINAPI DMBAND_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +{ TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBand) && IsEqualIID (riid, &IID_IClassFactory)) { diff -urN wine-20050725/dlls/dmband/regsvr.c wine-20050830/dlls/dmband/regsvr.c --- wine-20050725/dlls/dmband/regsvr.c 2004-01-20 01:21:42.000000000 +0100 +++ wine-20050830/dlls/dmband/regsvr.c 2005-08-08 19:35:29.000000000 +0200 @@ -507,7 +507,8 @@ /*********************************************************************** * DllRegisterServer (DMBAND.3) */ -HRESULT WINAPI DMBAND_DllRegisterServer(void) { +HRESULT WINAPI DllRegisterServer(void) +{ HRESULT hr; TRACE("\n"); @@ -521,7 +522,8 @@ /*********************************************************************** * DllUnregisterServer (DMBAND.4) */ -HRESULT WINAPI DMBAND_DllUnregisterServer(void) { +HRESULT WINAPI DllUnregisterServer(void) +{ HRESULT hr; TRACE("\n"); diff -urN wine-20050725/dlls/dmcompos/.cvsignore wine-20050830/dlls/dmcompos/.cvsignore --- wine-20050725/dlls/dmcompos/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050830/dlls/dmcompos/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dmcompos.dll.dbg.c -libdmcompos.def version.res diff -urN wine-20050725/dlls/dmcompos/Makefile.in wine-20050830/dlls/dmcompos/Makefile.in --- wine-20050725/dlls/dmcompos/Makefile.in 2005-05-09 16:42:35.000000000 +0200 +++ wine-20050830/dlls/dmcompos/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dmcompos.dll -IMPORTLIB = libdmcompos.$(IMPLIBEXT) IMPORTS = ole32 user32 advapi32 kernel32 EXTRALIBS = -ldxguid -luuid diff -urN wine-20050725/dlls/dmcompos/dmcompos.spec wine-20050830/dlls/dmcompos/dmcompos.spec --- wine-20050725/dlls/dmcompos/dmcompos.spec 2005-05-17 16:41:38.000000000 +0200 +++ wine-20050830/dlls/dmcompos/dmcompos.spec 2005-08-08 20:21:33.000000000 +0200 @@ -1,4 +1,4 @@ @ stdcall -private DllCanUnloadNow() -@ stdcall -private DllGetClassObject(long long ptr) +@ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dmime/.cvsignore wine-20050830/dlls/dmime/.cvsignore --- wine-20050725/dlls/dmime/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050830/dlls/dmime/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dmime.dll.dbg.c -libdmime.def version.res diff -urN wine-20050725/dlls/dmime/Makefile.in wine-20050830/dlls/dmime/Makefile.in --- wine-20050725/dlls/dmime/Makefile.in 2005-05-09 16:42:35.000000000 +0200 +++ wine-20050830/dlls/dmime/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dmime.dll -IMPORTLIB = libdmime.$(IMPLIBEXT) IMPORTS = dsound winmm ole32 user32 advapi32 kernel32 EXTRALIBS = -ldxguid -luuid diff -urN wine-20050725/dlls/dmime/dmime.spec wine-20050830/dlls/dmime/dmime.spec --- wine-20050725/dlls/dmime/dmime.spec 2005-05-17 16:41:37.000000000 +0200 +++ wine-20050830/dlls/dmime/dmime.spec 2005-08-08 20:21:33.000000000 +0200 @@ -1,4 +1,4 @@ @ stdcall -private DllCanUnloadNow() -@ stdcall -private DllGetClassObject(long long ptr) +@ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dmime/segment.c wine-20050830/dlls/dmime/segment.c --- wine-20050725/dlls/dmime/segment.c 2005-06-21 11:44:28.000000000 +0200 +++ wine-20050830/dlls/dmime/segment.c 2005-07-26 20:32:54.000000000 +0200 @@ -252,7 +252,7 @@ } pNewSegTrack->dwGroupBits = dwGroupBits; pNewSegTrack->pTrack = pTrack; - IDirectMusicTrack_Init(pTrack, iface); + IDirectMusicTrack_Init(pTrack, (IDirectMusicSegment *)iface); IDirectMusicTrack_AddRef(pTrack); list_add_tail (&This->Tracks, &pNewSegTrack->entry); diff -urN wine-20050725/dlls/dmloader/.cvsignore wine-20050830/dlls/dmloader/.cvsignore --- wine-20050725/dlls/dmloader/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050830/dlls/dmloader/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dmloader.dll.dbg.c -libdmloader.def version.res diff -urN wine-20050725/dlls/dmloader/Makefile.in wine-20050830/dlls/dmloader/Makefile.in --- wine-20050725/dlls/dmloader/Makefile.in 2005-05-09 16:42:34.000000000 +0200 +++ wine-20050830/dlls/dmloader/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dmloader.dll -IMPORTLIB = libdmloader.$(IMPLIBEXT) IMPORTS = ole32 user32 advapi32 kernel32 EXTRALIBS = -ldxguid -luuid diff -urN wine-20050725/dlls/dmloader/dmloader.spec wine-20050830/dlls/dmloader/dmloader.spec --- wine-20050725/dlls/dmloader/dmloader.spec 2003-07-30 05:48:55.000000000 +0200 +++ wine-20050830/dlls/dmloader/dmloader.spec 2005-08-08 19:35:29.000000000 +0200 @@ -1,4 +1,4 @@ -@ stdcall -private DllCanUnloadNow() DMLOADER_DllCanUnloadNow -@ stdcall -private DllGetClassObject(long long ptr) DMLOADER_DllGetClassObject -@ stdcall -private DllRegisterServer() DMLOADER_DllRegisterServer -@ stdcall -private DllUnregisterServer() DMLOADER_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dmloader/dmloader_main.c wine-20050830/dlls/dmloader/dmloader_main.c --- wine-20050725/dlls/dmloader/dmloader_main.c 2005-07-05 13:02:54.000000000 +0200 +++ wine-20050830/dlls/dmloader/dmloader_main.c 2005-08-10 16:45:58.000000000 +0200 @@ -39,9 +39,10 @@ /****************************************************************** - * DllCanUnloadNow (DMLOADER.1) + * DllCanUnloadNow (DMLOADER.@) */ -HRESULT WINAPI DMLOADER_DllCanUnloadNow (void) { +HRESULT WINAPI DllCanUnloadNow (void) +{ TRACE("(void)\n"); /* if there are no instances left, it's safe to release */ if (!dwDirectMusicContainer && !dwDirectMusicLoader) @@ -52,9 +53,10 @@ /****************************************************************** - * DllGetClassObject (DMLOADER.2) + * DllGetClassObject (DMLOADER.@) */ -HRESULT WINAPI DMLOADER_DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv) { +HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv) +{ TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); if (IsEqualCLSID (rclsid, &CLSID_DirectMusicLoader) && IsEqualIID (riid, &IID_IClassFactory)) { return DMUSIC_CreateDirectMusicLoaderCF (riid, ppv, NULL); diff -urN wine-20050725/dlls/dmloader/dmloader_private.h wine-20050830/dlls/dmloader/dmloader_private.h --- wine-20050725/dlls/dmloader/dmloader_private.h 2005-07-05 13:02:54.000000000 +0200 +++ wine-20050830/dlls/dmloader/dmloader_private.h 2005-07-26 20:32:54.000000000 +0200 @@ -200,7 +200,7 @@ }; /* Custom: */ -extern HRESULT WINAPI IDirectMusicLoaderFileStream_Attach (LPSTREAM iface, LPCWSTR wzFile, LPDIRECTMUSICLOADER pLoader); +extern HRESULT WINAPI IDirectMusicLoaderFileStream_Attach (LPSTREAM iface, LPCWSTR wzFile, LPDIRECTMUSICLOADER8 pLoader); extern void WINAPI IDirectMusicLoaderFileStream_Detach (LPSTREAM iface); /* IUnknown/IStream: */ extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj); @@ -228,7 +228,7 @@ }; /* Custom: */ -extern HRESULT WINAPI IDirectMusicLoaderResourceStream_Attach (LPSTREAM iface, LPBYTE pbMemData, LONGLONG llMemLength, LONGLONG llPos, LPDIRECTMUSICLOADER pLoader); +extern HRESULT WINAPI IDirectMusicLoaderResourceStream_Attach (LPSTREAM iface, LPBYTE pbMemData, LONGLONG llMemLength, LONGLONG llPos, LPDIRECTMUSICLOADER8 pLoader); extern void WINAPI IDirectMusicLoaderResourceStream_Detach (LPSTREAM iface); /* IUnknown/IStream: */ extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj); @@ -253,7 +253,7 @@ }; /* Custom: */ -extern HRESULT WINAPI IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface, LPSTREAM pStream, LPDIRECTMUSICLOADER pLoader); +extern HRESULT WINAPI IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface, LPSTREAM pStream, LPDIRECTMUSICLOADER8 pLoader); extern void WINAPI IDirectMusicLoaderGenericStream_Detach (LPSTREAM iface); /* IUnknown/IStream: */ extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj); diff -urN wine-20050725/dlls/dmloader/loader.c wine-20050830/dlls/dmloader/loader.c --- wine-20050725/dlls/dmloader/loader.c 2005-07-05 13:02:54.000000000 +0200 +++ wine-20050830/dlls/dmloader/loader.c 2005-07-26 20:32:54.000000000 +0200 @@ -197,7 +197,7 @@ ERR(": could not create loader stream\n"); return result; } - result = IDirectMusicLoaderFileStream_Attach (pStream, wszFileName, (LPDIRECTMUSICLOADER)iface); + result = IDirectMusicLoaderFileStream_Attach (pStream, wszFileName, iface); if (FAILED(result)) { ERR(": could not attach stream to file\n"); return result; @@ -213,7 +213,7 @@ ERR(": could not create resource stream\n"); return result; } - result = IDirectMusicLoaderResourceStream_Attach (pStream, pDesc->pbMemData, pDesc->llMemLength, 0, (LPDIRECTMUSICLOADER)iface); + result = IDirectMusicLoaderResourceStream_Attach (pStream, pDesc->pbMemData, pDesc->llMemLength, 0, iface); if (FAILED(result)) { ERR(": could not attach stream to resource\n"); return result; @@ -228,7 +228,7 @@ ERR(": could not create generic stream\n"); return result; } - result = IDirectMusicLoaderGenericStream_Attach (pStream, pDesc->pStream, (LPDIRECTMUSICLOADER)iface); + result = IDirectMusicLoaderGenericStream_Attach (pStream, pDesc->pStream, iface); if (FAILED(result)) { ERR(": failed to attach stream\n"); return result; @@ -346,19 +346,19 @@ /* create stream */ DMUSIC_CreateDirectMusicLoaderFileStream ((LPVOID*)&pStream); /* attach stream */ - IDirectMusicLoaderFileStream_Attach (pStream, wszFileName, (LPDIRECTMUSICLOADER)iface); + IDirectMusicLoaderFileStream_Attach (pStream, wszFileName, iface); } else if (pDesc->dwValidData & DMUS_OBJ_STREAM) { /* create stream */ DMUSIC_CreateDirectMusicLoaderGenericStream ((LPVOID*)&pStream); /* attach stream */ - IDirectMusicLoaderGenericStream_Attach (pStream, pDesc->pStream, (LPDIRECTMUSICLOADER)iface); + IDirectMusicLoaderGenericStream_Attach (pStream, pDesc->pStream, iface); } else if (pDesc->dwValidData & DMUS_OBJ_MEMORY) { /* create stream */ DMUSIC_CreateDirectMusicLoaderResourceStream ((LPVOID*)&pStream); /* attach stream */ - IDirectMusicLoaderResourceStream_Attach (pStream, pDesc->pbMemData, pDesc->llMemLength, 0, (LPDIRECTMUSICLOADER)iface); + IDirectMusicLoaderResourceStream_Attach (pStream, pDesc->pbMemData, pDesc->llMemLength, 0, iface); } else { ERR(": no way to get additional info\n"); diff -urN wine-20050725/dlls/dmloader/loaderstream.c wine-20050830/dlls/dmloader/loaderstream.c --- wine-20050725/dlls/dmloader/loaderstream.c 2005-06-14 13:38:09.000000000 +0200 +++ wine-20050830/dlls/dmloader/loaderstream.c 2005-07-26 20:32:54.000000000 +0200 @@ -56,7 +56,7 @@ * IDirectMusicLoaderFileStream implementation */ /* Custom : */ -HRESULT WINAPI IDirectMusicLoaderFileStream_Attach (LPSTREAM iface, LPCWSTR wzFile, LPDIRECTMUSICLOADER pLoader) { +HRESULT WINAPI IDirectMusicLoaderFileStream_Attach (LPSTREAM iface, LPCWSTR wzFile, LPDIRECTMUSICLOADER8 pLoader) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); TRACE("(%p, %s, %p)\n", This, debugstr_w(wzFile), pLoader); IDirectMusicLoaderFileStream_Detach (iface); @@ -66,7 +66,7 @@ return DMUS_E_LOADER_FAILEDOPEN; } /* create IDirectMusicGetLoader */ - This->pLoader = (LPDIRECTMUSICLOADER8)pLoader; + This->pLoader = pLoader; lstrcpynW (This->wzFileName, wzFile, MAX_PATH); TRACE(": succeeded\n"); return S_OK; @@ -160,7 +160,7 @@ if (FAILED(result)) return result; if (This->hFile != INVALID_HANDLE_VALUE) { ULARGE_INTEGER ullCurrentPosition; - result = IDirectMusicLoaderFileStream_Attach (pOther, This->wzFileName, (LPDIRECTMUSICLOADER)This->pLoader); + result = IDirectMusicLoaderFileStream_Attach (pOther, This->wzFileName, This->pLoader); if (SUCCEEDED(result)) { LARGE_INTEGER liZero; liZero.QuadPart = 0; @@ -312,7 +312,7 @@ * IDirectMusicLoaderResourceStream implementation */ /* Custom : */ -HRESULT WINAPI IDirectMusicLoaderResourceStream_Attach (LPSTREAM iface, LPBYTE pbMemData, LONGLONG llMemLength, LONGLONG llPos, LPDIRECTMUSICLOADER pLoader) { +HRESULT WINAPI IDirectMusicLoaderResourceStream_Attach (LPSTREAM iface, LPBYTE pbMemData, LONGLONG llMemLength, LONGLONG llPos, LPDIRECTMUSICLOADER8 pLoader) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); TRACE("(%p, %p, 0x%08llX, 0x%08llx, %p)\n", This, pbMemData, llMemLength, llPos, pLoader); @@ -576,7 +576,7 @@ * IDirectMusicLoaderGenericStream implementation */ /* Custom : */ -HRESULT WINAPI IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface, LPSTREAM pStream, LPDIRECTMUSICLOADER pLoader) { +HRESULT WINAPI IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface, LPSTREAM pStream, LPDIRECTMUSICLOADER8 pLoader) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE("(%p, %p, %p)\n", This, pStream, pLoader); diff -urN wine-20050725/dlls/dmloader/regsvr.c wine-20050830/dlls/dmloader/regsvr.c --- wine-20050725/dlls/dmloader/regsvr.c 2004-01-20 01:21:41.000000000 +0100 +++ wine-20050830/dlls/dmloader/regsvr.c 2005-08-08 19:35:29.000000000 +0200 @@ -507,7 +507,8 @@ /*********************************************************************** * DllRegisterServer (DMLOADER.3) */ -HRESULT WINAPI DMLOADER_DllRegisterServer(void) { +HRESULT WINAPI DllRegisterServer(void) +{ HRESULT hr; TRACE("\n"); @@ -521,7 +522,8 @@ /*********************************************************************** * DllUnregisterServer (DMLOADER.4) */ -HRESULT WINAPI DMLOADER_DllUnregisterServer(void) { +HRESULT WINAPI DllUnregisterServer(void) +{ HRESULT hr; TRACE("\n"); diff -urN wine-20050725/dlls/dmscript/.cvsignore wine-20050830/dlls/dmscript/.cvsignore --- wine-20050725/dlls/dmscript/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050830/dlls/dmscript/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dmscript.dll.dbg.c -libdmscript.def version.res diff -urN wine-20050725/dlls/dmscript/Makefile.in wine-20050830/dlls/dmscript/Makefile.in --- wine-20050725/dlls/dmscript/Makefile.in 2005-05-09 16:42:34.000000000 +0200 +++ wine-20050830/dlls/dmscript/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dmscript.dll -IMPORTLIB = libdmscript.$(IMPLIBEXT) IMPORTS = ole32 user32 advapi32 kernel32 EXTRALIBS = -ldxguid -luuid diff -urN wine-20050725/dlls/dmscript/dmscript.spec wine-20050830/dlls/dmscript/dmscript.spec --- wine-20050725/dlls/dmscript/dmscript.spec 2003-07-30 05:48:55.000000000 +0200 +++ wine-20050830/dlls/dmscript/dmscript.spec 2005-08-08 19:35:28.000000000 +0200 @@ -1,4 +1,4 @@ -@ stdcall -private DllCanUnloadNow() DMSCRIPT_DllCanUnloadNow -@ stdcall -private DllGetClassObject(long long ptr) DMSCRIPT_DllGetClassObject -@ stdcall -private DllRegisterServer() DMSCRIPT_DllRegisterServer -@ stdcall -private DllUnregisterServer() DMSCRIPT_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dmscript/dmscript_main.c wine-20050830/dlls/dmscript/dmscript_main.c --- wine-20050725/dlls/dmscript/dmscript_main.c 2005-05-30 12:01:09.000000000 +0200 +++ wine-20050830/dlls/dmscript/dmscript_main.c 2005-08-10 16:45:58.000000000 +0200 @@ -560,21 +560,23 @@ /****************************************************************** - * DllCanUnloadNow (DMSCRIPT.1) + * DllCanUnloadNow (DMSCRIPT.@) * * */ -HRESULT WINAPI DMSCRIPT_DllCanUnloadNow(void) { +HRESULT WINAPI DllCanUnloadNow(void) +{ return DMSCRIPT_refCount != 0 ? S_FALSE : S_OK; } /****************************************************************** - * DllGetClassObject (DMSCRIPT.2) + * DllGetClassObject (DMSCRIPT.@) * * */ -HRESULT WINAPI DMSCRIPT_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +{ TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpSegment) && IsEqualIID (riid, &IID_IClassFactory)) { *ppv = (LPVOID) &ScriptAutoImplSegment_CF; diff -urN wine-20050725/dlls/dmscript/regsvr.c wine-20050830/dlls/dmscript/regsvr.c --- wine-20050725/dlls/dmscript/regsvr.c 2004-02-25 02:30:04.000000000 +0100 +++ wine-20050830/dlls/dmscript/regsvr.c 2005-08-08 19:35:28.000000000 +0200 @@ -572,7 +572,8 @@ /*********************************************************************** * DllRegisterServer (DMSCRIPT.3) */ -HRESULT WINAPI DMSCRIPT_DllRegisterServer(void) { +HRESULT WINAPI DllRegisterServer(void) +{ HRESULT hr; TRACE("\n"); @@ -586,7 +587,8 @@ /*********************************************************************** * DllUnregisterServer (DMSCRIPT.4) */ -HRESULT WINAPI DMSCRIPT_DllUnregisterServer(void) { +HRESULT WINAPI DllUnregisterServer(void) +{ HRESULT hr; TRACE("\n"); diff -urN wine-20050725/dlls/dmstyle/.cvsignore wine-20050830/dlls/dmstyle/.cvsignore --- wine-20050725/dlls/dmstyle/.cvsignore 2005-05-07 14:39:57.000000000 +0200 +++ wine-20050830/dlls/dmstyle/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dmstyle.dll.dbg.c -libdmstyle.def version.res diff -urN wine-20050725/dlls/dmstyle/Makefile.in wine-20050830/dlls/dmstyle/Makefile.in --- wine-20050725/dlls/dmstyle/Makefile.in 2005-05-09 16:42:34.000000000 +0200 +++ wine-20050830/dlls/dmstyle/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dmstyle.dll -IMPORTLIB = libdmstyle.$(IMPLIBEXT) IMPORTS = ole32 user32 advapi32 kernel32 EXTRALIBS = -ldxguid -luuid diff -urN wine-20050725/dlls/dmstyle/dmstyle.spec wine-20050830/dlls/dmstyle/dmstyle.spec --- wine-20050725/dlls/dmstyle/dmstyle.spec 2005-05-17 16:41:37.000000000 +0200 +++ wine-20050830/dlls/dmstyle/dmstyle.spec 2005-08-08 20:21:33.000000000 +0200 @@ -1,4 +1,4 @@ @ stdcall -private DllCanUnloadNow() -@ stdcall -private DllGetClassObject(long long ptr) +@ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dmsynth/.cvsignore wine-20050830/dlls/dmsynth/.cvsignore --- wine-20050725/dlls/dmsynth/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050830/dlls/dmsynth/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dmsynth.dll.dbg.c -libdmsynth.def version.res diff -urN wine-20050725/dlls/dmsynth/Makefile.in wine-20050830/dlls/dmsynth/Makefile.in --- wine-20050725/dlls/dmsynth/Makefile.in 2005-05-09 16:42:34.000000000 +0200 +++ wine-20050830/dlls/dmsynth/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dmsynth.dll -IMPORTLIB = libdmsynth.$(IMPLIBEXT) IMPORTS = winmm ole32 user32 advapi32 kernel32 EXTRALIBS = -ldxguid -luuid diff -urN wine-20050725/dlls/dmsynth/dmsynth.spec wine-20050830/dlls/dmsynth/dmsynth.spec --- wine-20050725/dlls/dmsynth/dmsynth.spec 2003-07-30 05:48:55.000000000 +0200 +++ wine-20050830/dlls/dmsynth/dmsynth.spec 2005-08-08 19:35:28.000000000 +0200 @@ -1,4 +1,4 @@ -@ stdcall -private DllCanUnloadNow() DMSYNTH_DllCanUnloadNow -@ stdcall -private DllGetClassObject(long long ptr) DMSYNTH_DllGetClassObject -@ stdcall -private DllRegisterServer() DMSYNTH_DllRegisterServer -@ stdcall -private DllUnregisterServer() DMSYNTH_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dmsynth/dmsynth_main.c wine-20050830/dlls/dmsynth/dmsynth_main.c --- wine-20050725/dlls/dmsynth/dmsynth_main.c 2005-06-01 21:57:43.000000000 +0200 +++ wine-20050830/dlls/dmsynth/dmsynth_main.c 2005-08-10 16:45:58.000000000 +0200 @@ -145,21 +145,23 @@ /****************************************************************** - * DllCanUnloadNow (DMSYNTH.1) + * DllCanUnloadNow (DMSYNTH.@) * * */ -HRESULT WINAPI DMSYNTH_DllCanUnloadNow(void) { +HRESULT WINAPI DllCanUnloadNow(void) +{ return DMSYNTH_refCount != 0 ? S_FALSE : S_OK; } /****************************************************************** - * DllGetClassObject (DMSYNTH.2) + * DllGetClassObject (DMSYNTH.@) * * */ -HRESULT WINAPI DMSYNTH_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +{ TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSynth) && IsEqualIID (riid, &IID_IClassFactory)) { *ppv = (LPVOID) &Synth_CF; diff -urN wine-20050725/dlls/dmsynth/regsvr.c wine-20050830/dlls/dmsynth/regsvr.c --- wine-20050725/dlls/dmsynth/regsvr.c 2004-01-20 01:21:41.000000000 +0100 +++ wine-20050830/dlls/dmsynth/regsvr.c 2005-08-08 19:35:28.000000000 +0200 @@ -507,7 +507,8 @@ /*********************************************************************** * DllRegisterServer (DMSYNTH.3) */ -HRESULT WINAPI DMSYNTH_DllRegisterServer(void) { +HRESULT WINAPI DllRegisterServer(void) +{ HRESULT hr; TRACE("\n"); @@ -521,7 +522,8 @@ /*********************************************************************** * DllUnregisterServer (DMSYNTH.4) */ -HRESULT WINAPI DMSYNTH_DllUnregisterServer(void) { +HRESULT WINAPI DllUnregisterServer(void) +{ HRESULT hr; TRACE("\n"); diff -urN wine-20050725/dlls/dmusic/.cvsignore wine-20050830/dlls/dmusic/.cvsignore --- wine-20050725/dlls/dmusic/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050830/dlls/dmusic/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dmusic.dll.dbg.c -libdmusic.def version.res diff -urN wine-20050725/dlls/dmusic/Makefile.in wine-20050830/dlls/dmusic/Makefile.in --- wine-20050725/dlls/dmusic/Makefile.in 2005-05-09 16:42:34.000000000 +0200 +++ wine-20050830/dlls/dmusic/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dmusic.dll -IMPORTLIB = libdmusic.$(IMPLIBEXT) IMPORTS = winmm ole32 msacm32 dsound rpcrt4 user32 advapi32 kernel32 ntdll EXTRALIBS = -ldxguid -luuid diff -urN wine-20050725/dlls/dmusic/dmusic.spec wine-20050830/dlls/dmusic/dmusic.spec --- wine-20050725/dlls/dmusic/dmusic.spec 2003-07-30 05:48:55.000000000 +0200 +++ wine-20050830/dlls/dmusic/dmusic.spec 2005-08-08 19:35:28.000000000 +0200 @@ -1,4 +1,4 @@ -@ stdcall -private DllCanUnloadNow() DMUSIC_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) DMUSIC_DllGetClassObject -@ stdcall -private DllRegisterServer() DMUSIC_DllRegisterServer -@ stdcall -private DllUnregisterServer() DMUSIC_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dmusic/dmusic_main.c wine-20050830/dlls/dmusic/dmusic_main.c --- wine-20050725/dlls/dmusic/dmusic_main.c 2005-06-01 21:57:43.000000000 +0200 +++ wine-20050830/dlls/dmusic/dmusic_main.c 2005-08-10 16:45:58.000000000 +0200 @@ -145,21 +145,23 @@ /****************************************************************** - * DllCanUnloadNow (DMUSIC.1) + * DllCanUnloadNow (DMUSIC.@) * * */ -HRESULT WINAPI DMUSIC_DllCanUnloadNow(void) { +HRESULT WINAPI DllCanUnloadNow(void) +{ return DMUSIC_refCount != 0 ? S_FALSE : S_OK; } /****************************************************************** - * DllGetClassObject (DMUSIC.2) + * DllGetClassObject (DMUSIC.@) * * */ -HRESULT WINAPI DMUSIC_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +{ TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); if (IsEqualCLSID (rclsid, &CLSID_DirectMusic) && IsEqualIID (riid, &IID_IClassFactory)) { *ppv = (LPVOID) &DirectMusic_CF; diff -urN wine-20050725/dlls/dmusic/regsvr.c wine-20050830/dlls/dmusic/regsvr.c --- wine-20050725/dlls/dmusic/regsvr.c 2004-01-20 01:21:41.000000000 +0100 +++ wine-20050830/dlls/dmusic/regsvr.c 2005-08-08 19:35:28.000000000 +0200 @@ -507,7 +507,8 @@ /*********************************************************************** * DllRegisterServer (DMUSIC.3) */ -HRESULT WINAPI DMUSIC_DllRegisterServer(void) { +HRESULT WINAPI DllRegisterServer(void) +{ HRESULT hr; TRACE("\n"); @@ -521,7 +522,8 @@ /*********************************************************************** * DllUnregisterServer (DMUSIC.4) */ -HRESULT WINAPI DMUSIC_DllUnregisterServer(void) { +HRESULT WINAPI DllUnregisterServer(void) +{ HRESULT hr; TRACE("\n"); diff -urN wine-20050725/dlls/dplay/Makefile.in wine-20050830/dlls/dplay/Makefile.in --- wine-20050725/dlls/dplay/Makefile.in 2005-05-09 16:42:34.000000000 +0200 +++ wine-20050830/dlls/dplay/Makefile.in 2005-08-29 17:11:37.000000000 +0200 @@ -4,7 +4,7 @@ VPATH = @srcdir@ MODULE = dplay.dll IMPORTLIB = libdplay.$(IMPLIBEXT) -IMPORTS = dplayx +IMPORTS = dplayx kernel32 C_SRCS = dplay_main.c diff -urN wine-20050725/dlls/dplayx/dpclassfactory.c wine-20050830/dlls/dplayx/dpclassfactory.c --- wine-20050725/dlls/dplayx/dpclassfactory.c 2005-07-12 21:21:37.000000000 +0200 +++ wine-20050830/dlls/dplayx/dpclassfactory.c 2005-08-10 15:02:44.000000000 +0200 @@ -101,7 +101,7 @@ /******************************************************************************* - * DllGetClassObject [DPLAYX.11] + * DllGetClassObject [DPLAYX.@] * Retrieves DP or DPL class object from a DLL object * * NOTES @@ -117,7 +117,7 @@ * Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG, * E_UNEXPECTED */ -DWORD WINAPI DPLAYX_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); diff -urN wine-20050725/dlls/dplayx/dplay.c wine-20050830/dlls/dplayx/dplay.c --- wine-20050725/dlls/dplayx/dplay.c 2005-07-13 13:59:15.000000000 +0200 +++ wine-20050830/dlls/dplayx/dplay.c 2005-08-30 10:56:35.000000000 +0200 @@ -2498,7 +2498,7 @@ if( lpGData->name.u1.lpszShortNameA ) { - strcpy( ((BYTE*)lpName)+lpGData->name.dwSize, + strcpy( ((char*)lpName)+lpGData->name.dwSize, lpGData->name.u1.lpszShortNameA ); } else @@ -2508,7 +2508,7 @@ if( lpGData->name.u1.lpszShortNameA ) { - strcpy( ((BYTE*)lpName)+lpGData->name.dwSize, + strcpy( ((char*)lpName)+lpGData->name.dwSize, lpGData->name.u2.lpszLongNameA ); } else @@ -2697,7 +2697,7 @@ if( lpPList->lpPData->name.u1.lpszShortNameA ) { - strcpy( ((BYTE*)lpName)+lpPList->lpPData->name.dwSize, + strcpy( ((char*)lpName)+lpPList->lpPData->name.dwSize, lpPList->lpPData->name.u1.lpszShortNameA ); } else @@ -2707,7 +2707,7 @@ if( lpPList->lpPData->name.u1.lpszShortNameA ) { - strcpy( ((BYTE*)lpName)+lpPList->lpPData->name.dwSize, + strcpy( ((char*)lpName)+lpPList->lpPData->name.dwSize, lpPList->lpPData->name.u2.lpszLongNameA ); } else diff -urN wine-20050725/dlls/dplayx/dplaysp.h wine-20050830/dlls/dplayx/dplaysp.h --- wine-20050725/dlls/dplayx/dplaysp.h 2004-10-05 06:16:21.000000000 +0200 +++ wine-20050830/dlls/dplayx/dplaysp.h 2005-07-26 20:32:54.000000000 +0200 @@ -29,7 +29,7 @@ /* GUID for IDirectPlaySP {0C9F6360-CC61-11cf-ACEC-00AA006886E3} */ DEFINE_GUID(IID_IDirectPlaySP, 0xc9f6360, 0xcc61, 0x11cf, 0xac, 0xec, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3); -typedef struct IDirectPlaySP IDirectPlaySP, *LPDIRECTPLAYSP; +typedef struct IDirectPlaySP *LPDIRECTPLAYSP; typedef BOOL (CALLBACK *LPENUMMRUCALLBACK)( LPCVOID lpData, diff -urN wine-20050725/dlls/dplayx/dplayx.spec wine-20050830/dlls/dplayx/dplayx.spec --- wine-20050725/dlls/dplayx/dplayx.spec 2003-08-24 00:55:43.000000000 +0200 +++ wine-20050830/dlls/dplayx/dplayx.spec 2005-08-10 15:02:44.000000000 +0200 @@ -5,7 +5,8 @@ 5 stdcall DirectPlayLobbyCreateW(ptr ptr ptr ptr long) 6 extern gdwDPlaySPRefCount 9 stdcall DirectPlayEnumerate(ptr ptr) DirectPlayEnumerateA - 10 stdcall -private DllCanUnloadNow() DPLAYX_DllCanUnloadNow - 11 stdcall -private DllGetClassObject(ptr ptr ptr) DPLAYX_DllGetClassObject -@ stdcall -private DllRegisterServer() DPLAYX_DllRegisterServer -@ stdcall -private DllUnregisterServer() DPLAYX_DllUnregisterServer + +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dplayx/dplayx_main.c wine-20050830/dlls/dplayx/dplayx_main.c --- wine-20050725/dlls/dplayx/dplayx_main.c 2003-09-29 22:12:05.000000000 +0200 +++ wine-20050830/dlls/dplayx/dplayx_main.c 2005-08-15 12:48:51.000000000 +0200 @@ -73,7 +73,7 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) { - TRACE( "(%p,0x%08lx,%p)\n", hinstDLL, fdwReason, lpvReserved ); + TRACE( "(%p,%ld,%p)\n", hinstDLL, fdwReason, lpvReserved ); switch ( fdwReason ) { @@ -95,9 +95,9 @@ } /*********************************************************************** - * DllCanUnloadNow (DPLAYX.10) + * DllCanUnloadNow (DPLAYX.@) */ -HRESULT WINAPI DPLAYX_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { HRESULT hr = ( gdwDPlaySPRefCount > 0 ) ? S_FALSE : S_OK; diff -urN wine-20050725/dlls/dplayx/lobbysp.h wine-20050830/dlls/dplayx/lobbysp.h --- wine-20050725/dlls/dplayx/lobbysp.h 2004-10-05 06:16:21.000000000 +0200 +++ wine-20050830/dlls/dplayx/lobbysp.h 2005-07-26 20:32:53.000000000 +0200 @@ -28,7 +28,7 @@ /* GUID for IDPLobbySP {5A4E5A20-2CED-11d0-A889-00A0C905433C} */ DEFINE_GUID(IID_IDPLobbySP, 0x5a4e5a20, 0x2ced, 0x11d0, 0xa8, 0x89, 0x0, 0xa0, 0xc9, 0x5, 0x43, 0x3c); -typedef struct IDPLobbySP IDPLobbySP, *LPDPLOBBYSP; +typedef struct IDPLobbySP *LPDPLOBBYSP; /* For SP. Top 16 bits is dplay, bottom 16 is SP */ #define DPLSP_MAJORVERSION 0x00050000 diff -urN wine-20050725/dlls/dplayx/regsvr.c wine-20050830/dlls/dplayx/regsvr.c --- wine-20050725/dlls/dplayx/regsvr.c 2003-09-06 01:08:38.000000000 +0200 +++ wine-20050830/dlls/dplayx/regsvr.c 2005-08-08 19:35:28.000000000 +0200 @@ -528,7 +528,7 @@ /*********************************************************************** * DllRegisterServer (DPLAYX.@) */ -HRESULT WINAPI DPLAYX_DllRegisterServer(void) +HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -543,7 +543,7 @@ /*********************************************************************** * DllUnregisterServer (DPLAYX.@) */ -HRESULT WINAPI DPLAYX_DllUnregisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; diff -urN wine-20050725/dlls/dpnet/dpnet.spec wine-20050830/dlls/dpnet/dpnet.spec --- wine-20050725/dlls/dpnet/dpnet.spec 2004-04-07 22:39:00.000000000 +0200 +++ wine-20050830/dlls/dpnet/dpnet.spec 2005-08-08 19:35:28.000000000 +0200 @@ -1,5 +1,5 @@ @ stdcall DirectPlay8Create(ptr ptr ptr) -@ stdcall -private DllCanUnloadNow() DPNET_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) DPNET_DllGetClassObject -@ stdcall -private DllRegisterServer() DPNET_DllRegisterServer -@ stdcall -private DllUnregisterServer() DPNET_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dpnet/dpnet_main.c wine-20050830/dlls/dpnet/dpnet_main.c --- wine-20050725/dlls/dpnet/dpnet_main.c 2005-07-12 21:21:37.000000000 +0200 +++ wine-20050830/dlls/dpnet/dpnet_main.c 2005-08-08 19:35:28.000000000 +0200 @@ -121,7 +121,7 @@ /*********************************************************************** * DllCanUnloadNow (DPNET.@) */ -BOOL WINAPI DPNET_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { return S_FALSE; } @@ -129,7 +129,7 @@ /*********************************************************************** * DllGetClassObject (DPNET.@) */ -HRESULT WINAPI DPNET_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { int i = 0; diff -urN wine-20050725/dlls/dpnet/regsvr.c wine-20050830/dlls/dpnet/regsvr.c --- wine-20050725/dlls/dpnet/regsvr.c 2004-04-07 22:39:00.000000000 +0200 +++ wine-20050830/dlls/dpnet/regsvr.c 2005-08-08 19:35:28.000000000 +0200 @@ -557,7 +557,7 @@ /*********************************************************************** * DllRegisterServer (DPNET.@) */ -HRESULT WINAPI DPNET_DllRegisterServer(void) +HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -572,7 +572,7 @@ /*********************************************************************** * DllUnregisterServer (DPNET.@) */ -HRESULT WINAPI DPNET_DllUnregisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; diff -urN wine-20050725/dlls/dpnhpast/.cvsignore wine-20050830/dlls/dpnhpast/.cvsignore --- wine-20050725/dlls/dpnhpast/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050830/dlls/dpnhpast/.cvsignore 2005-07-26 17:52:59.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dpnhpast.dll.dbg.c -libdpnhpast.def version.res diff -urN wine-20050725/dlls/dpnhpast/Makefile.in wine-20050830/dlls/dpnhpast/Makefile.in --- wine-20050725/dlls/dpnhpast/Makefile.in 2005-05-09 16:42:34.000000000 +0200 +++ wine-20050830/dlls/dpnhpast/Makefile.in 2005-07-26 17:52:59.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dpnhpast.dll -IMPORTLIB = libdpnhpast.$(IMPLIBEXT) IMPORTS = kernel32 C_SRCS = \ diff -urN wine-20050725/dlls/dpnhpast/dpnhpast.spec wine-20050830/dlls/dpnhpast/dpnhpast.spec --- wine-20050725/dlls/dpnhpast/dpnhpast.spec 2003-07-30 05:48:55.000000000 +0200 +++ wine-20050830/dlls/dpnhpast/dpnhpast.spec 2005-08-10 15:02:43.000000000 +0200 @@ -1,5 +1,6 @@ 1 stub DirectPlayNATHelpCreate -2 stdcall -private DllRegisterServer() DPNHPAST_DllRegisterServer -3 stdcall -private DllCanUnloadNow() DPNHPAST_DllCanUnloadNow -4 stdcall -private DllGetClassObject( long long ptr ) DPNHPAST_DllGetClassObject -5 stdcall -private DllUnregisterServer() DPNHPAST_DllUnregisterServer + +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dpnhpast/main.c wine-20050830/dlls/dpnhpast/main.c --- wine-20050725/dlls/dpnhpast/main.c 2003-09-06 01:08:38.000000000 +0200 +++ wine-20050830/dlls/dpnhpast/main.c 2005-08-10 15:02:43.000000000 +0200 @@ -63,11 +63,11 @@ /****************************************************************** - * DllRegisterServer (DPNHPAST.2) + * DllRegisterServer (DPNHPAST.@) * * */ -HRESULT WINAPI DPNHPAST_DllRegisterServer(void) +HRESULT WINAPI DllRegisterServer(void) { FIXME(":stub\n"); return S_OK; @@ -75,11 +75,11 @@ /****************************************************************** - * DllCanUnloadNow (DPNHPAST.3) + * DllCanUnloadNow (DPNHPAST.@) * * */ -HRESULT WINAPI DPNHPAST_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { FIXME(":stub\n"); return S_OK; @@ -87,11 +87,11 @@ /****************************************************************** - * DllGetClassObject (DPNHPAST.4) + * DllGetClassObject (DPNHPAST.@) * * */ -HRESULT WINAPI DPNHPAST_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { FIXME(":stub\n"); return E_FAIL; @@ -99,11 +99,11 @@ /****************************************************************** - * DllUnregisterServer (DPNHPAST.5) + * DllUnregisterServer (DPNHPAST.@) * * */ -HRESULT WINAPI DPNHPAST_DllUnregisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { FIXME(":stub\n"); return S_OK; diff -urN wine-20050725/dlls/dsound/capture.c wine-20050830/dlls/dsound/capture.c --- wine-20050725/dlls/dsound/capture.c 2005-06-05 19:44:30.000000000 +0200 +++ wine-20050830/dlls/dsound/capture.c 2005-08-30 10:56:35.000000000 +0200 @@ -1488,11 +1488,11 @@ break; } if (c == 0) { - ipDSC->device->pwave[0].lpData = ipDSC->device->buffer; + ipDSC->device->pwave[0].lpData = (LPSTR)ipDSC->device->buffer; ipDSC->device->pwave[0].dwBufferLength = This->notifies[0].dwOffset + 1; } else { - ipDSC->device->pwave[c].lpData = ipDSC->device->buffer + + ipDSC->device->pwave[c].lpData = (LPSTR)ipDSC->device->buffer + This->notifies[c-1].dwOffset + 1; ipDSC->device->pwave[c].dwBufferLength = This->notifies[c].dwOffset - @@ -1534,7 +1534,7 @@ else ipDSC->device->pwave = HeapAlloc(GetProcessHeap(),0,sizeof(WAVEHDR)); - ipDSC->device->pwave[0].lpData = ipDSC->device->buffer; + ipDSC->device->pwave[0].lpData = (LPSTR)ipDSC->device->buffer; ipDSC->device->pwave[0].dwBufferLength = ipDSC->device->buflen; ipDSC->device->pwave[0].dwBytesRecorded = 0; ipDSC->device->pwave[0].dwUser = (DWORD)ipDSC; diff -urN wine-20050725/dlls/dsound/dsound_main.c wine-20050830/dlls/dsound/dsound_main.c --- wine-20050725/dlls/dsound/dsound_main.c 2005-07-07 14:08:43.000000000 +0200 +++ wine-20050830/dlls/dsound/dsound_main.c 2005-08-15 12:48:51.000000000 +0200 @@ -653,7 +653,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) { int i; - TRACE("(%p 0x%lx %p)\n", hInstDLL, fdwReason, lpvReserved); + TRACE("(%p %ld %p)\n", hInstDLL, fdwReason, lpvReserved); switch (fdwReason) { case DLL_PROCESS_ATTACH: diff -urN wine-20050725/dlls/dsound/mixer.c wine-20050830/dlls/dsound/mixer.c --- wine-20050725/dlls/dsound/mixer.c 2005-06-21 11:43:29.000000000 +0200 +++ wine-20050830/dlls/dsound/mixer.c 2005-08-03 21:13:58.000000000 +0200 @@ -490,6 +490,9 @@ dsb->buf_mixpos %= dsb->buflen; if (dsb->leadin && (dsb->startpos <= dsb->buf_mixpos)) dsb->leadin = FALSE; /* HACK: see above */ + } else if (dsb->buf_mixpos > dsb->buflen) { + ERR("Mixpos (%lu) past buflen (%lu), capping...\n", dsb->buf_mixpos, dsb->buflen); + dsb->buf_mixpos = dsb->buflen; } } diff -urN wine-20050725/dlls/dsound/primary.c wine-20050830/dlls/dsound/primary.c --- wine-20050725/dlls/dsound/primary.c 2005-06-01 21:57:42.000000000 +0200 +++ wine-20050830/dlls/dsound/primary.c 2005-08-30 10:56:35.000000000 +0200 @@ -96,7 +96,7 @@ /* prepare fragment headers */ for (c=0; cpwave[c]->lpData = device->buffer + c*device->fraglen; + device->pwave[c]->lpData = (char*)device->buffer + c*device->fraglen; device->pwave[c]->dwBufferLength = device->fraglen; device->pwave[c]->dwUser = (DWORD)device; device->pwave[c]->dwFlags = 0; diff -urN wine-20050725/dlls/dswave/.cvsignore wine-20050830/dlls/dswave/.cvsignore --- wine-20050725/dlls/dswave/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050830/dlls/dswave/.cvsignore 2005-07-26 17:52:58.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dswave.dll.dbg.c -libdswave.def version.res diff -urN wine-20050725/dlls/dswave/Makefile.in wine-20050830/dlls/dswave/Makefile.in --- wine-20050725/dlls/dswave/Makefile.in 2005-05-09 16:42:34.000000000 +0200 +++ wine-20050830/dlls/dswave/Makefile.in 2005-07-26 17:52:58.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dswave.dll -IMPORTLIB = libdswave.$(IMPLIBEXT) IMPORTS = msacm32 ole32 user32 advapi32 kernel32 EXTRALIBS = -ldxguid -luuid diff -urN wine-20050725/dlls/dswave/dswave.spec wine-20050830/dlls/dswave/dswave.spec --- wine-20050725/dlls/dswave/dswave.spec 2004-01-20 01:21:41.000000000 +0100 +++ wine-20050830/dlls/dswave/dswave.spec 2005-08-08 19:35:28.000000000 +0200 @@ -1,4 +1,4 @@ -@ stdcall -private DllCanUnloadNow() DSWAVE_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) DSWAVE_DllGetClassObject -@ stdcall -private DllRegisterServer() DSWAVE_DllRegisterServer -@ stdcall -private DllUnregisterServer() DSWAVE_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dswave/dswave_main.c wine-20050830/dlls/dswave/dswave_main.c --- wine-20050725/dlls/dswave/dswave_main.c 2005-06-01 21:57:42.000000000 +0200 +++ wine-20050830/dlls/dswave/dswave_main.c 2005-08-10 16:45:58.000000000 +0200 @@ -97,21 +97,23 @@ /****************************************************************** - * DllCanUnloadNow (DSWAVE.1) + * DllCanUnloadNow (DSWAVE.@) * * */ -HRESULT WINAPI DSWAVE_DllCanUnloadNow(void) { +HRESULT WINAPI DllCanUnloadNow(void) +{ return DSWAVE_refCount != 0 ? S_FALSE : S_OK; } /****************************************************************** - * DllGetClassObject (DSWAVE.2) + * DllGetClassObject (DSWAVE.@) * * */ -HRESULT WINAPI DSWAVE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +{ TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); if (IsEqualCLSID (rclsid, &CLSID_DirectSoundWave) && IsEqualIID (riid, &IID_IClassFactory)) { *ppv = (LPVOID) &Wave_CF; diff -urN wine-20050725/dlls/dswave/regsvr.c wine-20050830/dlls/dswave/regsvr.c --- wine-20050725/dlls/dswave/regsvr.c 2004-01-20 01:21:41.000000000 +0100 +++ wine-20050830/dlls/dswave/regsvr.c 2005-08-08 19:35:28.000000000 +0200 @@ -499,7 +499,8 @@ /*********************************************************************** * DllRegisterServer (DSWAVE.3) */ -HRESULT WINAPI DSWAVE_DllRegisterServer(void) { +HRESULT WINAPI DllRegisterServer(void) +{ HRESULT hr; TRACE("\n"); @@ -513,7 +514,8 @@ /*********************************************************************** * DllUnregisterServer (DSWAVE.4) */ -HRESULT WINAPI DSWAVE_DllUnregisterServer(void) { +HRESULT WINAPI DllUnregisterServer(void) +{ HRESULT hr; TRACE("\n"); diff -urN wine-20050725/dlls/dxdiagn/.cvsignore wine-20050830/dlls/dxdiagn/.cvsignore --- wine-20050725/dlls/dxdiagn/.cvsignore 2005-05-07 14:39:56.000000000 +0200 +++ wine-20050830/dlls/dxdiagn/.cvsignore 2005-07-26 17:52:58.000000000 +0200 @@ -1,4 +1,3 @@ Makefile dxdiagn.dll.dbg.c -libdxdiagn.def version.res diff -urN wine-20050725/dlls/dxdiagn/Makefile.in wine-20050830/dlls/dxdiagn/Makefile.in --- wine-20050725/dlls/dxdiagn/Makefile.in 2005-05-09 16:42:34.000000000 +0200 +++ wine-20050830/dlls/dxdiagn/Makefile.in 2005-07-26 17:52:58.000000000 +0200 @@ -3,7 +3,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dxdiagn.dll -IMPORTLIB = libdxdiagn.$(IMPLIBEXT) IMPORTS = ole32 oleaut32 user32 advapi32 kernel32 EXTRALIBS = -ldxguid -luuid diff -urN wine-20050725/dlls/dxdiagn/dxdiag_private.h wine-20050830/dlls/dxdiagn/dxdiag_private.h --- wine-20050725/dlls/dxdiagn/dxdiag_private.h 2005-06-20 16:18:04.000000000 +0200 +++ wine-20050830/dlls/dxdiagn/dxdiag_private.h 2005-08-03 13:03:05.000000000 +0200 @@ -46,7 +46,7 @@ struct IDxDiagProviderImpl { /* IUnknown fields */ const IDxDiagProviderVtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDxDiagProvider fields */ BOOL init; DXDIAG_INIT_PARAMS params; @@ -85,7 +85,7 @@ struct IDxDiagContainerImpl { /* IUnknown fields */ const IDxDiagContainerVtbl *lpVtbl; - DWORD ref; + LONG ref; /* IDxDiagContainer fields */ IDxDiagContainerImpl_Property* properties; IDxDiagContainerImpl_SubContainer* subContainers; diff -urN wine-20050725/dlls/dxdiagn/dxdiagn.spec wine-20050830/dlls/dxdiagn/dxdiagn.spec --- wine-20050725/dlls/dxdiagn/dxdiagn.spec 2004-04-16 02:26:14.000000000 +0200 +++ wine-20050830/dlls/dxdiagn/dxdiagn.spec 2005-08-08 19:35:28.000000000 +0200 @@ -1,4 +1,4 @@ -@ stdcall -private DllCanUnloadNow() DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) DllGetClassObject -@ stdcall -private DllRegisterServer() DllRegisterServer -@ stdcall -private DllUnregisterServer() DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -urN wine-20050725/dlls/dxerr8/Makefile.in wine-20050830/dlls/dxerr8/Makefile.in --- wine-20050725/dlls/dxerr8/Makefile.in 2004-10-20 01:06:12.000000000 +0200 +++ wine-20050830/dlls/dxerr8/Makefile.in 2005-08-25 14:14:13.000000000 +0200 @@ -1,6 +1,3 @@ -DLLDEFS = @DLLDEFS@ -DLLFLAGS = @DLLFLAGS@ -DEFS = -D__WINESRC__ $(DLLDEFS) TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ @@ -12,19 +9,6 @@ EXTRA_OBJS = $(MODULE).dbg.o -all: $(MODULE) - -@MAKE_RULES@ - -$(MODULE): $(OBJS) Makefile.in - $(RM) $@ - $(AR) $@ $(OBJS) - $(RANLIB) $@ - -man: - -doc-html: - -doc-sgml: +@MAKE_IMPLIB_RULES@ ### Dependencies: diff -urN wine-20050725/dlls/dxerr9/Makefile.in wine-20050830/dlls/dxerr9/Makefile.in --- wine-20050725/dlls/dxerr9/Makefile.in 2004-10-20 01:06:11.000000000 +0200 +++ wine-20050830/dlls/dxerr9/Makefile.in 2005-08-25 14:14:13.000000000 +0200 @@ -1,6 +1,3 @@ -DLLDEFS = @DLLDEFS@ -DLLFLAGS = @DLLFLAGS@ -DEFS = -D__WINESRC__ $(DLLDEFS) TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ @@ -12,19 +9,6 @@ EXTRA_OBJS = $(MODULE).dbg.o -all: $(MODULE) - -@MAKE_RULES@ - -$(MODULE): $(OBJS) Makefile.in - $(RM) $@ - $(AR) $@ $(OBJS) - $(RANLIB) $@ - -man: - -doc-html: - -doc-sgml: +@MAKE_IMPLIB_RULES@ ### Dependencies: diff -urN wine-20050725/dlls/dxguid/Makefile.in wine-20050830/dlls/dxguid/Makefile.in --- wine-20050725/dlls/dxguid/Makefile.in 2004-10-20 01:06:11.000000000 +0200 +++ wine-20050830/dlls/dxguid/Makefile.in 2005-08-25 14:14:13.000000000 +0200 @@ -1,6 +1,3 @@ -DLLDEFS = @DLLDEFS@ -DLLFLAGS = @DLLFLAGS@ -DEFS = -D__WINESRC__ $(DLLDEFS) TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ @@ -12,19 +9,6 @@ dx9guid.c \ dxguid.c -all: $(MODULE) - -@MAKE_RULES@ - -$(MODULE): $(OBJS) Makefile.in - $(RM) $@ - $(AR) $@ $(OBJS) - $(RANLIB) $@ - -man: - -doc-html: - -doc-sgml: +@MAKE_IMPLIB_RULES@ ### Dependencies: diff -urN wine-20050725/dlls/gdi/dib.c wine-20050830/dlls/gdi/dib.c --- wine-20050725/dlls/gdi/dib.c 2005-07-14 12:15:42.000000000 +0200 +++ wine-20050830/dlls/gdi/dib.c 2005-08-19 15:58:34.000000000 +0200 @@ -42,6 +42,10 @@ - BITMAPV4HEADER: Introduced in Windows 95 / NT 4.0 - BITMAPV5HEADER: Introduced in Windows 98 / 2000 + + If biCompression is BI_BITFIELDS, the color masks are at the same position + in all the headers (they start at bmiColors of BITMAPINFOHEADER), because + the new headers have structure members for the masks. * You should never access the color table using the bmiColors member, @@ -956,12 +960,30 @@ info->bmiHeader.biWidth = bmp->bitmap.bmWidth; info->bmiHeader.biHeight = bmp->bitmap.bmHeight; info->bmiHeader.biPlanes = 1; - info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel; info->bmiHeader.biSizeImage = DIB_GetDIBImageBytes( bmp->bitmap.bmWidth, bmp->bitmap.bmHeight, bmp->bitmap.bmBitsPixel ); - info->bmiHeader.biCompression = 0; + switch(bmp->bitmap.bmBitsPixel) + { + case 15: + info->bmiHeader.biBitCount = 16; + info->bmiHeader.biCompression = BI_RGB; + break; + + case 16: + info->bmiHeader.biBitCount = 16; + info->bmiHeader.biCompression = BI_BITFIELDS; + ((PDWORD)info->bmiColors)[0] = 0xf800; + ((PDWORD)info->bmiColors)[1] = 0x07e0; + ((PDWORD)info->bmiColors)[2] = 0x001f; + break; + + default: + info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel; + info->bmiHeader.biCompression = BI_RGB; + break; + } info->bmiHeader.biXPelsPerMeter = 0; info->bmiHeader.biYPelsPerMeter = 0; info->bmiHeader.biClrUsed = 0; @@ -1118,7 +1140,6 @@ LONG width, height; WORD planes, bpp; DWORD compression, sizeImage; - const DWORD *colorPtr; void *mapBits = NULL; if (((bitmap_type = DIB_GetBitmapInfo( &bmi->bmiHeader, &width, &height, @@ -1167,7 +1188,6 @@ /* set dsBitfields values */ - colorPtr = (const DWORD *)((const char *)bmi + (WORD) bmi->bmiHeader.biSize); if (usage == DIB_PAL_COLORS || bpp <= 8) { dib->dsBitfields[0] = dib->dsBitfields[1] = dib->dsBitfields[2] = 0; @@ -1176,15 +1196,15 @@ { case 15: case 16: - dib->dsBitfields[0] = (compression == BI_BITFIELDS) ? colorPtr[0] : 0x7c00; - dib->dsBitfields[1] = (compression == BI_BITFIELDS) ? colorPtr[1] : 0x03e0; - dib->dsBitfields[2] = (compression == BI_BITFIELDS) ? colorPtr[2] : 0x001f; + dib->dsBitfields[0] = (compression == BI_BITFIELDS) ? *(const DWORD *)bmi->bmiColors : 0x7c00; + dib->dsBitfields[1] = (compression == BI_BITFIELDS) ? *((const DWORD *)bmi->bmiColors + 1) : 0x03e0; + dib->dsBitfields[2] = (compression == BI_BITFIELDS) ? *((const DWORD *)bmi->bmiColors + 2) : 0x001f; break; case 24: case 32: - dib->dsBitfields[0] = (compression == BI_BITFIELDS) ? colorPtr[0] : 0xff0000; - dib->dsBitfields[1] = (compression == BI_BITFIELDS) ? colorPtr[1] : 0x00ff00; - dib->dsBitfields[2] = (compression == BI_BITFIELDS) ? colorPtr[2] : 0x0000ff; + dib->dsBitfields[0] = (compression == BI_BITFIELDS) ? *(const DWORD *)bmi->bmiColors : 0xff0000; + dib->dsBitfields[1] = (compression == BI_BITFIELDS) ? *((const DWORD *)bmi->bmiColors + 1) : 0x00ff00; + dib->dsBitfields[2] = (compression == BI_BITFIELDS) ? *((const DWORD *)bmi->bmiColors + 2) : 0x0000ff; break; } diff -urN wine-20050725/dlls/gdi/driver.c wine-20050830/dlls/gdi/driver.c --- wine-20050725/dlls/gdi/driver.c 2005-07-05 13:02:37.000000000 +0200 +++ wine-20050830/dlls/gdi/driver.c 2005-08-08 17:03:42.000000000 +0200 @@ -410,14 +410,14 @@ dmW = HeapAlloc(GetProcessHeap(), 0, dmW_size + dmA->dmDriverExtra); if (!dmW) return NULL; - MultiByteToWideChar(CP_ACP, 0, dmA->dmDeviceName, CCHDEVICENAME, + MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmDeviceName, CCHDEVICENAME, dmW->dmDeviceName, CCHDEVICENAME); /* copy slightly more, to avoid long computations */ memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, dmA->dmSize - CCHDEVICENAME); if (dmA->dmSize >= (const char *)dmA->dmFormName - (const char *)dmA + CCHFORMNAME) { - MultiByteToWideChar(CP_ACP, 0, dmA->dmFormName, CCHFORMNAME, + MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmFormName, CCHFORMNAME, dmW->dmFormName, CCHFORMNAME); if (dmA->dmSize > (const char *)&dmA->dmLogPixels - (const char *)dmA) memcpy(&dmW->dmLogPixels, &dmA->dmLogPixels, dmA->dmSize - ((const char *)&dmA->dmLogPixels - (const char *)dmA)); diff -urN wine-20050725/dlls/gdi/enhmfdrv/enhmetafiledrv.h wine-20050830/dlls/gdi/enhmfdrv/enhmetafiledrv.h --- wine-20050725/dlls/gdi/enhmfdrv/enhmetafiledrv.h 2004-03-04 21:41:13.000000000 +0100 +++ wine-20050830/dlls/gdi/enhmfdrv/enhmetafiledrv.h 2005-08-23 11:38:59.000000000 +0200 @@ -78,7 +78,7 @@ extern INT EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ); extern BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, - UINT count, const INT *lpDx, INT breakExtra ); + UINT count, const INT *lpDx ); extern BOOL EMFDRV_FillPath( PHYSDEV dev ); extern BOOL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ); extern BOOL EMFDRV_FlattenPath( PHYSDEV dev ); diff -urN wine-20050725/dlls/gdi/enhmfdrv/graphics.c wine-20050830/dlls/gdi/enhmfdrv/graphics.c --- wine-20050725/dlls/gdi/enhmfdrv/graphics.c 2004-12-21 15:49:19.000000000 +0100 +++ wine-20050830/dlls/gdi/enhmfdrv/graphics.c 2005-08-23 11:38:59.000000000 +0200 @@ -710,7 +710,7 @@ */ BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, UINT count, - const INT *lpDx, INT breakExtra ) + const INT *lpDx ) { EMREXTTEXTOUTW *pemr; DWORD nSize; diff -urN wine-20050725/dlls/gdi/font.c wine-20050830/dlls/gdi/font.c --- wine-20050725/dlls/gdi/font.c 2005-07-18 20:05:04.000000000 +0200 +++ wine-20050830/dlls/gdi/font.c 2005-08-23 11:38:59.000000000 +0200 @@ -68,6 +68,25 @@ return GDI_ROUND(floatHeight); } +static inline INT INTERNAL_XWSTODS(DC *dc, INT width) +{ + POINT pt[2]; + pt[0].x = pt[0].y = 0; + pt[1].x = width; + pt[1].y = 0; + LPtoDP(dc->hSelf, pt, 2); + return pt[1].x - pt[0].x; +} + +static inline INT INTERNAL_YWSTODS(DC *dc, INT height) +{ + POINT pt[2]; + pt[0].x = pt[0].y = 0; + pt[1].x = 0; + pt[1].y = height; + LPtoDP(dc->hSelf, pt, 2); + return pt[1].y - pt[0].y; +} static HGDIOBJ FONT_SelectObject( HGDIOBJ handle, void *obj, HDC hdc ); static INT FONT_GetObject16( HGDIOBJ handle, void *obj, INT count, LPVOID buffer ); @@ -229,13 +248,13 @@ FONT_LogFontWTo16( (LPLOGFONTW)fontW, (LPLOGFONT16)font16); WideCharToMultiByte( CP_ACP, 0, fontW->elfFullName, -1, - font16->elfFullName, LF_FULLFACESIZE, NULL, NULL ); + (LPSTR) font16->elfFullName, LF_FULLFACESIZE, NULL, NULL ); font16->elfFullName[LF_FULLFACESIZE-1] = '\0'; WideCharToMultiByte( CP_ACP, 0, fontW->elfStyle, -1, - font16->elfStyle, LF_FACESIZE, NULL, NULL ); + (LPSTR) font16->elfStyle, LF_FACESIZE, NULL, NULL ); font16->elfStyle[LF_FACESIZE-1] = '\0'; WideCharToMultiByte( CP_ACP, 0, fontW->elfScript, -1, - font16->elfScript, LF_FACESIZE, NULL, NULL ); + (LPSTR) font16->elfScript, LF_FACESIZE, NULL, NULL ); font16->elfScript[LF_FACESIZE-1] = '\0'; } @@ -244,13 +263,13 @@ FONT_LogFontWToA( (LPLOGFONTW)fontW, (LPLOGFONTA)fontA); WideCharToMultiByte( CP_ACP, 0, fontW->elfFullName, -1, - fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL ); + (LPSTR) fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL ); fontA->elfFullName[LF_FULLFACESIZE-1] = '\0'; WideCharToMultiByte( CP_ACP, 0, fontW->elfStyle, -1, - fontA->elfStyle, LF_FACESIZE, NULL, NULL ); + (LPSTR) fontA->elfStyle, LF_FACESIZE, NULL, NULL ); fontA->elfStyle[LF_FACESIZE-1] = '\0'; WideCharToMultiByte( CP_ACP, 0, fontW->elfScript, -1, - fontA->elfScript, LF_FACESIZE, NULL, NULL ); + (LPSTR) fontA->elfScript, LF_FACESIZE, NULL, NULL ); fontA->elfScript[LF_FACESIZE-1] = '\0'; } @@ -1718,36 +1737,320 @@ const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx ) { BOOL ret = FALSE; + LPWSTR reordered_str = (LPWSTR)str; + const WORD *glyphs = NULL; + UINT align = GetTextAlign( hdc ); + POINT pt; + TEXTMETRICW tm; + LOGFONTW lf; + double cosEsc, sinEsc; + INT *deltas = NULL, char_extra; + SIZE sz; + RECT rc; + BOOL done_extents = FALSE; + INT width, xwidth, ywidth; + DWORD type; DC * dc = DC_GetDCUpdate( hdc ); - if (dc) + + if (!dc) return FALSE; + + if (flags & (ETO_NUMERICSLOCAL | ETO_NUMERICSLATIN | ETO_PDY)) + FIXME("flags ETO_NUMERICSLOCAL | ETO_NUMERICSLATIN | ETO_PDY unimplemented\n"); + + if(PATH_IsPathOpen(dc->path)) + { + FIXME("called on an open path\n"); + GDI_ReleaseObj( hdc ); + return ret; + } + + if(!dc->funcs->pExtTextOut) + { + GDI_ReleaseObj( hdc ); + return ret; + } + + type = GetObjectType(hdc); + if(type == OBJ_METADC || type == OBJ_ENHMETADC) + { + ret = dc->funcs->pExtTextOut(dc->physDev, x, y, flags, lprect, str, count, lpDx); + GDI_ReleaseObj( hdc ); + return ret; + } + + if( !(flags & (ETO_GLYPH_INDEX | ETO_IGNORELANGUAGE)) && BidiAvail && count > 0 ) + { + reordered_str = HeapAlloc(GetProcessHeap(), 0, count*sizeof(WCHAR)); + + BIDI_Reorder( str, count, GCP_REORDER, + ((flags&ETO_RTLREADING)!=0 || (GetTextAlign(hdc)&TA_RTLREADING)!=0)? + WINE_GCPW_FORCE_RTL:WINE_GCPW_FORCE_LTR, + reordered_str, count, NULL ); + + flags |= ETO_IGNORELANGUAGE; + } + + TRACE("%p, %d, %d, %08x, %p, %s, %d, %p)\n", hdc, x, y, flags, + lprect, debugstr_wn(str, count), count, lpDx); + + if(flags & ETO_GLYPH_INDEX) + glyphs = (const WORD*)reordered_str; + else if(dc->gdiFont) { - if (flags&(ETO_NUMERICSLOCAL|ETO_NUMERICSLATIN|ETO_PDY)) - FIXME("flags ETO_NUMERICSLOCAL|ETO_NUMERICSLATIN|ETO_PDY unimplemented\n"); + glyphs = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WCHAR)); + GetGlyphIndicesW(hdc, reordered_str, count, (WORD*)glyphs, 0); + flags |= ETO_GLYPH_INDEX; + } + + if(lprect) + TRACE("rect: %ld,%ld - %ld,%ld\n", lprect->left, lprect->top, lprect->right, + lprect->bottom); + TRACE("align = %x bkmode = %x mapmode = %x\n", align, GetBkMode(hdc), GetMapMode(hdc)); + + if(align & TA_UPDATECP) + { + GetCurrentPositionEx( hdc, &pt ); + x = pt.x; + y = pt.y; + } + + GetTextMetricsW(hdc, &tm); + GetObjectW(GetCurrentObject(hdc, OBJ_FONT), sizeof(lf), &lf); - if(PATH_IsPathOpen(dc->path)) - FIXME("called on an open path\n"); - else if(dc->funcs->pExtTextOut) + if(!(tm.tmPitchAndFamily & TMPF_VECTOR)) /* Non-scalable fonts shouldn't be rotated */ + lf.lfEscapement = 0; + + if(lf.lfEscapement != 0) + { + cosEsc = cos(lf.lfEscapement * M_PI / 1800); + sinEsc = sin(lf.lfEscapement * M_PI / 1800); + } + else + { + cosEsc = 1; + sinEsc = 0; + } + + if(flags & (ETO_CLIPPED | ETO_OPAQUE)) + { + if(!lprect) + { + if(flags & ETO_CLIPPED) goto done; + if(flags & ETO_GLYPH_INDEX) + GetTextExtentPointI(hdc, glyphs, count, &sz); + else + GetTextExtentPointW(hdc, reordered_str, count, &sz); + + done_extents = TRUE; + rc.left = x; + rc.top = y; + rc.right = x + sz.cx; + rc.bottom = y + sz.cy; + } + else { - if( !(flags&(ETO_GLYPH_INDEX|ETO_IGNORELANGUAGE)) && BidiAvail && count>0 ) + rc = *lprect; + } + + LPtoDP(hdc, (POINT*)&rc, 2); + + if(rc.left > rc.right) {INT tmp = rc.left; rc.left = rc.right; rc.right = tmp;} + if(rc.top > rc.bottom) {INT tmp = rc.top; rc.top = rc.bottom; rc.bottom = tmp;} + } + + if(flags & ETO_OPAQUE) + dc->funcs->pExtTextOut(dc->physDev, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL); + + if(count == 0) + goto done; + + pt.x = x; + pt.y = y; + LPtoDP(hdc, &pt, 1); + x = pt.x; + y = pt.y; + + char_extra = GetTextCharacterExtra(hdc); + width = 0; + if(char_extra || dc->breakExtra || lpDx) + { + UINT i; + SIZE tmpsz; + deltas = HeapAlloc(GetProcessHeap(), 0, count * sizeof(INT)); + for(i = 0; i < count; i++) + { + if(lpDx) + deltas[i] = lpDx[i] + char_extra; + else + { + if(flags & ETO_GLYPH_INDEX) + GetTextExtentPointI(hdc, glyphs + i, 1, &tmpsz); + else + GetTextExtentPointW(hdc, reordered_str + i, 1, &tmpsz); + + deltas[i] = tmpsz.cx; + } + + if (dc->breakExtra && reordered_str[i] == tm.tmBreakChar) { - /* The caller did not specify that language processing was already done. - */ - LPWSTR lpReorderedString=HeapAlloc(GetProcessHeap(), 0, count*sizeof(WCHAR)); - - BIDI_Reorder( str, count, GCP_REORDER, - ((flags&ETO_RTLREADING)!=0 || (GetTextAlign(hdc)&TA_RTLREADING)!=0)? - WINE_GCPW_FORCE_RTL:WINE_GCPW_FORCE_LTR, - lpReorderedString, count, NULL ); - - ret = dc->funcs->pExtTextOut(dc->physDev,x,y,flags|ETO_IGNORELANGUAGE, - lprect,lpReorderedString,count,lpDx,dc->breakExtra); - HeapFree(GetProcessHeap(), 0, lpReorderedString); - } else - ret = dc->funcs->pExtTextOut(dc->physDev,x,y,flags,lprect,str,count, - lpDx,dc->breakExtra); + deltas[i] = deltas[i] + dc->breakExtra; + } + deltas[i] = INTERNAL_XWSTODS(dc, deltas[i]); + width += deltas[i]; + } + } + else + { + if(!done_extents) + { + if(flags & ETO_GLYPH_INDEX) + GetTextExtentPointI(hdc, glyphs, count, &sz); + else + GetTextExtentPointW(hdc, reordered_str, count, &sz); + done_extents = TRUE; + } + width = INTERNAL_XWSTODS(dc, sz.cx); + } + xwidth = width * cosEsc; + ywidth = width * sinEsc; + + tm.tmAscent = abs(INTERNAL_YWSTODS(dc, tm.tmAscent)); + tm.tmDescent = abs(INTERNAL_YWSTODS(dc, tm.tmDescent)); + switch( align & (TA_LEFT | TA_RIGHT | TA_CENTER) ) + { + case TA_LEFT: + if (align & TA_UPDATECP) + { + pt.x = x + xwidth; + pt.y = y - ywidth; + DPtoLP(hdc, &pt, 1); + MoveToEx(hdc, pt.x, pt.y, NULL); + } + break; + + case TA_CENTER: + x -= xwidth / 2; + y += ywidth / 2; + break; + + case TA_RIGHT: + x -= xwidth; + y += ywidth; + if (align & TA_UPDATECP) + { + pt.x = x; + pt.y = y; + DPtoLP(hdc, &pt, 1); + MoveToEx(hdc, pt.x, pt.y, NULL); + } + break; + } + + switch( align & (TA_TOP | TA_BOTTOM | TA_BASELINE) ) + { + case TA_TOP: + y += tm.tmAscent * cosEsc; + x += tm.tmAscent * sinEsc; + break; + + case TA_BOTTOM: + y -= tm.tmDescent * cosEsc; + x -= tm.tmDescent * sinEsc; + break; + + case TA_BASELINE: + break; + } + + if(GetBkMode(hdc) != TRANSPARENT) + { + if(!((flags & ETO_CLIPPED) && (flags & ETO_OPAQUE))) + { + if(!(flags & ETO_OPAQUE) || x < rc.left || x + width >= rc.right || + y - tm.tmAscent < rc.top || y + tm.tmDescent >= rc.bottom) + { + RECT rc; + rc.left = x; + rc.right = x + width; + rc.top = y - tm.tmAscent; + rc.bottom = y + tm.tmDescent; + dc->funcs->pExtTextOut(dc->physDev, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL); + } } - GDI_ReleaseObj( hdc ); } + + ret = dc->funcs->pExtTextOut(dc->physDev, x, y, (flags & ~ETO_OPAQUE), &rc, + (flags & ETO_GLYPH_INDEX) ? glyphs: reordered_str, count, deltas); + + if (lf.lfUnderline || lf.lfStrikeOut) + { + int underlinePos, strikeoutPos; + int underlineWidth, strikeoutWidth; + UINT nMetricsSize = GetOutlineTextMetricsW(hdc, 0, NULL); + OUTLINETEXTMETRICW* otm = NULL; + + if(!nMetricsSize) + { + TEXTMETRICW tm; + GetTextMetricsW(hdc, &tm); + underlinePos = 0; + underlineWidth = tm.tmAscent / 20 + 1; + strikeoutPos = tm.tmAscent / 2; + strikeoutWidth = underlineWidth; + } + else + { + otm = HeapAlloc(GetProcessHeap(), 0, nMetricsSize); + if (!otm) goto done; + + GetOutlineTextMetricsW(hdc, nMetricsSize, otm); + underlinePos = otm->otmsUnderscorePosition; + underlineWidth = otm->otmsUnderscoreSize; + strikeoutPos = otm->otmsStrikeoutPosition; + strikeoutWidth = otm->otmsStrikeoutSize; + } + + if(lf.lfUnderline) + { + 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)); + } + + if(lf.lfStrikeOut) + { + 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)); + } + } + +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; } @@ -2557,3 +2860,9 @@ if (height) *height = sz.cy; return (sz.cx / 26 + 1) / 2; } + +BOOL WINAPI EnableEUDC(BOOL fEnableEUDC) +{ + FIXME("(%d): stub\n", fEnableEUDC); + return FALSE; +} diff -urN wine-20050725/dlls/gdi/freetype.c wine-20050830/dlls/gdi/freetype.c --- wine-20050725/dlls/gdi/freetype.c 2005-07-05 13:02:37.000000000 +0200 +++ wine-20050830/dlls/gdi/freetype.c 2005-08-19 11:58:32.000000000 +0200 @@ -418,7 +418,8 @@ #ifdef HAVE_FREETYPE_FTWINFNT_H FT_WinFNT_HeaderRec winfnt_header; #endif - int i, bitmap_num; + int i, bitmap_num, internal_leading; + FONTSIGNATURE fs; do { char *family_name = fake_family; @@ -489,12 +490,43 @@ StyleW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, ft_face->style_name, -1, StyleW, len); + internal_leading = 0; + memset(&fs, 0, sizeof(fs)); + + pOS2 = pFT_Get_Sfnt_Table(ft_face, ft_sfnt_os2); + if(pOS2) { + fs.fsCsb[0] = pOS2->ulCodePageRange1; + fs.fsCsb[1] = pOS2->ulCodePageRange2; + fs.fsUsb[0] = pOS2->ulUnicodeRange1; + fs.fsUsb[1] = pOS2->ulUnicodeRange2; + fs.fsUsb[2] = pOS2->ulUnicodeRange3; + fs.fsUsb[3] = pOS2->ulUnicodeRange4; + if(pOS2->version == 0) { + FT_UInt dummy; + + if(!pFT_Get_First_Char || (pFT_Get_First_Char( ft_face, &dummy ) < 0x100)) + fs.fsCsb[0] |= 1; + else + fs.fsCsb[0] |= 1L << 31; + } + } +#ifdef HAVE_FREETYPE_FTWINFNT_H + else if(pFT_Get_WinFNT_Header && !pFT_Get_WinFNT_Header(ft_face, &winfnt_header)) { + CHARSETINFO csi; + TRACE("pix_h %d charset %d dpi %dx%d pt %d\n", winfnt_header.pixel_height, winfnt_header.charset, + winfnt_header.vertical_resolution,winfnt_header.horizontal_resolution, winfnt_header.nominal_point_size); + if(TranslateCharsetInfo((DWORD*)(UINT)winfnt_header.charset, &csi, TCI_SRCCHARSET)) + memcpy(&fs, &csi.fs, sizeof(csi.fs)); + internal_leading = winfnt_header.internal_leading; + } +#endif + face_elem_ptr = list_head(&family->faces); while(face_elem_ptr) { face = LIST_ENTRY(face_elem_ptr, Face, entry); face_elem_ptr = list_next(&family->faces, face_elem_ptr); if(!strcmpW(face->StyleName, StyleW) && - (FT_IS_SCALABLE(ft_face) || (size->y_ppem == face->size.y_ppem))) { + (FT_IS_SCALABLE(ft_face) || ((size->y_ppem == face->size.y_ppem) && !memcmp(&fs, &face->fs, sizeof(fs)) ))) { TRACE("Already loaded font %s %s original version is %lx, this version is %lx\n", debugstr_w(family->FamilyName), debugstr_w(StyleW), face->font_version, pHeader ? pHeader->Font_Revision : 0); @@ -531,6 +563,7 @@ face->font_version = pHeader ? pHeader->Font_Revision : 0; face->family = family; face->external = (flags & ADDFONT_EXTERNAL_FONT) ? TRUE : FALSE; + memcpy(&face->fs, &fs, sizeof(face->fs)); if(FT_IS_SCALABLE(ft_face)) { memset(&face->size, 0, sizeof(face->size)); @@ -544,39 +577,10 @@ face->size.size = size->size; face->size.x_ppem = size->x_ppem; face->size.y_ppem = size->y_ppem; - face->size.internal_leading = 0; + face->size.internal_leading = internal_leading; face->scalable = FALSE; } - memset(&face->fs, 0, sizeof(face->fs)); - - pOS2 = pFT_Get_Sfnt_Table(ft_face, ft_sfnt_os2); - if(pOS2) { - face->fs.fsCsb[0] = pOS2->ulCodePageRange1; - face->fs.fsCsb[1] = pOS2->ulCodePageRange2; - face->fs.fsUsb[0] = pOS2->ulUnicodeRange1; - face->fs.fsUsb[1] = pOS2->ulUnicodeRange2; - face->fs.fsUsb[2] = pOS2->ulUnicodeRange3; - face->fs.fsUsb[3] = pOS2->ulUnicodeRange4; - if(pOS2->version == 0) { - FT_UInt dummy; - - if(!pFT_Get_First_Char || (pFT_Get_First_Char( ft_face, &dummy ) < 0x100)) - face->fs.fsCsb[0] |= 1; - else - face->fs.fsCsb[0] |= 1L << 31; - } - } -#ifdef HAVE_FREETYPE_FTWINFNT_H - else if(pFT_Get_WinFNT_Header && !pFT_Get_WinFNT_Header(ft_face, &winfnt_header)) { - CHARSETINFO csi; - TRACE("pix_h %d charset %d dpi %dx%d pt %d\n", winfnt_header.pixel_height, winfnt_header.charset, - winfnt_header.vertical_resolution,winfnt_header.horizontal_resolution, winfnt_header.nominal_point_size); - if(TranslateCharsetInfo((DWORD*)(UINT)winfnt_header.charset, &csi, TCI_SRCCHARSET)) - memcpy(&face->fs, &csi.fs, sizeof(csi.fs)); - face->size.internal_leading = winfnt_header.internal_leading; - } -#endif TRACE("fsCsb = %08lx %08lx/%08lx %08lx %08lx %08lx\n", face->fs.fsCsb[0], face->fs.fsCsb[1], face->fs.fsUsb[0], face->fs.fsUsb[1], @@ -622,7 +626,7 @@ TRACE("Family: %s\n", debugstr_w(family->FamilyName)); LIST_FOR_EACH(face_elem_ptr, &family->faces) { face = LIST_ENTRY(face_elem_ptr, Face, entry); - TRACE("\t%s", debugstr_w(face->StyleName)); + TRACE("\t%s\t%08lx", debugstr_w(face->StyleName), face->fs.fsCsb[0]); if(!face->scalable) TRACE(" %ld", face->size.y_ppem >> 6); TRACE("\n"); @@ -848,7 +852,7 @@ FcFontSet *fontset; FcValue v; int i, len; - const char *ext; + const char *file, *ext; fc_handle = wine_dlopen(SONAME_LIBFONTCONFIG, RTLD_NOW, NULL, 0); if(!fc_handle) { @@ -881,16 +885,17 @@ if(pFcPatternGet(fontset->fonts[i], FC_FILE, 0, &v) != FcResultMatch) continue; if(v.type != FcTypeString) continue; - TRACE("fontconfig: %s\n", v.u.s); + file = (LPCSTR) v.u.s; + TRACE("fontconfig: %s\n", file); /* We're just interested in OT/TT fonts for now, so this hack just picks up the standard extensions to save time loading every other font */ - len = strlen(v.u.s); + len = strlen( file ); if(len < 4) continue; - ext = v.u.s + len - 3; + ext = &file[ len - 3 ]; if(!strcasecmp(ext, "ttf") || !strcasecmp(ext, "ttc") || !strcasecmp(ext, "otf")) - AddFontFileToList(v.u.s, NULL, ADDFONT_EXTERNAL_FONT); + AddFontFileToList(file, NULL, ADDFONT_EXTERNAL_FONT); } pFcFontSetDestroy(fontset); pFcObjectSetDestroy(os); @@ -1720,84 +1725,78 @@ LIST_FOR_EACH(family_elem_ptr, &font_list) { family = LIST_ENTRY(family_elem_ptr, Family, entry); if(!strcmpiW(family->FamilyName, lf.lfFaceName)) { - face_elem_ptr = list_head(&family->faces); - face = LIST_ENTRY(face_elem_ptr, Face, entry); - if((csi.fs.fsCsb[0] & face->fs.fsCsb[0]) || !csi.fs.fsCsb[0]) - if(face->scalable || can_use_bitmap) - break; + 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(face->scalable || can_use_bitmap) + goto found; + } } - family = NULL; } } - if(!family) { - /* If requested charset was DEFAULT_CHARSET then try using charset - corresponding to the current ansi codepage */ - if(!csi.fs.fsCsb[0]) { - INT acp = GetACP(); - if(!TranslateCharsetInfo((DWORD*)acp, &csi, TCI_SRCCODEPAGE)) { - FIXME("TCI failed on codepage %d\n", acp); - csi.fs.fsCsb[0] = 0; - } else - lf.lfCharSet = csi.ciCharset; - } - - /* Face families are in the top 4 bits of lfPitchAndFamily, - so mask with 0xF0 before testing */ - - if((lf.lfPitchAndFamily & FIXED_PITCH) || - (lf.lfPitchAndFamily & 0xF0) == FF_MODERN) - strcpyW(lf.lfFaceName, defFixed); - else if((lf.lfPitchAndFamily & 0xF0) == FF_ROMAN) - strcpyW(lf.lfFaceName, defSerif); - else if((lf.lfPitchAndFamily & 0xF0) == FF_SWISS) - strcpyW(lf.lfFaceName, defSans); - else - strcpyW(lf.lfFaceName, defSans); - LIST_FOR_EACH(family_elem_ptr, &font_list) { - family = LIST_ENTRY(family_elem_ptr, Family, entry); - if(!strcmpiW(family->FamilyName, lf.lfFaceName)) { - face_elem_ptr = list_head(&family->faces); + /* If requested charset was DEFAULT_CHARSET then try using charset + corresponding to the current ansi codepage */ + if(!csi.fs.fsCsb[0]) { + INT acp = GetACP(); + if(!TranslateCharsetInfo((DWORD*)acp, &csi, TCI_SRCCODEPAGE)) { + FIXME("TCI failed on codepage %d\n", acp); + csi.fs.fsCsb[0] = 0; + } else + lf.lfCharSet = csi.ciCharset; + } + + /* Face families are in the top 4 bits of lfPitchAndFamily, + so mask with 0xF0 before testing */ + + if((lf.lfPitchAndFamily & FIXED_PITCH) || + (lf.lfPitchAndFamily & 0xF0) == FF_MODERN) + strcpyW(lf.lfFaceName, defFixed); + else if((lf.lfPitchAndFamily & 0xF0) == FF_ROMAN) + strcpyW(lf.lfFaceName, defSerif); + else if((lf.lfPitchAndFamily & 0xF0) == FF_SWISS) + strcpyW(lf.lfFaceName, defSans); + else + strcpyW(lf.lfFaceName, defSans); + LIST_FOR_EACH(family_elem_ptr, &font_list) { + family = LIST_ENTRY(family_elem_ptr, Family, entry); + 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(face->scalable || can_use_bitmap) - break; + goto found; } - family = NULL; - } + } } - if(!family) { - LIST_FOR_EACH(family_elem_ptr, &font_list) { - family = LIST_ENTRY(family_elem_ptr, Family, entry); - face_elem_ptr = list_head(&family->faces); + LIST_FOR_EACH(family_elem_ptr, &font_list) { + 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]) if(face->scalable || can_use_bitmap) - break; - family = NULL; - } + goto found; + } } - if(!family) { - LIST_FOR_EACH(family_elem_ptr, &font_list) { - family = LIST_ENTRY(family_elem_ptr, Family, entry); - face_elem_ptr = list_head(&family->faces); + + LIST_FOR_EACH(family_elem_ptr, &font_list) { + 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(face->scalable || can_use_bitmap) { csi.fs.fsCsb[0] = 0; FIXME("just using first face for now\n"); - break; + goto found; } - family = NULL; - } - if(!family) { - FIXME("can't find a single appropriate font - bailing\n"); - free_font(ret); - return NULL; } } + FIXME("can't find a single appropriate font - bailing\n"); + free_font(ret); + return NULL; +found: it = lf.lfItalic ? 1 : 0; bd = lf.lfWeight > 550 ? 1 : 0; @@ -1807,7 +1806,8 @@ face = best = NULL; LIST_FOR_EACH(face_elem_ptr, &family->faces) { face = LIST_ENTRY(face_elem_ptr, Face, entry); - if(!(face->Italic ^ it) && !(face->Bold ^ bd)) { + if(!(face->Italic ^ it) && !(face->Bold ^ bd) && + ((csi.fs.fsCsb[0] & face->fs.fsCsb[0]) || !csi.fs.fsCsb[0])) { if(face->scalable) break; if(height > 0) @@ -1831,19 +1831,21 @@ best = NULL; LIST_FOR_EACH(face_elem_ptr, &family->faces) { face = LIST_ENTRY(face_elem_ptr, Face, entry); - if(face->scalable) - break; - if(height > 0) - newdiff = height - (signed int)(face->size.y_ppem >> 6); - else - newdiff = -height - ((signed int)(face->size.y_ppem >> 6) - face->size.internal_leading); - if(!best || (diff > 0 && newdiff < diff && newdiff >= 0) || - (diff < 0 && newdiff > diff)) { - TRACE("%ld is better for %d diff was %d\n", face->size.y_ppem >> 6, height, diff); - diff = newdiff; - best = face; - if(diff == 0) + if((csi.fs.fsCsb[0] & face->fs.fsCsb[0]) || !csi.fs.fsCsb[0]) { + if(face->scalable) break; + if(height > 0) + newdiff = height - (signed int)(face->size.y_ppem >> 6); + else + newdiff = -height - ((signed int)(face->size.y_ppem >> 6) - face->size.internal_leading); + if(!best || (diff > 0 && newdiff < diff && newdiff >= 0) || + (diff < 0 && newdiff > diff)) { + TRACE("%ld is better for %d diff was %d\n", face->size.y_ppem >> 6, height, diff); + diff = newdiff; + best = face; + if(diff == 0) + break; + } } face = NULL; } @@ -1862,8 +1864,8 @@ else ret->charset = get_nearest_charset(face, &ret->codepage); - TRACE("Chosen: %s %s\n", debugstr_w(family->FamilyName), - debugstr_w(face->StyleName)); + TRACE("Chosen: %s %s (%s:%ld)\n", debugstr_w(family->FamilyName), + debugstr_w(face->StyleName), face->file, face->face_index); if(!face->scalable) { width = face->size.x_ppem >> 6; @@ -2211,7 +2213,7 @@ WCHAR wc = (WCHAR)glyph; char buf; WideCharToMultiByte(font->codepage, 0, &wc, 1, &buf, sizeof(buf), 0, 0); - return pFT_Get_Char_Index(font->ft_face, buf); + return pFT_Get_Char_Index(font->ft_face, (unsigned char)buf); } if(font->charset == SYMBOL_CHARSET && glyph < 0x100) diff -urN wine-20050725/dlls/gdi/gdi32.spec wine-20050830/dlls/gdi/gdi32.spec --- wine-20050725/dlls/gdi/gdi32.spec 2005-07-18 20:05:04.000000000 +0200 +++ wine-20050830/dlls/gdi/gdi32.spec 2005-08-15 11:45:40.000000000 +0200 @@ -7,6 +7,7 @@ @ stdcall AbortDoc(long) @ stdcall AbortPath(long) +# @ stub AddFontMemResourceEx @ stdcall AddFontResourceA(str) @ stdcall AddFontResourceExA(str long ptr) @ stdcall AddFontResourceExW(wstr long ptr) @@ -14,6 +15,7 @@ @ stdcall AddFontResourceW(wstr) @ stdcall AngleArc(long long long long long long) @ stdcall AnimatePalette(long long long ptr) +# @ stub AnyLinkedFonts @ stdcall Arc(long long long long long long long long long) @ stdcall ArcTo(long long long long long long long long long) @ stdcall BeginPath(long) @@ -23,6 +25,8 @@ @ stub CheckColorsInGamut @ stdcall ChoosePixelFormat(long ptr) @ stdcall Chord(long long long long long long long long long) +# @ stub ClearBitmapAttributes +# @ stub ClearBrushAttributes @ stdcall CloseEnhMetaFile(long) @ stdcall CloseFigure(long) @ stdcall CloseMetaFile(long) @@ -54,6 +58,8 @@ @ stdcall CreateEnhMetaFileW(long wstr ptr wstr) @ stdcall CreateFontA(long long long long long long long long long long long long long str) @ stdcall CreateFontIndirectA(ptr) +# @ stub CreateFontIndirectExA +# @ stub CreateFontIndirectExW @ stdcall CreateFontIndirectW(ptr) @ stdcall CreateFontW(long long long long long long long long long long long long long wstr) @ stdcall CreateHalftonePalette(long) @@ -86,8 +92,9 @@ @ stub DeviceCapabilitiesExW @ stdcall DrawEscape(long long long ptr) @ stdcall Ellipse(long long long long long) -@ stub EnableEUDC +@ stdcall EnableEUDC(long) @ stdcall EndDoc(long) +# @ stub EndFormPage @ stdcall EndPage(long) @ stdcall EndPath(long) @ stdcall EnumEnhMetaFile(long long ptr ptr ptr) @@ -103,6 +110,8 @@ @ stdcall EnumObjects(long long ptr long) @ stdcall EqualRgn(long long) @ stdcall Escape(long long long ptr ptr) +# @ stub EudcLoadLinkW +# @ stub EudcUnloadLinkW @ stdcall ExcludeClipRect(long long long long long) @ stdcall ExtCreatePen(long long ptr long ptr) @ stdcall ExtCreateRegion(ptr long ptr) @@ -116,14 +125,21 @@ @ stdcall FixBrushOrgEx(long long long ptr) @ stdcall FlattenPath(long) @ stdcall FloodFill(long long long long) +# @ stub FontIsLinked @ stdcall FrameRgn(long long long long long) @ stub FreeImageColorMatcher +# @ stub GdiAddFontResourceW +# @ stub GdiAddGlsBounds +# @ stub GdiAddGlsRecord @ stdcall GdiAlphaBlend(long long long long long long long long long long long) +# @ stub GdiArtificialDecrementDriver @ stub GdiAssociateObject @ stub GdiCleanCacheDC @ stdcall GdiComment(long long ptr) +# @ stub GdiConsoleTextOut @ stub GdiConvertAndCheckDC @ stub GdiConvertBitmap +# @ stub GdiConvertBitmapV5 @ stub GdiConvertBrush @ stub GdiConvertDC @ stub GdiConvertEnhMetaFile @@ -152,47 +168,84 @@ @ stub GdiDciSetDestination @ stub GdiDeleteLocalDC @ stub GdiDeleteLocalObject +# @ stub GdiDeleteSpoolFileHandle +# @ stub GdiDescribePixelFormat @ stub GdiDllInitialize +# @ stub GdiDrawStream +# @ stub GdiEndDocEMF +# @ stub GdiEndPageEMF +# @ stub GdiFixUpHandle @ stdcall GdiFlush() +# @ stub GdiFullscreenControl @ stdcall GdiGetBatchLimit() @ stdcall GdiGetCharDimensions(ptr ptr ptr) +# @ stub GdiGetCodePage +# @ stub GdiGetDC +# @ stub GdiGetDevmodeForPage @ stub GdiGetLocalBitmap @ stub GdiGetLocalBrush @ stub GdiGetLocalDC @ stub GdiGetLocalFont +# @ stub GdiGetPageCount +# @ stub GdiGetPageHandle +# @ stub GdiGetSpoolFileHandle +# @ stub GdiGetSpoolMessage @ stdcall GdiGradientFill(long ptr long ptr long long) +# @ stub GdiInitSpool +# @ stub GdiInitializeLanguagePack @ stdcall GdiIsMetaFileDC(long) @ stdcall GdiIsMetaPrintDC(long) @ stdcall GdiIsPlayMetafileDC(long) @ stub GdiPlayDCScript +# @ stub GdiPlayEMF @ stub GdiPlayJournal +# @ stub GdiPlayPageEMF +# @ stub GdiPlayPrivatePageEMF @ stub GdiPlayScript +# @ stub GdiPrinterThunk +# @ stub GdiProcessSetup +# @ stub GdiQueryFonts +# @ stub GdiQueryTable +# @ stub GdiRealizationInfo +# @ stub GdiReleaseDC @ stub GdiReleaseLocalDC +# @ stub GdiResetDCEMF @ stub GdiSetAttrs @ stdcall GdiSetBatchLimit(long) +# @ stub GdiSetLastError +# @ stub GdiSetPixelFormat @ stub GdiSetServerAttr +# @ stub GdiStartDocEMF +# @ stub GdiStartPageEMF +# @ stub GdiSwapBuffers @ stdcall GdiTransparentBlt(long long long long long long long long long long long) +# @ stub GdiValidateHandle @ stub GdiWinWatchClose @ stub GdiWinWatchDidStatusChange @ stub GdiWinWatchGetClipList @ stub GdiWinWatchOpen @ stdcall GetArcDirection(long) @ stdcall GetAspectRatioFilterEx(long ptr) +# @ stub GetBitmapAttributes @ stdcall GetBitmapBits(long long ptr) @ stdcall GetBitmapDimensionEx(long ptr) @ stdcall GetBkColor(long) @ stdcall GetBkMode(long) @ stdcall GetBoundsRect(long ptr long) +# @ stub GetBrushAttributes @ stdcall GetBrushOrgEx(long ptr) @ stdcall GetCharABCWidthsA(long long long ptr) @ stdcall GetCharABCWidthsFloatA(long long long ptr) @ stdcall GetCharABCWidthsFloatW(long long long ptr) +# @ stub GetCharABCWidthsI @ stdcall GetCharABCWidthsW(long long long ptr) @ stdcall GetCharWidth32A(long long long long) @ stdcall GetCharWidth32W(long long long long) @ stdcall GetCharWidthA(long long long long) GetCharWidth32A @ stdcall GetCharWidthFloatA(long long long ptr) @ stdcall GetCharWidthFloatW(long long long ptr) +# @ stub GetCharWidthI +# @ stub GetCharWidthInfo @ stdcall GetCharWidthW(long long long long) GetCharWidth32W @ stub GetCharWidthWOW @ stdcall GetCharacterPlacementA(long str long long ptr long) @@ -211,17 +264,22 @@ @ stdcall GetDeviceCaps(long long) @ stdcall GetDeviceGammaRamp(long ptr) @ stub GetETM +# @ stub GetEUDCTimeStamp +# @ stub GetEUDCTimeStampExW @ stdcall GetEnhMetaFileA(str) @ stdcall GetEnhMetaFileBits(long long ptr) @ stdcall GetEnhMetaFileDescriptionA(long long ptr) @ stdcall GetEnhMetaFileDescriptionW(long long ptr) @ stdcall GetEnhMetaFileHeader(long long ptr) @ stdcall GetEnhMetaFilePaletteEntries (long long ptr) +# @ stub GetEnhMetaFilePixelFormat @ stdcall GetEnhMetaFileW(wstr) +# @ stub GetFontAssocStatus @ stdcall GetFontData(long long long ptr long) @ stdcall GetFontLanguageInfo(long) @ stub GetFontResourceInfo @ stub GetFontResourceInfoW +# @ stub GetFontUnicodeRanges @ stdcall GetGlyphIndicesA(long ptr long ptr long) @ stdcall GetGlyphIndicesW(long ptr long ptr long) @ stub GetGlyphOutline @@ -229,6 +287,7 @@ @ stdcall GetGlyphOutlineW(long long long ptr long ptr ptr) @ stub GetGlyphOutlineWow @ stdcall GetGraphicsMode(long) +# @ stub GetHFONT @ stdcall GetICMProfileA(long ptr str) @ stdcall GetICMProfileW(long ptr wstr) @ stdcall GetKerningPairs(long long ptr) GetKerningPairsA @@ -263,6 +322,8 @@ @ stdcall GetRgnBox(long ptr) @ stdcall GetStockObject(long) @ stdcall GetStretchBltMode(long) +# @ stub GetStringBitmapA +# @ stub GetStringBitmapW @ stdcall GetSystemPaletteEntries(long long long ptr) @ stdcall GetSystemPaletteUse(long) @ stdcall GetTextAlign(long) @@ -271,13 +332,16 @@ @ stdcall GetTextCharsetInfo(long ptr long) @ stdcall GetTextColor(long) @ stdcall GetTextExtentExPointA(long str long long ptr ptr ptr) +# @ stub GetTextExtentExPointI @ stdcall GetTextExtentExPointW(long wstr long long ptr ptr ptr) +# @ stub GetTextExtentExPointWPri @ stdcall GetTextExtentPoint32A(long str long ptr) @ stdcall GetTextExtentPoint32W(long wstr long ptr) @ stdcall GetTextExtentPointA(long str long ptr) @ stdcall GetTextExtentPointI(long ptr long ptr) @ stdcall GetTextExtentPointW(long wstr long ptr) @ stdcall GetTextFaceA(long long ptr) +# @ stub GetTextFaceAliasW @ stdcall GetTextFaceW(long long ptr) @ stdcall GetTextMetricsA(long ptr) @ stdcall GetTextMetricsW(long ptr) @@ -290,14 +354,18 @@ @ stdcall GetWorldTransform(long ptr) @ stdcall IntersectClipRect(long long long long long) @ stdcall InvertRgn(long long) +# @ stub IsValidEnhMetaRecord +# @ stub IsValidEnhMetaRecordOffExt @ stdcall LPtoDP(long ptr long) @ stdcall LineDDA(long long long long ptr long) @ stdcall LineTo(long long long) @ stub LoadImageColorMatcherA @ stub LoadImageColorMatcherW @ stdcall MaskBlt(long long long long long long long long long long long long) +# @ stub MirrorRgn @ stdcall ModifyWorldTransform(long ptr long) @ stdcall MoveToEx(long long long ptr) +# @ stub NamedEscape @ stdcall OffsetClipRgn(long long long) @ stdcall OffsetRgn(long long long) @ stdcall OffsetViewportOrgEx(long long long ptr) @@ -314,6 +382,7 @@ @ stdcall PolyBezier(long ptr long) @ stdcall PolyBezierTo(long ptr long) @ stdcall PolyDraw(long ptr ptr long) +# @ stub PolyPatBlt @ stdcall PolyPolygon(long ptr ptr long) @ stdcall PolyPolyline(long ptr ptr long) @ stdcall PolyTextOutA(long ptr long) @@ -323,10 +392,12 @@ @ stdcall PolylineTo(long ptr long) @ stdcall PtInRegion(long long long) @ stdcall PtVisible(long long long) +# @ stub QueryFontAssocStatus @ stdcall RealizePalette(long) @ stdcall RectInRegion(long ptr) @ stdcall RectVisible(long ptr) @ stdcall Rectangle(long long long long long) +# @ stub RemoveFontMemResourceEx @ stdcall RemoveFontResourceA(str) @ stdcall RemoveFontResourceExA(str long ptr) @ stdcall RemoveFontResourceExW(wstr long ptr) @@ -348,11 +419,13 @@ @ stdcall SelectPalette(long long long) @ stdcall SetAbortProc(long ptr) @ stdcall SetArcDirection(long long) +# @ stub SetBitmapAttributes @ stdcall SetBitmapBits(long long ptr) @ stdcall SetBitmapDimensionEx(long long long ptr) @ stdcall SetBkColor(long long) @ stdcall SetBkMode(long long) @ stdcall SetBoundsRect(long ptr long) +# @ stub SetBrushAttributes @ stdcall SetBrushOrgEx(long long long ptr) @ stdcall SetColorAdjustment(long ptr) @ stdcall SetColorSpace(long long) @@ -369,6 +442,7 @@ @ stdcall SetICMProfileA(long str) @ stdcall SetICMProfileW(long wstr) @ stdcall SetLayout(long long) +# @ stub SetLayoutWidth @ stub SetMagicColors @ stdcall SetMapMode(long long) @ stdcall SetMapperFlags(long long) @@ -399,6 +473,7 @@ @ stdcall SetWorldTransform(long ptr) @ stdcall StartDocA(long ptr) @ stdcall StartDocW(long ptr) +# @ stub StartFormPage @ stdcall StartPage(long) @ stdcall StretchBlt(long long long long long long long long long long long) @ stdcall StretchDIBits(long long long long long long long long long ptr ptr long long) diff -urN wine-20050725/dlls/gdi/gdi_private.h wine-20050830/dlls/gdi/gdi_private.h --- wine-20050725/dlls/gdi/gdi_private.h 2005-04-13 18:11:18.000000000 +0200 +++ wine-20050830/dlls/gdi/gdi_private.h 2005-08-23 11:38:59.000000000 +0200 @@ -82,7 +82,7 @@ INT (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID); BOOL (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT); INT (*pExtSelectClipRgn)(PHYSDEV,HRGN,INT); - BOOL (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*,INT); + BOOL (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*); BOOL (*pFillPath)(PHYSDEV); BOOL (*pFillRgn)(PHYSDEV,HRGN,HBRUSH); BOOL (*pFlattenPath)(PHYSDEV); diff -urN wine-20050725/dlls/gdi/metafile.c wine-20050830/dlls/gdi/metafile.c --- wine-20050725/dlls/gdi/metafile.c 2005-04-11 14:50:01.000000000 +0200 +++ wine-20050830/dlls/gdi/metafile.c 2005-08-10 12:59:20.000000000 +0200 @@ -666,7 +666,7 @@ hHT = GlobalAlloc16(GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof(HANDLETABLE16) * mh->mtNoObjects); - spht = K32WOWGlobalLock16(hHT); + spht = WOWGlobalLock16(hHT); seg = hmf | 7; offset = mh->mtHeaderSize * 2; diff -urN wine-20050725/dlls/gdi/mfdrv/metafiledrv.h wine-20050830/dlls/gdi/mfdrv/metafiledrv.h --- wine-20050725/dlls/gdi/mfdrv/metafiledrv.h 2004-03-04 21:41:13.000000000 +0100 +++ wine-20050830/dlls/gdi/mfdrv/metafiledrv.h 2005-08-23 11:38:59.000000000 +0200 @@ -84,7 +84,7 @@ extern INT MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ); extern BOOL MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, - UINT count, const INT *lpDx, INT breakExtra ); + UINT count, const INT *lpDx ); extern BOOL MFDRV_FillPath( PHYSDEV dev ); extern BOOL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ); extern BOOL MFDRV_FlattenPath( PHYSDEV dev ); diff -urN wine-20050725/dlls/gdi/mfdrv/text.c wine-20050830/dlls/gdi/mfdrv/text.c --- wine-20050725/dlls/gdi/mfdrv/text.c 2004-12-23 19:41:05.000000000 +0100 +++ wine-20050830/dlls/gdi/mfdrv/text.c 2005-08-23 11:38:59.000000000 +0200 @@ -74,7 +74,7 @@ BOOL MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, UINT count, - const INT *lpDx, INT breakExtra ) + const INT *lpDx ) { RECT16 rect16; LPINT16 lpdx16 = NULL; diff -urN wine-20050725/dlls/gdi/path.c wine-20050830/dlls/gdi/path.c --- wine-20050725/dlls/gdi/path.c 2005-05-16 11:13:28.000000000 +0200 +++ wine-20050830/dlls/gdi/path.c 2005-08-22 12:19:34.000000000 +0200 @@ -123,7 +123,7 @@ /* Performs a world-to-viewport transformation on the specified width. */ -static inline void INTERNAL_WSTODS(DC *dc, LONG *width) +static inline void INTERNAL_WSTODS(DC *dc, DWORD *width) { POINT pt[2]; pt[0].x = pt[0].y = 0; @@ -1478,7 +1478,7 @@ LOGPEN lp; GetObjectW(hOldPen, sizeof(LOGPEN), &lp); if(lp.lopnWidth.x > 0) - INTERNAL_WSTODS(dc, &lp.lopnWidth.x); + INTERNAL_WSTODS(dc, (DWORD*)&lp.lopnWidth.x); hNewPen = CreatePenIndirect(&lp); } SelectObject(dc->hSelf, hNewPen); diff -urN wine-20050725/dlls/gdi/tests/.cvsignore wine-20050830/dlls/gdi/tests/.cvsignore --- wine-20050725/dlls/gdi/tests/.cvsignore 2004-11-24 19:09:20.000000000 +0100 +++ wine-20050830/dlls/gdi/tests/.cvsignore 2005-08-22 11:18:02.000000000 +0200 @@ -4,4 +4,5 @@ gdiobj.ok generated.ok metafile.ok +palette.ok testlist.c diff -urN wine-20050725/dlls/gdi/tests/Makefile.in wine-20050830/dlls/gdi/tests/Makefile.in --- wine-20050725/dlls/gdi/tests/Makefile.in 2004-11-24 19:09:20.000000000 +0100 +++ wine-20050830/dlls/gdi/tests/Makefile.in 2005-08-27 11:27:10.000000000 +0200 @@ -3,14 +3,15 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ TESTDLL = gdi32.dll -IMPORTS = user32 gdi32 +IMPORTS = user32 gdi32 kernel32 CTESTS = \ bitmap.c \ brush.c \ gdiobj.c \ generated.c \ - metafile.c + metafile.c \ + palette.c @MAKE_TEST_RULES@ diff -urN wine-20050725/dlls/gdi/tests/gdiobj.c wine-20050830/dlls/gdi/tests/gdiobj.c --- wine-20050725/dlls/gdi/tests/gdiobj.c 2005-07-18 20:08:30.000000000 +0200 +++ wine-20050830/dlls/gdi/tests/gdiobj.c 2005-08-08 13:07:25.000000000 +0200 @@ -325,6 +325,77 @@ ReleaseDC(NULL, hdc); } +struct hgdiobj_event +{ + HDC hdc; + HGDIOBJ hgdiobj; + HANDLE stop_event; + HANDLE ready_event; +}; + +static DWORD WINAPI thread_proc(void *param) +{ + LOGPEN lp; + struct hgdiobj_event *hgdiobj_event = (struct hgdiobj_event *)param; + + hgdiobj_event->hdc = CreateDC("display", NULL, NULL, NULL); + ok(hgdiobj_event->hdc != NULL, "CreateDC error %ld\n", GetLastError()); + + hgdiobj_event->hgdiobj = CreatePen(PS_DASHDOTDOT, 17, RGB(1, 2, 3)); + ok(hgdiobj_event->hgdiobj != 0, "Failed to create pen\n"); + + SetEvent(hgdiobj_event->ready_event); + ok(WaitForSingleObject(hgdiobj_event->stop_event, INFINITE) == WAIT_OBJECT_0, + "WaitForSingleObject error %ld\n", GetLastError()); + + ok(!GetObject(hgdiobj_event->hgdiobj, sizeof(lp), &lp), "GetObject should fail\n"); + + ok(!GetDeviceCaps(hgdiobj_event->hdc, TECHNOLOGY), "GetDeviceCaps(TECHNOLOGY) should fail\n"); + + return 0; +} + +static void test_thread_objects(void) +{ + LOGPEN lp; + DWORD tid; + HANDLE hthread; + struct hgdiobj_event hgdiobj_event; + INT ret; + + hgdiobj_event.stop_event = CreateEvent(NULL, 0, 0, NULL); + ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %ld\n", GetLastError()); + hgdiobj_event.ready_event = CreateEvent(NULL, 0, 0, NULL); + ok(hgdiobj_event.ready_event != NULL, "CreateEvent error %ld\n", GetLastError()); + + hthread = CreateThread(NULL, 0, thread_proc, &hgdiobj_event, 0, &tid); + ok(hthread != NULL, "CreateThread error %ld\n", GetLastError()); + + ok(WaitForSingleObject(hgdiobj_event.ready_event, INFINITE) == WAIT_OBJECT_0, + "WaitForSingleObject error %ld\n", GetLastError()); + + ok(GetObject(hgdiobj_event.hgdiobj, sizeof(lp), &lp) == sizeof(lp), + "GetObject error %ld\n", GetLastError()); + ok(lp.lopnStyle == PS_DASHDOTDOT, "wrong pen style %d\n", lp.lopnStyle); + ok(lp.lopnWidth.x == 17, "wrong pen width.y %ld\n", lp.lopnWidth.x); + ok(lp.lopnWidth.y == 0, "wrong pen width.y %ld\n", lp.lopnWidth.y); + ok(lp.lopnColor == RGB(1, 2, 3), "wrong pen width.y %08lx\n", lp.lopnColor); + + ret = GetDeviceCaps(hgdiobj_event.hdc, TECHNOLOGY); + ok(ret == DT_RASDISPLAY, "GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d\n", ret); + + ok(DeleteObject(hgdiobj_event.hgdiobj), "DeleteObject error %ld\n", GetLastError()); + ok(DeleteDC(hgdiobj_event.hdc), "DeleteDC error %ld\n", GetLastError()); + + SetEvent(hgdiobj_event.stop_event); + ok(WaitForSingleObject(hthread, INFINITE) == WAIT_OBJECT_0, + "WaitForSingleObject error %ld\n", GetLastError()); + CloseHandle(hthread); + + CloseHandle(hgdiobj_event.stop_event); + CloseHandle(hgdiobj_event.ready_event); +} + START_TEST(gdiobj) { test_logfont(); @@ -332,4 +403,5 @@ test_gdi_objects(); test_GdiGetCharDimensions(); test_text_extents(); + test_thread_objects(); } diff -urN wine-20050725/dlls/gdi/tests/metafile.c wine-20050830/dlls/gdi/tests/metafile.c --- wine-20050725/dlls/gdi/tests/metafile.c 2005-07-15 11:55:33.000000000 +0200 +++ wine-20050830/dlls/gdi/tests/metafile.c 2005-08-08 17:03:42.000000000 +0200 @@ -295,10 +295,10 @@ * otherwise returns the number of non-matching bytes. */ -static int compare_mf_bits (const HMETAFILE mf, const char *bits, UINT bsize, +static int compare_mf_bits (const HMETAFILE mf, const unsigned char *bits, UINT bsize, const char *desc) { - char buf[MF_BUFSIZE]; + unsigned char buf[MF_BUFSIZE]; UINT mfsize, i; int diff; diff -urN wine-20050725/dlls/gdi/tests/palette.c wine-20050830/dlls/gdi/tests/palette.c --- wine-20050725/dlls/gdi/tests/palette.c 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/gdi/tests/palette.c 2005-08-22 11:18:02.000000000 +0200 @@ -0,0 +1,126 @@ +/* + * Unit test suite for palettes + * + * Copyright 2005 Glenn Wurster + * + * 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 "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "mmsystem.h" + +#include "wine/test.h" + +static PALETTEENTRY logpalettedata[8] = { + { 0x10, 0x20, 0x30, PC_NOCOLLAPSE }, + { 0x20, 0x30, 0x40, PC_NOCOLLAPSE }, + { 0x30, 0x40, 0x50, PC_NOCOLLAPSE }, + { 0x40, 0x50, 0x60, PC_NOCOLLAPSE }, + { 0x50, 0x60, 0x70, PC_NOCOLLAPSE }, + { 0x60, 0x70, 0x80, PC_NOCOLLAPSE }, + { 0x70, 0x80, 0x90, PC_NOCOLLAPSE }, + { 0x80, 0x90, 0xA0, PC_NOCOLLAPSE }, +}; + +static void test_DIB_PAL_COLORS(void) { + HDC hdc = GetDC( NULL ); + HDC memhdc = CreateCompatibleDC( hdc ); + HBITMAP hbmp, hbmpOld; + char bmpbuf[sizeof(BITMAPINFO) + 10 * sizeof(WORD)]; + PBITMAPINFO bmp = (PBITMAPINFO)bmpbuf; + WORD * bmpPalPtr; + char logpalettebuf[sizeof(LOGPALETTE) + sizeof(logpalettedata)]; + PLOGPALETTE logpalette = (PLOGPALETTE)logpalettebuf; + HPALETTE hpal, hpalOld; + COLORREF setColor, chkColor, getColor; + int i; + + /* Initalize the logical palette with a few colours */ + logpalette->palVersion = 0x300; + logpalette->palNumEntries = 8; + memcpy( logpalette->palPalEntry, logpalettedata, sizeof(logpalettedata) ); + hpal = CreatePalette( logpalette ); + hpalOld = SelectPalette( memhdc, hpal, FALSE ); + ok( hpalOld != NULL, "error=%ld\n", GetLastError() ); + + /* Create a DIB BMP which references colours in the logical palette */ + memset( bmp, 0x00, sizeof(BITMAPINFO) ); + bmp->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmp->bmiHeader.biWidth = 1; + bmp->bmiHeader.biHeight = 1; + bmp->bmiHeader.biPlanes = 1; + bmp->bmiHeader.biBitCount = 8; + bmp->bmiHeader.biCompression = BI_RGB; + bmp->bmiHeader.biClrUsed = 10; + bmp->bmiHeader.biClrImportant = 0; + bmpPalPtr = (WORD *)&bmp->bmiColors; + for( i = 0; i < 8; i++ ) { + *bmpPalPtr++ = i; + } + *bmpPalPtr++ = 8; /* Pointer to logical palette index just outside range */ + *bmpPalPtr++ = 19; /* Pointer to bad logical palette index */ + + hbmp = CreateDIBSection( memhdc, bmp, DIB_PAL_COLORS, 0, 0, 0 ); + ok( hbmp != NULL, "error=%ld\n", GetLastError() ); + hbmpOld = SelectObject( memhdc, hbmp ); + ok( hbmpOld != NULL, "error=%ld\n", GetLastError() ); + + /* Test with a RGB to DIB_PAL_COLORS */ + setColor = RGB( logpalettedata[1].peRed, logpalettedata[1].peGreen, logpalettedata[1].peBlue ); + SetPixel( memhdc, 0, 0, setColor ); + chkColor = RGB( logpalettedata[1].peRed, logpalettedata[1].peGreen, logpalettedata[1].peBlue ); + getColor = GetPixel( memhdc, 0, 0 ); + ok( getColor == chkColor, "getColor=%08X\n", (UINT)getColor ); + + /* Test with a valid DIBINDEX to DIB_PAL_COLORS */ + setColor = DIBINDEX( 2 ); + SetPixel( memhdc, 0, 0, setColor ); + chkColor = RGB( logpalettedata[2].peRed, logpalettedata[2].peGreen, logpalettedata[2].peBlue ); + getColor = GetPixel( memhdc, 0, 0 ); + ok( getColor == chkColor, "getColor=%08X\n", (UINT)getColor ); + + /* Test with a invalid DIBINDEX to DIB_PAL_COLORS */ + setColor = DIBINDEX( 12 ); + SetPixel( memhdc, 0, 0, setColor ); + chkColor = RGB( 0, 0, 0 ); + getColor = GetPixel( memhdc, 0, 0 ); + ok( getColor == chkColor, "getColor=%08X\n", (UINT)getColor ); + + /* Test for double wraparound on logical palette references from */ + /* DIBINDEX by DIB_PAL_COLORS. */ + setColor = DIBINDEX( 9 ); + SetPixel( memhdc, 0, 0, setColor ); + chkColor = RGB( logpalettedata[3].peRed, logpalettedata[3].peGreen, logpalettedata[3].peBlue ); + getColor = GetPixel( memhdc, 0, 0 ); + ok( getColor == chkColor, "getColor=%08X\n", (UINT)getColor ); + + SelectPalette( memhdc, hpalOld, FALSE ); + DeleteObject( hpal ); + SelectObject( memhdc, hbmpOld ); + DeleteObject( hbmp ); + DeleteDC( memhdc ); + ReleaseDC( NULL, hdc ); +} + +START_TEST(palette) +{ + test_DIB_PAL_COLORS(); +} diff -urN wine-20050725/dlls/hhctrl.ocx/.cvsignore wine-20050830/dlls/hhctrl.ocx/.cvsignore --- wine-20050725/dlls/hhctrl.ocx/.cvsignore 2004-11-08 21:26:45.000000000 +0100 +++ wine-20050830/dlls/hhctrl.ocx/.cvsignore 2005-08-02 16:55:11.000000000 +0200 @@ -1,3 +1,3 @@ Makefile hhctrl.ocx.dbg.c -version.res +hhctrl.res diff -urN wine-20050725/dlls/hhctrl.ocx/De.rc wine-20050830/dlls/hhctrl.ocx/De.rc --- wine-20050725/dlls/hhctrl.ocx/De.rc 1970-01-01 01:00:00.000000000 +0100 +++ wine-20050830/dlls/