From 59e065284fe6557c12b1b01cfbca8798d638bcc4 Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Sat, 18 Jul 2009 13:24:17 +0200 Subject: [PATCH] push 862965e7f7bbbfb960006fcded9111ae18c06ef6 --- .gitignore | 2 + ANNOUNCE | 1515 +++++++++----------- AUTHORS | 98 +- VERSION | 2 +- configure | 45 +- configure.ac | 3 +- dlls/Makefile.in | 5 - dlls/appwiz.cpl/De.rc | 11 +- dlls/appwiz.cpl/En.rc | 8 +- dlls/appwiz.cpl/Fr.rc | 12 +- dlls/appwiz.cpl/Ja.rc | 8 +- dlls/appwiz.cpl/Ko.rc | 8 +- dlls/appwiz.cpl/Lt.rc | 16 +- dlls/appwiz.cpl/Nl.rc | 8 +- dlls/appwiz.cpl/No.rc | 8 +- dlls/appwiz.cpl/Pt.rc | 37 +- dlls/appwiz.cpl/Ro.rc | 8 +- dlls/appwiz.cpl/Ru.rc | 8 +- dlls/appwiz.cpl/Si.rc | 8 +- dlls/appwiz.cpl/Sv.rc | 8 +- dlls/appwiz.cpl/Zh.rc | 8 +- dlls/appwiz.cpl/appwiz.c | 87 +- dlls/appwiz.cpl/res.h | 3 + dlls/browseui/rsrc_De.rc | 2 + dlls/comctl32/dpa.c | 3 +- dlls/comctl32/header.c | 9 +- dlls/comctl32/tests/dpa.c | 4 +- dlls/comctl32/tests/header.c | 43 +- dlls/comctl32/toolbar.c | 2 +- dlls/comctl32/treeview.c | 20 +- dlls/comdlg32/tests/filedlg.c | 35 +- dlls/crypt32/crypt32_No.rc | 123 +- dlls/crypt32/crypt32_Pt.rc | 29 +- dlls/cryptdlg/Makefile.in | 1 + programs/reg/Pt.rc => dlls/cryptdlg/cryptdlg_Pt.rc | 27 +- dlls/d3d10/d3d10_private.h | 38 +- dlls/d3d10/effect.c | 659 +++++++-- dlls/d3dx8/core.c | 148 -- dlls/d3dx8/d3dx8.spec | 156 -- dlls/d3dx8/d3dx8_main.c | 43 - dlls/d3dx8/d3dx8_private.h | 94 -- dlls/d3dx8/mesh.c | 247 ---- dlls/d3dx8/tests/Makefile.in | 14 - dlls/d3dx9_36/Makefile.in | 3 +- dlls/d3dx9_36/core.c | 120 ++ dlls/d3dx9_36/d3dx9_36.spec | 170 +-- dlls/d3dx9_36/d3dx9_36_private.h | 28 + dlls/{d3dx8 => d3dx9_36}/math.c | 503 +++++-- dlls/d3dx9_36/mesh.c | 93 +- dlls/{d3dx8 => d3dx9_36}/tests/math.c | 805 ++++++++++- dlls/{d3dx8 => d3dx9_36}/tests/mesh.c | 111 +- dlls/dbghelp/dbghelp_private.h | 4 +- dlls/dbghelp/elf_module.c | 14 +- dlls/dbghelp/minidump.c | 34 +- dlls/dbghelp/pe_module.c | 4 +- dlls/dbghelp/symbol.c | 10 +- dlls/ddraw/tests/d3d.c | 1 + dlls/ddraw/tests/dsurface.c | 63 +- dlls/ddraw/tests/overlay.c | 3 +- dlls/ddraw/tests/refcount.c | 20 +- dlls/devenum/devenum.rc | 11 +- dlls/dxguid/dx8guid.c | 1 - dlls/dxguid/dx9guid.c | 2 +- dlls/gdi32/freetype.c | 3 +- dlls/gdi32/tests/bitmap.c | 79 + dlls/gdi32/tests/metafile.c | 52 +- dlls/gdiplus/brush.c | 29 +- dlls/gdiplus/graphics.c | 45 +- dlls/gdiplus/tests/brush.c | 66 + dlls/gphoto2.ds/gphoto2_Pt.rc | 20 +- dlls/iccvid/Makefile.in | 1 + dlls/iccvid/iccvid_De.rc | 2 + dlls/iccvid/{iccvid_De.rc => iccvid_Ja.rc} | 12 +- dlls/iccvid/iccvid_Ro.rc | 2 + dlls/jscript/array.c | 106 +- dlls/jscript/date.c | 33 + dlls/jscript/dispex.c | 16 + dlls/jscript/engine.c | 26 +- dlls/jscript/function.c | 77 +- dlls/jscript/global.c | 15 +- dlls/jscript/jscript.h | 7 +- dlls/jscript/jsutils.c | 27 +- dlls/jscript/number.c | 113 +- dlls/jscript/object.c | 44 +- dlls/jscript/regexp.c | 9 + dlls/jscript/string.c | 530 +++++-- dlls/jscript/tests/api.js | 101 +- dlls/jscript/tests/lang.js | 4 +- dlls/jscript/tests/regexp.js | 18 +- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/nls/winerr_deu.mc | 530 +++---- dlls/kernel32/nls/winerr_enu.mc | 14 +- dlls/kernel32/nls/winerr_fra.mc | 1215 ++++++++-------- dlls/kernel32/process.c | 9 + dlls/localspl/spl_De.rc | 2 + dlls/localspl/spl_Ro.rc | 2 + dlls/mpr/mpr_De.rc | 2 + dlls/msacm32/msacm_De.rc | 2 + dlls/msctf/msctf.c | 1 - dlls/mshtml/Pt.rc | 29 +- dlls/msi/dialog.c | 50 +- dlls/msvcrt/errno.c | 1 + dlls/msvidc32/Makefile.in | 1 + dlls/msvidc32/msvidc32_De.rc | 2 + dlls/msvidc32/{msvidc32_De.rc => msvidc32_Ja.rc} | 10 +- dlls/msvidc32/msvidc32_Ro.rc | 2 + dlls/oleaut32/oleaut32_De.rc | 2 + dlls/oleaut32/tests/usrmarshal.c | 76 +- dlls/oleaut32/usrmarshal.c | 22 +- dlls/riched20/editor.c | 49 +- dlls/riched20/paint.c | 108 +- dlls/riched20/reader.c | 23 +- dlls/riched20/tests/editor.c | 54 +- dlls/sane.ds/Makefile.in | 1 + dlls/sane.ds/sane_De.rc | 2 + dlls/sane.ds/{sane_De.rc => sane_Ja.rc} | 15 +- dlls/shdoclc/Pt.rc | 57 +- dlls/shell32/shell32.spec | 2 +- dlls/shell32/shell32_De.rc | 124 +- dlls/shell32/shell32_Nl.rc | 96 +- dlls/shlwapi/shlwapi_De.rc | 2 + dlls/t2embed/main.c | 18 + dlls/t2embed/t2embed.spec | 2 +- dlls/user32/resources/user32_De.rc | 36 +- dlls/user32/tests/menu.c | 59 + dlls/uuid/uuid.c | 5 + dlls/wbemprox/Makefile.in | 6 +- dlls/wbemprox/main.c | 108 ++ dlls/{windowscodecs => wbemprox}/regsvr.c | 291 ++-- dlls/wbemprox/wbemlocator.c | 130 ++ dlls/wbemprox/wbemprox.spec | 8 +- .../De.rc => dlls/wbemprox/wbemprox_private.h | 12 +- dlls/windowscodecs/bmpdecode.c | 51 +- dlls/windowscodecs/regsvr.c | 289 ++++ dlls/winealsa.drv/dsoutput.c | 159 +- dlls/wined3d/arb_program_shader.c | 80 +- dlls/wined3d/ati_fragment_shader.c | 25 +- dlls/wined3d/baseshader.c | 32 +- dlls/wined3d/context.c | 247 ++-- dlls/wined3d/cubetexture.c | 2 +- dlls/wined3d/device.c | 34 +- dlls/wined3d/directx.c | 84 +- dlls/wined3d/gl_compat.c | 3 +- dlls/wined3d/glsl_shader.c | 63 +- dlls/wined3d/nvidia_texture_shader.c | 3 +- dlls/wined3d/shader_sm1.c | 2 + dlls/wined3d/shader_sm4.c | 57 +- dlls/wined3d/state.c | 5 +- dlls/wined3d/surface.c | 24 +- dlls/wined3d/texture.c | 2 +- dlls/wined3d/utils.c | 20 +- dlls/wined3d/volumetexture.c | 4 +- dlls/wined3d/wined3d_gl.h | 123 +- dlls/wined3d/wined3d_private.h | 56 +- dlls/winex11.drv/bitblt.c | 23 +- dlls/winex11.drv/bitmap.c | 20 +- dlls/winex11.drv/brush.c | 11 +- dlls/winex11.drv/clipboard.c | 87 +- dlls/winex11.drv/dib.c | 6 +- dlls/winex11.drv/graphics.c | 2 +- dlls/winex11.drv/x11drv.h | 12 +- dlls/winex11.drv/xrender.c | 194 ++- dlls/winhttp/Makefile.in | 2 +- dlls/winhttp/request.c | 205 ++- dlls/winhttp/session.c | 411 +++++- dlls/winhttp/tests/Makefile.in | 2 +- dlls/winhttp/tests/winhttp.c | 138 +- dlls/winhttp/winhttp_private.h | 1 + dlls/wininet/dialogs.c | 16 +- dlls/wininet/ftp.c | 323 ++--- dlls/wininet/http.c | 297 ++-- dlls/wininet/internet.c | 152 +- dlls/wininet/internet.h | 65 +- dlls/wininet/utility.c | 6 +- dlls/wininet/wininet_De.rc | 2 + dlls/{d3dx8 => wmiutils}/Makefile.in | 12 +- dlls/wmiutils/main.c | 147 ++ dlls/{windowscodecs => wmiutils}/regsvr.c | 291 ++-- dlls/wmiutils/statuscode.c | 153 ++ dlls/wmiutils/wmiutils.spec | 4 + .../De.rc => dlls/wmiutils/wmiutils_private.h | 12 +- dlls/ws2_32/socket.c | 41 +- dlls/ws2_32/tests/sock.c | 230 ++- include/Makefile.in | 9 +- include/d3d10effect.h | 43 + include/d3dx8core.h | 130 -- include/d3dx8math.h | 415 ------ include/d3dx8math.inl | 1268 ---------------- include/d3dx8mesh.h | 41 - include/d3dx9math.h | 73 +- include/gdiplusflat.h | 1 + include/netcon.idl | 412 ++++++ include/ntddndis.h | 168 +++ include/{d3dx8.h => t2embapi.h} | 36 +- include/wbemcli.idl | 211 +++ include/winbase.h | 1 + include/wincodec.idl | 4 + programs/cmd/De.rc | 68 +- programs/cmd/Ru.rc | 571 ++++---- programs/reg/Pt.rc | 9 +- programs/taskmgr/De.rc | 120 +- programs/taskmgr/Ja.rc | 1 + programs/taskmgr/No.rc | 172 ++- programs/taskmgr/Pt.rc | 184 ++- programs/winecfg/De.rc | 96 +- programs/winedbg/be_i386.c | 3 - programs/winedbg/rsrc_Sv.rc | 2 - programs/winefile/Pt.rc | 21 +- programs/winemine/De.rc | 2 +- programs/wordpad/En.rc | 26 +- programs/wordpad/Pt.rc | 71 +- programs/wordpad/wordpad.h | 28 +- programs/write/De.rc | 2 + server/file.c | 2 +- tools/widl/typegen.c | 7 +- tools/wine.inf.in | 2 + tools/wrc/parser.l | 6 +- tools/wrc/parser.y | 16 +- 218 files changed, 11228 insertions(+), 7455 deletions(-) rewrite ANNOUNCE (96%) copy programs/reg/Pt.rc => dlls/cryptdlg/cryptdlg_Pt.rc (53%) delete mode 100644 dlls/d3dx8/core.c delete mode 100644 dlls/d3dx8/d3dx8.spec delete mode 100644 dlls/d3dx8/d3dx8_main.c delete mode 100644 dlls/d3dx8/d3dx8_private.h delete mode 100644 dlls/d3dx8/mesh.c delete mode 100644 dlls/d3dx8/tests/Makefile.in create mode 100644 dlls/d3dx9_36/core.c rename dlls/{d3dx8 => d3dx9_36}/math.c (80%) rename dlls/{d3dx8 => d3dx9_36}/tests/math.c (75%) rename dlls/{d3dx8 => d3dx9_36}/tests/mesh.c (74%) copy dlls/iccvid/{iccvid_De.rc => iccvid_Ja.rc} (78%) copy dlls/msvidc32/{msvidc32_De.rc => msvidc32_Ja.rc} (81%) copy dlls/sane.ds/{sane_De.rc => sane_Ja.rc} (77%) copy dlls/{windowscodecs => wbemprox}/regsvr.c (54%) create mode 100644 dlls/wbemprox/wbemlocator.c copy programs/write/De.rc => dlls/wbemprox/wbemprox_private.h (77%) rename dlls/{d3dx8 => wmiutils}/Makefile.in (62%) create mode 100644 dlls/wmiutils/main.c copy dlls/{windowscodecs => wmiutils}/regsvr.c (54%) create mode 100644 dlls/wmiutils/statuscode.c create mode 100644 dlls/wmiutils/wmiutils.spec copy programs/write/De.rc => dlls/wmiutils/wmiutils_private.h (77%) delete mode 100644 include/d3dx8core.h delete mode 100644 include/d3dx8math.h delete mode 100644 include/d3dx8math.inl delete mode 100644 include/d3dx8mesh.h create mode 100644 include/netcon.idl create mode 100644 include/ntddndis.h rename include/{d3dx8.h => t2embapi.h} (54%) create mode 100644 include/wbemcli.idl rewrite programs/cmd/Ru.rc (86%) diff --git a/.gitignore b/.gitignore index 017550af167..1f9c9088047 100644 --- a/.gitignore +++ b/.gitignore @@ -138,6 +138,7 @@ include/msinkaut.h include/mstask.h include/msxml.h include/msxml2.h +include/netcon.h include/netfw.h include/oaidl.h include/objidl.h @@ -167,6 +168,7 @@ include/unknwn.h include/urlhist.h include/urlmon.h include/vmr9.h +include/wbemcli.h include/wincodec.h include/wine/itss.h include/wine/svcctl.h diff --git a/ANNOUNCE b/ANNOUNCE dissimilarity index 96% index 62dd485111a..099274bbeb9 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,800 +1,715 @@ -The Wine development release 1.1.25 is now available. - -What's new in this release (see below for details): - - A ton of translation updates. - - Support for various Unicode file encodings in Notepad. - - Improved memory management, especially for OpenGL. - - Desktop menus now cleaned up automatically. - - Beginnings of a windowscodecs DLL implementation. - - Various bug fixes. - -The source is available from the following locations: - - http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.25.tar.bz2 - http://prdownloads.sourceforge.net/wine/wine-1.1.25.tar.bz2 - -Binary packages for various distributions will be available from: - - http://www.winehq.org/site/download - -You will find documentation on http://www.winehq.org/site/documentation - -You can also get the current source directly from the git -repository. Check http://www.winehq.org/site/git for details. - -Wine is available thanks to the work of many people. See the file -AUTHORS in the distribution for the complete list. - ----------------------------------------------------------------- - -Bugs fixed in 1.1.25: - - 5720 addr_to_linear Failed to linearize address, etc. - 7229 Using sound in WoW causes a lockup - 7949 Quicktest Pro 8.2 fails to start up - 8690 Display Error with CyclingPeaks WKO - 9256 S.T.A.L.K.E.R. - Major slowdown near anomalies or in high RAD areas - 9944 Cannot active Microsoft Office 2003 Over the telephone - 10277 Uninstalling software does not remove them from Programs menu - 10688 PSP 7.0 installation blows up - 11223 uTorrent 1.8 alpha not working - GetBestInterfaceEx problem - 11492 Perfect world entering world wait infinite - 12492 Farcry on steam does not start - 12615 EVE Online: Space textures are replaced with some other things from video-memory - 13130 Sound in Nightlong only working every couple of starts - 13204 winealsa.drv makes incorrect assumptions about hardware - 13335 Wine virtual memory exhaustion causing OpenGL crashes / slowdowns - 13706 Mankind encounters a page fault on startup - 14000 Everquest2 - unable to find a suitable iPixel Format with ATI - 14012 CodeWright crashes - 14182 Warcraft III: The Frozen Throne installer crashes - 14239 Sonos Desktop Controller: Crashes clicking in the Music Library list - 14555 Tool-tip glitch in The Curse of Monkey Island - 14794 Crash when starting Yahoo Messenger 8 - 15484 Respondus Lockdown browser fails to launch - 15534 Dragon NaturallySpeaking 10 crashes occasionally with seh error - 15742 eMule: Missing text in the information box - 16386 FAR crashes with Unimplemented KERNEL32.dll.GetConsoleAliasW - 16827 Secret Maryo Chronicles: Won't install. - 16864 Rendering of main character is wrong - 17253 Luka: exits soon after start - 17318 winemenubuilder fails to create proper menu structure - 17618 winecfg does not set drive type correctly for Local Hard Disk choice - 17706 EVE Premium and Geforce 6200: FPS drops to 0 during Warp - 18006 Mp3tag: Crash when using Tag Sources feature - 18192 Notepad can only save in current locale encoding, should be able to save in unicode - 18208 crypt32.dll.CryptRegisterOIDInfo needed for Microsoft Font Validator (installer) - 18412 Lord of the Rings Online, image upside down and more - 18583 Free Realms crashes with unimplemented D3DXGetDeclVertexSize - 18688 Ventrilo crashes on startup - 18806 3Dmark 2006 - 18831 Lord of the Rings Online: Mines of Moria post-processing misplaces objects - 18893 Oblivion installation crashed with an uncought exception - 18953 UFO Aftermath installer exits with error - 18956 Intel Xorg: no more 3D since default OffscreenRenderingMode is fbo - 18980 Canon's CONSOLE Image Control & Storage Software fails on administrator privs check - 18984 Free&Easy Font Viewer crashes on startup - 19002 Postal 2 - graphics problems - 19009 Crosstests don't compile with CROSSCC="ccache i586-mingw32msvc-gcc" - 19014 Casino Club crashes when typing in login-box - 19022 BibleStudyPro: text does not display on screen - 19024 No WM_MEASUREITEM received on LV creation (LVS_OWNERDRAWFIXED) - 19045 winecfg: drive list is not refreshed in winecfg, no more disk label - 19050 PE explorer shows access violations when started - 19055 Various apps quit with "bad file descriptor" error - 19065 3dmark06: shader doesn't compile with arb shader backend - 19069 Nestopia crashes - 19071 Reg.exe doesn't error out on invalid input (appinstall) - 19079 Add multiple files dialog does not work. - 19094 Regression on OS X, may not be able to load dll - 19096 iexplore's gecko installer broken - 19119 Quice.exe program no longer starts - 19126 VS 2005 SP1 installation failure - ----------------------------------------------------------------- - -Changes since 1.1.24: - -Alexander Nicolaysen Sørnes (4): - appwiz.cpl: Update Norwegian Bokmål translation. - shell32: Update Norwegian Bokmål translation. - regedit: Update Norwegian Bokmål translation. - wordpad: Update Norwegian Bokmål translation. - -Alexander Scott-Johns (7): - rtutils: Add stub dll. - rtutils: Add stub TraceRegisterExW and TraceRegisterExA. - notepad: Fix trying to open non-existent files with the command line. - notepad: Improve encoding detection when opening files. - notepad: Remember the encoding of files when they are opened, and use the same encoding when saving. - notepad: Allow user to choose which encoding to open and save files in. - notepad: Detect if saving will lose information. - -Alexandre Julliard (51): - winebuild: Add possibility to generate a global resource file without running it through windres. - wrc: Add support for loading multiple input files at once. - configure: Improve extraction of the target name from the CROSSCC definition. - crypt32: Fix a couple of assumptions about structure layout. - configure: Add a check for broken 16-bit compile with Xcode 3.x. - winebuild: Enforce header size alignment when outputting resources. - wrc: Use an EOF rule instead of lex_destroy for compatibility with prediluvian flex versions. - winedbg: Don't display the crash dialog for winedevice.exe, it only confuses users. - configure: Rename the shared heap segment to avoid a Mac OS linker bug with 16-char names. - dbghelp: Fix detection of special Wine segments. - configure: Add a wrapper macro for .cfi pseudo-ops in assembly code. - msvcrt: Add call frame annotations in x86 assembly code. - rpcrt4: Add call frame annotations in x86 assembly code. - user32: Add call frame annotations in x86 assembly code. - winedos: Add call frame annotations in x86 assembly code. - libwine: Add call frame annotations in x86 assembly code. - ntdll: Add call frame annotations in x86 assembly code. - kernel32: Add call frame annotations in x86 assembly code. - msi: The dialog units are based on a 12-point font size, despite the documentation. - winex11: Try to use the correct window rectangle as far as possible at XCreateWindow time. - ntdll: Compute the free lists address at run-time instead of playing with alignment and padding. - ntdll: Don't try to decommit a heap past its initial commit size. - ntdll: Release some address space after the process initialization is done. - loader: Reserve some more memory to cover the native ole32 addresses. - server: Use sys/inotify.h if it exists instead of hardcoding the system calls. - wrc: Clean up command line parsing for multiple files support. - winegcc: Pass all option flags to winebuild before non-options filenames. - ntdll: Disable releasing the address space on Mac OS since dyld doesn't support this. - winebuild: Don't try to output 32-bit resources when building a 16-bit wrapper dll. - ntdll: Large heap blocks don't need to be 64k aligned. - ntdll: Go back to growing the heap in smaller increments once we start running out of address space. - winemenubuilder: Use spawnvp() instead of system() to launch the xdg update scripts. - oleaut32: Properly release cache DCs instead of trying to delete them. - ntdll: Avoid the close-on-exec race with recvmsg() on kernels that support this. - ntdll: Avoid the close-on-exec race with pipe() on kernels that support pipe2(). - kernel32: Avoid the close-on-exec race with pipe() on kernels that support pipe2(). - secur32: Avoid the close-on-exec race with pipe() on kernels that support pipe2(). - gdiplus: Don't return garbage from the GdipCreateHBITMAPFromBitmap stub. - preloader: Reserve addresses only up to 0x68000000, that should be enough for ole32. - makefiles: Remove the no longer used SPEC_SRCS variable from 16-bit makefiles. - widl: Skip the existing correlation descriptor on unencapsulated unions when generating a different one. - widl: Struct alignment should be the largest alignment of all the struct members. - widl: Take into account structure field alignment when computing offsets. - widl: An ENUM16 is 32-bit wide in memory. - make_makefiles: Automatically update the source lists in the individual makefiles. - makefiles: Regenerate the source lists using make_makefiles. - rpcrt4: Replace long and unsigned long by more appropriate types. - oleaut32: Replace long and unsigned long by more appropriate types. - ole32/tests: Fix the HMETAFILE_UserSize prototype. - ntdll: Fix the formatting of the get_token_groups request for 64-bit. - kernel32: Compile .mc files to resources as independent files. - -Anders Jonsson (1): - crypt32: Add CryptRegisterOIDInfo stub. - -Andrew Eikum (5): - gdiplus/tests: Fix resource leaks in several tests. - gdiplus/tests: Add tests for GdipDrawCurve2. - gdiplus/tests: Add tests for GdipDrawCurveI. - gdiplus/tests: Add tests for GdipDrawCurve2I. - gdiplus: Implement GdipDrawCurve3 and GdipDrawCurve3I. - -Andrew Nguyen (4): - reg: Report an error when an unknown operation is specified. - reg: Fix behavior when specifying the help flag. - reg: Correct the sense of return values for registry operations. - reg: Support the /h flag as a synonymous help flag. - -Andrew Talbot (2): - cryptnet: Constify some variables. - cryptui: Constify some variables. - -André Hentschel (9): - documentation: README.de spelling fixes. - taskmgr: Add German translation. - taskmgr: Update German translation. - appwiz: Add function for installer button. - taskmgr: Update German translation. - appwiz: A nicer icon for appwiz. - taskmgr: Update German translation. - wineconsole: Improve German translation. - notepad: Update German translation. - -Aric Stewart (30): - browseui: Add Japanese translation. - mshtml: Update Japanese resources. - user32: Update Japanese resources. - msctf: Define ITfCompartment. - msctf: Implement ITfCompartment::GetValue. - msctf: Implement ITfCompartment::SetValue. - msctf: Implement ITfCompartmentMgr::GetCompartment. - msctf: ITfCompartmentMgr tests. - msctf: Define ITfSource for Compartments. - msctf: Implement ITfCompartmentEventSink. - wininet: Improve HTTP status 100 handling. - wininet: Semi-stub for quering Http INTERNET_OPTION_SECURITY_FLAGS. - wintrust: Stub WTHelperCertCheckValidSignature. - msctf: Implement ITfContext::GetStatus. - msctf: ITfContext::GetDocumentMgr should AddRef the DocumentMgr. - msctf: Context initialization happens before OnPushContext sink. - msctf/tests: Verify to make sure OnPopContext happens before context is removed from stack. - wintrust: GetSignedMsgFromCabFile looks for signinfo at the beginning of the cab. - msctf: Correct registry key from "Enabled" to "Enable". - msctf/tests: Release the ITfDocumentMgr received on GetFocus. - msctf: Semi-stub implementation of ITfInputProcessorProfiles::GetLanguageList. - shell32: Handle shell: urls internal in ParseDisplayName instead of passing them to shdocvw. - shell32: Implement SHCreateShellFolderView (ordinal 256). - msctf: Implement ITfInputProcessorProfiles::GetDefaultLanguageProfile. - msctf: Implement ITfInputProcessorProfiles::SetDefaultLanguageProfile. - msctf: Add api definitions for TF_CreateThreadMgr and TF_GetThreadMgr. - msctf: Implement TF_CreateInputProcessorProfiles. - msctf: Implement ITfDocumentMgr::EnumContexts. - wordpad: Update Japanese resource. - notepad: Update Japanese resource. - -Aurimas Fišeras (44): - mpr: Add Lithuanian translation. - localspl: Add Lithuanian translation. - iccvid: Add Lithuanian translation. - localui: Add Lithuanian translation. - msrle32: Add Lithuanian translation. - msi: Add Lithuanian translation. - msvfw32: Add Lithuanian translation. - msvidc32: Add Lithuanian translation. - oleaut32: Add Lithuanian translation. - sane.ds: Add Lithuanian translation. - serialui: Add Lithuanian translation. - taskmgr: Make all static text translatable. - setupapi: Add Lithuanian translation. - shlwapi: Add Lithuanian translation. - taskmgr: Make status bar text translatable. - avifil32: Add Lithuanian translation. - taskmgr: Make column headers in processes tab translatable. - oledlg: Add Lithuanian translation. - clock: Add Lithuanian translation. - taskmgr: Make MessageBoxes translatable. - taskmgr: Add Lithuanian translation. - taskmgr: Add missing resource. - appwiz.cpl: Update Lithuanian translation. - cryptdlg: Add Lithuanian translation. - taskmgr: Make remaining strings translatable. - shdoclc: Add Lithuanian translation. - wldap32: Add Lithuanian translation. - notepad: Improve Lithuanian translation. - wordpad: Add Lithuanian translation. - winhlp32: Add Lithuanian translation. - net: Add Lithuanian translation. - cmdlgtst: Add Lithuanian translation. - write: Add Lithuanian translation. - xcopy: Add Lithuanian translation. - winefile: Add Lithuanian translation. - view: Add Lithuanian translation. - comdlg32: Improve Lithuanian translation. - progman: Add Lithuanian translation. - wineconsole: Add Lithuanian translation. - oleview: Add Lithuanian translation. - winmm: Add Lithuanian translation. - notepad: Update Lithuanian translation. - cmd: Add Lithuanian translation. - winecfg: Improve Lithuanian translation. - -Austin English (6): - shdocvw: Handle DISPID_AMBIENT_DLCONTROL case. - wined3d: Fix a compiler warning. - winedbg: Return 0 if --help is specified. - winecfg: Fix cd detection for FreeBSD. - winex11: Make sure GetKeyNameText gets the correct length to return. - drmclien: Add stub dll. - -Damjan Jovanovic (5): - winemenubuilder: Generate new menus in the right directory. - winemenubuilder: Allow multiple options. - wine.inf: Run winemenubuilder to delete menus on startup. - winemenubuilder: Only generate associations for the "open" verb. - winemenubuilder: Distinguish menu icons from association icons. - -Davide Pizzetti (5): - progman: Update Italian translation. - winemine: Update Italian translation. - regedit: Update Italian translation. - winhlp32: Update Italian translation. - cmdlgtst: Update Italian translation. - -Detlef Riekenberg (9): - winex11: Get rid of glext.h in remaining locations. - urlmon: Implement ZoneManager_GetZoneAttributes. - urlmon/tests: Add tests for ZoneManager_GetZoneAttributes. - browseui: Add a stub for DllInstall. - advapi32: Check the output pointer first in RegOpenKey, with test. - advapi32/tests: Remove unneeded SetLastError. - shlwapi: Last parameter in SHUnicodeToAnsiCP is an int. - urlmon: Implement the ZoneEnumerator. - urlmon/tests: Add tests for the ZoneEnumerator. - -Dmitry Timoshkov (2): - mlang: Make it possible to build the mlang test with PSDK. - user32: Add a test for BM_SETSTYLE, make it pass under Wine. - -Eric Pouech (10): - dbghelp: When loading ELF public information, handle the cases when we don't get an address. - dbghelp: Factorize symbol insertion into module by address table. - dbghelp: when (re)building the per module symbol table (lookup by address), no longer iterate over the hash table. - dbghelp: Simplify the resort operation (module address table) by using binary insertion instead of resorting the whole array. - winhlp32: Fixed some cases where winhlp32 didn't shutdown as expected. - winedbg: Print array size when looking at its type. - winedbg: Correctly print type for functions without parameters. - dbghelp: When the CU is compiled with GCC, deal with some GCC extensions. - dbghelp: Added reference for MSVC 8. - winedump: Added reference for MSVC 8. - -Eric van Beurden (2): - wininet: Add a terminating empty line to the headers if necessary. - wininet: Check for failed heap allocations. - -Francois Gouget (17): - msvfw32: Move MSVIDEO_SendMessage() up and make it and MSVIDEO_GetHicPtr() static. - ole32: Reorder some stubmanager functions to avoid forward declarations. - ole32: Make stub_manager_int_addref() static. - Assorted spelling fixes. - comctl32: Make MapIdSearchCompare() static. - gdi32/tests: Fix the trailing '\n' of a few ok() calls. - wined3d: Add a trailing '\n' to a FIXME() trace. - clock: Use SUBLANG_NEUTRAL for Romanian. - setupapi: Ellipses should be preceded by a space in Slovenian. - notepad: Ellipses should be preceded by a space in Slovenian. - gdi32/tests: Make test_GetTextMetrics2() static. - windowscodecs: Make the QueryInterface() functions static. - advapi32/tests: Add a trailing '\n' to ok() calls. - makedep: Add support for multiple object file extensions. - crosstest: Fix the crosstest dependencies. - taskmgr: Remove spaces before '\n's. - windowscodecs: Add a trailing '\n' to FIXME() traces. - -Frédéric Delanoy (12): - wldap32: Fixed French translation. - cmdlgtst: Fixed French translation. - taskmgr: Some fixes to French translation/display. - appwiz.cpl: Updated French translation. - shell32: Updated French translation. - cryptui: Add French translation. - winedbg: Add French translation. - comdlg32: Improve French translation. - crypt32: Update French translation. - gphoto2.ds: Update French translation. - hhctrl.ocx: Update French translation. - msi: Update French translation. - -Gerald Pfeifer (6): - ddraw: Fix error checking in IDirect3DExecuteBufferImpl_Execute(). - ddraw: Fix two bounds checks. - dsound/tests: Fix two broken conditions. - d3d9/tests: Fix three incorrect logic conditions. - wined3d: Fix logical condition in find_clip_texcoord(). - d3d9: Fix variable type in reset_enum_callback(). - -Hans Leidekker (20): - ntdll: Don't return success from the NtQueryEvent stub. - wininet: Don't delete the cache file when closing a request. - crypt32: Add a partial implementation of CertCreateContext. - include: Add definition of IObjContext. - ole32: Implement CoGetContextToken. - ole32: Add tests for CoGetContextToken. - wininet: Improve the PrivacyGet/SetZonePreferenceW stubs. - mlang: Implement IMLangFontLink2_CodePageToScriptID. - mlang: Implement IMLangFontLink2_GetFontUnicodeRanges. - msi: Support opening transform databases. - hhctrl.ocx: Don't leak the CHM filename. - hhctrl.ocx: Remove some dead code. - hhctrl.ocx: Try the Windows help directory if the specified file does not exist. - mlang: Implement IMultiLanguage2_IsCodePageInstallable. - mlang: Add a test for IMultiLanguage2_IsCodePageInstallable. - winebrowser: Support file URLs with a query or an anchor. - fusion/tests: Initialize a variable. - iphlpapi/tests: Initialize a variable. - wintrust/tests: Initialize a variable. - ole32: Use existing MTA in CoGetContextToken and CoGetObjectContext. - -Henri Verbeet (50): - wined3d: Simplify the transformed position fixup a bit. - wined3d: Move the num_untracked_materials lookup out of the main drawing loop. - wined3d: Get rid of DEBUG_SINGLE_MODE. - wined3d: Get rid of some asserts. - wined3d: Add an rtInternal fallback for WINED3DFMT_R16G16_UNORM. - d3d9/tests: Release the vertex buffer in test_null_stream(). - d3d9/tests: Release the query in test_occlusion_query_states(). - d3d9/tests: Make sure the device is released properly. - d3d8/tests: Make sure the device is released properly. - wined3d: Fix a comment. - wined3d: Add some missing GL locking documentation to arb_program_shader.c. - wined3d: Use a proper structure for "loop_control". - wined3d: Avoid a redundant copy. - wined3d: Eliminate a redundant local variable in get_loop_control_const(). - wined3d: Allow the existence of other shader types in get_loop_control_const(). - wined3d: Make sure we have an active GL context in delete_opengl_contexts(). - wined3d: Make sure we have an active GL context in buffer_PreLoad(). - wined3d: Make context_resource_released() responsible for activating a different GL context. - wined3d: Make sure we have an active GL context in context_resource_released(). - wined3d: Make sure we have an active GL context in IWineD3DDeviceImpl_SetCursorProperties(). - wined3d: Make sure queries have an active GL context. - wined3d: Make sure we have an active GL context in IWineD3DSurfaceImpl_UnLoad(). - wined3d: Make sure we have an active GL context before calling surface_remove_pbo(). - wined3d: Make sure we have an active GL context before calling d3dfmt_p8_upload_palette(). - wined3d: Document GL context dependencies. - wined3d: Add some missing GL locking to init_format_fbo_compat_info(). - wined3d: Prevent GL calls from DestroyContext() if we failed to make the GL context current. - wined3d: Always check the result of wglMakeCurrent(). - d3d: Add a test for releasing the device after destroying the window. - wined3d: Add a WARN to IWineD3DDeviceImpl_SetFrontBackBuffers() about potentially being called without a GL context. - wined3d: Remove shader_is_version_token(). - wined3d: Pass the shader type to shader_record_register_usage(). - wined3d: Remove some redundant pshader checks. - wined3d: Use dst_param.reg.idx to index reg_maps->texcoord_mask. - wined3d: Consolidate "color0_mov" handling a bit. - wined3d: Replace "pshader" checks with explicit type checks in shader_get_registers_used(). - wined3d: Recognize geometry shaders in shader_trace_init(). - wined3d: Try to activate the original context for queries. - wined3d: Move the driver_quirk structure to directx.c. - wined3d: Use flags for driver quirks. - wined3d: Make sure the rtInternal format is supported. - wined3d: Check if formats support blending when attached to an FBO. - wined3d: Clear the last device in WineD3D_CreateFakeGLContext(). - wined3d: Don't reuse random GL contexts during initialization. - wined3d: Get rid of the silly refcount for the "fake" GL context. - wined3d: Use a proper structure for storing initial GL context information. - wined3d: Get rid of wined3d_fake_gl_context_cs. - d3d9/tests: Add a small test for having multiple device active at the same time. - wined3d: Don't abuse blending to disable color writes in surface_depth_blt(). - wined3d: Don't accept NULL as a valid result from glGetString(). - -Hib Eris (4): - msi/tests: Add tests for order of tables. - msi: Insert new tables in correct _Tables location. - msi: Release msi_custom_action_info when no longer needed. - msi: Release more msi_custom_action_info when no longer needed. - -Huw Davies (20): - gdi32: CBM_INIT is a flag. - ole32: Since OleCreateLinkFromData is a stub we should return S_FALSE from OleQueryLinkFromData. - ole32: Add support for retrieving enhanced metafiles. - ole32/tests: Add a test for enhanced metafile retrieval. - gdi32: Implement SetVirtualResolution. - gdi32: Add tests for SetVirtualResolution. - gdi32: Implement GetTransform for the other valid transform types. - gdi32: Add tests for GetTransform. - configure: Remove reference to obsolete ftnames.h. - ole32: Implement OleCreateEmbeddingHelper. - gdi32: Use the unicode version of CreateMetaFile. - gdi32: Remove obviously incorrect calls to SetMapMode. - gdi32: Store the original emf as a sequence of MFCOMMENT records. - gdi32: Add tests for the GetWinMetaFileBits MFCOMMENT record. - gdi32/tests: Add a test for the MFCOMMENT record's size. - gdi32/tests: Dump the correct metafile if the test fails. - gdi32: Write the map mode and window size records after the mfcomment. - gdi32: Add tests for the map mode and window size records. - gdi32/tests: Add some traces and fix a few comments. - gdi32/tests: Fix tests on win9x and winMe. - -Hwang YunSong (5): - start: Updated Korean resource. - winecfg: Updated Korean resource. - appwiz.cpl: Updated Korean resource. - taskmgr: Updated Korean resource. - kernel32: Updated winerr_kor.mc. - -Jacek Caban (14): - mshtml.idl: Added DispHTMLLocation and DispHTMLNavigation dispinterfaces. - mshtml: Fixed tests on IE8 and change Wine behavior to IE8. - urlmon.idl: Added IBindStatusCallbackEx declaration. - urlmon: Fixed tests on IE8. - urlmon: Query for IHtmlNegotiate[2] interfaces when needed. - urlmon: Don't depend on QueryService returning NULL on failure. - urlmon: Set user agent registry. - urlmon: Added UrlMkSetSessionOption(URLMON_OPTION_USERAGENT) implementation. - urlmon: Added UrlMkSetSessionOption(URLMON_OPTION_USERAGENT) implementation. - urlmon: Added user agent tests. - urlmon: Added ObtainUserAgentString implementation. - urlmon: Added IBindStatusCallbackEx tests (also fixes some IE8 failures). - urlmon: Use GetBinfInfoEx in GetBindInfo implementation if possible. - urlmon: Added IBindStatusCallbackEx implementation. - -Jaime Rave (2): - notepad: Update Spanish translation. - regedit: Spanish translation updated. - -Joel Holdsworth (3): - user32/tests: Added tests for DrawIcon and DrawIconEx. - user32: Added DrawIcon alpha blending support. - user32: Added DrawIconEx alpha blending support. - -Jörg Höhle (3): - winedos: Provide trailing \ now required by GetVolumeInformation. - winecfg: Provide trailing \ now required by GetVolumeInformation. - kernel32: Avoid unprotected sprintf on registry/user-supplied format string. - -Ken Sharp (1): - gdiplus: Add GdipIsVisibleRegionPointI stub. - -Louis Lenders (2): - kernel32/nls: Add system message 2221 to winerr_enu.mc. - advapi32: Add a few tests for GetSidSubAuthority and SetLastError correctly. - -Maksim Kuleshov (1): - wininet: Fix sockets leak in FTP_Connect. - -Matej Spindler (8): - mshtml: Update Slovenian translation. - appwiz.cpl: Update Slovenian translation. - notepad: Update Slovenian translation. - reg: Update Slovenian translation. - regedit: Update Slovenian translation. - shell32: Update Slovenian translation. - setupapi: Update Slovenian translation. - wordpad: Update Slovenian translation. - -Michael Stefaniuc (70): - appwiz.cpl: Fix the Romanian translation. - user32: Remove unreachable code: break after return (Smatch). - browseui: Build language resource files separately. - iccvid: Build language resource files separately. - oleacc: Build language resource files separately. - crypt32: Build language resource files separately. - mpr: Build language resource files separately. - msrle32: Build language resource files separately. - uninstaller: Build language resource files separately. - oleaut32: Build language resource files separately. - cryptdlg: Build language resource files separately. - wldap32: Build language resource files separately. - wineconsole: Build language resource files separately. - winedbg: Include the local resource header last. - winedbg: Build language resource files separately. - hhctrl.ocx: Build language resource files separately. - gphoto2.ds: Build language resource files separately. - mshtml: Build language resource files separately. - hhctrl.ocx: Fix a memory leak on an error path (Smatch). - notepad: Fix the Finnish translation. - oleaut32: Fix a small error in a comment. - msvidc32: Build language resource files separately. - sane.ds: Build language resource files separately. - cmd: Build language resource files separately. - regedit: Build language resource files separately. - wineboot: Build language resource files separately. - winecfg: Build language resource files separately. - write: Build language resource files separately. - appwiz.cpl: Build language resource files separately. - localui: Build language resource files separately. - xcopy: Build language resource files separately. - net: Build language resource files separately. - reg: Build language resource files separately. - localspl: Build language resource files separately. - taskmgr: Build language resource files separately. - start: Build language resource files separately. - shdoclc: Build language resource files separately. - cmdlgtst: Build language resource files separately. - wordpad: Build language resource files separately. - msi: Build language resource files separately. - winemine: Build language resource files separately. - msvfw32: Build language resource files separately. - view: Build language resource files separately. - credui: Build language resource files separately. - oledlg: Build language resource files separately. - winhlp32: Build language resource files separately. - notepad: Build language resource files separately. - comctl32: Build language resource files separately. - shlwapi: Build language resource files separately. - shell32: Build language resource files separately. - cryptui: Build language resource files separately. - avifil32: Build language resource files separately. - serialui: Build language resource files separately. - setupapi: Build language resource files separately. - oleview: Build language resource files separately. - winefile: Build language resource files separately. - comdlg32: Build language resource files separately. - shdocvw: Import the version.rc into the main rc file. - wineps.drv: Include a local header last. - wineps.drv: Build language resource files separately. - winmm: Build language resource files separately. - progman: Build language resource files separately. - winspool.drv: Build language resource files separately. - msacm32: Build language resource files separately. - wininet: Build language resource files separately. - cards: Build the version.rc file separately. - ole32: Import the content of version.rc into the main rc file. - msiexec: Import the version.rc into the main rc file. - urlmon: Import the version.rc into the main rc file. - user32: Build language resource files separately. - -Nicolas Le Cam (5): - user32/tests: Ignore WM_TIMECHANGE message. - shell32/tests: Fix a typo. - shell32/tests: Use win_skip() instead of skip() and trace(). - cabinet/tests: Avoid use of lstrlenA when not needed. - cabinet/tests: Split an incorrect test in two valid ones. - -Nikolay Sivov (22): - comctl32/listview: Implement LVM_CANCELEDITLABEL with tests. - comctl32/listview: Implement LVM_ISITEMVISIBLE. - comctl32/listview: Basic LVM_MAPINDEXTOID tests. - comctl32/listview: Implement LVM_MAPIDTOINDEX/LVM_MAPINDEXTOID. - comctl32/header: Add support for HDS_FLAT style. - comctl32/listview: Fix a test failure on 4.7x. - comctl32/listview: XP SP3 comctl32 V6 test workaround. - comctl32/listview: Test for parent sequence when creating with LVS_OWNERDRAWFIXED. - comctl32/listview: Notify parent with WM_MEASUREITEM on control creation. - comctl32/listview: Invalidate list after WM_MEASUREITEM notification. - comctl32/listview: Initialize string pointers on notification conversion routine. - comctl32/toolbar: Move initialization to WM_NCREATE handler. - comctl32/toolbar: Move parameter cast to WinProc level, some code cleanup. - comctl32/progress: Implement PBM_GETBARCOLOR, add some todo entries. - comctl32/progress: Implement PBM_GETBKCOLOR. - comctl32/rebar: Update Rebar structure. - comctl32/rebar: Use proper structure size in tests and parameter checks. - comctl32/listview: Improve hittesting a bit. - comctl32/header: Always release item down state on WM_LBUTTONUP. - comctl32/listview: Fix select rectangle calculation for empty text items. - comctl32/listview: Remove parent creation test. It's unrelated to ListView. - oleacc: Add ObjectFromLresult stub. - -Paul Chitescu (9): - winecfg: Fixed Romanian translation. - winecfg: Reordered controls in the About dialog so labels can have accelerators. - shell32: Completed Romanian translation, fixed minor typos. - clock: Romanian translation. - shell32: Add missing Romanian translation for IDS_SHLEXEC_NOASSOC. - avifil32: Romanian translation. - cryptdlg: Add Romanian translation. - crypt32: Add Romanian translation. - services.exe: When asked to search by display name skip NULL names. - -Paul Vriens (23): - urlmon/tests: Fix a test failure on Win95 by using more A-functions. - include/activscp.idl: Add some defines. - taskmgr: Fix Dutch translations. - crypt32/tests: Fix some tests (logical || with non-zero constant). - crypt32/tests: Fix a test (logical || with non-zero constant). - d3d9/tests: Use color_match ((logical || with non-zero constant). - user32/tests: Prevent some 'deadcode' (Coverity). - taskmgr: Update Dutch translations. - crypt32/tests: Fix a test failure on Win9x. - crypt32/tests: Fix some test failures on Win9x. - user32/tests: Prevent some 'deadcode' (Coverity). - comctl32/tests: Fix test failures on comctl32 < 5.80. - appwiz.cpl: Fix Dutch translations. - comctl32/tests: Fix some test failures with comctl32 < 5.80. - comctl32/tests: Fix test failures with comctl32 < 5.80. - kernel32: Update Dutch translations. - shell32: Fix Dutch translations. - taskmgr: Fix Dutch translations. - urlmon/tests: Don't check for out of memory (Coverity). - oleaut32/tests: Fix test failures and crash on Win9x/WinME. - ole32/tests: Fix some test failures on Win9x/WinME. - mlang/tests: Prevent messing up the codepages on Win98. - notepad: Add Dutch translations. - -Piotr Caban (20): - jscript: Added implementation of Date constructor with more then one argument. - jscript: Added Date_getTimezoneOffset and fixed Date_get... functions. - jscript: Fix typos in comments, add missing ones. - jscript: Fixed Date_setMilliseconds implementation. - jscript: Fix Date_setSeconds implementation. - jscript: Fix Date_setMinutes implementation. - jscript: Fix Date_setHours implementation. - jscript: Added Date_setDate and Date_setUTCDate implementation. - jscript: Added Date_setMonth and Date_setUTCMonth implementation. - jscript: Added Date_setFullYear and Date_setUTCFullYear implementation. - jscript: Added Date_toLocaleDateString implementation. - jscript: Added Date_toLocaleTimeString implementation. - jscript: Added Date_toTimeString implementation. - jscript: Added Date_toDateString implementation. - jscript: Added Date_toUTCString implementation. - jscript: Added Date_toLocaleString implementation. - jscript: Added Date_toString implementation. - jscript: Added stub implementation of Date constructor properties. - jscript: Added DateConstr_UTC implementation. - jscript: Fix strings allocation. - -Rein Klazes (5): - gdi32/tests: Show that there is an upper limit to the width of a font that can be specified. - comdlg32: Fix a problem with the returned value of a CDN_FILEOK notification. - comdlg32: Fix resizing of the file dialog browser that keeps returning to its original size. - comdlg32: Don't call ShowWindow for the custom dialog until all rearrangements of the file dialog have been done. - comdlg32/tests: fix a few test failures on Vista and higher. - -Stefan Dösinger (32): - wined3d: Invalidate the srgb tex in surface::unload. - d3d9: Add an aL indexing test. - d3d9: Add a SGN test. - wined3d: Reload the first 8 constants on a 1.x and != 1.x ps switch. - wined3d: Implement MRTs in ARB. - wined3d: XXXC CC doesn't work even with NV_FP2 on. - wined3d: Make the ARB index offset work with emulated MOVA. - wined3d: Enable Shader Model 2.0 in ARB. - wined3d: Advertise SM 3.0 in ARB if the extensions are available. - wined3d: GLSL 1.20 includes gl_FragData[] syntax. - wined3d: Don't emulate clipplanes with ffp vp and fix a wrong if condition. - wined3d: Add a function to control use of NV_vp2 clipplanes. - wined3d: Find the clip texcoord before compiling. - wined3d: Use a local parameter for the position fixup. - wined3d: Fix pixelshader ifc. - winebuild: Open resource files in binary mode. - wined3d: Beware of double negations. - wined3d: IFC requires GL_NV_fragment_program2. - wined3d: POW and LOG operate on the absolute value. - wined3d: Unclamp vertex colors for 3.0 shaders in ARB if needed. - wined3d: Initialize the used clip planes even if no clip emulation is used. - wined3d: Support writemasks on texkill in ARB. - wined3d: Jump to the else branch if cond is false, not endif. - wined3d: Honor WINED3DSPSM_NOT in ARB. - wined3d: Only update the screen when the frontbuffer was changed. - wined3d: Don't disable ARBfp if the replacement pipeline is used. - wined3d: ARB*p is already on after a depth blit. - wined3d: Implement function calls with NV exts. - wined3d: Write the vshader footer in a separate function. - wined3d: Add the vertex shader footer in the main function. - wined3d: Add a NOP ret handler to GLSL. - wined3d: Don't dirtify too many shader constants. - -Stefan Leichter (1): - oleaut32: Add two tests of function VarDateFromStr for German date format. - -Tobias Jakobi (10): - wined3d: Add ps_np2fixup_info structure. - wined3d: Enable constant packing for NP2 texcoord fixup. - wined3d: Force NP2 fixup constant reloading in shader_glsl_select. - wined3d: Add ps_arb_max_local_constants. - wined3d: Add arb_ps_np2fixup_info structure and improve structure packing for arb_ps_compiled_shader. - wined3d: Add NP2 fixup code to shader_arb_generate_pshader. - wined3d: Add NP2 fixup code to shader_hw_sample (ARB). - wined3d: Implement shader_arb_load_np2fixup_constants. - wined3d: Force NP2 constant reload in shader_arb_select. - wined3d: Fix comments about NP2 fixup. - -Tony Wasserka (16): - d3dx9: Improve parameter validation in D3DXCreateFont and D3DXCreateFontIndirect. - d3dx9: Implement ID3DXFont_GetDevice. - d3dx9: Implement ID3DXFont_GetDesc. - d3dx9: Implement ID3DXFont_GetDC. - d3dx9: Implement ID3DXFont_GetTextMetrics. - d3dx9: Add tests for basic ID3DXFont functions. - d3dx9: Add a stub for D3DXLoadSurfaceFromFileInMemory. - d3dx9: Implement D3DXLoadSurfaceFromFile. - d3dx9: Implement D3DXLoadSurfaceFromResource. - d3dx9: Add a stub for D3DXLoadSurfaceFromMemory. - d3dx9: Implement D3DXLoadSurfaceFromSurface. - d3dx9: Add tests for D3DXLoadSurfaceFromFile. - d3dx9: Add tests for D3DXLoadSurfaceFromResource. - d3dx9: Add tests for D3DXLoadSurfaceFromFileInMemory. - d3dx9: Add tests for D3DXLoadSurfaceFromMemory. - d3dx9: Add tests for D3DXLoadSurfaceFromSurface. - -Vincent Povirk (26): - ole32: Add support for rendering HENHMETAFILE clipboard objects. - winex11.drv: Link the windows PNG format to the X image/png format. - winex11.drv: Link the windows JFIF format to the X image/jpeg format. - windowscodecs: Add stub implementation of IWICImagingFactory. - windowscodecs: Add a stub decoder for the BMP format. - include: Add some definitions to wincodec.idl. - windowscodecs: Implement trivial methods for BMP decoder. - windowscodecs: Implement Initialize method for BMP decoder. - windowscodecs: Implement GetFrame for BMP decoder. - windowscodecs: Implement GetSize for BMP decoder. - windowscodecs: Implement GetResolution for BMP decoder. - windowscodecs: Add test for BMP decoder. - gdiplus: Implement horizontal alignment in GdipDrawString. - gdiplus: Don't crash when a NULL format is passed to GdipDrawString. - include: Define some WIC pixel format GUIDs. - windowscodecs: Implement GetPixelFormat for BMP decoder. - windowscodecs: Simplify the BMP GetSize code and fix for top-down dibs. - windowscodecs: Implement CopyPixels for BMP decoder. - windowscodecs: Implement QueryCapability for BMP decoder. - include: Add definitions for IWICPalette. - windowscodecs: Add stub implementation of IWICPalette. - windowscodecs: Implement InitializeCustom and GetColors for palettes. - windowscodecs: Implement GetColorCount and GetType for palettes. - windowscodecs: Implement IsBlackWhite and IsGrayscale for palettes. - windowscodecs: Implement HasAlpha for palettes. - windowscodecs: Add test for IWICPalette. - -Vitaliy Margolen (2): - dxdiagn: Add fil_data.idl to describe IAMFilterData interface. - dxdiagn: Use quartz's IFilterMapper to get DirectShow filter information instead of looking through private structures. - -Vladimir Pankratov (1): - shell32: Fix RunFileDialog to close after starting apps. - --- -Alexandre Julliard -julliard@winehq.org +The Wine development release 1.1.26 is now available. + +What's new in this release (see below for details): + - Still more translation updates. + - Faster bitmap stretching using XRender. + - Proxy support in WinHTTP. + - Many more JScript functions. + - Various bug fixes. + +The source is available from the following locations: + + http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.26.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.1.26.tar.bz2 + +Binary packages for various distributions will be available from: + + http://www.winehq.org/site/download + +You will find documentation on http://www.winehq.org/site/documentation + +You can also get the current source directly from the git +repository. Check http://www.winehq.org/site/git for details. + +Wine is available thanks to the work of many people. See the file +AUTHORS in the distribution for the complete list. + +---------------------------------------------------------------- + +Bugs fixed in 1.1.26: + + 758 Menu/combo-box-functionality in managed mode. + 4277 GetPixel() returns wrong value for monochrome bitmaps + 5034 Wrong size of commdlg OpenFile dialog in radvideo.exe + 8290 Lotus Notes 6.5 demo fails to install + 9036 Adobe Photoshop Elements 1.0 fails to install, says IE4 is required + 9599 Caesar3 hackled sound + 9614 scroll wheel causes farcry crash. + 10394 No$gba Open file dialog non-resizable (OFN_ENABLESIZING not implemented) + 11015 Save games not ordered properly. + 11520 resident evil 4: the black,the white and the glitch + 12080 Portal 1.0: Graphics go haywire when first portal opens + 12101 SpellForce: The Order Of Dawn - Graphical bug + 12259 CoWaitForMultipleHandles Unexpected wait termination + 12600 Adobe Acrobat Pro 6 -- File Open should default to a more logical location + 12807 Team Fortress 2 crashes after running for several minutes at 1680x1050 + 12906 MyScript Notes 2.2 : Crashes on program startup after clicking "continue trial" + 13525 Word 2003: Copy/Paste Textbox converts to picture + 13575 iTunes does not start on x64 computers + 13689 Word 2003: Last opened files appear incorrectly in File menu + 13926 Dune 2000 crashes after starting a mission + 13958 Services: handle null display names properly when populating SCM db entries + 14259 Wordview hang when open Doc file with picture + 14300 winhelp: Wrong initial view position in pages + 14404 Diablo LOD/Starcraft, no sound with ALSA + 14500 Supreme Commander: Input field too narrow to enter the CD key + 14878 Some places of Far Cry game world covered by one color + 15461 Security zones are not displayed in inetcpl.cpl (ZoneMgr_CreateZoneEnumerator, _GetZoneAt, _GetZoneAttributes) + 15631 Dragon NaturallySpeaking 10 crashes after opening Accuracy Center + 15789 Icewind Dale 2 : very low framerate + 15844 Weird Dutch translation for Program files folder + 15958 "make test" hangs in winmm/wave.c in wave_out_test_device + 16454 emule crashs after an undefined time + 16682 Messed up fonts in Civilization 4 + 16767 Azgard Defence: game too slow + 16770 MSN Messenger 7.0: Chat window get the focus incorrectly + 17240 Full Tilt poker crashing + 17283 Steam crashes by logging in into the Steam Community with Gecko + 17604 The PlayOnline viewer fails to start after the initial update. + 17802 RegiStax 5 crashes at the end of stacking process + 18021 When starting The Lord of the Ring Online in additional X session, there is no sound. + 18419 Condemned: Criminal Origins: Camera images sometimes appear upside down + 18649 The Sims 3 crashes for no specific reason after a while + 18709 Breakout crashes:System.OverflowException: Value was either too large or too small for a Decimal + 18901 WoW crashes on exit when running in D3D + 19005 SimCity 4 crashes on start + 19047 Assertion failure at listview.c:2741 + 19049 Motocross Madness 2 on MacOSX: crash with fbo + 19072 Reg.exe doesn't respect help commands (appinstall) + 19143 Anarchy Online corrupted graphics + 19157 CoGetContextToken and CoGetObjectContext need to take existing MTA into account + 19169 Albumplayer closes with an abnormal program termination + 19211 netconn_set_timeout() is unused in winhttp + 19216 winecfg - Wine version lost + 19220 Firefox 3.5 crashes because of stub in t2embed + 19225 notepad: launching with a non-existent file does not have 'cancel' option (appinstall) + 19246 winemenubuilder.exe error + 19327 LiveZilla 3.1.8.1 installer fails to complete + 19338 ResHacker - only small part of treeview is visible + +---------------------------------------------------------------- + +Changes since 1.1.25: + +Alexander Nicolaysen Sørnes (4): + reg: Update Norwegian Bokmål translation. + notepad: Update Norwegian Bokmål translation. + crypt32: Update Norwegian Bokmål translation. + taskmgr: Update Norwegian Bokmål translation. + +Alexander Scott-Johns (3): + notepad: Refactor DoOpenFile to simplify next patch. + notepad: When opening a file, replace \0 characters with spaces, instead of truncating the file at the first \0. + notepad: Add Cancel button to message box displayed when opening a non-existent file with the command line. + +Alexandre Julliard (38): + winetest: Build exe resources as separate .res files. + loader: Get rid of the pthread support routines. + include: Get rid of the no longer used wine/pthread.h. + ntdll: Add management of the Wow64 filesystem redirection flag. + kernel32: Forward the Wow64 redirection functions to ntdll. + winetest: Load resources by name instead of id. + server: Return the process CPU in the get_process_info request. + ntdll: Support querying the Wow64 state of other processes. + kernel32: Add implementation of GetSystemWow64DirectoryA/W. + shell32: Add support for the CSIDL_SYSTEMX86 folder. + shell32/tests: Revive the test for CSIDL_SYSTEMX86. + kernel32/tests: Avoid using non-ASCII characters in strings. + configure: Apply makedep flags when doing automatic dependencies. + winebuild: Dump resource data as dwords to reduce the output file size. + winetest: Create a separate resource file with the SHA1 build id. + ws2_32: Check buffers before recvmsg() to trigger write watches. + ntdll: Display write watch status in virtual traces. + taskmgr: Convert the language-neutral resource file to UTF-8. + avifil32: Convert the language-neutral resource file to UTF-8. + msdmo: Convert the language-neutral resource file to UTF-8. + mswsock: Convert the language-neutral resource file to UTF-8. + Remove some obsolete README files. + ntdll: Add support for the MEM_RESET flag in VirtualAlloc, with tests. + kernel32: Explicitly specify the codepage in message files. + wmc: Add support for utf-8 codepage. + dbghelp: Grow all arrays by doubling the size. + oleaut32/tests: Fix the usrmarshal tests on 64-bit. + oleaut32: Fix safe array marshalling on 64-bit. + ddraw/tests: Fix a few tests that fail on Win64. + widl: Take into account the alignment of conformant arrays to pad a structure. + ddraw/tests: Fix a failing test on 64-bit. + ddraw/tests: Properly release surfaces even if we can't get the texture object. + msvcrt: Add an errno mapping for ERROR_SHARING_VIOLATION. + msi: Build a proper tab chain by walking through the controls list. + wrc: Avoid a crash if a file didn't contain any resources. + wrc: Report an error when encountering non-ASCII characters. + uuid: Include some more headers. + Updated the authors list. + +Anders Jonsson (4): + notepad: Update Swedish translation. + winedbg: Add Swedish translation. + winemine: Add ellipses for menu entries that open new dialog windows. + winemine: Add Swedish translation. + +Andrew Eikum (4): + gdiplus: Implement GdipBeginContainer2 and GdipEndContainer. + gdiplus/tests: Test cases for GdipBeginContainer2. + gdiplus: Don't modify container list if container restoration fails. + gdiplus: Implement GdipSaveGraphics and GdipRestoreGraphics. + +Andrew Nguyen (3): + server: Remap the EROFS errno value to STATUS_ACCESS_DENIED. + kernel32: Implement WTSGetActiveConsoleSessionId as a stub. + t2embed: Implement TTLoadEmbeddedFont as a stub. + +Andrew Talbot (3): + dbghelp: Constify some variables. + dbghelp: Constify some variables. + dbghelp: Constify some variables. + +André Hentschel (8): + crypt32: Update German translation. + winecfg: Improve German About dialog. + cmd: Fix German translation. + cmd: Update German translation. + appwiz.cpl: Correct German language. + shell32: Correct German language. + appwiz.cpl: Fix German translation. + winecfg: Add the codepage pragma for German translation. + +Aric Stewart (13): + shlwapi: Forward UrlCrackW to wininet.InternetCrackUrlW. + msctf: Correct return value from GetValue. + msctf: Add definition for IEnumTfDocumentMgrs. + msctf: Add code to track created ITfDocumentMgrs. + msctf: Implement ITfThreadMgr::EnumDocumentMgrs. + msctf/tests: Test EnumDocumentMgrs. + taskmgr: Update Japanese resource. + sane: Add Japanese resource. + msvidc32: Add Japanese resource. + iccvid: Add Japanese resource. + devenum: Add Japanese resource. + sane: Remove BOM from Japanese resource. + gdi32: In init_system_links, reinitialize val_len and data_len before continuing. + +Aurimas Fišeras (7): + crypt32: Add "Disallowed" to CryptFindLocalizedName. + Various spelling fixes for Lithuanian translation. + cryptui: Add Lithuanian translation. + crypt32: Add Lithuanian translation. + cryptdlg: Translate "CPS" (Certification Practice Statement) to Lithuanian and add a comment to English resource. + kernel32/nls: Add Lithuanian winerr translation. + appwiz.cpl: Update Lithuanian translation. + +Austin English (4): + notepad: Fix English resource line breaks. + hal: Add stub for KeGetCurrentIrql. + shell32: Fix folder names for Dutch locale. + shell32: More Dutch translations fixes. + +Damjan Jovanovic (3): + ws2_32: Add some AcceptEx tests. + ws2_32: Test AcceptEx short reads. + ws2_32: Test AcceptEx early disconnects and invalid parameters. + +Dan Kegel (1): + winmm: Don't convert return string in mciSendStringA on error. + +Daniel Nylander (1): + appwiz.cpl: Add Swedish translation. + +David Adam (18): + d3dx9_36: Fix tests to make them pass in Windows. + d3dx9_36: Fix the sprite tests to make them pass in Windows. + d3dx9: Fix the prototype of some functions. + d3dx9: Add d3dx9.h in dxguid. + d3dx9: Merge d3dx8 core into d3dx9. + d3dx9: Merge d3dx8 mesh into d3dx9. + d3dx9: Merge d3dx8 mesh tests into d3dx9. + d3dx9: Merge d3dx8 math into d3dx9. + d3dx9: Clean-up the spec file. + d3dx9: Merge d3dx8 math tests into d3dx9. + d3dx9: Remove the useless d3dx8 import. + dxguid: Remove the useless d3dx8 include. + d3dx8: Remove the d3dx8 dll. + include: Remove useless headers. + d3dx9: Fix D3DXQuaternionToAxisAngle to make tests pass in Windows. + d3dx9: Remove a failing test in Windows. + d3dx9: Fix D3DXQuaternionInverse to make tests pass in Windows. + d3dx9: Fix D3DXQuaternionNormalize to make tests pass in Windows. + +Detlef Riekenberg (5): + include: Add IInternetZoneManagerEx2 interface for IE7. + urlmon: Partial InternetZoneManagerEx2 implementation. + urlmon/tests: Add tests for CoInternetCreateZoneManager. + urlmon/tests: Windows headers need _WIN32_IE for IInternetZoneManagerEx2. + winemine: Add ellipses for IDM_CUSTOM. + +Dmitry Timoshkov (3): + user32: Fix some BM_SETSTYLE test failres under Win9x. + comctl32: Do not redraw treeview in TVM_INSERTITEM handler if bRedraw is not set, trigger the redraw on WM_SETREDRAW/TRUE. + comctl32: Explicitly initialize visible order of a newly added item, force visible order recalculation on redraw. + +Dylan Smith (6): + richedit: Support ascii RTF in WM_SETTEXT even for unicode messages. + richedit: Add more tests for WM_SETTEXT RTF support. + richedit: Prevent autoscrolling without ES_AUTO[VH]SCROLL style. + richedit: Initially disable scrollbars for ES_DISABLENOSCROLL. + richedit: Keep scrollbars hidden without WS_HSCROLL & WS_VSCROLL. + richedit: Handle missing colours in rtf colour table. + +Eric Pouech (2): + winedbg: 'Int XX' is not a function call, so don't try to handle it as such on i386. + dbghelp: Fixed regressions introduced by growing arrays exponentially instead of linearly. + +Erik Inge Bolsø (1): + wined3d: Fix Nvidia GTX series misdetection. + +Francois Gouget (10): + winapi: Simplify and improve the readability of the C parsers. + ole32: Reorder some compobj functions to avoid forward declarations. + ole32: Make apartment_addref() static. + notepad: Remove spaces before '\n's. + winefile: Remove space before ellipsis. + urlmon/tests: Fix two ok() trailing '\n's. + winapi: Introduce a pseudo-loop in parse_c_variable() to get rid of the $finished variable. + winapi: Modify parse_c_typedef() to get rid of the $finished variable. + winapi/c_parser: Badly indenting a closing brace should be a warning, not an error. + winapi/c_parser: Remove special cases for DEFINE_SHLGUID() and ICOM_DEFINE(). + +Frédéric Delanoy (54): + oleacc: Update French translation. + user32: Update French translation. + winmm: Fix French translation. + cmd: Fix French translation. + notepad: Update French translation. + oleview: Fix French translation. + regedit: Fix French translation & UI display. + taskmgr: Update French translation; display fixes. + uninstaller: Fix French translation. + winecfg: Fix French translation & UI display. + wineconsole: Fix French translation & UI display. + winhlp32: Fix French translation. + notepad: Update French translation. + winefile: Fix French translation & UI display. + wordpad: Fix French translation & UI display. + xcopy: Fix French translation. + wininet: Fix French translation & UI display. + crypt32: Update French translation. + serialui: Fix French translation & UI display. + avifil32: Fix French translation. + iccvid: Fix French translation. + oledlg: Fix French translation & UI display. + wineps.drv: Fix French translation & UI display. + setupapi: Fix French translation & UI display. + shlwapi: Fix French translation. + msrle32: Fix French translation. + appwiz.cpl: Fix French translation & UI display. + msacm32: Fix French translation & UI display. + wldap32: Fix French translation. + comdlg32: Fix French translation & UI display. + comctl32: Fix French translation & UI display. + mpr: Fix French translation. + winspool.drv: Convert French resources to UTF-8. + mshtml: Convert French resources to UTF-8. + taskmgr: Fix typo in French translation. + shdoclc: Fix French translation & UI display. + msvfw32: Fix French UI display. + msvidc32: Convert French resources to UTF-8. + progman: Fix French translation & UI display. + winemine: Fix French translation & UI display. + view: Convert French resources to UTF-8. + comdlg32: Fix left-right margins inversion in French page setup UI. + comdlgtst: Fix French translation & UI display. + reg: Fix French translation. + clock: Convert French resources to UTF-8. + shell32: Fix French translation & UI display. + cryptdlg: Update French translation. + cryptui: Fix UI display. + cryptui: Fix French translation & UI display. + kernel32: Convert French resources to UTF-8. + kernel32: Convert German error msgs resources to UTF-8. + kernel32: Fix typos in English errors messages. + appwiz.cpl: Fix French UI display and wording. + kernel32: Update French translation of error messages. + +Hans Leidekker (10): + iphlpapi: Use a separate index to count addresses in GetAdaptersAddresses. + winhttp: Implement WinHttpSetTimeouts. + include: Add IWbemStatusCodeText and IWbemLocator interfaces. + wbemprox: Add a stub implementation of IWbemLocator. + wbemprox: Add class factory. + wbemprox: Register interfaces. + wmiutils: New dll. + wmiutils: Add a stub implementation of IWbemStatusCodeText. + wmiutils: Add class factory. + wmiutils: Register interfaces. + +Henri Verbeet (45): + wined3d: Get rid of the redundant "return_value" variable. + winedd3d: Get rid of a useless trace. + wined3d: Get rid of the unused gl_version and glx_version fields. + wined3d: Remove the gl_renderer field from WineD3D_GL_Info. + wined3d: Avoid a forward declaration. + wined3d: Avoid an unnecessary strcpy(). + wined3d: Add some missing float suffixes. + wined3d: checkGLcall() doesn't need a \n. + wined3d: Get rid of some pointers in WINED3DADAPTER_IDENTIFIER. + wined3d: Replace some shader_is_pshader_version() calls with plain type checks. + wined3d: Implement a A8R8G8B8 to X8R8G8B8 surface format converter. + wined3d: Avoid destroying the currently active context for non-implicit swapchains. + wined3d: Trace the D3D shader in find_glsl_vshader() / find_glsl_pshader(). + wined3d: Fix a sign compare warning in glsl_shader.c. + wined3d: Fix a sign compare warning in shader_vaddline(). + wined3d: Reuse the shader buffer between shaders. + wined3d: Rename "SHADER_BUFFER" to something sane. + wined3d: Allow shader_buffer_init() to fail. + wined3d: Get rid of the useless "fragcolor" variable in shader_glsl_generate_pshader(). + wined3d: Fix some cast-qual warnings. + wined3d: Simplify the GLSL sRGB write code. + wined3d: Remove GetGlDesc() from the public IWineD3DSurface interface. + wined3d: Get rid of struct glDescriptor. + wined3d: Take geometry shaders into account in shader_glsl_load_constantsB(). + d3d9/tests: Use color_match() in a few more places. + d3d10: Add the ID3D10EffectMatrixVariable interface. + d3d10: Parse local buffers. + d3d10: Parse local buffer names. + d3d10: Merge parse_fx10_technique() and parse_fx10_technique_index(). + d3d10: Marge parse_fx10_pass() and parse_fx10_pass_index(). + wined3d: Remove the remains of an ATI_fragment_shader hack. + wined3d: Check the return values for some wgl calls. + d3d10: Do all effect object parsing in parse_fx10_object(). + d3d10: Parse effect variables. + d3d10: Implement ID3D10Effect::GetVariableByName(). + wined3d: Recognize SM4 arrays. + wined3d: Recognize the SM4 constant buffer register type. + wined3d: Recognize the SM4 rsq opcode. + wined3d: Recognize the SM4 dp3 opcode. + wined3d: Recognize the SM4 dp4 opcode. + wined3d: Rename _WineD3D_GL_Info to struct wined3d_gl_info. + wined3d: Store a pointer to wined3d_gl_info in struct WineD3DContext. + wined3d: Pass the context instead of the device to the various context functions. + wined3d: Always use context_bind_fbo() to change the framebuffer binding. + wined3d: Avoid redundant FBO binds. + +Hib Eris (4): + msi/tests: Add tests for MsiViewModify ASSIGN mode. + msi: Implement ASSIGN mode in MsiViewModify. + oleaut32/tests: Add tests for VarDecCmp. + oleaut32: Prevent overflow in VarDecCmp. + +Huw Davies (11): + gdi32: Use a modified version of MulDiv to match native behaviour. + winhlp32: Add English neutral translations. + wineconsole: Add English neutral translations. + winecfg: Add English neutral translations. + hhctrl.ocx: Add English neutral translations. + regedit: Update English neutral translations. + shdoclc: Add English neutral translations and fix US English. + gdi32/tests: Don't continue with the tests if GetWinMetaFileBits fails. + wordpad: Add English neutral translations. + gdi32/tests: Allow a small tolerance when comparing scaling values. + gdi32/tests: Add a broken case for some versions of winxp. + +Hwang YunSong (4): + crypt32: Updated Korean resource. + cryptdlg: Updated Korean resource. + cryptui: Updated Korean resource. + notepad: Updated Korean resource. + +Jacek Caban (17): + mshtml: Don't call AutoRegister on GRE directory - it's no longer needed. + urlmon: Ignore QueryInterface call for an undocumented interface. + urlmon: Moved more initialization code to init_test. + mshtml: Added support for VT_UINT name in IHTMLElementCollection::item. + wininet: Rename WININETHANDLEHEADER to object_header_t. + wininet: Rename WININETHTTPSESSIONW to http_session_t. + wininet: Rename WININETHTTPREQW to http_request_t. + wininet: Rename WININETAPPINFOW to appinfo_t. + wininet: Rename WININETFTPSESSIONW to ftp_session_t. + wininet: Rename WININETFTPFILEW to ftp_file_t. + include: Added netcon.idl. + wininet: Rename WININET_strdupW to standard heap_strdupW. + wininet: Rename WININET_strdup_AtoW to heap_strdupAtoW and handle NULL argument in its implementation. + wininet: Rename WININET_strdup_WtoA to heap_strdupWtoA. + wininet: Code clean up by using heap_strdup* functions. + wininet: Code clean up by using heap_strdup* functions. + include: Added ntddndis.h. + +Jeff Latimer (2): + ws2_32/tests: IPv6 tests for WSAAddressToStringW. + ws2_32: IPv6 functionality for WSAAddressToStringW. + +Joel Holdsworth (1): + gdi32/tests: Added tests for BitBlt. + +Juan Lang (34): + cryptui: Increase control width to support larger fonts. + winhttp: Change type of netconn_resolve from struct sockaddr_in * to struct sockaddr *. + winhttp: Simplify netconn_resolve when using getaddrinfo. + winhttp: Convert connect_t's address type from a struct sockaddr_in to a struct sockaddr_storage. + winhttp: Support IPv6 addresses in open_connection. + winhttp: Support IPv6 in netconn_resolve. + wininet: Fix tests when running behind a proxy server. + wininet: Change type of GetAddress from struct sockaddr_in * to struct sockaddr *. + wininet: Simplify GetAddress when using getaddrinfo. + wininet: Use struct sockaddr_storage in InternetCheckConnectionW. + wininet: Use length reported by GetAddress in FTP_Connect. + wininet: Use sizeof(member) rather than sizeof(type) for address lengths. + wininet: Use address length returned by GetAddress in NETCON_connect. + wininet: Convert WININETSESSIONW's socketAddress to a struct sockaddr_storage. + wininet: Support IPv6 addresses in HTTP_ResolveName and HTTP_OpenConnection. + wininet: Fail in FTP if the resolved name is not an IPv4 address. + wininet: Support IPv6 in GetAddress. + winhttp: Add tests for WinHttpSetDefaultProxyConfiguration. + winhttp: Implement WinHttpSetDefaultProxyConfiguration. + winhttp: Implement WinHttpGetDefaultProxyConfiguration. + winhttp: Support getting the default proxy settings from the http_proxy environment variable. + winhttp: Honor WINHTTP_ACCESS_TYPE_DEFAULT_PROXY in WinHttpOpen. + winhttp: Set connect_t's servername and port based on proxy settings. + winhttp: When connecting via a proxy include full hostname and scheme in path. + winhttp: Connect to the proxy port rather than the host port. + winhttp: Use a helper function to set connect_t's servername and port. + winhttp: Use proxy server when redirecting. + winhttp: Allow full path in addition to relative path in headers to accomodate proxy servers. + winhttp: Don't set port number to a default before scheme is known. + winhttp: Issue CONNECT command to connect to a secure server through a proxy server. + winhttp: Fix a comment typo. + winhttp: Use the correct address length when connecting. + ws2_32: Remove an unnecessary cast. + ws2_32: Make sure sockaddr is big enough when formatting an IPv6 address. + +Maarten Lankhorst (1): + winealsa.drv: Add support for indirect read/write in directsound support. + +Michael Stefaniuc (42): + winecfg: Fix regression introduced by 807d75a94e378d05. + oleacc: Add missing encoding info to the German resource file. + cryptdlg: Add missing encoding info to the German resource file. + shdoclc: Convert the German resources to UTF-8. + cmd: Convert the German resources to UTF-8. + view: Convert the German resources to UTF-8. + wineps.drv: Convert the German resources to UTF-8. + winspool.drv: Convert the German resources to UTF-8. + uninstaller: Convert the German resources to UTF-8. + msrle32: Convert the German resources to UTF-8. + wineboot: Convert the German resources to UTF-8. + serialui: Convert the German resources to UTF-8. + avifil32: Convert the German resources to UTF-8. + msvfw32: Convert the German resources to UTF-8. + hhctrl.ocx: Convert the German resources to UTF-8. + credui: Convert the German resources to UTF-8. + gphoto2.ds: Convert the German resources to UTF-8. + winhlp32: Convert the German resources to UTF-8. + winemine: Convert the German resources to UTF-8. + localui: Convert the German resources to UTF-8. + start: Convert the German resources to UTF-8. + clock: Convert the German resources to UTF-8. + comctl32: Convert the German resources to UTF-8. + xcopy: Convert the German resources to UTF-8. + wldap32: Convert the German resources to UTF-8. + cmdlgtst: Convert the German resources to UTF-8. + notepad: Convert the German resources to UTF-8. + oleview: Convert the German resources to UTF-8. + progman: Convert the German resources to UTF-8. + wineconsole: Convert the German resources to UTF-8. + oledlg: Convert the German resources to UTF-8. + winefile: Convert the German resources to UTF-8. + comdlg32: Convert the German resources to UTF-8. + winmm: Convert the German resources to UTF-8. + wrc: Reset the language before processing multiple rc files. + winecfg: Convert the German resources to UTF-8. + user32: Update the German resources and switch them to UTF-8. + shell32: Convert the German resources to UTF-8. + taskmgr: Convert the German resources to UTF-8. + Set the encoding of the remaining German resources to UTF-8. + Set the encoding of the Romanian resources to UTF-8. + wordpad: Change some string resource ids to logically group the strings in separate STRINGTABLEs. + +Mike Kaplinskiy (1): + ws2/tests: Test AcceptEx with a deferred socket. + +Nikolay Sivov (15): + comctl32/listview: Basic LVM_GETITEMSPACING tests. + user32/spy: Update ListView message table. + comctl32/listview: Fix some test failures on 4.7x. + comctl32/listview: More LVM_*HITTEST tests. + comctl32/listview: Fix hittesting for "small" positive Y coordinates. + comctl32/listview: Fix hittest flag calculation for negative Y values on report mode. + comctl32/listview: A basic test for column width default value. + comctl32/listview: Basic LVN_(BEGIN|END)SCROLL tests. + comctl32/listview: Fix selection and focus rectangles on reordered list (report mode). + comctl32/header: Test item rectangles updating after reordering. + comctl32/header: Always update rectangles after HDM_SETORDERARRAY. + comctl32/header: Use macro to define LPARAM value. + comctl32/header: Update item bounds on WM_SIZE. + comctl32/header: Fix hittesting flags, extend tests a bit. + comctl32/dpa: Don't use start index on searching sorted array. + +Owen Rudge (4): + appwiz.cpl: Replace Add/Remove button with separate Modify and Remove buttons. + appwiz.cpl: Read modification path from registry. + appwiz.cpl: Enable/disable Modify button, and modify title on Remove button, as appropriate. + appwiz.cpl: Execute installer when Modify clicked. + +Paul Chitescu (1): + crypt32: Updated Romanian translation. + +Paul Vriens (16): + gdi32/tests: Mark an intermittent failure as broken() on Win9x/ME. + d3d9/tests: Skip a test on failure. + ole32/tests: Reset a variable before testing. + comdlg32: Fixed size of Dutch control. + cryptui: Fix Dutch translations. + crypt32: Make sure we show Unicode characters (Dutch translation). + cryptui: Show the select store text when browsing stores. + crypt32: Improve an English resource. + crypt32: Fix Dutch translations. + shell32: Add missing encoding for Dutch resources. + winhlp32: Improve Dutch translations and convert to UTF8. + ws2_32/tests: Fix a test failure on NT4. + comctl32/tests: Fix test failures with comctl32 <= 5.80. + appwiz.cpl: Fix Dutch translations. + winedbg: Remove an unneeded pragma from the Swedish translation. + winhttp: Fix a crash on Vista and higher. + +Peter Oberndorfer (1): + winemenubuilder: Use heap_printf to allocate the right amount of memory and not cause heap corruption. + +Piotr Caban (46): + jscript: Added DateConstr_parse implementation. + jscript: Added string argument handling to Date constructor. + jscript: Added calling Date as function implementation. + jscript: Fix do while loop parsing. + jscript: Added Date_valueOf implementation. + jscript: Added Boolean constructor implementation. + jscript: Added Bool_toString implementation. + jscript: Added Bool_valueOf implementation. + jscript: Added Bool_toLocaleString implementation. + jscript: Fixed to_boolean implementation. + jscript: Fix DateConstr_parse implementation. + jscript: Inherit Array valueOf from Object. + jscript: Added Object_valueOf implementation. + jscript: Added Object_toString and Object_toLocaleString implementation. + jscript: Added Function_valueOf implementation. + jscript: Changed to_primitive implementation. + jscript: Added String_fontcolor implementation. + jscript: Added String_fontsize implementation. + jscript: Added String_anchor implementation. + jscript: Added String_link implementation. + jscript: Change do_attributeless_tag_format so it works on non string objects. + jscript: Make do_attribute_tag_format generic. + jscript: Make String_charAt generic. + jscript: Make String_charCodeAt generic. + jscript: Make String_indexOf generic. + jscript: Make String_match generic. + jscript: Make String_replace generic. + jscript: Make String_slice generic. + jscript: Make String_split generic. + jscript: Make String_substring generic. + jscript: Make String_toLowerCase generic. + jscript: Make String_toUpperCase generic. + jscript: Fix String_match implementation. + jscript: Inherit Function_valueOf from Object. + jscript: Added Array length setting implementation. + jscript: Added implementation of Array constructor called as a function. + jscript: Added call_expression_eval implementation for EXPRVAL_VARIANT values. + jscript: Added Array_slice implementation. + jscript: Added String_fromCharCode implementation. + jscript: Added Date_getYear implementation. + jscript: Improve to_string implementation. + jscript: Improve Number_toString implementation. + jscript: Added RegExp_test stub. + jscript: Improve Object_toString implementation. + jscript: Remove broken tests. + jscript: Fix create_exec_ctx implementation. + +Rein Klazes (5): + comdlg32: Rearrange some more controls when resizing a file dialog. + comdlg32: Fix a problem with resizing a customized file dialog. + comdlg32: Memorize and restore the size of the file dialog between calls. + comdlg32/tests: Remove file dialog resize tests that rely on CDN_SELCHANGE notifications. + user32/tests: Show that Windows avoids creating loops in a menu tree, probably by limiting the depth of such tree. + +Ricardo Filipe (27): + comdlg32: Update Portuguese translation and convert to UTF8. + oledlg: Update Portuguese translation and convert to UTF8. + notepad: Update Portuguese translation and convert to UTF8. + cmdlgtst: Update Portuguese translation and convert to UTF8. + setupapi: Update Portuguese translation and convert to UTF8. + shell32: Update Portuguese translation and convert to UTF8. + user32: Update Portuguese translation and convert to UTF8. + clock: Update Portuguese translation and convert to UTF8. + mpr: Update Portuguese translation and convert to UTF8. + comctl32: Update Portuguese translation and convert to UTF8. + oledlg: Fix Portuguese translation. + progman: Update Portuguese translation and convert to UTF8. + regedit: Update Portuguese translation and convert to UTF8. + winecfg: Update Portuguese translation and convert to UTF8. + wineconsole: Update Portuguese translation and convert to UTF8. + winefile: Update Portuguese translation and convert to UTF8. + crypt32: Update Portuguese translation and convert to UTF8. + reg: Update Portuguese translation and convert to UTF8. + taskmgr: Update Portuguese translation and convert to UTF8. + gphoto2.ds: Fix Portuguese translation and convert to UTF8. + mshtml: Update Portuguese translation and convert to UTF8. + shdoclc: Fix Portuguese translation and convert to UTF8. + appwiz.cpl: Update Portuguese translation and convert to UTF8. + winefile: Fix Portuguese translation. + wordpad: Update Portuguese translation and convert to UTF8. + cryptdlg: Add Portuguese translation. + devenum: Update Portuguese translation. + +Rico Schüller (1): + d3d10: Rename struct d3d10_effect_variable to struct d3d10_effect_object. + +Roderick Colenbrander (8): + winex11: Get rid of the static Xrender picture format table. + winex11: Move AlphaBlend over to get_xrender_format. + winex11: Move glyph code over to get_xrender_format. + winex11: Get rid of depth conversion fixme. + winex11: Add a helper function for converting a random color to a XRenderColor. + winex11: Add an XRender based GetSrcAreaStretch. + winex11: Use set_xrender_transformation in AlphaBlend. + winex11: Add a function for retrieving the bitmap GC. + +Stefan Dösinger (10): + wined3d: An indirect address op can adjust min and max at the same time. + wined3d: Add Intel GMA X3100 to our card DB. + wined3d: Update Nvidia driver versions. + wined3d: Only use 4 component specular colors if GL allows it. + wined3d: Drop the color0 mov optimization if the src is overwritten. + wined3d: Check the correct constant limit. + wined3d: EXP and EXPP are scalar operations. + wined3d: Set the depth blit helper texture address mode to clamp. + wined3d: Don't call glGetError if nobody is listening. + wined3d: Use the unmodified source in MOVA. + +Vincent Povirk (15): + windowscodecs: Implement CopyPalette for BMP decoder. + windowscodecs: Add test for 1-bit indexed color BMP. + windowscodecs: Add test for 4-bit indexed color BMP. + windowscodecs: Return proper error codes in unneeded BMP decoder methods. + windowscodecs: Add support for decoding RLE8-encoded BMP files. + windowscodecs: Add support for decoding RLE4-encoded BMP files. + gdiplus: Use brush_fill_path in GdipFillEllipse. + gdiplus: Use brush_fill_path in GdipFillPie. + gdiplus: Use brush_fill_path in GdipFillPolygon. + gdiplus: Use brush_fill_path in GdipFillPolygonI. + gdiplus: Use brush_fill_path in GdipFillRegion. + gdiplus: Use brush_fill_path in GdipFillRectangleI. + gdiplus: Implement GdipSetLineLinearBlend. + windowscodecs: Don't leak memory when BmpFrameDecode_CopyPalette fails. + windowscodecs: Register BMP decoder as a bitmap decoder. + +Vitaliy Margolen (1): + shell32: Export IsUserAnAdmin by name as well. + +Vladimir Pankratov (3): + regedit: Implement open last key at startup. + comctl32: Fix division by zero. + cmd: Convert the Russian resources to UTF-8. + +Yuri Khan (1): + winex11.drv: Handle clipboard on an auxiliary thread for windowless apps. + +-- +Alexandre Julliard +julliard@winehq.org diff --git a/AUTHORS b/AUTHORS index 14c0d37b85f..20b15d639ce 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,6 +2,7 @@ Wine is available thanks to the work of: Sami Aario James Abbatiello +Michael Abbott Michael Abd-El-Malek Howard Abrams David Adam @@ -51,8 +52,11 @@ Nerijus Baliunas Alexandru Balut Scott Bambrough Andre Malafaya Baptista +Denis Baranov Justin Santa Barbara Aaron Barnes +Cesar Eduardo Barros +Ismael Barros Guido Barzini Jean-Claude Batista Jacek Bator @@ -69,6 +73,7 @@ Ken Belleau Yvon Belleau Maxime Bellengé Elias Benali +Luke Benstead Leo van den Berg Anders Bergh Christopher Berner @@ -81,7 +86,9 @@ Peter Beutner Stephan Beuze Georg Beyerle Pierre Beyssac +Przemysław Białek Fabian Bieler +Giuseppe Bilotta Bobby Bingham Ross Biro Hartmut Birr @@ -117,11 +124,12 @@ John Brezak Alastair Bridgewater Simon Britnell Christian Britz +Dustin Brody Nicolas Brouard Alban Browaeys Marcus R. Brown Philip Brown -Zac Brown +Zachary Brown Gregor Brunmar Stefan Brüns Tom Brus @@ -143,6 +151,7 @@ Jonathan Buzzard Jacek Caban Piotr Caban Stewart Caie +Jim Cameron Brad Campbell Jose Marcos López Caravaca Michael Cardenas @@ -216,9 +225,11 @@ Evan Deaubl Lionel Debroux Bryan DeGrendel Moses DeJong +Frédéric Delanoy Nicolas Delcros Sam Dennis Matthias Derer +Andrei Derevyanko Raul Dias Robert Dickenson Darryl Dixon @@ -226,13 +237,17 @@ Jan Djarv Petar Djukic Petr Dlouhý Roman Dolejsi +François Dorin Alexander Dorofeyev Frans van Dorsselaer Stefan Dösinger +Jeremy Drake +Yann Droneaud Josh DuBois Marcelo Duarte Charles Duffy Mark Dufour +Warren Dumortier Reece H. Dunn EA Durbin Zoran Dzelajlija @@ -240,6 +255,7 @@ Jason Edmeades Steven Edwards Christian Eggers Rikhardur Egilsson +Andrew Eikum Karsten Elfenbein John Elliot David Elliott @@ -247,8 +263,10 @@ Steven Elliott Dan Engel Ralf S. Engelschall Austin English +Rich Ercolani Morten Eriksen Jakob Eriksson +Hib Eris Jonathan Ernst Nicolas Escuder Andrey Esin @@ -261,16 +279,22 @@ Susan Farley Rob Farnum David Faure Matthias Fechner +Massimo Del Fedele +Andrew Fenn Tim Ferguson Raul Fernandes +Filipe Ferreira Wesley Filardo +Ricardo Filipe Colin Finck Matt Finnicum Aurimas Fischer Claus Fischer +Aurimas Fišeras Thomas Fitzsimmons Olaf Flebbe Yuval Fledel +Jeremiah Flerchinger Tom Fogal Krzysztof Foltman Chad Fraleigh @@ -287,6 +311,7 @@ Philippe Froidevaux Mike Frysinger Martin Fuchs Bernd Fuhrmann +Shunichi Fuji Satsuki Fujishima Ron Gage Louis Philippe Gagnon @@ -297,9 +322,11 @@ Gabriel Garcia Ramon Garcia Johan Gardell Michael Gardiner +Jérôme Gardou Martin Garton Jeff Garzik Sebastian Gasiorek +Patrick Gauthier Christopher Gautier David Gay Julio César Gázquez @@ -339,9 +366,11 @@ Jason Green Jon Griffiths Kevin Groeneveld Gerhard W. Gruber +Michael Gruber Tobias Gruetzmacher Marcin Grześkowiak Daniel Gudbjartsson +Stefano Guidoni Adam Gundy Michael Günnewig Ivan Gyurdiev @@ -354,6 +383,7 @@ Patrick Haller Stefan Haller Jake Hamby David Hammerton +Paul TBBle Hampson Noomen Hamza Anssi Hannula Charles M. Hannum @@ -373,18 +403,22 @@ Peter Hawkins Shi Quan He Mike Hearn Waldek Hebisch +Ulrich Hecht David Hedberg +Peter Hedlund Lars Heete Cameron Heide Hagen Heiduck Jukka Heinonen David Hemmo +André Hentschel Pierre d'Herbemont Juraj Hercek Bernd Herd Robert van Herk Theodore S. Hetke Dan Hipschman +Markus Hitter Haithem Hmida Roger Hoang Ben Hodgetts @@ -396,6 +430,7 @@ Erik Hofman Jörg Höhle John K. Hohm Kevin Holbrook +Joel Holdsworth Nick Holloway Alfons Hoogervorst Erich Hoover @@ -419,11 +454,13 @@ Peter Hunnisett A C Hurst Choe Hwanjin Miguel de Icaza +Mikio Idneuma Mounir Idrassi Romain Iehl Jukka Iivonen Vladdy Impaler Hiroshi Inoue +Simon C. Ion Kostya Ivanov Serge Ivanov Peter Ivanyi @@ -432,6 +469,7 @@ Michael Jacobsen Francois Jacques Lee Jaekil Gautam Jain +Tobias Jakobi Jeroen Janssen Oldrich Jedlicka György 'Nog' Jeney @@ -448,6 +486,7 @@ Jeff Johann André Johansen Andrew Johnston Matt Jones +Anders Jonsson Damjan Jovanovic Alexandre Julliard Jussi Jumppanen @@ -455,38 +494,47 @@ Bang Jun-Young Michael Jung Raphael Junqueira James Juran +Mario Kacmar Achim Kaiser Rolf Kalbermatter Maciek Kaliszewski Kaj Kaloinen +Yuriy Kaminskiy Alexander Kanavin Srivatsa Kanchi, R Jukka Kangas Thorsten Kani Pavel Kankovsky Lauris Kaplinski +Mike Kaplinskiy Michael Karcher Reinhard Karcher Niclas Karlsson Jochen Karrer Valery Kartel Rudolf Kastl +Hirofumi Katayama Michael Kaufmann Tapio Kautto Dan Kegel Matthew Kehrer Don Kelly +Robert Key +Yuri Khan Thomas Kho Sergey Khodych Vijay Kiran Kamuju Andreas Kirschbaum +Dmitry Kislyuk Simon Kissane Rafael Kitover Rein Klazes John Klehm +Ben Klein Albrecht Kleine Dietmar Kling William Knop +Florian Köberle Johannes Koch Eric Kohl Kevin Koltzau @@ -497,7 +545,10 @@ Frans Kool Oleg Korda Ilya Korniyko Alex Korobka +David Korth +Mathias Kosch Misha Koshelev +Krzysztof Kotlenga Kusanagi Kouichi András Kovács Zoltan Kovacs @@ -509,9 +560,11 @@ Jan Kratochvil David Kredba Marko Kreen Greg Kreider +Timo Kreuzer Oleg Krylov Phil Krylov Junichi Kuchinishi +Maksim Kuleshov Vik Kumar Anand Kumria Matthias Kupfer @@ -543,6 +596,7 @@ David Lassonde Jeff Latimer Paul Laufer Klaus Layer +Nicolas Le Cam Albert Lee Jaekil Lee Sander van Leeuwen @@ -555,6 +609,7 @@ Crestez Leonard Alistair Leslie-Hughes Karl Lessard Pascal Lessard +Eddie Leung Hin-Tak Leung Blake Leverett Wim Lewis @@ -583,6 +638,7 @@ Carlos Lozano Jean-Bruno Luginbühl Denis Lukianov Alexander V. Lukyanov +Austin Lund Daniel Lund Magnus Lundborg Robert Lunnon @@ -611,6 +667,7 @@ Daniel Marmier Juergen Marquardt Greg Marsden Kris Marsh +Brad Martin Philip Mason Alberto Massari Ricardo Massaro @@ -655,6 +712,7 @@ David Miller Donn Miller Jeff Miller Bruce Milner +Roman Mindalev Michal Janusz Miroslaw Anish Mistry Royce Mitchell III @@ -665,6 +723,7 @@ Andreas Mohr Todd Mokros Slava Monich James Moody +Jan de Mooij David Moore Patrick Moran Chris Morgan @@ -683,11 +742,13 @@ Gregor Münch Krishna Murthy Rick Mutzke Philippe De Muyter +Rafał Mużyło Ken Myers Kimmo Myllyvirta Zoltan Nagy Itai Nahshon Filip Navara +Juan M. Navarro Dustin Navea Felix Nawothnig Jonathan Naylor @@ -696,12 +757,16 @@ Nathan Neulinger Christian Neumair Jeremy Newman Tim Newsome +Andrew Nguyen Thuy Nguyen +Hongbo Ni Kristian Nielsen Arjen Nienhuis Jan Nieuwenhuizen +Jan-Peter Nilsson Philip Nilsson Nix N. Nix +Muneyuki Noguchi Sami Nopanen Leonard Norrgård Robert North @@ -747,6 +812,7 @@ Ted Percival Vitaly Perov James Perry Ori Pessach +Adam Petaccia Nemeth Peter Chris Peterson Jim Peterson @@ -766,6 +832,7 @@ Laurent Pinchart Aviad Pineles Brian Pirie Colin Pitrat +Davide Pizzetti Michael Ploujnikov William Poetra Yoga Hadisoesen Gracjan Polak @@ -782,6 +849,7 @@ Joseph Pranevich Raimonds Praude Aneurin Price Alex Priem +Martin Profittlich Oleg Prokhorov Roberto Augusto Pungartnik Francesco Di Punzio @@ -796,12 +864,15 @@ Pete Ratzlaff Jaime Rave Ron Record Robert Reif +Stefan Reimer Petter Reinholdtsen +John Reiser Karl Relton Daniel Remenak Andrew de los Reyes Keith Reynolds Slaven Rezic +Artem Reznikov John Richardson Rick Richardson Frank Richter @@ -813,6 +884,7 @@ Detlef Riekenberg Robert Riggs Peter Riocreux Scott Ritchie +Paul Bryan Roberts Matthew Robertson Chris Robinson Vedran Rodic @@ -820,26 +892,33 @@ Wino Rojo Troy Rollo Paul Romanyszyn Drew Ronneberg +Stephan Rose Andreas Rosenberg Bernhard Rosenkraenzer Pavel Roskin Herbert Rosmanith Elias Ross Lilia Roumiantseva +Owen Rudge Paul Rupe +Mike Ruprecht Johannes Ruscheinski Andy Rysin Daniel Sabo Adam Sacarny Ivan de Saedeleer Madhura Sahasrabudhe +Diaa Sami Kasper Sandberg Thomas Sandford +Daniel Santos Constantine Sapuntzakis Pablo Saratxaga Kouji Sasaki Mike Schaadt Carl van Schaik +Florian Tobias Schandinat +Peter Schauer Paul van Schayck Daniel Schepler Johannes E. Schindelin @@ -850,6 +929,7 @@ Ulrich Schmid Axel Schmidt Bernd Schmidt Ian Schmidt +Ryan Schmidt Juergen Schmied Ingo Schneider Victor Schneider @@ -862,17 +942,20 @@ Tim Schwartz Federico Schwindt Wolfgang Schwotzer Dan Scott +Alexander Scott-Johns Tim Segall Hajime Segawa Pavel Semerad Hippocrates Sendoukas Stas Sergeev +Ken Sharp Jeremy Shaw Roy Shea Robert Shearman John Sheets Shachar Shemesh Nickolay V. Shmyrev +Ilya Shpigor Santosh Siddheshwar Stefan Siebert Yngvi Sigurjonsson @@ -884,6 +967,7 @@ Ivan Sinitsin Dmitrij Sinukov Willie Sippel Nikolay Sivov +Kjell Rune Skaaraas Daniel Skorka Jesper Skov Neil Skrypuch @@ -904,6 +988,7 @@ Pablo Spallanzani Thomas Spear Chris Spencer Liu Spider +Matej Spindler Patrick Spinler Serge S. Spiridonoff Alexey Spiridonov @@ -924,7 +1009,9 @@ Johannes Stezenbach Oliver Stieber Clinton Stimpson William Stinson +Adam Stoelting Richard Stonehouse +Stefan Stranz Dominik Strasser Patrik Stridvall Vadim Strizhevsky @@ -965,14 +1052,17 @@ Goran Thyni Steve Tibbett Dmitry Timoshkov Marco Timpano +Will Tipton Jimmy Tirtawangsa Petr Tomasek Jon Tombs Janusz Tomczak Allan Tong +Gal Topper Linus Torvalds Luc Tourangeau Jeff Tranter +Pavel Troller Gregory Trubetskoy Lauri Tulmin Petri Tuomola @@ -1010,6 +1100,7 @@ Ferenc Wagner Ronan Waide Daniel Walker Martin Walker +Wolfgang Walter Simon Walton Owen Wang Eric Warnke @@ -1036,9 +1127,11 @@ Jan Willamowius Carl Williams Eric Williams Grant Williamson +Chris Wilson Jed Wing Andre Wisplinghoff Christoph von Wittich +Łukasz Wojniłowicz Dan Wolf Erwin Wolff Philipp Wollermann @@ -1046,6 +1139,7 @@ Ivan Wong Brandon Woodmansee Alex Woods Cliff Wright +Tim Wright Chia-I Wu Gerold Jens Wucherpfennig Karl Guenter Wuensch @@ -1069,6 +1163,8 @@ Lei Zhang Yuxi Zhang Shanren Zhou Andrew Ziem +G. Paul Ziemba +Daniel Zimmermann Nikolas Zimmermann Alex Zorach Nathan Zorich diff --git a/VERSION b/VERSION index 4a099c1bc53..9ee63cb1018 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Wine version 1.1.25 +Wine version 1.1.26 diff --git a/configure b/configure index b26c8660d27..5ce51c1390d 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for Wine 1.1.25. +# Generated by GNU Autoconf 2.61 for Wine 1.1.26. # # Report bugs to . # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.1.25' -PACKAGE_STRING='Wine 1.1.25' +PACKAGE_VERSION='1.1.26' +PACKAGE_STRING='Wine 1.1.26' PACKAGE_BUGREPORT='wine-devel@winehq.org' ac_unique_file="server/atom.c" @@ -1301,7 +1301,7 @@ if test "$ac_init_help" = "long"; then # 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 1.1.25 to adapt to many kinds of systems. +\`configure' configures Wine 1.1.26 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1370,7 +1370,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.1.25:";; + short | recursive ) echo "Configuration of Wine 1.1.26:";; esac cat <<\_ACEOF @@ -1503,7 +1503,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.1.25 +Wine configure 1.1.26 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1517,7 +1517,7 @@ cat >config.log <<_ACEOF 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 1.1.25, which was +It was created by Wine $as_me 1.1.26, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -23852,22 +23852,6 @@ dlls/d3drm/tests/Makefile: dlls/d3drm/tests/Makefile.in dlls/Maketest.rules" ac_config_files="$ac_config_files dlls/d3drm/tests/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ - dlls/d3dx8/Makefile" -test "x$enable_d3dx8" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ - d3dx8" -ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS -dlls/d3dx8/Makefile: dlls/d3dx8/Makefile.in dlls/Makedll.rules" -ac_config_files="$ac_config_files dlls/d3dx8/Makefile" - -ALL_MAKEFILES="$ALL_MAKEFILES \\ - dlls/d3dx8/tests/Makefile" -test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ - d3dx8/tests" -ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS -dlls/d3dx8/tests/Makefile: dlls/d3dx8/tests/Makefile.in dlls/Maketest.rules" -ac_config_files="$ac_config_files dlls/d3dx8/tests/Makefile" - -ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/d3dx9_24/Makefile" test "x$enable_d3dx9_24" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ d3dx9_24" @@ -26740,6 +26724,14 @@ dlls/wmi/Makefile: dlls/wmi/Makefile.in dlls/Makedll.rules" ac_config_files="$ac_config_files dlls/wmi/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ + dlls/wmiutils/Makefile" +test "x$enable_wmiutils" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ + wmiutils" +ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS +dlls/wmiutils/Makefile: dlls/wmiutils/Makefile.in dlls/Makedll.rules" +ac_config_files="$ac_config_files dlls/wmiutils/Makefile" + +ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/wnaspi32/Makefile" test "x$enable_wnaspi32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ wnaspi32" @@ -27854,7 +27846,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Wine $as_me 1.1.25, which was +This file was extended by Wine $as_me 1.1.26, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -27907,7 +27899,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Wine config.status 1.1.25 +Wine config.status 1.1.26 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -28091,8 +28083,6 @@ do "dlls/d3dim/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dim/Makefile" ;; "dlls/d3drm/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3drm/Makefile" ;; "dlls/d3drm/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3drm/tests/Makefile" ;; - "dlls/d3dx8/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx8/Makefile" ;; - "dlls/d3dx8/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx8/tests/Makefile" ;; "dlls/d3dx9_24/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx9_24/Makefile" ;; "dlls/d3dx9_25/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx9_25/Makefile" ;; "dlls/d3dx9_26/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx9_26/Makefile" ;; @@ -28452,6 +28442,7 @@ do "dlls/wldap32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/wldap32/Makefile" ;; "dlls/wldap32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/wldap32/tests/Makefile" ;; "dlls/wmi/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/wmi/Makefile" ;; + "dlls/wmiutils/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/wmiutils/Makefile" ;; "dlls/wnaspi32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/wnaspi32/Makefile" ;; "dlls/wow32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/wow32/Makefile" ;; "dlls/ws2_32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ws2_32/Makefile" ;; diff --git a/configure.ac b/configure.ac index 18755e27e7a..5cce1b78ebd 100644 --- a/configure.ac +++ b/configure.ac @@ -2097,8 +2097,6 @@ WINE_CONFIG_MAKEFILE([dlls/d3d9/tests/Makefile],[dlls/Maketest.rules],[dlls],[AL WINE_CONFIG_MAKEFILE([dlls/d3dim/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3drm/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3drm/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) -WINE_CONFIG_MAKEFILE([dlls/d3dx8/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/d3dx8/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/d3dx9_24/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3dx9_25/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3dx9_26/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) @@ -2458,6 +2456,7 @@ WINE_CONFIG_MAKEFILE([dlls/wintrust/tests/Makefile],[dlls/Maketest.rules],[dlls] WINE_CONFIG_MAKEFILE([dlls/wldap32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/wldap32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/wmi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/wmiutils/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/wnaspi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/wow32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ws2_32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index edb73cb599e..8f2a9779bcc 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -116,7 +116,6 @@ IMPORT_LIBS = \ d3d9/libd3d9.$(IMPLIBEXT) \ d3dim/libd3dim.$(IMPLIBEXT) \ d3drm/libd3drm.$(IMPLIBEXT) \ - d3dx8/libd3dx8.$(IMPLIBEXT) \ d3dx9_36/libd3dx9.$(IMPLIBEXT) \ d3dxof/libd3dxof.$(IMPLIBEXT) \ dbghelp/libdbghelp.$(IMPLIBEXT) \ @@ -263,7 +262,6 @@ CROSS_IMPLIBS = \ d3d9/libd3d9.a \ d3dim/libd3dim.a \ d3drm/libd3drm.a \ - d3dx8/libd3dx8.a \ d3dx9_36/libd3dx9.a \ d3dxof/libd3dxof.a \ dbghelp/libdbghelp.a \ @@ -468,9 +466,6 @@ d3dim/libd3dim.def d3dim/libd3dim.a: d3dim/d3dim.spec $(WINEBUILD) d3drm/libd3drm.def d3drm/libd3drm.a: d3drm/d3drm.spec $(WINEBUILD) @cd d3drm && $(MAKE) `basename $@` -d3dx8/libd3dx8.def d3dx8/libd3dx8.a: d3dx8/d3dx8.spec $(WINEBUILD) - @cd d3dx8 && $(MAKE) `basename $@` - d3dx9_36/libd3dx9.def d3dx9_36/libd3dx9.a: d3dx9_36/d3dx9_36.spec $(WINEBUILD) @cd d3dx9_36 && $(MAKE) `basename $@` diff --git a/dlls/appwiz.cpl/De.rc b/dlls/appwiz.cpl/De.rc index 65be3f745a6..c266d8f2810 100644 --- a/dlls/appwiz.cpl/De.rc +++ b/dlls/appwiz.cpl/De.rc @@ -28,7 +28,7 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL STRINGTABLE { IDS_CPL_TITLE, "Software" - IDS_CPL_DESC, "Erlaubt ihnen neue Software hinzuzufügen, oder vorhandene zu entfernen." + IDS_CPL_DESC, "Erlaubt ihnen neue Software hinzuzufügen oder zu entfernen." IDS_TAB1_TITLE, "Anwendungen" IDS_UNINSTALL_FAILED, "Der Uninstaller konnte nicht gestartet werden, '%s'. Möchten Sie den Uninstall-Eintrag für dieses Programm aus der Registrierung entfernen?" @@ -38,6 +38,9 @@ STRINGTABLE IDS_COLUMN_PUBLISHER, "Herausgeber" IDS_COLUMN_VERSION, "Version" IDS_INSTALL_FILTER, "Setup-Programme\0*instal*.exe;*setup*.exe;*.msi\0Programme (*.exe)\0*.exe\0Alle Dateien (*.*)\0*.*\0\0" + + IDS_REMOVE, "&Entfernen..." + IDS_MODIFY_REMOVE, "Än&dern/Entfernen..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -51,8 +54,10 @@ FONT 8, "MS Shell Dlg" CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "Folgende Programme können automatisch entfernt werden. Um ein Programm zu entfernen oder um installierte Komponenten zu ändern, wählen Sie es aus der Liste aus und klicken Sie auf Ändern/Entfernen.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Än&dern/Entfernen...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 230, 198, 80, 14 - CONTROL "&Informationen...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 160, 198, 64, 14 + CONTROL "&Informationen...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 198, 64, 14 + CONTROL "Än&dern...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Entfernen...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 + CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/En.rc b/dlls/appwiz.cpl/En.rc index 1eb237353b2..4f775aa86f2 100644 --- a/dlls/appwiz.cpl/En.rc +++ b/dlls/appwiz.cpl/En.rc @@ -36,6 +36,9 @@ STRINGTABLE IDS_COLUMN_PUBLISHER, "Publisher" IDS_COLUMN_VERSION, "Version" IDS_INSTALL_FILTER, "Installation Programs\0*instal*.exe;*setup*.exe;*.msi\0Programs (*.exe)\0*.exe\0All Files (*.*)\0*.*\0\0" + + IDS_REMOVE, "&Remove..." + IDS_MODIFY_REMOVE, "&Modify/Remove..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -49,8 +52,9 @@ FONT 8, "MS Shell Dlg" CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "The following software can be automatically removed. To remove a program or to modify its installed components, select it from the list and click Change/Remove.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Change/&Remove...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 - CONTROL "&Support Info...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 + CONTROL "&Support Info...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 198, 64, 14 + CONTROL "&Modify...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Remove...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/Fr.rc b/dlls/appwiz.cpl/Fr.rc index 4c290109dbe..e8e67e55804 100644 --- a/dlls/appwiz.cpl/Fr.rc +++ b/dlls/appwiz.cpl/Fr.rc @@ -39,6 +39,9 @@ STRINGTABLE IDS_COLUMN_PUBLISHER, "Éditeur" IDS_COLUMN_VERSION, "Version" IDS_INSTALL_FILTER, "Programmes d'installation\0*instal*.exe;*setup*.exe;*.msi\0Programmes (*.exe)\0*.exe\0Tous les fichiers (*.*)\0*.*\0\0" + + IDS_REMOVE, "&Supprimer..." + IDS_MODIFY_REMOVE, "&Modifier/Supprimer..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -47,13 +50,14 @@ CAPTION "Installation/Désinstallation" FONT 8, "MS Shell Dlg" { CONTROL "Pour installer un nouveau programme à partir d'une disquette, d'un CD-ROM ou d'un disque dur, cliquez sur Installer.", 1000, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 7, 270, 20 - CONTROL "&Installer...", IDC_INSTALL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 240, 26, 70, 14 + CONTROL "&Installer...", IDC_INSTALL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 242, 26, 68, 14 CONTROL "", -1, "STATIC", SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE, 7, 46, 303, 1 CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 - CONTROL "Les logiciels suivants peuvent être désinstallés automatiquement.\nPour supprimer un programme ou modifier ses composants, sélectionnez-le dans la liste et cliquez sur Modifier/Supprimer.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 + CONTROL "Les logiciels suivants peuvent être désinstallés automatiquement.\nPour supprimer un programme ou modifier ses composants, sélectionnez-le dans la liste et cliquez sur Supprimer ou Modifier respectivement.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Modifier/&Supprimer", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 240, 198, 70, 14 - CONTROL "&Informations de support", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 150, 198, 87, 14 + CONTROL "Inf&ormations de support...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 73, 198, 95, 14 + CONTROL "&Modifier...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Supprimer...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/Ja.rc b/dlls/appwiz.cpl/Ja.rc index a0e536c64bd..f4e45d092e5 100644 --- a/dlls/appwiz.cpl/Ja.rc +++ b/dlls/appwiz.cpl/Ja.rc @@ -38,6 +38,9 @@ STRINGTABLE IDS_COLUMN_NAME, "名前" IDS_COLUMN_PUBLISHER, "発行元" IDS_COLUMN_VERSION, "バージョン" + + IDS_REMOVE, "&Remove..." + IDS_MODIFY_REMOVE, "&Modify/Remove..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -51,8 +54,9 @@ FONT 9, "MS Shell Dlg" CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "以下のソフトウェアを自動的に削除できます。プログラムを削除またはインストールされたコンポーネントを変更するには、リストからプログラムを選択し [追加と削除] をクリックしてください。", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "追加と削除(&R)...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 198, 64, 14 - CONTROL "サポート情報(&S)...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 + CONTROL "サポート情報(&S)...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 198, 64, 14 + CONTROL "&Modify...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Remove...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/Ko.rc b/dlls/appwiz.cpl/Ko.rc index 138158bf973..19076e0f528 100644 --- a/dlls/appwiz.cpl/Ko.rc +++ b/dlls/appwiz.cpl/Ko.rc @@ -36,6 +36,9 @@ STRINGTABLE IDS_COLUMN_PUBLISHER, "Á¦ÀÛ»ç" IDS_COLUMN_VERSION, "¹öÁ¯" IDS_INSTALL_FILTER, "¼³Ä¡ ÇÁ·Î±×·¥0*instal*.exe;*setup*.exe;*.msi\0ÇÁ·Î±×·¥ (*.exe)\0*.exe\0¸ðµç ÆÄÀϵé (*.*)\0*.*\0\0" + + IDS_REMOVE, "&Remove..." + IDS_MODIFY_REMOVE, "&Modify/Remove..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -49,8 +52,9 @@ FONT 9, "MS Shell Dlg" CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "ÀÌ ¼ÒÇÁÆ®¿þ¾î´Â ÀÚµ¿À¸·Î »èÁ¦µÇ¾úÀ» ¼öµµ ÀÖ½À´Ï´Ù.¼³Ä¡µÈ ±¸¼º¿ä¼Ò¸¦ °íÄ¡°Å³ª ÇÁ·Î±×·¥À» Áö¿ì·Á¸é , Ãß°¡/»èÁ¦ ¸ñ·Ï¿¡¼­ ¼±ÅÃÇϽʽÿÀ..", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 36 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Ãß°¡/»èÁ¦(&R)..", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 198, 64, 14 - CONTROL "Áö¿ø Á¤º¸(&S)...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 + CONTROL "Áö¿ø Á¤º¸(&S)...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 198, 64, 14 + CONTROL "&Modify...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Remove...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/Lt.rc b/dlls/appwiz.cpl/Lt.rc index 6ce9038d77d..88f491e17fe 100644 --- a/dlls/appwiz.cpl/Lt.rc +++ b/dlls/appwiz.cpl/Lt.rc @@ -32,13 +32,16 @@ STRINGTABLE IDS_CPL_DESC, "Leidžia įdiegti naują programinę įrangą, ar pašalinti jau įdiegtą iš jūsų kompiuterio." IDS_TAB1_TITLE, "Programos" - IDS_UNINSTALL_FAILED, "Nepavyko įvykdyti programos pašalinimo komandos '%s'. Ar norite pašalinti programos šalinimo įrašą iš registro?" + IDS_UNINSTALL_FAILED, "Nepavyko įvykdyti programos pašalinimo komandos „%s“. Ar norite pašalinti programos šalinimo įrašą iš registro?" IDS_NOT_SPECIFIED, "Nenurodyta" IDS_COLUMN_NAME, "Vardas" IDS_COLUMN_PUBLISHER, "Leidėjas" IDS_COLUMN_VERSION, "Versija" IDS_INSTALL_FILTER, "Diegimo programos\0*instal*.exe;*setup*.exe;*.msi\0Programos (*.exe)\0*.exe\0Visi failai (*.*)\0*.*\0\0" + + IDS_REMOVE, "Pa&šalinti..." + IDS_MODIFY_REMOVE, "Pa&keisti/pašalinti..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -46,14 +49,15 @@ STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMEN CAPTION "Įdiegti/Pašalinti" FONT 8, "MS Shell Dlg" { - CONTROL "Norėdami įdiegti naują programą iš diskelio, kompaktinio disko ar standžiojo disko spauskite 'Įdiegti'.", 1000, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 7, 270, 20 + CONTROL "Norėdami įdiegti naują programą iš diskelio, kompaktinio disko ar standžiojo disko spauskite „Įdiegti“.", 1000, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 7, 270, 20 CONTROL "Į&diegti...", IDC_INSTALL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 26, 64, 14 CONTROL "", -1, "STATIC", SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE, 7, 46, 303, 1 CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 - CONTROL "Ši programinė įranga gali būti automatiškai pašalinta. Norėdami pašalinti programą ar modifikuoti jos įdiegtus komponentus pažymėkite ją sąraše ir spauskite 'Įdiegti/Pašalinti'.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 + CONTROL "Ši programinė įranga gali būti automatiškai pašalinta. Norėdami pašalinti programą ar modifikuoti jos įdiegtus komponentus pažymėkite ją sąraše ir spauskite „Pakeisti/pašalinti“.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Įdiegti/Pa&šalinti...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 198, 64, 14 - CONTROL "&Priežiūros informacija...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 156, 198, 84, 14 + CONTROL "&Priežiūros informacija...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 84, 198, 84, 14 + CONTROL "Pa&keisti...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "Pa&šalinti...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } @@ -63,7 +67,7 @@ CAPTION "Priežiūros informacija" FONT 8, "MS Shell Dlg" { CONTROL "Gerai", IDOK, "BUTTON", BS_DEFPUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 103, 116, 50, 14 - CONTROL "Ši informacija gali būti panaudota programos '%s' techninei priežiūrai gauti:", IDC_INFO_LABEL, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 12, 9, 228, 19 + CONTROL "Ši informacija gali būti panaudota programos „%s“ techninei priežiūrai gauti:", IDC_INFO_LABEL, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 12, 9, 228, 19 CONTROL "Leidėjas:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 30, 60, 8 CONTROL "Versija:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 40, 60, 8 CONTROL "Kontaktas:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 50, 60, 8 diff --git a/dlls/appwiz.cpl/Nl.rc b/dlls/appwiz.cpl/Nl.rc index f29f97cc3fe..34704ec3d78 100644 --- a/dlls/appwiz.cpl/Nl.rc +++ b/dlls/appwiz.cpl/Nl.rc @@ -38,6 +38,9 @@ STRINGTABLE IDS_COLUMN_PUBLISHER, "Uitgever" IDS_COLUMN_VERSION, "Versie" IDS_INSTALL_FILTER, "Installatie-programma's\0*instal*.exe;*setup*.exe;*.msi\0Programma's (*.exe)\0*.exe\0Alle bestanden (*.*)\0*.*\0\0" + + IDS_REMOVE, "&Verwijderen..." + IDS_MODIFY_REMOVE, "&Modify/Remove..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -51,8 +54,9 @@ FONT 8, "MS Shell Dlg" CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "De volgende software kan automatisch verwijderd worden. Om het programma te verwijderen of de geïnstalleerde onderdelen te wijzigen, selecteer het in de lijst en druk op Wijzigen/Verwijderen.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Wijzigen/&Verwijderen...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 198, 64, 14 - CONTROL "&Support Informatie...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 + CONTROL "&Support Informatie...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 198, 64, 14 + CONTROL "&Modify...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Verwijderen...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/No.rc b/dlls/appwiz.cpl/No.rc index 889ee83f47b..a6106a43915 100644 --- a/dlls/appwiz.cpl/No.rc +++ b/dlls/appwiz.cpl/No.rc @@ -39,6 +39,9 @@ STRINGTABLE IDS_COLUMN_PUBLISHER, "Utgiver" IDS_COLUMN_VERSION, "Versjon" IDS_INSTALL_FILTER, "Installasjonsprogrammer\0*instal*.exe;*setup*.exe;*.msi\0Programmer (*.exe)\0*.exe\0Alle filer (*.*)\0*.*\0\0" + + IDS_REMOVE, "Fje&rn..." + IDS_MODIFY_REMOVE, "&Modify/Remove..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -52,8 +55,9 @@ FONT 8, "MS Shell Dlg" CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "Følgende programmer kan fjernes automatisk. Merk et program og trykk «Legg til/Fjern» for å fjerne det eller endre installerte komponenter", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Legg til/Fje&rn...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 198, 64, 14 - CONTROL "&Støtteinformasjon...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 170, 198, 70, 14 + CONTROL "&Støtteinformasjon...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 98, 198, 70, 14 + CONTROL "&Modify...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "Fje&rn...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/Pt.rc b/dlls/appwiz.cpl/Pt.rc index 5f772da6596..4abcb507449 100644 --- a/dlls/appwiz.cpl/Pt.rc +++ b/dlls/appwiz.cpl/Pt.rc @@ -21,20 +21,26 @@ #include "res.h" -LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL +#pragma code_page(65001) + +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE STRINGTABLE { IDS_CPL_TITLE, "Adicionar/Remover Programas" - IDS_CPL_DESC, "Permite a instalação de novo software, ou a remoção de software existente no seu computador." - IDS_TAB1_TITLE, "Aplicações" + IDS_CPL_DESC, "Permite a instalação de novo software, ou a remoção de software existente no seu computador." + IDS_TAB1_TITLE, "Aplicações" - IDS_UNINSTALL_FAILED, "Não foi possível executar o desinstalador, '%s'. Deseja remover do registo a entrada de desinstalação para este programa?" - IDS_NOT_SPECIFIED, "Não especificado" + IDS_UNINSTALL_FAILED, "Não foi possível executar o desinstalador, '%s'. Deseja remover do registo a entrada de desinstalação para este programa?" + IDS_NOT_SPECIFIED, "Não especificado" IDS_COLUMN_NAME, "Nome" IDS_COLUMN_PUBLISHER, "Editor" - IDS_COLUMN_VERSION, "Versão" + IDS_COLUMN_VERSION, "Versão" + IDS_INSTALL_FILTER, "Programas de Instalação\0*instal*.exe;*setup*.exe;*.msi\0Programas (*.exe)\0*.exe\0Todos os ficheiros (*.*)\0*.*\0\0" + + IDS_REMOVE, "&Remover..." + IDS_MODIFY_REMOVE, "&Modificar/Remover..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -42,32 +48,33 @@ STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMEN CAPTION "Instalar/Desinstalar" FONT 8, "MS Shell Dlg" { - CONTROL "Para instalar um programa novo a partir de uma disquete, CD-ROM ou do seu disco rígido clique em Instalar.", 1000, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 7, 270, 20 + CONTROL "Para instalar um programa novo a partir de uma disquete, CD-ROM ou do seu disco rígido clique em Instalar.", 1000, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 7, 270, 20 CONTROL "&Instalar...", IDC_INSTALL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 26, 64, 14 CONTROL "", -1, "STATIC", SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE, 7, 46, 303, 1 CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "O software seguinte pode ser automaticamente removido. Para remover um programa ou modificar os seus componentes instalados seleccione-o da lista e clique em Adicionar/Remover.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Adicionar/&Remover...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 198, 64, 14 - CONTROL "&Informação de Suporte...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 + CONTROL "&Informação de Suporte...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 198, 64, 14 + CONTROL "&Modificar...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Remover...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } IDD_INFO DIALOG 0, 0, 256, 138 STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Informação de Suporte" +CAPTION "Informação de Suporte" FONT 8, "MS Shell Dlg" { CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 103, 116, 50, 14 - CONTROL "A informação seguinte pode ser usada para obter suporte técnico para %s:", IDC_INFO_LABEL, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 12, 9, 228, 19 + CONTROL "A informação seguinte pode ser usada para obter suporte técnico para %s:", IDC_INFO_LABEL, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 12, 9, 228, 19 CONTROL "Editor:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 30, 60, 8 - CONTROL "Versão:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 40, 60, 8 + CONTROL "Versão:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 40, 60, 8 CONTROL "Contacto:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 50, 60, 8 - CONTROL "Informação de Suporte:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 60, 64, 8 + CONTROL "Informação de Suporte:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 60, 64, 8 CONTROL "Telefone de Suporte:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 70, 68, 8 CONTROL "Readme:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 80, 60, 8 - CONTROL "Updates Producto:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 90, 60, 8 - CONTROL "Comentários:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 100, 60, 8 + CONTROL "Actualizações de Produto:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 90, 60, 8 + CONTROL "Comentários:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 100, 60, 8 CONTROL "", IDC_INFO_PUBLISHER, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 30, 136, 8 CONTROL "", IDC_INFO_VERSION, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 40, 136, 8 CONTROL "", IDC_INFO_CONTACT, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 50, 136, 8 diff --git a/dlls/appwiz.cpl/Ro.rc b/dlls/appwiz.cpl/Ro.rc index 6dcc5c432f6..46c339b3a54 100644 --- a/dlls/appwiz.cpl/Ro.rc +++ b/dlls/appwiz.cpl/Ro.rc @@ -39,6 +39,9 @@ STRINGTABLE IDS_COLUMN_PUBLISHER, "Emitent" IDS_COLUMN_VERSION, "Versiune" IDS_INSTALL_FILTER, "Programe de instalare\0*instal*.exe;*setup*.exe;*.msi\0Programe (*.exe)\0*.exe\0Toate fișierele (*.*)\0*.*\0\0" + + IDS_REMOVE, "&Sterge..." + IDS_MODIFY_REMOVE, "&Modify/Remove..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -52,8 +55,9 @@ FONT 8, "MS Shell Dlg" CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "Urmatoarele programe pot fi îndepărtate automat. Pentru a îndepărta un program sau pentru ai modifica componentele instalate, alegeți programul din listă și apăsați pe „Adaugă/&șterge”.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Adaugă/&șterge...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 236, 198, 74, 14 - CONTROL "Informații a&sistență...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 156, 198, 74, 14 + CONTROL "Informații a&sistență...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 94, 198, 74, 14 + CONTROL "&Modify...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Sterge...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/Ru.rc b/dlls/appwiz.cpl/Ru.rc index 9160c226c78..e3b00183fd1 100644 --- a/dlls/appwiz.cpl/Ru.rc +++ b/dlls/appwiz.cpl/Ru.rc @@ -35,6 +35,9 @@ STRINGTABLE IDS_COLUMN_NAME, "Íàçâàíèå" IDS_COLUMN_PUBLISHER, "Èçäàòåëü" IDS_COLUMN_VERSION, "Âåðñèÿ" + + IDS_REMOVE, "&Óäàëèòü..." + IDS_MODIFY_REMOVE, "&Modify/Remove..." } IDD_MAIN DIALOG 0, 0, 320, 235 @@ -48,8 +51,9 @@ CONTROL " CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "&Ïåðå÷èñëåííûå ïðîãðàììû ìîæíî óäàëèòü èëè ïåðåóñòàíîâèòü àâòîìàòè÷åñêè. ×òîáû óäàëèòü ïðîãðàììó èëè èçìåíèòü ñîñòàâ óñòàíîâëåííûõ êîìïîíåíòîâ, âûáåðèòå íóæíûé ïóíêò ñïèñêà è íàæìèòå êíîïêó Óñòàíîâèòü/Óäàëèòü.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 55, 270, 32 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Óñòàíîâèòü/&Óäàëèòü...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 216, 198, 94, 14 - CONTROL "&Ñâåäåíèÿ î ïîääåðæêå...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 116, 198, 94, 14 + CONTROL "&Ñâåäåíèÿ î ïîääåðæêå...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 198, 94, 14 + CONTROL "&Modify...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Óäàëèòü...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/Si.rc b/dlls/appwiz.cpl/Si.rc index 26235b6d90a..d936cf9a60d 100644 --- a/dlls/appwiz.cpl/Si.rc +++ b/dlls/appwiz.cpl/Si.rc @@ -38,6 +38,9 @@ STRINGTABLE IDS_COLUMN_PUBLISHER, "Založnik" IDS_COLUMN_VERSION, "Različica" IDS_INSTALL_FILTER, "Instalacijski programi\0*instal*.exe;*setup*.exe;*.msi\0Programi (*.exe)\0*.exe\0Vse datoteke (*.*)\0*.*\0\0" + + IDS_REMOVE, "&Odstrani ..." + IDS_MODIFY_REMOVE, "&Modify/Remove..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -51,8 +54,9 @@ FONT 8, "MS Shell Dlg" CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "Naslednji programi omogočajo samodejno odstranitev. Za odstranitev programa oz. spremembo nameščenih komponent izberite program s seznama in kliknite 'Dodaj/Odstrani'.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Dodaj/&Odstrani ...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 198, 64, 14 - CONTROL "&Informacije ...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 + CONTROL "&Informacije ...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 198, 64, 14 + CONTROL "&Modify...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Odstrani ...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/Sv.rc b/dlls/appwiz.cpl/Sv.rc index da8bae2c5c5..75aa17ab8a7 100644 --- a/dlls/appwiz.cpl/Sv.rc +++ b/dlls/appwiz.cpl/Sv.rc @@ -40,6 +40,9 @@ STRINGTABLE IDS_COLUMN_PUBLISHER, "Utgivare" IDS_COLUMN_VERSION, "Version" IDS_INSTALL_FILTER, "Installationsprogram\0*instal*.exe;*setup*.exe;*.msi\0Program (*.exe)\0*.exe\0Alla filer (*.*)\0*.*\0\0" + + IDS_REMOVE, "&Ta bort..." + IDS_MODIFY_REMOVE, "&Modify/Remove..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -53,8 +56,9 @@ FONT 8, "MS Shell Dlg" CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "Följande programvara kan automatiskt tas bort. Markera den från listan och klicka på Lägg till/Ta bort för att ta bort eller ändra dess installerade komponenter.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "Lägg till/&Ta bort...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 - CONTROL "&Supportinfo...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 + CONTROL "&Supportinfo...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 198, 64, 14 + CONTROL "&Modify...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Ta bort....", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/Zh.rc b/dlls/appwiz.cpl/Zh.rc index d9444743ccb..974104b678a 100644 --- a/dlls/appwiz.cpl/Zh.rc +++ b/dlls/appwiz.cpl/Zh.rc @@ -38,6 +38,9 @@ STRINGTABLE IDS_COLUMN_NAME, "名称" IDS_COLUMN_PUBLISHER, "生产商" IDS_COLUMN_VERSION, "版本" + + IDS_REMOVE, "&Remove..." + IDS_MODIFY_REMOVE, "&Modify/Remove..." } IDD_MAIN DIALOG 0, 0, 320, 220 @@ -51,8 +54,9 @@ FONT 9, "MS Shell Dlg" CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 CONTROL "下列软件可以自动卸载. 按'添加/删除'可卸载选定程序或者调整已安装部件.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 30 CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 - CONTROL "添加/删除(&R)...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 198, 64, 14 - CONTROL "技术支持(&S)...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 + CONTROL "技术支持(&S)...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 198, 64, 14 + CONTROL "&Modify...", IDC_MODIFY, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 198, 68, 14 + CONTROL "&Remove...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 244, 198, 68, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index daf3e82c49a..0d9e555fc30 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -56,6 +56,7 @@ typedef struct APPINFO { LPWSTR title; LPWSTR path; + LPWSTR path_modify; LPWSTR icon; int iconIdx; @@ -72,6 +73,9 @@ typedef struct APPINFO { static struct APPINFO *AppInfo = NULL; static HINSTANCE hInst; +static WCHAR btnRemove[MAX_STRING_LEN]; +static WCHAR btnModifyRemove[MAX_STRING_LEN]; + static const WCHAR openW[] = {'o','p','e','n',0}; /* names of registry keys */ @@ -85,6 +89,8 @@ static const WCHAR ContactW[] = {'C','o','n','t','a','c','t',0}; static const WCHAR HelpLinkW[] = {'H','e','l','p','L','i','n','k',0}; static const WCHAR HelpTelephoneW[] = {'H','e','l','p','T','e','l','e','p','h', 'o','n','e',0}; +static const WCHAR ModifyPathW[] = {'M','o','d','i','f','y','P','a','t','h',0}; +static const WCHAR NoModifyW[] = {'N','o','M','o','d','i','f','y',0}; static const WCHAR ReadmeW[] = {'R','e','a','d','m','e',0}; static const WCHAR URLUpdateInfoW[] = {'U','R','L','U','p','d','a','t','e','I', 'n','f','o',0}; @@ -129,6 +135,7 @@ static void FreeAppInfo(APPINFO *info) HeapFree(GetProcessHeap(), 0, info->title); HeapFree(GetProcessHeap(), 0, info->path); + HeapFree(GetProcessHeap(), 0, info->path_modify); HeapFree(GetProcessHeap(), 0, info->icon); HeapFree(GetProcessHeap(), 0, info->publisher); HeapFree(GetProcessHeap(), 0, info->version); @@ -149,6 +156,7 @@ static BOOL ReadApplicationsFromRegistry(HKEY root) HKEY hkeyUninst, hkeyApp; int i, id = 0; DWORD sizeOfSubKeyName, displen, uninstlen; + DWORD dwNoModify, dwType; WCHAR subKeyName[256]; WCHAR key_app[MAX_STRING_LEN]; WCHAR *p; @@ -273,6 +281,34 @@ static BOOL ReadApplicationsFromRegistry(HKEY root) &displen); } + /* Check if NoModify is set */ + dwType = REG_DWORD; + dwNoModify = 0; + displen = sizeof(DWORD); + + if (RegQueryValueExW(hkeyApp, NoModifyW, NULL, &dwType, (LPBYTE)&dwNoModify, &displen) + != ERROR_SUCCESS) + { + dwNoModify = 0; + } + + /* Some installers incorrectly create a REG_SZ instead of a REG_DWORD - check for + ASCII 49, which equals 1 */ + if (dwType == REG_SZ) + dwNoModify = (dwNoModify == 49) ? 1 : 0; + + /* Fetch the modify path */ + if ((dwNoModify == 0) && (RegQueryValueExW(hkeyApp, ModifyPathW, 0, 0, NULL, &displen) + == ERROR_SUCCESS)) + { + iter->path_modify = HeapAlloc(GetProcessHeap(), 0, displen); + + if (!iter->path_modify) + goto err; + + RegQueryValueExW(hkeyApp, ModifyPathW, 0, 0, (LPBYTE)iter->path_modify, &displen); + } + /* registry key */ iter->regroot = root; lstrcpyW(iter->regkey, subKeyName); @@ -368,10 +404,42 @@ static inline void EmptyList(void) */ static void UpdateButtons(HWND hWnd) { - BOOL sel = SendMessageW(GetDlgItem(hWnd, IDL_PROGRAMS), LVM_GETSELECTEDCOUNT, 0, 0) != 0; + APPINFO *iter; + LVITEMW lvItem; + DWORD selitem = SendDlgItemMessageW(hWnd, IDL_PROGRAMS, LVM_GETNEXTITEM, -1, + LVNI_FOCUSED | LVNI_SELECTED); + BOOL enable_modify = FALSE; - EnableWindow(GetDlgItem(hWnd, IDC_ADDREMOVE), sel); - EnableWindow(GetDlgItem(hWnd, IDC_SUPPORT_INFO), sel); + if (selitem != -1) + { + lvItem.iItem = selitem; + lvItem.mask = LVIF_PARAM; + + if (SendDlgItemMessageW(hWnd, IDL_PROGRAMS, LVM_GETITEMW, 0, (LPARAM) &lvItem)) + { + for (iter = AppInfo; iter; iter = iter->next) + { + if (iter->id == lvItem.lParam) + { + /* Decide whether to display Modify/Remove as one button or two */ + enable_modify = (iter->path_modify != NULL); + + /* Update title as appropriate */ + if (iter->path_modify == NULL) + SetWindowTextW(GetDlgItem(hWnd, IDC_ADDREMOVE), btnModifyRemove); + else + SetWindowTextW(GetDlgItem(hWnd, IDC_ADDREMOVE), btnRemove); + + break; + } + } + } + } + + /* Enable/disable other buttons if necessary */ + EnableWindow(GetDlgItem(hWnd, IDC_ADDREMOVE), (selitem != -1)); + EnableWindow(GetDlgItem(hWnd, IDC_SUPPORT_INFO), (selitem != -1)); + EnableWindow(GetDlgItem(hWnd, IDC_MODIFY), enable_modify); } /****************************************************************************** @@ -421,8 +489,9 @@ static void InstallProgram(HWND hWnd) * Name : UninstallProgram * Description: Executes the specified program's installer. * Parameters : id - the internal ID of the installer to remove + * Parameters : button - ID of button pressed (Modify or Remove) */ -static void UninstallProgram(int id) +static void UninstallProgram(int id, DWORD button) { APPINFO *iter; STARTUPINFOW si; @@ -445,8 +514,9 @@ static void UninstallProgram(int id) memset(&si, 0, sizeof(STARTUPINFOW)); si.cb = sizeof(STARTUPINFOW); si.wShowWindow = SW_NORMAL; - res = CreateProcessW(NULL, iter->path, NULL, NULL, FALSE, 0, NULL, - NULL, &si, &info); + + res = CreateProcessW(NULL, (button == IDC_MODIFY) ? iter->path_modify : iter->path, + NULL, NULL, FALSE, 0, NULL, NULL, &si, &info); if (res) { @@ -788,6 +858,7 @@ static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar break; case IDC_ADDREMOVE: + case IDC_MODIFY: selitem = SendDlgItemMessageW(hWnd, IDL_PROGRAMS, LVM_GETNEXTITEM, -1, LVNI_FOCUSED|LVNI_SELECTED); @@ -798,7 +869,7 @@ static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar if (SendDlgItemMessageW(hWnd, IDL_PROGRAMS, LVM_GETITEMW, 0, (LPARAM) &lvItem)) - UninstallProgram(lvItem.lParam); + UninstallProgram(lvItem.lParam, LOWORD(wParam)); } hImageList = ResetApplicationList(FALSE, hWnd, hImageList); @@ -842,6 +913,8 @@ static void StartApplet(HWND hWnd) /* Load the strings we will use */ LoadStringW(hInst, IDS_TAB1_TITLE, tab_title, sizeof(tab_title) / sizeof(tab_title[0])); LoadStringW(hInst, IDS_CPL_TITLE, app_title, sizeof(app_title) / sizeof(app_title[0])); + LoadStringW(hInst, IDS_REMOVE, btnRemove, sizeof(btnRemove) / sizeof(btnRemove[0])); + LoadStringW(hInst, IDS_MODIFY_REMOVE, btnModifyRemove, sizeof(btnModifyRemove) / sizeof(btnModifyRemove[0])); /* Fill out the PROPSHEETPAGE */ psp.dwSize = sizeof (PROPSHEETPAGEW); diff --git a/dlls/appwiz.cpl/res.h b/dlls/appwiz.cpl/res.h index 1d605d79469..c336cf30b61 100644 --- a/dlls/appwiz.cpl/res.h +++ b/dlls/appwiz.cpl/res.h @@ -33,6 +33,7 @@ #define IDL_PROGRAMS 1011 #define IDC_ADDREMOVE 1012 #define IDC_SUPPORT_INFO 1013 +#define IDC_MODIFY 1014 #define IDC_INFO_PUBLISHER 1100 #define IDC_INFO_VERSION 1101 @@ -58,3 +59,5 @@ #define IDS_COLUMN_PUBLISHER 7 #define IDS_COLUMN_VERSION 8 #define IDS_INSTALL_FILTER 9 +#define IDS_REMOVE 10 +#define IDS_MODIFY_REMOVE 11 diff --git a/dlls/browseui/rsrc_De.rc b/dlls/browseui/rsrc_De.rc index b32400cef69..9a0b78e81de 100644 --- a/dlls/browseui/rsrc_De.rc +++ b/dlls/browseui/rsrc_De.rc @@ -19,6 +19,8 @@ #include "resids.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL STRINGTABLE diff --git a/dlls/comctl32/dpa.c b/dlls/comctl32/dpa.c index bbad10df8d0..43f2a3adf61 100644 --- a/dlls/comctl32/dpa.c +++ b/dlls/comctl32/dpa.c @@ -802,7 +802,8 @@ INT WINAPI DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart, INT l, r, x, n; LPVOID *lpPtr; - l = (nStart == -1) ? 0 : nStart; + /* for binary search ignore start index */ + l = 0; r = hdpa->nItemCount - 1; lpPtr = hdpa->ptrs; while (r >= l) { diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index aa68102385b..7c8f161a17e 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -247,8 +247,7 @@ HEADER_SetItemBounds (HEADER_INFO *infoPtr) static LRESULT HEADER_Size (HEADER_INFO *infoPtr) { - infoPtr->bRectsValid = FALSE; - + HEADER_SetItemBounds(infoPtr); return 0; } @@ -1225,10 +1224,12 @@ HEADER_GetUnicodeFormat (const HEADER_INFO *infoPtr) static LRESULT HEADER_HitTest (const HEADER_INFO *infoPtr, LPHDHITTESTINFO phti) { + UINT outside = HHT_NOWHERE | HHT_ABOVE | HHT_BELOW | HHT_TOLEFT | HHT_TORIGHT; + HEADER_InternalHitTest (infoPtr, &phti->pt, &phti->flags, &phti->iItem); - if (phti->flags == HHT_NOWHERE) - return -1; + if (phti->flags & outside) + return phti->iItem = -1; else return phti->iItem; } diff --git a/dlls/comctl32/tests/dpa.c b/dlls/comctl32/tests/dpa.c index ed28119ac89..741aeb63b23 100644 --- a/dlls/comctl32/tests/dpa.c +++ b/dlls/comctl32/tests/dpa.c @@ -289,9 +289,9 @@ static void test_dpa(void) ok(j == DPA_ERR, "j=%d\n", j); /* ... but for a binary search it's ignored */ j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, i+1, CB_CmpLT, 0xdeadbeef, DPAS_SORTED); - todo_wine ok(j+1 == i, "j=%d i=%d\n", j, i); + ok(j+1 == i, "j=%d i=%d\n", j, i); } - + /* Try to get the index of a nonexistent item */ i = pDPA_GetPtrIndex(dpa, (PVOID)7); ok(i == DPA_ERR, "i=%d\n", i); diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c index e357f9d1a72..611433e3cda 100644 --- a/dlls/comctl32/tests/header.c +++ b/dlls/comctl32/tests/header.c @@ -819,10 +819,8 @@ static void test_hdm_getitemrect(HWND hParent) expect(80, rect.left); expect(0, rect.top); expect(160, rect.right); - todo_wine - { - expect(g_customheight, rect.bottom); - } + expect(g_customheight, rect.bottom); + retVal = SendMessage(hChild, HDM_GETITEMRECT, 0, (LPARAM) &rect); ok(retVal == TRUE, "Getting item rect should TRUE, got %d\n", retVal); @@ -831,10 +829,8 @@ static void test_hdm_getitemrect(HWND hParent) expect(0, rect.top); expect(80, rect.right); - todo_wine - { - expect(g_customheight, rect.bottom); - } + expect(g_customheight, rect.bottom); + retVal = SendMessage(hChild, HDM_GETITEMRECT, 10, (LPARAM) &rect); ok(retVal == 0, "Getting rect of nonexistent item should return 0, got %d\n", retVal); @@ -906,30 +902,25 @@ static void test_hdm_hittest(HWND hParent) flush_sequences(sequences, NUM_MSG_SEQUENCES); retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo); - todo_wine - { - expect(0, retVal); - expect(0, hdHitTestInfo.iItem); - } + expect(0, retVal); + expect(0, hdHitTestInfo.iItem); + expect(HHT_ONDIVIDER, hdHitTestInfo.flags); pt.x = secondItemRightBoundary - 1; pt.y = bottomBoundary - 1; hdHitTestInfo.pt = pt; retVal = SendMessage(hChild, HDM_HITTEST, 1, (LPARAM) &hdHitTestInfo); - todo_wine - { - expect(1, retVal); - } + expect(1, retVal); expect(1, hdHitTestInfo.iItem); + expect(HHT_ONDIVIDER, hdHitTestInfo.flags); pt.x = secondItemRightBoundary; pt.y = bottomBoundary + 1; hdHitTestInfo.pt = pt; - todo_wine - { - retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo); - expect(-1, retVal); - } + retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo); + expect(-1, retVal); + expect(-1, hdHitTestInfo.iItem); + expect(HHT_BELOW, hdHitTestInfo.flags); ok_sequence(sequences, HEADER_SEQ_INDEX, hittest_seq, "hittest sequence testing", FALSE); @@ -950,11 +941,9 @@ static void test_hdm_sethotdivider(HWND hParent) "adder header control to parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); - todo_wine - { - retVal = SendMessage(hChild, HDM_SETHOTDIVIDER, TRUE, 0X00050005); - expect(0, retVal); - } + retVal = SendMessage(hChild, HDM_SETHOTDIVIDER, TRUE, MAKELPARAM(5, 5)); + expect(0, retVal); + retVal = SendMessage(hChild, HDM_SETHOTDIVIDER, FALSE, 100); expect(100, retVal); retVal = SendMessage(hChild, HDM_SETHOTDIVIDER, FALSE, 1); diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index c6cf83e2d87..0d11b2b65a8 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -4846,7 +4846,7 @@ TOOLBAR_SetRows (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPRECT lprc) if (seps) FIXME("Separators unhandled\n"); /* Round up so more per line, i.e., less rows */ - idealWrap = (infoPtr->nNumButtons - hidden + (rows-1)) / rows; + idealWrap = (infoPtr->nNumButtons - hidden + (rows-1)) / (rows ? rows : 1); /* Calculate ideal wrap point if we are allowed to grow, but cannot achieve the requested number of rows. */ diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 8bea9738a2b..8155aab6a75 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -1255,6 +1255,7 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i newItem->parent = parentItem; newItem->iIntegral = 1; + newItem->visibleOrder = -1; if (!TREEVIEW_DoSetItemT(infoPtr, newItem, tvItem, isW)) return 0; @@ -1367,6 +1368,8 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i TREEVIEW_VerifyTree(infoPtr); + if (!infoPtr->bRedraw) return (LRESULT)newItem; + if (parentItem == infoPtr->root || (ISVISIBLE(parentItem) && parentItem->state & TVIS_EXPANDED)) { @@ -1392,8 +1395,6 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i } else { - newItem->visibleOrder = -1; - /* refresh treeview if newItem is the first item inserted under parentItem */ if (ISVISIBLE(parentItem) && newItem->prevSibling == newItem->nextSibling) { @@ -1564,6 +1565,7 @@ TREEVIEW_DeleteItem(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem) TREEVIEW_VerifyTree(infoPtr); + if (!infoPtr->bRedraw) return TRUE; if (visible) { @@ -1586,12 +1588,16 @@ TREEVIEW_DeleteItem(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem) static LRESULT TREEVIEW_SetRedraw(TREEVIEW_INFO* infoPtr, WPARAM wParam) { - if(wParam) - infoPtr->bRedraw = TRUE; - else - infoPtr->bRedraw = FALSE; + infoPtr->bRedraw = wParam ? TRUE : FALSE; - return 0; + if (infoPtr->bRedraw) + { + TREEVIEW_UpdateSubTree(infoPtr, infoPtr->root); + TREEVIEW_RecalculateVisibleOrder(infoPtr, NULL); + TREEVIEW_UpdateScrollBars(infoPtr); + TREEVIEW_Invalidate(infoPtr, NULL); + } + return 0; } static LRESULT diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c index 63375bb2b9a..2bef8cefb45 100644 --- a/dlls/comdlg32/tests/filedlg.c +++ b/dlls/comdlg32/tests/filedlg.c @@ -273,23 +273,20 @@ static void test_create_view_template(void) /* test cases for resizing of the file dialog */ struct { DWORD flags; - int resize_folderchange; /* change in CDN_FOLDERCHANGE handler */ - int resize_selchange; /* change in CDN_SELCHANGE handler */ - int resize_timer1; /* change in first WM_TIMER handler */ - int resize_check; /* expected change (in second WM_TIMER handler) */ - BOOL todo; /* mark that test todo_wine */ - BOOL testcontrols; /* test resizing and moving of the controls */ + int resize_folderchange;/* change in CDN_FOLDERCHANGE handler */ + int resize_timer1; /* change in first WM_TIMER handler */ + int resize_check; /* expected change (in second WM_TIMER handler) */ + BOOL todo; /* mark that test todo_wine */ + BOOL testcontrols; /* test resizing and moving of the controls */ } resize_testcases[] = { - { 0 , 10, 10, 10, 30,FALSE,FALSE}, /* 0 */ - { 0 ,-10,-10,-10,-30,FALSE,FALSE}, - { OFN_ENABLESIZING , 0, 0, 0, 0,FALSE,FALSE}, - { OFN_ENABLESIZING , 0, 0,-10, 0,FALSE,FALSE}, - { OFN_ENABLESIZING , 0, 0, 10, 10,FALSE, TRUE}, - { OFN_ENABLESIZING , 0,-10, 0, 0,FALSE,FALSE}, /* 5 */ - { OFN_ENABLESIZING , 0, 10, 0, 10,FALSE,FALSE}, - { OFN_ENABLESIZING ,-10, 0, 0, 10,FALSE,FALSE}, - { OFN_ENABLESIZING , 10, 0, 0, 10,FALSE,FALSE}, - { OFN_ENABLESIZING , 0, 0, 10, 20,FALSE,FALSE}, + { 0 , 10, 10, 20,FALSE,FALSE}, /* 0 */ + { 0 ,-10,-10,-20,FALSE,FALSE}, + { OFN_ENABLESIZING , 0, 0, 0,FALSE,FALSE}, + { OFN_ENABLESIZING , 0,-10, 0,FALSE,FALSE}, + { OFN_ENABLESIZING , 0, 10, 10,FALSE, TRUE}, + { OFN_ENABLESIZING ,-10, 0, 10,FALSE,FALSE}, /* 5 */ + { OFN_ENABLESIZING , 10, 0, 10,FALSE,FALSE}, + { OFN_ENABLESIZING , 0, 10, 20,FALSE,FALSE}, /* mark the end */ { 0xffffffff } }; @@ -338,12 +335,6 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L MoveWindow( parent, initrc.left,initrc.top, initrc.right - initrc.left + resize, initrc.bottom - initrc.top + resize, TRUE); } - } else if(( (LPNMHDR)lParam)->code == CDN_SELCHANGE){ - if( (resize = resize_testcases[index].resize_selchange)){ - GetWindowRect( parent, &rc); - MoveWindow( parent, rc.left,rc.top, rc.right - rc.left + resize, - rc.bottom - rc.top + resize, TRUE); - } SetTimer( dlg, 0, 100, 0); } break; diff --git a/dlls/crypt32/crypt32_No.rc b/dlls/crypt32/crypt32_No.rc index 26652860105..b9edbff2837 100644 --- a/dlls/crypt32/crypt32_No.rc +++ b/dlls/crypt32/crypt32_No.rc @@ -1,7 +1,7 @@ /* * crypt32 dll resources * - * Copyright (C) 2006 Alexander N. Sørnes + * Copyright (C) 2006-2009 Alexander N. Sørnes * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,22 +20,24 @@ #include "cryptres.h" +#pragma code_page(65001) + LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL STRINGTABLE DISCARDABLE { - IDS_AUTHORITY_KEY_ID "Identifiserer for autentiseringsnøkkel" - IDS_KEY_ATTRIBUTES "Nøkkelegenskaper" - IDS_KEY_USAGE_RESTRICTION "Begrensning av nøkkelbruk" + IDS_AUTHORITY_KEY_ID "Identifiserer for autentiseringsnøkkel" + IDS_KEY_ATTRIBUTES "Nøkkelegenskaper" + IDS_KEY_USAGE_RESTRICTION "Begrensning av nøkkelbruk" IDS_SUBJECT_ALT_NAME "Alternativt navn for emne" IDS_ISSUER_ALT_NAME "Alternativt navn for utsteder" IDS_BASIC_CONSTRAINTS "Basisbegrensninger" - IDS_KEY_USAGE "Nøkkelbruk" + IDS_KEY_USAGE "Nøkkelbruk" IDS_CERT_POLICIES "Sertifikatholdninger" - IDS_SUBJECT_KEY_IDENTIFIER "Identifiserer for emnenøkkel" + IDS_SUBJECT_KEY_IDENTIFIER "Identifiserer for emnenøkkel" IDS_CRL_REASON_CODE "CRL-grunnkode" IDS_CRL_DIST_POINTS "CRL-distribusjonspunkter" - IDS_ENHANCED_KEY_USAGE "Forbedret nøkkelbruk" + IDS_ENHANCED_KEY_USAGE "Forbedret nøkkelbruk" IDS_AUTHORITY_INFO_ACCESS "Myndighet-informasjonstilgang" IDS_CERT_EXTENSIONS "Sertifikatutvidelser" IDS_NEXT_UPDATE_LOCATION "Neste oppdateringsplassering" @@ -54,7 +56,7 @@ STRINGTABLE DISCARDABLE IDS_USER_NOTICE "Brukervarsel" IDS_OCSP "On-line Certificate Status Protocol" IDS_CA_ISSUER "Utsteder for sertifiseringsautoritet" - IDS_CERT_TEMPLATE_NAME "Navn på sertifiseringsmal" + IDS_CERT_TEMPLATE_NAME "Navn på sertifiseringsmal" IDS_CERT_TYPE "Sertifikattype" IDS_CERT_MANIFOLD "Sertifikatmangfold" IDS_NETSCAPE_CERT_TYPE "Netscape-sertifikattype" @@ -94,15 +96,15 @@ STRINGTABLE DISCARDABLE IDS_ISSUING_DIST_POINT "Utsteder distribusjonspunkt" IDS_FRESHEST_CRL "Nyeste CRL" IDS_NAME_CONSTRAINTS "Navnebegrensninger" - IDS_POLICY_MAPPINGS "Framgangsmåtekartlegginger" - IDS_POLICY_CONSTRAINTS "Framgangsmåtebegresninger" + IDS_POLICY_MAPPINGS "Framgangsmåtekartlegginger" + IDS_POLICY_CONSTRAINTS "Framgangsmåtebegresninger" IDS_CROSS_CERT_DIST_POINTS "Distribusjonspunkter for kryss-sertifikat" - IDS_APPLICATION_POLICIES "Framgangsmåter for programmers" - IDS_APPLICATION_POLICY_MAPPINGS "Framgangsmåtekartlegginger for programmer" - IDS_APPLICATION_POLICY_CONSTRAINTS "Framgangsmåtebegrensninger for programmer" + IDS_APPLICATION_POLICIES "Framgangsmåter for programmers" + IDS_APPLICATION_POLICY_MAPPINGS "Framgangsmåtekartlegginger for programmer" + IDS_APPLICATION_POLICY_CONSTRAINTS "Framgangsmåtebegrensninger for programmer" IDS_CMC_DATA "CMC-data" IDS_CMC_RESPONSE "CMS-svar" - IDS_UNSIGNED_CMC_REQUEST "Usignert CMC-forespørsel" + IDS_UNSIGNED_CMC_REQUEST "Usignert CMC-forespørsel" IDS_CMC_STATUS_INFO "CMC-statusinformasjon" IDS_CMC_EXTENSIONS "CMC-utvidelser" IDS_CMC_ATTRIBUTES "CMC-egenskaper" @@ -110,30 +112,30 @@ STRINGTABLE DISCARDABLE IDS_PKCS_7_SIGNED "PKCS 7 Signert" IDS_PKCS_7_ENVELOPED "PKCS 7 Innpakket" IDS_PKCS_7_SIGNED_ENVELOPED "PKCS 7 Signert Innpakket" - IDS_PKCS_7_DIGESTED "PKCS 7 Fordøyet" + IDS_PKCS_7_DIGESTED "PKCS 7 Fordøyet" IDS_PKCS_7_ENCRYPTED "PKCS 7 Kryptert" IDS_PREVIOUS_CA_CERT_HASH "Forrige CA-sertifikatlappskaus" IDS_CRL_VIRTUAL_BASE "Virtuelt basis-CRL-nummer" IDS_CRL_NEXT_PUBLISH "Neste CRL-utgiving" IDS_CA_EXCHANGE "CA-krypteringssertifikat" - IDS_KEY_RECOVERY_AGENT "Agent for nøkkelgjenoppretting" + IDS_KEY_RECOVERY_AGENT "Agent for nøkkelgjenoppretting" IDS_CERTIFICATE_TEMPLATE "Informasjon om sertifikatmal" IDS_ENTERPRISE_ROOT_OID "Storselskap-rot-OID" IDS_RDN_DUMMY_SIGNER "Tullesignerer" - IDS_ARCHIVED_KEY_ATTR "Kryptert privat nøkkel" + IDS_ARCHIVED_KEY_ATTR "Kryptert privat nøkkel" IDS_CRL_SELF_CDP "Publisert CRL-plasseringer" - IDS_REQUIRE_CERT_CHAIN_POLICY "Håndhev sertifikatlenkepolitikk" + IDS_REQUIRE_CERT_CHAIN_POLICY "Håndhev sertifikatlenkepolitikk" IDS_TRANSACTION_ID "Transaksjons-id" IDS_SENDER_NONCE "Gjeldende sender" IDS_RECIPIENT_NONCE "Gjeldende mottaker" IDS_REG_INFO "Reg info" IDS_GET_CERTIFICATE "Hent sertifikat" IDS_GET_CRL "Hent CRL" - IDS_REVOKE_REQUEST "Gjenoppliv forespørsel" - IDS_QUERY_PENDING "Spørring venter" + IDS_REVOKE_REQUEST "Gjenoppliv forespørsel" + IDS_QUERY_PENDING "Spørring venter" IDS_SORTED_CTL "Tillitsliste for sertifikater" - IDS_ARCHIVED_KEY_CERT_HASH "Arkivert nøkkelsertifikatlappskaus" - IDS_PRIVATE_KEY_USAGE_PERIOD "Privat nøkkelbrukperiode" + IDS_ARCHIVED_KEY_CERT_HASH "Arkivert nøkkelsertifikatlappskaus" + IDS_PRIVATE_KEY_USAGE_PERIOD "Privat nøkkelbrukperiode" IDS_CLIENT_INFORMATION "Klientinformasjon" IDS_SERVER_AUTHENTICATION "Tjenerautentisering" IDS_CLIENT_AUTHENTICATION "Klientautentisering" @@ -150,21 +152,21 @@ STRINGTABLE DISCARDABLE IDS_NT5_CRYPTO "Windows sytemkomponent-godkjenning" IDS_OEM_WHQL_CRYPTO "OEM Windows systemkomponent-godkjenning" IDS_EMBEDDED_NT_CRYPTO "Innebygget Windows systemkomponent-godkjenning" - IDS_KEY_PACK_LICENSES "Nøkkelpakkelisenser" + IDS_KEY_PACK_LICENSES "Nøkkelpakkelisenser" IDS_LICENSE_SERVER "Lisenstjener-verifisering" - IDS_SMART_CARD_LOGON "Smart Card-pålogging" + IDS_SMART_CARD_LOGON "Smart Card-pålogging" IDS_DIGITAL_RIGHTS "Digitale rettigheter" IDS_QUALIFIED_SUBORDINATION "Kvalifisert underordinering" - IDS_KEY_RECOVERY "Nøkkelgjenoppretting" + IDS_KEY_RECOVERY "Nøkkelgjenoppretting" IDS_DOCUMENT_SIGNING "Dokumentsignering" IDS_IPSEC_IKE_INTERMEDIATE "IP-sikkerhet IKE viderekommen" IDS_FILE_RECOVERY "Filgjenoppretting" IDS_ROOT_LIST_SIGNER "Rotlistesignerer" - IDS_ANY_APPLICATION_POLICIES "Alle framgangsmåter for programmer" + IDS_ANY_APPLICATION_POLICIES "Alle framgangsmåter for programmer" IDS_DS_EMAIL_REPLICATION "Katalogtjeneste e-postreplikering" - IDS_ENROLLMENT_AGENT "Agent for sertifikatforespørsler" + IDS_ENROLLMENT_AGENT "Agent for sertifikatforespørsler" IDS_LIFETIME_SIGNING "Livstidsignering" - IDS_ANY_CERT_POLICY "Alle framgangsmåter for utsteding" + IDS_ANY_CERT_POLICY "Alle framgangsmåter for utsteding" } STRINGTABLE DISCARDABLE @@ -173,4 +175,69 @@ STRINGTABLE DISCARDABLE IDS_LOCALIZEDNAME_MY "Personlig" IDS_LOCALIZEDNAME_CA "Mellomliggende sertifiseringsinstanser" IDS_LOCALIZEDNAME_ADDRESSBOOK "Andre personer" + IDS_LOCALIZEDNAME_TRUSTEDPUBLISHER "Betrodde utgivere" + IDS_LOCALIZEDNAME_DISALLOWED "Mistrodde sertifikater" +} + +STRINGTABLE DISCARDABLE +{ + IDS_KEY_ID "NøkkelID=" + IDS_CERT_ISSUER "Utsteder" + IDS_CERT_SERIAL_NUMBER "Serienummer=" + IDS_ALT_NAME_OTHER_NAME "Annet navn=" + IDS_ALT_NAME_RFC822_NAME "E-postadresse=" + IDS_ALT_NAME_DNS_NAME "DNS-navn=" + IDS_ALT_NAME_DIRECTORY_NAME "Katalogadresse" + IDS_ALT_NAME_URL "URL=" + IDS_ALT_NAME_IP_ADDRESS "IP-adresse=" + IDS_ALT_NAME_MASK "Mask=" + IDS_ALT_NAME_REGISTERED_ID "Registrert ID=" + IDS_USAGE_UNKNOWN "Ukjent nøkkelbruk" + IDS_SUBJECT_TYPE "Emnetype=" + IDS_SUBJECT_TYPE_CA "CA" + IDS_SUBJECT_TYPE_END_CERT "Sluttenhet" + IDS_PATH_LENGTH "Begrensning på stilengde=" + IDS_PATH_LENGTH_NONE "Ingen" + IDS_INFO_NOT_AVAILABLE "Informasjonen er utilgjengelig" + IDS_AIA "Tilgang til autoritetsinfo" + IDS_ACCESS_METHOD "Tilgangsmetode=" + IDS_ACCESS_METHOD_OCSP "OCSP" + IDS_ACCESS_METHOD_CA_ISSUERS "CA-utstedere" + IDS_ACCESS_METHOD_UNKNOWN "Ukjent tilgangsmetode" + IDS_ACCESS_LOCATION "Alternativt navn" + IDS_CRL_DIST_POINT "Distribusjonspunkt for CRL" + IDS_CRL_DIST_POINT_NAME "Navn på distribusjonspunkt" + IDS_CRL_DIST_POINT_FULL_NAME "Fult navn" + IDS_CRL_DIST_POINT_RDN_NAME "RDN-navn" + IDS_CRL_DIST_POINT_REASON "CRL-årsak=" + IDS_CRL_DIST_POINT_ISSUER "CRL-utsteder" + IDS_REASON_KEY_COMPROMISE "Nøkellkompromiss" + IDS_REASON_CA_COMPROMISE "CA-kompromiss" + IDS_REASON_AFFILIATION_CHANGED "Tilslutning endret" + IDS_REASON_SUPERSEDED "Erstattet" + IDS_REASON_CESSATION_OF_OPERATION "Operasjonen opphørte" + IDS_REASON_CERTIFICATE_HOLD "Sertifikatet er holdt tilbake" + IDS_FINANCIAL_CRITERIA "Finansiell informasjon=" + IDS_FINANCIAL_CRITERIA_AVAILABLE "Tilgjengelig" + IDS_FINANCIAL_CRITERIA_NOT_AVAILABLE "Ikke tilgjengelig" + IDS_FINANCIAL_CRITERIA_MEETS_CRITERIA "Møter kriterier=" + IDS_YES "Ja" + IDS_NO "Nei" + IDS_DIGITAL_SIGNATURE "Digital signatur" + IDS_NON_REPUDIATION "Kan ikke tilbakekalles" + IDS_KEY_ENCIPHERMENT "Nøkkelkryptering" + IDS_DATA_ENCIPHERMENT "Datakryptering" + IDS_KEY_AGREEMENT "Nøkkel-avtale" + IDS_CERT_SIGN "Sertifikatsignering" + IDS_OFFLINE_CRL_SIGN "Lokal CRL-signering" + IDS_CRL_SIGN "CRL-signering" + IDS_ENCIPHER_ONLY "Kun kryptering" + IDS_DECIPHER_ONLY "Kun dekryptering" + IDS_NETSCAPE_SSL_CLIENT "Autentisering av SSL-klient" + IDS_NETSCAPE_SSL_SERVER "Autentisering av SSL-tjener" + IDS_NETSCAPE_SMIME "S/MIME" + IDS_NETSCAPE_SIGN "Signatur" + IDS_NETSCAPE_SSL_CA "SSL CA" + IDS_NETSCAPE_SMIME_CA "S/MIME CA" + IDS_NETSCAPE_SIGN_CA "Signatur CA" } diff --git a/dlls/crypt32/crypt32_Pt.rc b/dlls/crypt32/crypt32_Pt.rc index 5c5d3b701fb..dcce8097a01 100644 --- a/dlls/crypt32/crypt32_Pt.rc +++ b/dlls/crypt32/crypt32_Pt.rc @@ -20,7 +20,9 @@ #include "cryptres.h" -LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL +#pragma code_page(65001) + +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE STRINGTABLE DISCARDABLE { @@ -108,11 +110,11 @@ STRINGTABLE DISCARDABLE IDS_CMC_ATTRIBUTES "Atributos CMC" IDS_PKCS_7_DATA "Dados PKCS 7" IDS_PKCS_7_SIGNED "Assinado PKCS 7" - IDS_PKCS_7_ENVELOPED "PKCS 7 Enveloped" - IDS_PKCS_7_SIGNED_ENVELOPED "PKCS 7 Signed Enveloped" + IDS_PKCS_7_ENVELOPED "PKCS 7 Envolvido" + IDS_PKCS_7_SIGNED_ENVELOPED "PKCS 7 Assinado Envolvido" IDS_PKCS_7_DIGESTED "PKCS 7 Resumido" IDS_PKCS_7_ENCRYPTED "PKCS 7 Cifrado" - IDS_PREVIOUS_CA_CERT_HASH "Hash Certificado CA prévio" + IDS_PREVIOUS_CA_CERT_HASH "Hash anterior de Certificado CA" IDS_CRL_VIRTUAL_BASE "Número CRL de Base Virtual" IDS_CRL_NEXT_PUBLISH "Próxima Publicação CRL" IDS_CA_EXCHANGE "Certificado de Cifra CA" @@ -173,6 +175,8 @@ STRINGTABLE DISCARDABLE IDS_LOCALIZEDNAME_MY "Pessoal" IDS_LOCALIZEDNAME_CA "Autoridades de Certificação Intermédias" IDS_LOCALIZEDNAME_ADDRESSBOOK "Outras pessoas" + IDS_LOCALIZEDNAME_TRUSTEDPUBLISHER "Publicadores Confiáveis" + IDS_LOCALIZEDNAME_DISALLOWED "Certificados Desconfiáveis" } STRINGTABLE DISCARDABLE @@ -219,4 +223,21 @@ STRINGTABLE DISCARDABLE IDS_FINANCIAL_CRITERIA_MEETS_CRITERIA "Conforme os Critérios=" IDS_YES "Sim" IDS_NO "Não" + IDS_DIGITAL_SIGNATURE "Assinatura Digital" + IDS_NON_REPUDIATION "Não-Repudiação" + IDS_KEY_ENCIPHERMENT "Ciframento de Chaves" + IDS_DATA_ENCIPHERMENT "Ciframento de Dados" + IDS_KEY_AGREEMENT "Acordo de Chaves" + IDS_CERT_SIGN "Assinatura de Certificados" + IDS_OFFLINE_CRL_SIGN "Assinatura CRL Off-line" + IDS_CRL_SIGN "Assinatura CRL" + IDS_ENCIPHER_ONLY "Cifrar apenas" + IDS_DECIPHER_ONLY "Decifrar apenas" + IDS_NETSCAPE_SSL_CLIENT "Autenticação de Cliente SSL" + IDS_NETSCAPE_SSL_SERVER "Autenticação de Servidor SSL" + IDS_NETSCAPE_SMIME "S/MIME" + IDS_NETSCAPE_SIGN "Assinatura" + IDS_NETSCAPE_SSL_CA "SSL CA" + IDS_NETSCAPE_SMIME_CA "S/MIME CA" + IDS_NETSCAPE_SIGN_CA "CA de Assinatura" } diff --git a/dlls/cryptdlg/Makefile.in b/dlls/cryptdlg/Makefile.in index 311e805fb15..0cc2d3f9f75 100644 --- a/dlls/cryptdlg/Makefile.in +++ b/dlls/cryptdlg/Makefile.in @@ -15,6 +15,7 @@ RC_SRCS = \ cryptdlg_Ko.rc \ cryptdlg_Lt.rc \ cryptdlg_Nl.rc \ + cryptdlg_Pt.rc \ cryptdlg_Ro.rc @MAKE_DLL_RULES@ diff --git a/programs/reg/Pt.rc b/dlls/cryptdlg/cryptdlg_Pt.rc similarity index 53% copy from programs/reg/Pt.rc copy to dlls/cryptdlg/cryptdlg_Pt.rc index 6294408973e..92d179cd5cd 100644 --- a/programs/reg/Pt.rc +++ b/dlls/cryptdlg/cryptdlg_Pt.rc @@ -1,8 +1,6 @@ /* - * REG.EXE - Wine-compatible reg program. - * Portuguese language support + * cryptdlg dll Portuguese resources * - * Copyright 2008 Andrew Riedi * Copyright 2008 Ricardo Filipe * * This library is free software; you can redistribute it and/or @@ -20,14 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "reg.h" +#include "cryptres.h" -LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL +#pragma code_page(65001) -STRINGTABLE +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE + +STRINGTABLE DISCARDABLE { - STRING_USAGE, "A sintaxe deste comando é:\n\nREG [ ADD | DELETE | QUERY ]\nREG comando /?\n" - STRING_ADD_USAGE, "REG ADD nome_chave [/v nome_valor | /ve] [/t tipo] [/s separador] [/d dados] [/f]\n" - STRING_DELETE_USAGE, "REG DELETE nome_chave [/v nome_valor | /ve | /va] [/f]\n" - STRING_QUERY_USAGE, "REG QUERY nome_chave [/v nome_valor | /ve] [/s]\n" + IDS_CERT_POLICY "Política de Certificados" + IDS_POLICY_ID "Identificador da Política: " + IDS_POLICY_QUALIFIER_INFO "Informação do Qualificador da Política" + IDS_POLICY_QUALIFIER_ID "ID do Qualificador da Política=" + IDS_CPS "CPS" /* Certification Practice Statement */ + IDS_USER_NOTICE "Aviso ao Utilizador" + IDS_QUALIFIER "Qualificador" + IDS_NOTICE_REF "Referência do Aviso" + IDS_ORGANIZATION "Organização=" + IDS_NOTICE_NUM "Número do Aviso=" + IDS_NOTICE_TEXT "Texto do Aviso=" } diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index c5a74aa54a3..60f2aa0198e 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -31,17 +31,17 @@ /* TRACE helper functions */ const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type); -enum d3d10_effect_variable_type +enum d3d10_effect_object_type { - D3D10_EVT_VERTEXSHADER = 6, - D3D10_EVT_PIXELSHADER = 7, - D3D10_EVT_GEOMETRYSHADER = 8, + D3D10_EOT_VERTEXSHADER = 6, + D3D10_EOT_PIXELSHADER = 7, + D3D10_EOT_GEOMETRYSHADER = 8, }; -struct d3d10_effect_variable +struct d3d10_effect_object { struct d3d10_effect_pass *pass; - enum d3d10_effect_variable_type type; + enum d3d10_effect_object_type type; DWORD idx_offset; void *data; }; @@ -58,6 +58,23 @@ struct d3d10_effect_shader_variable } shader; }; +/* ID3D10EffectVariable */ +struct d3d10_effect_variable +{ + const struct ID3D10EffectVariableVtbl *vtbl; + + char *name; + DWORD buffer_offset; +}; + +struct d3d10_effect_local_buffer +{ + char *name; + DWORD data_size; + DWORD variable_count; + struct d3d10_effect_variable *variables; +}; + /* ID3D10EffectPass */ struct d3d10_effect_pass { @@ -66,8 +83,8 @@ struct d3d10_effect_pass struct d3d10_effect_technique *technique; char *name; DWORD start; - DWORD variable_count; - struct d3d10_effect_variable *variables; + DWORD object_count; + struct d3d10_effect_object *objects; }; /* ID3D10EffectTechnique */ @@ -77,7 +94,6 @@ struct d3d10_effect_technique struct d3d10_effect *effect; char *name; - DWORD start; DWORD pass_count; struct d3d10_effect_pass *passes; }; @@ -91,7 +107,7 @@ struct d3d10_effect ID3D10Device *device; DWORD version; - DWORD localbuffers_count; + DWORD local_buffer_count; DWORD localobjects_count; DWORD sharedbuffers_count; DWORD sharedobjects_count; @@ -101,6 +117,8 @@ struct d3d10_effect DWORD blendstate_count; DWORD rasterizerstate_count; DWORD samplerstate_count; + + struct d3d10_effect_local_buffer *local_buffers; struct d3d10_effect_technique *techniques; }; diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 8316db8f9b8..37d2dcb9fbf 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d10); static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl; static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl; +static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl; static inline void read_dword(const char **ptr, DWORD *d) { @@ -124,75 +125,22 @@ static HRESULT parse_dxbc(const char *data, SIZE_T data_size, return hr; } -static HRESULT parse_fx10_pass_index(struct d3d10_effect_pass *p, const char **ptr) +static char *copy_name(const char *ptr) { - unsigned int i; - - read_dword(ptr, &p->start); - TRACE("Pass starts at offset %#x\n", p->start); - - read_dword(ptr, &p->variable_count); - TRACE("Pass has %u variables\n", p->variable_count); - - skip_dword_unknown(ptr, 1); - - p->variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->variable_count * sizeof(*p->variables)); - if (!p->variables) - { - ERR("Failed to allocate variables memory\n"); - return E_OUTOFMEMORY; - } - - for (i = 0; i < p->variable_count; ++i) - { - struct d3d10_effect_variable *v = &p->variables[i]; - - v->pass = p; - - read_dword(ptr, &v->type); - TRACE("Variable %u is of type %#x\n", i, v->type); - - skip_dword_unknown(ptr, 2); - - read_dword(ptr, &v->idx_offset); - TRACE("Variable %u idx is at offset %#x\n", i, v->idx_offset); - } - - return S_OK; -} - -static HRESULT parse_fx10_technique_index(struct d3d10_effect_technique *t, const char **ptr) -{ - HRESULT hr = S_OK; - unsigned int i; - - read_dword(ptr, &t->start); - TRACE("Technique starts at offset %#x\n", t->start); - - read_dword(ptr, &t->pass_count); - TRACE("Technique has %u passes\n", t->pass_count); - - skip_dword_unknown(ptr, 1); + size_t name_len; + char *name; - t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes)); - if (!t->passes) + name_len = strlen(ptr) + 1; + name = HeapAlloc(GetProcessHeap(), 0, name_len); + if (!name) { - ERR("Failed to allocate passes memory\n"); - return E_OUTOFMEMORY; + ERR("Failed to allocate name memory.\n"); + return NULL; } - for (i = 0; i < t->pass_count; ++i) - { - struct d3d10_effect_pass *p = &t->passes[i]; - - p->vtbl = &d3d10_effect_pass_vtbl; - p->technique = t; - - hr = parse_fx10_pass_index(p, ptr); - if (FAILED(hr)) break; - } + memcpy(name, ptr, name_len); - return hr; + return name; } static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx) @@ -259,16 +207,16 @@ static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag return S_OK; } -static HRESULT parse_shader(struct d3d10_effect_variable *v, const char *data) +static HRESULT parse_shader(struct d3d10_effect_object *o, const char *data) { - ID3D10Device *device = v->pass->technique->effect->device; + ID3D10Device *device = o->pass->technique->effect->device; struct d3d10_effect_shader_variable *s; const char *ptr = data; DWORD dxbc_size; HRESULT hr; - v->data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3d10_effect_shader_variable)); - if (!v->data) + o->data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3d10_effect_shader_variable)); + if (!o->data) { ERR("Failed to allocate shader variable memory\n"); return E_OUTOFMEMORY; @@ -276,23 +224,23 @@ static HRESULT parse_shader(struct d3d10_effect_variable *v, const char *data) if (!ptr) return S_OK; - s = v->data; + s = o->data; read_dword(&ptr, &dxbc_size); TRACE("dxbc size: %#x\n", dxbc_size); - switch (v->type) + switch (o->type) { - case D3D10_EVT_VERTEXSHADER: + case D3D10_EOT_VERTEXSHADER: hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &s->shader.vs); if (FAILED(hr)) return hr; break; - case D3D10_EVT_PIXELSHADER: + case D3D10_EOT_PIXELSHADER: hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &s->shader.ps); if (FAILED(hr)) return hr; break; - case D3D10_EVT_GEOMETRYSHADER: + case D3D10_EOT_GEOMETRYSHADER: hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &s->shader.gs); if (FAILED(hr)) return hr; break; @@ -301,47 +249,55 @@ static HRESULT parse_shader(struct d3d10_effect_variable *v, const char *data) return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, s); } -static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char *data) +static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr, const char *data) { - const char *ptr; + const char *data_ptr; DWORD offset; HRESULT hr; - ptr = data + v->idx_offset; - read_dword(&ptr, &offset); + read_dword(ptr, &o->type); + TRACE("Effect object is of type %#x.\n", o->type); + + skip_dword_unknown(ptr, 2); - TRACE("Variable of type %#x starts at offset %#x\n", v->type, offset); + read_dword(ptr, &offset); + TRACE("Effect object idx is at offset %#x.\n", offset); + + data_ptr = data + offset; + read_dword(&data_ptr, &offset); + + TRACE("Effect object starts at offset %#x.\n", offset); /* FIXME: This probably isn't completely correct. */ if (offset == 1) { - WARN("Skipping variable\n"); - ptr = NULL; + WARN("Skipping effect object.\n"); + data_ptr = NULL; } else { - ptr = data + offset; + data_ptr = data + offset; } - switch (v->type) + switch (o->type) { - case D3D10_EVT_VERTEXSHADER: + case D3D10_EOT_VERTEXSHADER: TRACE("Vertex shader\n"); - hr = parse_shader(v, ptr); + hr = parse_shader(o, data_ptr); break; - case D3D10_EVT_PIXELSHADER: + case D3D10_EOT_PIXELSHADER: TRACE("Pixel shader\n"); - hr = parse_shader(v, ptr); + hr = parse_shader(o, data_ptr); break; - case D3D10_EVT_GEOMETRYSHADER: + case D3D10_EOT_GEOMETRYSHADER: TRACE("Geometry shader\n"); - hr = parse_shader(v, ptr); + hr = parse_shader(o, data_ptr); break; default: - FIXME("Unhandled variable type %#x\n", v->type); + FIXME("Unhandled object type %#x\n", o->type); hr = E_FAIL; break; } @@ -349,75 +305,178 @@ static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char * return hr; } -static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char *data) +static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, const char *data) { HRESULT hr = S_OK; - const char *ptr; - size_t name_len; unsigned int i; + DWORD offset; - ptr = data + p->start; + read_dword(ptr, &offset); + TRACE("Pass name at offset %#x.\n", offset); - name_len = strlen(ptr) + 1; - p->name = HeapAlloc(GetProcessHeap(), 0, name_len); + p->name = copy_name(data + offset); if (!p->name) { - ERR("Failed to allocate name memory\n"); + ERR("Failed to copy name.\n"); return E_OUTOFMEMORY; } + TRACE("Pass name: %s.\n", p->name); - memcpy(p->name, ptr, name_len); - ptr += name_len; + read_dword(ptr, &p->object_count); + TRACE("Pass has %u effect objects.\n", p->object_count); - TRACE("pass name: %s\n", p->name); + skip_dword_unknown(ptr, 1); - for (i = 0; i < p->variable_count; ++i) + p->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->object_count * sizeof(*p->objects)); + if (!p->objects) { - hr = parse_fx10_variable(&p->variables[i], data); - if (FAILED(hr)) break; + ERR("Failed to allocate effect objects memory.\n"); + return E_OUTOFMEMORY; + } + + for (i = 0; i < p->object_count; ++i) + { + struct d3d10_effect_object *o = &p->objects[i]; + + o->pass = p; + + hr = parse_fx10_object(o, ptr, data); + if (FAILED(hr)) return hr; } return hr; } -static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char *data) +static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char **ptr, const char *data) { - HRESULT hr = S_OK; - const char *ptr; - size_t name_len; unsigned int i; + DWORD offset; - ptr = data + t->start; + read_dword(ptr, &offset); + TRACE("Technique name at offset %#x.\n", offset); - name_len = strlen(ptr) + 1; - t->name = HeapAlloc(GetProcessHeap(), 0, name_len); + t->name = copy_name(data + offset); if (!t->name) { - ERR("Failed to allocate name memory\n"); + ERR("Failed to copy name.\n"); return E_OUTOFMEMORY; } + TRACE("Technique name: %s.\n", t->name); + + read_dword(ptr, &t->pass_count); + TRACE("Technique has %u passes\n", t->pass_count); - memcpy(t->name, ptr, name_len); - ptr += name_len; + skip_dword_unknown(ptr, 1); - TRACE("technique name: %s\n", t->name); + t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes)); + if (!t->passes) + { + ERR("Failed to allocate passes memory\n"); + return E_OUTOFMEMORY; + } for (i = 0; i < t->pass_count; ++i) { - hr = parse_fx10_pass(&t->passes[i], data); - if (FAILED(hr)) break; + struct d3d10_effect_pass *p = &t->passes[i]; + HRESULT hr; + + p->vtbl = &d3d10_effect_pass_vtbl; + p->technique = t; + + hr = parse_fx10_pass(p, ptr, data); + if (FAILED(hr)) return hr; } - return hr; + return S_OK; +} + +static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data) +{ + DWORD offset; + + read_dword(ptr, &offset); + TRACE("Variable name at offset %#x.\n", offset); + + v->name = copy_name(data + offset); + if (!v->name) + { + ERR("Failed to copy name.\n"); + return E_OUTOFMEMORY; + } + TRACE("Variable name: %s.\n", v->name); + + read_dword(ptr, &offset); + TRACE("Variable type info at offset %#x.\n", offset); + + skip_dword_unknown(ptr, 1); + + read_dword(ptr, &v->buffer_offset); + TRACE("Variable offset in buffer: %#x.\n", v->buffer_offset); + + skip_dword_unknown(ptr, 3); + + return S_OK; +} + +static HRESULT parse_fx10_local_buffer(struct d3d10_effect_local_buffer *l, const char **ptr, const char *data) +{ + unsigned int i; + DWORD offset; + + read_dword(ptr, &offset); + TRACE("Local buffer name at offset %#x.\n", offset); + + l->name = copy_name(data + offset); + if (!l->name) + { + ERR("Failed to copy name.\n"); + return E_OUTOFMEMORY; + } + TRACE("Local buffer name: %s.\n", l->name); + + read_dword(ptr, &l->data_size); + TRACE("Local buffer data size: %#x.\n", l->data_size); + + skip_dword_unknown(ptr, 1); + + read_dword(ptr, &l->variable_count); + TRACE("Local buffer variable count: %#x.\n", l->variable_count); + + skip_dword_unknown(ptr, 2); + + l->variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->variable_count * sizeof(*l->variables)); + if (!l->variables) + { + ERR("Failed to allocate variables memory.\n"); + return E_OUTOFMEMORY; + } + + for (i = 0; i < l->variable_count; ++i) + { + struct d3d10_effect_variable *v = &l->variables[i]; + HRESULT hr; + + v->vtbl = &d3d10_effect_variable_vtbl; + + hr = parse_fx10_variable(v, ptr, data); + if (FAILED(hr)) return hr; + } + + return S_OK; } static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size) { const char *ptr = data + e->index_offset; - HRESULT hr = S_OK; unsigned int i; + HRESULT hr; - skip_dword_unknown(&ptr, 6); + e->local_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_buffer_count * sizeof(*e->local_buffers)); + if (!e->local_buffers) + { + ERR("Failed to allocate local buffer memory.\n"); + return E_OUTOFMEMORY; + } e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques)); if (!e->techniques) @@ -426,6 +485,14 @@ static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD d return E_OUTOFMEMORY; } + for (i = 0; i < e->local_buffer_count; ++i) + { + struct d3d10_effect_local_buffer *l = &e->local_buffers[i]; + + hr = parse_fx10_local_buffer(l, &ptr, data); + if (FAILED(hr)) return hr; + } + for (i = 0; i < e->technique_count; ++i) { struct d3d10_effect_technique *t = &e->techniques[i]; @@ -433,14 +500,11 @@ static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD d t->vtbl = &d3d10_effect_technique_vtbl; t->effect = e; - hr = parse_fx10_technique_index(t, &ptr); - if (FAILED(hr)) break; - - hr = parse_fx10_technique(t, data); - if (FAILED(hr)) break; + hr = parse_fx10_technique(t, &ptr, data); + if (FAILED(hr)) return hr; } - return hr; + return S_OK; } static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_size) @@ -452,8 +516,8 @@ static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_s read_dword(&ptr, &e->version); TRACE("Target: %#x\n", e->version); - read_dword(&ptr, &e->localbuffers_count); - TRACE("Localbuffers count: %u\n", e->localbuffers_count); + read_dword(&ptr, &e->local_buffer_count); + TRACE("Local buffer count: %u.\n", e->local_buffer_count); /* Number of variables in local buffers? */ read_dword(&ptr, &unknown); @@ -536,46 +600,46 @@ HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T d return parse_dxbc(data, data_size, fx10_chunk_handler, This); } -static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v) +static void d3d10_effect_object_destroy(struct d3d10_effect_object *o) { - TRACE("variable %p\n", v); + TRACE("effect object %p.\n", o); - switch(v->type) + switch(o->type) { - case D3D10_EVT_VERTEXSHADER: - case D3D10_EVT_PIXELSHADER: - case D3D10_EVT_GEOMETRYSHADER: - HeapFree(GetProcessHeap(), 0, ((struct d3d10_effect_shader_variable *)v->data)->input_signature); + case D3D10_EOT_VERTEXSHADER: + case D3D10_EOT_PIXELSHADER: + case D3D10_EOT_GEOMETRYSHADER: + HeapFree(GetProcessHeap(), 0, ((struct d3d10_effect_shader_variable *)o->data)->input_signature); break; default: break; } - HeapFree(GetProcessHeap(), 0, v->data); + HeapFree(GetProcessHeap(), 0, o->data); } -static HRESULT d3d10_effect_variable_apply(struct d3d10_effect_variable *v) +static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o) { - ID3D10Device *device = v->pass->technique->effect->device; + ID3D10Device *device = o->pass->technique->effect->device; - TRACE("variable %p, type %#x\n", v, v->type); + TRACE("effect object %p, type %#x.\n", o, o->type); - switch(v->type) + switch(o->type) { - case D3D10_EVT_VERTEXSHADER: - ID3D10Device_VSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.vs); + case D3D10_EOT_VERTEXSHADER: + ID3D10Device_VSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.vs); return S_OK; - case D3D10_EVT_PIXELSHADER: - ID3D10Device_PSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.ps); + case D3D10_EOT_PIXELSHADER: + ID3D10Device_PSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.ps); return S_OK; - case D3D10_EVT_GEOMETRYSHADER: - ID3D10Device_GSSetShader(device, ((struct d3d10_effect_shader_variable *)v->data)->shader.gs); + case D3D10_EOT_GEOMETRYSHADER: + ID3D10Device_GSSetShader(device, ((struct d3d10_effect_shader_variable *)o->data)->shader.gs); return S_OK; default: - FIXME("Unhandled variable type %#x\n", v->type); + FIXME("Unhandled effect object type %#x.\n", o->type); return E_FAIL; } } @@ -585,14 +649,14 @@ static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p) TRACE("pass %p\n", p); HeapFree(GetProcessHeap(), 0, p->name); - if (p->variables) + if (p->objects) { unsigned int i; - for (i = 0; i < p->variable_count; ++i) + for (i = 0; i < p->object_count; ++i) { - d3d10_effect_variable_destroy(&p->variables[i]); + d3d10_effect_object_destroy(&p->objects[i]); } - HeapFree(GetProcessHeap(), 0, p->variables); + HeapFree(GetProcessHeap(), 0, p->objects); } } @@ -612,6 +676,29 @@ static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t) } } +static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v) +{ + TRACE("variable %p.\n", v); + + HeapFree(GetProcessHeap(), 0, v->name); +} + +static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_local_buffer *l) +{ + TRACE("local buffer %p.\n", l); + + HeapFree(GetProcessHeap(), 0, l->name); + if (l->variables) + { + unsigned int i; + for (i = 0; i < l->variable_count; ++i) + { + d3d10_effect_variable_destroy(&l->variables[i]); + } + HeapFree(GetProcessHeap(), 0, l->variables); + } +} + /* IUnknown methods */ static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object) @@ -651,15 +738,26 @@ static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface) if (!refcount) { + unsigned int i; + if (This->techniques) { - unsigned int i; for (i = 0; i < This->technique_count; ++i) { d3d10_effect_technique_destroy(&This->techniques[i]); } HeapFree(GetProcessHeap(), 0, This->techniques); } + + if (This->local_buffers) + { + for (i = 0; i < This->local_buffer_count; ++i) + { + d3d10_effect_local_buffer_destroy(&This->local_buffers[i]); + } + HeapFree(GetProcessHeap(), 0, This->local_buffers); + } + ID3D10Device_Release(This->device); HeapFree(GetProcessHeap(), 0, This); } @@ -727,7 +825,27 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name) { - FIXME("iface %p, name \"%s\" stub!\n", iface, name); + struct d3d10_effect *This = (struct d3d10_effect *)iface; + unsigned int i; + + TRACE("iface %p, name \"%s\"\n", iface, name); + + for (i = 0; i < This->local_buffer_count; ++i) + { + struct d3d10_effect_local_buffer *l = &This->local_buffers[i]; + unsigned int j; + + for (j = 0; j < l->variable_count; ++j) + { + struct d3d10_effect_variable *v = &l->variables[j]; + + if (!strcmp(v->name, name)) + { + TRACE("Returning variable %p.\n", v); + return (ID3D10EffectVariable *)v; + } + } + } return NULL; } @@ -938,12 +1056,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *ifa memset(desc, 0, sizeof(*desc)); desc->Name = This->name; - for (i = 0; i < This->variable_count; ++i) + for (i = 0; i < This->object_count; ++i) { - struct d3d10_effect_variable *v = &This->variables[i]; - if (v->type == D3D10_EVT_VERTEXSHADER) + struct d3d10_effect_object *o = &This->objects[i]; + if (o->type == D3D10_EOT_VERTEXSHADER) { - struct d3d10_effect_shader_variable *s = v->data; + struct d3d10_effect_shader_variable *s = o->data; desc->pIAInputSignature = (BYTE *)s->input_signature; desc->IAInputSignatureSize = s->input_signature_size; break; @@ -1003,9 +1121,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface if (flags) FIXME("Ignoring flags (%#x)\n", flags); - for (i = 0; i < This->variable_count; ++i) + for (i = 0; i < This->object_count; ++i) { - hr = d3d10_effect_variable_apply(&This->variables[i]); + hr = d3d10_effect_object_apply(&This->objects[i]); if (FAILED(hr)) break; } @@ -1033,3 +1151,232 @@ static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl = d3d10_effect_pass_Apply, d3d10_effect_pass_ComputeStateBlockMask, }; + +/* ID3D10EffectVariable methods */ + +static BOOL STDMETHODCALLTYPE d3d10_effect_variable_IsValid(ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return FALSE; +} + +static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_variable_GetType(ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetDesc(ID3D10EffectVariable *iface, + D3D10_EFFECT_VARIABLE_DESC *desc) +{ + FIXME("iface %p, desc %p stub!\n", iface, desc); + + return E_NOTIMPL; +} + +static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByIndex( + ID3D10EffectVariable *iface, UINT index) +{ + FIXME("iface %p, index %u stub!\n", iface, index); + + return NULL; +} + +static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName( + ID3D10EffectVariable *iface, LPCSTR name) +{ + FIXME("iface %p, name \"%s\" stub!\n", iface, name); + + return NULL; +} + +static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex( + ID3D10EffectVariable *iface, UINT index) +{ + FIXME("iface %p, index %u stub!\n", iface, index); + + return NULL; +} + +static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName( + ID3D10EffectVariable *iface, LPCSTR name) +{ + FIXME("iface %p, name \"%s\" stub!\n", iface, name); + + return NULL; +} + +static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic( + ID3D10EffectVariable *iface, LPCSTR semantic) +{ + FIXME("iface %p, semantic \"%s\" stub!\n", iface, semantic); + + return NULL; +} + +static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetElement( + ID3D10EffectVariable *iface, UINT index) +{ + FIXME("iface %p, index %u stub!\n", iface, index); + + return NULL; +} + +static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_GetParentConstantBuffer( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsScalar( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsVector( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsString( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShaderResource( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRenderTargetView( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencilView( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_AsConstantBuffer( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShader( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsBlend(ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencil( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRasterizer( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsSampler( + ID3D10EffectVariable *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface, + void *data, UINT offset, UINT count) +{ + FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface, + void *data, UINT offset, UINT count) +{ + FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count); + + return E_NOTIMPL; +} + +static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl = +{ + /* ID3D10EffectVariable methods */ + d3d10_effect_variable_IsValid, + d3d10_effect_variable_GetType, + d3d10_effect_variable_GetDesc, + d3d10_effect_variable_GetAnnotationByIndex, + d3d10_effect_variable_GetAnnotationByName, + d3d10_effect_variable_GetMemberByIndex, + d3d10_effect_variable_GetMemberByName, + d3d10_effect_variable_GetMemberBySemantic, + d3d10_effect_variable_GetElement, + d3d10_effect_variable_GetParentConstantBuffer, + d3d10_effect_variable_AsScalar, + d3d10_effect_variable_AsVector, + d3d10_effect_variable_AsMatrix, + d3d10_effect_variable_AsString, + d3d10_effect_variable_AsShaderResource, + d3d10_effect_variable_AsRenderTargetView, + d3d10_effect_variable_AsDepthStencilView, + d3d10_effect_variable_AsConstantBuffer, + d3d10_effect_variable_AsShader, + d3d10_effect_variable_AsBlend, + d3d10_effect_variable_AsDepthStencil, + d3d10_effect_variable_AsRasterizer, + d3d10_effect_variable_AsSampler, + d3d10_effect_variable_SetRawValue, + d3d10_effect_variable_GetRawValue, +}; diff --git a/dlls/d3dx8/core.c b/dlls/d3dx8/core.c deleted file mode 100644 index da821fc9d35..00000000000 --- a/dlls/d3dx8/core.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * - * Copyright 2002 Raphael Junqueira - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include - -#define COBJMACROS -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "wine/debug.h" -#include "wine/unicode.h" - -#include "d3dx8_private.h" - -WINE_DEFAULT_DEBUG_CHANNEL(d3dx); - -/* ID3DXBuffer IUnknown parts follow: */ -static HRESULT WINAPI ID3DXBufferImpl_QueryInterface(LPD3DXBUFFER iface, REFIID riid, LPVOID* ppobj) { - ID3DXBufferImpl *This = (ID3DXBufferImpl *)iface; - - if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_ID3DXBuffer)) { - IUnknown_AddRef(iface); - *ppobj = This; - return D3D_OK; - } - - WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); - return E_NOINTERFACE; -} - -static ULONG WINAPI ID3DXBufferImpl_AddRef(LPD3DXBUFFER iface) { - ID3DXBufferImpl *This = (ID3DXBufferImpl *)iface; - ULONG ref = InterlockedIncrement(&This->ref); - - TRACE("(%p) : AddRef from %d\n", This, ref - 1); - - return ref; -} - -static ULONG WINAPI ID3DXBufferImpl_Release(LPD3DXBUFFER iface) { - ID3DXBufferImpl *This = (ID3DXBufferImpl *)iface; - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) : ReleaseRef to %d\n", This, ref); - - if (ref == 0) { - HeapFree(GetProcessHeap(), 0, This->buffer); - HeapFree(GetProcessHeap(), 0, This); - } - return ref; -} - -/* ID3DXBuffer Interface follow: */ -static LPVOID WINAPI ID3DXBufferImpl_GetBufferPointer(LPD3DXBUFFER iface) { - ID3DXBufferImpl *This = (ID3DXBufferImpl *)iface; - return This->buffer; -} - -static DWORD WINAPI ID3DXBufferImpl_GetBufferSize(LPD3DXBUFFER iface) { - ID3DXBufferImpl *This = (ID3DXBufferImpl *)iface; - return This->bufferSize; -} - -const ID3DXBufferVtbl D3DXBuffer_Vtbl = -{ - ID3DXBufferImpl_QueryInterface, - ID3DXBufferImpl_AddRef, - ID3DXBufferImpl_Release, - ID3DXBufferImpl_GetBufferPointer, - ID3DXBufferImpl_GetBufferSize -}; - -HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer) { - ID3DXBufferImpl *object; - - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXBufferImpl)); - if (NULL == object) { - *ppBuffer = NULL; - return E_OUTOFMEMORY; - } - object->lpVtbl = &D3DXBuffer_Vtbl; - object->ref = 1; - object->bufferSize = NumBytes; - object->buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, NumBytes); - if (NULL == object->buffer) { - HeapFree(GetProcessHeap(), 0, object); - *ppBuffer = NULL; - return E_OUTOFMEMORY; - } - *ppBuffer = (LPD3DXBUFFER)object; - return D3D_OK; -} - -HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors) { - FIXME("(void): stub\n"); - return D3D_OK; -} - -HRESULT WINAPI D3DXAssembleShaderFromFileA(LPCSTR pSrcFile, DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors) { - LPWSTR pSrcFileW = NULL; - DWORD len; - HRESULT ret; - - if (!pSrcFile) return D3DXERR_INVALIDDATA; - - len = MultiByteToWideChar( CP_ACP, 0, pSrcFile, -1, NULL, 0 ); - pSrcFileW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, pSrcFile, -1, pSrcFileW, len ); - ret=D3DXAssembleShaderFromFileW(pSrcFileW, Flags, ppConstants, ppCompiledShader, ppCompilationErrors); - HeapFree( GetProcessHeap(), 0, pSrcFileW ); - return ret; -} - -HRESULT WINAPI D3DXAssembleShaderFromFileW(LPCWSTR pSrcFile, DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors) { - FIXME("(void): stub\n"); - return D3D_OK; -} - -HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont) { - FIXME("(void): stub\n"); - return D3D_OK; -} diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec deleted file mode 100644 index 88666f7dec5..00000000000 --- a/dlls/d3dx8/d3dx8.spec +++ /dev/null @@ -1,156 +0,0 @@ -@ stdcall D3DXVec2Normalize(ptr ptr) -@ stdcall D3DXVec2Hermite(ptr ptr ptr ptr ptr long) -@ stdcall D3DXVec2CatmullRom(ptr ptr ptr ptr ptr long) -@ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr long long) -@ stdcall D3DXVec2Transform(ptr ptr ptr) -@ stdcall D3DXVec2TransformCoord(ptr ptr ptr) -@ stdcall D3DXVec2TransformNormal(ptr ptr ptr) -@ stdcall D3DXVec3Normalize(ptr ptr) -@ stdcall D3DXVec3Hermite(ptr ptr ptr ptr ptr long) -@ stdcall D3DXVec3CatmullRom(ptr ptr ptr ptr ptr long) -@ stdcall D3DXVec3BaryCentric(ptr ptr ptr ptr long long) -@ stdcall D3DXVec3Transform(ptr ptr ptr) -@ stdcall D3DXVec3TransformCoord(ptr ptr ptr) -@ stdcall D3DXVec3TransformNormal(ptr ptr ptr) -@ stdcall D3DXVec3Project(ptr ptr ptr ptr ptr ptr) -@ stdcall D3DXVec3Unproject(ptr ptr ptr ptr ptr ptr) -@ stdcall D3DXVec4Cross(ptr ptr ptr ptr) -@ stdcall D3DXVec4Normalize(ptr ptr) -@ stdcall D3DXVec4Hermite(ptr ptr ptr ptr ptr long) -@ stdcall D3DXVec4CatmullRom(ptr ptr ptr ptr ptr long) -@ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr long long) -@ stdcall D3DXVec4Transform(ptr ptr ptr) -@ stdcall D3DXMatrixfDeterminant(ptr) -@ stdcall D3DXMatrixMultiply(ptr ptr ptr) -@ stdcall D3DXMatrixMultiplyTranspose(ptr ptr ptr) -@ stdcall D3DXMatrixTranspose(ptr ptr) -@ stdcall D3DXMatrixInverse(ptr ptr ptr) -@ stdcall D3DXMatrixScaling(ptr long long long) -@ stdcall D3DXMatrixTranslation(ptr long long long) -@ stdcall D3DXMatrixRotationX(ptr long) -@ stdcall D3DXMatrixRotationY(ptr long) -@ stdcall D3DXMatrixRotationZ(ptr long) -@ stdcall D3DXMatrixRotationAxis(ptr ptr long) -@ stdcall D3DXMatrixRotationQuaternion(ptr ptr) -@ stdcall D3DXMatrixRotationYawPitchRoll(ptr long long long) -@ stdcall D3DXMatrixTransformation(ptr ptr ptr ptr ptr ptr ptr) -@ stdcall D3DXMatrixAffineTransformation(ptr long ptr ptr ptr) -@ stdcall D3DXMatrixLookAtRH(ptr ptr ptr ptr) -@ stdcall D3DXMatrixLookAtLH(ptr ptr ptr ptr) -@ stdcall D3DXMatrixPerspectiveRH(ptr long long long long) -@ stdcall D3DXMatrixPerspectiveLH(ptr long long long long) -@ stdcall D3DXMatrixPerspectiveFovRH(ptr long long long long) -@ stdcall D3DXMatrixPerspectiveFovLH(ptr long long long long) -@ stdcall D3DXMatrixPerspectiveOffCenterRH(ptr long long long long long long) -@ stdcall D3DXMatrixPerspectiveOffCenterLH(ptr long long long long long long) -@ stdcall D3DXMatrixOrthoRH(ptr long long long long) -@ stdcall D3DXMatrixOrthoLH(ptr long long long long) -@ stdcall D3DXMatrixOrthoOffCenterRH(ptr long long long long long long) -@ stdcall D3DXMatrixOrthoOffCenterLH(ptr long long long long long long) -@ stdcall D3DXMatrixShadow(ptr ptr ptr) -@ stdcall D3DXMatrixReflect(ptr ptr) -@ stdcall D3DXQuaternionToAxisAngle(ptr ptr ptr) -@ stdcall D3DXQuaternionRotationMatrix(ptr ptr) -@ stdcall D3DXQuaternionRotationAxis(ptr ptr long) -@ stdcall D3DXQuaternionRotationYawPitchRoll(ptr long long long) -@ stdcall D3DXQuaternionMultiply(ptr ptr ptr) -@ stdcall D3DXQuaternionNormalize(ptr ptr) -@ stdcall D3DXQuaternionInverse(ptr ptr) -@ stdcall D3DXQuaternionLn(ptr ptr) -@ stdcall D3DXQuaternionExp(ptr ptr) -@ stdcall D3DXQuaternionSlerp(ptr ptr ptr long) -@ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr long) -@ stdcall D3DXQuaternionBaryCentric(ptr ptr ptr ptr long long) -@ stdcall D3DXPlaneNormalize(ptr ptr) -@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr) -@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr) -@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr) -@ stdcall D3DXPlaneTransform(ptr ptr ptr) -@ stdcall D3DXColorAdjustSaturation(ptr ptr long) -@ stdcall D3DXColorAdjustContrast(ptr ptr long) -@ stdcall D3DXFresnelTerm(long long) -@ stdcall D3DXCreateMatrixStack(long ptr) -@ stdcall D3DXCreateFont(ptr ptr ptr) -@ stub D3DXCreateFontIndirect -@ stub D3DXCreateSprite -@ stub D3DXCreateRenderToSurface -@ stub D3DXCreateRenderToEnvMap -@ stdcall D3DXAssembleShaderFromFileA(ptr long ptr ptr ptr) -@ stdcall D3DXAssembleShaderFromFileW(ptr long ptr ptr ptr) -@ stdcall D3DXGetFVFVertexSize(long) -@ stub D3DXGetErrorStringA -@ stub D3DXGetErrorStringW -@ stdcall D3DXAssembleShader(ptr long long ptr ptr ptr) -@ stub D3DXCompileEffectFromFileA -@ stub D3DXCompileEffectFromFileW -@ stub D3DXCompileEffect -@ stub D3DXCreateEffect -@ stub D3DXCreateMesh -@ stub D3DXCreateMeshFVF -@ stub D3DXCreateSPMesh -@ stub D3DXCleanMesh -@ stub D3DXValidMesh -@ stub D3DXGeneratePMesh -@ stub D3DXSimplifyMesh -@ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) -@ stdcall D3DXComputeBoundingBox(ptr long long ptr ptr) -@ stub D3DXComputeNormals -@ stdcall D3DXCreateBuffer(long ptr) -@ stub D3DXLoadMeshFromX -@ stub D3DXSaveMeshToX -@ stub D3DXCreatePMeshFromStream -@ stub D3DXCreateSkinMesh -@ stub D3DXCreateSkinMeshFVF -@ stub D3DXCreateSkinMeshFromMesh -@ stub D3DXLoadMeshFromXof -@ stub D3DXLoadSkinMeshFromXof -@ stub D3DXTesselateMesh -@ stub D3DXDeclaratorFromFVF -@ stub D3DXFVFFromDeclarator -@ stub D3DXWeldVertices -@ stub D3DXIntersect -@ cdecl D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall D3DXSphereBoundProbe(ptr long ptr ptr) -@ stdcall D3DXBoxBoundProbe(ptr ptr ptr ptr) -@ stub D3DXCreatePolygon -@ stub D3DXCreateBox -@ stub D3DXCreateCylinder -@ stub D3DXCreateSphere -@ stub D3DXCreateTorus -@ stub D3DXCreateTeapot -@ stub D3DXCreateTextA -@ stub D3DXCreateTextW -@ stub D3DXLoadSurfaceFromFileA -@ stub D3DXLoadSurfaceFromFileW -@ stub D3DXLoadSurfaceFromResourceA -@ stub D3DXLoadSurfaceFromResourceW -@ stub D3DXLoadSurfaceFromFileInMemory -@ stub D3DXLoadSurfaceFromSurface -@ stub D3DXLoadSurfaceFromMemory -@ stub D3DXLoadVolumeFromVolume -@ stub D3DXLoadVolumeFromMemory -@ stub D3DXCheckTextureRequirements -@ stub D3DXCreateTexture -@ stub D3DXCreateTextureFromFileA -@ stub D3DXCreateTextureFromFileW -@ stub D3DXCreateTextureFromResourceA -@ stub D3DXCreateTextureFromResourceW -@ stub D3DXCreateTextureFromFileExA -@ stub D3DXCreateTextureFromFileExW -@ stub D3DXCreateTextureFromResourceExA -@ stub D3DXCreateTextureFromResourceExW -@ stub D3DXCreateTextureFromFileInMemory -@ stub D3DXCreateTextureFromFileInMemoryEx -@ stub D3DXFilterTexture -@ stub D3DXCheckCubeTextureRequirements -@ stub D3DXCreateCubeTexture -@ stub D3DXCreateCubeTextureFromFileA -@ stub D3DXCreateCubeTextureFromFileW -@ stub D3DXCreateCubeTextureFromFileExA -@ stub D3DXCreateCubeTextureFromFileExW -@ stub D3DXCreateCubeTextureFromFileInMemory -@ stub D3DXCreateCubeTextureFromFileInMemoryEx -@ stub D3DXFilterCubeTexture -@ stub D3DXCheckVolumeTextureRequirements -@ stub D3DXCreateVolumeTexture -@ stub D3DXFilterVolumeTexture diff --git a/dlls/d3dx8/d3dx8_main.c b/dlls/d3dx8/d3dx8_main.c deleted file mode 100644 index 4fb860a7313..00000000000 --- a/dlls/d3dx8/d3dx8_main.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Direct3D X 8 main file - * - * Copyright (C) 2002 Raphael Junqueira - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ - -#include - -#include "windef.h" -#include "winbase.h" - -/*********************************************************************** - * DllMain. - */ -BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) -{ - switch(reason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(inst); - break; - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} diff --git a/dlls/d3dx8/d3dx8_private.h b/dlls/d3dx8/d3dx8_private.h deleted file mode 100644 index 01174dcc671..00000000000 --- a/dlls/d3dx8/d3dx8_private.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Direct3D X 8 private include file - * - * Copyright 2002 Raphael Junqueira - * Copyright 2007 David Adam - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_D3DX8_PRIVATE_H -#define __WINE_D3DX8_PRIVATE_H - -#include - -#include "windef.h" -#include "winbase.h" -#include "d3dx8.h" - -/* Interfaces */ -typedef struct ID3DXBufferImpl ID3DXBufferImpl; -typedef struct ID3DXFontImpl ID3DXFontImpl; -typedef struct ID3DXMatrixStackImpl ID3DXMatrixStackImpl; - -/* ----------- */ -/* ID3DXBuffer */ -/* ----------- */ - -/***************************************************************************** - * Predeclare the interface implementation structures - */ -extern const ID3DXBufferVtbl D3DXBuffer_Vtbl; - -/***************************************************************************** - * ID3DXBufferImpl implementation structure - */ -struct ID3DXBufferImpl -{ - /* IUnknown fields */ - const ID3DXBufferVtbl *lpVtbl; - LONG ref; - - /* ID3DXBuffer fields */ - DWORD *buffer; - DWORD bufferSize; -}; - -/* --------- */ -/* ID3DXFont */ -/* --------- */ - -/***************************************************************************** - * ID3DXFontImpl implementation structure - */ -struct ID3DXFontImpl -{ - /* IUnknown fields */ - const ID3DXFontVtbl *lpVtbl; - LONG ref; - - /* ID3DXFont fields */ -}; - -/* ----------- */ -/* ID3DXMatrix */ -/* ----------- */ - -/***************************************************************************** - * ID3DXMatrixStackImpl implementation structure - */ -struct ID3DXMatrixStackImpl -{ - /* IUnknown fields */ - const ID3DXMatrixStackVtbl *lpVtbl; - LONG ref; - - /* ID3DXMatrixStack fields */ - unsigned int current; - unsigned int stack_size; - D3DXMATRIX *stack; -}; - -#endif /*__WINE_D3DX8_PRIVATE_H */ diff --git a/dlls/d3dx8/mesh.c b/dlls/d3dx8/mesh.c deleted file mode 100644 index b0562c7401e..00000000000 --- a/dlls/d3dx8/mesh.c +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright 2008 David Adam - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" - -#include "d3dx8_private.h" - - -BOOL WINAPI D3DXBoxBoundProbe(CONST D3DXVECTOR3 *pmin, CONST D3DXVECTOR3 *pmax, CONST D3DXVECTOR3 *prayposition, CONST D3DXVECTOR3 *praydirection) - -/* Algorithm taken from the article: An Efficient and Robust Ray-Box Intersection Algoritm -Amy Williams University of Utah -Steve Barrus University of Utah -R. Keith Morley University of Utah -Peter Shirley University of Utah - -International Conference on Computer Graphics and Interactive Techniques archive -ACM SIGGRAPH 2005 Courses -Los Angeles, California - -This algorithm is free of patents or of copyrights, as confirmed by Peter Shirley himself. - -Algorithm: Consider the box as the intersection of three slabs. Clip the ray -against each slab, if there's anything left of the ray after we're -done we've got an intersection of the ray with the box. -*/ - -{ - FLOAT div, tmin, tmax, tymin, tymax, tzmin, tzmax; - - div = 1.0f / praydirection->x; - if ( div >= 0.0f ) - { - tmin = ( pmin->x - prayposition->x ) * div; - tmax = ( pmax->x - prayposition->x ) * div; - } - else - { - tmin = ( pmax->x - prayposition->x ) * div; - tmax = ( pmin->x - prayposition->x ) * div; - } - - if ( tmax < 0.0f ) return FALSE; - - div = 1.0f / praydirection->y; - if ( div >= 0.0f ) - { - tymin = ( pmin->y - prayposition->y ) * div; - tymax = ( pmax->y - prayposition->y ) * div; - } - else - { - tymin = ( pmax->y - prayposition->y ) * div; - tymax = ( pmin->y - prayposition->y ) * div; - } - - if ( ( tymax < 0.0f ) || ( tmin > tymax ) || ( tymin > tmax ) ) return FALSE; - - if ( tymin > tmin ) tmin = tymin; - if ( tymax < tmax ) tmax = tymax; - - div = 1.0f / praydirection->z; - if ( div >= 0.0f ) - { - tzmin = ( pmin->z - prayposition->z ) * div; - tzmax = ( pmax->z - prayposition->z ) * div; - } - else - { - tzmin = ( pmax->z - prayposition->z ) * div; - tzmax = ( pmin->z - prayposition->z ) * div; - } - - if ( (tzmax < 0.0f ) || ( tmin > tzmax ) || ( tzmin > tmax ) ) return FALSE; - - return TRUE; -} - -HRESULT WINAPI D3DXComputeBoundingBox(PVOID ppointsFVF, DWORD numvertices, DWORD FVF, D3DXVECTOR3 *pmin, D3DXVECTOR3 *pmax) -{ - D3DXVECTOR3 vec; - unsigned int i; - - if( !ppointsFVF || !pmin || !pmax ) return D3DERR_INVALIDCALL; - - *pmin = *(D3DXVECTOR3*)((char*)ppointsFVF); - *pmax = *pmin; - -/* It looks like that D3DXComputeBoundingBox does not take in account the last vertex. */ - for(i=0; ix ) pmin->x = vec.x; - if ( vec.x > pmax->x ) pmax->x = vec.x; - - if ( vec.y < pmin->y ) pmin->y = vec.y; - if ( vec.y > pmax->y ) pmax->y = vec.y; - - if ( vec.z < pmin->z ) pmin->z = vec.z; - if ( vec.z > pmax->z ) pmax->z = vec.z; - } - - return D3D_OK; -} - -HRESULT WINAPI D3DXComputeBoundingSphere(PVOID ppointsFVF, DWORD numvertices, DWORD FVF, D3DXVECTOR3 *pcenter, FLOAT *pradius) -{ - D3DXVECTOR3 temp, temp1; - FLOAT d; - unsigned int i; - - if( !ppointsFVF || !pcenter || !pradius ) return D3DERR_INVALIDCALL; - - temp.x = 0.0f; - temp.y = 0.0f; - temp.z = 0.0f; - temp1 = temp; - d = 0.0f; - *pradius = 0.0f; - - for(i=0; i *pradius ) *pradius = d; - } - return D3D_OK; -} - -static UINT Get_TexCoord_Size_From_FVF(DWORD FVF, int tex_num) -{ - return (((((FVF) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1); -} - -UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF) -{ - DWORD size = 0; - UINT i; - UINT numTextures = (FVF & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT; - - if (FVF & D3DFVF_NORMAL) size += sizeof(D3DXVECTOR3); - if (FVF & D3DFVF_DIFFUSE) size += sizeof(DWORD); - if (FVF & D3DFVF_SPECULAR) size += sizeof(DWORD); - if (FVF & D3DFVF_PSIZE) size += sizeof(DWORD); - - switch (FVF & D3DFVF_POSITION_MASK) - { - case D3DFVF_XYZ: size += sizeof(D3DXVECTOR3); break; - case D3DFVF_XYZRHW: size += 4 * sizeof(FLOAT); break; - case D3DFVF_XYZB1: size += 4 * sizeof(FLOAT); break; - case D3DFVF_XYZB2: size += 5 * sizeof(FLOAT); break; - case D3DFVF_XYZB3: size += 6 * sizeof(FLOAT); break; - case D3DFVF_XYZB4: size += 7 * sizeof(FLOAT); break; - case D3DFVF_XYZB5: size += 8 * sizeof(FLOAT); break; - } - - for (i = 0; i < numTextures; i++) - { - size += Get_TexCoord_Size_From_FVF(FVF, i) * sizeof(FLOAT); - } - - return size; -} - -BOOL CDECL D3DXIntersectTri(CONST D3DXVECTOR3 *p0, CONST D3DXVECTOR3 *p1, CONST D3DXVECTOR3 *p2, CONST D3DXVECTOR3 *praypos, CONST D3DXVECTOR3 *praydir, FLOAT *pu, FLOAT *pv, FLOAT *pdist) -{ - D3DXMATRIX m; - D3DXVECTOR4 vec; - - m.m[0][0] = p1->x - p0->x; - m.m[1][0] = p2->x - p0->x; - m.m[2][0] = -praydir->x; - m.m[3][0] = 0.0f; - m.m[0][1] = p1->y - p0->z; - m.m[1][1] = p2->y - p0->z; - m.m[2][1] = -praydir->y; - m.m[3][1] = 0.0f; - m.m[0][2] = p1->z - p0->z; - m.m[1][2] = p2->z - p0->z; - m.m[2][2] = -praydir->z; - m.m[3][2] = 0.0f; - m.m[0][3] = 0.0f; - m.m[1][3] = 0.0f; - m.m[2][3] = 0.0f; - m.m[3][3] = 1.0f; - - vec.x = praypos->x - p0->x; - vec.y = praypos->y - p0->y; - vec.z = praypos->z - p0->z; - vec.w = 0.0f; - - if ( D3DXMatrixInverse(&m, NULL, &m) ) - { - D3DXVec4Transform(&vec, &vec, &m); - if ( (vec.x >= 0.0f) && (vec.y >= 0.0f) && (vec.x + vec.y <= 1.0f) && (vec.z >= 0.0f) ) - { - *pu = vec.x; - *pv = vec.y; - *pdist = fabs( vec.z ); - return TRUE; - } - } - -return FALSE; -} - -BOOL WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *pcenter, FLOAT radius, CONST D3DXVECTOR3 *prayposition, CONST D3DXVECTOR3 *praydirection) -{ - D3DXVECTOR3 difference; - FLOAT a, b, c, d; - - a = D3DXVec3LengthSq(praydirection); - if (!D3DXVec3Subtract(&difference, prayposition, pcenter)) return FALSE; - b = D3DXVec3Dot(&difference, praydirection); - c = D3DXVec3LengthSq(&difference) - radius * radius; - d = b * b - a * c; - - if ( ( d <= 0.0f ) || ( sqrt(d) <= b ) ) return FALSE; - return TRUE; -} diff --git a/dlls/d3dx8/tests/Makefile.in b/dlls/d3dx8/tests/Makefile.in deleted file mode 100644 index 8869d711d58..00000000000 --- a/dlls/d3dx8/tests/Makefile.in +++ /dev/null @@ -1,14 +0,0 @@ -TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../../.. -SRCDIR = @srcdir@ -VPATH = @srcdir@ -TESTDLL = d3dx8.dll -IMPORTS = d3dx8 kernel32 - -CTESTS = \ - math.c \ - mesh.c - -@MAKE_TEST_RULES@ - -@DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in index 1c6195b7a7b..88ac1d70739 100644 --- a/dlls/d3dx9_36/Makefile.in +++ b/dlls/d3dx9_36/Makefile.in @@ -4,9 +4,10 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = d3dx9_36.dll IMPORTLIB = d3dx9 -IMPORTS = d3d9 d3dx8 gdi32 user32 kernel32 +IMPORTS = d3d9 gdi32 user32 kernel32 C_SRCS = \ + core.c \ d3dx9_36_main.c \ font.c \ math.c \ diff --git a/dlls/d3dx9_36/core.c b/dlls/d3dx9_36/core.c new file mode 100644 index 00000000000..3b63e9e4688 --- /dev/null +++ b/dlls/d3dx9_36/core.c @@ -0,0 +1,120 @@ +/* + * + * Copyright 2002 Raphael Junqueira + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#define COBJMACROS +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "wine/debug.h" +#include "wine/unicode.h" + +#include "d3dx9_36_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3dx); + +/* ID3DXBuffer IUnknown parts follow: */ +static HRESULT WINAPI ID3DXBufferImpl_QueryInterface(LPD3DXBUFFER iface, REFIID riid, LPVOID* ppobj) +{ + ID3DXBufferImpl *This = (ID3DXBufferImpl *)iface; + + if (IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_ID3DXBuffer)) + { + IUnknown_AddRef(iface); + *ppobj = This; + return D3D_OK; + } + + WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); + return E_NOINTERFACE; +} + +static ULONG WINAPI ID3DXBufferImpl_AddRef(LPD3DXBUFFER iface) +{ + ID3DXBufferImpl *This = (ID3DXBufferImpl *)iface; + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) : AddRef from %d\n", This, ref - 1); + + return ref; +} + +static ULONG WINAPI ID3DXBufferImpl_Release(LPD3DXBUFFER iface) +{ + ID3DXBufferImpl *This = (ID3DXBufferImpl *)iface; + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) : ReleaseRef to %d\n", This, ref); + + if (ref == 0) + { + HeapFree(GetProcessHeap(), 0, This->buffer); + HeapFree(GetProcessHeap(), 0, This); + } + return ref; +} + +/* ID3DXBuffer Interface follow: */ +static LPVOID WINAPI ID3DXBufferImpl_GetBufferPointer(LPD3DXBUFFER iface) +{ + ID3DXBufferImpl *This = (ID3DXBufferImpl *)iface; + return This->buffer; +} + +static DWORD WINAPI ID3DXBufferImpl_GetBufferSize(LPD3DXBUFFER iface) +{ + ID3DXBufferImpl *This = (ID3DXBufferImpl *)iface; + return This->bufferSize; +} + +const ID3DXBufferVtbl D3DXBuffer_Vtbl = +{ + ID3DXBufferImpl_QueryInterface, + ID3DXBufferImpl_AddRef, + ID3DXBufferImpl_Release, + ID3DXBufferImpl_GetBufferPointer, + ID3DXBufferImpl_GetBufferSize +}; + +HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer) +{ + ID3DXBufferImpl *object; + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXBufferImpl)); + if (object == NULL) + { + *ppBuffer = NULL; + return E_OUTOFMEMORY; + } + object->lpVtbl = &D3DXBuffer_Vtbl; + object->ref = 1; + object->bufferSize = NumBytes; + object->buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, NumBytes); + if (object->buffer == NULL) + { + HeapFree(GetProcessHeap(), 0, object); + *ppBuffer = NULL; + return E_OUTOFMEMORY; + } + + *ppBuffer = (LPD3DXBUFFER)object; + return D3D_OK; +} diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index 8a7cdf705da..d3fe3acad7c 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -3,14 +3,14 @@ @ stub D3DXAssembleShaderFromFileW @ stub D3DXAssembleShaderFromResourceA @ stub D3DXAssembleShaderFromResourceW -@ stdcall D3DXBoxBoundProbe(ptr ptr ptr ptr) d3dx8.D3DXBoxBoundProbe +@ stdcall D3DXBoxBoundProbe(ptr ptr ptr ptr) @ stub D3DXCheckCubeTextureRequirements @ stub D3DXCheckTextureRequirements @ stdcall D3DXCheckVersion(long long) @ stub D3DXCheckVolumeTextureRequirements @ stub D3DXCleanMesh -@ stdcall D3DXColorAdjustContrast(ptr ptr long) d3dx8.D3DXColorAdjustContrast -@ stdcall D3DXColorAdjustSaturation(ptr ptr long) d3dx8.D3DXColorAdjustSaturation +@ stdcall D3DXColorAdjustContrast(ptr ptr long) +@ stdcall D3DXColorAdjustSaturation(ptr ptr long) @ stub D3DXCompileShader @ stub D3DXCompileShaderFromFileA @ stub D3DXCompileShaderFromFileW @@ -23,7 +23,7 @@ @ stub D3DXComputeIMTFromSignal @ stub D3DXComputeIMTFromTexture @ stub D3DXComputeNormalMap -@ stdcall D3DXComputeNormals(ptr ptr) d3dx8.D3DXComputeNormals +@ stub D3DXComputeNormals @ stub D3DXComputeTangent @ stub D3DXComputeTangentFrame @ stub D3DXComputeTangentFrameEx @@ -32,7 +32,7 @@ @ stub D3DXConvertMeshSubsetToStrips @ stub D3DXCreateAnimationController @ stub D3DXCreateBox -@ stdcall D3DXCreateBuffer(long ptr) d3dx8.D3DXCreateBuffer +@ stdcall D3DXCreateBuffer(long ptr) @ stub D3DXCreateCompressedAnimationSet @ stub D3DXCreateCubeTexture @ stub D3DXCreateCubeTextureFromFileA @@ -70,7 +70,7 @@ @ stub D3DXCreateFragmentLinkerEx @ stub D3DXCreateKeyframedAnimationSet @ stub D3DXCreateLine -@ stdcall D3DXCreateMatrixStack(long ptr) d3dx8.D3DXCreateMatrixStack +@ stdcall D3DXCreateMatrixStack(long ptr) @ stub D3DXCreateMesh @ stub D3DXCreateMeshFVF @ stub D3DXCreateNPatchMesh @@ -83,7 +83,7 @@ @ stub D3DXCreatePRTEngine @ stub D3DXCreateRenderToEnvMap @ stub D3DXCreateRenderToSurface -@ stdcall D3DXCreateSPMesh(ptr ptr ptr ptr ptr) d3dx8.D3DXCreateSPMesh +@ stub D3DXCreateSPMesh @ stub D3DXCreateSkinInfo @ stub D3DXCreateSkinInfoFromBlendedMesh @ stub D3DXCreateSkinInfoFVF @@ -138,7 +138,7 @@ @ stub D3DXFrameFind @ stub D3DXFrameNumNamedMatrices @ stub D3DXFrameRegisterNamedMatrices -@ stdcall D3DXFresnelTerm(long long) d3dx8.D3DXFresnelTerm +@ stdcall D3DXFresnelTerm(long long) @ stub D3DXFVFFromDeclarator @ stub D3DXGatherFragments @ stub D3DXGatherFragmentsFromFileA @@ -146,7 +146,7 @@ @ stub D3DXGatherFragmentsFromResourceA @ stub D3DXGatherFragmentsFromResourceW @ stub D3DXGenerateOutputDecl -@ stdcall D3DXGeneratePMesh(ptr ptr ptr ptr long long ptr) d3dx8.D3DXGeneratePMesh +@ stub D3DXGeneratePMesh @ stub D3DXGetDeclLength @ stdcall D3DXGetDeclVertexSize(ptr long) @ stdcall D3DXGetDriverLevel(ptr) @@ -165,8 +165,8 @@ @ stdcall D3DXGetShaderSize(ptr) @ stdcall D3DXGetShaderVersion(ptr) @ stdcall D3DXGetVertexShaderProfile(ptr) -@ stdcall D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXIntersect -@ stdcall D3DXIntersectSubset(ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXIntersectSubset +@ stub D3DXIntersect +@ stub D3DXIntersectSubset @ stdcall D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr) @ stub D3DXLoadMeshFromXA @ stub D3DXLoadMeshFromXInMemory @@ -196,64 +196,64 @@ @ stub D3DXLoadVolumeFromResourceA @ stub D3DXLoadVolumeFromResourceW @ stub D3DXLoadVolumeFromVolume -@ stdcall D3DXMatrixAffineTransformation(ptr long ptr ptr ptr) d3dx8.D3DXMatrixAffineTransformation +@ stdcall D3DXMatrixAffineTransformation(ptr long ptr ptr ptr) @ stdcall D3DXMatrixAffineTransformation2D(ptr long ptr long ptr) @ stdcall D3DXMatrixDecompose(ptr ptr ptr ptr) -@ stdcall D3DXMatrixDeterminant(ptr) d3dx8.D3DXMatrixfDeterminant -@ stdcall D3DXMatrixInverse(ptr ptr ptr) d3dx8.D3DXMatrixInverse -@ stdcall D3DXMatrixLookAtLH(ptr ptr ptr ptr) d3dx8.D3DXMatrixLookAtLH -@ stdcall D3DXMatrixLookAtRH(ptr ptr ptr ptr) d3dx8.D3DXMatrixLookAtRH -@ stdcall D3DXMatrixMultiply(ptr ptr ptr) d3dx8.D3DXMatrixMultiply -@ stdcall D3DXMatrixMultiplyTranspose(ptr ptr ptr) d3dx8.D3DXMatrixMultiplyTranspose -@ stdcall D3DXMatrixOrthoLH(ptr long long long long) d3dx8.D3DXMatrixOrthoLH -@ stdcall D3DXMatrixOrthoOffCenterLH(ptr long long long long long long) d3dx8.D3DXMatrixOrthoOffCenterLH -@ stdcall D3DXMatrixOrthoOffCenterRH(ptr long long long long long long) d3dx8.D3DXMatrixOrthoOffCenterRH -@ stdcall D3DXMatrixOrthoRH(ptr long long long long) d3dx8.D3DXMatrixOrthoRH -@ stdcall D3DXMatrixPerspectiveFovLH(ptr long long long long) d3dx8.D3DXMatrixPerspectiveFovLH -@ stdcall D3DXMatrixPerspectiveFovRH(ptr long long long long) d3dx8.D3DXMatrixPerspectiveFovRH -@ stdcall D3DXMatrixPerspectiveLH(ptr long long long long) d3dx8.D3DXMatrixPerspectiveLH -@ stdcall D3DXMatrixPerspectiveOffCenterLH(ptr long long long long long long) d3dx8.D3DXMatrixPerspectiveOffCenterLH -@ stdcall D3DXMatrixPerspectiveOffCenterRH(ptr long long long long long long) d3dx8.D3DXMatrixPerspectiveOffCenterRH -@ stdcall D3DXMatrixPerspectiveRH(ptr long long long long) d3dx8.D3DXMatrixPerspectiveRH -@ stdcall D3DXMatrixReflect(ptr ptr) d3dx8.D3DXMatrixReflect -@ stdcall D3DXMatrixRotationAxis(ptr ptr long) d3dx8.D3DXMatrixRotationAxis -@ stdcall D3DXMatrixRotationQuaternion(ptr ptr) d3dx8.D3DXMatrixRotationQuaternion -@ stdcall D3DXMatrixRotationX(ptr long) d3dx8.D3DXMatrixRotationX -@ stdcall D3DXMatrixRotationY(ptr long) d3dx8.D3DXMatrixRotationY -@ stdcall D3DXMatrixRotationYawPitchRoll(ptr long long long) d3dx8.D3DXMatrixRotationYawPitchRoll -@ stdcall D3DXMatrixRotationZ(ptr long) d3dx8.D3DXMatrixRotationZ -@ stdcall D3DXMatrixScaling(ptr long long long) d3dx8.D3DXMatrixScaling -@ stdcall D3DXMatrixShadow(ptr ptr ptr) d3dx8.D3DXMatrixShadow -@ stdcall D3DXMatrixTransformation(ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXMatrixTransformation +@ stdcall D3DXMatrixDeterminant(ptr) +@ stdcall D3DXMatrixInverse(ptr ptr ptr) +@ stdcall D3DXMatrixLookAtLH(ptr ptr ptr ptr) +@ stdcall D3DXMatrixLookAtRH(ptr ptr ptr ptr) +@ stdcall D3DXMatrixMultiply(ptr ptr ptr) +@ stdcall D3DXMatrixMultiplyTranspose(ptr ptr ptr) +@ stdcall D3DXMatrixOrthoLH(ptr long long long long) +@ stdcall D3DXMatrixOrthoOffCenterLH(ptr long long long long long long) +@ stdcall D3DXMatrixOrthoOffCenterRH(ptr long long long long long long) +@ stdcall D3DXMatrixOrthoRH(ptr long long long long) +@ stdcall D3DXMatrixPerspectiveFovLH(ptr long long long long) +@ stdcall D3DXMatrixPerspectiveFovRH(ptr long long long long) +@ stdcall D3DXMatrixPerspectiveLH(ptr long long long long) +@ stdcall D3DXMatrixPerspectiveOffCenterLH(ptr long long long long long long) +@ stdcall D3DXMatrixPerspectiveOffCenterRH(ptr long long long long long long) +@ stdcall D3DXMatrixPerspectiveRH(ptr long long long long) +@ stdcall D3DXMatrixReflect(ptr ptr) +@ stdcall D3DXMatrixRotationAxis(ptr ptr long) +@ stdcall D3DXMatrixRotationQuaternion(ptr ptr) +@ stdcall D3DXMatrixRotationX(ptr long) +@ stdcall D3DXMatrixRotationY(ptr long) +@ stdcall D3DXMatrixRotationYawPitchRoll(ptr long long long) +@ stdcall D3DXMatrixRotationZ(ptr long) +@ stdcall D3DXMatrixScaling(ptr long long long) +@ stdcall D3DXMatrixShadow(ptr ptr ptr) +@ stdcall D3DXMatrixTransformation(ptr ptr ptr ptr ptr ptr ptr) @ stdcall D3DXMatrixTransformation2D(ptr ptr long ptr ptr long ptr) -@ stdcall D3DXMatrixTranslation(ptr long long long) d3dx8.D3DXMatrixTranslation -@ stdcall D3DXMatrixTranspose(ptr ptr) d3dx8.D3DXMatrixTranspose +@ stdcall D3DXMatrixTranslation(ptr long long long) +@ stdcall D3DXMatrixTranspose(ptr ptr) @ stub D3DXOptimizeFaces @ stub D3DXOptimizeVertices -@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr) d3dx8.D3DXPlaneFromPointNormal -@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr) d3dx8.D3DXPlaneFromPoints -@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr) d3dx8.D3DXPlaneIntersectLine -@ stdcall D3DXPlaneNormalize(ptr ptr) d3dx8.D3DXPlaneNormalize -@ stdcall D3DXPlaneTransform(ptr ptr ptr) d3dx8.D3DXPlaneTransform +@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr) +@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr) +@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr) +@ stdcall D3DXPlaneNormalize(ptr ptr) +@ stdcall D3DXPlaneTransform(ptr ptr ptr) @ stdcall D3DXPlaneTransformArray(ptr long ptr long ptr long) @ stub D3DXPreprocessShader @ stub D3DXPreprocessShaderFromFileA @ stub D3DXPreprocessShaderFromFileW @ stub D3DXPreprocessShaderFromResourceA @ stub D3DXPreprocessShaderFromResourceW -@ stdcall D3DXQuaternionBaryCentric(ptr ptr ptr ptr long long) d3dx8.D3DXQuaternionBaryCentric -@ stdcall D3DXQuaternionExp(ptr ptr) d3dx8.D3DXQuaternionExp -@ stdcall D3DXQuaternionInverse(ptr ptr) d3dx8.D3DXQuaternionInverse -@ stdcall D3DXQuaternionLn(ptr ptr) d3dx8.D3DXQuaternionLn -@ stdcall D3DXQuaternionMultiply(ptr ptr ptr) d3dx8.D3DXQuaternionMultiply -@ stdcall D3DXQuaternionNormalize(ptr ptr) d3dx8.D3DXQuaternionNormalize -@ stdcall D3DXQuaternionRotationAxis(ptr ptr long) d3dx8.D3DXQuaternionRotationAxis -@ stdcall D3DXQuaternionRotationMatrix(ptr ptr) d3dx8.D3DXQuaternionRotationMatrix -@ stdcall D3DXQuaternionRotationYawPitchRoll(ptr long long long) d3dx8.D3DXQuaternionRotationYawPitchRoll -@ stdcall D3DXQuaternionSlerp(ptr ptr ptr long) d3dx8.D3DXQuaternionSlerp -@ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr long) d3dx8.D3DXQuaternionSquad -@ stdcall D3DXQuaternionSquadSetup(ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXQuaternionSquadSetup -@ stdcall D3DXQuaternionToAxisAngle(ptr ptr ptr) d3dx8.D3DXQuaternionToAxisAngle +@ stdcall D3DXQuaternionBaryCentric(ptr ptr ptr ptr long long) +@ stdcall D3DXQuaternionExp(ptr ptr) +@ stdcall D3DXQuaternionInverse(ptr ptr) +@ stdcall D3DXQuaternionLn(ptr ptr) +@ stdcall D3DXQuaternionMultiply(ptr ptr ptr) +@ stdcall D3DXQuaternionNormalize(ptr ptr) +@ stdcall D3DXQuaternionRotationAxis(ptr ptr long) +@ stdcall D3DXQuaternionRotationMatrix(ptr ptr) +@ stdcall D3DXQuaternionRotationYawPitchRoll(ptr long long long) +@ stdcall D3DXQuaternionSlerp(ptr ptr ptr long) +@ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr long) +@ stub D3DXQuaternionSquadSetup +@ stdcall D3DXQuaternionToAxisAngle(ptr ptr ptr) @ stub D3DXRectPatchSize @ stub D3DXSaveMeshHierarchyToFileA @ stub D3DXSaveMeshHierarchyToFileW @@ -290,47 +290,47 @@ @ stub D3DXSHRotate @ stub D3DXSHRotateZ @ stub D3DXSHScale -@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx8.D3DXSimplifyMesh -@ stdcall D3DXSphereBoundProbe(ptr long ptr ptr) d3dx8.D3DXSphereBoundProbe -@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx8.D3DXSplitMesh -@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx8.D3DXTessellateNPatches +@ stub D3DXSimplifyMesh +@ stdcall D3DXSphereBoundProbe(ptr long ptr ptr) +@ stub D3DXSplitMesh +@ stub D3DXTessellateNPatches @ stub D3DXTessellateRectPatch @ stub D3DXTessellateTriPatch @ stub D3DXTriPatchSize @ stub D3DXUVAtlasCreate @ stub D3DXUVAtlasPack @ stub D3DXUVAtlasPartition -@ stdcall D3DXValidMesh(ptr ptr ptr) d3dx8.D3DXValidMesh +@ stub D3DXValidMesh @ stub D3DXValidPatchMesh -@ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr long long) d3dx8.D3DXVec2BaryCentric -@ stdcall D3DXVec2CatmullRom(ptr ptr ptr ptr ptr long) d3dx8.D3DXVec2CatmullRom -@ stdcall D3DXVec2Hermite(ptr ptr ptr ptr ptr long) d3dx8.D3DXVec2Hermite -@ stdcall D3DXVec2Normalize(ptr ptr) d3dx8.D3DXVec2Normalize -@ stdcall D3DXVec2Transform(ptr ptr ptr) d3dx8.D3DXVec2Transform +@ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr long long) +@ stdcall D3DXVec2CatmullRom(ptr ptr ptr ptr ptr long) +@ stdcall D3DXVec2Hermite(ptr ptr ptr ptr ptr long) +@ stdcall D3DXVec2Normalize(ptr ptr) +@ stdcall D3DXVec2Transform(ptr ptr ptr) @ stdcall D3DXVec2TransformArray(ptr long ptr long ptr long) -@ stdcall D3DXVec2TransformCoord(ptr ptr ptr) d3dx8.D3DXVec2TransformCoord +@ stdcall D3DXVec2TransformCoord(ptr ptr ptr) @ stdcall D3DXVec2TransformCoordArray(ptr long ptr long ptr long) -@ stdcall D3DXVec2TransformNormal(ptr ptr ptr) d3dx8.D3DXVec2TransformNormal +@ stdcall D3DXVec2TransformNormal(ptr ptr ptr) @ stdcall D3DXVec2TransformNormalArray(ptr long ptr long ptr long) -@ stdcall D3DXVec3BaryCentric(ptr ptr ptr ptr long long) d3dx8.D3DXVec3BaryCentric -@ stdcall D3DXVec3CatmullRom(ptr ptr ptr ptr ptr long) d3dx8.D3DXVec3CatmullRom -@ stdcall D3DXVec3Hermite(ptr ptr ptr ptr ptr long) d3dx8.D3DXVec3Hermite -@ stdcall D3DXVec3Normalize(ptr ptr) d3dx8.D3DXVec3Normalize -@ stdcall D3DXVec3Project(ptr ptr ptr ptr ptr ptr) d3dx8.D3DXVec3Project +@ stdcall D3DXVec3BaryCentric(ptr ptr ptr ptr long long) +@ stdcall D3DXVec3CatmullRom(ptr ptr ptr ptr ptr long) +@ stdcall D3DXVec3Hermite(ptr ptr ptr ptr ptr long) +@ stdcall D3DXVec3Normalize(ptr ptr) +@ stdcall D3DXVec3Project(ptr ptr ptr ptr ptr ptr) @ stdcall D3DXVec3ProjectArray(ptr long ptr long ptr ptr ptr ptr long) -@ stdcall D3DXVec3Transform(ptr ptr ptr) d3dx8.D3DXVec3Transform +@ stdcall D3DXVec3Transform(ptr ptr ptr) @ stdcall D3DXVec3TransformArray(ptr long ptr long ptr long) -@ stdcall D3DXVec3TransformCoord(ptr ptr ptr) d3dx8.D3DXVec3TransformCoord +@ stdcall D3DXVec3TransformCoord(ptr ptr ptr) @ stdcall D3DXVec3TransformCoordArray(ptr long ptr long ptr long) -@ stdcall D3DXVec3TransformNormal(ptr ptr ptr) d3dx8.D3DXVec3TransformNormal +@ stdcall D3DXVec3TransformNormal(ptr ptr ptr) @ stdcall D3DXVec3TransformNormalArray(ptr long ptr long ptr long) -@ stdcall D3DXVec3Unproject(ptr ptr ptr ptr ptr ptr) d3dx8.D3DXVec3Unproject +@ stdcall D3DXVec3Unproject(ptr ptr ptr ptr ptr ptr) @ stdcall D3DXVec3UnprojectArray(ptr long ptr long ptr ptr ptr ptr long) -@ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr long long) d3dx8.D3DXVec4BaryCentric -@ stdcall D3DXVec4CatmullRom(ptr ptr ptr ptr ptr long) d3dx8.D3DXVec4CatmullRom -@ stdcall D3DXVec4Cross(ptr ptr ptr ptr) d3dx8.D3DXVec4Cross -@ stdcall D3DXVec4Hermite(ptr ptr ptr ptr ptr long) d3dx8.D3DXVec4Hermite -@ stdcall D3DXVec4Normalize(ptr ptr) d3dx8.D3DXVec4Normalize -@ stdcall D3DXVec4Transform(ptr ptr ptr) d3dx8.D3DXVec4Transform +@ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr long long) +@ stdcall D3DXVec4CatmullRom(ptr ptr ptr ptr ptr long) +@ stdcall D3DXVec4Cross(ptr ptr ptr ptr) +@ stdcall D3DXVec4Hermite(ptr ptr ptr ptr ptr long) +@ stdcall D3DXVec4Normalize(ptr ptr) +@ stdcall D3DXVec4Transform(ptr ptr ptr) @ stdcall D3DXVec4TransformArray(ptr long ptr long ptr long) @ stub D3DXWeldVertices diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h index cf3e176cbe5..8568366d277 100644 --- a/dlls/d3dx9_36/d3dx9_36_private.h +++ b/dlls/d3dx9_36/d3dx9_36_private.h @@ -1,4 +1,6 @@ /* + * Copyright (C) 2002 Raphael Junqueira + * Copyright (C) 2008 David Adam * Copyright (C) 2008 Tony Wasserka * * This library is free software; you can redistribute it and/or @@ -32,6 +34,20 @@ HRESULT map_view_of_file(LPCWSTR filename, LPVOID *buffer, DWORD *length); HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, LPVOID *buffer, DWORD *length); +extern const ID3DXBufferVtbl D3DXBuffer_Vtbl; + +/* ID3DXBUFFER */ +typedef struct ID3DXBufferImpl +{ + /* IUnknown fields */ + const ID3DXBufferVtbl *lpVtbl; + LONG ref; + + /* ID3DXBuffer fields */ + DWORD *buffer; + DWORD bufferSize; +} ID3DXBufferImpl; + /* ID3DXFont */ typedef struct ID3DXFontImpl @@ -48,6 +64,18 @@ typedef struct ID3DXFontImpl HFONT hfont; } ID3DXFontImpl; +/* ID3DXMatrixStack */ +typedef struct ID3DXMatrixStackImpl +{ + /* IUnknown fields */ + const ID3DXMatrixStackVtbl *lpVtbl; + LONG ref; + + /* ID3DXMatrixStack fields */ + unsigned int current; + unsigned int stack_size; + D3DXMATRIX *stack; +} ID3DXMatrixStackImpl; /*ID3DXSprite */ typedef struct _SPRITE { diff --git a/dlls/d3dx8/math.c b/dlls/d3dx9_36/math.c similarity index 80% rename from dlls/d3dx8/math.c rename to dlls/d3dx9_36/math.c index 34f6fed04d7..30f7ec9bf92 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx9_36/math.c @@ -1,6 +1,11 @@ /* - * Copyright 2007 David Adam - * Copyright 2008 Jérôme Gardou + * Mathematical operations specific to D3DX9. + * + * Copyright (C) 2008 David Adam + * Copyright (C) 2008 Luis Busquets + * Copyright (C) 2008 Jérôme Gardou + * Copyright (C) 2008 Philip Nilsson + * Copyright (C) 2008 Henri Verbeet * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,14 +22,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - #define NONAMELESSUNION +#include "config.h" #include "windef.h" -#include "winbase.h" #include "wingdi.h" -#include "d3dx8_private.h" +#include "d3dx9_36_private.h" #include "wine/debug.h" @@ -76,40 +79,126 @@ D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, FLOAT scalin D3DXMATRIX m1, m2, m3, m4, m5; D3DXMatrixScaling(&m1, scaling, scaling, scaling); + if ( !rotationcenter ) { - D3DXMatrixIdentity(&m2); - D3DXMatrixIdentity(&m4); + D3DXMatrixIdentity(&m2); + D3DXMatrixIdentity(&m4); } else { - D3DXMatrixTranslation(&m2, -rotationcenter->x, -rotationcenter->y, -rotationcenter->z); - D3DXMatrixTranslation(&m4, rotationcenter->x, rotationcenter->y, rotationcenter->z); + D3DXMatrixTranslation(&m2, -rotationcenter->x, -rotationcenter->y, -rotationcenter->z); + D3DXMatrixTranslation(&m4, rotationcenter->x, rotationcenter->y, rotationcenter->z); } - if ( !rotation ) + + if ( !rotation ) D3DXMatrixIdentity(&m3); + else D3DXMatrixRotationQuaternion(&m3, rotation); + + if ( !translation ) D3DXMatrixIdentity(&m5); + else D3DXMatrixTranslation(&m5, translation->x, translation->y, translation->z); + + D3DXMatrixMultiply(&m1, &m1, &m2); + D3DXMatrixMultiply(&m1, &m1, &m3); + D3DXMatrixMultiply(&m1, &m1, &m4); + D3DXMatrixMultiply(pout, &m1, &m5); + return pout; +} + +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, CONST D3DXVECTOR2 *ptranslation) +{ + D3DXMATRIX m1, m2, m3, m4, m5; + D3DXQUATERNION rot; + D3DXVECTOR3 rot_center, trans; + + rot.w=cos(rotation/2.0f); + rot.x=0.0f; + rot.y=0.0f; + rot.z=sin(rotation/2.0f); + + if ( protationcenter ) { - D3DXMatrixIdentity(&m3); + rot_center.x=protationcenter->x; + rot_center.y=protationcenter->y; + rot_center.z=0.0f; } else { - D3DXMatrixRotationQuaternion(&m3, rotation); + rot_center.x=0.0f; + rot_center.y=0.0f; + rot_center.z=0.0f; } - if ( !translation ) + + if ( ptranslation ) { - D3DXMatrixIdentity(&m5); + trans.x=ptranslation->x; + trans.y=ptranslation->y; + trans.z=0.0f; } else { - D3DXMatrixTranslation(&m5, translation->x, translation->y, translation->z); + trans.x=0.0f; + trans.y=0.0f; + trans.z=0.0f; } + + D3DXMatrixScaling(&m1, scaling, scaling, 1.0f); + D3DXMatrixTranslation(&m2, -rot_center.x, -rot_center.y, -rot_center.z); + D3DXMatrixTranslation(&m4, rot_center.x, rot_center.y, rot_center.z); + D3DXMatrixRotationQuaternion(&m3, &rot); + D3DXMatrixTranslation(&m5, trans.x, trans.y, trans.z); + D3DXMatrixMultiply(&m1, &m1, &m2); D3DXMatrixMultiply(&m1, &m1, &m3); D3DXMatrixMultiply(&m1, &m1, &m4); D3DXMatrixMultiply(pout, &m1, &m5); + return pout; } -FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm) +HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutrotation, D3DXVECTOR3 *pouttranslation, CONST D3DXMATRIX *pm) +{ + D3DXMATRIX normalized; + D3DXVECTOR3 vec; + + /*Compute the scaling part.*/ + vec.x=pm->u.m[0][0]; + vec.y=pm->u.m[0][1]; + vec.z=pm->u.m[0][2]; + poutscale->x=D3DXVec3Length(&vec); + + vec.x=pm->u.m[1][0]; + vec.y=pm->u.m[1][1]; + vec.z=pm->u.m[1][2]; + poutscale->y=D3DXVec3Length(&vec); + + vec.x=pm->u.m[2][0]; + vec.y=pm->u.m[2][1]; + vec.z=pm->u.m[2][2]; + poutscale->z=D3DXVec3Length(&vec); + + /*Compute the translation part.*/ + pouttranslation->x=pm->u.m[3][0]; + pouttranslation->y=pm->u.m[3][1]; + pouttranslation->z=pm->u.m[3][2]; + + /*Let's calculate the rotation now*/ + if ( (poutscale->x == 0.0f) || (poutscale->y == 0.0f) || (poutscale->z == 0.0f) ) return D3DERR_INVALIDCALL; + + normalized.u.m[0][0]=pm->u.m[0][0]/poutscale->x; + normalized.u.m[0][1]=pm->u.m[0][1]/poutscale->x; + normalized.u.m[0][2]=pm->u.m[0][2]/poutscale->x; + normalized.u.m[1][0]=pm->u.m[1][0]/poutscale->y; + normalized.u.m[1][1]=pm->u.m[1][1]/poutscale->y; + normalized.u.m[1][2]=pm->u.m[1][2]/poutscale->y; + normalized.u.m[2][0]=pm->u.m[2][0]/poutscale->z; + normalized.u.m[2][1]=pm->u.m[2][1]/poutscale->z; + normalized.u.m[2][2]=pm->u.m[2][2]/poutscale->z; + + D3DXQuaternionRotationMatrix(poutrotation,&normalized); + return S_OK; +} + +FLOAT WINAPI D3DXMatrixDeterminant(CONST D3DXMATRIX *pm) { D3DXVECTOR4 minor, v1, v2, v3; FLOAT det; @@ -129,29 +218,30 @@ D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, CONS D3DXVECTOR4 v, vec[3]; FLOAT det; - det = D3DXMatrixfDeterminant(pm); + det = D3DXMatrixDeterminant(pm); if ( !det ) return NULL; if ( pdeterminant ) *pdeterminant = det; for (i=0; i<4; i++) { - for (j=0; j<4; j++) - { - if (j != i ) - { - a = j; - if ( j > i ) a = a-1; - vec[a].x = pm->u.m[j][0]; - vec[a].y = pm->u.m[j][1]; - vec[a].z = pm->u.m[j][2]; - vec[a].w = pm->u.m[j][3]; - } - } + for (j=0; j<4; j++) + { + if (j != i ) + { + a = j; + if ( j > i ) a = a-1; + vec[a].x = pm->u.m[j][0]; + vec[a].y = pm->u.m[j][1]; + vec[a].z = pm->u.m[j][2]; + vec[a].w = pm->u.m[j][3]; + } + } D3DXVec4Cross(&v, &vec[0], &vec[1], &vec[2]); out.u.m[0][i] = pow(-1.0f, i) * v.x / det; out.u.m[1][i] = pow(-1.0f, i) * v.y / det; out.u.m[2][i] = pow(-1.0f, i) * v.z / det; out.u.m[3][i] = pow(-1.0f, i) * v.w / det; } + *pout = out; return pout; } @@ -221,11 +311,12 @@ D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, C for (i=0; i<4; i++) { - for (j=0; j<4; j++) - { - out.u.m[i][j] = pm1->u.m[i][0] * pm2->u.m[0][j] + pm1->u.m[i][1] * pm2->u.m[1][j] + pm1->u.m[i][2] * pm2->u.m[2][j] + pm1->u.m[i][3] * pm2->u.m[3][j]; - } + for (j=0; j<4; j++) + { + out.u.m[i][j] = pm1->u.m[i][0] * pm2->u.m[0][j] + pm1->u.m[i][1] * pm2->u.m[1][j] + pm1->u.m[i][2] * pm2->u.m[2][j] + pm1->u.m[i][3] * pm2->u.m[3][j]; + } } + *pout = out; return pout; } @@ -497,75 +588,141 @@ D3DXMATRIX* WINAPI D3DXMatrixTransformation(D3DXMATRIX *pout, CONST D3DXVECTOR3 if ( !pscalingcenter ) { - psc.x = 0.0f; - psc.y = 0.0f; - psc.z = 0.0f; + psc.x = 0.0f; + psc.y = 0.0f; + psc.z = 0.0f; } else { - psc.x = pscalingcenter->x; - psc.y = pscalingcenter->y; - psc.z = pscalingcenter->z; + psc.x = pscalingcenter->x; + psc.y = pscalingcenter->y; + psc.z = pscalingcenter->z; } + if ( !protationcenter ) { - prc.x = 0.0f; - prc.y = 0.0f; - prc.z = 0.0f; + prc.x = 0.0f; + prc.y = 0.0f; + prc.z = 0.0f; } else { - prc.x = protationcenter->x; - prc.y = protationcenter->y; - prc.z = protationcenter->z; + prc.x = protationcenter->x; + prc.y = protationcenter->y; + prc.z = protationcenter->z; } + if ( !ptranslation ) { - pt.x = 0.0f; - pt.y = 0.0f; - pt.z = 0.0f; + pt.x = 0.0f; + pt.y = 0.0f; + pt.z = 0.0f; } else { - pt.x = ptranslation->x; - pt.y = ptranslation->y; - pt.z = ptranslation->z; + pt.x = ptranslation->x; + pt.y = ptranslation->y; + pt.z = ptranslation->z; } + D3DXMatrixTranslation(&m1, -psc.x, -psc.y, -psc.z); + if ( !pscalingrotation ) { - D3DXMatrixIdentity(&m2); - D3DXMatrixIdentity(&m4); + D3DXMatrixIdentity(&m2); + D3DXMatrixIdentity(&m4); } else { - D3DXMatrixRotationQuaternion(&m4, pscalingrotation); - D3DXMatrixInverse(&m2, NULL, &m4); + D3DXMatrixRotationQuaternion(&m4, pscalingrotation); + D3DXMatrixInverse(&m2, NULL, &m4); } - if ( !pscaling ) + + if ( !pscaling ) D3DXMatrixIdentity(&m3); + else D3DXMatrixScaling(&m3, pscaling->x, pscaling->y, pscaling->z); + + if ( !protation ) D3DXMatrixIdentity(&m6); + else D3DXMatrixRotationQuaternion(&m6, protation); + + D3DXMatrixTranslation(&m5, psc.x - prc.x, psc.y - prc.y, psc.z - prc.z); + D3DXMatrixTranslation(&m7, prc.x + pt.x, prc.y + pt.y, prc.z + pt.z); + D3DXMatrixMultiply(&m1, &m1, &m2); + D3DXMatrixMultiply(&m1, &m1, &m3); + D3DXMatrixMultiply(&m1, &m1, &m4); + D3DXMatrixMultiply(&m1, &m1, &m5); + D3DXMatrixMultiply(&m1, &m1, &m6); + D3DXMatrixMultiply(pout, &m1, &m7); + return pout; +} +D3DXMATRIX* WINAPI D3DXMatrixTransformation2D(D3DXMATRIX *pout, CONST D3DXVECTOR2 *pscalingcenter, FLOAT scalingrotation, CONST D3DXVECTOR2 *pscaling, CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, CONST D3DXVECTOR2 *ptranslation) +{ + D3DXQUATERNION rot, sca_rot; + D3DXVECTOR3 rot_center, sca, sca_center, trans; + + if ( pscalingcenter ) { - D3DXMatrixIdentity(&m3); + sca_center.x=pscalingcenter->x; + sca_center.y=pscalingcenter->y; + sca_center.z=0.0f; } else { - D3DXMatrixScaling(&m3, pscaling->x, pscaling->y, pscaling->z); + sca_center.x=0.0f; + sca_center.y=0.0f; + sca_center.z=0.0f; } - if ( !protation ) + + if ( pscaling ) { - D3DXMatrixIdentity(&m6); + sca.x=pscaling->x; + sca.y=pscaling->y; + sca.z=1.0f; } else { - D3DXMatrixRotationQuaternion(&m6, protation); + sca.x=1.0f; + sca.y=1.0f; + sca.z=1.0f; } - D3DXMatrixTranslation(&m5, psc.x - prc.x, psc.y - prc.y, psc.z - prc.z); - D3DXMatrixTranslation(&m7, prc.x + pt.x, prc.y + pt.y, prc.z + pt.z); - D3DXMatrixMultiply(&m1, &m1, &m2); - D3DXMatrixMultiply(&m1, &m1, &m3); - D3DXMatrixMultiply(&m1, &m1, &m4); - D3DXMatrixMultiply(&m1, &m1, &m5); - D3DXMatrixMultiply(&m1, &m1, &m6); - D3DXMatrixMultiply(pout, &m1, &m7); + + if ( protationcenter ) + { + rot_center.x=protationcenter->x; + rot_center.y=protationcenter->y; + rot_center.z=0.0f; + } + else + { + rot_center.x=0.0f; + rot_center.y=0.0f; + rot_center.z=0.0f; + } + + if ( ptranslation ) + { + trans.x=ptranslation->x; + trans.y=ptranslation->y; + trans.z=0.0f; + } + else + { + trans.x=0.0f; + trans.y=0.0f; + trans.z=0.0f; + } + + rot.w=cos(rotation/2.0f); + rot.x=0.0f; + rot.y=0.0f; + rot.z=sin(rotation/2.0f); + + sca_rot.w=cos(scalingrotation/2.0f); + sca_rot.x=0.0f; + sca_rot.y=0.0f; + sca_rot.z=sin(scalingrotation/2.0f); + + D3DXMatrixTransformation(pout, &sca_center, &sca_rot, &sca, &rot_center, &rot, &trans); + return pout; } @@ -584,12 +741,8 @@ D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm) int i,j; for (i=0; i<4; i++) - { - for (j=0; j<4; j++) - { - pout->u.m[i][j] = m.u.m[j][i]; - } - } + for (j=0; j<4; j++) pout->u.m[i][j] = m.u.m[j][i]; + return pout; } @@ -983,6 +1136,19 @@ D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, C return pout; } +D3DXPLANE* WINAPI D3DXPlaneTransformArray(D3DXPLANE* out, UINT outstride, CONST D3DXPLANE* in, UINT instride, CONST D3DXMATRIX* matrix, UINT elements) +{ + UINT i; + + for (i = 0; i < elements; ++i) { + D3DXPlaneTransform( + (D3DXPLANE*)((char*)out + outstride * i), + (CONST D3DXPLANE*)((const char*)in + instride * i), + matrix); + } + return out; +} + /*_________________D3DXQUATERNION________________*/ D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, FLOAT f, FLOAT g) @@ -1016,23 +1182,17 @@ D3DXQUATERNION* WINAPI D3DXQuaternionExp(D3DXQUATERNION *pout, CONST D3DXQUATERN D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) { + D3DXQUATERNION out; FLOAT norm; norm = D3DXQuaternionLengthSq(pq); - if ( !norm ) - { - pout->x = 0.0f; - pout->y = 0.0f; - pout->z = 0.0f; - pout->w = 0.0f; - } - else - { - pout->x = -pq->x / norm; - pout->y = -pq->y / norm; - pout->z = -pq->z / norm; - pout->w = pq->w / norm; - } + + out.x = -pq->x / norm; + out.y = -pq->y / norm; + out.z = -pq->z / norm; + out.w = pq->w / norm; + + *pout =out; return pout; } @@ -1081,21 +1241,14 @@ D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQ FLOAT norm; norm = D3DXQuaternionLength(pq); - if ( !norm ) - { - out.x = 0.0f; - out.y = 0.0f; - out.z = 0.0f; - out.w = 0.0f; - } - else - { - out.x = pq->x / norm; - out.y = pq->y / norm; - out.z = pq->z / norm; - out.w = pq->w / norm; - } + + out.x = pq->x / norm; + out.y = pq->y / norm; + out.z = pq->z / norm; + out.w = pq->w / norm; + *pout=out; + return pout; } @@ -1207,23 +1360,10 @@ D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATE void WINAPI D3DXQuaternionToAxisAngle(CONST D3DXQUATERNION *pq, D3DXVECTOR3 *paxis, FLOAT *pangle) { - FLOAT norm; - - *pangle = 0.0f; - norm = D3DXQuaternionLength(pq); - if ( norm ) - { - paxis->x = pq->x / norm; - paxis->y = pq->y / norm; - paxis->z = pq->z / norm; - if ( fabs( pq->w ) <= 1.0f ) *pangle = 2.0f * acos(pq->w); - } - else - { - paxis->x = 1.0f; - paxis->y = 0.0f; - paxis->z = 0.0f; - } + paxis->x = pq->x; + paxis->y = pq->y; + paxis->z = pq->z; + *pangle = 2.0f * acos(pq->w); } /*_________________D3DXVec2_____________________*/ @@ -1285,6 +1425,19 @@ D3DXVECTOR4* WINAPI D3DXVec2Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR2 *pv, return pout; } +D3DXVECTOR4* WINAPI D3DXVec2TransformArray(D3DXVECTOR4* out, UINT outstride, CONST D3DXVECTOR2* in, UINT instride, CONST D3DXMATRIX* matrix, UINT elements) +{ + UINT i; + + for (i = 0; i < elements; ++i) { + D3DXVec2Transform( + (D3DXVECTOR4*)((char*)out + outstride * i), + (CONST D3DXVECTOR2*)((const char*)in + instride * i), + matrix); + } + return out; +} + D3DXVECTOR2* WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm) { FLOAT norm; @@ -1304,6 +1457,19 @@ D3DXVECTOR2* WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 return pout; } +D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray(D3DXVECTOR2* out, UINT outstride, CONST D3DXVECTOR2* in, UINT instride, CONST D3DXMATRIX* matrix, UINT elements) +{ + UINT i; + + for (i = 0; i < elements; ++i) { + D3DXVec2TransformCoord( + (D3DXVECTOR2*)((char*)out + outstride * i), + (CONST D3DXVECTOR2*)((const char*)in + instride * i), + matrix); + } + return out; +} + D3DXVECTOR2* WINAPI D3DXVec2TransformNormal(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm) { CONST D3DXVECTOR2 v = *pv; @@ -1312,6 +1478,19 @@ D3DXVECTOR2* WINAPI D3DXVec2TransformNormal(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 return pout; } +D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray(D3DXVECTOR2* out, UINT outstride, CONST D3DXVECTOR2 *in, UINT instride, CONST D3DXMATRIX *matrix, UINT elements) +{ + UINT i; + + for (i = 0; i < elements; ++i) { + D3DXVec2TransformNormal( + (D3DXVECTOR2*)((char*)out + outstride * i), + (CONST D3DXVECTOR2*)((const char*)in + instride * i), + matrix); + } + return out; +} + /*_________________D3DXVec3_____________________*/ D3DXVECTOR3* WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT f, FLOAT g) @@ -1367,7 +1546,7 @@ D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv) return pout; } -D3DXVECTOR3* WINAPI D3DXVec3Project(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT8 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld) +D3DXVECTOR3* WINAPI D3DXVec3Project(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT9 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld) { D3DXMATRIX m; D3DXVECTOR3 out; @@ -1382,6 +1561,19 @@ D3DXVECTOR3* WINAPI D3DXVec3Project(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CO return pout; } +D3DXVECTOR3* WINAPI D3DXVec3ProjectArray(D3DXVECTOR3* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride, CONST D3DVIEWPORT9* viewport, CONST D3DXMATRIX* projection, CONST D3DXMATRIX* view, CONST D3DXMATRIX* world, UINT elements) +{ + UINT i; + + for (i = 0; i < elements; ++i) { + D3DXVec3Project( + (D3DXVECTOR3*)((char*)out + outstride * i), + (CONST D3DXVECTOR3*)((const char*)in + instride * i), + viewport, projection, view, world); + } + return out; +} + D3DXVECTOR4* WINAPI D3DXVec3Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm) { pout->x = pm->u.m[0][0] * pv->x + pm->u.m[1][0] * pv->y + pm->u.m[2][0] * pv->z + pm->u.m[3][0]; @@ -1391,6 +1583,19 @@ D3DXVECTOR4* WINAPI D3DXVec3Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR3 *pv, return pout; } +D3DXVECTOR4* WINAPI D3DXVec3TransformArray(D3DXVECTOR4* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride, CONST D3DXMATRIX* matrix, UINT elements) +{ + UINT i; + + for (i = 0; i < elements; ++i) { + D3DXVec3Transform( + (D3DXVECTOR4*)((char*)out + outstride * i), + (CONST D3DXVECTOR3*)((const char*)in + instride * i), + matrix); + } + return out; +} + D3DXVECTOR3* WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm) { D3DXVECTOR3 out; @@ -1415,6 +1620,19 @@ D3DXVECTOR3* WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 return pout; } +D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray(D3DXVECTOR3* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride, CONST D3DXMATRIX* matrix, UINT elements) +{ + UINT i; + + for (i = 0; i < elements; ++i) { + D3DXVec3TransformCoord( + (D3DXVECTOR3*)((char*)out + outstride * i), + (CONST D3DXVECTOR3*)((const char*)in + instride * i), + matrix); + } + return out; +} + D3DXVECTOR3* WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm) { CONST D3DXVECTOR3 v = *pv; @@ -1425,7 +1643,20 @@ D3DXVECTOR3* WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 } -D3DXVECTOR3* WINAPI D3DXVec3Unproject(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT8 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld) +D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray(D3DXVECTOR3* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride, CONST D3DXMATRIX* matrix, UINT elements) +{ + UINT i; + + for (i = 0; i < elements; ++i) { + D3DXVec3TransformNormal( + (D3DXVECTOR3*)((char*)out + outstride * i), + (CONST D3DXVECTOR3*)((const char*)in + instride * i), + matrix); + } + return out; +} + +D3DXVECTOR3* WINAPI D3DXVec3Unproject(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT9 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld) { D3DXMATRIX m; D3DXVECTOR3 out; @@ -1441,6 +1672,19 @@ D3DXVECTOR3* WINAPI D3DXVec3Unproject(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, return pout; } +D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray(D3DXVECTOR3* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride, CONST D3DVIEWPORT9* viewport, CONST D3DXMATRIX* projection, CONST D3DXMATRIX* view, CONST D3DXMATRIX* world, UINT elements) +{ + UINT i; + + for (i = 0; i < elements; ++i) { + D3DXVec3Unproject( + (D3DXVECTOR3*)((char*)out + outstride * i), + (CONST D3DXVECTOR3*)((const char*)in + instride * i), + viewport, projection, view, world); + } + return out; +} + /*_________________D3DXVec4_____________________*/ D3DXVECTOR4* WINAPI D3DXVec4BaryCentric(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT f, FLOAT g) @@ -1522,3 +1766,16 @@ D3DXVECTOR4* WINAPI D3DXVec4Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv, *pout = out; return pout; } + +D3DXVECTOR4* WINAPI D3DXVec4TransformArray(D3DXVECTOR4* out, UINT outstride, CONST D3DXVECTOR4* in, UINT instride, CONST D3DXMATRIX* matrix, UINT elements) +{ + UINT i; + + for (i = 0; i < elements; ++i) { + D3DXVec4Transform( + (D3DXVECTOR4*)((char*)out + outstride * i), + (CONST D3DXVECTOR4*)((const char*)in + instride * i), + matrix); + } + return out; +} diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c index 9b54ce03492..251bb40f9fc 100644 --- a/dlls/d3dx9_36/mesh.c +++ b/dlls/d3dx9_36/mesh.c @@ -28,6 +28,79 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); /************************************************************************* + * D3DXBoxBoundProbe + */ +BOOL WINAPI D3DXBoxBoundProbe(CONST D3DXVECTOR3 *pmin, CONST D3DXVECTOR3 *pmax, CONST D3DXVECTOR3 *prayposition, CONST D3DXVECTOR3 *praydirection) + +/* Algorithm taken from the article: An Efficient and Robust Ray-Box Intersection Algoritm +Amy Williams University of Utah +Steve Barrus University of Utah +R. Keith Morley University of Utah +Peter Shirley University of Utah + +International Conference on Computer Graphics and Interactive Techniques archive +ACM SIGGRAPH 2005 Courses +Los Angeles, California + +This algorithm is free of patents or of copyrights, as confirmed by Peter Shirley himself. + +Algorithm: Consider the box as the intersection of three slabs. Clip the ray +against each slab, if there's anything left of the ray after we're +done we've got an intersection of the ray with the box. +*/ + +{ + FLOAT div, tmin, tmax, tymin, tymax, tzmin, tzmax; + + div = 1.0f / praydirection->x; + if ( div >= 0.0f ) + { + tmin = ( pmin->x - prayposition->x ) * div; + tmax = ( pmax->x - prayposition->x ) * div; + } + else + { + tmin = ( pmax->x - prayposition->x ) * div; + tmax = ( pmin->x - prayposition->x ) * div; + } + + if ( tmax < 0.0f ) return FALSE; + + div = 1.0f / praydirection->y; + if ( div >= 0.0f ) + { + tymin = ( pmin->y - prayposition->y ) * div; + tymax = ( pmax->y - prayposition->y ) * div; + } + else + { + tymin = ( pmax->y - prayposition->y ) * div; + tymax = ( pmin->y - prayposition->y ) * div; + } + + if ( ( tymax < 0.0f ) || ( tmin > tymax ) || ( tymin > tmax ) ) return FALSE; + + if ( tymin > tmin ) tmin = tymin; + if ( tymax < tmax ) tmax = tymax; + + div = 1.0f / praydirection->z; + if ( div >= 0.0f ) + { + tzmin = ( pmin->z - prayposition->z ) * div; + tzmax = ( pmax->z - prayposition->z ) * div; + } + else + { + tzmin = ( pmax->z - prayposition->z ) * div; + tzmax = ( pmin->z - prayposition->z ) * div; + } + + if ( (tzmax < 0.0f ) || ( tmin > tzmax ) || ( tzmin > tmax ) ) return FALSE; + + return TRUE; +} + +/************************************************************************* * D3DXComputeBoundingBox */ HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pmin, D3DXVECTOR3 *pmax) @@ -131,7 +204,7 @@ UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF) } /************************************************************************* - * D3DXGetFVFVertexSize + * D3DXGetDeclVertexSize */ UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_idx) { @@ -223,3 +296,21 @@ BOOL WINAPI D3DXIntersectTri(CONST D3DXVECTOR3 *p0, CONST D3DXVECTOR3 *p1, CONST return FALSE; } + +/************************************************************************* + * D3DXSphereBoundProbe + */ +BOOL WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *pcenter, FLOAT radius, CONST D3DXVECTOR3 *prayposition, CONST D3DXVECTOR3 *praydirection) +{ + D3DXVECTOR3 difference; + FLOAT a, b, c, d; + + a = D3DXVec3LengthSq(praydirection); + if (!D3DXVec3Subtract(&difference, prayposition, pcenter)) return FALSE; + b = D3DXVec3Dot(&difference, praydirection); + c = D3DXVec3LengthSq(&difference) - radius * radius; + d = b * b - a * c; + + if ( ( d <= 0.0f ) || ( sqrt(d) <= b ) ) return FALSE; + return TRUE; +} diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx9_36/tests/math.c similarity index 75% rename from dlls/d3dx8/tests/math.c rename to dlls/d3dx9_36/tests/math.c index 12236bc0a94..6e9f25da7de 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -1,5 +1,6 @@ /* - * Copyright 2007 David Adam + * Copyright 2008 David Adam + * Copyright 2008 Philip Nilsson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,13 +17,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include "d3dx8.h" - #include "wine/test.h" +#include "d3dx9.h" + +#define ARRAY_SIZE 5 #define admitted_error 0.0001f +#define relative_error(exp, out) ((exp == out) ? 0.0f : (fabs(out - exp) / fabs(exp))) + #define expect_color(expectedcolor,gotcolor) ok((fabs(expectedcolor.r-gotcolor.r)1.0f */ - expectedvec.x = 1.0f/11.0f; expectedvec.y = 2.0f/11.0f; expectedvec.z = 4.0f/11.0f; + expectedvec.x = 1.0f; expectedvec.y = 2.0f; expectedvec.z = 4.0f; expected = 0.0f; D3DXQuaternionToAxisAngle(&q,&axis,&angle); expect_vec3(expectedvec,axis); - ok(fabs( angle - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, angle); /* Test the null quaternion */ - expectedvec.x = 1.0f; expectedvec.y = 0.0f; expectedvec.z = 0.0f; - expected = 0.0f; + expectedvec.x = 0.0f; expectedvec.y = 0.0f; expectedvec.z = 0.0f; + expected = 3.141593f; D3DXQuaternionToAxisAngle(&nul,&axis,&angle); expect_vec3(expectedvec,axis); ok(fabs( angle - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, angle); } -static void D3X8Vector2Test(void) +static void D3DXVector2Test(void) { D3DXVECTOR2 expectedvec, gotvec, nul, nulproj, u, v, w, x; LPD3DXVECTOR2 funcpointer; @@ -1074,9 +1117,9 @@ static void D3X8Vector2Test(void) expect_vec(expectedvec,gotvec); } -static void D3X8Vector3Test(void) +static void D3DXVector3Test(void) { - D3DVIEWPORT8 viewport; + D3DVIEWPORT9 viewport; D3DXVECTOR3 expectedvec, gotvec, nul, nulproj, u, v, w, x; LPD3DXVECTOR3 funcpointer; D3DXVECTOR4 expectedtrans, gottrans; @@ -1270,7 +1313,7 @@ static void D3X8Vector3Test(void) expect_vec3(expectedvec,gotvec); } -static void D3X8Vector4Test(void) +static void D3DXVector4Test(void) { D3DXVECTOR4 expectedvec, gotvec, nul, u, v, w, x; LPD3DXVECTOR4 funcpointer; @@ -1509,15 +1552,715 @@ static void test_matrix_stack(void) ok(!refcount, "Matrix stack has %u references left.\n", refcount); } +static void test_Matrix_AffineTransformation2D(void) +{ + D3DXMATRIX exp_mat, got_mat; + D3DXVECTOR2 center, position; + FLOAT angle, scale; + + center.x = 3.0f; + center.y = 4.0f; + + position.x = -6.0f; + position.y = 7.0f; + + angle = D3DX_PI/3.0f; + + scale = 20.0f; + + U(exp_mat).m[0][0] = 10.0f; + U(exp_mat).m[1][0] = -17.320507f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = -1.035898f; + U(exp_mat).m[0][1] = 17.320507f; + U(exp_mat).m[1][1] = 10.0f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = 6.401924f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 1.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; + + D3DXMatrixAffineTransformation2D(&got_mat, scale, ¢er, angle, &position); + + expect_mat(&exp_mat, &got_mat); + +/*______________*/ + + center.x = 3.0f; + center.y = 4.0f; + + angle = D3DX_PI/3.0f; + + scale = 20.0f; + + U(exp_mat).m[0][0] = 10.0f; + U(exp_mat).m[1][0] = -17.320507f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = 4.964102f; + U(exp_mat).m[0][1] = 17.320507f; + U(exp_mat).m[1][1] = 10.0f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = -0.598076f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 1.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; + + D3DXMatrixAffineTransformation2D(&got_mat, scale, ¢er, angle, NULL); + + expect_mat(&exp_mat, &got_mat); + +/*______________*/ + + position.x = -6.0f; + position.y = 7.0f; + + angle = D3DX_PI/3.0f; + + scale = 20.0f; + + U(exp_mat).m[0][0] = 10.0f; + U(exp_mat).m[1][0] = -17.320507f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = -6.0f; + U(exp_mat).m[0][1] = 17.320507f; + U(exp_mat).m[1][1] = 10.0f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = 7.0f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 1.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; + + D3DXMatrixAffineTransformation2D(&got_mat, scale, NULL, angle, &position); + + expect_mat(&exp_mat, &got_mat); + +/*______________*/ + + angle = 5.0f * D3DX_PI/4.0f; + + scale = -20.0f; + + U(exp_mat).m[0][0] = 14.142133f; + U(exp_mat).m[1][0] = -14.142133f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = 0.0f; + U(exp_mat).m[0][1] = 14.142133; + U(exp_mat).m[1][1] = 14.142133f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = 0.0f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 1.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; + + D3DXMatrixAffineTransformation2D(&got_mat, scale, NULL, angle, NULL); + + expect_mat(&exp_mat, &got_mat); +} + +static void test_Matrix_Decompose(void) +{ + D3DXMATRIX pm; + D3DXQUATERNION exp_rotation, got_rotation; + D3DXVECTOR3 exp_scale, got_scale, exp_translation, got_translation; + HRESULT hr; + +/*___________*/ + + U(pm).m[0][0] = -0.9238790f; + U(pm).m[1][0] = -0.2705984f; + U(pm).m[2][0] = 0.2705984f; + U(pm).m[3][0] = -5.0f; + U(pm).m[0][1] = 0.2705984f; + U(pm).m[1][1] = 0.03806049f; + U(pm).m[2][1] = 0.9619395f; + U(pm).m[3][1] = 0.0f; + U(pm).m[0][2] = -0.2705984f; + U(pm).m[1][2] = 0.9619395f; + U(pm).m[2][2] = 0.03806049f; + U(pm).m[3][2] = 10.0f; + U(pm).m[0][3] = 0.0f; + U(pm).m[1][3] = 0.0f; + U(pm).m[2][3] = 0.0f; + U(pm).m[3][3] = 1.0f; + + exp_scale.x = 1.0f; + exp_scale.y = 1.0f; + exp_scale.z = 1.0f; + + exp_rotation.w = 0.195091f; + exp_rotation.x = 0.0f; + exp_rotation.y = 0.693520f; + exp_rotation.z = 0.693520f; + + exp_translation.x = -5.0f; + exp_translation.y = 0.0f; + exp_translation.z = 10.0f; + + D3DXMatrixDecompose(&got_scale, &got_rotation, &got_translation, &pm); + + compare_scale(exp_scale, got_scale); + compare_rotation(exp_rotation, got_rotation); + compare_translation(exp_translation, got_translation); + +/*_________*/ + + U(pm).m[0][0] = -2.255813f; + U(pm).m[1][0] = 1.302324f; + U(pm).m[2][0] = 1.488373f; + U(pm).m[3][0] = 1.0f; + U(pm).m[0][1] = 1.302327f; + U(pm).m[1][1] = -0.7209296f; + U(pm).m[2][1] = 2.60465f; + U(pm).m[3][1] = 2.0f; + U(pm).m[0][2] = 1.488371f; + U(pm).m[1][2] = 2.604651f; + U(pm).m[2][2] = -0.02325551f; + U(pm).m[3][2] = 3.0f; + U(pm).m[0][3] = 0.0f; + U(pm).m[1][3] = 0.0f; + U(pm).m[2][3] = 0.0f; + U(pm).m[3][3] = 1.0f; + + exp_scale.x = 3.0f; + exp_scale.y = 3.0f; + exp_scale.z = 3.0f; + + exp_rotation.w = 0.0; + exp_rotation.x = 0.352180f; + exp_rotation.y = 0.616316f; + exp_rotation.z = 0.704361f; + + exp_translation.x = 1.0f; + exp_translation.y = 2.0f; + exp_translation.z = 3.0f; + + D3DXMatrixDecompose(&got_scale, &got_rotation, &got_translation, &pm); + + compare_scale(exp_scale, got_scale); + compare_rotation(exp_rotation, got_rotation); + compare_translation(exp_translation, got_translation); + +/*_____________*/ + + U(pm).m[0][0] = 2.427051f; + U(pm).m[1][0] = 0.0f; + U(pm).m[2][0] = 1.763355f; + U(pm).m[3][0] = 5.0f; + U(pm).m[0][1] = 0.0f; + U(pm).m[1][1] = 3.0f; + U(pm).m[2][1] = 0.0f; + U(pm).m[3][1] = 5.0f; + U(pm).m[0][2] = -1.763355f; + U(pm).m[1][2] = 0.0f; + U(pm).m[2][2] = 2.427051f; + U(pm).m[3][2] = 5.0f; + U(pm).m[0][3] = 0.0f; + U(pm).m[1][3] = 0.0f; + U(pm).m[2][3] = 0.0f; + U(pm).m[3][3] = 1.0f; + + exp_scale.x = 3.0f; + exp_scale.y = 3.0f; + exp_scale.z = 3.0f; + + exp_rotation.w = 0.951057f; + exp_rotation.x = 0.0f; + exp_rotation.y = 0.309017f; + exp_rotation.z = 0.0f; + + exp_translation.x = 5.0f; + exp_translation.y = 5.0f; + exp_translation.z = 5.0f; + + D3DXMatrixDecompose(&got_scale, &got_rotation, &got_translation, &pm); + + compare_scale(exp_scale, got_scale); + compare_rotation(exp_rotation, got_rotation); + compare_translation(exp_translation, got_translation); + +/*_____________*/ + + U(pm).m[0][0] = -0.9238790f; + U(pm).m[1][0] = -0.2705984f; + U(pm).m[2][0] = 0.2705984f; + U(pm).m[3][0] = -5.0f; + U(pm).m[0][1] = 0.2705984f; + U(pm).m[1][1] = 0.03806049f; + U(pm).m[2][1] = 0.9619395f; + U(pm).m[3][1] = 0.0f; + U(pm).m[0][2] = -0.2705984f; + U(pm).m[1][2] = 0.9619395f; + U(pm).m[2][2] = 0.03806049f; + U(pm).m[3][2] = 10.0f; + U(pm).m[0][3] = 0.0f; + U(pm).m[1][3] = 0.0f; + U(pm).m[2][3] = 0.0f; + U(pm).m[3][3] = 1.0f; + + exp_scale.x = 1.0f; + exp_scale.y = 1.0f; + exp_scale.z = 1.0f; + + exp_rotation.w = 0.195091f; + exp_rotation.x = 0.0f; + exp_rotation.y = 0.693520f; + exp_rotation.z = 0.693520f; + + exp_translation.x = -5.0f; + exp_translation.y = 0.0f; + exp_translation.z = 10.0f; + + D3DXMatrixDecompose(&got_scale, &got_rotation, &got_translation, &pm); + + compare_scale(exp_scale, got_scale); + compare_rotation(exp_rotation, got_rotation); + compare_translation(exp_translation, got_translation); + +/*__________*/ + + U(pm).m[0][0] = -0.9238790f; + U(pm).m[1][0] = -0.5411968f; + U(pm).m[2][0] = 0.8117952f; + U(pm).m[3][0] = -5.0f; + U(pm).m[0][1] = 0.2705984f; + U(pm).m[1][1] = 0.07612098f; + U(pm).m[2][1] = 2.8858185f; + U(pm).m[3][1] = 0.0f; + U(pm).m[0][2] = -0.2705984f; + U(pm).m[1][2] = 1.9238790f; + U(pm).m[2][2] = 0.11418147f; + U(pm).m[3][2] = 10.0f; + U(pm).m[0][3] = 0.0f; + U(pm).m[1][3] = 0.0f; + U(pm).m[2][3] = 0.0f; + U(pm).m[3][3] = 1.0f; + + exp_scale.x = 1.0f; + exp_scale.y = 2.0f; + exp_scale.z = 3.0f; + + exp_rotation.w = 0.195091f; + exp_rotation.x = 0.0f; + exp_rotation.y = 0.693520f; + exp_rotation.z = 0.693520f; + + exp_translation.x = -5.0f; + exp_translation.y = 0.0f; + exp_translation.z = 10.0f; + + D3DXMatrixDecompose(&got_scale, &got_rotation, &got_translation, &pm); + + compare_scale(exp_scale, got_scale); + compare_rotation(exp_rotation, got_rotation); + compare_translation(exp_translation, got_translation); + +/*__________*/ + + U(pm).m[0][0] = 0.7156004f; + U(pm).m[1][0] = -0.5098283f; + U(pm).m[2][0] = -0.4774843f; + U(pm).m[3][0] = -5.0f; + U(pm).m[0][1] = -0.6612288f; + U(pm).m[1][1] = -0.7147621f; + U(pm).m[2][1] = -0.2277977f; + U(pm).m[3][1] = 0.0f; + U(pm).m[0][2] = -0.2251499f; + U(pm).m[1][2] = 0.4787385f; + U(pm).m[2][2] = -0.8485972f; + U(pm).m[3][2] = 10.0f; + U(pm).m[0][3] = 0.0f; + U(pm).m[1][3] = 0.0f; + U(pm).m[2][3] = 0.0f; + U(pm).m[3][3] = 1.0f; + + exp_scale.x = 1.0f; + exp_scale.y = 1.0f; + exp_scale.z = 1.0f; + + exp_rotation.w = 0.195091f; + exp_rotation.x = 0.905395f; + exp_rotation.y = -0.323355f; + exp_rotation.z = -0.194013f; + + exp_translation.x = -5.0f; + exp_translation.y = 0.0f; + exp_translation.z = 10.0f; + + D3DXMatrixDecompose(&got_scale, &got_rotation, &got_translation, &pm); + + compare_scale(exp_scale, got_scale); + compare_rotation(exp_rotation, got_rotation); + compare_translation(exp_translation, got_translation); + +/*_____________*/ + + U(pm).m[0][0] = 0.06554436f; + U(pm).m[1][0] = -0.6873012f; + U(pm).m[2][0] = 0.7234092f; + U(pm).m[3][0] = -5.0f; + U(pm).m[0][1] = -0.9617381f; + U(pm).m[1][1] = -0.2367795f; + U(pm).m[2][1] = -0.1378230f; + U(pm).m[3][1] = 0.0f; + U(pm).m[0][2] = 0.2660144f; + U(pm).m[1][2] = -0.6866967f; + U(pm).m[2][2] = -0.6765233f; + U(pm).m[3][2] = 10.0f; + U(pm).m[0][3] = 0.0f; + U(pm).m[1][3] = 0.0f; + U(pm).m[2][3] = 0.0f; + U(pm).m[3][3] = 1.0f; + + exp_scale.x = 1.0f; + exp_scale.y = 1.0f; + exp_scale.z = 1.0f; + + exp_rotation.w = -0.195091f; + exp_rotation.x = 0.703358f; + exp_rotation.y = -0.586131f; + exp_rotation.z = 0.351679f; + + exp_translation.x = -5.0f; + exp_translation.y = 0.0f; + exp_translation.z = 10.0f; + + D3DXMatrixDecompose(&got_scale, &got_rotation, &got_translation, &pm); + + compare_scale(exp_scale, got_scale); + compare_rotation(exp_rotation, got_rotation); + compare_translation(exp_translation, got_translation); + +/*_________*/ + + U(pm).m[0][0] = 7.121047f; + U(pm).m[1][0] = -5.883487f; + U(pm).m[2][0] = 11.81843f; + U(pm).m[3][0] = -5.0f; + U(pm).m[0][1] = 5.883487f; + U(pm).m[1][1] = -10.60660f; + U(pm).m[2][1] = -8.825232f; + U(pm).m[3][1] = 0.0f; + U(pm).m[0][2] = 11.81843f; + U(pm).m[1][2] = 8.8252320f; + U(pm).m[2][2] = -2.727645f; + U(pm).m[3][2] = 2.0f; + U(pm).m[0][3] = 0.0f; + U(pm).m[1][3] = 0.0f; + U(pm).m[2][3] = 0.0f; + U(pm).m[3][3] = 1.0f; + + exp_scale.x = 15.0f; + exp_scale.y = 15.0f; + exp_scale.z = 15.0f; + + exp_rotation.w = 0.382684f; + exp_rotation.x = 0.768714f; + exp_rotation.y = 0.0f; + exp_rotation.z = 0.512476f; + + exp_translation.x = -5.0f; + exp_translation.y = 0.0f; + exp_translation.z = 2.0f; + + D3DXMatrixDecompose(&got_scale, &got_rotation, &got_translation, &pm); + + compare_scale(exp_scale, got_scale); + compare_rotation(exp_rotation, got_rotation); + compare_translation(exp_translation, got_translation); + +/*__________*/ + + U(pm).m[0][0] = 0.0f; + U(pm).m[1][0] = 4.0f; + U(pm).m[2][0] = 5.0f; + U(pm).m[3][0] = -5.0f; + U(pm).m[0][1] = 0.0f; + U(pm).m[1][1] = -10.60660f; + U(pm).m[2][1] = -8.825232f; + U(pm).m[3][1] = 6.0f; + U(pm).m[0][2] = 0.0f; + U(pm).m[1][2] = 8.8252320f; + U(pm).m[2][2] = 2.727645; + U(pm).m[3][2] = 3.0f; + U(pm).m[0][3] = 0.0f; + U(pm).m[1][3] = 0.0f; + U(pm).m[2][3] = 0.0f; + U(pm).m[3][3] = 1.0f; + + hr = D3DXMatrixDecompose(&got_scale, &got_rotation, &got_translation, &pm); + ok(hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %x\n", hr); +} + +static void test_Matrix_Transformation2D(void) +{ + D3DXMATRIX exp_mat, got_mat; + D3DXVECTOR2 rot_center, sca, sca_center, trans; + FLOAT rot, sca_rot; + + rot_center.x = 3.0f; + rot_center.y = 4.0f; + + sca.x = 12.0f; + sca.y = -3.0f; + + sca_center.x = 9.0f; + sca_center.y = -5.0f; + + trans.x = -6.0f; + trans.y = 7.0f; + + rot = D3DX_PI/3.0f; + + sca_rot = 5.0f*D3DX_PI/4.0f; + + U(exp_mat).m[0][0] = -4.245192f; + U(exp_mat).m[1][0] = -0.147116f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = 45.265373f; + U(exp_mat).m[0][1] = 7.647113f; + U(exp_mat).m[1][1] = 8.745192f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = -13.401899f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 1.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; + + D3DXMatrixTransformation2D(&got_mat, &sca_center, sca_rot, &sca, &rot_center, rot, &trans); + + expect_mat(&exp_mat, &got_mat); + +/*_________*/ + + sca_center.x = 9.0f; + sca_center.y = -5.0f; + + trans.x = -6.0f; + trans.y = 7.0f; + + rot = D3DX_PI/3.0f; + + sca_rot = 5.0f*D3DX_PI/4.0f; + + U(exp_mat).m[0][0] = 0.50f; + U(exp_mat).m[1][0] = -0.866025f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = -6.0f; + U(exp_mat).m[0][1] = 0.866025f; + U(exp_mat).m[1][1] = 0.50f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = 7.0f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 1.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; + + D3DXMatrixTransformation2D(&got_mat, &sca_center, sca_rot, NULL, NULL, rot, &trans); + + expect_mat(&exp_mat, &got_mat); + +/*_________*/ + + U(exp_mat).m[0][0] = 0.50f; + U(exp_mat).m[1][0] = -0.866025f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = 0.0f; + U(exp_mat).m[0][1] = 0.866025f; + U(exp_mat).m[1][1] = 0.50f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = 0.0f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 1.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; + + D3DXMatrixTransformation2D(&got_mat, NULL, sca_rot, NULL, NULL, rot, NULL); + + expect_mat(&exp_mat, &got_mat); +} + +static void test_D3DXVec_Array(void) +{ + unsigned int i; + D3DVIEWPORT9 viewport; + D3DXMATRIX mat, projection, view, world; + D3DXVECTOR4 inp_vec[ARRAY_SIZE]; + D3DXVECTOR4 out_vec[ARRAY_SIZE + 2]; + D3DXVECTOR4 exp_vec[ARRAY_SIZE + 2]; + D3DXPLANE inp_plane[ARRAY_SIZE]; + D3DXPLANE out_plane[ARRAY_SIZE + 2]; + D3DXPLANE exp_plane[ARRAY_SIZE + 2]; + + viewport.Width = 800; viewport.MinZ = 0.2f; viewport.X = 10; + viewport.Height = 680; viewport.MaxZ = 0.9f; viewport.Y = 5; + + for (i = 0; i < ARRAY_SIZE + 2; ++i) { + out_vec[i].x = out_vec[i].y = out_vec[i].z = out_vec[i].w = 0.0f; + exp_vec[i].x = exp_vec[i].y = exp_vec[i].z = exp_vec[i].w = 0.0f; + out_plane[i].a = out_plane[i].b = out_plane[i].c = out_plane[i].d = 0.0f; + exp_plane[i].a = exp_plane[i].b = exp_plane[i].c = exp_plane[i].d = 0.0f; + } + + for (i = 0; i < ARRAY_SIZE; ++i) { + inp_plane[i].a = inp_plane[i].c = inp_vec[i].x = inp_vec[i].z = i; + inp_plane[i].b = inp_plane[i].d = inp_vec[i].y = inp_vec[i].w = ARRAY_SIZE - i; + } + + U(mat).m[0][0] = 1.0f; U(mat).m[0][1] = 2.0f; U(mat).m[0][2] = 3.0f; U(mat).m[0][3] = 4.0f; + U(mat).m[1][0] = 5.0f; U(mat).m[1][1] = 6.0f; U(mat).m[1][2] = 7.0f; U(mat).m[1][3] = 8.0f; + U(mat).m[2][0] = 9.0f; U(mat).m[2][1] = 10.0f; U(mat).m[2][2] = 11.0f; U(mat).m[2][3] = 12.0f; + U(mat).m[3][0] = 13.0f; U(mat).m[3][1] = 14.0f; U(mat).m[3][2] = 15.0f; U(mat).m[3][3] = 16.0f; + + D3DXMatrixPerspectiveFovLH(&projection,D3DX_PI/4.0f,20.0f/17.0f,1.0f,1000.0f); + + U(view).m[0][1] = 5.0f; U(view).m[0][2] = 7.0f; U(view).m[0][3] = 8.0f; + U(view).m[1][0] = 11.0f; U(view).m[1][2] = 16.0f; U(view).m[1][3] = 33.0f; + U(view).m[2][0] = 19.0f; U(view).m[2][1] = -21.0f; U(view).m[2][3] = 43.0f; + U(view).m[3][0] = 2.0f; U(view).m[3][1] = 3.0f; U(view).m[3][2] = -4.0f; + U(view).m[0][0] = 10.0f; U(view).m[1][1] = 20.0f; U(view).m[2][2] = 30.0f; + U(view).m[3][3] = -40.0f; + + U(world).m[0][0] = 21.0f; U(world).m[0][1] = 2.0f; U(world).m[0][2] = 3.0f; U(world).m[0][3] = 4.0; + U(world).m[1][0] = 5.0f; U(world).m[1][1] = 23.0f; U(world).m[1][2] = 7.0f; U(world).m[1][3] = 8.0f; + U(world).m[2][0] = -8.0f; U(world).m[2][1] = -7.0f; U(world).m[2][2] = 25.0f; U(world).m[2][3] = -5.0f; + U(world).m[3][0] = -4.0f; U(world).m[3][1] = -3.0f; U(world).m[3][2] = -2.0f; U(world).m[3][3] = 27.0f; + + /* D3DXVec2TransformCoordArray */ + exp_vec[1].x = 0.678571f; exp_vec[1].y = 0.785714f; + exp_vec[2].x = 0.653846f; exp_vec[2].y = 0.769231f; + exp_vec[3].x = 0.625f; exp_vec[3].y = 0.75f; + exp_vec[4].x = 0.590909f; exp_vec[4].y = 8.0f/11.0f; + exp_vec[5].x = 0.55f; exp_vec[5].y = 0.7f; + D3DXVec2TransformCoordArray((D3DXVECTOR2*)(out_vec + 1), sizeof(D3DXVECTOR4), (D3DXVECTOR2*)inp_vec, sizeof(D3DXVECTOR4), &mat, ARRAY_SIZE); + compare_vectors(exp_vec, out_vec); + + /* D3DXVec2TransformNormalArray */ + exp_vec[1].x = 25.0f; exp_vec[1].y = 30.0f; + exp_vec[2].x = 21.0f; exp_vec[2].y = 26.0f; + exp_vec[3].x = 17.0f; exp_vec[3].y = 22.0f; + exp_vec[4].x = 13.0f; exp_vec[4].y = 18.0f; + exp_vec[5].x = 9.0f; exp_vec[5].y = 14.0f; + D3DXVec2TransformNormalArray((D3DXVECTOR2*)(out_vec + 1), sizeof(D3DXVECTOR4), (D3DXVECTOR2*)inp_vec, sizeof(D3DXVECTOR4), &mat, ARRAY_SIZE); + compare_vectors(exp_vec, out_vec); + + /* D3DXVec3TransformCoordArray */ + exp_vec[1].x = 0.678571f; exp_vec[1].y = 0.785714f; exp_vec[1].z = 0.892857f; + exp_vec[2].x = 0.671875f; exp_vec[2].y = 0.78125f; exp_vec[2].z = 0.890625f; + exp_vec[3].x = 6.0f/9.0f; exp_vec[3].y = 7.0f/9.0f; exp_vec[3].z = 8.0f/9.0f; + exp_vec[4].x = 0.6625f; exp_vec[4].y = 0.775f; exp_vec[4].z = 0.8875f; + exp_vec[5].x = 0.659091f; exp_vec[5].y = 0.772727f; exp_vec[5].z = 0.886364f; + D3DXVec3TransformCoordArray((D3DXVECTOR3*)(out_vec + 1), sizeof(D3DXVECTOR4), (D3DXVECTOR3*)inp_vec, sizeof(D3DXVECTOR4), &mat, ARRAY_SIZE); + compare_vectors(exp_vec, out_vec); + + /* D3DXVec3TransformNormalArray */ + exp_vec[1].x = 25.0f; exp_vec[1].y = 30.0f; exp_vec[1].z = 35.0f; + exp_vec[2].x = 30.0f; exp_vec[2].y = 36.0f; exp_vec[2].z = 42.0f; + exp_vec[3].x = 35.0f; exp_vec[3].y = 42.0f; exp_vec[3].z = 49.0f; + exp_vec[4].x = 40.0f; exp_vec[4].y = 48.0f; exp_vec[4].z = 56.0f; + exp_vec[5].x = 45.0f; exp_vec[5].y = 54.0f; exp_vec[5].z = 63.0f; + D3DXVec3TransformNormalArray((D3DXVECTOR3*)(out_vec + 1), sizeof(D3DXVECTOR4), (D3DXVECTOR3*)inp_vec, sizeof(D3DXVECTOR4), &mat, ARRAY_SIZE); + compare_vectors(exp_vec, out_vec); + + /* D3DXVec3ProjectArray */ + exp_vec[1].x = 1089.554199f; exp_vec[1].y = -226.590622f; exp_vec[1].z = 0.215273f; + exp_vec[2].x = 1068.903320f; exp_vec[2].y = 103.085129f; exp_vec[2].z = 0.183050f; + exp_vec[3].x = 1051.778931f; exp_vec[3].y = 376.462250f; exp_vec[3].z = 0.156329f; + exp_vec[4].x = 1037.348877f; exp_vec[4].y = 606.827393f; exp_vec[4].z = 0.133813f; + exp_vec[5].x = 1025.023560f; exp_vec[5].y = 803.591248f; exp_vec[5].z = 0.114581f; + D3DXVec3ProjectArray((D3DXVECTOR3*)(out_vec + 1), sizeof(D3DXVECTOR4), (CONST D3DXVECTOR3*)inp_vec, sizeof(D3DXVECTOR4), &viewport, &projection, &view, &world, ARRAY_SIZE); + compare_vectors(exp_vec, out_vec); + + /* D3DXVec3UnprojectArray */ + exp_vec[1].x = -6.124031f; exp_vec[1].y = 3.225360f; exp_vec[1].z = 0.620571f; + exp_vec[2].x = -3.807109f; exp_vec[2].y = 2.046579f; exp_vec[2].z = 0.446894f; + exp_vec[3].x = -2.922839f; exp_vec[3].y = 1.596689f; exp_vec[3].z = 0.380609f; + exp_vec[4].x = -2.456225f; exp_vec[4].y = 1.359290f; exp_vec[4].z = 0.345632f; + exp_vec[5].x = -2.167897f; exp_vec[5].y = 1.212597f; exp_vec[5].z = 0.324019f; + D3DXVec3UnprojectArray((D3DXVECTOR3*)(out_vec + 1), sizeof(D3DXVECTOR4), (CONST D3DXVECTOR3*)inp_vec, sizeof(D3DXVECTOR4), &viewport, &projection, &view, &world, ARRAY_SIZE); + compare_vectors(exp_vec, out_vec); + + /* D3DXVec2TransformArray */ + exp_vec[1].x = 38.0f; exp_vec[1].y = 44.0f; exp_vec[1].z = 50.0f; exp_vec[1].w = 56.0f; + exp_vec[2].x = 34.0f; exp_vec[2].y = 40.0f; exp_vec[2].z = 46.0f; exp_vec[2].w = 52.0f; + exp_vec[3].x = 30.0f; exp_vec[3].y = 36.0f; exp_vec[3].z = 42.0f; exp_vec[3].w = 48.0f; + exp_vec[4].x = 26.0f; exp_vec[4].y = 32.0f; exp_vec[4].z = 38.0f; exp_vec[4].w = 44.0f; + exp_vec[5].x = 22.0f; exp_vec[5].y = 28.0f; exp_vec[5].z = 34.0f; exp_vec[5].w = 40.0f; + D3DXVec2TransformArray(out_vec + 1, sizeof(D3DXVECTOR4), (D3DXVECTOR2*)inp_vec, sizeof(D3DXVECTOR4), &mat, ARRAY_SIZE); + compare_vectors(exp_vec, out_vec); + + /* D3DXVec3TransformArray */ + exp_vec[1].x = 38.0f; exp_vec[1].y = 44.0f; exp_vec[1].z = 50.0f; exp_vec[1].w = 56.0f; + exp_vec[2].x = 43.0f; exp_vec[2].y = 50.0f; exp_vec[2].z = 57.0f; exp_vec[2].w = 64.0f; + exp_vec[3].x = 48.0f; exp_vec[3].y = 56.0f; exp_vec[3].z = 64.0f; exp_vec[3].w = 72.0f; + exp_vec[4].x = 53.0f; exp_vec[4].y = 62.0f; exp_vec[4].z = 71.0f; exp_vec[4].w = 80.0f; + exp_vec[5].x = 58.0f; exp_vec[5].y = 68.0f; exp_vec[5].z = 78.0f; exp_vec[5].w = 88.0f; + D3DXVec3TransformArray(out_vec + 1, sizeof(D3DXVECTOR4), (D3DXVECTOR3*)inp_vec, sizeof(D3DXVECTOR4), &mat, ARRAY_SIZE); + compare_vectors(exp_vec, out_vec); + + /* D3DXVec4TransformArray */ + exp_vec[1].x = 90.0f; exp_vec[1].y = 100.0f; exp_vec[1].z = 110.0f; exp_vec[1].w = 120.0f; + exp_vec[2].x = 82.0f; exp_vec[2].y = 92.0f; exp_vec[2].z = 102.0f; exp_vec[2].w = 112.0f; + exp_vec[3].x = 74.0f; exp_vec[3].y = 84.0f; exp_vec[3].z = 94.0f; exp_vec[3].w = 104.0f; + exp_vec[4].x = 66.0f; exp_vec[4].y = 76.0f; exp_vec[4].z = 86.0f; exp_vec[4].w = 96.0f; + exp_vec[5].x = 58.0f; exp_vec[5].y = 68.0f; exp_vec[5].z = 78.0f; exp_vec[5].w = 88.0f; + D3DXVec4TransformArray(out_vec + 1, sizeof(D3DXVECTOR4), inp_vec, sizeof(D3DXVECTOR4), &mat, ARRAY_SIZE); + compare_vectors(exp_vec, out_vec); + + /* D3DXPlaneTransformArray */ + exp_plane[1].a = 90.0f; exp_plane[1].b = 100.0f; exp_plane[1].c = 110.0f; exp_plane[1].d = 120.0f; + exp_plane[2].a = 82.0f; exp_plane[2].b = 92.0f; exp_plane[2].c = 102.0f; exp_plane[2].d = 112.0f; + exp_plane[3].a = 74.0f; exp_plane[3].b = 84.0f; exp_plane[3].c = 94.0f; exp_plane[3].d = 104.0f; + exp_plane[4].a = 66.0f; exp_plane[4].b = 76.0f; exp_plane[4].c = 86.0f; exp_plane[4].d = 96.0f; + exp_plane[5].a = 58.0f; exp_plane[5].b = 68.0f; exp_plane[5].c = 78.0f; exp_plane[5].d = 88.0f; + D3DXPlaneTransformArray(out_plane + 1, sizeof(D3DXPLANE), inp_plane, sizeof(D3DXPLANE), &mat, ARRAY_SIZE); + compare_planes(exp_plane, out_plane); +} + START_TEST(math) { D3DXColorTest(); D3DXFresnelTest(); D3DXMatrixTest(); D3DXPlaneTest(); - D3X8QuaternionTest(); - D3X8Vector2Test(); - D3X8Vector3Test(); - D3X8Vector4Test(); + D3DXQuaternionTest(); + D3DXVector2Test(); + D3DXVector3Test(); + D3DXVector4Test(); test_matrix_stack(); + test_Matrix_AffineTransformation2D(); + test_Matrix_Decompose(); + test_Matrix_Transformation2D(); + test_D3DXVec_Array(); } diff --git a/dlls/d3dx8/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c similarity index 74% rename from dlls/d3dx8/tests/mesh.c rename to dlls/d3dx9_36/tests/mesh.c index 04e8bf2e325..0f451a2501c 100644 --- a/dlls/d3dx8/tests/mesh.c +++ b/dlls/d3dx9_36/tests/mesh.c @@ -1,6 +1,7 @@ /* * Copyright 2008 David Adam * Copyright 2008 Luis Busquets + * Copyright 2009 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "d3dx8.h" - #include "wine/test.h" +#include "d3dx9.h" #define admitted_error 0.0001f @@ -102,10 +102,6 @@ static void D3DXBoundProbeTest(void) result = D3DXSphereBoundProbe(¢er, radius, &rayposition, &raydirection); ok(result == FALSE, "expected FALSE, received TRUE\n"); - rayposition.x = 5.0f; rayposition.y = 7.0f; rayposition.z = 9.0f; - result = D3DXSphereBoundProbe(¢er, radius, &rayposition, &raydirection); - ok(result == FALSE, "expected FALSE, received TRUE\n"); - rayposition.x = 5.0f; rayposition.y = 11.0f; rayposition.z = 9.0f; result = D3DXSphereBoundProbe(¢er, radius, &rayposition, &raydirection); ok(result == FALSE, "expected FALSE, received TRUE\n"); @@ -123,9 +119,9 @@ static void D3DXComputeBoundingBoxTest(void) vertex[4].x = 9.0f; vertex[4].y = 9.0f; vertex[4].z = 9.0f; exp_min.x = 1.0f; exp_min.y = 1.0f; exp_min.z = 1.0f; - exp_max.x = 1.0f; exp_max.y = 1.0f; exp_max.z = 1.0f; + exp_max.x = 9.0f; exp_max.y = 9.0f; exp_max.z = 9.0f; - hr = D3DXComputeBoundingBox(&vertex[3],2,D3DFVF_XYZ,&got_min,&got_max); + hr = D3DXComputeBoundingBox(&vertex[3],2,D3DXGetFVFVertexSize(D3DFVF_XYZ),&got_min,&got_max); ok( hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); ok( compare_vec3(exp_min,got_min), "Expected min: (%f, %f, %f), got: (%f, %f, %f)\n", exp_min.x,exp_min.y,exp_min.z,got_min.x,got_min.y,got_min.z); @@ -139,10 +135,10 @@ static void D3DXComputeBoundingBoxTest(void) vertex[3].x = -6.92f; vertex[3].y = 6.3f; vertex[3].z = -3.8f; vertex[4].x = 11.4f; vertex[4].y = -8.1f; vertex[4].z = 4.5f; - exp_min.x = -6.92f; exp_min.y = -0.90f; exp_min.z = -3.80f; - exp_max.x = 7.43f; exp_max.y = 7.90f; exp_max.z = 11.9f; + exp_min.x = -6.92f; exp_min.y = -8.1f; exp_min.z = -3.80f; + exp_max.x = 11.4f; exp_max.y = 7.90f; exp_max.z = 11.9f; - hr = D3DXComputeBoundingBox(&vertex[0],5,D3DFVF_XYZ,&got_min,&got_max); + hr = D3DXComputeBoundingBox(&vertex[0],5,D3DXGetFVFVertexSize(D3DFVF_XYZ),&got_min,&got_max); ok( hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); ok( compare_vec3(exp_min,got_min), "Expected min: (%f, %f, %f), got: (%f, %f, %f)\n", exp_min.x,exp_min.y,exp_min.z,got_min.x,got_min.y,got_min.z); @@ -156,25 +152,25 @@ static void D3DXComputeBoundingBoxTest(void) vertex[3].x = -6.92f; vertex[3].y = 6.3f; vertex[3].z = -3.8f; vertex[4].x = 11.4f; vertex[4].y = -8.1f; vertex[4].z = 4.5f; - exp_min.x = -1.87f; exp_min.y = -0.90f; exp_min.z = -1.20f; + exp_min.x = -6.92f; exp_min.y = -0.9f; exp_min.z = -3.8f; exp_max.x = 7.43f; exp_max.y = 7.90f; exp_max.z = 11.9f; - hr = D3DXComputeBoundingBox(&vertex[0],4,D3DFVF_XYZ,&got_min,&got_max); + hr = D3DXComputeBoundingBox(&vertex[0],4,D3DXGetFVFVertexSize(D3DFVF_XYZ),&got_min,&got_max); ok( hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); ok( compare_vec3(exp_min,got_min), "Expected min: (%f, %f, %f), got: (%f, %f, %f)\n", exp_min.x,exp_min.y,exp_min.z,got_min.x,got_min.y,got_min.z); ok( compare_vec3(exp_max,got_max), "Expected max: (%f, %f, %f), got: (%f, %f, %f)\n", exp_max.x,exp_max.y,exp_max.z,got_max.x,got_max.y,got_max.z); /*________________________*/ - hr = D3DXComputeBoundingBox(NULL,5,D3DFVF_XYZ,&got_min,&got_max); + hr = D3DXComputeBoundingBox(NULL,5,D3DXGetFVFVertexSize(D3DFVF_XYZ),&got_min,&got_max); ok( hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %#x\n", hr); /*________________________*/ - hr = D3DXComputeBoundingBox(&vertex[3],5,D3DFVF_XYZ,NULL,&got_max); + hr = D3DXComputeBoundingBox(&vertex[3],5,D3DXGetFVFVertexSize(D3DFVF_XYZ),NULL,&got_max); ok( hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %#x\n", hr); /*________________________*/ - hr = D3DXComputeBoundingBox(&vertex[3],5,D3DFVF_XYZ,&got_min,NULL); + hr = D3DXComputeBoundingBox(&vertex[3],5,D3DXGetFVFVertexSize(D3DFVF_XYZ),&got_min,NULL); ok( hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %#x\n", hr); } @@ -193,7 +189,7 @@ static void D3DXComputeBoundingSphereTest(void) exp_rad = 6.928203f; exp_cen.x = 5.0; exp_cen.y = 5.0; exp_cen.z = 5.0; - hr = D3DXComputeBoundingSphere(&vertex[3],2,D3DFVF_XYZ,&got_cen,&got_rad); + hr = D3DXComputeBoundingSphere(&vertex[3],2,D3DXGetFVFVertexSize(D3DFVF_XYZ),&got_cen,&got_rad); ok( hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); ok( compare(exp_rad, got_rad), "Expected radius: %f, got radius: %f\n", exp_rad, got_rad); @@ -210,22 +206,22 @@ static void D3DXComputeBoundingSphereTest(void) exp_rad = 13.707883f; exp_cen.x = 2.408f; exp_cen.y = 2.22f; exp_cen.z = 3.76f; - hr = D3DXComputeBoundingSphere(&vertex[0],5,D3DFVF_XYZ,&got_cen,&got_rad); + hr = D3DXComputeBoundingSphere(&vertex[0],5,D3DXGetFVFVertexSize(D3DFVF_XYZ),&got_cen,&got_rad); ok( hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); ok( compare(exp_rad, got_rad), "Expected radius: %f, got radius: %f\n", exp_rad, got_rad); ok( compare_vec3(exp_cen,got_cen), "Expected center: (%f, %f, %f), got center: (%f, %f, %f)\n", exp_cen.x,exp_cen.y,exp_cen.z,got_cen.x,got_cen.y,got_cen.z); /*________________________*/ - hr = D3DXComputeBoundingSphere(NULL,5,D3DFVF_XYZ,&got_cen,&got_rad); + hr = D3DXComputeBoundingSphere(NULL,5,D3DXGetFVFVertexSize(D3DFVF_XYZ),&got_cen,&got_rad); ok( hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %#x\n", hr); /*________________________*/ - hr = D3DXComputeBoundingSphere(&vertex[3],5,D3DFVF_XYZ,NULL,&got_rad); + hr = D3DXComputeBoundingSphere(&vertex[3],5,D3DXGetFVFVertexSize(D3DFVF_XYZ),NULL,&got_rad); ok( hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %#x\n", hr); /*________________________*/ - hr = D3DXComputeBoundingSphere(&vertex[3],5,D3DFVF_XYZ,&got_cen,NULL); + hr = D3DXComputeBoundingSphere(&vertex[3],5,D3DXGetFVFVertexSize(D3DFVF_XYZ),&got_cen,NULL); ok( hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %#x\n", hr); } @@ -386,6 +382,78 @@ static void D3DXIntersectTriTest(void) ok( got_res == exp_res, "Expected result = %d, got %d\n",exp_res,got_res); } +static void test_get_decl_vertex_size(void) +{ + static const D3DVERTEXELEMENT9 declaration1[] = + { + {0, 0, D3DDECLTYPE_FLOAT1, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {1, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {2, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {3, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {4, 0, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {5, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {6, 0, D3DDECLTYPE_SHORT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {7, 0, D3DDECLTYPE_SHORT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {8, 0, D3DDECLTYPE_UBYTE4N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {9, 0, D3DDECLTYPE_SHORT2N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {10, 0, D3DDECLTYPE_SHORT4N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {11, 0, D3DDECLTYPE_UDEC3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {12, 0, D3DDECLTYPE_DEC3N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {13, 0, D3DDECLTYPE_FLOAT16_2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {14, 0, D3DDECLTYPE_FLOAT16_4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + D3DDECL_END(), + }; + static const D3DVERTEXELEMENT9 declaration2[] = + { + {0, 8, D3DDECLTYPE_FLOAT1, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {1, 8, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {2, 8, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {3, 8, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {4, 8, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {5, 8, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {6, 8, D3DDECLTYPE_SHORT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {7, 8, D3DDECLTYPE_SHORT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {0, 8, D3DDECLTYPE_UBYTE4N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {1, 8, D3DDECLTYPE_SHORT2N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {2, 8, D3DDECLTYPE_SHORT4N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {3, 8, D3DDECLTYPE_UDEC3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {4, 8, D3DDECLTYPE_DEC3N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {5, 8, D3DDECLTYPE_FLOAT16_2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {6, 8, D3DDECLTYPE_FLOAT16_4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {7, 8, D3DDECLTYPE_FLOAT1, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + D3DDECL_END(), + }; + static const UINT sizes1[] = + { + 4, 8, 12, 16, + 4, 4, 4, 8, + 4, 4, 8, 4, + 4, 4, 8, 0, + }; + static const UINT sizes2[] = + { + 12, 16, 20, 24, + 12, 12, 16, 16, + }; + unsigned int i; + UINT size; + + size = D3DXGetDeclVertexSize(NULL, 0); + ok(size == 0, "Got size %#x, expected 0.\n", size); + + for (i = 0; i < 16; ++i) + { + size = D3DXGetDeclVertexSize(declaration1, i); + ok(size == sizes1[i], "Got size %u for stream %u, expected %u.\n", size, i, sizes1[i]); + } + + for (i = 0; i < 8; ++i) + { + size = D3DXGetDeclVertexSize(declaration2, i); + ok(size == sizes2[i], "Got size %u for stream %u, expected %u.\n", size, i, sizes2[i]); + } +} + START_TEST(mesh) { D3DXBoundProbeTest(); @@ -393,4 +461,5 @@ START_TEST(mesh) D3DXComputeBoundingSphereTest(); D3DXGetFVFVertexSizeTest(); D3DXIntersectTriTest(); + test_get_decl_vertex_size(); } diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 0ddcb93779d..0a014095b84 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -559,7 +559,7 @@ extern struct symt_function* unsigned long addr, unsigned long size, struct symt* type); extern BOOL symt_normalize_function(struct module* module, - struct symt_function* func); + const struct symt_function* func); extern void symt_add_func_line(struct module* module, struct symt_function* func, unsigned source_idx, int line_num, @@ -577,7 +577,7 @@ extern struct symt_block* unsigned pc, unsigned len); extern struct symt_block* symt_close_func_block(struct module* module, - struct symt_function* func, + const struct symt_function* func, struct symt_block* block, unsigned pc); extern struct symt_hierarchy_point* symt_add_function_point(struct module* module, diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 12754dd3bde..6c79c8b690a 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -237,7 +237,7 @@ static void elf_end_find(struct elf_file_map* fmap) * * Get the size of an ELF section */ -static inline unsigned elf_get_map_size(struct elf_section_map* esm) +static inline unsigned elf_get_map_size(const struct elf_section_map* esm) { if (esm->sidx < 0 || esm->sidx >= esm->fmap->elfhdr.e_shnum) return 0; @@ -473,7 +473,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, */ static const Elf32_Sym* elf_lookup_symtab(const struct module* module, const struct hash_table* ht_symtab, - const char* name, struct symt* compiland) + const char* name, const struct symt* compiland) { struct symtab_elt* weak_result = NULL; /* without compiland name */ struct symtab_elt* result = NULL; @@ -490,7 +490,7 @@ static const Elf32_Sym* elf_lookup_symtab(const struct module* module, if (compiland) { compiland_name = source_get(module, - ((struct symt_compiland*)compiland)->source); + ((const struct symt_compiland*)compiland)->source); compiland_basename = strrchr(compiland_name, '/'); if (!compiland_basename++) compiland_basename = compiland_name; } @@ -542,7 +542,7 @@ static const Elf32_Sym* elf_lookup_symtab(const struct module* module, * - get any relevant information (address & size) from the bits we got from the * stabs debugging information */ -static void elf_finish_stabs_info(struct module* module, struct hash_table* symtab) +static void elf_finish_stabs_info(struct module* module, const struct hash_table* symtab) { struct hash_table_iter hti; void* ptr; @@ -623,7 +623,7 @@ static void elf_finish_stabs_info(struct module* module, struct hash_table* symt * * creating the thunk objects for a wine native DLL */ -static int elf_new_wine_thunks(struct module* module, struct hash_table* ht_symtab, +static int elf_new_wine_thunks(struct module* module, const struct hash_table* ht_symtab, const struct elf_thunk_area* thunks) { int j; @@ -716,7 +716,7 @@ static int elf_new_wine_thunks(struct module* module, struct hash_table* ht_symt * * Creates a set of public symbols from an ELF symtab */ -static int elf_new_public_symbols(struct module* module, struct hash_table* symtab) +static int elf_new_public_symbols(struct module* module, const struct hash_table* symtab) { struct hash_table_iter hti; struct symtab_elt* ste; @@ -830,7 +830,7 @@ found: * Parses a .gnu_debuglink section and loads the debug info from * the external file specified there. */ -static BOOL elf_debuglink_parse(struct elf_file_map* fmap, struct module* module, +static BOOL elf_debuglink_parse(struct elf_file_map* fmap, const struct module* module, const BYTE* debuglink) { /* The content of a debug link section is: diff --git a/dlls/dbghelp/minidump.c b/dlls/dbghelp/minidump.c index 7c624c99773..4108ef43784 100644 --- a/dlls/dbghelp/minidump.c +++ b/dlls/dbghelp/minidump.c @@ -266,18 +266,23 @@ static BOOL add_module(struct dump_context* dc, const WCHAR* name, dc->modules = HeapReAlloc(GetProcessHeap(), 0, dc->modules, dc->alloc_modules * sizeof(*dc->modules)); } - if (!dc->modules) return FALSE; + if (!dc->modules) + { + dc->alloc_modules = dc->num_modules = 0; + return FALSE; + } if (is_elf || !GetModuleFileNameExW(dc->hProcess, (HMODULE)base, - dc->modules[dc->num_modules - 1].name, - sizeof(dc->modules[dc->num_modules - 1].name) / sizeof(WCHAR))) - lstrcpynW(dc->modules[dc->num_modules - 1].name, name, - sizeof(dc->modules[dc->num_modules - 1].name) / sizeof(WCHAR)); - dc->modules[dc->num_modules - 1].base = base; - dc->modules[dc->num_modules - 1].size = size; - dc->modules[dc->num_modules - 1].timestamp = timestamp; - dc->modules[dc->num_modules - 1].checksum = checksum; - dc->modules[dc->num_modules - 1].is_elf = is_elf; + dc->modules[dc->num_modules].name, + sizeof(dc->modules[dc->num_modules].name) / sizeof(WCHAR))) + lstrcpynW(dc->modules[dc->num_modules].name, name, + sizeof(dc->modules[dc->num_modules].name) / sizeof(WCHAR)); + dc->modules[dc->num_modules].base = base; + dc->modules[dc->num_modules].size = size; + dc->modules[dc->num_modules].timestamp = timestamp; + dc->modules[dc->num_modules].checksum = checksum; + dc->modules[dc->num_modules].is_elf = is_elf; + dc->num_modules++; return TRUE; } @@ -402,9 +407,10 @@ static void add_memory_block(struct dump_context* dc, ULONG64 base, ULONG size, } if (dc->mem) { - dc->mem[dc->num_mem - 1].base = base; - dc->mem[dc->num_mem - 1].size = size; - dc->mem[dc->num_mem - 1].rva = rva; + dc->mem[dc->num_mem].base = base; + dc->mem[dc->num_mem].size = size; + dc->mem[dc->num_mem].rva = rva; + dc->num_mem++; } else dc->num_mem = dc->alloc_mem = 0; } @@ -428,7 +434,7 @@ static void writeat(struct dump_context* dc, RVA rva, const void* data, unsigned * writes a new chunk of data to the minidump, increasing the current * rva in dc */ -static void append(struct dump_context* dc, void* data, unsigned size) +static void append(struct dump_context* dc, const void* data, unsigned size) { writeat(dc, dc->rva, data, size); dc->rva += size; diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 91c7d801e1a..44a4d6a14b2 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -134,7 +134,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module, */ static BOOL pe_load_msc_debug_info(const struct process* pcs, struct module* module, - void* mapping, IMAGE_NT_HEADERS* nth) + void* mapping, const IMAGE_NT_HEADERS* nth) { BOOL ret = FALSE; const IMAGE_DATA_DIRECTORY* dir; @@ -182,7 +182,7 @@ static BOOL pe_load_msc_debug_info(const struct process* pcs, */ static BOOL pe_load_export_debug_info(const struct process* pcs, struct module* module, - void* mapping, IMAGE_NT_HEADERS* nth) + void* mapping, const IMAGE_NT_HEADERS* nth) { unsigned int i; const IMAGE_EXPORT_DIRECTORY* exports; diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 366cadecf3c..34d00b2a021 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -486,7 +486,7 @@ struct symt_block* symt_open_func_block(struct module* module, } struct symt_block* symt_close_func_block(struct module* module, - struct symt_function* func, + const struct symt_function* func, struct symt_block* block, unsigned pc) { assert(func); @@ -518,7 +518,7 @@ struct symt_hierarchy_point* symt_add_function_point(struct module* module, return sym; } -BOOL symt_normalize_function(struct module* module, struct symt_function* func) +BOOL symt_normalize_function(struct module* module, const struct symt_function* func) { unsigned len; struct line_info* dli; @@ -771,7 +771,7 @@ static BOOL send_symbol(const struct sym_enum* se, const struct module_pair* pai return !se->cb(se->sym_info, se->sym_info->Size, se->user); } -static BOOL symt_enum_module(struct module_pair* pair, const regex_t* regex, +static BOOL symt_enum_module(const struct module_pair* pair, const regex_t* regex, const struct sym_enum* se) { void* ptr; @@ -792,7 +792,7 @@ static BOOL symt_enum_module(struct module_pair* pair, const regex_t* regex, return FALSE; } -static inline unsigned where_to_insert(const struct module* module, unsigned high, struct symt_ht* elt) +static inline unsigned where_to_insert(const struct module* module, unsigned high, const struct symt_ht* elt) { unsigned low = 0, mid = high / 2; ULONG64 addr; @@ -848,7 +848,7 @@ static BOOL resort_symbols(struct module* module) return module->sortlist_valid = TRUE; } -static void symt_get_length(struct symt* symt, ULONG64* size) +static void symt_get_length(const struct symt* symt, ULONG64* size) { DWORD type_index; diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 57e1da002d6..f4cd07b3fa0 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -951,6 +951,7 @@ static BOOL D3D1_createObjects(void) ok(hr==DD_OK, "SetCooperativeLevel returned: %x\n", hr); hr = IDirectDraw_QueryInterface(DirectDraw1, &IID_IDirect3D, (void**) &Direct3D1); + if (hr == E_NOINTERFACE) return FALSE; ok(hr==DD_OK, "QueryInterface returned: %x\n", hr); if (!Direct3D1) { return FALSE; diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c index c3280fb5880..28fc0f55937 100644 --- a/dlls/ddraw/tests/dsurface.c +++ b/dlls/ddraw/tests/dsurface.c @@ -1029,36 +1029,39 @@ static void IFaceRefCount(void) todo_wine ok(ref == 2, "Refcount is %u, expected 2\n", ref); /* IDirect3DTexture interface (unlike the others) alters the original IDirectDrawSurface ref count */ - IDirectDrawSurface_QueryInterface(surf, &IID_IDirect3DTexture, (void **) &tex); - ref = getRefcount((IUnknown *) tex); - todo_wine ok(ref == 2, "Refcount is %u, expected 2\n", ref); - ref = getRefcount((IUnknown *) surf); - todo_wine ok(ref == 2, "Refcount is %u, expected 2\n", ref); - - IDirectDrawSurface_QueryInterface(surf, &IID_IDirect3DTexture2, (void **) &tex2); - ref = getRefcount((IUnknown *) tex); - todo_wine ok(ref == 3, "Refcount is %u, expected 3\n", ref); - ref = getRefcount((IUnknown *) tex2); - todo_wine ok(ref == 3, "Refcount is %u, expected 3\n", ref); - ref = getRefcount((IUnknown *) surf); - todo_wine ok(ref == 3, "Refcount is %u, expected 3\n", ref); - - IDirectDrawSurface_QueryInterface(surf, &IID_IDirectDrawGammaControl, (void **) &gamma); - ref = getRefcount((IUnknown *) gamma); - todo_wine ok(ref == 1, "Refcount is %u, expected 1\n", ref); - - ref = IDirect3DTexture2_Release(tex2); /* Release the texture */ - todo_wine ok(ref == 2, "Refcount is %u, expected 2\n", ref); - ref = getRefcount((IUnknown *) surf); - todo_wine ok(ref == 2, "Refcount is %u, expected 2\n", ref); - - ref = IDirect3DTexture_Release(tex); /* Release the texture */ - todo_wine ok(ref == 1, "Refcount is %u, expected 1\n", ref); - ref = getRefcount((IUnknown *) surf); - todo_wine ok(ref == 1, "Refcount is %u, expected 1\n", ref); - - ref = IDirectDrawGammaControl_Release(gamma); /* Release the gamma control */ - todo_wine ok(ref == 0, "Refcount is %u, expected 0\n", ref); + ret = IDirectDrawSurface_QueryInterface(surf, &IID_IDirect3DTexture, (void **) &tex); + if (SUCCEEDED(ret)) + { + ref = getRefcount((IUnknown *) tex); + todo_wine ok(ref == 2, "Refcount is %u, expected 2\n", ref); + ref = getRefcount((IUnknown *) surf); + todo_wine ok(ref == 2, "Refcount is %u, expected 2\n", ref); + + IDirectDrawSurface_QueryInterface(surf, &IID_IDirect3DTexture2, (void **) &tex2); + ref = getRefcount((IUnknown *) tex); + todo_wine ok(ref == 3, "Refcount is %u, expected 3\n", ref); + ref = getRefcount((IUnknown *) tex2); + todo_wine ok(ref == 3, "Refcount is %u, expected 3\n", ref); + ref = getRefcount((IUnknown *) surf); + todo_wine ok(ref == 3, "Refcount is %u, expected 3\n", ref); + + IDirectDrawSurface_QueryInterface(surf, &IID_IDirectDrawGammaControl, (void **) &gamma); + ref = getRefcount((IUnknown *) gamma); + todo_wine ok(ref == 1, "Refcount is %u, expected 1\n", ref); + + ref = IDirect3DTexture2_Release(tex2); /* Release the texture */ + todo_wine ok(ref == 2, "Refcount is %u, expected 2\n", ref); + ref = getRefcount((IUnknown *) surf); + todo_wine ok(ref == 2, "Refcount is %u, expected 2\n", ref); + + ref = IDirect3DTexture_Release(tex); /* Release the texture */ + todo_wine ok(ref == 1, "Refcount is %u, expected 1\n", ref); + ref = getRefcount((IUnknown *) surf); + todo_wine ok(ref == 1, "Refcount is %u, expected 1\n", ref); + + ref = IDirectDrawGammaControl_Release(gamma); /* Release the gamma control */ + todo_wine ok(ref == 0, "Refcount is %u, expected 0\n", ref); + } ref = IDirectDrawSurface2_Release(surf2); /* Release one of the 2 surf2 interfaces */ todo_wine ok(ref == 1, "Refcount is %u, expected 1\n", ref); diff --git a/dlls/ddraw/tests/overlay.c b/dlls/ddraw/tests/overlay.c index d1edc1d8d29..55c4989b9ba 100644 --- a/dlls/ddraw/tests/overlay.c +++ b/dlls/ddraw/tests/overlay.c @@ -200,7 +200,8 @@ static void yv12_test(void) ok(desc.dwFlags == (DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS | DDSD_PITCH), "Unexpected desc.dwFlags 0x%08x\n", desc.dwFlags); - ok(desc.ddsCaps.dwCaps == (DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM), + ok(desc.ddsCaps.dwCaps == (DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM) || + desc.ddsCaps.dwCaps == (DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_HWCODEC), "Unexpected desc.ddsCaps.dwCaps 0x%08x\n", desc.ddsCaps.dwCaps); ok(desc.dwWidth == 256 && desc.dwHeight == 256, "Expected size 64x64, got %ux%u\n", desc.dwWidth, desc.dwHeight); diff --git a/dlls/ddraw/tests/refcount.c b/dlls/ddraw/tests/refcount.c index bfff64afbd3..9ad560bf50e 100644 --- a/dlls/ddraw/tests/refcount.c +++ b/dlls/ddraw/tests/refcount.c @@ -237,7 +237,17 @@ static void test_iface_refcnt(void) ok(ref == 1, "IDirectDraw reference count is %ld\n", ref); hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirect3D7, (void **) &D3D7); - ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK || hr == E_NOINTERFACE, /* win64 */ + "IDirectDraw7_QueryInterface returned %08x\n", hr); + if (FAILED(hr)) + { + IDirectDraw7_Release(DDraw7); + IDirectDraw4_Release(DDraw4); + IDirectDraw2_Release(DDraw2); + IDirectDraw_Release(DDraw1); + skip( "no IDirect3D7 support\n" ); + return; + } /* Apparently IDirectDrawX and IDirect3DX are linked together */ ref = getRefcount( (IUnknown *) D3D7); @@ -348,6 +358,14 @@ static void test_d3d_ifaces(void) ok(ref == 1, "IDirectDraw reference count is %ld\n", ref); hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirect3D, (void **) &D3D1); + if (hr == E_NOINTERFACE) /* win64 */ + { + IDirectDraw4_Release(DDraw4); + IDirectDraw2_Release(DDraw2); + IDirectDraw_Release(DDraw1); + skip( "no IDirect3D support\n" ); + return; + } ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr); ref = getRefcount( (IUnknown *) DDraw4); ok(ref == 1, "IDirectDraw4 reference count is %ld\n", ref); diff --git a/dlls/devenum/devenum.rc b/dlls/devenum/devenum.rc index b9ff4a5d292..01f76b4c603 100644 --- a/dlls/devenum/devenum.rc +++ b/dlls/devenum/devenum.rc @@ -72,7 +72,7 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL } STRINGTABLE DISCARDABLE -LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL { 7 "DirectSound padrão" 8 "DirectSound: %s" @@ -170,3 +170,12 @@ LANGUAGE LANG_LITHUANIAN, SUBLANG_NEUTRAL 9 "Numatytasis WaveOut įrenginys" 10 "Numatytasis MidiOut įrenginys" } + +STRINGTABLE DISCARDABLE +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT +{ + 7 "デフォルト DirectSound" + 8 "DirectSound: %s" + 9 "デフォルト WaveOut デバイス" + 10 "デフォルト MidiOut デバイス" +} diff --git a/dlls/dxguid/dx8guid.c b/dlls/dxguid/dx8guid.c index 6b51c9e6749..76d8cd1fe0f 100644 --- a/dlls/dxguid/dx8guid.c +++ b/dlls/dxguid/dx8guid.c @@ -31,4 +31,3 @@ #include "initguid.h" #include "d3d8.h" -#include "d3dx8.h" diff --git a/dlls/dxguid/dx9guid.c b/dlls/dxguid/dx9guid.c index 2ab60ad8e69..d64e6906cfc 100644 --- a/dlls/dxguid/dx9guid.c +++ b/dlls/dxguid/dx9guid.c @@ -31,4 +31,4 @@ #include "olectl.h" #include "initguid.h" -#include "d3d9.h" +#include "d3dx9.h" diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 65006010027..96b197aeab6 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -1663,7 +1663,7 @@ static BOOL init_system_links(void) if(psub) { TRACE("%s: SystemLink entry for substituted font, ignoring\n", debugstr_w(value)); - continue; + goto next; } font_link = HeapAlloc(GetProcessHeap(), 0, sizeof(*font_link)); font_link->font_name = strdupW(value); @@ -1712,6 +1712,7 @@ static BOOL init_system_links(void) } } list_add_tail(&system_links, &font_link->entry); + next: val_len = max_val + 1; data_len = max_data; } diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 660a1451e01..8666da229b0 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -2252,6 +2252,84 @@ static void test_get16dibits(void) ReleaseDC(NULL, screen_dc); } +static void check_BitBlt_pixel(HDC hdcDst, HDC hdcSrc, UINT32 *dstBuffer, UINT32 *srcBuffer, + DWORD dwRop, UINT32 expected, int line) +{ + *srcBuffer = 0xFEDCBA98; + *dstBuffer = 0x89ABCDEF; + Rectangle(hdcSrc, 0, 0, 1, 1); /* A null operation to ensure dibs are coerced to X11 */ + BitBlt(hdcDst, 0, 0, 1, 1, hdcSrc, 0, 0, dwRop); + ok(expected == *dstBuffer, + "BitBlt with dwRop %06X. Expected 0x%08X, got 0x%08X from line %d\n", + dwRop, expected, *dstBuffer, line); +} + +static void test_BitBlt(void) +{ + HBITMAP bmpDst, bmpSrc; + HBITMAP oldDst, oldSrc; + HDC hdcScreen, hdcDst, hdcSrc; + UINT32 *dstBuffer, *srcBuffer; + HBRUSH hBrush, hOldBrush; + BITMAPINFO bitmapInfo; + + memset(&bitmapInfo, 0, sizeof(BITMAPINFO)); + bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bitmapInfo.bmiHeader.biWidth = 1; + bitmapInfo.bmiHeader.biHeight = 1; + bitmapInfo.bmiHeader.biPlanes = 1; + bitmapInfo.bmiHeader.biBitCount = 32; + bitmapInfo.bmiHeader.biCompression = BI_RGB; + bitmapInfo.bmiHeader.biSizeImage = sizeof(UINT32); + + hdcScreen = CreateCompatibleDC(0); + hdcDst = CreateCompatibleDC(hdcScreen); + hdcSrc = CreateCompatibleDC(hdcDst); + + /* Setup the destination dib section */ + bmpDst = CreateDIBSection(hdcScreen, &bitmapInfo, DIB_RGB_COLORS, (void**)&dstBuffer, + NULL, 0); + oldDst = SelectObject(hdcDst, bmpDst); + + hBrush = CreateSolidBrush(0x012345678); + hOldBrush = SelectObject(hdcDst, hBrush); + + /* Setup the source dib section */ + bmpSrc = CreateDIBSection(hdcScreen, &bitmapInfo, DIB_RGB_COLORS, (void**)&srcBuffer, + NULL, 0); + oldSrc = SelectObject(hdcSrc, bmpSrc); + + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, SRCCOPY, 0xFEDCBA98, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, SRCPAINT, 0xFFFFFFFF, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, SRCAND, 0x88888888, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, SRCINVERT, 0x77777777, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, SRCERASE, 0x76543210, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, NOTSRCCOPY, 0x01234567, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, NOTSRCERASE, 0x00000000, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, MERGECOPY, 0x00581210, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, MERGEPAINT, 0x89ABCDEF, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, PATCOPY, 0x00785634, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, PATPAINT, 0x89FBDFFF, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, PATINVERT, 0x89D39BDB, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, DSTINVERT, 0x76543210, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, BLACKNESS, 0x00000000, __LINE__); + check_BitBlt_pixel(hdcDst, hdcSrc, dstBuffer, srcBuffer, WHITENESS, 0xFFFFFFFF, __LINE__); + + /* Tidy up */ + SelectObject(hdcSrc, oldSrc); + DeleteObject(bmpSrc); + DeleteDC(hdcSrc); + + SelectObject(hdcDst, hOldBrush); + DeleteObject(hBrush); + SelectObject(hdcDst, oldDst); + DeleteObject(bmpDst); + DeleteDC(hdcDst); + + + DeleteDC(hdcScreen); +} + static void test_GdiAlphaBlend(void) { /* test out-of-bound parameters for GdiAlphaBlend */ @@ -2393,6 +2471,7 @@ START_TEST(bitmap) test_GetDIBits_BI_BITFIELDS(); test_select_object(); test_CreateBitmap(); + test_BitBlt(); test_GdiAlphaBlend(); test_bitmapinfoheadersize(); test_get16dibits(); diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 2eacd37d3b4..15a2c631e6b 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -2308,19 +2308,14 @@ static void test_SetWinMetaFileBits(void) HeapFree(GetProcessHeap(), 0, buffer); } -/* This is somewhat different to MulDiv, but appears to be how native behaves */ -static INT muldiv(INT m1, INT m2, INT d) +static BOOL near_match(int x, int y) { - LONGLONG ret; + int epsilon = min(abs(x), abs(y)); - ret = ((LONGLONG)m1 * m2 + d/2) / d; /* Always add d/2 even if ret will be -ve */ + epsilon = max(epsilon/100, 2); - if((LONGLONG)m1 * m2 * 2 == (2 * ret - 1) * d) /* If the answer is exactly n.5 round towards zero */ - { - if(ret > 0) ret--; - else ret++; - } - return ret; + if(x < y - epsilon || x > y + epsilon) return FALSE; + return TRUE; } static void getwinmetafilebits(UINT mode, int scale, RECT *rc) @@ -2362,7 +2357,9 @@ static void getwinmetafilebits(UINT mode, int scale, RECT *rc) ok(EqualRect((RECT*)&enh_header->rclFrame, rc), "Frame rectangles differ\n"); size = GetWinMetaFileBits(emf, 0, NULL, mode, display_dc); - ok(size, "GetWinMetaFileBits returns 0\n"); + ok(size || + broken(size == 0), /* some versions of winxp fail for some reason */ + "GetWinMetaFileBits returns 0\n"); if(!size) goto end; mh = HeapAlloc(GetProcessHeap(), 0, size); GetWinMetaFileBits(emf, size, (BYTE*)mh, mode, display_dc); @@ -2422,43 +2419,42 @@ static void getwinmetafilebits(UINT mode, int scale, RECT *rc) case MM_TEXT: case MM_ISOTROPIC: case MM_ANISOTROPIC: - pt.y = muldiv(rc->top, vert_res, vert_size * 100); - pt.x = muldiv(rc->left, horz_res, horz_size * 100); + pt.y = MulDiv(rc->top, vert_res, vert_size * 100) + 1; + pt.x = MulDiv(rc->left, horz_res, horz_size * 100); break; case MM_LOMETRIC: - pt.y = muldiv(-rc->top, 1, 10) + 1; - pt.x = muldiv( rc->left, 1, 10); + pt.y = MulDiv(-rc->top, 1, 10) + 1; + pt.x = MulDiv( rc->left, 1, 10); break; case MM_HIMETRIC: pt.y = -rc->top + 1; pt.x = (rc->left >= 0) ? rc->left : rc->left + 1; /* strange but true */ break; case MM_LOENGLISH: - pt.y = muldiv(-rc->top, 10, 254) + 1; - pt.x = muldiv( rc->left, 10, 254); + pt.y = MulDiv(-rc->top, 10, 254) + 1; + pt.x = MulDiv( rc->left, 10, 254); break; case MM_HIENGLISH: - pt.y = muldiv(-rc->top, 100, 254) + 1; - pt.x = muldiv( rc->left, 100, 254); + pt.y = MulDiv(-rc->top, 100, 254) + 1; + pt.x = MulDiv( rc->left, 100, 254); break; case MM_TWIPS: - pt.y = muldiv(-rc->top, 72 * 20, 2540) + 1; - pt.x = muldiv( rc->left, 72 * 20, 2540); + pt.y = MulDiv(-rc->top, 72 * 20, 2540) + 1; + pt.x = MulDiv( rc->left, 72 * 20, 2540); break; default: pt.x = pt.y = 0; } - ok((short)rec->rdParm[0] == pt.y || - broken(mode >= MM_LOMETRIC && mode <= MM_TWIPS && (short)rec->rdParm[0] == pt.y - 1), /* win9x, winme */ - "got %d expect %d\n", (short)rec->rdParm[0], pt.y); - ok((short)rec->rdParm[1] == pt.x, "got %d expect %d\n", (short)rec->rdParm[1], pt.x); + ok(near_match((short)rec->rdParm[0], pt.y), "got %d expect %d\n", (short)rec->rdParm[0], pt.y); + ok(near_match((short)rec->rdParm[1], pt.x), "got %d expect %d\n", (short)rec->rdParm[1], pt.x); } if(rec_num == mfcomment_chunks + 2) { ok(rec->rdFunction == META_SETWINDOWEXT, "got %04x\n", rec->rdFunction); - ok((short)rec->rdParm[0] == muldiv(rc->bottom - rc->top, vert_res, vert_size * 100), "got %d\n", (short)rec->rdParm[0]); - ok((short)rec->rdParm[1] == muldiv(rc->right - rc->left, horz_res, horz_size * 100), "got %d\n", (short)rec->rdParm[1]); - + ok(near_match((short)rec->rdParm[0], MulDiv(rc->bottom - rc->top, vert_res, vert_size * 100)), + "got %d\n", (short)rec->rdParm[0]); + ok(near_match((short)rec->rdParm[1], MulDiv(rc->right - rc->left, horz_res, horz_size * 100)), + "got %d\n", (short)rec->rdParm[1]); } rec_num++; diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 824ece0fc85..bb19e4399c2 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -1531,12 +1531,33 @@ GpStatus WINGDIPAPI GdipRotateTextureTransform(GpTexture* brush, REAL angle, GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus, REAL scale) { - static int calls; + REAL factors[3]; + REAL positions[3]; + int num_points = 0; - if(!(calls++)) - FIXME("not implemented\n"); + TRACE("(%p,%.2f,%.2f)\n", brush, focus, scale); - return NotImplemented; + if (!brush) return InvalidParameter; + + if (focus != 0.0) + { + factors[num_points] = 0.0; + positions[num_points] = 0.0; + num_points++; + } + + factors[num_points] = scale; + positions[num_points] = focus; + num_points++; + + if (focus != 1.0) + { + factors[num_points] = 0.0; + positions[num_points] = 1.0; + num_points++; + } + + return GdipSetLineBlend(brush, factors, positions, num_points); } GpStatus WINGDIPAPI GdipSetLinePresetBlend(GpLineGradient *brush, diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index b59814e22b5..58ca2e6eeb2 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2512,12 +2512,14 @@ GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x save_state = SaveDC(graphics->hdc); EndPath(graphics->hdc); - SelectObject(graphics->hdc, brush->gdibrush); - SelectObject(graphics->hdc, GetStockObject(NULL_PEN)); transform_and_round_points(graphics, pti, ptf, 2); + BeginPath(graphics->hdc); Ellipse(graphics->hdc, pti[0].x, pti[0].y, pti[1].x, pti[1].y); + EndPath(graphics->hdc); + + brush_fill_path(graphics, brush); RestoreDC(graphics->hdc, save_state); @@ -2584,10 +2586,12 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, save_state = SaveDC(graphics->hdc); EndPath(graphics->hdc); - SelectObject(graphics->hdc, brush->gdibrush); - SelectObject(graphics->hdc, GetStockObject(NULL_PEN)); + BeginPath(graphics->hdc); draw_pie(graphics, x, y, width, height, startAngle, sweepAngle); + EndPath(graphics->hdc); + + brush_fill_path(graphics, brush); RestoreDC(graphics->hdc, save_state); @@ -2630,13 +2634,16 @@ GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics *graphics, GpBrush *brush, save_state = SaveDC(graphics->hdc); EndPath(graphics->hdc); - SelectObject(graphics->hdc, brush->gdibrush); - SelectObject(graphics->hdc, GetStockObject(NULL_PEN)); SetPolyFillMode(graphics->hdc, (fillMode == FillModeAlternate ? ALTERNATE : WINDING)); transform_and_round_points(graphics, pti, ptf, count); + + BeginPath(graphics->hdc); Polygon(graphics->hdc, pti, count); + EndPath(graphics->hdc); + + brush_fill_path(graphics, brush); RestoreDC(graphics->hdc, save_state); @@ -2677,13 +2684,16 @@ GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics *graphics, GpBrush *brush, save_state = SaveDC(graphics->hdc); EndPath(graphics->hdc); - SelectObject(graphics->hdc, brush->gdibrush); - SelectObject(graphics->hdc, GetStockObject(NULL_PEN)); SetPolyFillMode(graphics->hdc, (fillMode == FillModeAlternate ? ALTERNATE : WINDING)); transform_and_round_points(graphics, pti, ptf, count); + + BeginPath(graphics->hdc); Polygon(graphics->hdc, pti, count); + EndPath(graphics->hdc); + + brush_fill_path(graphics, brush); RestoreDC(graphics->hdc, save_state); @@ -2776,12 +2786,14 @@ GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush, save_state = SaveDC(graphics->hdc); EndPath(graphics->hdc); - SelectObject(graphics->hdc, brush->gdibrush); - SelectObject(graphics->hdc, GetStockObject(NULL_PEN)); transform_and_round_points(graphics, pti, ptf, 4); + BeginPath(graphics->hdc); Polygon(graphics->hdc, pti, 4); + EndPath(graphics->hdc); + + brush_fill_path(graphics, brush); RestoreDC(graphics->hdc, save_state); @@ -2845,6 +2857,7 @@ GpStatus WINGDIPAPI GdipFillRegion(GpGraphics* graphics, GpBrush* brush, INT save_state; GpStatus status; HRGN hrgn; + RECT rc; TRACE("(%p, %p, %p)\n", graphics, brush, region); @@ -2860,9 +2873,17 @@ GpStatus WINGDIPAPI GdipFillRegion(GpGraphics* graphics, GpBrush* brush, save_state = SaveDC(graphics->hdc); EndPath(graphics->hdc); - SelectObject(graphics->hdc, GetStockObject(NULL_PEN)); - FillRgn(graphics->hdc, hrgn, brush->gdibrush); + ExtSelectClipRgn(graphics->hdc, hrgn, RGN_AND); + + if (GetClipBox(graphics->hdc, &rc) != NULLREGION) + { + BeginPath(graphics->hdc); + Rectangle(graphics->hdc, rc.left, rc.top, rc.right, rc.bottom); + EndPath(graphics->hdc); + + brush_fill_path(graphics, brush); + } RestoreDC(graphics->hdc, save_state); diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c index b6fbe3044ef..7993d60cfd4 100644 --- a/dlls/gdiplus/tests/brush.c +++ b/dlls/gdiplus/tests/brush.c @@ -493,6 +493,71 @@ static void test_lineblend(void) expect(Ok, status); } +static void test_linelinearblend(void) +{ + GpLineGradient *brush; + GpStatus status; + GpPointF pt1, pt2; + INT count=10; + REAL res_factors[3] = {0.3f}; + REAL res_positions[3] = {0.3f}; + + status = GdipSetLineLinearBlend(NULL, 0.6, 0.8); + expect(InvalidParameter, status); + + pt1.X = pt1.Y = 1.0; + pt2.X = pt2.Y = 100.0; + status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush); + expect(Ok, status); + + + status = GdipSetLineLinearBlend(brush, 0.6, 0.8); + expect(Ok, status); + + status = GdipGetLineBlendCount(brush, &count); + expect(Ok, status); + expect(3, count); + + status = GdipGetLineBlend(brush, res_factors, res_positions, 3); + expect(Ok, status); + expectf(0.0, res_factors[0]); + expectf(0.0, res_positions[0]); + expectf(0.8, res_factors[1]); + expectf(0.6, res_positions[1]); + expectf(0.0, res_factors[2]); + expectf(1.0, res_positions[2]); + + + status = GdipSetLineLinearBlend(brush, 0.0, 0.8); + expect(Ok, status); + + status = GdipGetLineBlendCount(brush, &count); + expect(Ok, status); + expect(2, count); + + status = GdipGetLineBlend(brush, res_factors, res_positions, 3); + expect(Ok, status); + expectf(0.8, res_factors[0]); + expectf(0.0, res_positions[0]); + expectf(0.0, res_factors[1]); + expectf(1.0, res_positions[1]); + + + status = GdipSetLineLinearBlend(brush, 1.0, 0.8); + expect(Ok, status); + + status = GdipGetLineBlendCount(brush, &count); + expect(Ok, status); + expect(2, count); + + status = GdipGetLineBlend(brush, res_factors, res_positions, 3); + expect(Ok, status); + expectf(0.0, res_factors[0]); + expectf(0.0, res_positions[0]); + expectf(0.8, res_factors[1]); + expectf(1.0, res_positions[1]); +} + START_TEST(brush) { struct GdiplusStartupInput gdiplusStartupInput; @@ -515,6 +580,7 @@ START_TEST(brush) test_texturewrap(); test_gradientgetrect(); test_lineblend(); + test_linelinearblend(); GdiplusShutdown(gdiplusToken); } diff --git a/dlls/gphoto2.ds/gphoto2_Pt.rc b/dlls/gphoto2.ds/gphoto2_Pt.rc index c89d6ba0a0d..7e131f30f85 100644 --- a/dlls/gphoto2.ds/gphoto2_Pt.rc +++ b/dlls/gphoto2.ds/gphoto2_Pt.rc @@ -20,38 +20,40 @@ #include "resource.h" -LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL +#pragma code_page(65001) + +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE IDD_CAMERAUI DIALOG DISCARDABLE 0, 0, 372, 273 STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Ficheiros na Câmara" +CAPTION "Ficheiros na Câmara" MENU 20545 FONT 8, "MS Sans Serif" BEGIN CONTROL "List1",IDC_LIST1,"SysListView32", LVS_ICON | WS_BORDER | WS_TABSTOP,7,7,358,229 DEFPUSHBUTTON "Importar Seleccionado",IDC_IMPORT,152,252,72,14 - PUSHBUTTON "Pré-visualizar",IDC_FETCH,7,252,64,14 + PUSHBUTTON "Pré-visualizar",IDC_FETCH,7,252,64,14 PUSHBUTTON "Importar tudo",IDC_IMPORTALL,80,252,64,14 - CONTROL "Passar à frente",IDC_SKIP,"Botão", BS_AUTOCHECKBOX | WS_TABSTOP,230,252,76,14 + CONTROL "Passar à frente",IDC_SKIP,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,230,252,76,14 PUSHBUTTON "Sair",IDC_EXIT,315,252,50,14 END IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 46 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTER | DS_SETFOREGROUND -CAPTION "Transferindo" +CAPTION "A transferir" FONT 8, "MS Sans Serif" BEGIN - LTEXT "Transferindo... Por favor espere",IDC_STATIC,5,19,176,8, SS_CENTER + LTEXT "A transferir... Por favor espere",IDC_STATIC,5,19,176,8, SS_CENTER END IDD_CONNECTING DIALOG DISCARDABLE 0, 0, 280, 116 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU| WS_VISIBLE | DS_CENTER -CAPTION "A ligar à câmara" +CAPTION "A ligar à câmara" FONT 8, "MS Sans Serif" BEGIN - CONTROL "",IDC_BITMAP,"Estático",SS_BITMAP|SS_CENTERIMAGE,4,4,110,110 - LTEXT "A ligar à câmara... Por favor espere",IDC_STATIC,128,58, + CONTROL "",IDC_BITMAP,"Static",SS_BITMAP|SS_CENTERIMAGE,4,4,110,110 + LTEXT "A ligar à câmara... Por favor espere",IDC_STATIC,128,58, 116,8 END diff --git a/dlls/iccvid/Makefile.in b/dlls/iccvid/Makefile.in index 1a2fd75d4dd..6fdf13d1bff 100644 --- a/dlls/iccvid/Makefile.in +++ b/dlls/iccvid/Makefile.in @@ -14,6 +14,7 @@ RC_SRCS = \ iccvid_En.rc \ iccvid_Fr.rc \ iccvid_Hu.rc \ + iccvid_Ja.rc \ iccvid_Ko.rc \ iccvid_Lt.rc \ iccvid_Nl.rc \ diff --git a/dlls/iccvid/iccvid_De.rc b/dlls/iccvid/iccvid_De.rc index 3262c914ac3..d1a3cef3131 100644 --- a/dlls/iccvid/iccvid_De.rc +++ b/dlls/iccvid/iccvid_De.rc @@ -19,6 +19,8 @@ #include "iccvid_private.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL STRINGTABLE DISCARDABLE diff --git a/dlls/iccvid/iccvid_De.rc b/dlls/iccvid/iccvid_Ja.rc similarity index 78% copy from dlls/iccvid/iccvid_De.rc copy to dlls/iccvid/iccvid_Ja.rc index 3262c914ac3..b845af4a1c3 100644 --- a/dlls/iccvid/iccvid_De.rc +++ b/dlls/iccvid/iccvid_Ja.rc @@ -1,6 +1,5 @@ /* - * Copyright 2005 Dmitry Timoshkov - * Copyright 2005 Henning Gerhardt + * Copyright 2009 Aric Stewart, CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,10 +18,13 @@ #include "iccvid_private.h" -LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL +/* UTF-8 */ +#pragma code_page(65001) + +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT STRINGTABLE DISCARDABLE { - IDS_NAME "Cinepak Video Codec" - IDS_DESCRIPTION "Cinepak Video Codec" + IDS_NAME "Cinepak ビデオコーデック" + IDS_DESCRIPTION "Cinepak ビデオコーデック" } diff --git a/dlls/iccvid/iccvid_Ro.rc b/dlls/iccvid/iccvid_Ro.rc index ccd8ef7e1de..d99a0b2d36b 100644 --- a/dlls/iccvid/iccvid_Ro.rc +++ b/dlls/iccvid/iccvid_Ro.rc @@ -19,6 +19,8 @@ #include "iccvid_private.h" +#pragma code_page(65001) + LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL STRINGTABLE DISCARDABLE diff --git a/dlls/jscript/array.c b/dlls/jscript/array.c index 75d3871b96c..9b4314275d2 100644 --- a/dlls/jscript/array.c +++ b/dlls/jscript/array.c @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include "jscript.h" #include "wine/debug.h" @@ -60,6 +62,32 @@ static HRESULT Array_length(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM V_VT(retv) = VT_I4; V_I4(retv) = This->length; break; + case DISPATCH_PROPERTYPUT: { + VARIANT num; + DOUBLE len = -1; + DWORD i; + HRESULT hres; + + hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &num); + if(V_VT(&num) == VT_I4) + len = V_I4(&num); + else + len = floor(V_R8(&num)); + + if(len!=(DWORD)len) { + FIXME("Throw RangeError\n"); + return E_FAIL; + } + + for(i=len; ilength; i++) { + hres = jsdisp_delete_idx(dispex, i); + if(FAILED(hres)) + return hres; + } + + This->length = len; + break; + } default: FIXME("unimplemented flags %x\n", flags); return E_NOTIMPL; @@ -393,8 +421,81 @@ static HRESULT Array_shift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS static HRESULT Array_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + DispatchEx *arr; + VARIANT v; + DOUBLE range; + DWORD length, start, end, idx; + HRESULT hres; + + TRACE("\n"); + + if(is_class(dispex, JSCLASS_ARRAY)) { + length = ((ArrayInstance*)dispex)->length; + }else { + FIXME("not Array this\n"); + return E_NOTIMPL; + } + + if(arg_cnt(dp)) { + hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &v); + if(FAILED(hres)) + return hres; + + if(V_VT(&v) == VT_I4) + range = V_I4(&v); + else + range = floor(V_R8(&v)); + + if(-range>length || isnan(range)) start = 0; + else if(range < 0) start = range+length; + else if(range <= length) start = range; + else start = length; + } + else start = 0; + + if(arg_cnt(dp)>1) { + hres = to_number(dispex->ctx, get_arg(dp, 1), ei, &v); + if(FAILED(hres)) + return hres; + + if(V_VT(&v) == VT_I4) + range = V_I4(&v); + else + range = floor(V_R8(&v)); + + if(-range>length) end = 0; + else if(range < 0) end = range+length; + else if(range <= length) end = range; + else end = length; + } + else end = length; + + hres = create_array(dispex->ctx, (end>start)?end-start:0, &arr); + if(FAILED(hres)) + return hres; + + for(idx=start; idxtime, date); + + + if(isnan(t)) { + if(retv) + num_set_nan(retv); + return S_OK; + } + + year = year_from_time(t); + if(retv) + num_set_val(retv, (1900<=year && year<2000)?year-1900:year); + + return S_OK; +} + static HRESULT Date_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) { @@ -2160,6 +2192,7 @@ static const builtin_prop_t Date_props[] = { {getUTCMinutesW, Date_getUTCMinutes, PROPF_METHOD}, {getUTCMonthW, Date_getUTCMonth, PROPF_METHOD}, {getUTCSecondsW, Date_getUTCSeconds, PROPF_METHOD}, + {getYearW, Date_getYear, PROPF_METHOD}, {hasOwnPropertyW, Date_hasOwnProperty, PROPF_METHOD}, {isPrototypeOfW, Date_isPrototypeOf, PROPF_METHOD}, {propertyIsEnumerableW, Date_propertyIsEnumerable, PROPF_METHOD}, diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 01f4d49f421..509fb50944d 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -1010,3 +1010,19 @@ HRESULT disp_propget(IDispatch *disp, DISPID id, LCID lcid, VARIANT *val, jsexce return hres; } + +HRESULT jsdisp_delete_idx(DispatchEx *obj, DWORD idx) +{ + static const WCHAR formatW[] = {'%','d',0}; + WCHAR buf[12]; + dispex_prop_t *prop; + HRESULT hres; + + sprintfW(buf, formatW, idx); + + hres = find_prop_name(obj, buf, &prop); + if(FAILED(hres) || !prop) + return hres; + + return delete_prop(prop); +} diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 00eb087809a..f3ea33f782d 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -179,6 +179,8 @@ HRESULT create_exec_ctx(IDispatch *this_obj, DispatchEx *var_disp, scope_chain_t if(!ctx) return E_OUTOFMEMORY; + ctx->ref = 1; + IDispatch_AddRef(this_obj); ctx->this_obj = this_obj; @@ -1536,11 +1538,19 @@ HRESULT call_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, hres = args_to_param(ctx, expr->argument_list, ei, &dp); if(SUCCEEDED(hres)) { switch(exprval.type) { + case EXPRVAL_VARIANT: + if(V_VT(&exprval.u.var) != VT_DISPATCH) { + FIXME("throw TypeError\n"); + hres = E_NOTIMPL; + break; + } + + hres = disp_call(V_DISPATCH(&exprval.u.var), DISPID_VALUE, ctx->parser->script->lcid, + DISPATCH_METHOD, &dp, flags & EXPR_NOVAL ? NULL : &var, ei, NULL/*FIXME*/); + break; case EXPRVAL_IDREF: - hres = disp_call(exprval.u.idref.disp, exprval.u.idref.id, ctx->parser->script->lcid, DISPATCH_METHOD, - &dp, flags & EXPR_NOVAL ? NULL : &var, ei, NULL/*FIXME*/); - if(flags & EXPR_NOVAL) - V_VT(&var) = VT_EMPTY; + hres = disp_call(exprval.u.idref.disp, exprval.u.idref.id, ctx->parser->script->lcid, + DISPATCH_METHOD, &dp, flags & EXPR_NOVAL ? NULL : &var, ei, NULL/*FIXME*/); break; default: FIXME("unimplemented type %d\n", exprval.type); @@ -1554,9 +1564,13 @@ HRESULT call_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, if(FAILED(hres)) return hres; - TRACE("= %s\n", debugstr_variant(&var)); ret->type = EXPRVAL_VARIANT; - ret->u.var = var; + if(flags & EXPR_NOVAL) { + V_VT(&ret->u.var) = VT_EMPTY; + }else { + TRACE("= %s\n", debugstr_variant(&var)); + ret->u.var = var; + } return S_OK; } diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index c2ea230229c..dac8d3e23b0 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -41,7 +41,6 @@ static const WCHAR prototypeW[] = {'p','r','o','t','o','t', 'y', 'p','e',0}; static const WCHAR lengthW[] = {'l','e','n','g','t','h',0}; static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; -static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0}; static const WCHAR applyW[] = {'a','p','p','l','y',0}; static const WCHAR callW[] = {'c','a','l','l',0}; static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; @@ -198,9 +197,10 @@ static HRESULT invoke_constructor(FunctionInstance *function, LCID lcid, DISPPAR return hres; hres = invoke_source(function, (IDispatch*)_IDispatchEx_(this_obj), lcid, dp, retv, ei, caller); - jsdisp_release(this_obj); - if(FAILED(hres)) + if(FAILED(hres)) { + jsdisp_release(this_obj); return hres; + } V_VT(retv) = VT_DISPATCH; V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(this_obj); @@ -299,21 +299,6 @@ static HRESULT Function_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags return E_NOTIMPL; } -static HRESULT Function_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - WARN("should be inherited from Object\n"); - - if(retv) { - IDispatchEx_AddRef(_IDispatchEx_(dispex)); - - V_VT(retv) = VT_DISPATCH; - V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(dispex); - } - - return S_OK; -} - static HRESULT Function_apply(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -416,8 +401,7 @@ static const builtin_prop_t Function_props[] = { {lengthW, Function_length, 0}, {propertyIsEnumerableW, Function_propertyIsEnumerable, PROPF_METHOD}, {toLocaleStringW, Function_toLocaleString, PROPF_METHOD}, - {toStringW, Function_toString, PROPF_METHOD}, - {valueOfW, Function_valueOf, PROPF_METHOD} + {toStringW, Function_toString, PROPF_METHOD} }; static const builtin_info_t Function_info = { @@ -465,23 +449,20 @@ static HRESULT create_function(script_ctx_t *ctx, const builtin_info_t *builtin_ function->flags = flags; function->length = flags & PROPF_ARGMASK; - if(prototype) { - jsexcept_t jsexcept; - VARIANT var; + *ret = function; + return S_OK; +} - V_VT(&var) = VT_DISPATCH; - V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(prototype); - memset(&jsexcept, 0, sizeof(jsexcept)); +static HRESULT set_prototype(script_ctx_t *ctx, DispatchEx *dispex, DispatchEx *prototype) +{ + jsexcept_t jsexcept; + VARIANT var; - hres = jsdisp_propput_name(&function->dispex, prototypeW, ctx->lcid, &var, &jsexcept, NULL/*FIXME*/); - if(FAILED(hres)) { - IDispatchEx_Release(_IDispatchEx_(&function->dispex)); - return hres; - } - } + V_VT(&var) = VT_DISPATCH; + V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(prototype); + memset(&jsexcept, 0, sizeof(jsexcept)); - *ret = function; - return S_OK; + return jsdisp_propput_name(dispex, prototypeW, ctx->lcid, &var, &jsexcept, NULL/*FIXME*/); } HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, @@ -490,10 +471,16 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, FunctionInstance *function; HRESULT hres; - hres = create_function(ctx, builtin_info, flags, FALSE, prototype, &function); + hres = create_function(ctx, builtin_info, flags, FALSE, NULL, &function); if(FAILED(hres)) return hres; + hres = set_prototype(ctx, &function->dispex, prototype); + if(FAILED(hres)) { + jsdisp_release(&function->dispex); + return hres; + } + function->value_proc = value_proc; *ret = &function->dispex; @@ -513,7 +500,12 @@ HRESULT create_source_function(parser_ctx_t *ctx, parameter_t *parameters, sourc if(FAILED(hres)) return hres; - hres = create_function(ctx->script, NULL, PROPF_CONSTR, FALSE, prototype, &function); + hres = create_function(ctx->script, NULL, PROPF_CONSTR, FALSE, NULL, &function); + if(SUCCEEDED(hres)) { + hres = set_prototype(ctx->script, &function->dispex, prototype); + if(FAILED(hres)) + jsdisp_release(&function->dispex); + } jsdisp_release(prototype); if(FAILED(hres)) return hres; @@ -540,23 +532,28 @@ HRESULT create_source_function(parser_ctx_t *ctx, parameter_t *parameters, sourc return S_OK; } -HRESULT init_function_constr(script_ctx_t *ctx) +HRESULT init_function_constr(script_ctx_t *ctx, DispatchEx *object_prototype) { FunctionInstance *prot, *constr; HRESULT hres; - hres = create_function(ctx, NULL, PROPF_CONSTR, TRUE, NULL, &prot); + hres = create_function(ctx, NULL, PROPF_CONSTR, TRUE, object_prototype, &prot); if(FAILED(hres)) return hres; prot->value_proc = FunctionProt_value; hres = create_function(ctx, NULL, PROPF_CONSTR, TRUE, &prot->dispex, &constr); + if(SUCCEEDED(hres)) { + constr->value_proc = FunctionConstr_value; + hres = set_prototype(ctx, &constr->dispex, &prot->dispex); + if(FAILED(hres)) + jsdisp_release(&constr->dispex); + } jsdisp_release(&prot->dispex); if(FAILED(hres)) return hres; - constr->value_proc = FunctionConstr_value; ctx->function_constr = &constr->dispex; - return hres; + return S_OK; } diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 4f95653173a..9428e6578e2 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -574,15 +574,15 @@ static const builtin_info_t JSGlobal_info = { NULL }; -static HRESULT init_constructors(script_ctx_t *ctx) +static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype) { HRESULT hres; - hres = init_function_constr(ctx); + hres = init_function_constr(ctx, object_prototype); if(FAILED(hres)) return hres; - hres = create_object_constr(ctx, &ctx->object_constr); + hres = create_object_constr(ctx, object_prototype, &ctx->object_constr); if(FAILED(hres)) return hres; @@ -615,14 +615,19 @@ static HRESULT init_constructors(script_ctx_t *ctx) HRESULT init_global(script_ctx_t *ctx) { - DispatchEx *math; + DispatchEx *math, *object_prototype; VARIANT var; HRESULT hres; if(ctx->global) return S_OK; - hres = init_constructors(ctx); + hres = create_object_prototype(ctx, &object_prototype); + if(FAILED(hres)) + return hres; + + hres = init_constructors(ctx, object_prototype); + jsdisp_release(object_prototype); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 8d7d61f1018..370b3bdccdd 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -68,6 +68,7 @@ typedef enum { JSCLASS_ARRAY, JSCLASS_BOOLEAN, JSCLASS_DATE, + JSCLASS_ERROR, JSCLASS_FUNCTION, JSCLASS_GLOBAL, JSCLASS_MATH, @@ -132,6 +133,7 @@ HRESULT jsdisp_propput_idx(DispatchEx*,DWORD,LCID,VARIANT*,jsexcept_t*,IServiceP HRESULT jsdisp_propget_name(DispatchEx*,LPCWSTR,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_propget_idx(DispatchEx*,DWORD,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_get_id(DispatchEx*,const WCHAR*,DWORD,DISPID*); +HRESULT jsdisp_delete_idx(DispatchEx*,DWORD); HRESULT create_builtin_function(script_ctx_t*,builtin_invoke_t,const builtin_info_t*,DWORD, DispatchEx*,DispatchEx**); @@ -200,13 +202,14 @@ static inline void script_addref(script_ctx_t *ctx) } HRESULT init_global(script_ctx_t*); -HRESULT init_function_constr(script_ctx_t*); +HRESULT init_function_constr(script_ctx_t*,DispatchEx*); +HRESULT create_object_prototype(script_ctx_t*,DispatchEx**); HRESULT create_array_constr(script_ctx_t*,DispatchEx**); HRESULT create_bool_constr(script_ctx_t*,DispatchEx**); HRESULT create_date_constr(script_ctx_t*,DispatchEx**); HRESULT create_number_constr(script_ctx_t*,DispatchEx**); -HRESULT create_object_constr(script_ctx_t*,DispatchEx**); +HRESULT create_object_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_regexp_constr(script_ctx_t*,DispatchEx**); HRESULT create_string_constr(script_ctx_t*,DispatchEx**); diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index 4a885a50b75..d5ffa7fa168 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -512,6 +512,8 @@ HRESULT to_string(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, BSTR *str) const WCHAR nullW[] = {'n','u','l','l',0}; const WCHAR trueW[] = {'t','r','u','e',0}; const WCHAR falseW[] = {'f','a','l','s','e',0}; + const WCHAR NaNW[] = {'N','a','N',0}; + const WCHAR InfinityW[] = {'-','I','n','f','i','n','i','t','y',0}; switch(V_VT(v)) { case VT_EMPTY: @@ -524,16 +526,23 @@ HRESULT to_string(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, BSTR *str) *str = int_to_bstr(V_I4(v)); break; case VT_R8: { - VARIANT strv; - HRESULT hres; - - V_VT(&strv) = VT_EMPTY; - hres = VariantChangeTypeEx(&strv, v, MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), 0, VT_BSTR); - if(FAILED(hres)) - return hres; + if(isnan(V_R8(v))) + *str = SysAllocString(NaNW); + else if(isinf(V_R8(v))) + *str = SysAllocString(V_R8(v)<0 ? InfinityW : InfinityW+1); + else { + VARIANT strv; + HRESULT hres; + + V_VT(&strv) = VT_EMPTY; + hres = VariantChangeTypeEx(&strv, v, MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), 0, VT_BSTR); + if(FAILED(hres)) + return hres; - *str = V_BSTR(&strv); - return S_OK; + *str = V_BSTR(&strv); + return S_OK; + } + break; } case VT_BSTR: *str = SysAllocString(V_BSTR(v)); diff --git a/dlls/jscript/number.c b/dlls/jscript/number.c index d6591d06317..5399c91615a 100644 --- a/dlls/jscript/number.c +++ b/dlls/jscript/number.c @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include "jscript.h" #include "wine/debug.h" @@ -39,11 +41,14 @@ static const WCHAR propertyIsEnumerableW[] = {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; +#define NUMBER_TOSTRING_BUF_SIZE 64 /* ECMA-262 3rd Edition 15.7.4.2 */ static HRESULT Number_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { NumberInstance *number; + INT radix = 10; + DOUBLE val; BSTR str; HRESULT hres; @@ -56,14 +61,110 @@ static HRESULT Number_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA number = (NumberInstance*)dispex; - if(arg_cnt(dp) != 0) { - FIXME("unsupported args\n"); - return E_NOTIMPL; + if(arg_cnt(dp)) { + hres = to_int32(dispex->ctx, get_arg(dp, 0), ei, &radix); + if(FAILED(hres)) + return hres; + + if(radix<2 || radix>36) { + FIXME("throw TypeError\n"); + return E_FAIL; + } } - hres = to_string(dispex->ctx, &number->num, ei, &str); - if(FAILED(hres)) - return hres; + if(V_VT(&number->num) == VT_I4) + val = V_I4(&number->num); + else + val = V_R8(&number->num); + + if(radix==10 || isnan(val) || isinf(val)) { + hres = to_string(dispex->ctx, &number->num, ei, &str); + if(FAILED(hres)) + return hres; + } + else { + INT idx = 0; + DOUBLE integ, frac, log_radix = 0; + WCHAR buf[NUMBER_TOSTRING_BUF_SIZE+16]; + BOOL exp = FALSE; + + if(val<0) { + val = -val; + buf[idx++] = '-'; + } + + while(1) { + integ = floor(val); + frac = val-integ; + + if(integ == 0) + buf[idx++] = '0'; + while(integ>=1 && idx beg) { + wch = buf[beg]; + buf[beg++] = buf[end]; + buf[end--] = wch; + } + } + + if(idx != NUMBER_TOSTRING_BUF_SIZE) buf[idx++] = '.'; + + while(frac>0 && idxbuiltin_info->class] == NULL) { + ERR("dispex->builtin_info->class = %d\n", + dispex->builtin_info->class); + return E_FAIL; + } + if(retv) { V_VT(retv) = VT_BSTR; - V_BSTR(retv) = SysAllocString(default_valueW); + V_BSTR(retv) = SysAllocStringLen(NULL, 9+strlenW(names[dispex->builtin_info->class])); if(!V_BSTR(retv)) return E_OUTOFMEMORY; + + sprintfW(V_BSTR(retv), formatW, names[dispex->builtin_info->class]); } return S_OK; @@ -161,19 +185,15 @@ static HRESULT ObjectConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DIS return S_OK; } -HRESULT create_object_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_object_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { - DispatchEx *object; - HRESULT hres; - - hres = create_dispex(ctx, &Object_info, NULL, &object); - if(FAILED(hres)) - return hres; - - hres = create_builtin_function(ctx, ObjectConstr_value, NULL, PROPF_CONSTR, object, ret); + return create_builtin_function(ctx, ObjectConstr_value, NULL, PROPF_CONSTR, + object_prototype, ret); +} - jsdisp_release(object); - return hres; +HRESULT create_object_prototype(script_ctx_t *ctx, DispatchEx **ret) +{ + return create_dispex(ctx, &Object_info, NULL, ret); } HRESULT create_object(script_ctx_t *ctx, DispatchEx *constr, DispatchEx **ret) diff --git a/dlls/jscript/regexp.c b/dlls/jscript/regexp.c index 0acc47815c8..9722919f722 100644 --- a/dlls/jscript/regexp.c +++ b/dlls/jscript/regexp.c @@ -96,6 +96,7 @@ static const WCHAR propertyIsEnumerableW[] = {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static const WCHAR execW[] = {'e','x','e','c',0}; +static const WCHAR testW[] = {'t','e','s','t',0}; static const WCHAR emptyW[] = {0}; @@ -3505,6 +3506,13 @@ static HRESULT RegExp_exec(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS return E_NOTIMPL; } +static HRESULT RegExp_test(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, + VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) +{ + FIXME("\n"); + return E_NOTIMPL; +} + static HRESULT RegExp_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -3532,6 +3540,7 @@ static const builtin_prop_t RegExp_props[] = { {multilineW, RegExp_multiline, 0}, {propertyIsEnumerableW, RegExp_propertyIsEnumerable, PROPF_METHOD}, {sourceW, RegExp_source, 0}, + {testW, RegExp_test, PROPF_METHOD}, {toLocaleStringW, RegExp_toLocaleString, PROPF_METHOD}, {toStringW, RegExp_toString, PROPF_METHOD} }; diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 70ec50b2bb9..cf3c5be9f4b 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -66,6 +66,7 @@ static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p', static const WCHAR propertyIsEnumerableW[] = {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; +static const WCHAR fromCharCodeW[] = {'f','r','o','m','C','h','a','r','C','o','d','e',0}; static HRESULT String_length(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) @@ -127,26 +128,45 @@ static HRESULT do_attributeless_tag_format(DispatchEx *dispex, LCID lcid, WORD f VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp, const WCHAR *tagname) { static const WCHAR tagfmt[] = {'<','%','s','>','%','s','<','/','%','s','>',0}; - StringInstance *string; - BSTR ret; + const WCHAR *str; + DWORD length; + BSTR val_str = NULL; + HRESULT hres; if(!is_class(dispex, JSCLASS_STRING)) { - WARN("this is not a string object\n"); - return E_NOTIMPL; + VARIANT this; + + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); } + else { + StringInstance *this = (StringInstance*)dispex; - string = (StringInstance*)dispex; + str = this->str; + length = this->length; + } if(retv) { - ret = SysAllocStringLen(NULL, string->length + 2*strlenW(tagname) + 5); - if(!ret) + BSTR ret = SysAllocStringLen(NULL, length + 2*strlenW(tagname) + 5); + if(!ret) { + SysFreeString(val_str); return E_OUTOFMEMORY; + } - sprintfW(ret, tagfmt, tagname, string->str, tagname); + sprintfW(ret, tagfmt, tagname, str, tagname); V_VT(retv) = VT_BSTR; V_BSTR(retv) = ret; } + + SysFreeString(val_str); return S_OK; } @@ -158,43 +178,63 @@ static HRESULT do_attribute_tag_format(DispatchEx *dispex, LCID lcid, WORD flags = {'<','%','s',' ','%','s','=','\"','%','s','\"','>','%','s','<','/','%','s','>',0}; static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; - StringInstance *string; - BSTR ret, attr_value; + const WCHAR *str; + DWORD length; + BSTR attr_value, val_str = NULL; HRESULT hres; if(!is_class(dispex, JSCLASS_STRING)) { - WARN("this is not a string object\n"); - return E_NOTIMPL; + VARIANT this; + + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); } + else { + StringInstance *this = (StringInstance*)dispex; - string = (StringInstance*) dispex; + str = this->str; + length = this->length; + } if(arg_cnt(dp)) { hres = to_string(dispex->ctx, get_arg(dp, 0), ei, &attr_value); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } } else { attr_value = SysAllocString(undefinedW); - if(!attr_value) + if(!attr_value) { + SysFreeString(val_str); return E_OUTOFMEMORY; + } } if(retv) { - ret = SysAllocStringLen(NULL, string->length + 2*strlenW(tagname) + BSTR ret = SysAllocStringLen(NULL, length + 2*strlenW(tagname) + strlenW(attr) + SysStringLen(attr_value) + 9); if(!ret) { SysFreeString(attr_value); + SysFreeString(val_str); return E_OUTOFMEMORY; } - sprintfW(ret, tagfmtW, tagname, attr, attr_value, string->str, tagname); + sprintfW(ret, tagfmtW, tagname, attr, attr_value, str, tagname); V_VT(retv) = VT_BSTR; V_BSTR(retv) = ret; } SysFreeString(attr_value); + SysFreeString(val_str); return S_OK; } @@ -232,26 +272,42 @@ static HRESULT String_bold(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS static HRESULT String_charAt(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - StringInstance *strobj; - BSTR str; + const WCHAR *str; + DWORD length; + BSTR ret, val_str = NULL; INT pos = 0; HRESULT hres; TRACE("\n"); - if(dispex->builtin_info->class != JSCLASS_STRING) { - FIXME("not string this not supported\n"); - return E_NOTIMPL; + if(!is_class(dispex, JSCLASS_STRING)) { + VARIANT this; + + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); } + else { + StringInstance *this = (StringInstance*)dispex; - strobj = (StringInstance*)dispex; + str = this->str; + length = this->length; + } if(arg_cnt(dp)) { VARIANT num; hres = to_integer(dispex->ctx, get_arg(dp, 0), ei, &num); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } if(V_VT(&num) == VT_I4) { pos = V_I4(&num); @@ -261,18 +317,22 @@ static HRESULT String_charAt(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA } } - if(!retv) + if(!retv) { + SysFreeString(val_str); return S_OK; + } - if(0 <= pos && pos < strobj->length) - str = SysAllocStringLen(strobj->str+pos, 1); + if(0 <= pos && pos < length) + ret = SysAllocStringLen(str+pos, 1); else - str = SysAllocStringLen(NULL, 0); - if(!str) + ret = SysAllocStringLen(NULL, 0); + SysFreeString(val_str); + if(!ret) { return E_OUTOFMEMORY; + } V_VT(retv) = VT_BSTR; - V_BSTR(retv) = str; + V_BSTR(retv) = ret; return S_OK; } @@ -281,30 +341,44 @@ static HRESULT String_charCodeAt(DispatchEx *dispex, LCID lcid, WORD flags, DISP VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { const WCHAR *str; + BSTR val_str = NULL; DWORD length, idx = 0; HRESULT hres; TRACE("\n"); - if(dispex->builtin_info->class == JSCLASS_STRING) { - StringInstance *string = (StringInstance*)dispex; + if(!is_class(dispex, JSCLASS_STRING)) { + VARIANT this; - str = string->str; - length = string->length; - }else { - FIXME("not string this not supported\n"); - return E_NOTIMPL; + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); + } + else { + StringInstance *this = (StringInstance*)dispex; + + str = this->str; + length = this->length; } if(arg_cnt(dp) > 0) { VARIANT v; hres = to_integer(dispex->ctx, get_arg(dp, 0), ei, &v); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } if(V_VT(&v) != VT_I4 || V_I4(&v) < 0 || V_I4(&v) >= length) { if(retv) num_set_nan(&v); + SysFreeString(val_str); return S_OK; } @@ -315,6 +389,8 @@ static HRESULT String_charCodeAt(DispatchEx *dispex, LCID lcid, WORD flags, DISP V_VT(retv) = VT_I4; V_I4(retv) = str[idx]; } + + SysFreeString(val_str); return S_OK; } @@ -406,20 +482,30 @@ static HRESULT String_indexOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR { DWORD length, pos = 0; const WCHAR *str; - BSTR search_str; + BSTR search_str, val_str = NULL; INT ret = -1; HRESULT hres; TRACE("\n"); - if(is_class(dispex, JSCLASS_STRING)) { - StringInstance *string = (StringInstance*)dispex; + if(!is_class(dispex, JSCLASS_STRING)) { + VARIANT this; - str = string->str; - length = string->length; - }else { - FIXME("not String this\n"); - return E_NOTIMPL; + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); + } + else { + StringInstance *this = (StringInstance*)dispex; + + str = this->str; + length = this->length; } if(!arg_cnt(dp)) { @@ -427,12 +513,15 @@ static HRESULT String_indexOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR V_VT(retv) = VT_I4; V_I4(retv) = -1; } + SysFreeString(val_str); return S_OK; } hres = to_string(dispex->ctx, get_arg(dp,0), ei, &search_str); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } if(arg_cnt(dp) >= 2) { VARIANT ival; @@ -459,6 +548,7 @@ static HRESULT String_indexOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR } SysFreeString(search_str); + SysFreeString(val_str); if(FAILED(hres)) return hres; @@ -496,19 +586,23 @@ static HRESULT String_link(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS static HRESULT String_match(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - StringInstance *This = (StringInstance*)dispex; + const WCHAR *str; match_result_t *match_result; DispatchEx *regexp; DispatchEx *array; VARIANT var, *arg_var; - DWORD match_cnt, i; + DWORD length, match_cnt, i; + BSTR val_str; HRESULT hres = S_OK; TRACE("\n"); - if(arg_cnt(dp) != 1) { - FIXME("unsupported args\n"); - return E_NOTIMPL; + if(!arg_cnt(dp)) { + if(retv) { + V_VT(retv) = VT_NULL; + } + + return S_OK; } arg_var = get_arg(dp, 0); @@ -534,22 +628,50 @@ static HRESULT String_match(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM } } - hres = regexp_match(regexp, This->str, This->length, FALSE, &match_result, &match_cnt); + if(!is_class(dispex, JSCLASS_STRING)) { + VARIANT this; + + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) { + jsdisp_release(regexp); + return hres; + } + + str = val_str; + length = SysStringLen(val_str); + } + else { + StringInstance *this = (StringInstance*)dispex; + + str = this->str; + length = this->length; + } + + hres = regexp_match(regexp, str, length, FALSE, &match_result, &match_cnt); jsdisp_release(regexp); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } if(!match_cnt) { TRACE("no match\n"); if(retv) V_VT(retv) = VT_NULL; + + SysFreeString(val_str); return S_OK; } hres = create_array(dispex->ctx, match_cnt, &array); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } V_VT(&var) = VT_BSTR; @@ -566,6 +688,8 @@ static HRESULT String_match(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM break; } + SysFreeString(val_str); + if(SUCCEEDED(hres) && retv) { V_VT(retv) = VT_DISPATCH; V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(array); @@ -674,11 +798,11 @@ static HRESULT rep_call(DispatchEx *func, const WCHAR *str, match_result_t *matc static HRESULT String_replace(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) { + const WCHAR *str; DWORD parens_cnt = 0, parens_size=0, rep_len=0, length; - BSTR rep_str = NULL, match_str = NULL, ret_str; + BSTR rep_str = NULL, match_str = NULL, ret_str, val_str = NULL; DispatchEx *rep_func = NULL, *regexp = NULL; match_result_t *parens = NULL, match; - const WCHAR *str; strbuf_t ret = {NULL,0,0}; BOOL gcheck = FALSE; VARIANT *arg_var; @@ -686,23 +810,36 @@ static HRESULT String_replace(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR TRACE("\n"); - if(is_class(dispex, JSCLASS_STRING)) { - StringInstance *string = (StringInstance*)dispex; - str = string->str; - length = string->length; - }else { - FIXME("not String this\n"); - return E_NOTIMPL; + if(!is_class(dispex, JSCLASS_STRING)) { + VARIANT this; + + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); + } + else { + StringInstance *this = (StringInstance*)dispex; + + str = this->str; + length = this->length; } if(!arg_cnt(dp)) { if(retv) { - ret_str = SysAllocString(str); - if(!ret_str) - return E_OUTOFMEMORY; + if(!val_str) { + val_str = SysAllocStringLen(str, length); + if(!val_str) + return E_OUTOFMEMORY; + } V_VT(retv) = VT_BSTR; - V_BSTR(retv) = ret_str; + V_BSTR(retv) = val_str; } return S_OK; } @@ -722,8 +859,10 @@ static HRESULT String_replace(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR default: hres = to_string(dispex->ctx, arg_var, ei, &match_str); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } } if(arg_cnt(dp) >= 2) { @@ -816,6 +955,7 @@ static HRESULT String_replace(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR jsdisp_release(rep_func); if(regexp) jsdisp_release(regexp); + SysFreeString(val_str); SysFreeString(rep_str); SysFreeString(match_str); heap_free(parens); @@ -846,6 +986,7 @@ static HRESULT String_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { const WCHAR *str; + BSTR val_str = NULL; DWORD length; INT start=0, end; VARIANT v; @@ -853,20 +994,32 @@ static HRESULT String_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM TRACE("\n"); - if(is_class(dispex, JSCLASS_STRING)) { - StringInstance *string = (StringInstance*)dispex; + if(!is_class(dispex, JSCLASS_STRING)) { + VARIANT this; - str = string->str; - length = string->length; - }else { - FIXME("this is not a string class\n"); - return E_NOTIMPL; + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); + } + else { + StringInstance *this = (StringInstance*)dispex; + + str = this->str; + length = this->length; } if(arg_cnt(dp)) { hres = to_integer(dispex->ctx, dp->rgvarg + dp->cArgs-1, ei, &v); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } if(V_VT(&v) == VT_I4) { start = V_I4(&v); @@ -886,8 +1039,10 @@ static HRESULT String_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM if(arg_cnt(dp) >= 2) { hres = to_integer(dispex->ctx, dp->rgvarg + dp->cArgs-2, ei, &v); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } if(V_VT(&v) == VT_I4) { end = V_I4(&v); @@ -910,12 +1065,16 @@ static HRESULT String_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM if(retv) { BSTR retstr = SysAllocStringLen(str+start, end-start); - if(!str) + if(!retstr) { + SysFreeString(val_str); return E_OUTOFMEMORY; + } V_VT(retv) = VT_BSTR; V_BSTR(retv) = retstr; } + + SysFreeString(val_str); return S_OK; } @@ -930,26 +1089,38 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { match_result_t *match_result = NULL; - DWORD match_cnt, i, match_len = 0; - StringInstance *string; - const WCHAR *ptr, *ptr2; + DWORD length, match_cnt, i, match_len = 0; + const WCHAR *str, *ptr, *ptr2; VARIANT *arg, var; DispatchEx *array; - BSTR match_str = NULL; + BSTR val_str = NULL, match_str = NULL; HRESULT hres; TRACE("\n"); - if(!is_class(dispex, JSCLASS_STRING)) { - FIXME("not String this\n"); + if(arg_cnt(dp) != 1) { + FIXME("unsupported args\n"); return E_NOTIMPL; } - string = (StringInstance*)dispex; + if(!is_class(dispex, JSCLASS_STRING)) { + VARIANT this; - if(arg_cnt(dp) != 1) { - FIXME("unsupported args\n"); - return E_NOTIMPL; + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); + } + else { + StringInstance *this = (StringInstance*)dispex; + + str = this->str; + length = this->length; } arg = get_arg(dp, 0); @@ -960,10 +1131,12 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM regexp = iface_to_jsdisp((IUnknown*)V_DISPATCH(arg)); if(regexp) { if(is_class(regexp, JSCLASS_REGEXP)) { - hres = regexp_match(regexp, string->str, string->length, TRUE, &match_result, &match_cnt); + hres = regexp_match(regexp, str, length, TRUE, &match_result, &match_cnt); jsdisp_release(regexp); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } break; } jsdisp_release(regexp); @@ -971,8 +1144,10 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM } default: hres = to_string(dispex->ctx, arg, ei, &match_str); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } match_len = SysStringLen(match_str); if(!match_len) { @@ -984,7 +1159,7 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM hres = create_array(dispex->ctx, 0, &array); if(SUCCEEDED(hres)) { - ptr = string->str; + ptr = str; for(i=0;; i++) { if(match_result) { if(i == match_cnt) @@ -1022,7 +1197,7 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM } if(SUCCEEDED(hres) && (match_str || match_result)) { - DWORD len = (string->str+string->length) - ptr; + DWORD len = (str+length) - ptr; if(len || match_str) { V_VT(&var) = VT_BSTR; @@ -1038,6 +1213,7 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM } SysFreeString(match_str); + SysFreeString(val_str); heap_free(match_result); if(SUCCEEDED(hres) && retv) { @@ -1069,6 +1245,7 @@ static HRESULT String_substring(DispatchEx *dispex, LCID lcid, WORD flags, DISPP VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { const WCHAR *str; + BSTR val_str = NULL; INT start=0, end; DWORD length; VARIANT v; @@ -1076,20 +1253,32 @@ static HRESULT String_substring(DispatchEx *dispex, LCID lcid, WORD flags, DISPP TRACE("\n"); - if(is_class(dispex, JSCLASS_STRING)) { - StringInstance *string = (StringInstance*)dispex; + if(!is_class(dispex, JSCLASS_STRING)) { + VARIANT this; - length = string->length; - str = string->str; - }else { - FIXME("not string this not supported\n"); - return E_NOTIMPL; + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); + } + else { + StringInstance *this = (StringInstance*)dispex; + + str = this->str; + length = this->length; } if(arg_cnt(dp) >= 1) { hres = to_integer(dispex->ctx, dp->rgvarg + dp->cArgs-1, ei, &v); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } if(V_VT(&v) == VT_I4) { start = V_I4(&v); @@ -1104,8 +1293,10 @@ static HRESULT String_substring(DispatchEx *dispex, LCID lcid, WORD flags, DISPP if(arg_cnt(dp) >= 2) { hres = to_integer(dispex->ctx, dp->rgvarg + dp->cArgs-2, ei, &v); - if(FAILED(hres)) + if(FAILED(hres)) { + SysFreeString(val_str); return hres; + } if(V_VT(&v) == VT_I4) { end = V_I4(&v); @@ -1129,9 +1320,12 @@ static HRESULT String_substring(DispatchEx *dispex, LCID lcid, WORD flags, DISPP if(retv) { V_VT(retv) = VT_BSTR; V_BSTR(retv) = SysAllocStringLen(str+start, end-start); - if(!V_BSTR(retv)) + if(!V_BSTR(retv)) { + SysFreeString(val_str); return E_OUTOFMEMORY; + } } + SysFreeString(val_str); return S_OK; } @@ -1152,66 +1346,92 @@ static HRESULT String_sup(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS static HRESULT String_toLowerCase(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - StringInstance *string; const WCHAR* str; DWORD length; - BSTR bstr; + BSTR val_str = NULL; + HRESULT hres; TRACE("\n"); - if(is_class(dispex, JSCLASS_STRING)) { - string = (StringInstance*)dispex; + if(!is_class(dispex, JSCLASS_STRING)) { + VARIANT this; - length = string->length; - str = string->str; - }else { - FIXME("not string this not supported\n"); - return E_NOTIMPL; + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); + } + else { + StringInstance *this = (StringInstance*)dispex; + + str = this->str; + length = this->length; } if(retv) { - bstr = SysAllocStringLen(str, length); - if (!bstr) - return E_OUTOFMEMORY; + if(!val_str) { + val_str = SysAllocStringLen(str, length); + if(!val_str) + return E_OUTOFMEMORY; + } - strlwrW(bstr); + strlwrW(val_str); V_VT(retv) = VT_BSTR; - V_BSTR(retv) = bstr; + V_BSTR(retv) = val_str; } + else SysFreeString(val_str); return S_OK; } static HRESULT String_toUpperCase(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - StringInstance *string; const WCHAR* str; DWORD length; - BSTR bstr; + BSTR val_str = NULL; + HRESULT hres; TRACE("\n"); - if(is_class(dispex, JSCLASS_STRING)) { - string = (StringInstance*)dispex; + if(!is_class(dispex, JSCLASS_STRING)) { + VARIANT this; - length = string->length; - str = string->str; - }else { - FIXME("not string this not supported\n"); - return E_NOTIMPL; + V_VT(&this) = VT_DISPATCH; + V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex); + + hres = to_string(dispex->ctx, &this, ei, &val_str); + if(FAILED(hres)) + return hres; + + str = val_str; + length = SysStringLen(val_str); + } + else { + StringInstance *this = (StringInstance*)dispex; + + str = this->str; + length = this->length; } if(retv) { - bstr = SysAllocStringLen(str, length); - if (!bstr) - return E_OUTOFMEMORY; + if(!val_str) { + val_str = SysAllocStringLen(str, length); + if(!val_str) + return E_OUTOFMEMORY; + } - struprW(bstr); + struprW(val_str); V_VT(retv) = VT_BSTR; - V_BSTR(retv) = bstr; + V_BSTR(retv) = val_str; } + else SysFreeString(val_str); return S_OK; } @@ -1338,6 +1558,37 @@ static const builtin_info_t String_info = { NULL }; +/* ECMA-262 3rd Edition 15.5.3.2 */ +static HRESULT StringConstr_fromCharCode(DispatchEx *dispex, LCID lcid, WORD flags, + DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) +{ + DWORD i, code; + BSTR ret; + HRESULT hres; + + ret = SysAllocStringLen(NULL, arg_cnt(dp)); + if(!ret) + return E_OUTOFMEMORY; + + for(i=0; ictx, get_arg(dp, i), ei, &code); + if(FAILED(hres)) { + SysFreeString(ret); + return hres; + } + + ret[i] = code; + } + + if(retv) { + V_VT(retv) = VT_BSTR; + V_BSTR(retv) = ret; + } + else SysFreeString(ret); + + return S_OK; +} + static HRESULT StringConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -1417,6 +1668,19 @@ static HRESULT string_alloc(script_ctx_t *ctx, BOOL use_constr, StringInstance * return S_OK; } +static const builtin_prop_t StringConstr_props[] = { + {fromCharCodeW, StringConstr_fromCharCode, PROPF_METHOD}, +}; + +static const builtin_info_t StringConstr_info = { + JSCLASS_FUNCTION, + {NULL, Function_value, 0}, + sizeof(StringConstr_props)/sizeof(*StringConstr_props), + StringConstr_props, + NULL, + NULL +}; + HRESULT create_string_constr(script_ctx_t *ctx, DispatchEx **ret) { StringInstance *string; @@ -1426,7 +1690,7 @@ HRESULT create_string_constr(script_ctx_t *ctx, DispatchEx **ret) if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, StringConstr_value, NULL, PROPF_CONSTR, &string->dispex, ret); + hres = create_builtin_function(ctx, StringConstr_value, &StringConstr_info, PROPF_CONSTR, &string->dispex, ret); jsdisp_release(&string->dispex); return hres; diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 22b531704ca..a80bd9f6d50 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -60,6 +60,22 @@ ok(tmp === "abc", "encodeURI('abc') = " + tmp); tmp = "" + new Object(); ok(tmp === "[object Object]", "'' + new Object() = " + tmp); +(tmp = new Array).f = Object.prototype.toString; +ok(tmp.f() === "[object Array]", "tmp.f() = " + tmp.f()); +(tmp = new Boolean).f = Object.prototype.toString; +ok(tmp.f() === "[object Boolean]", "tmp.f() = " + tmp.f()); +(tmp = new Date).f = Object.prototype.toString; +ok(tmp.f() === "[object Date]", "tmp.f() = " + tmp.f()); +(tmp = function() {}).f = Object.prototype.toString; +ok(tmp.f() === "[object Function]", "tmp.f() = " + tmp.f()); +Math.f = Object.prototype.toString; +ok(Math.f() === "[object Math]", "tmp.f() = " + tmp.f()); +(tmp = new Number).f = Object.prototype.toString; +ok(tmp.f() === "[object Number]", "tmp.f() = " + tmp.f()); +(tmp = new RegExp("")).f = Object.prototype.toString; +ok(tmp.f() === "[object RegExp]", "tmp.f() = " + tmp.f()); +(tmp = new String).f = Object.prototype.toString; +ok(tmp.f() === "[object String]", "tmp.f() = " + tmp.f()); ok("".length === 0, "\"\".length = " + "".length); ok(getVT("".length) == "VT_I4", "\"\".length = " + "".length); @@ -405,6 +421,13 @@ ok(tmp === "test", "'test'.sup() = " + tmp); tmp = "test".sup(3); ok(tmp === "test", "'test'.sup(3) = " + tmp); +ok(String.fromCharCode() === "", "String.fromCharCode() = " + String.fromCharCode()); +ok(String.fromCharCode(65,"66",67) === "ABC", "String.fromCharCode(65,'66',67) = " + String.fromCharCode(65,"66",67)); +ok(String.fromCharCode(1024*64+65, -1024*64+65) === "AA", + "String.fromCharCode(1024*64+65, -1024*64+65) = " + String.fromCharCode(1024*64+65, -1024*64+65)); +ok(String.fromCharCode(65, NaN, undefined).length === 3, + "String.fromCharCode(65, NaN, undefined).length = " + String.fromCharCode(65, NaN, undefined).length); + var arr = new Array(); ok(typeof(arr) === "object", "arr () is not object"); ok((arr.length === 0), "arr.length is not 0"); @@ -494,6 +517,16 @@ ok(arr.sort() === arr, "arr.sort() !== arr"); for(var i=0; i < arr.length; i++) ok(arr[i] === tmp[i], "arr[" + i + "] = " + arr[i] + " expected " + tmp[i]); +arr = ["1", "2", "3"]; +arr.length = 1; +ok(arr.length === 1, "arr.length = " + arr.length); +arr.length = 3; +ok(arr.length === 3, "arr.length = " + arr.length); +ok(arr.toString() === "1,,", "arr.toString() = " + arr.toString()); + +arr = Array("a","b","c"); +ok(arr.toString() === "a,b,c", "arr.toString() = " + arr.toString()); + ok(arr.valueOf === Object.prototype.valueOf, "arr.valueOf !== Object.prototype.valueOf"); ok(arr === arr.valueOf(), "arr !== arr.valueOf"); @@ -514,6 +547,23 @@ tmp = arr.concat([2]); ok(tmp.length === 3, "tmp.length = " + tmp.length); ok(tmp[1] === undefined, "tmp[1] = " + tmp[1]); +arr = [1,false,'a',null,undefined,'a']; +ok(arr.slice(0,6).toString() === "1,false,a,,,a", "arr.slice(0,6).toString() = " + arr.slice(0,6)); +ok(arr.slice(0,6).length === 6, "arr.slice(0,6).length = " + arr.slice(0,6).length); +ok(arr.slice().toString() === "1,false,a,,,a", "arr.slice().toString() = " + arr.slice()); +ok(arr.slice("abc").toString() === "1,false,a,,,a", "arr.slice(\"abc\").toString() = " + arr.slice("abc")); +ok(arr.slice(3,8).toString() === ",,a", "arr.slice(3,8).toString() = " + arr.slice(3,8)); +ok(arr.slice(3,8).length === 3, "arr.slice(3,8).length = " + arr.slice(3,8).length); +ok(arr.slice(1).toString() === "false,a,,,a", "arr.slice(1).toString() = " + arr.slice(1)); +ok(arr.slice(-2).toString() === ",a", "arr.slice(-2).toString() = " + arr.slice(-2)); +ok(arr.slice(3,1).toString() === "", "arr.slice(3,1).toString() = " + arr.slice(3,1)); +tmp = arr.slice(0,6); +for(var i=0; i < arr.length; i++) + ok(arr[i] === tmp[i], "arr[" + i + "] = " + arr[i] + " expected " + tmp[i]); +arr[12] = 2; +ok(arr.slice(5).toString() === "a,,,,,,,2", "arr.slice(5).toString() = " + arr.slice(5).toString()); +ok(arr.slice(5).length === 8, "arr.slice(5).length = " + arr.slice(5).length); + var num = new Number(2); ok(num.toString() === "2", "num(2).toString !== 2"); var num = new Number(); @@ -532,6 +582,51 @@ ok(tmp === 0, "(new Number()).valueOf = " + tmp); tmp = Number.prototype.valueOf(); ok(tmp === 0, "Number.prototype.valueOf = " + tmp); +function equals(val, base) { + var i; + var num = 0; + var str = val.toString(base); + + for(i=0; ival-val/1000 && numname, name ); - list_add_head( &dialog->controls, &control->entry ); + list_add_tail( &dialog->controls, &control->entry ); control->handler = NULL; control->update = NULL; control->property = NULL; @@ -3002,37 +3002,34 @@ static void msi_dialog_adjust_dialog_pos( msi_dialog *dialog, MSIRECORD *rec, LP AdjustWindowRect( pos, style, FALSE ); } -static BOOL msi_control_set_next( msi_control *control, msi_control *next ) +static void msi_dialog_set_tab_order( msi_dialog *dialog, LPCWSTR first ) { - return SetWindowPos( next->hwnd, control->hwnd, 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW | - SWP_NOREPOSITION | SWP_NOSENDCHANGING | SWP_NOSIZE ); -} + struct list tab_chain; + msi_control *control; + HWND prev = HWND_TOP; -static UINT msi_dialog_set_tab_order( msi_dialog *dialog ) -{ - msi_control *control, *tab_next; + list_init( &tab_chain ); + if (!(control = msi_dialog_find_control( dialog, first ))) return; - LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry ) + dialog->hWndFocus = control->hwnd; + while (control) { - tab_next = msi_dialog_find_control( dialog, control->tabnext ); - if( !tab_next ) - continue; - msi_control_set_next( control, tab_next ); + list_remove( &control->entry ); + list_add_tail( &tab_chain, &control->entry ); + if (!control->tabnext) break; + control = msi_dialog_find_control( dialog, control->tabnext ); } - return ERROR_SUCCESS; -} - -static void msi_dialog_set_first_control( msi_dialog* dialog, LPCWSTR name ) -{ - msi_control *control; + LIST_FOR_EACH_ENTRY( control, &tab_chain, msi_control, entry ) + { + SetWindowPos( control->hwnd, prev, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW | + SWP_NOREPOSITION | SWP_NOSENDCHANGING | SWP_NOSIZE ); + prev = control->hwnd; + } - control = msi_dialog_find_control( dialog, name ); - if( control ) - dialog->hWndFocus = control->hwnd; - else - dialog->hWndFocus = NULL; + /* put them back on the main list */ + list_move_head( &dialog->controls, &tab_chain ); } static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs ) @@ -3082,8 +3079,7 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs ) msi_dialog_build_font_list( dialog ); msi_dialog_fill_controls( dialog ); msi_dialog_evaluate_control_conditions( dialog ); - msi_dialog_set_tab_order( dialog ); - msi_dialog_set_first_control( dialog, MSI_RecordGetString( rec, 8 ) ); + msi_dialog_set_tab_order( dialog, MSI_RecordGetString( rec, 8 ) ); msiobj_release( &rec->hdr ); return 0; diff --git a/dlls/msvcrt/errno.c b/dlls/msvcrt/errno.c index 6ed6086877f..413ab391fc0 100644 --- a/dlls/msvcrt/errno.c +++ b/dlls/msvcrt/errno.c @@ -140,6 +140,7 @@ void msvcrt_set_errno(int err) ERR_CASE(ERROR_DRIVE_LOCKED) ERR_CASE(ERROR_NOT_LOCKED) ERR_CASE(ERROR_INVALID_ACCESS) + ERR_CASE(ERROR_SHARING_VIOLATION) ERR_MAPS(ERROR_LOCK_VIOLATION, MSVCRT_EACCES); ERR_CASE(ERROR_FILE_NOT_FOUND) ERR_CASE(ERROR_NO_MORE_FILES) diff --git a/dlls/msvidc32/Makefile.in b/dlls/msvidc32/Makefile.in index faa0f18ed15..3bc63a8c1ee 100644 --- a/dlls/msvidc32/Makefile.in +++ b/dlls/msvidc32/Makefile.in @@ -14,6 +14,7 @@ RC_SRCS = \ msvidc32_En.rc \ msvidc32_Fr.rc \ msvidc32_Hu.rc \ + msvidc32_Ja.rc \ msvidc32_Ko.rc \ msvidc32_Lt.rc \ msvidc32_Nl.rc \ diff --git a/dlls/msvidc32/msvidc32_De.rc b/dlls/msvidc32/msvidc32_De.rc index c31635cfa5e..1dc777b8497 100644 --- a/dlls/msvidc32/msvidc32_De.rc +++ b/dlls/msvidc32/msvidc32_De.rc @@ -19,6 +19,8 @@ #include "msvidc32_private.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL STRINGTABLE DISCARDABLE diff --git a/dlls/msvidc32/msvidc32_De.rc b/dlls/msvidc32/msvidc32_Ja.rc similarity index 81% copy from dlls/msvidc32/msvidc32_De.rc copy to dlls/msvidc32/msvidc32_Ja.rc index c31635cfa5e..3d09c760b2f 100644 --- a/dlls/msvidc32/msvidc32_De.rc +++ b/dlls/msvidc32/msvidc32_Ja.rc @@ -1,6 +1,5 @@ /* - * Copyright 2005 Dmitry Timoshkov - * Copyright 2005 Henning Gerhardt + * Copyright 2009 Aric Stewart, CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,10 +18,13 @@ #include "msvidc32_private.h" -LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL +/* UTF-8 */ +#pragma code_page(65001) + +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT STRINGTABLE DISCARDABLE { IDS_NAME "MS-CRAM" - IDS_DESCRIPTION "Wine Video 1 Video Codec" + IDS_DESCRIPTION "Wine ビデオ 1 ビデオコーデック" } diff --git a/dlls/msvidc32/msvidc32_Ro.rc b/dlls/msvidc32/msvidc32_Ro.rc index 62bcef0df4d..c001dd4f2c0 100644 --- a/dlls/msvidc32/msvidc32_Ro.rc +++ b/dlls/msvidc32/msvidc32_Ro.rc @@ -19,6 +19,8 @@ #include "msvidc32_private.h" +#pragma code_page(65001) + LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL STRINGTABLE DISCARDABLE diff --git a/dlls/oleaut32/oleaut32_De.rc b/dlls/oleaut32/oleaut32_De.rc index e0ae38b9190..1dbee3ee8c7 100644 --- a/dlls/oleaut32/oleaut32_De.rc +++ b/dlls/oleaut32/oleaut32_De.rc @@ -20,6 +20,8 @@ #include "resource.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL STRINGTABLE DISCARDABLE diff --git a/dlls/oleaut32/tests/usrmarshal.c b/dlls/oleaut32/tests/usrmarshal.c index 1f10971c4d6..d1809460238 100644 --- a/dlls/oleaut32/tests/usrmarshal.c +++ b/dlls/oleaut32/tests/usrmarshal.c @@ -118,7 +118,7 @@ static void check_safearray(void *buffer, LPSAFEARRAY lpsa) if(!lpsa) { - ok(*(void **)wiresa == NULL, "wiresa + 0x0 should be NULL instead of 0x%08x\n", *(DWORD *)wiresa); + ok(*(DWORD *)wiresa == 0, "wiresa + 0x0 should be NULL instead of 0x%08x\n", *(DWORD *)wiresa); return; } @@ -134,19 +134,19 @@ static void check_safearray(void *buffer, LPSAFEARRAY lpsa) wiresa += sizeof(DWORD); ok(*(WORD *)wiresa == lpsa->cDims, "wiresa + 0x8 should be lpsa->cDims instead of 0x%04x\n", *(WORD *)wiresa); wiresa += sizeof(WORD); - ok(*(WORD *)wiresa == lpsa->fFeatures, "wiresa + 0xc should be lpsa->fFeatures instead of 0x%08x\n", *(WORD *)wiresa); + ok(*(WORD *)wiresa == lpsa->fFeatures, "wiresa + 0xa should be lpsa->fFeatures instead of 0x%08x\n", *(WORD *)wiresa); wiresa += sizeof(WORD); - ok(*(DWORD *)wiresa == lpsa->cbElements, "wiresa + 0x10 should be lpsa->cbElements instead of 0x%08x\n", *(DWORD *)wiresa); + ok(*(DWORD *)wiresa == lpsa->cbElements, "wiresa + 0xc should be lpsa->cbElements instead of 0x%08x\n", *(DWORD *)wiresa); wiresa += sizeof(DWORD); - ok(*(WORD *)wiresa == lpsa->cLocks, "wiresa + 0x16 should be lpsa->cLocks instead of 0x%04x\n", *(WORD *)wiresa); + ok(*(WORD *)wiresa == lpsa->cLocks, "wiresa + 0x10 should be lpsa->cLocks instead of 0x%04x\n", *(WORD *)wiresa); wiresa += sizeof(WORD); - ok(*(WORD *)wiresa == vt, "wiresa + 0x14 should be %04x instead of 0x%04x\n", vt, *(WORD *)wiresa); + ok(*(WORD *)wiresa == vt, "wiresa + 0x12 should be %04x instead of 0x%04x\n", vt, *(WORD *)wiresa); wiresa += sizeof(WORD); - ok(*(DWORD *)wiresa == sftype, "wiresa + 0x18 should be %08x instead of 0x%08x\n", (DWORD)sftype, *(DWORD *)wiresa); + ok(*(DWORD *)wiresa == sftype, "wiresa + 0x14 should be %08x instead of 0x%08x\n", (DWORD)sftype, *(DWORD *)wiresa); wiresa += sizeof(DWORD); - ok(*(DWORD *)wiresa == cell_count, "wiresa + 0x1c should be %u instead of %u\n", cell_count, *(DWORD *)wiresa); + ok(*(DWORD *)wiresa == cell_count, "wiresa + 0x18 should be %u instead of %u\n", cell_count, *(DWORD *)wiresa); wiresa += sizeof(DWORD); - ok(*(DWORD *)wiresa, "wiresa + 0x20 should be non-zero instead of 0x%08x\n", *(DWORD *)wiresa); + ok(*(DWORD *)wiresa, "wiresa + 0x1c should be non-zero instead of 0x%08x\n", *(DWORD *)wiresa); wiresa += sizeof(DWORD); if(sftype == SF_HAVEIID) { @@ -158,7 +158,7 @@ static void check_safearray(void *buffer, LPSAFEARRAY lpsa) ok(!memcmp(wiresa, lpsa->rgsabound, sizeof(lpsa->rgsabound[0]) * lpsa->cDims), "bounds mismatch\n"); wiresa += sizeof(lpsa->rgsabound[0]) * lpsa->cDims; - ok(*(DWORD *)wiresa == cell_count, "wiresa + 0x2c should be %u instead of %u\n", cell_count, *(DWORD*)wiresa); + ok(*(DWORD *)wiresa == cell_count, "wiresa + 0x28 should be %u instead of %u\n", cell_count, *(DWORD*)wiresa); wiresa += sizeof(DWORD); /* elements are now pointed to by wiresa */ } @@ -198,7 +198,7 @@ static void init_user_marshal_cb(USER_MARSHAL_CB *umcb, static void test_marshal_LPSAFEARRAY(void) { unsigned char *buffer; - ULONG size; + ULONG size, expected; LPSAFEARRAY lpsa; LPSAFEARRAY lpsa2 = NULL; SAFEARRAYBOUND sab; @@ -217,10 +217,15 @@ static void test_marshal_LPSAFEARRAY(void) lpsa->cLocks = 7; init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); size = LPSAFEARRAY_UserSize(&umcb.Flags, 1, &lpsa); - ok(size == 68, "size should be 68 bytes, not %d\n", size); + expected = (44 + 1 + sizeof(ULONG) - 1) & ~(sizeof(ULONG) - 1); + expected += sab.cElements * sizeof(USHORT); + ok(size == expected || size == expected + 12, /* win64 */ + "size should be %u bytes, not %u\n", expected, size); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); size = LPSAFEARRAY_UserSize(&umcb.Flags, 0, &lpsa); - ok(size == 64, "size should be 64 bytes, not %d\n", size); + expected = 44 + sab.cElements * sizeof(USHORT); + ok(size == expected || size == expected + 12, /* win64 */ + "size should be %u bytes, not %u\n", expected, size); buffer = HeapAlloc(GetProcessHeap(), 0, size); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserMarshal(&umcb.Flags, buffer, &lpsa); @@ -273,10 +278,16 @@ static void test_marshal_LPSAFEARRAY(void) lpsa->cLocks = 7; init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); size = LPSAFEARRAY_UserSize(&umcb.Flags, 1, &lpsa); - ok(size == 128, "size should be 128 bytes, not %d\n", size); + expected = (44 + 1 + (sizeof(double) - 1)) & ~(sizeof(double) - 1); + expected += sab.cElements * sizeof(double); + ok(size == expected || size == expected + 16, /* win64 */ + "size should be %u bytes, not %u\n", expected, size); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + expected = (44 + (sizeof(double) - 1)) & ~(sizeof(double) - 1); + expected += sab.cElements * sizeof(double); size = LPSAFEARRAY_UserSize(&umcb.Flags, 0, &lpsa); - ok(size == 128, "size should be 128 bytes, not %d\n", size); + ok(size == expected || size == expected + 8, /* win64 */ + "size should be %u bytes, not %u\n", expected, size); buffer = HeapAlloc(GetProcessHeap(), 0, size); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserMarshal(&umcb.Flags, buffer, &lpsa); @@ -301,7 +312,10 @@ static void test_marshal_LPSAFEARRAY(void) init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); size = LPSAFEARRAY_UserSize(&umcb.Flags, 0, &lpsa); - ok(size == 432, "size %d\n", size); + expected = (44 + lpsa->cbElements - 1) & ~(lpsa->cbElements - 1); + expected += lpsa->cbElements * lpsa->rgsabound[0].cElements; + ok(size == expected || size == expected + 8, /* win64 */ + "size should be %u bytes, not %u\n", expected, size); buffer = HeapAlloc(GetProcessHeap(), 0, size); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserMarshal(&umcb.Flags, buffer, &lpsa); @@ -313,7 +327,7 @@ static void test_marshal_LPSAFEARRAY(void) /* VARTYPE-less arrays with FADF_VARIANT */ hr = SafeArrayAllocDescriptor(1, &lpsa); ok(hr == S_OK, "saad failed %08x\n", hr); - lpsa->cbElements = 16; + lpsa->cbElements = sizeof(VARIANT); lpsa->fFeatures = FADF_VARIANT; lpsa->rgsabound[0].lLbound = 2; lpsa->rgsabound[0].cElements = 48; @@ -325,11 +339,14 @@ static void test_marshal_LPSAFEARRAY(void) init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); size = LPSAFEARRAY_UserSize(&umcb.Flags, 0, &lpsa); + expected = 44 + 28 * lpsa->rgsabound[0].cElements; todo_wine - ok(size == 1388, "size %d\n", size); + ok(size == expected || size == expected + 8, /* win64 */ + "size should be %u bytes, not %u\n", expected, size); buffer = HeapAlloc(GetProcessHeap(), 0, size); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserMarshal(&umcb.Flags, buffer, &lpsa); + lpsa->cbElements = 16; /* VARIANT wire size */ check_safearray(buffer, lpsa); HeapFree(GetProcessHeap(), 0, buffer); SafeArrayDestroyData(lpsa); @@ -582,6 +599,7 @@ static void test_marshal_VARIANT(void) LPSAFEARRAY lpsa; DECIMAL dec, dec2; HeapUnknown *heap_unknown; + DWORD expected; stubMsg.RpcMsg = &rpcMsg; @@ -1130,14 +1148,16 @@ static void test_marshal_VARIANT(void) V_ARRAY(&v) = lpsa; rpcMsg.BufferLength = stubMsg.BufferLength = VARIANT_UserSize(&umcb.Flags, 0, &v); - ok(stubMsg.BufferLength == 152, "size %d\n", stubMsg.BufferLength); + expected = 152; + ok(stubMsg.BufferLength == expected || stubMsg.BufferLength == expected + 8, /* win64 */ + "size %u instead of %u\n", stubMsg.BufferLength, expected); buffer = rpcMsg.Buffer = stubMsg.Buffer = stubMsg.BufferStart = alloc_aligned(stubMsg.BufferLength, &oldbuffer); stubMsg.BufferEnd = stubMsg.Buffer + stubMsg.BufferLength; next = VARIANT_UserMarshal(&umcb.Flags, buffer, &v); - ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); + ok(next == buffer + expected, "got %p expect %p\n", next, buffer + expected); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); + check_variant_header(wirev, &v, expected); wirev += 5; ok(*wirev, "wv[5] %08x\n", *wirev); /* win2k: this is lpsa. winxp: this is (char*)lpsa + 1 */ wirev++; @@ -1149,7 +1169,7 @@ static void test_marshal_VARIANT(void) VariantInit(&v2); stubMsg.Buffer = buffer; next = VARIANT_UserUnmarshal(&umcb.Flags, buffer, &v2); - ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); + ok(next == buffer + expected, "got %p expect %p\n", next, buffer + expected); ok(V_VT(&v) == V_VT(&v2), "got vt %d expect %d\n", V_VT(&v), V_VT(&v2)); ok(SafeArrayGetDim(V_ARRAY(&v)) == SafeArrayGetDim(V_ARRAY(&v)), "array dims differ\n"); SafeArrayGetLBound(V_ARRAY(&v), 1, &bound); @@ -1171,14 +1191,16 @@ static void test_marshal_VARIANT(void) V_ARRAYREF(&v) = &lpsa; rpcMsg.BufferLength = stubMsg.BufferLength = VARIANT_UserSize(&umcb.Flags, 0, &v); - ok(stubMsg.BufferLength == 152, "size %d\n", stubMsg.BufferLength); + expected = 152; + ok(stubMsg.BufferLength == expected || stubMsg.BufferLength == expected + 16, /* win64 */ + "size %u instead of %u\n", stubMsg.BufferLength, expected); buffer = rpcMsg.Buffer = stubMsg.Buffer = stubMsg.BufferStart = alloc_aligned(stubMsg.BufferLength, &oldbuffer); stubMsg.BufferEnd = stubMsg.Buffer + stubMsg.BufferLength; next = VARIANT_UserMarshal(&umcb.Flags, buffer, &v); - ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); + ok(next == buffer + expected, "got %p expect %p\n", next, buffer + expected); wirev = (DWORD*)buffer; - - check_variant_header(wirev, &v, stubMsg.BufferLength); + + check_variant_header(wirev, &v, expected); wirev += 5; ok(*wirev == 4, "wv[5] %08x\n", *wirev); wirev++; @@ -1192,7 +1214,7 @@ static void test_marshal_VARIANT(void) VariantInit(&v2); stubMsg.Buffer = buffer; next = VARIANT_UserUnmarshal(&umcb.Flags, buffer, &v2); - ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); + ok(next == buffer + expected, "got %p expect %p\n", next, buffer + expected); ok(V_VT(&v) == V_VT(&v2), "got vt %d expect %d\n", V_VT(&v), V_VT(&v2)); ok(SafeArrayGetDim(*V_ARRAYREF(&v)) == SafeArrayGetDim(*V_ARRAYREF(&v)), "array dims differ\n"); SafeArrayGetLBound(*V_ARRAYREF(&v), 1, &bound); @@ -1228,7 +1250,7 @@ static void test_marshal_VARIANT(void) check_variant_header(wirev, &v, stubMsg.BufferLength); wirev += 5; - ok(*wirev == 16, "wv[5] %08x\n", *wirev); + ok(*wirev == sizeof(VARIANT), "wv[5] %08x\n", *wirev); wirev++; ok(*wirev == ('U' | 's' << 8 | 'e' << 16 | 'r' << 24), "wv[6] %08x\n", *wirev); /* 'User' */ wirev++; diff --git a/dlls/oleaut32/usrmarshal.c b/dlls/oleaut32/usrmarshal.c index 1e20c3cd322..3172ebad5fc 100644 --- a/dlls/oleaut32/usrmarshal.c +++ b/dlls/oleaut32/usrmarshal.c @@ -232,7 +232,7 @@ static unsigned int get_type_size(ULONG *pFlags, VARTYPE vt) case VT_DECIMAL: return sizeof(DECIMAL); case VT_BSTR: - return sizeof(BSTR); + return sizeof(ULONG); case VT_VARIANT: return sizeof(VARIANT); case VT_UNKNOWN: @@ -764,7 +764,7 @@ ULONG WINAPI LPSAFEARRAY_UserSize(ULONG *pFlags, ULONG StartingSize, LPSAFEARRAY HRESULT hr; size += sizeof(ULONG); - size += FIELD_OFFSET(struct _wireSAFEARRAY, uArrayStructs); + size += 2 * sizeof(USHORT) + 2 * sizeof(ULONG); sftype = SAFEARRAY_GetUnionType(psa); size += sizeof(ULONG); @@ -850,23 +850,23 @@ unsigned char * WINAPI LPSAFEARRAY_UserMarshal(ULONG *pFlags, unsigned char *Buf VARTYPE vt; SAFEARRAY *psa = *ppsa; ULONG ulCellCount = SAFEARRAY_GetCellCount(psa); - wireSAFEARRAY wiresa; SF_TYPE sftype; GUID guid; *(ULONG *)Buffer = psa->cDims; Buffer += sizeof(ULONG); - wiresa = (wireSAFEARRAY)Buffer; - wiresa->cDims = psa->cDims; - wiresa->fFeatures = psa->fFeatures; - wiresa->cbElements = psa->cbElements; + *(USHORT *)Buffer = psa->cDims; + Buffer += sizeof(USHORT); + *(USHORT *)Buffer = psa->fFeatures; + Buffer += sizeof(USHORT); + *(ULONG *)Buffer = psa->cbElements; + Buffer += sizeof(ULONG); hr = SafeArrayGetVartype(psa, &vt); if (FAILED(hr)) vt = 0; - wiresa->cLocks = (USHORT)psa->cLocks | (vt << 16); - - Buffer += FIELD_OFFSET(struct _wireSAFEARRAY, uArrayStructs); + *(ULONG *)Buffer = (USHORT)psa->cLocks | (vt << 16); + Buffer += sizeof(ULONG); sftype = SAFEARRAY_GetUnionType(psa); *(ULONG *)Buffer = sftype; @@ -987,7 +987,7 @@ unsigned char * WINAPI LPSAFEARRAY_UserUnmarshal(ULONG *pFlags, unsigned char *B Buffer += sizeof(ULONG); wiresa = (wireSAFEARRAY)Buffer; - Buffer += FIELD_OFFSET(struct _wireSAFEARRAY, uArrayStructs); + Buffer += 2 * sizeof(USHORT) + 2 * sizeof(ULONG); if (cDims != wiresa->cDims) RpcRaiseException(RPC_S_INVALID_BOUND); diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 278b9aaa843..14a72468ba9 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -422,7 +422,10 @@ void ME_RTFCharAttrHook(RTF_Info *info) else if (info->rtfParam != rtfNoParam) { RTFColor *c = RTFGetColor(info, info->rtfParam); - fmt.crTextColor = (c->rtfCBlue<<16)|(c->rtfCGreen<<8)|(c->rtfCRed); + if (c && c->rtfCBlue >= 0) + fmt.crTextColor = (c->rtfCBlue<<16)|(c->rtfCGreen<<8)|(c->rtfCRed); + else + fmt.dwEffects = CFE_AUTOBACKCOLOR; } break; case rtfForeColor: @@ -433,10 +436,11 @@ void ME_RTFCharAttrHook(RTF_Info *info) else if (info->rtfParam != rtfNoParam) { RTFColor *c = RTFGetColor(info, info->rtfParam); - if (c) + if (c && c->rtfCBlue >= 0) fmt.crTextColor = (c->rtfCBlue<<16)|(c->rtfCGreen<<8)|(c->rtfCRed); - else - fmt.crTextColor = 0; + else { + fmt.dwEffects = CFE_AUTOCOLOR; + } } break; case rtfFontNum: @@ -3194,7 +3198,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, /* If we detect ascii rtf at the start of the string, * we know it isn't unicode. */ bRtf = (lParam && (!strncmp((char *)lParam, "{\\rtf", 5) || - !strncmp((char *)lParam, "{\\urtf}", 6))); + !strncmp((char *)lParam, "{\\urtf", 6))); bUnicode = !bRtf && pStruct->codepage == 1200; TRACE("EM_SETTEXTEX - %s, flags %d, cp %d\n", @@ -3463,7 +3467,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, if (lParam) { TRACE("WM_SETTEXT lParam==%lx\n",lParam); - if (!unicode && !strncmp((char *)lParam, "{\\rtf", 5)) + if (!strncmp((char *)lParam, "{\\rtf", 5) || + !strncmp((char *)lParam, "{\\urtf", 6)) { /* Undocumented: WM_SETTEXT supports RTF text */ ME_StreamInRTFString(editor, 0, (char *)lParam); @@ -3841,23 +3846,29 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, } case WM_CREATE: { - SCROLLINFO si; + INT max; ME_SetDefaultFormatRect(editor); - si.cbSize = sizeof(si); - si.fMask = SIF_PAGE | SIF_RANGE; + max = (editor->styleFlags & ES_DISABLENOSCROLL) ? 1 : 0; + if (~editor->styleFlags & ES_DISABLENOSCROLL || editor->styleFlags & WS_VSCROLL) + ITextHost_TxSetScrollRange(editor->texthost, SB_VERT, 0, max, TRUE); + + if (~editor->styleFlags & ES_DISABLENOSCROLL || editor->styleFlags & WS_HSCROLL) + ITextHost_TxSetScrollRange(editor->texthost, SB_HORZ, 0, max, TRUE); + if (editor->styleFlags & ES_DISABLENOSCROLL) - si.fMask |= SIF_DISABLENOSCROLL; - si.nMax = (si.fMask & SIF_DISABLENOSCROLL) ? 1 : 0; - si.nMin = 0; - si.nPage = 0; - if (editor->hWnd) { - SetScrollInfo(editor->hWnd, SB_VERT, &si, TRUE); - SetScrollInfo(editor->hWnd, SB_HORZ, &si, TRUE); - } else { - ITextHost_TxSetScrollRange(editor->texthost, SB_VERT, si.nMin, si.nMax, TRUE); - ITextHost_TxSetScrollRange(editor->texthost, SB_HORZ, si.nMin, si.nMax, TRUE); + { + if (editor->styleFlags & WS_VSCROLL) + { + ITextHost_TxEnableScrollBar(editor->texthost, SB_VERT, ESB_DISABLE_BOTH); + ITextHost_TxShowScrollBar(editor->texthost, SB_VERT, TRUE); + } + if (editor->styleFlags & WS_HSCROLL) + { + ITextHost_TxEnableScrollBar(editor->texthost, SB_HORZ, ESB_DISABLE_BOTH); + ITextHost_TxShowScrollBar(editor->texthost, SB_HORZ, TRUE); + } } ME_CommitUndo(editor); diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 620ac69160c..2c1c9b98c82 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -1061,22 +1061,28 @@ void ME_ScrollAbs(ME_TextEditor *editor, int x, int y) if (editor->hWnd) { LONG winStyle = GetWindowLongW(editor->hWnd, GWL_STYLE); - bScrollBarIsVisible = (winStyle & WS_HSCROLL) != 0; - bScrollBarWillBeVisible = (editor->nTotalWidth > editor->sizeWindow.cx - && (editor->styleFlags & WS_HSCROLL)) - || (editor->styleFlags & ES_DISABLENOSCROLL); - if (bScrollBarIsVisible != bScrollBarWillBeVisible) - ITextHost_TxShowScrollBar(editor->texthost, SB_HORZ, - bScrollBarWillBeVisible); + if (editor->styleFlags & WS_HSCROLL) + { + bScrollBarIsVisible = (winStyle & WS_HSCROLL) != 0; + bScrollBarWillBeVisible = (editor->nTotalWidth > editor->sizeWindow.cx + && (editor->styleFlags & WS_HSCROLL)) + || (editor->styleFlags & ES_DISABLENOSCROLL); + if (bScrollBarIsVisible != bScrollBarWillBeVisible) + ITextHost_TxShowScrollBar(editor->texthost, SB_HORZ, + bScrollBarWillBeVisible); + } - bScrollBarIsVisible = (winStyle & WS_VSCROLL) != 0; - bScrollBarWillBeVisible = (editor->nTotalLength > editor->sizeWindow.cy - && (editor->styleFlags & WS_VSCROLL) - && (editor->styleFlags & ES_MULTILINE)) - || (editor->styleFlags & ES_DISABLENOSCROLL); - if (bScrollBarIsVisible != bScrollBarWillBeVisible) - ITextHost_TxShowScrollBar(editor->texthost, SB_VERT, - bScrollBarWillBeVisible); + if (editor->styleFlags & WS_VSCROLL) + { + bScrollBarIsVisible = (winStyle & WS_VSCROLL) != 0; + bScrollBarWillBeVisible = (editor->nTotalLength > editor->sizeWindow.cy + && (editor->styleFlags & WS_VSCROLL) + && (editor->styleFlags & ES_MULTILINE)) + || (editor->styleFlags & ES_DISABLENOSCROLL); + if (bScrollBarIsVisible != bScrollBarWillBeVisible) + ITextHost_TxShowScrollBar(editor->texthost, SB_VERT, + bScrollBarWillBeVisible); + } } ME_UpdateScrollBar(editor); } @@ -1136,6 +1142,7 @@ void ME_UpdateScrollBar(ME_TextEditor *editor) si.cbSize = sizeof(si); si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS; + si.nMin = 0; if (editor->styleFlags & ES_DISABLENOSCROLL) si.fMask |= SIF_DISABLENOSCROLL; @@ -1150,20 +1157,19 @@ void ME_UpdateScrollBar(ME_TextEditor *editor) return; } - si.nMin = 0; si.nMax = editor->nTotalWidth; si.nPos = editor->horz_si.nPos; si.nPage = editor->sizeWindow.cx; - if (si.nMin != editor->horz_si.nMin || - si.nMax != editor->horz_si.nMax || + if (si.nMax != editor->horz_si.nMax || si.nPage != editor->horz_si.nPage) { TRACE("min=%d max=%d page=%d\n", si.nMin, si.nMax, si.nPage); - editor->horz_si.nMin = si.nMin; editor->horz_si.nMax = si.nMax; editor->horz_si.nPage = si.nPage; - if (bScrollBarWillBeVisible || bScrollBarWasVisible) { + if ((bScrollBarWillBeVisible || bScrollBarWasVisible) && + editor->styleFlags & WS_HSCROLL) + { if (editor->hWnd) { SetScrollInfo(editor->hWnd, SB_HORZ, &si, TRUE); } else { @@ -1175,14 +1181,17 @@ void ME_UpdateScrollBar(ME_TextEditor *editor) } } - if (si.fMask & SIF_DISABLENOSCROLL) { - bScrollBarWillBeVisible = TRUE; - } else if (!(editor->styleFlags & WS_HSCROLL)) { - bScrollBarWillBeVisible = FALSE; - } + if (editor->styleFlags & WS_HSCROLL) + { + if (si.fMask & SIF_DISABLENOSCROLL) { + bScrollBarWillBeVisible = TRUE; + } else if (!(editor->styleFlags & WS_HSCROLL)) { + bScrollBarWillBeVisible = FALSE; + } - if (bScrollBarWasVisible != bScrollBarWillBeVisible) - ITextHost_TxShowScrollBar(editor->texthost, SB_HORZ, bScrollBarWillBeVisible); + if (bScrollBarWasVisible != bScrollBarWillBeVisible) + ITextHost_TxShowScrollBar(editor->texthost, SB_HORZ, bScrollBarWillBeVisible); + } /* Update vertical scrollbar */ bScrollBarWasVisible = editor->vert_si.nMax > editor->vert_si.nPage; @@ -1201,15 +1210,15 @@ void ME_UpdateScrollBar(ME_TextEditor *editor) si.nPos = editor->vert_si.nPos; si.nPage = editor->sizeWindow.cy; - if (si.nMin != editor->vert_si.nMin || - si.nMax != editor->vert_si.nMax || + if (si.nMax != editor->vert_si.nMax || si.nPage != editor->vert_si.nPage) { TRACE("min=%d max=%d page=%d\n", si.nMin, si.nMax, si.nPage); - editor->vert_si.nMin = si.nMin; editor->vert_si.nMax = si.nMax; editor->vert_si.nPage = si.nPage; - if (bScrollBarWillBeVisible || bScrollBarWasVisible) { + if ((bScrollBarWillBeVisible || bScrollBarWasVisible) && + editor->styleFlags & WS_VSCROLL) + { if (editor->hWnd) { SetScrollInfo(editor->hWnd, SB_VERT, &si, TRUE); } else { @@ -1221,15 +1230,18 @@ void ME_UpdateScrollBar(ME_TextEditor *editor) } } - if (si.fMask & SIF_DISABLENOSCROLL) { - bScrollBarWillBeVisible = TRUE; - } else if (!(editor->styleFlags & WS_VSCROLL)) { - bScrollBarWillBeVisible = FALSE; - } + if (editor->styleFlags & WS_VSCROLL) + { + if (si.fMask & SIF_DISABLENOSCROLL) { + bScrollBarWillBeVisible = TRUE; + } else if (!(editor->styleFlags & WS_VSCROLL)) { + bScrollBarWillBeVisible = FALSE; + } - if (bScrollBarWasVisible != bScrollBarWillBeVisible) - ITextHost_TxShowScrollBar(editor->texthost, SB_VERT, - bScrollBarWillBeVisible); + if (bScrollBarWasVisible != bScrollBarWillBeVisible) + ITextHost_TxShowScrollBar(editor->texthost, SB_VERT, + bScrollBarWillBeVisible); + } } void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor) @@ -1242,11 +1254,21 @@ void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor) assert(pRow); assert(pPara); - x = pRun->pt.x + ME_PointFromChar(editor, pRun, pCursor->nOffset); - if (x > editor->horz_si.nPos + editor->sizeWindow.cx) - x = x + 1 - editor->sizeWindow.cx; - else if (x > editor->horz_si.nPos) + if (editor->styleFlags & ES_AUTOHSCROLL) + { + x = pRun->pt.x + ME_PointFromChar(editor, pRun, pCursor->nOffset); + if (x > editor->horz_si.nPos + editor->sizeWindow.cx) + x = x + 1 - editor->sizeWindow.cx; + else if (x > editor->horz_si.nPos) + x = editor->horz_si.nPos; + + if (~editor->styleFlags & ES_AUTOVSCROLL) + ME_HScrollAbs(editor, x); + } else { + if (~editor->styleFlags & ES_AUTOVSCROLL) + return; x = editor->horz_si.nPos; + } y = pPara->member.para.pt.y + pRow->member.row.pt.y; yheight = pRow->member.row.nHeight; diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c index b6a6f44f255..0462f71eb73 100644 --- a/dlls/riched20/reader.c +++ b/dlls/riched20/reader.c @@ -990,18 +990,21 @@ static void ReadColorTbl(RTF_Info *info) break; } cp->rtfCNum = cnum++; - cp->rtfCRed = cp->rtfCGreen = cp->rtfCBlue = -1; cp->rtfNextColor = info->colorList; info->colorList = cp; - while (RTFCheckCM (info, rtfControl, rtfColorName)) - { - switch (info->rtfMinor) - { - case rtfRed: cp->rtfCRed = info->rtfParam; break; - case rtfGreen: cp->rtfCGreen = info->rtfParam; break; - case rtfBlue: cp->rtfCBlue = info->rtfParam; break; - } - RTFGetToken (info); + if (!RTFCheckCM (info, rtfControl, rtfColorName)) + cp->rtfCRed = cp->rtfCGreen = cp->rtfCBlue = -1; + else { + cp->rtfCRed = cp->rtfCGreen = cp->rtfCBlue = 0; + do { + switch (info->rtfMinor) + { + case rtfRed: cp->rtfCRed = info->rtfParam & 0xFF; break; + case rtfGreen: cp->rtfCGreen = info->rtfParam & 0xFF; break; + case rtfBlue: cp->rtfCBlue = info->rtfParam & 0xFF; break; + } + RTFGetToken (info); + } while (RTFCheckCM (info, rtfControl, rtfColorName)); } if (info->rtfClass == rtfEOF) break; diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 0383d1487bf..914f25bd9ae 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -3282,10 +3282,15 @@ static void test_WM_SETTEXT(void) const char * TestItem7 = "TestSomeText\r\n\r\r\n\rTestSomeText"; const char * TestItem7_after = "TestSomeText\r\n \r\nTestSomeText"; + const char rtftextA[] = "{\\rtf sometext}"; + const char urtftextA[] = "{\\urtf sometext}"; + const WCHAR rtftextW[] = {'{','\\','r','t','f',' ','s','o','m','e','t','e','x','t','}',0}; + const WCHAR urtftextW[] = {'{','\\','u','r','t','f',' ','s','o','m','e','t','e','x','t','}',0}; + const WCHAR sometextW[] = {'s','o','m','e','t','e','x','t',0}; + char buf[1024] = {0}; + WCHAR bufW[1024] = {0}; LRESULT result; - EDITSTREAM es; - char * p; /* This test attempts to show that WM_SETTEXT on a riched20 control causes any solitary \r to be converted to \r\n on return. Properly paired @@ -3302,7 +3307,7 @@ static void test_WM_SETTEXT(void) result, lstrlen(buf)); \ result = strcmp(b, buf); \ ok(result == 0, \ - "WM_SETTEXT round trip: strcmp = %ld\n", result); + "WM_SETTEXT round trip: strcmp = %ld, text=\"%s\"\n", result, buf); TEST_SETTEXT(TestItem1, TestItem1) TEST_SETTEXT(TestItem2, TestItem2_after) @@ -3313,20 +3318,39 @@ static void test_WM_SETTEXT(void) TEST_SETTEXT(TestItem6, TestItem6_after) TEST_SETTEXT(TestItem7, TestItem7_after) - /* The following test demonstrates that WM_SETTEXT supports RTF strings */ - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) TestItem1); - p = buf; - es.dwCookie = (DWORD_PTR)&p; - es.dwError = 0; - es.pfnCallback = test_WM_SETTEXT_esCallback; - memset(buf, 0, sizeof(buf)); - SendMessage(hwndRichEdit, EM_STREAMOUT, - (WPARAM)(SF_RTF), (LPARAM)&es); - trace("EM_STREAMOUT produced:\n%s\n", buf); - TEST_SETTEXT(buf, TestItem1) - + /* The following tests demonstrate that WM_SETTEXT supports RTF strings */ + TEST_SETTEXT(rtftextA, "sometext") /* interpreted as ascii rtf */ + TEST_SETTEXT(urtftextA, "sometext") /* interpreted as ascii rtf */ + TEST_SETTEXT(rtftextW, "{") /* interpreted as ascii text */ + TEST_SETTEXT(urtftextW, "{") /* interpreted as ascii text */ + DestroyWindow(hwndRichEdit); #undef TEST_SETTEXT + +#define TEST_SETTEXTW(a, b) \ + result = SendMessageW(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) a); \ + ok (result == 1, "WM_SETTEXT returned %ld instead of 1\n", result); \ + result = SendMessageW(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) bufW); \ + ok (result == lstrlenW(bufW), \ + "WM_GETTEXT returned %ld instead of expected %u\n", \ + result, lstrlenW(bufW)); \ + result = lstrcmpW(b, bufW); \ + ok(result == 0, "WM_SETTEXT round trip: strcmp = %ld\n", result); + + if (is_win9x) + { + skip("Cannot perform unicode tests\n"); + return; + } +hwndRichEdit = CreateWindowW(RICHEDIT_CLASS20W, NULL, + ES_MULTILINE|WS_POPUP|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwndRichEdit != NULL, "class: RichEdit20W, error: %d\n", (int) GetLastError()); + TEST_SETTEXTW(rtftextA, sometextW) /* interpreted as ascii rtf */ + TEST_SETTEXTW(urtftextA, sometextW) /* interpreted as ascii rtf */ + TEST_SETTEXTW(rtftextW, rtftextW) /* interpreted as ascii text */ + TEST_SETTEXTW(urtftextW, urtftextW) /* interpreted as ascii text */ DestroyWindow(hwndRichEdit); +#undef TEST_SETTEXTW } static void test_EM_STREAMOUT(void) diff --git a/dlls/sane.ds/Makefile.in b/dlls/sane.ds/Makefile.in index e394939fbdf..e5c3fd45a5e 100644 --- a/dlls/sane.ds/Makefile.in +++ b/dlls/sane.ds/Makefile.in @@ -21,6 +21,7 @@ RC_SRCS = \ sane_Es.rc \ sane_Fi.rc \ sane_Fr.rc \ + sane_Ja.rc \ sane_Ko.rc \ sane_Lt.rc \ sane_Nl.rc \ diff --git a/dlls/sane.ds/sane_De.rc b/dlls/sane.ds/sane_De.rc index a1be1e4f105..3f3e116c3dc 100644 --- a/dlls/sane.ds/sane_De.rc +++ b/dlls/sane.ds/sane_De.rc @@ -20,6 +20,8 @@ #include "resource.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 46 diff --git a/dlls/sane.ds/sane_De.rc b/dlls/sane.ds/sane_Ja.rc similarity index 77% copy from dlls/sane.ds/sane_De.rc copy to dlls/sane.ds/sane_Ja.rc index a1be1e4f105..27e709549b6 100644 --- a/dlls/sane.ds/sane_De.rc +++ b/dlls/sane.ds/sane_Ja.rc @@ -1,7 +1,7 @@ /* - * German resources for Twain + * Japanese resources for Twain * - * Copyright 2006 Henning Gerhardt + * Copyright 2009 CodeWeavers, Aric Stewart * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,14 +20,17 @@ #include "resource.h" -LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL +/* UTF-8 */ +#pragma code_page(65001) + +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 46 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTER | DS_SETFOREGROUND -CAPTION "Scanne" -FONT 8, "MS Sans Serif" +CAPTION "スキャン中" +FONT 9, "MS Shell Dlg" BEGIN - LTEXT "SCANNE... Bitte warten",IDC_STATIC,5,19,176,8, SS_CENTER + LTEXT "スキャン中... しばらくお待ちください",IDC_STATIC,5,19,176,8, SS_CENTER END STRINGTABLE DISCARDABLE diff --git a/dlls/shdoclc/Pt.rc b/dlls/shdoclc/Pt.rc index 64379f433fe..d0bd1b74fa4 100644 --- a/dlls/shdoclc/Pt.rc +++ b/dlls/shdoclc/Pt.rc @@ -18,11 +18,13 @@ #include "shdoclc.h" -LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL +#pragma code_page(65001) + +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE STRINGTABLE DISCARDABLE { - IDS_MESSAGE_BOX_TITLE, "Wine Internet Explorer" + IDS_MESSAGE_BOX_TITLE, "Explorador de Internet Wine" } STRINGTABLE DISCARDABLE @@ -36,7 +38,7 @@ IDR_BROWSE_CONTEXT_MENU MENU POPUP "Default" { MENUITEM "&Retroceder", IDM_GOBACKWARD - MENUITEM "&Avançar", IDM_GOFORWARD + MENUITEM "&Avançar", IDM_GOFORWARD MENUITEM SEPARATOR MENUITEM "&Guardar fundo como...", IDM_SAVEBACKGROUND MENUITEM "&Definir como fundo", IDM_SETWALLPAPER @@ -48,9 +50,9 @@ IDR_BROWSE_CONTEXT_MENU MENU MENUITEM SEPARATOR MENUITEM "Criar &Atalho", IDM_CREATESHORTCUT MENUITEM "Adicionar aos &Favoritos", IDM_ADDFAVORITES - MENUITEM "&Ver Código Fonte", IDM_VIEWSOURCE + MENUITEM "&Ver Código Fonte", IDM_VIEWSOURCE MENUITEM SEPARATOR - MENUITEM "C&odificação", IDM_LANGUAGE + MENUITEM "C&odificação", IDM_LANGUAGE MENUITEM SEPARATOR MENUITEM "&Imprimir", IDM_PRINT MENUITEM "&Actualizar", _IDM_REFRESH @@ -61,10 +63,10 @@ IDR_BROWSE_CONTEXT_MENU MENU POPUP "Imagem" { - MENUITEM "&Abrir ligação", IDM_FOLLOWLINKC - MENUITEM "Abrir &ligação numa nova janela", IDM_FOLLOWLINKN - MENUITEM "&Guardar ligação como...", IDM_SAVETARGET - MENUITEM "&Imprimir ligação", IDM_PRINTTARGET + MENUITEM "&Abrir ligação", IDM_FOLLOWLINKC + MENUITEM "Abrir &ligação numa nova janela", IDM_FOLLOWLINKN + MENUITEM "&Guardar ligação como...", IDM_SAVETARGET + MENUITEM "&Imprimir ligação", IDM_PRINTTARGET MENUITEM SEPARATOR MENUITEM "&Mostrar imagem", IDM_SHOWPICTURE MENUITEM "G&uardar imagem como...", IDM_SAVEPICTURE @@ -102,14 +104,14 @@ IDR_BROWSE_CONTEXT_MENU MENU { POPUP "&Seleccionar" { - MENUITEM "&Célula", IDM_CELLSELECT + MENUITEM "&Célula", IDM_CELLSELECT MENUITEM "&Linha", IDM_ROWSELECT MENUITEM "C&oluna", IDM_COLUMNSELECT MENUITEM "&Tabela", IDM_TABLESELECT } MENUITEM SEPARATOR MENUITEM SEPARATOR - MENUITEM "&Propriedades da Célula", IDM_CELLPROPERTIES + MENUITEM "&Propriedades da Célula", IDM_CELLPROPERTIES MENUITEM "&Propriedades da Tabela", IDM_TABLEPROPERTIES } @@ -123,12 +125,12 @@ IDR_BROWSE_CONTEXT_MENU MENU MENUITEM SEPARATOR } - POPUP "Âncora" + POPUP "Âncora" { MENUITEM "&Abrir", IDM_FOLLOWLINKC MENUITEM "A&brir numa nova janela", IDM_FOLLOWLINKN - MENUITEM "&Guardar ligação como...", IDM_SAVETARGET - MENUITEM "&Imprimir ligação", IDM_PRINTTARGET + MENUITEM "&Guardar ligação como...", IDM_SAVETARGET + MENUITEM "&Imprimir ligação", IDM_PRINTTARGET MENUITEM SEPARATOR MENUITEM "&Cortar", IDM_CUT MENUITEM "C&opiar", IDM_COPY @@ -148,10 +150,10 @@ IDR_BROWSE_CONTEXT_MENU MENU POPUP "Imagem DYNSRC" { - MENUITEM "&Abrir ligação", IDM_FOLLOWLINKC - MENUITEM "A&brir ligação numa nova janela", IDM_FOLLOWLINKN - MENUITEM "&Guardar ligação como...", IDM_SAVETARGET - MENUITEM "&Imprimir ligação", IDM_PRINTTARGET + MENUITEM "&Abrir ligação", IDM_FOLLOWLINKC + MENUITEM "A&brir ligação numa nova janela", IDM_FOLLOWLINKN + MENUITEM "&Guardar ligação como...", IDM_SAVETARGET + MENUITEM "&Imprimir ligação", IDM_PRINTTARGET MENUITEM SEPARATOR MENUITEM "&Mostrar imagem", IDM_SHOWPICTURE MENUITEM "G&uardar video como...", IDM_SAVEPICTURE @@ -173,10 +175,10 @@ IDR_BROWSE_CONTEXT_MENU MENU POPUP "Imagem ART" { - MENUITEM "&Abrir ligação", IDM_FOLLOWLINKC - MENUITEM "A&brir ligação numa nova janela", IDM_FOLLOWLINKN - MENUITEM "&Guardar ligação como...", IDM_SAVETARGET - MENUITEM "&Imprimir ligação", IDM_PRINTTARGET + MENUITEM "&Abrir ligação", IDM_FOLLOWLINKC + MENUITEM "A&brir ligação numa nova janela", IDM_FOLLOWLINKN + MENUITEM "&Guardar ligação como...", IDM_SAVETARGET + MENUITEM "&Imprimir ligação", IDM_PRINTTARGET MENUITEM SEPARATOR MENUITEM "&Mostrar imagem", IDM_SHOWPICTURE MENUITEM "G&uardar video como...", IDM_SAVEPICTURE @@ -190,10 +192,9 @@ IDR_BROWSE_CONTEXT_MENU MENU MENUITEM SEPARATOR MENUITEM "Adicionar aos &Favoritos...", IDM_ADDFAVORITES MENUITEM SEPARATOR - MENUITEM SEPARATOR MENUITEM "I&niciar", IDM_DYNSRCPLAY MENUITEM "&Parar", IDM_DYNSRCSTOP - MENUITEM "&Recomeçar", IDM_IMGARTREWIND + MENUITEM "&Recomeçar", IDM_IMGARTREWIND MENUITEM SEPARATOR MENUITEM SEPARATOR MENUITEM "Propriedade&s", IDM_PROPERTIES @@ -226,8 +227,8 @@ IDR_BROWSE_CONTEXT_MENU MENU MENUITEM "Topo", IDM_SCROLL_TOP MENUITEM "Fundo", IDM_SCROLL_BOTTOM MENUITEM SEPARATOR - MENUITEM "Página Acima", IDM_SCROLL_PAGEUP - MENUITEM "Página abaixo", IDM_SCROLL_PAGEDOWN + MENUITEM "Página Acima", IDM_SCROLL_PAGEUP + MENUITEM "Página abaixo", IDM_SCROLL_PAGEDOWN MENUITEM SEPARATOR MENUITEM "Scroll Cima", IDM_SCROLL_UP MENUITEM "Scroll Baixo", IDM_SCROLL_DOWN @@ -240,8 +241,8 @@ IDR_BROWSE_CONTEXT_MENU MENU MENUITEM "Canto Esquerdo", IDM_SCROLL_LEFTEDGE MENUITEM "Canto Direito", IDM_SCROLL_RIGHTEDGE MENUITEM SEPARATOR - MENUITEM "Página esquerda", IDM_SCROLL_PAGELEFT - MENUITEM "Página direita", IDM_SCROLL_PAGERIGHT + MENUITEM "Página esquerda", IDM_SCROLL_PAGELEFT + MENUITEM "Página direita", IDM_SCROLL_PAGERIGHT MENUITEM SEPARATOR MENUITEM "Scroll Esquerda", IDM_SCROLL_LEFT MENUITEM "Scroll Direita", IDM_SCROLL_RIGHT diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index 433ed3a7cbd..2eb5934a101 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -251,7 +251,7 @@ 654 stdcall @(long long) shell32_654 # ReadCabinetState@8 660 stdcall -noname FileIconInit(long) - 680 stdcall -noname IsUserAnAdmin() + 680 stdcall IsUserAnAdmin() 704 stdcall -noname GUIDFromStringW(wstr ptr) diff --git a/dlls/shell32/shell32_De.rc b/dlls/shell32/shell32_De.rc index c5b7d01fdbf..75980ecc737 100644 --- a/dlls/shell32/shell32_De.rc +++ b/dlls/shell32/shell32_De.rc @@ -19,11 +19,13 @@ #include "shresdef.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL MENU_001 MENU DISCARDABLE BEGIN - MENUITEM "&Große Symbole", FCIDM_SHVIEW_BIGICON + MENUITEM "&Große Symbole", FCIDM_SHVIEW_BIGICON MENUITEM "&Kleine Symbole", FCIDM_SHVIEW_SMALLICON MENUITEM "&Liste", FCIDM_SHVIEW_LISTVIEW MENUITEM "&Details", FCIDM_SHVIEW_REPORTVIEW @@ -38,7 +40,7 @@ BEGIN BEGIN POPUP "&Ansicht" BEGIN - MENUITEM "&Große Symbole", FCIDM_SHVIEW_BIGICON + MENUITEM "&Große Symbole", FCIDM_SHVIEW_BIGICON MENUITEM "&Kleine Symbole", FCIDM_SHVIEW_SMALLICON MENUITEM "&Liste", FCIDM_SHVIEW_LISTVIEW MENUITEM "&Details", FCIDM_SHVIEW_REPORTVIEW @@ -48,7 +50,7 @@ BEGIN BEGIN MENUITEM "Nach &Name", 0x30 /* column 0 */ MENUITEM "Nach &Typ", 0x32 /* column 2 */ - MENUITEM "Nach &Größe", 0x31 /* ... */ + MENUITEM "Nach &Größe", 0x31 /* ... */ MENUITEM "Nach &Datum", 0x33 MENUITEM SEPARATOR MENUITEM "&Automatisch anordnen", FCIDM_SHVIEW_AUTOARRANGE @@ -57,13 +59,13 @@ BEGIN MENUITEM SEPARATOR MENUITEM "Aktualisieren", FCIDM_SHVIEW_REFRESH MENUITEM SEPARATOR - MENUITEM "Einfügen", FCIDM_SHVIEW_INSERT - MENUITEM "Einfügen als Verknüpfung", FCIDM_SHVIEW_INSERTLINK + MENUITEM "Einfügen", FCIDM_SHVIEW_INSERT + MENUITEM "Einfügen als Verknüpfung", FCIDM_SHVIEW_INSERTLINK MENUITEM SEPARATOR POPUP "Neu" BEGIN MENUITEM "Neues Ver&zeichnis", FCIDM_SHVIEW_NEWFOLDER - MENUITEM "Neue Ver&knüpfung", FCIDM_SHVIEW_NEWLINK + MENUITEM "Neue Ver&knüpfung", FCIDM_SHVIEW_NEWLINK MENUITEM SEPARATOR END MENUITEM SEPARATOR @@ -78,15 +80,15 @@ MENU_SHV_FILE MENU DISCARDABLE BEGIN POPUP "" BEGIN - MENUITEM "Aus&wählen" FCIDM_SHVIEW_OPEN + MENUITEM "Aus&wählen" FCIDM_SHVIEW_OPEN MENUITEM "E&rkunden", FCIDM_SHVIEW_EXPLORE - MENUITEM "&Öffnen" FCIDM_SHVIEW_OPEN + MENUITEM "&Öffnen" FCIDM_SHVIEW_OPEN MENUITEM SEPARATOR MENUITEM "&Ausschneiden", FCIDM_SHVIEW_CUT MENUITEM "&Kopieren", FCIDM_SHVIEW_COPY MENUITEM SEPARATOR - MENUITEM "&Verknüpfung erzeugen", FCIDM_SHVIEW_CREATELINK - MENUITEM "&Löschen", FCIDM_SHVIEW_DELETE + MENUITEM "&Verknüpfung erzeugen", FCIDM_SHVIEW_CREATELINK + MENUITEM "&Löschen", FCIDM_SHVIEW_DELETE MENUITEM "&Umbenennen", FCIDM_SHVIEW_RENAME MENUITEM SEPARATOR MENUITEM "&Eigenschaften", FCIDM_SHVIEW_PROPERTIES @@ -95,29 +97,29 @@ END MENU_CPANEL MENU BEGIN - POPUP "&File" + POPUP "&Datei" BEGIN MENUITEM SEPARATOR - MENUITEM "E&xit", IDM_CPANEL_EXIT + MENUITEM "&Beenden", IDM_CPANEL_EXIT END - POPUP "&View" + POPUP "&Ansicht" BEGIN - MENUITEM "&Große Symbole", FCIDM_SHVIEW_BIGICON + MENUITEM "&Große Symbole", FCIDM_SHVIEW_BIGICON MENUITEM "&Kleine Symbole", FCIDM_SHVIEW_SMALLICON MENUITEM "&Liste", FCIDM_SHVIEW_LISTVIEW MENUITEM "&Details", FCIDM_SHVIEW_REPORTVIEW END - POPUP "&Help" + POPUP "&Hilfe" BEGIN - MENUITEM "&About Control Panel...", IDM_CPANEL_ABOUT + MENUITEM "&Über Systemsteuerung...", IDM_CPANEL_ABOUT END END SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192 STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK -CAPTION "Verzeichnis auswählen" +CAPTION "Verzeichnis auswählen" FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP @@ -132,7 +134,7 @@ FONT 8, "MS Shell Dlg" SHNEWBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 218, 196 STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK -CAPTION "Verzeichnis auswählen" +CAPTION "Verzeichnis auswählen" FONT 8, "MS Shell Dlg" { LTEXT "", IDD_TITLE, 10, 8, 198, 24 @@ -163,7 +165,7 @@ FONT 8, "MS Shell Dlg" SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Informationen über %s" +CAPTION "Informationen über %s" FONT 10, "MS Shell Dlg" { DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP @@ -173,7 +175,7 @@ FONT 10, "MS Shell Dlg" LTEXT "", IDC_ABOUT_STATIC_TEXT1, 40, 10, 137, 10 LTEXT "", IDC_ABOUT_STATIC_TEXT2, 40, 22, 137, 10 LTEXT "Wine Version %s", IDC_ABOUT_STATIC_TEXT3, 40, 34, 170, 10 - LTEXT "Wine wurde für Sie gekeltert von:", IDC_ABOUT_WINE_TEXT, 8, 55, 137, 10 + LTEXT "Wine wurde für Sie gekeltert von:", IDC_ABOUT_WINE_TEXT, 8, 55, 137, 10 } SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95 @@ -182,8 +184,8 @@ CAPTION "" FONT 8, "MS Shell Dlg" { ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE - LTEXT "Geben sie den Namen eines Programmes, eines Ordners, eines Dokumentes oder einer Internet-Ressource ein, die geöffnet werden soll", 12289, 36, 11, 182, 18 - LTEXT "Ö&ffnen:", 12305, 7, 39, 24, 10 + LTEXT "Geben sie den Namen eines Programmes, eines Ordners, eines Dokumentes oder einer Internet-Ressource ein, die geöffnet werden soll", 12289, 36, 11, 182, 18 + LTEXT "Ö&ffnen:", 12305, 7, 39, 24, 10 CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100 DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP PUSHBUTTON "Abbrechen", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP @@ -194,70 +196,70 @@ STRINGTABLE { /* columns in the shellview */ IDS_SHV_COLUMN1 "Datei" - IDS_SHV_COLUMN2 "Größe" + IDS_SHV_COLUMN2 "Größe" IDS_SHV_COLUMN3 "Typ" - IDS_SHV_COLUMN4 "Geändert" + IDS_SHV_COLUMN4 "Geändert" IDS_SHV_COLUMN5 "Attribute" - IDS_SHV_COLUMN6 "Gesamtgröße" + IDS_SHV_COLUMN6 "Gesamtgröße" IDS_SHV_COLUMN7 "Freier Speicher" IDS_SHV_COLUMN8 "Name" IDS_SHV_COLUMN9 "Kommentar" IDS_SHV_COLUMN10 "Besitzer" IDS_SHV_COLUMN11 "Gruppe" IDS_SHV_COLUMN_DELFROM "Ursprung" - IDS_SHV_COLUMN_DELDATE "Gelöscht am" + IDS_SHV_COLUMN_DELDATE "Gelöscht am" /* special folders */ IDS_DESKTOP "Desktop" IDS_MYCOMPUTER "Arbeitsplatz" IDS_RECYCLEBIN_FOLDER_NAME "Papierkorb" - IDS_CONTROLPANEL "Control Panel" + IDS_CONTROLPANEL "Systemsteuerung" /* context menus */ - IDS_VIEW_LARGE "&Große Symbole" + IDS_VIEW_LARGE "&Große Symbole" IDS_VIEW_SMALL "&Kleine Symbole" IDS_VIEW_LIST "&Liste" IDS_VIEW_DETAILS "&Details" - IDS_SELECT "Auswählen" - IDS_OPEN "Öffnen" + IDS_SELECT "Auswählen" + IDS_OPEN "Öffnen" IDS_CREATEFOLDER_DENIED "Es konnte kein neues Verzeichnis erstellt werden: Zugriff verweigert." IDS_CREATEFOLDER_CAPTION "Es trat ein Fehler beim Erstellen eines neuen Verzeichnisses auf" - IDS_DELETEITEM_CAPTION "Bestätigung: Objekt löschen" - IDS_DELETEFOLDER_CAPTION "Bestätigung: Verzeichnis löschen" - IDS_DELETEITEM_TEXT "Sind Sie sich sicher, dass Sie '%1' löschen möchten?" - IDS_DELETEMULTIPLE_TEXT "Sind Sie sich sicher, dass Sie diese %1 Objekte löschen möchten?" - IDS_DELETESELECTED_TEXT "Sind Sie sich sicher, dass Sie die ausgewählten Objekte löschen möchten?" - IDS_TRASHITEM_TEXT "Sind Sie sich sicher, dass Sie '%1' in den Papierkorb verschieben möchten?" - IDS_TRASHFOLDER_TEXT "Sind Sie sich sicher, dass Sie '%1' und seinen Inhalt in den Papierkorb verschieben möchten?" - IDS_TRASHMULTIPLE_TEXT "Sind Sie sich sicher, dass Sie diese %1 Dateien in den Papierkorb verschieben möchten?" - IDS_CANTTRASH_TEXT "Das Objekt '%1' kann nicht in den Papierkorb verschoben werden.\n\n Möchten Sie es stattdessen löschen?" - IDS_OVERWRITEFILE_TEXT "Der Ordner enthält bereits eine Datei namens '%1'.\n\n Wollen Sie die Datei ersetzen?" - IDS_OVERWRITEFILE_CAPTION "Bestätigung: Datei überschreiben" + IDS_DELETEITEM_CAPTION "Bestätigung: Objekt löschen" + IDS_DELETEFOLDER_CAPTION "Bestätigung: Verzeichnis löschen" + IDS_DELETEITEM_TEXT "Sind Sie sich sicher, dass Sie '%1' löschen möchten?" + IDS_DELETEMULTIPLE_TEXT "Sind Sie sich sicher, dass Sie diese %1 Objekte löschen möchten?" + IDS_DELETESELECTED_TEXT "Sind Sie sich sicher, dass Sie die ausgewählten Objekte löschen möchten?" + IDS_TRASHITEM_TEXT "Sind Sie sich sicher, dass Sie '%1' in den Papierkorb verschieben möchten?" + IDS_TRASHFOLDER_TEXT "Sind Sie sich sicher, dass Sie '%1' und seinen Inhalt in den Papierkorb verschieben möchten?" + IDS_TRASHMULTIPLE_TEXT "Sind Sie sich sicher, dass Sie diese %1 Dateien in den Papierkorb verschieben möchten?" + IDS_CANTTRASH_TEXT "Das Objekt '%1' kann nicht in den Papierkorb verschoben werden.\n\n Möchten Sie es stattdessen löschen?" + IDS_OVERWRITEFILE_TEXT "Der Ordner enthält bereits eine Datei namens '%1'.\n\n Wollen Sie die Datei ersetzen?" + IDS_OVERWRITEFILE_CAPTION "Bestätigung: Datei überschreiben" IDS_OVERWRITEFOLDER_TEXT "Im Verzeichnis befindet sich bereits ein Ordner namens '%1'.\n\n"\ - "Wenn die Dateien im Zielordner die gleichen Namen haben, wie die im ausgewählten Ordner, werden sie ersetzt.\n\n\ - Möchten sie trotzdem fortfahren?" + "Wenn die Dateien im Zielordner die gleichen Namen haben, wie die im ausgewählten Ordner, werden sie ersetzt.\n\n\ + Möchten sie trotzdem fortfahren?" /* message box strings */ IDS_RESTART_TITLE "Neustarten" - IDS_RESTART_PROMPT "Möchten Sie, dass ein simulierter Windows Neustart durchgeführt wird?" + IDS_RESTART_PROMPT "Möchten Sie, dass ein simulierter Windows Neustart durchgeführt wird?" IDS_SHUTDOWN_TITLE "Beenden" - IDS_SHUTDOWN_PROMPT "Möchten Sie die aktuelle Wine Sitzung beenden?" + IDS_SHUTDOWN_PROMPT "Möchten Sie die aktuelle Wine Sitzung beenden?" /* Run File dialog */ - IDS_RUNDLG_ERROR "Konnte Ausführen-Dialog nicht anzeigen (interner Fehler)" + IDS_RUNDLG_ERROR "Konnte Ausführen-Dialog nicht anzeigen (interner Fehler)" IDS_RUNDLG_BROWSE_ERROR "Konnte Durchsuchen-Dialog nicht anzeigen (interner Fehler)" IDS_RUNDLG_BROWSE_CAPTION "Durchsuchen" IDS_RUNDLG_BROWSE_FILTER "Programme\0*.exe\0Alle Dateien\0*.*\0\0" /* shell folder path default values */ - IDS_PROGRAMS "Startmenü\\Programme" + IDS_PROGRAMS "Startmenü\\Programme" IDS_PERSONAL "Eigene Dateien" IDS_FAVORITES "Favoriten" - IDS_STARTUP "Startmenü\\Programme\\Autostart" + IDS_STARTUP "Startmenü\\Programme\\Autostart" IDS_RECENT "Recent" IDS_SENDTO "SendTo" - IDS_STARTMENU "Startmenü" + IDS_STARTMENU "Startmenü" IDS_MYMUSIC "Eigene Musik" IDS_MYVIDEO "Eigene Videos" IDS_DESKTOPDIRECTORY "Desktop" @@ -273,7 +275,7 @@ STRINGTABLE IDS_MYPICTURES "Eigene Bilder" IDS_PROGRAM_FILES_COMMON "Programme\\Gemeinsame Dateien" IDS_COMMON_DOCUMENTS "Dokumente" - IDS_ADMINTOOLS "Startmenü\\Programme\\Verwaltung" + IDS_ADMINTOOLS "Startmenü\\Programme\\Verwaltung" IDS_COMMON_MUSIC "Dokumente\\Eigene Musik" IDS_COMMON_PICTURES "Dokumente\\Eigene Bilder" IDS_COMMON_VIDEO "Dokumente\\Eigene Videos" @@ -281,26 +283,26 @@ STRINGTABLE IDS_NEWFOLDER "Neuer Ordner" - IDS_CPANEL_TITLE "Wine Control Panel" + IDS_CPANEL_TITLE "Wine Systemsteuerung" IDS_CPANEL_NAME "Name" - IDS_CPANEL_DESCRIPTION "Description" - IDS_SHLEXEC_NOASSOC "Es ist kein Programm mit diesem Dateityp verknüpft." + IDS_CPANEL_DESCRIPTION "Beschreibung" + IDS_SHLEXEC_NOASSOC "Es ist kein Programm mit diesem Dateityp verknüpft." } STRINGTABLE { -IDS_LICENSE_CAPTION, "Wine License" +IDS_LICENSE_CAPTION, "Wine Lizenz" IDS_LICENSE, -"Wine ist freie Software; Sie dürfen sie unter den Bedingungen \ +"Wine ist freie Software; Sie dürfen sie unter den Bedingungen \ der GNU Lesser General Public License, welche von der \ -Free Software Foundation veröffentlicht wurde; weiter verteilen \ -und/oder modifizieren gemäß Version 2.1 der Lizenz, oder \ -(nach ihren Ermessen) jeder späteren Version.\n\n\ -Wine wird mit der Hoffnung verteilt das es sich als nützlich erweist. \ +Free Software Foundation veröffentlicht wurde; weiter verteilen \ +und/oder modifizieren gemäß Version 2.1 der Lizenz, oder \ +(nach ihren Ermessen) jeder späteren Version.\n\n\ +Wine wird mit der Hoffnung verteilt das es sich als nützlich erweist. \ Wine kommt aber OHNE JEGLICHE GARANTIE daher; sogar ohne einer \ -angedeuteten Garantie der MARKTGÄNGIGKEIT oder der EIGNUNG FÜR EINEN \ +angedeuteten Garantie der MARKTGÄNGIGKEIT oder der EIGNUNG FÜR EINEN \ BESTIMMTEN NUTZEN. Sehen Sie sich die GNU Lesser General Public License \ -an für mehr Details.\n\n\ +an für mehr Details.\n\n\ Sie sollten mit dieser Bibliothek auch eine Kopie der \ GNU Lesser General Public License erhalten haben; wenn nicht schreiben \ Sie der Free Software Foundation, \ diff --git a/dlls/shell32/shell32_Nl.rc b/dlls/shell32/shell32_Nl.rc index 33a65bcf4ac..e3038a16c4c 100644 --- a/dlls/shell32/shell32_Nl.rc +++ b/dlls/shell32/shell32_Nl.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL MENU_001 MENU DISCARDABLE BEGIN - MENUITEM "&Grote Icons", FCIDM_SHVIEW_BIGICON - MENUITEM "&Kleine Icons", FCIDM_SHVIEW_SMALLICON + MENUITEM "&Grote Pictogrammen", FCIDM_SHVIEW_BIGICON + MENUITEM "&Kleine Pictogrammen", FCIDM_SHVIEW_SMALLICON MENUITEM "&Lijst", FCIDM_SHVIEW_LISTVIEW MENUITEM "&Details", FCIDM_SHVIEW_REPORTVIEW END @@ -40,13 +40,13 @@ BEGIN BEGIN POPUP "&Bekijken" BEGIN - MENUITEM "&Grote Icons", FCIDM_SHVIEW_BIGICON - MENUITEM "&Kleine Icons", FCIDM_SHVIEW_SMALLICON + MENUITEM "&Grote Pictogrammen", FCIDM_SHVIEW_BIGICON + MENUITEM "&Kleine Pictogrammen", FCIDM_SHVIEW_SMALLICON MENUITEM "&Lijst", FCIDM_SHVIEW_LISTVIEW MENUITEM "&Details", FCIDM_SHVIEW_REPORTVIEW END MENUITEM SEPARATOR - POPUP "Sorteren &Icons" + POPUP "P&ictogrammen Sorteren" BEGIN MENUITEM "Op &Naam", 0x30 /* column 0 */ MENUITEM "Op &Type", 0x32 /* column 2 */ @@ -55,17 +55,17 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Automatisch", FCIDM_SHVIEW_AUTOARRANGE END - MENUITEM "Uitlijnen Icons", FCIDM_SHVIEW_SNAPTOGRID + MENUITEM "Pictogrammen Uitlijnen", FCIDM_SHVIEW_SNAPTOGRID MENUITEM SEPARATOR MENUITEM "Vernieuwen", FCIDM_SHVIEW_REFRESH MENUITEM SEPARATOR MENUITEM "Plakken", FCIDM_SHVIEW_INSERT - MENUITEM "Plakken als Link", FCIDM_SHVIEW_INSERTLINK + MENUITEM "Plakken als Snelkoppeling", FCIDM_SHVIEW_INSERTLINK MENUITEM SEPARATOR POPUP "Nieuw" BEGIN MENUITEM "Nieuwe &Map", FCIDM_SHVIEW_NEWFOLDER - MENUITEM "Nieuwe &Link", FCIDM_SHVIEW_NEWLINK + MENUITEM "Nieuwe Sne&lkoppeling", FCIDM_SHVIEW_NEWLINK MENUITEM SEPARATOR END MENUITEM SEPARATOR @@ -81,15 +81,15 @@ MENU_SHV_FILE MENU DISCARDABLE BEGIN POPUP "" BEGIN - MENUITEM "&Selecteer" FCIDM_SHVIEW_OPEN + MENUITEM "&Selecteren" FCIDM_SHVIEW_OPEN MENUITEM "&Verkennen", FCIDM_SHVIEW_EXPLORE - MENUITEM "&Open", FCIDM_SHVIEW_OPEN + MENUITEM "&Openen", FCIDM_SHVIEW_OPEN MENUITEM SEPARATOR MENUITEM "K&nippen", FCIDM_SHVIEW_CUT - MENUITEM "&Kopieren", FCIDM_SHVIEW_COPY + MENUITEM "&Kopiëren", FCIDM_SHVIEW_COPY MENUITEM SEPARATOR - MENUITEM "Creëer &Link", FCIDM_SHVIEW_CREATELINK - MENUITEM "Ver&wijder", FCIDM_SHVIEW_DELETE + MENUITEM "Maak Sne&lkoppeling", FCIDM_SHVIEW_CREATELINK + MENUITEM "Ver&wijderen", FCIDM_SHVIEW_DELETE MENUITEM "&Hernoemen", FCIDM_SHVIEW_RENAME MENUITEM SEPARATOR MENUITEM "&Eigenschappen", FCIDM_SHVIEW_PROPERTIES @@ -106,15 +106,15 @@ BEGIN POPUP "B&eeld" BEGIN - MENUITEM "&Grote Icons", FCIDM_SHVIEW_BIGICON - MENUITEM "&Kleine Icons", FCIDM_SHVIEW_SMALLICON + MENUITEM "&Grote Pictogrammen", FCIDM_SHVIEW_BIGICON + MENUITEM "&Kleine Pictogrammen", FCIDM_SHVIEW_SMALLICON MENUITEM "&Lijst", FCIDM_SHVIEW_LISTVIEW MENUITEM "&Details", FCIDM_SHVIEW_REPORTVIEW END POPUP "&Help" BEGIN - MENUITEM "&Over Controle Paneel...", IDM_CPANEL_ABOUT + MENUITEM "&Over Configuratiescherm", IDM_CPANEL_ABOUT END END @@ -214,32 +214,32 @@ STRINGTABLE IDS_DESKTOP "Bureaublad" IDS_MYCOMPUTER "Mijn Computer" IDS_RECYCLEBIN_FOLDER_NAME "Vuilnisbak" - IDS_CONTROLPANEL "Controle Paneel" + IDS_CONTROLPANEL "Configuratiescherm" /* context menus */ - IDS_VIEW_LARGE "Grote Icons" - IDS_VIEW_SMALL "&Kleine Icons" + IDS_VIEW_LARGE "Grote Pictogrammen" + IDS_VIEW_SMALL "&Kleine Pictogrammen" IDS_VIEW_LIST "&Lijst" IDS_VIEW_DETAILS "&Details" - IDS_SELECT "Selecteer" - IDS_OPEN "Open" + IDS_SELECT "Selecteren" + IDS_OPEN "Openen" - IDS_CREATEFOLDER_DENIED "Niet mogelijk om nieuwe map te maken: Permissie afgewezen." - IDS_CREATEFOLDER_CAPTION "Fout tijdens creatie van een nieuwe map" - IDS_DELETEITEM_CAPTION "Bevestig bestand verwijdering" - IDS_DELETEFOLDER_CAPTION "Bevestig map verwijdering" + IDS_CREATEFOLDER_DENIED "Niet mogelijk om nieuwe map te maken: Geen permissies." + IDS_CREATEFOLDER_CAPTION "Fout tijdens het maken van een nieuwe map" + IDS_DELETEITEM_CAPTION "Bevestig bestandsverwijdering" + IDS_DELETEFOLDER_CAPTION "Bevestig mapverwijdering" IDS_DELETEITEM_TEXT "Weet u zeker dat u '%1' wilt verwijderen?" IDS_DELETEMULTIPLE_TEXT "Weet u zeker dat u deze %1 bestanden wilt verwijderen?" IDS_DELETESELECTED_TEXT "Weet u zeker dat u de geselecteerde bestand(en) wilt verwijderen?" - IDS_TRASHITEM_TEXT "Weet u zeker dat u '%1' naar de Vuilnisbak wilt sturen?" - IDS_TRASHFOLDER_TEXT "Weet u zeker dat u '%1' en zijn gehele inhoud naar de Vuilnisbak wilt sturen?" - IDS_TRASHMULTIPLE_TEXT "Weet u zeker dat u deze %1 bestanden naar de Vuilnisbak wilt sturen?" - IDS_CANTTRASH_TEXT "Bestand '%1' kan niet naar de Vuilnisbak worden gestuurd. Wilt u het dan maar verwijderen?" + IDS_TRASHITEM_TEXT "Weet u zeker dat u '%1' naar de Vuilnisbak wilt verplaatsen?" + IDS_TRASHFOLDER_TEXT "Weet u zeker dat u '%1' en zijn gehele inhoud naar de Vuilnisbak wilt verplaatsen?" + IDS_TRASHMULTIPLE_TEXT "Weet u zeker dat u deze %1 bestanden naar de Vuilnisbak wilt verplaatsen?" + IDS_CANTTRASH_TEXT "Bestand '%1' kan niet naar de Vuilnisbak worden verplaatst. Wilt u het bestand permanent verwijderen?" IDS_OVERWRITEFILE_TEXT "Deze map bevat reeds een bestand genaamd '%1'.\n\nWilt u het vervangen?" - IDS_OVERWRITEFILE_CAPTION "Bevestig het overschrijven van het bestand" + IDS_OVERWRITEFILE_CAPTION "Bevestig bestandsoverschrijving" IDS_OVERWRITEFOLDER_TEXT "Deze map bevat reeds een map genaamd '%1'.\n\n"\ - "Als de bestanden in de doel map dezelfde naam hebben als de bestanden in de\n"\ - "geselecteerde map worden ze overschreven. Wilt u nog steeds de map copieren\n"\ + "Als de bestanden in de doelmap dezelfde naam hebben als de bestanden in de\n"\ + "geselecteerde map zullen ze worden overschreven. Wilt u alsnog de map kopiëren\n"\ "of verplaatsen?" /* message box strings */ @@ -249,47 +249,47 @@ STRINGTABLE IDS_SHUTDOWN_PROMPT "Wilt u uw Wine sessie afsluiten?" /* Run File dialog */ - IDS_RUNDLG_ERROR "Fout tijdens tonen Uitvoeren Bestand venster (interne fout)" - IDS_RUNDLG_BROWSE_ERROR "Fout tijdens tonen Bladeren venster (interne fout)" + IDS_RUNDLG_ERROR "Fout tijdens tonen venster 'Uitvoeren Bestand' (interne fout)" + IDS_RUNDLG_BROWSE_ERROR "Fout tijdens tonen van Bladeren venster (interne fout)" IDS_RUNDLG_BROWSE_CAPTION "Bladeren" IDS_RUNDLG_BROWSE_FILTER "Uitvoerbare bestanden\0*.exe\0Alle bestanden\0*.*\0\0" /* shell folder path default values */ - IDS_PROGRAMS "Start Menu\\Programmas" + IDS_PROGRAMS "Start Menu\\Programma's" IDS_PERSONAL "Mijn Documenten" IDS_FAVORITES "Favorieten" - IDS_STARTUP "Start Menu\\Programmas\\StartUp" + IDS_STARTUP "Start Menu\\Programma's\\Opstarten" IDS_RECENT "Recent" - IDS_SENDTO "Stuur Naar" + IDS_SENDTO "SendTo" IDS_STARTMENU "Start Menu" IDS_MYMUSIC "Mijn Muziek" - IDS_MYVIDEO "Mijn Videos" + IDS_MYVIDEO "Mijn Video's" IDS_DESKTOPDIRECTORY "Bureaublad" IDS_NETHOOD "Netwerkomgeving" IDS_TEMPLATES "Sjablonen" - IDS_APPDATA "Applicatie Data" + IDS_APPDATA "Application Data" IDS_PRINTHOOD "Printeromgeving" - IDS_LOCAL_APPDATA "Lokale Instellingen\\Applicatie Data" - IDS_INTERNET_CACHE "Lokale Instellingen\\Tijdelijke Internet Bestanden" - IDS_COOKIES "Koekies" - IDS_HISTORY "Lokale Instellingen\\Geschiedenis" - IDS_PROGRAM_FILES "Programma Bestanden" + IDS_LOCAL_APPDATA "Local Settings\\Application Data" + IDS_INTERNET_CACHE "Local Settings\\Tijdelijke Internetbestanden" + IDS_COOKIES "Cookies" + IDS_HISTORY "Local Settings\\Geschiedenis" + IDS_PROGRAM_FILES "Program Files" IDS_MYPICTURES "Mijn Afbeeldingen" - IDS_PROGRAM_FILES_COMMON "Programma Bestanden\\Gemeenschappelijke Bestanden" + IDS_PROGRAM_FILES_COMMON "Program Files\\Common Files" IDS_COMMON_DOCUMENTS "Documenten" IDS_ADMINTOOLS "Start Menu\\Programmas\\Administratieve Tools" IDS_COMMON_MUSIC "Documenten\\Mijn Muziek" IDS_COMMON_PICTURES "Documenten\\Mijn Afbeeldingen" IDS_COMMON_VIDEO "Documenten\\Mijn Videos" - IDS_CDBURN_AREA "Lokale Instellingen\\Applicatie Data\\Microsoft\\CD Branden" + IDS_CDBURN_AREA "Local Settings\\Applicatie Data\\Microsoft\\CD Branden" IDS_NEWFOLDER "Nieuwe Map" - IDS_CPANEL_TITLE "Wine Controle Paneel" + IDS_CPANEL_TITLE "Wine Configuratiescherm" IDS_CPANEL_NAME "Naam" IDS_CPANEL_DESCRIPTION "Beschrijving" - IDS_SHLEXEC_NOASSOC "Er is geen Windows programma geconfigureerd om dit soort bestanden te openen." + IDS_SHLEXEC_NOASSOC "Er is geen Windows-programma geconfigureerd om dit soort bestanden te openen." } STRINGTABLE diff --git a/dlls/shlwapi/shlwapi_De.rc b/dlls/shlwapi/shlwapi_De.rc index f0de1931c35..f74600fdf06 100644 --- a/dlls/shlwapi/shlwapi_De.rc +++ b/dlls/shlwapi/shlwapi_De.rc @@ -20,6 +20,8 @@ #include "resource.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 diff --git a/dlls/t2embed/main.c b/dlls/t2embed/main.c index 89622485bd0..c9c5dc53551 100644 --- a/dlls/t2embed/main.c +++ b/dlls/t2embed/main.c @@ -24,6 +24,10 @@ #include "windef.h" #include "winbase.h" +#include "t2embapi.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(t2embed); BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { @@ -41,3 +45,17 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } + +LONG WINAPI TTLoadEmbeddedFont(HANDLE *phFontReference, ULONG ulFlags, + ULONG *pulPrivStatus, ULONG ulPrivs, + ULONG *pulStatus, READEMBEDPROC lpfnReadFromStream, + LPVOID lpvReadStream, LPWSTR szWinFamilyName, + LPSTR szMacFamilyName, TTLOADINFO *pTTLoadInfo) +{ + FIXME("(%p 0x%08x %p 0x%08x %p %p %p %s %s %p) stub\n", phFontReference, + ulFlags, pulPrivStatus, ulPrivs, pulStatus, lpfnReadFromStream, + lpvReadStream, debugstr_w(szWinFamilyName), szMacFamilyName, + pTTLoadInfo); + + return E_API_NOTIMPL; +} diff --git a/dlls/t2embed/t2embed.spec b/dlls/t2embed/t2embed.spec index ed0c71f88ef..ed5d25b6698 100644 --- a/dlls/t2embed/t2embed.spec +++ b/dlls/t2embed/t2embed.spec @@ -7,7 +7,7 @@ @ stub TTGetEmbeddingType @ stub TTIsEmbeddingEnabled @ stub TTIsEmbeddingEnabledForFacename -@ stub TTLoadEmbeddedFont +@ stdcall TTLoadEmbeddedFont(ptr long ptr long ptr ptr ptr wstr str ptr) @ stub TTRunValidationTests @ stub _TTCharToUnicode@24 @ stub _TTDeleteEmbeddedFont@12 diff --git a/dlls/user32/resources/user32_De.rc b/dlls/user32/resources/user32_De.rc index 344c5160eee..edb7c30f1b1 100644 --- a/dlls/user32/resources/user32_De.rc +++ b/dlls/user32/resources/user32_De.rc @@ -19,31 +19,33 @@ #include "resources.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE { MENUITEM "&Wiederherstellen", 61728 MENUITEM "&Verschieben", 61456 - MENUITEM "&Größe", 61440 + MENUITEM "&Größe", 61440 MENUITEM "Mi&nimieren", 61472 MENUITEM "Ma&ximieren", 61488 MENUITEM SEPARATOR - MENUITEM "&Schließen\tAlt-F4", 61536 + MENUITEM "&Schließen\tAlt-F4", 61536 MENUITEM SEPARATOR - MENUITEM "&Über Wine...", 61761 + MENUITEM "&Über Wine...", 61761 } EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE { POPUP "" BEGIN - MENUITEM "&Rückgängig", EM_UNDO + MENUITEM "&Rückgängig", EM_UNDO MENUITEM SEPARATOR MENUITEM "&Ausschneiden", WM_CUT MENUITEM "&Kopieren", WM_COPY - MENUITEM "&Einfügen", WM_PASTE - MENUITEM "&Löschen", WM_CLEAR + MENUITEM "&Einfügen", WM_PASTE + MENUITEM "&Löschen", WM_CLEAR MENUITEM SEPARATOR MENUITEM "&Alles markieren", EM_SETSEL END @@ -54,21 +56,21 @@ STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYS BEGIN ICON "", 1088, 8, 20, 16, 16, WS_CHILD | WS_VISIBLE LTEXT "", 100, 32, 4, 176, 48, WS_CHILD | WS_VISIBLE | WS_GROUP | SS_NOPREFIX - PUSHBUTTON "&OK", 1, 16, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&Abbrechen", 2, 64, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "Abbr&uch", 3, 112, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&Wiederholen", 4, 160, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&Ignorieren", 5, 208, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&Ja", 6, 256, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&Nein", 7, 304, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&Try Again", 10, 352, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&Continue", 11, 400, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "Help", 9, 448, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&OK", 1, 16, 56, 60, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Abbrechen", 2, 84, 56, 60, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Abbr&uch", 3, 152, 56, 60, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Wiederholen", 4, 220, 56, 60, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Ignorieren", 5, 288, 56, 60, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Ja", 6, 356, 56, 60, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Nein", 7, 424, 56, 60, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Erneut versuchen", 10, 492, 56, 60, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Fortsetzen", 11, 560, 56, 60, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Hilfe", 9, 628, 56, 60, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP END MDI_MOREWINDOWS DIALOG FIXED IMPURE 20, 20, 232, 122 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Fenster auswählen" +CAPTION "Fenster auswählen" FONT 8, "MS Shell Dlg" BEGIN LISTBOX MDI_IDC_LISTBOX, 5, 7, 222, 90, WS_VSCROLL | WS_HSCROLL /* defined in mdi.h */ diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c index 0948f69b0e7..868fd9aa802 100644 --- a/dlls/user32/tests/menu.c +++ b/dlls/user32/tests/menu.c @@ -2932,6 +2932,63 @@ static void test_menu_cancelmode(void) DestroyWindow( hwnd); } +/* show menu trees have a maximum depth */ +static void test_menu_maxdepth(void) +{ +#define NR_MENUS 100 + HMENU hmenus[ NR_MENUS]; + int i; + DWORD ret; + + for( i = 0; i < NR_MENUS; i++) { + hmenus[i] = CreatePopupMenu(); + if( !hmenus[i]) break; + } + ok( i == NR_MENUS, "could not create more then %d menu's\n", i); + for( i = 1; i < NR_MENUS; i++) { + ret = AppendMenuA( hmenus[i], MF_POPUP, (UINT_PTR)hmenus[i-1],"test"); + if( !ret) break; + } + trace("Maximum depth is %d\n", i); +todo_wine + ok( i < NR_MENUS || + broken( i == NR_MENUS), /* win98, NT */ + "no ( or very large) limit on menu depth!\n"); + + for( i = 0; i < NR_MENUS; i++) + DestroyMenu( hmenus[i]); +} + +/* bug #12171 */ +static void test_menu_circref(void) +{ + HMENU menu1, menu2; + DWORD ret; + + menu1 = CreatePopupMenu(); + menu2 = CreatePopupMenu(); + ok( menu1 && menu2, "error creating menus.\n"); + ret = AppendMenuA( menu1, MF_POPUP, (UINT_PTR)menu2, "winetest"); + ok( ret, "AppendMenu failed, error is %d\n", GetLastError()); + ret = AppendMenuA( menu1, MF_STRING | MF_HILITE, 123, "winetest"); + ok( ret, "AppendMenu failed, error is %d\n", GetLastError()); + /* app chooses an id that happens to clash with its own hmenu */ + ret = AppendMenuA( menu2, MF_STRING, (UINT_PTR)menu2, "winetest"); + ok( ret, "AppendMenu failed, error is %d\n", GetLastError()); + /* now attempt to change the string of the first item of menu1 */ + ret = ModifyMenuA( menu1, (UINT_PTR)menu2, MF_POPUP, (UINT_PTR)menu2, "menu 2"); +todo_wine + ok( !ret || + broken( 0), /* win98, NT */ + "ModifyMenu should have failed.\n"); + if( !ret) { /* will probably stack fault if the ModifyMenu succeeded */ + ret = GetMenuState( menu1, 123, 0); + ok( ret == MF_HILITE, "GetMenuState returned %x\n",ret); + } + DestroyMenu( menu2); + DestroyMenu( menu1); +} + START_TEST(menu) { init_function_pointers(); @@ -2970,4 +3027,6 @@ START_TEST(menu) test_menu_hilitemenuitem(); test_menu_trackpopupmenu(); test_menu_cancelmode(); + test_menu_maxdepth(); + test_menu_circref(); } diff --git a/dlls/uuid/uuid.c b/dlls/uuid/uuid.c index 18b4d557ebd..afb9abde8ce 100644 --- a/dlls/uuid/uuid.c +++ b/dlls/uuid/uuid.c @@ -76,6 +76,11 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); #include "isguids.h" #include "objsafe.h" #include "perhist.h" +#include "netcon.h" +#include "netfw.h" +#include "msctf.h" +#include "sensevts.h" +#include "ocmm.h" /* FIXME: cguids declares GUIDs but does not define their values */ diff --git a/dlls/wbemprox/Makefile.in b/dlls/wbemprox/Makefile.in index 58aad374f8e..0e3b9dc73a6 100644 --- a/dlls/wbemprox/Makefile.in +++ b/dlls/wbemprox/Makefile.in @@ -3,10 +3,12 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = wbemprox.dll -IMPORTS = kernel32 +IMPORTS = ole32 advapi32 kernel32 C_SRCS = \ - main.c + main.c \ + regsvr.c \ + wbemlocator.c @MAKE_DLL_RULES@ diff --git a/dlls/wbemprox/main.c b/dlls/wbemprox/main.c index 89812b2ea78..c22f57f8a2b 100644 --- a/dlls/wbemprox/main.c +++ b/dlls/wbemprox/main.c @@ -21,8 +21,96 @@ #include +#define COBJMACROS + #include "windef.h" #include "winbase.h" +#include "objbase.h" +#include "wbemcli.h" + +#include "wbemprox_private.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); + +typedef HRESULT (*fnCreateInstance)( IUnknown *pUnkOuter, LPVOID *ppObj ); + +typedef struct +{ + const struct IClassFactoryVtbl *vtbl; + fnCreateInstance pfnCreateInstance; +} wbemprox_cf; + +static inline wbemprox_cf *impl_from_IClassFactory( IClassFactory *iface ) +{ + return (wbemprox_cf *)((char *)iface - FIELD_OFFSET( wbemprox_cf, vtbl )); +} + +static HRESULT WINAPI wbemprox_cf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj ) +{ + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IClassFactory)) + { + IClassFactory_AddRef( iface ); + *ppobj = iface; + return S_OK; + } + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI wbemprox_cf_AddRef( IClassFactory *iface ) +{ + return 2; +} + +static ULONG WINAPI wbemprox_cf_Release( IClassFactory *iface ) +{ + return 1; +} + +static HRESULT WINAPI wbemprox_cf_CreateInstance( IClassFactory *iface, LPUNKNOWN pOuter, + REFIID riid, LPVOID *ppobj ) +{ + wbemprox_cf *This = impl_from_IClassFactory( iface ); + HRESULT r; + IUnknown *punk; + + TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj); + + *ppobj = NULL; + + if (pOuter) + return CLASS_E_NOAGGREGATION; + + r = This->pfnCreateInstance( pOuter, (LPVOID *)&punk ); + if (FAILED(r)) + return r; + + r = IUnknown_QueryInterface( punk, riid, ppobj ); + if (FAILED(r)) + return r; + + IUnknown_Release( punk ); + return r; +} + +static HRESULT WINAPI wbemprox_cf_LockServer( IClassFactory *iface, BOOL dolock ) +{ + FIXME("(%p)->(%d)\n", iface, dolock); + return S_OK; +} + +static const struct IClassFactoryVtbl wbemprox_cf_vtbl = +{ + wbemprox_cf_QueryInterface, + wbemprox_cf_AddRef, + wbemprox_cf_Release, + wbemprox_cf_CreateInstance, + wbemprox_cf_LockServer +}; + +static wbemprox_cf wbem_locator_cf = { &wbemprox_cf_vtbl, WbemLocator_create }; BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { @@ -40,3 +128,23 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } + +HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv ) +{ + IClassFactory *cf = NULL; + + TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv); + + if (IsEqualGUID( rclsid, &CLSID_WbemLocator )) + { + cf = (IClassFactory *)&wbem_locator_cf.vtbl; + } + if (!cf) return CLASS_E_CLASSNOTAVAILABLE; + return IClassFactory_QueryInterface( cf, iid, ppv ); +} + +HRESULT WINAPI DllCanUnloadNow( void ) +{ + FIXME("\n"); + return S_FALSE; +} diff --git a/dlls/windowscodecs/regsvr.c b/dlls/wbemprox/regsvr.c similarity index 54% copy from dlls/windowscodecs/regsvr.c copy to dlls/wbemprox/regsvr.c index ddb781a1bb6..60f3515a4fa 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/wbemprox/regsvr.c @@ -1,5 +1,7 @@ /* - * Copyright 2009 Vincent Povirk for CodeWeavers + * self-registerable dll functions for wbemprox.dll + * + * Copyright (C) 2003 John K. Hohm * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,30 +18,44 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#define COBJMACROS + #include #include #include "windef.h" #include "winbase.h" -#include "wingdi.h" #include "winuser.h" #include "winreg.h" #include "winerror.h" - #include "objbase.h" -#include "ocidl.h" -#include "wincodec.h" +#include "wbemcli.h" #include "wine/debug.h" +#include "wine/unicode.h" -WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); +WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); + +/* + * Near the bottom of this file are the exported DllRegisterServer and + * DllUnregisterServer, which make all this worthwhile. + */ /*********************************************************************** * interface for self-registering */ +struct regsvr_interface +{ + IID const *iid; /* NULL for end of list */ + LPCSTR name; /* can be NULL to omit */ + IID const *base_iid; /* can be NULL to omit */ + int num_methods; /* can be <0 to omit */ + CLSID const *ps_clsid; /* can be NULL to omit */ + CLSID const *ps_clsid32; /* can be NULL to omit */ +}; + +static HRESULT register_interfaces(struct regsvr_interface const *list); +static HRESULT unregister_interfaces(struct regsvr_interface const *list); + struct regsvr_coclass { CLSID const *clsid; /* NULL for end of list */ @@ -47,9 +63,8 @@ struct regsvr_coclass LPCSTR ips; /* can be NULL to omit */ LPCSTR ips32; /* can be NULL to omit */ LPCSTR ips32_tmodel; /* can be NULL to omit */ + LPCSTR clsid_str; /* can be NULL to omit */ LPCSTR progid; /* can be NULL to omit */ - LPCSTR viprogid; /* can be NULL to omit */ - LPCSTR progid_extra; /* can be NULL to omit */ }; static HRESULT register_coclasses(struct regsvr_coclass const *list); @@ -58,10 +73,21 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list); /*********************************************************************** * static string constants */ +static WCHAR const interface_keyname[10] = { + 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 }; +static WCHAR const base_ifa_keyname[14] = { + 'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', + 'e', 0 }; +static WCHAR const num_methods_keyname[11] = { + 'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 }; +static WCHAR const ps_clsid_keyname[15] = { + 'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's', + 'i', 'd', 0 }; +static WCHAR const ps_clsid32_keyname[17] = { + 'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's', + 'i', 'd', '3', '2', 0 }; static WCHAR const clsid_keyname[6] = { 'C', 'L', 'S', 'I', 'D', 0 }; -static WCHAR const curver_keyname[7] = { - 'C', 'u', 'r', 'V', 'e', 'r', 0 }; static WCHAR const ips_keyname[13] = { 'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r', 0 }; @@ -70,22 +96,112 @@ static WCHAR const ips32_keyname[15] = { '3', '2', 0 }; static WCHAR const progid_keyname[7] = { 'P', 'r', 'o', 'g', 'I', 'D', 0 }; -static WCHAR const viprogid_keyname[25] = { - 'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p', - 'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D', - 0 }; static char const tmodel_valuename[] = "ThreadingModel"; /*********************************************************************** * static helper functions */ +static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid); static LONG register_key_defvalueW(HKEY base, WCHAR const *name, WCHAR const *value); static LONG register_key_defvalueA(HKEY base, WCHAR const *name, char const *value); -static LONG register_progid(WCHAR const *clsid, - char const *progid, char const *curver_progid, - char const *name, char const *extra); + +/*********************************************************************** + * register_interfaces + */ +static HRESULT register_interfaces(struct regsvr_interface const *list) +{ + LONG res = ERROR_SUCCESS; + HKEY interface_key; + + res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &interface_key, NULL); + if (res != ERROR_SUCCESS) goto error_return; + + for (; res == ERROR_SUCCESS && list->iid; ++list) { + WCHAR buf[39]; + HKEY iid_key; + + StringFromGUID2(list->iid, buf, 39); + res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &iid_key, NULL); + if (res != ERROR_SUCCESS) goto error_close_interface_key; + + if (list->name) { + res = RegSetValueExA(iid_key, NULL, 0, REG_SZ, + (CONST BYTE*)(list->name), + strlen(list->name) + 1); + if (res != ERROR_SUCCESS) goto error_close_iid_key; + } + + if (list->base_iid) { + res = register_key_guid(iid_key, base_ifa_keyname, list->base_iid); + if (res != ERROR_SUCCESS) goto error_close_iid_key; + } + + if (0 <= list->num_methods) { + static WCHAR const fmt[3] = { '%', 'd', 0 }; + HKEY key; + + res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &key, NULL); + if (res != ERROR_SUCCESS) goto error_close_iid_key; + + sprintfW(buf, fmt, list->num_methods); + res = RegSetValueExW(key, NULL, 0, REG_SZ, + (CONST BYTE*)buf, + (lstrlenW(buf) + 1) * sizeof(WCHAR)); + RegCloseKey(key); + + if (res != ERROR_SUCCESS) goto error_close_iid_key; + } + + if (list->ps_clsid) { + res = register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid); + if (res != ERROR_SUCCESS) goto error_close_iid_key; + } + + if (list->ps_clsid32) { + res = register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32); + if (res != ERROR_SUCCESS) goto error_close_iid_key; + } + + error_close_iid_key: + RegCloseKey(iid_key); + } + +error_close_interface_key: + RegCloseKey(interface_key); +error_return: + return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK; +} + +/*********************************************************************** + * unregister_interfaces + */ +static HRESULT unregister_interfaces(struct regsvr_interface const *list) +{ + LONG res = ERROR_SUCCESS; + HKEY interface_key; + + res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, + KEY_READ | KEY_WRITE, &interface_key); + if (res == ERROR_FILE_NOT_FOUND) return S_OK; + if (res != ERROR_SUCCESS) goto error_return; + + for (; res == ERROR_SUCCESS && list->iid; ++list) { + WCHAR buf[39]; + + StringFromGUID2(list->iid, buf, 39); + res = RegDeleteTreeW(interface_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; + } + + RegCloseKey(interface_key); +error_return: + return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK; +} /*********************************************************************** * register_coclasses @@ -139,23 +255,26 @@ static HRESULT register_coclasses(struct regsvr_coclass const *list) if (res != ERROR_SUCCESS) goto error_close_clsid_key; } + if (list->clsid_str) { + res = register_key_defvalueA(clsid_key, clsid_keyname, + list->clsid_str); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + } + if (list->progid) { + HKEY progid_key; + res = register_key_defvalueA(clsid_key, progid_keyname, list->progid); if (res != ERROR_SUCCESS) goto error_close_clsid_key; - res = register_progid(buf, list->progid, NULL, - list->name, list->progid_extra); - if (res != ERROR_SUCCESS) goto error_close_clsid_key; - } - - if (list->viprogid) { - res = register_key_defvalueA(clsid_key, viprogid_keyname, - list->viprogid); + res = RegCreateKeyExA(HKEY_CLASSES_ROOT, list->progid, 0, + NULL, 0, KEY_READ | KEY_WRITE, NULL, + &progid_key, NULL); if (res != ERROR_SUCCESS) goto error_close_clsid_key; - res = register_progid(buf, list->viprogid, list->progid, - list->name, list->progid_extra); + res = register_key_defvalueW(progid_key, clsid_keyname, buf); + RegCloseKey(progid_key); if (res != ERROR_SUCCESS) goto error_close_clsid_key; } @@ -186,19 +305,13 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list) WCHAR buf[39]; StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); - if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; + res = RegDeleteTreeW(coclass_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; if (list->progid) { - res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid); - if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; - if (res != ERROR_SUCCESS) goto error_close_coclass_key; - } - - if (list->viprogid) { - res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid); - if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; + res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } } @@ -210,7 +323,18 @@ error_return: } /*********************************************************************** - * register_key_defvalueW + * regsvr_key_guid + */ +static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) +{ + WCHAR buf[39]; + + StringFromGUID2(guid, buf, 39); + return register_key_defvalueW(base, name, buf); +} + +/*********************************************************************** + * regsvr_key_defvalueW */ static LONG register_key_defvalueW( HKEY base, @@ -230,7 +354,7 @@ static LONG register_key_defvalueW( } /*********************************************************************** - * register_key_defvalueA + * regsvr_key_defvalueA */ static LONG register_key_defvalueA( HKEY base, @@ -250,74 +374,28 @@ static LONG register_key_defvalueA( } /*********************************************************************** - * register_progid - */ -static LONG register_progid( - WCHAR const *clsid, - char const *progid, - char const *curver_progid, - char const *name, - char const *extra) -{ - LONG res; - HKEY progid_key; - - res = RegCreateKeyExA(HKEY_CLASSES_ROOT, progid, 0, - NULL, 0, KEY_READ | KEY_WRITE, NULL, - &progid_key, NULL); - if (res != ERROR_SUCCESS) return res; - - if (name) { - res = RegSetValueExA(progid_key, NULL, 0, REG_SZ, - (CONST BYTE*)name, strlen(name) + 1); - if (res != ERROR_SUCCESS) goto error_close_progid_key; - } - - if (clsid) { - res = register_key_defvalueW(progid_key, clsid_keyname, clsid); - if (res != ERROR_SUCCESS) goto error_close_progid_key; - } - - if (curver_progid) { - res = register_key_defvalueA(progid_key, curver_keyname, - curver_progid); - if (res != ERROR_SUCCESS) goto error_close_progid_key; - } - - if (extra) { - HKEY extra_key; - - res = RegCreateKeyExA(progid_key, extra, 0, - NULL, 0, KEY_READ | KEY_WRITE, NULL, - &extra_key, NULL); - if (res == ERROR_SUCCESS) - RegCloseKey(extra_key); - } - -error_close_progid_key: - RegCloseKey(progid_key); - return res; -} - -/*********************************************************************** * coclass list */ static struct regsvr_coclass const coclass_list[] = { - { &CLSID_WICImagingFactory, - "WIC Imaging Factory", - NULL, - "windowscodecs.dll", - "Apartment" - }, - { &CLSID_WICBmpDecoder, - "WIC BMP Decoder", - NULL, - "windowscodecs.dll", - "Apartment" + { &CLSID_WbemLocator, + "CLSID_WbemLocator", + NULL, + "wbemprox.dll", + "Both" }, { NULL } /* list terminator */ }; +/*********************************************************************** + * interface list + */ +static struct regsvr_interface const interface_list[] = { + { NULL } /* list terminator */ +}; + +/*********************************************************************** + * DllRegisterServer (INETCOMM.@) + */ HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -325,9 +403,14 @@ HRESULT WINAPI DllRegisterServer(void) TRACE("\n"); hr = register_coclasses(coclass_list); + if (SUCCEEDED(hr)) + hr = register_interfaces(interface_list); return hr; } +/*********************************************************************** + * DllUnregisterServer (INETCOMM.@) + */ HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; @@ -335,5 +418,7 @@ HRESULT WINAPI DllUnregisterServer(void) TRACE("\n"); hr = unregister_coclasses(coclass_list); + if (SUCCEEDED(hr)) + hr = unregister_interfaces(interface_list); return hr; } diff --git a/dlls/wbemprox/wbemlocator.c b/dlls/wbemprox/wbemlocator.c new file mode 100644 index 00000000000..ad6a75d168f --- /dev/null +++ b/dlls/wbemprox/wbemlocator.c @@ -0,0 +1,130 @@ +/* + * Copyright 2009 Hans Leidekker for CodeWeavers + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "config.h" +#include + +#include "windef.h" +#include "winbase.h" +#include "initguid.h" +#include "objbase.h" +#include "wbemcli.h" + +#include "wine/debug.h" +#include "wine/unicode.h" +#include "wbemprox_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); + +typedef struct +{ + const IWbemLocatorVtbl *vtbl; + LONG refs; +} wbem_locator; + +static inline wbem_locator *impl_from_IWbemLocator( IWbemLocator *iface ) +{ + return (wbem_locator *)((char *)iface - FIELD_OFFSET( wbem_locator, vtbl )); +} + +static ULONG WINAPI wbem_locator_AddRef( + IWbemLocator *iface ) +{ + wbem_locator *wl = impl_from_IWbemLocator( iface ); + return InterlockedIncrement( &wl->refs ); +} + +static ULONG WINAPI wbem_locator_Release( + IWbemLocator *iface ) +{ + wbem_locator *wl = impl_from_IWbemLocator( iface ); + LONG refs = InterlockedDecrement( &wl->refs ); + if (!refs) + { + TRACE("destroying %p\n", wl); + HeapFree( GetProcessHeap(), 0, wl ); + } + return refs; +} + +static HRESULT WINAPI wbem_locator_QueryInterface( + IWbemLocator *iface, + REFIID riid, + void **ppvObject ) +{ + wbem_locator *This = impl_from_IWbemLocator( iface ); + + TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject ); + + if ( IsEqualGUID( riid, &IID_IWbemLocator ) || + IsEqualGUID( riid, &IID_IUnknown ) ) + { + *ppvObject = iface; + } + else + { + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + IWbemLocator_AddRef( iface ); + return S_OK; +} + +static HRESULT WINAPI wbem_locator_ConnectServer( + IWbemLocator *iface, + const BSTR NetworkResource, + const BSTR User, + const BSTR Password, + const BSTR Locale, + LONG SecurityFlags, + const BSTR Authority, + IWbemContext *pCtx, + IWbemServices **ppNamespace) +{ + FIXME("%p, %s, %s, %s, %s, 0x%08x, %s, %p, %p)\n", iface, debugstr_w(NetworkResource), debugstr_w(User), + debugstr_w(Password), debugstr_w(Locale), SecurityFlags, debugstr_w(Authority), pCtx, ppNamespace); + return WBEM_E_FAILED; +} + +static const IWbemLocatorVtbl wbem_locator_vtbl = +{ + wbem_locator_QueryInterface, + wbem_locator_AddRef, + wbem_locator_Release, + wbem_locator_ConnectServer +}; + +HRESULT WbemLocator_create( IUnknown *pUnkOuter, LPVOID *ppObj ) +{ + wbem_locator *wl; + + TRACE("(%p,%p)\n", pUnkOuter, ppObj); + + wl = HeapAlloc( GetProcessHeap(), 0, sizeof(*wl) ); + if (!wl) return E_OUTOFMEMORY; + + wl->vtbl = &wbem_locator_vtbl; + wl->refs = 1; + + *ppObj = &wl->vtbl; + + TRACE("returning iface %p\n", *ppObj); + return S_OK; +} diff --git a/dlls/wbemprox/wbemprox.spec b/dlls/wbemprox/wbemprox.spec index c5fc87af6d5..b16365d0c9f 100644 --- a/dlls/wbemprox/wbemprox.spec +++ b/dlls/wbemprox/wbemprox.spec @@ -1,4 +1,4 @@ -@ stub DllCanUnloadNow -@ stub DllGetClassObject -@ stub DllRegisterServer -@ stub DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/programs/write/De.rc b/dlls/wbemprox/wbemprox_private.h similarity index 77% copy from programs/write/De.rc copy to dlls/wbemprox/wbemprox_private.h index a9535767bb6..cf4301dd61b 100644 --- a/programs/write/De.rc +++ b/dlls/wbemprox/wbemprox_private.h @@ -1,6 +1,5 @@ /* - * Copyright (C) 2007 Mikolaj Zalewski - * Copyright (C) 2008 Michael Stefaniuc + * Copyright 2009 Hans Leidekker for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,11 +16,4 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "resources.h" - -LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL - -STRINGTABLE -{ - IDS_FAILED, "Der Start von Wordpad ist fehlgeschlagen" -} +HRESULT WbemLocator_create(IUnknown *, LPVOID *); diff --git a/dlls/windowscodecs/bmpdecode.c b/dlls/windowscodecs/bmpdecode.c index 80447cf9af5..0064e9dba56 100644 --- a/dlls/windowscodecs/bmpdecode.c +++ b/dlls/windowscodecs/bmpdecode.c @@ -191,6 +191,10 @@ static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, { HRESULT hr; BmpFrameDecode *This = (BmpFrameDecode*)iface; + int count; + WICColor *wiccolors=NULL; + RGBTRIPLE *bgrcolors=NULL; + TRACE("(%p,%p)\n", iface, pIPalette); if (This->bih.bV5Size == sizeof(BITMAPCOREHEADER)) @@ -199,30 +203,30 @@ static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, if (bch->bcBitCount <= 8) { /* 2**n colors in BGR format after the header */ - int count = 1 << bch->bcBitCount; - WICColor *wiccolors; ULONG tablesize, bytesread; - RGBTRIPLE *bgrcolors; LARGE_INTEGER offset; int i; + count = 1 << bch->bcBitCount; wiccolors = HeapAlloc(GetProcessHeap(), 0, sizeof(WICColor) * count); tablesize = sizeof(RGBTRIPLE) * count; bgrcolors = HeapAlloc(GetProcessHeap(), 0, tablesize); if (!wiccolors || !bgrcolors) { - HeapFree(GetProcessHeap(), 0, wiccolors); - HeapFree(GetProcessHeap(), 0, bgrcolors); - return E_OUTOFMEMORY; + hr = E_OUTOFMEMORY; + goto end; } offset.QuadPart = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPCOREHEADER); hr = IStream_Seek(This->stream, offset, STREAM_SEEK_SET, NULL); - if (FAILED(hr)) return hr; + if (FAILED(hr)) goto end; hr = IStream_Read(This->stream, bgrcolors, tablesize, &bytesread); - if (FAILED(hr)) return hr; - if (bytesread != tablesize) return E_FAIL; + if (FAILED(hr)) goto end; + if (bytesread != tablesize) { + hr = E_FAIL; + goto end; + } for (i=0; ibih.bV5BitCount <= 8) { - int count; - WICColor *wiccolors; ULONG tablesize, bytesread; LARGE_INTEGER offset; int i; @@ -264,26 +260,31 @@ static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, offset.QuadPart = sizeof(BITMAPFILEHEADER) + This->bih.bV5Size; hr = IStream_Seek(This->stream, offset, STREAM_SEEK_SET, NULL); - if (FAILED(hr)) return hr; + if (FAILED(hr)) goto end; hr = IStream_Read(This->stream, wiccolors, tablesize, &bytesread); - if (FAILED(hr)) return hr; - if (bytesread != tablesize) return E_FAIL; + if (FAILED(hr)) goto end; + if (bytesread != tablesize) { + hr = E_FAIL; + goto end; + } /* convert from BGR to BGRA by setting alpha to 100% */ for (i=0; iclsid; ++list) { + HKEY clsid_key; + HKEY instance_clsid_key; + + StringFromGUID2(list->clsid, buf, 39); + res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL); + if (res != ERROR_SUCCESS) goto error_close_coclass_key; + + StringFromGUID2(list->clsid, buf, 39); + res = RegCreateKeyExW(instance_key, buf, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &instance_clsid_key, NULL); + if (res == ERROR_SUCCESS) { + res = RegSetValueExW(instance_clsid_key, clsid_valuename, 0, REG_SZ, + (CONST BYTE*)(buf), 78); + RegCloseKey(instance_clsid_key); + } + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + + if (list->author) { + res = RegSetValueExA(clsid_key, author_valuename, 0, REG_SZ, + (CONST BYTE*)(list->author), + strlen(list->author) + 1); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + } + + if (list->friendlyname) { + res = RegSetValueExA(clsid_key, friendlyname_valuename, 0, REG_SZ, + (CONST BYTE*)(list->friendlyname), + strlen(list->friendlyname) + 1); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + } + + if (list->vendor) { + StringFromGUID2(list->vendor, buf, 39); + res = RegSetValueExW(clsid_key, vendor_valuename, 0, REG_SZ, + (CONST BYTE*)(buf), 78); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + } + + if (list->version) { + res = RegSetValueExA(clsid_key, version_valuename, 0, REG_SZ, + (CONST BYTE*)(list->version), + strlen(list->version) + 1); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + } + + if (list->mimetypes) { + res = RegSetValueExA(clsid_key, mimetypes_valuename, 0, REG_SZ, + (CONST BYTE*)(list->mimetypes), + strlen(list->mimetypes) + 1); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + } + + if (list->extensions) { + res = RegSetValueExA(clsid_key, extensions_valuename, 0, REG_SZ, + (CONST BYTE*)(list->extensions), + strlen(list->extensions) + 1); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + } + + if (list->formats) { + HKEY formats_key; + GUID const * const *format; + + res = RegCreateKeyExW(clsid_key, formats_keyname, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &formats_key, NULL); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + for (format=list->formats; *format; ++format) + { + HKEY format_key; + StringFromGUID2(*format, buf, 39); + res = RegCreateKeyExW(formats_key, buf, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &format_key, NULL); + if (res != ERROR_SUCCESS) break; + RegCloseKey(format_key); + } + RegCloseKey(formats_key); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + } + + if (list->patterns) { + HKEY patterns_key; + int i; + + res = RegCreateKeyExW(clsid_key, patterns_keyname, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &patterns_key, NULL); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + for (i=0; list->patterns[i].length; i++) + { + HKEY pattern_key; + static const WCHAR int_format[] = {'%','i',0}; + snprintfW(buf, 39, int_format, i); + res = RegCreateKeyExW(patterns_key, buf, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &pattern_key, NULL); + if (res != ERROR_SUCCESS) break; + res = RegSetValueExA(pattern_key, length_valuename, 0, REG_DWORD, + (CONST BYTE*)(&list->patterns[i].length), 4); + if (res == ERROR_SUCCESS) + res = RegSetValueExA(pattern_key, position_valuename, 0, REG_DWORD, + (CONST BYTE*)(&list->patterns[i].position), 4); + if (res == ERROR_SUCCESS) + res = RegSetValueExA(pattern_key, pattern_valuename, 0, REG_BINARY, + list->patterns[i].pattern, + list->patterns[i].length); + if (res == ERROR_SUCCESS) + res = RegSetValueExA(pattern_key, mask_valuename, 0, REG_BINARY, + list->patterns[i].mask, + list->patterns[i].length); + if (res == ERROR_SUCCESS) + res = RegSetValueExA(pattern_key, endofstream_valuename, 0, REG_DWORD, + (CONST BYTE*)&(list->patterns[i].endofstream), 4); + RegCloseKey(pattern_key); + } + RegCloseKey(patterns_key); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + } + + error_close_clsid_key: + RegCloseKey(clsid_key); + } + +error_close_coclass_key: + RegCloseKey(instance_key); + RegCloseKey(decoders_key); + RegCloseKey(coclass_key); +error_return: + return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK; +} + +/*********************************************************************** + * unregister_decoders + */ +static HRESULT unregister_decoders(struct regsvr_decoder const *list) +{ + LONG res = ERROR_SUCCESS; + HKEY coclass_key; + WCHAR buf[39]; + HKEY decoders_key; + HKEY instance_key; + + res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, + KEY_READ | KEY_WRITE, &coclass_key); + if (res == ERROR_FILE_NOT_FOUND) return S_OK; + + if (res == ERROR_SUCCESS) { + StringFromGUID2(&CATID_WICBitmapDecoders, buf, 39); + res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &decoders_key, NULL); + if (res == ERROR_SUCCESS) + { + res = RegCreateKeyExW(decoders_key, instance_keyname, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &instance_key, NULL); + if (res != ERROR_SUCCESS) goto error_close_coclass_key; + } + if (res != ERROR_SUCCESS) + RegCloseKey(coclass_key); + } + if (res != ERROR_SUCCESS) goto error_return; + + for (; res == ERROR_SUCCESS && list->clsid; ++list) { + StringFromGUID2(list->clsid, buf, 39); + + res = RegDeleteTreeW(coclass_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; + if (res != ERROR_SUCCESS) goto error_close_coclass_key; + + res = RegDeleteTreeW(instance_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; + if (res != ERROR_SUCCESS) goto error_close_coclass_key; + } + +error_close_coclass_key: + RegCloseKey(instance_key); + RegCloseKey(decoders_key); + RegCloseKey(coclass_key); +error_return: + return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK; +} + +/*********************************************************************** * register_key_defvalueW */ static LONG register_key_defvalueW( @@ -318,6 +567,42 @@ static struct regsvr_coclass const coclass_list[] = { { NULL } /* list terminator */ }; +/*********************************************************************** + * decoder list + */ +static const BYTE bmp_magic[] = {0x42,0x4d}; +static const BYTE mask_all[] = {0xff,0xff}; + +static GUID const * const bmp_formats[] = { + &GUID_WICPixelFormat1bppIndexed, + &GUID_WICPixelFormat2bppIndexed, + &GUID_WICPixelFormat4bppIndexed, + &GUID_WICPixelFormat8bppIndexed, + &GUID_WICPixelFormat16bppBGR555, + &GUID_WICPixelFormat24bppBGR, + &GUID_WICPixelFormat32bppBGR, + NULL +}; + +static struct decoder_pattern const bmp_patterns[] = { + {2,0,bmp_magic,mask_all,0}, + {0} +}; + +static struct regsvr_decoder const decoder_list[] = { + { &CLSID_WICBmpDecoder, + "The Wine Project", + "BMP Decoder", + "1.0.0.0", + &GUID_VendorMicrosoft, + "image/bmp", + ".bmp,.dib,.rle", + bmp_formats, + bmp_patterns + }, + { NULL } /* list terminator */ +}; + HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -325,6 +610,8 @@ HRESULT WINAPI DllRegisterServer(void) TRACE("\n"); hr = register_coclasses(coclass_list); + if (SUCCEEDED(hr)) + register_decoders(decoder_list); return hr; } @@ -335,5 +622,7 @@ HRESULT WINAPI DllUnregisterServer(void) TRACE("\n"); hr = unregister_coclasses(coclass_list); + if (SUCCEEDED(hr)) + unregister_decoders(decoder_list); return hr; } diff --git a/dlls/winealsa.drv/dsoutput.c b/dlls/winealsa.drv/dsoutput.c index 15cff5f1fbf..9c6d7fdb598 100644 --- a/dlls/winealsa.drv/dsoutput.c +++ b/dlls/winealsa.drv/dsoutput.c @@ -83,8 +83,9 @@ struct IDsDriverBufferImpl IDsDriverImpl* drv; CRITICAL_SECTION pcm_crst; - LPVOID mmap_buffer; + BYTE *mmap_buffer; DWORD mmap_buflen_bytes; + BOOL mmap; snd_pcm_t *pcm; snd_pcm_hw_params_t *hw_params; @@ -102,25 +103,44 @@ struct IDsDriverBufferImpl static snd_pcm_uframes_t CommitAll(IDsDriverBufferImpl *This) { const snd_pcm_channel_area_t *areas; - snd_pcm_uframes_t used; + snd_pcm_sframes_t used; const snd_pcm_uframes_t commitahead = This->mmap_commitahead; used = This->mmap_buflen_frames - snd_pcm_avail_update(This->pcm); - TRACE("%p needs to commit to %lu, used: %lu\n", This, commitahead, used); + if (used < 0) used = 0; + TRACE("%p needs to commit to %lu, used: %ld\n", This, commitahead, used); if (used < commitahead) { snd_pcm_uframes_t done, putin = commitahead - used; - snd_pcm_mmap_begin(This->pcm, &areas, &This->mmap_pos, &putin); - done = snd_pcm_mmap_commit(This->pcm, This->mmap_pos, putin); + if (This->mmap) + { + snd_pcm_mmap_begin(This->pcm, &areas, &This->mmap_pos, &putin); + done = snd_pcm_mmap_commit(This->pcm, This->mmap_pos, putin); + } + else + { + if (putin + This->mmap_pos > This->mmap_buflen_frames) + putin = This->mmap_buflen_frames - This->mmap_pos; + done = putin; + snd_pcm_writei(This->pcm, This->mmap_buffer + snd_pcm_frames_to_bytes(This->pcm, This->mmap_pos), putin); + } This->mmap_pos += done; used += done; putin = commitahead - used; if (This->mmap_pos == This->mmap_buflen_frames && (snd_pcm_sframes_t)putin > 0) { - snd_pcm_mmap_begin(This->pcm, &areas, &This->mmap_pos, &putin); - done = snd_pcm_mmap_commit(This->pcm, This->mmap_pos, putin); - This->mmap_pos += done; + if (This->mmap) + { + snd_pcm_mmap_begin(This->pcm, &areas, &This->mmap_pos, &putin); + done = snd_pcm_mmap_commit(This->pcm, This->mmap_pos, putin); + This->mmap_pos += done; + } + else + { + snd_pcm_writei(This->pcm, This->mmap_buffer, putin); + This->mmap_pos = done = putin; + } used += done; } } @@ -176,6 +196,7 @@ static int DSDB_CreateMMAP(IDsDriverBufferImpl* pdbi) const snd_pcm_channel_area_t *areas; snd_pcm_hw_params_t *hw_params = pdbi->hw_params; snd_pcm_sw_params_t *sw_params = pdbi->sw_params; + void *buf; mmap_mode = snd_pcm_type(pcm); @@ -218,15 +239,27 @@ static int DSDB_CreateMMAP(IDsDriverBufferImpl* pdbi) ERR("No buffer is available: %s.\n", snd_strerror(avail)); return DSERR_GENERIC; } - err = snd_pcm_mmap_begin(pcm, &areas, &ofs, &avail); - if ( err < 0 ) + + if (!pdbi->mmap) { - ERR("Can't map sound device for direct access: %s\n", snd_strerror(err)); - return DSERR_GENERIC; + buf = pdbi->mmap_buffer = HeapAlloc(GetProcessHeap(), 0, pdbi->mmap_buflen_bytes); + if (!buf) + return DSERR_OUTOFMEMORY; + + snd_pcm_format_set_silence(format, buf, pdbi->mmap_buflen_frames); + } + else + { + err = snd_pcm_mmap_begin(pcm, &areas, &ofs, &avail); + if ( err < 0 ) + { + ERR("Can't map sound device for direct access: %s/%d\n", snd_strerror(err), err); + return DSERR_GENERIC; + } + snd_pcm_format_set_silence(format, areas->addr, pdbi->mmap_buflen_frames); + pdbi->mmap_pos = ofs + snd_pcm_mmap_commit(pcm, ofs, 0); + pdbi->mmap_buffer = areas->addr; } - snd_pcm_format_set_silence(format, areas->addr, pdbi->mmap_buflen_frames); - pdbi->mmap_pos = ofs + snd_pcm_mmap_commit(pcm, ofs, 0); - pdbi->mmap_buffer = areas->addr; TRACE("created mmap buffer of %ld frames (%d bytes) at %p\n", frames, pdbi->mmap_buflen_bytes, pdbi->mmap_buffer); @@ -274,6 +307,8 @@ static ULONG WINAPI IDsDriverBufferImpl_Release(PIDSDRIVERBUFFER iface) This->pcm = NULL; HeapFree(GetProcessHeap(), 0, This->sw_params); HeapFree(GetProcessHeap(), 0, This->hw_params); + if (!This->mmap) + HeapFree(GetProcessHeap(), 0, This->mmap_buffer); HeapFree(GetProcessHeap(), 0, This); return 0; } @@ -305,7 +340,7 @@ static HRESULT WINAPI IDsDriverBufferImpl_Lock(PIDSDRIVERBUFFER iface, if (ppvAudio2) *ppvAudio2 = NULL; if (pdwLen2) *pdwLen2 = 0; - *ppvAudio1 = (LPBYTE)This->mmap_buffer + dwWritePosition; + *ppvAudio1 = This->mmap_buffer + dwWritePosition; *pdwLen1 = dwWriteLen; if (dwWritePosition+dwWriteLen > This->mmap_buflen_bytes) @@ -327,7 +362,8 @@ static HRESULT WINAPI IDsDriverBufferImpl_Lock(PIDSDRIVERBUFFER iface, const snd_pcm_channel_area_t *areas; snd_pcm_uframes_t writelen = snd_pcm_bytes_to_frames(This->pcm, dwWriteLen), putin = writelen; TRACE("Hit mmap_pos, locking data!\n"); - snd_pcm_mmap_begin(This->pcm, &areas, &This->mmap_pos, &putin); + if (This->mmap) + snd_pcm_mmap_begin(This->pcm, &areas, &This->mmap_pos, &putin); } else WARN("mmap_pos (%lu) != writepos (%lu) not locking data!\n", This->mmap_pos, writepos); @@ -356,14 +392,40 @@ static HRESULT WINAPI IDsDriverBufferImpl_Unlock(PIDSDRIVERBUFFER iface, const snd_pcm_channel_area_t *areas; snd_pcm_uframes_t writelen = snd_pcm_bytes_to_frames(This->pcm, dwLen1); TRACE("Committing data\n"); - This->mmap_pos += snd_pcm_mmap_commit(This->pcm, This->mmap_pos, writelen); + if (This->mmap) + This->mmap_pos += snd_pcm_mmap_commit(This->pcm, This->mmap_pos, writelen); + else + { + int ret; + ret = snd_pcm_writei(This->pcm, pvAudio1, writelen); + if (ret == -EPIPE) + { + WARN("Underrun occured\n"); + snd_pcm_prepare(This->pcm); + ret = snd_pcm_writei(This->pcm, pvAudio1, writelen); + snd_pcm_start(This->pcm); + } + if (ret < 0) + WARN("Committing data: %d / %s (%p %ld)\n", ret, snd_strerror(ret), pvAudio1, writelen); + This->mmap_pos += writelen; + } + if (This->mmap_pos == This->mmap_buflen_frames) This->mmap_pos = 0; if (!This->mmap_pos && dwLen2) { writelen = snd_pcm_bytes_to_frames(This->pcm, dwLen2); - snd_pcm_mmap_begin(This->pcm, &areas, &This->mmap_pos, &writelen); - This->mmap_pos += snd_pcm_mmap_commit(This->pcm, This->mmap_pos, writelen); + if (This->mmap) + { + snd_pcm_mmap_begin(This->pcm, &areas, &This->mmap_pos, &writelen); + This->mmap_pos += snd_pcm_mmap_commit(This->pcm, This->mmap_pos, writelen); + } + else + { + int ret; + ret = snd_pcm_writei(This->pcm, pvAudio2, writelen); + This->mmap_pos = writelen; + } assert(This->mmap_pos < This->mmap_buflen_frames); } } @@ -442,13 +504,30 @@ static HRESULT SetFormat(IDsDriverBufferImpl *This, LPWAVEFORMATEX pwfx) snd_pcm_hw_params_set_buffer_time_near(pcm, hw_params, &buffer_time, NULL); buffer_time = 10000; snd_pcm_hw_params_set_period_time_near(pcm, hw_params, &buffer_time, NULL); + + err = snd_pcm_hw_params_get_period_size(hw_params, &psize, NULL); + buffer_time = 16; + snd_pcm_hw_params_set_periods_near(pcm, hw_params, &buffer_time, NULL); + + if (!This->mmap) + { + HeapFree(GetProcessHeap(), 0, This->mmap_buffer); + This->mmap_buffer = NULL; + } + + err = snd_pcm_hw_params_set_access (pcm, hw_params, SND_PCM_ACCESS_MMAP_INTERLEAVED); + if (err >= 0) + This->mmap = 1; + else + { + This->mmap = 0; + err = snd_pcm_hw_params_set_access (pcm, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED); + } + err = snd_pcm_hw_params(pcm, hw_params); err = snd_pcm_sw_params(pcm, This->sw_params); snd_pcm_prepare(pcm); - err = snd_pcm_hw_params_get_period_size(hw_params, &psize, NULL); - TRACE("Period size is: %lu\n", psize); - /* ALSA needs at least 3 buffers to work successfully */ This->mmap_commitahead = 3 * psize; while (This->mmap_commitahead <= 512) @@ -553,9 +632,13 @@ static HRESULT WINAPI IDsDriverBufferImpl_GetPosition(PIDSDRIVERBUFFER iface, if (used < 0) { - This->mmap_pos += -used; - snd_pcm_forward(This->pcm, -used); - This->mmap_pos %= This->mmap_buflen_frames; + WARN("Underrun: %ld / %ld\n", used, snd_pcm_avail_update(This->pcm)); + if (This->mmap) + { + snd_pcm_forward(This->pcm, -used); + This->mmap_pos += -used; + This->mmap_pos %= This->mmap_buflen_frames; + } used = 0; } @@ -609,10 +692,19 @@ static HRESULT WINAPI IDsDriverBufferImpl_Stop(PIDSDRIVERBUFFER iface) snd_pcm_drop(This->pcm); snd_pcm_prepare(This->pcm); avail = snd_pcm_avail_update(This->pcm); - snd_pcm_mmap_begin(This->pcm, &areas, &This->mmap_pos, &avail); snd_pcm_hw_params_get_format(This->hw_params, &format); - snd_pcm_format_set_silence(format, areas->addr, This->mmap_buflen_frames); - snd_pcm_mmap_commit(This->pcm, This->mmap_pos, 0); + if (This->mmap) + { + snd_pcm_mmap_begin(This->pcm, &areas, &This->mmap_pos, &avail); + snd_pcm_format_set_silence(format, areas->addr, This->mmap_buflen_frames); + snd_pcm_mmap_commit(This->pcm, This->mmap_pos, 0); + } + else + { + snd_pcm_format_set_silence(format, This->mmap_buffer, This->mmap_buflen_frames); + snd_pcm_writei(This->pcm, This->mmap_buffer, This->mmap_buflen_frames); + This->mmap_pos = 0; + } /* **** */ LeaveCriticalSection(&This->pcm_crst); @@ -710,6 +802,8 @@ static HRESULT WINAPI IDsDriverImpl_Open(PIDSDRIVER iface) err = snd_pcm_hw_params_any(pcm, hw_params); if (err < 0) goto err; err = snd_pcm_hw_params_set_access (pcm, hw_params, SND_PCM_ACCESS_MMAP_INTERLEAVED); + if (err < 0) + err = snd_pcm_hw_params_set_access (pcm, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED); if (err < 0) goto err; TRACE("Success\n"); @@ -833,13 +927,6 @@ DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv) TRACE("driver created\n"); - /* the HAL isn't much better than the HEL if we can't do mmap() */ - if (!(WOutDev[wDevID].outcaps.dwSupport & WAVECAPS_DIRECTSOUND)) - { - WARN("MMAP not supported for this device, falling back to waveout, should be harmless\n"); - return MMSYSERR_NOTSUPPORTED; - } - *idrv = HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverImpl)); if (!*idrv) return MMSYSERR_NOMEM; diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 6f7a1f0c47a..6b8204915e0 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -42,13 +42,15 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); #define GLINFO_LOCATION (*gl_info) /* GL locking for state handlers is done by the caller. */ -static BOOL need_mova_const(IWineD3DBaseShader *shader, const WineD3D_GL_Info *gl_info) { +static BOOL need_mova_const(IWineD3DBaseShader *shader, const struct wined3d_gl_info *gl_info) +{ IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *) shader; if(!This->baseShader.reg_maps.usesmova) return FALSE; return !GL_SUPPORT(NV_VERTEX_PROGRAM2_OPTION); } -static BOOL need_helper_const(const WineD3D_GL_Info *gl_info) { +static BOOL need_helper_const(const struct wined3d_gl_info *gl_info) +{ if (!GL_SUPPORT(NV_VERTEX_PROGRAM) /* Need to init colors. */ || gl_info->quirks & WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT /* Load the immval offset. */ || gl_info->quirks & WINED3D_QUIRK_SET_TEXCOORD_W) /* Have to init texcoords. */ @@ -58,7 +60,8 @@ static BOOL need_helper_const(const WineD3D_GL_Info *gl_info) { return FALSE; } -static unsigned int reserved_vs_const(IWineD3DBaseShader *shader, const WineD3D_GL_Info *gl_info) { +static unsigned int reserved_vs_const(IWineD3DBaseShader *shader, const struct wined3d_gl_info *gl_info) +{ unsigned int ret = 1; /* We use one PARAM for the pos fixup, and in some cases one to load * some immediate values into the shader @@ -74,7 +77,7 @@ static inline BOOL ffp_clip_emul(IWineD3DStateBlockImpl *stateblock) } /* Returns TRUE if result.clip from GL_NV_vertex_program2 should be used and FALSE otherwise */ -static inline BOOL use_nv_clip(const WineD3D_GL_Info *gl_info) +static inline BOOL use_nv_clip(const struct wined3d_gl_info *gl_info) { return GL_SUPPORT(NV_VERTEX_PROGRAM2_OPTION); } @@ -276,7 +279,7 @@ struct shader_arb_priv * or GL_FRAGMENT_PROGRAM_ARB (for pixel shaders) */ /* GL locking is done by the caller */ -static unsigned int shader_arb_load_constantsF(IWineD3DBaseShaderImpl* This, const WineD3D_GL_Info *gl_info, +static unsigned int shader_arb_load_constantsF(IWineD3DBaseShaderImpl *This, const struct wined3d_gl_info *gl_info, GLuint target_type, unsigned int max_constants, const float *constants, char *dirty_consts) { local_constant* lconst; @@ -382,7 +385,7 @@ static void shader_arb_load_np2fixup_constants( IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl *) device; const struct shader_arb_priv* const priv = (const struct shader_arb_priv *) deviceImpl->shader_priv; IWineD3DStateBlockImpl* stateBlock = deviceImpl->stateBlock; - const WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &deviceImpl->adapter->gl_info; if (!usePixelShader) { /* NP2 texcoord fixup is (currently) only done for pixelshaders. */ @@ -425,7 +428,7 @@ static void shader_arb_load_np2fixup_constants( static inline void shader_arb_ps_local_constants(IWineD3DDeviceImpl* deviceImpl) { IWineD3DStateBlockImpl* stateBlock = deviceImpl->stateBlock; - const WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &deviceImpl->adapter->gl_info; unsigned char i; struct shader_arb_priv *priv = deviceImpl->shader_priv; const struct arb_ps_compiled_shader *gl_shader = priv->compiled_fprog; @@ -489,7 +492,7 @@ static inline void shader_arb_ps_local_constants(IWineD3DDeviceImpl* deviceImpl) static inline void shader_arb_vs_local_constants(IWineD3DDeviceImpl* deviceImpl) { IWineD3DStateBlockImpl* stateBlock; - const WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &deviceImpl->adapter->gl_info; unsigned char i; struct shader_arb_priv *priv = deviceImpl->shader_priv; const struct arb_vs_compiled_shader *gl_shader = priv->compiled_vprog; @@ -531,7 +534,7 @@ static void shader_arb_load_constants( IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) device; IWineD3DStateBlockImpl* stateBlock = deviceImpl->stateBlock; - const WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &deviceImpl->adapter->gl_info; if (useVertexShader) { IWineD3DBaseShaderImpl* vshader = (IWineD3DBaseShaderImpl*) stateBlock->vertexShader; @@ -603,7 +606,7 @@ static DWORD *local_const_mapping(IWineD3DBaseShaderImpl *This) /* Generate the variable & register declarations for the ARB_vertex_program output target */ static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface, const shader_reg_maps *reg_maps, - struct wined3d_shader_buffer *buffer, const WineD3D_GL_Info *gl_info, DWORD *lconst_map, + struct wined3d_shader_buffer *buffer, const struct wined3d_gl_info *gl_info, DWORD *lconst_map, DWORD *num_clipplanes, struct shader_arb_ctx_priv *ctx) { IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; @@ -1555,8 +1558,6 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins) case WINED3DSIH_DP3: instruction = "DP3"; break; case WINED3DSIH_DP4: instruction = "DP4"; break; case WINED3DSIH_DST: instruction = "DST"; break; - case WINED3DSIH_EXP: instruction = "EX2"; break; - case WINED3DSIH_EXPP: instruction = "EXP"; break; case WINED3DSIH_FRC: instruction = "FRC"; break; case WINED3DSIH_LIT: instruction = "LIT"; break; case WINED3DSIH_LRP: instruction = "LRP"; break; @@ -1605,15 +1606,13 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins) char src0_param[256]; if(ins->handler_idx == WINED3DSIH_MOVA) { - struct wined3d_shader_src_param tmp_src = ins->src[0]; char write_mask[6]; if(ctx->target_version >= NV2) { shader_hw_map2gl(ins); return; } - tmp_src.swizzle = (tmp_src.swizzle & 0x3) * 0x55; - shader_arb_get_src_param(ins, &tmp_src, 0, src0_param); + shader_arb_get_src_param(ins, &ins->src[0], 0, src0_param); shader_arb_get_write_mask(ins, &ins->dst[0], write_mask); /* This implements the mova formula used in GLSL. The first two instructions @@ -2255,7 +2254,7 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins) } } -static void shader_hw_rsq_rcp(const struct wined3d_shader_instruction *ins) +static void shader_hw_scalar_op(const struct wined3d_shader_instruction *ins) { struct wined3d_shader_buffer *buffer = ins->ctx->buffer; const char *instruction; @@ -2265,8 +2264,10 @@ static void shader_hw_rsq_rcp(const struct wined3d_shader_instruction *ins) switch(ins->handler_idx) { - case WINED3DSIH_RSQ: instruction = "RSQ"; break; - case WINED3DSIH_RCP: instruction = "RCP"; break; + case WINED3DSIH_RSQ: instruction = "RSQ"; break; + case WINED3DSIH_RCP: instruction = "RCP"; break; + case WINED3DSIH_EXP: instruction = "EX2"; break; + case WINED3DSIH_EXPP: instruction = "EXP"; break; default: instruction = ""; FIXME("Unhandled opcode %#x\n", ins->handler_idx); break; @@ -2884,7 +2885,7 @@ static void vshader_add_footer(IWineD3DVertexShaderImpl *This, struct wined3d_sh { const shader_reg_maps *reg_maps = &This->baseShader.reg_maps; IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)This->baseShader.device; - const WineD3D_GL_Info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; unsigned int i; /* The D3DRS_FOGTABLEMODE render state defines if the shader-generated fog coord is used @@ -2988,7 +2989,7 @@ static void shader_hw_call(const struct wined3d_shader_instruction *ins) } /* GL locking is done by the caller */ -static GLuint create_arb_blt_vertex_program(const WineD3D_GL_Info *gl_info) +static GLuint create_arb_blt_vertex_program(const struct wined3d_gl_info *gl_info) { GLuint program_id = 0; const char *blt_vprogram = @@ -3014,7 +3015,7 @@ static GLuint create_arb_blt_vertex_program(const WineD3D_GL_Info *gl_info) } /* GL locking is done by the caller */ -static GLuint create_arb_blt_fragment_program(const WineD3D_GL_Info *gl_info, enum tex_types tex_type) +static GLuint create_arb_blt_fragment_program(const struct wined3d_gl_info *gl_info, enum tex_types tex_type) { GLuint program_id = 0; static const char * const blt_fprograms[tex_type_count] = @@ -3202,7 +3203,7 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This, struct { const shader_reg_maps* reg_maps = &This->baseShader.reg_maps; CONST DWORD *function = This->baseShader.function; - const WineD3D_GL_Info *gl_info = &((IWineD3DDeviceImpl *)This->baseShader.device)->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)This->baseShader.device)->adapter->gl_info; const local_constant *lconst; GLuint retval; char fragcolor[16]; @@ -3771,7 +3772,7 @@ static GLuint shader_arb_generate_vshader(IWineD3DVertexShaderImpl *This, struct const shader_reg_maps *reg_maps = &This->baseShader.reg_maps; CONST DWORD *function = This->baseShader.function; IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)This->baseShader.device; - const WineD3D_GL_Info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const local_constant *lconst; GLuint ret; DWORD next_local, *lconst_map = local_const_mapping((IWineD3DBaseShaderImpl *) This); @@ -3911,7 +3912,7 @@ static void find_clip_texcoord(IWineD3DPixelShaderImpl *ps) { struct arb_pshader_private *shader_priv = ps->backend_priv; int i; - const WineD3D_GL_Info *gl_info = &((IWineD3DDeviceImpl *)ps->baseShader.device)->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)ps->baseShader.device)->adapter->gl_info; /* See if we can use fragment.texcoord[7] for clipplane emulation * @@ -4041,7 +4042,7 @@ static struct arb_vs_compiled_shader *find_arb_vshader(IWineD3DVertexShaderImpl struct wined3d_shader_buffer buffer; struct arb_vshader_private *shader_data; GLuint ret; - const WineD3D_GL_Info *gl_info = &((IWineD3DDeviceImpl *)shader->baseShader.device)->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)shader->baseShader.device)->adapter->gl_info; if(!shader->backend_priv) { shader->backend_priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data)); @@ -4100,7 +4101,7 @@ static inline void find_arb_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWi { int i; WORD int_skip; - const WineD3D_GL_Info *gl_info = &((IWineD3DDeviceImpl *)shader->baseShader.device)->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)shader->baseShader.device)->adapter->gl_info; find_ps_compile_args(shader, stateblock, &args->super); /* This forces all local boolean constants to 1 to make them stateblock independent */ @@ -4142,7 +4143,7 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW int i; WORD int_skip; IWineD3DDeviceImpl *dev = (IWineD3DDeviceImpl *)shader->baseShader.device; - const WineD3D_GL_Info *gl_info = &dev->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &dev->adapter->gl_info; find_vs_compile_args(shader, stateblock, &args->super); args->boolclip_compare = 0; @@ -4215,7 +4216,7 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW static void shader_arb_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; struct shader_arb_priv *priv = This->shader_priv; - const WineD3D_GL_Info *gl_info = &This->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; int i; /* Deal with pixel shaders first so the vertex shader arg function has the input signature ready */ @@ -4315,7 +4316,7 @@ static void shader_arb_select_depth_blt(IWineD3DDevice *iface, enum tex_types te IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; struct shader_arb_priv *priv = This->shader_priv; GLuint *blt_fprogram = &priv->depth_blt_fprogram_id[tex_type]; - const WineD3D_GL_Info *gl_info = &This->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; if (!priv->depth_blt_vprogram_id) priv->depth_blt_vprogram_id = create_arb_blt_vertex_program(gl_info); GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, priv->depth_blt_vprogram_id)); @@ -4330,7 +4331,7 @@ static void shader_arb_select_depth_blt(IWineD3DDevice *iface, enum tex_types te static void shader_arb_deselect_depth_blt(IWineD3DDevice *iface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; struct shader_arb_priv *priv = This->shader_priv; - const WineD3D_GL_Info *gl_info = &This->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; if (priv->current_vprogram_id) { GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, priv->current_vprogram_id)); @@ -4356,7 +4357,7 @@ static void shader_arb_deselect_depth_blt(IWineD3DDevice *iface) { static void shader_arb_destroy(IWineD3DBaseShader *iface) { IWineD3DBaseShaderImpl *baseShader = (IWineD3DBaseShaderImpl *) iface; IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)baseShader->baseShader.device; - const WineD3D_GL_Info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); @@ -4436,7 +4437,7 @@ static void release_signature(struct wine_rb_entry *entry, void *context) /* Context activation is done by the caller. */ static void shader_arb_free(IWineD3DDevice *iface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - const WineD3D_GL_Info *gl_info = &This->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; struct shader_arb_priv *priv = This->shader_priv; int i; @@ -4459,7 +4460,8 @@ static BOOL shader_arb_dirty_const(IWineD3DDevice *iface) { return TRUE; } -static void shader_arb_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *pCaps) +static void shader_arb_get_caps(WINED3DDEVTYPE devtype, const struct wined3d_gl_info *gl_info, + struct shader_caps *pCaps) { /* We don't have an ARB fixed function pipeline yet, so let the none backend set its caps, * then overwrite the shader specific ones @@ -4580,8 +4582,8 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_ENDIF */ shader_hw_endif, /* WINED3DSIH_ENDLOOP */ shader_hw_endloop, /* WINED3DSIH_ENDREP */ shader_hw_endrep, - /* WINED3DSIH_EXP */ shader_hw_map2gl, - /* WINED3DSIH_EXPP */ shader_hw_map2gl, + /* WINED3DSIH_EXP */ shader_hw_scalar_op, + /* WINED3DSIH_EXPP */ shader_hw_scalar_op, /* WINED3DSIH_FRC */ shader_hw_map2gl, /* WINED3DSIH_IF */ NULL /* Hardcoded into the shader */, /* WINED3DSIH_IFC */ shader_hw_ifc, @@ -4606,10 +4608,10 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_NRM */ shader_hw_nrm, /* WINED3DSIH_PHASE */ NULL, /* WINED3DSIH_POW */ shader_hw_log_pow, - /* WINED3DSIH_RCP */ shader_hw_rsq_rcp, + /* WINED3DSIH_RCP */ shader_hw_scalar_op, /* WINED3DSIH_REP */ shader_hw_rep, /* WINED3DSIH_RET */ shader_hw_ret, - /* WINED3DSIH_RSQ */ shader_hw_rsq_rcp, + /* WINED3DSIH_RSQ */ shader_hw_scalar_op, /* WINED3DSIH_SETP */ NULL, /* WINED3DSIH_SGE */ shader_hw_map2gl, /* WINED3DSIH_SGN */ shader_hw_sgn, @@ -5094,7 +5096,7 @@ static HRESULT arbfp_alloc(IWineD3DDevice *iface) { /* Context activation is done by the caller. */ static void arbfp_free_ffpshader(struct wine_rb_entry *entry, void *context) { - const WineD3D_GL_Info *gl_info = context; + const struct wined3d_gl_info *gl_info = context; struct arbfp_ffp_desc *entry_arb = WINE_RB_ENTRY_VALUE(entry, struct arbfp_ffp_desc, parent.entry); ENTER_GL(); @@ -5117,7 +5119,7 @@ static void arbfp_free(IWineD3DDevice *iface) { } } -static void arbfp_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *caps) +static void arbfp_get_caps(WINED3DDEVTYPE devtype, const struct wined3d_gl_info *gl_info, struct fragment_caps *caps) { caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE | WINED3DTEXOPCAPS_SELECTARG1 | diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index 283e37d235b..29a78503513 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -192,8 +192,9 @@ static const char *debug_mask(GLuint mask) { } #define GLINFO_LOCATION (*gl_info) -static void wrap_op1(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod, - GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) { +static void wrap_op1(const struct wined3d_gl_info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod, + GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) +{ if(dstMask == GL_ALPHA) { TRACE("glAlphaFragmentOp1ATI(%s, %s, %s, %s, %s, %s)\n", debug_op(op), debug_register(dst), debug_dstmod(dstMod), debug_register(arg1), debug_rep(arg1Rep), debug_argmod(arg1Mod)); @@ -206,9 +207,9 @@ static void wrap_op1(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLui } } -static void wrap_op2(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod, - GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, - GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) { +static void wrap_op2(const struct wined3d_gl_info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod, + GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) +{ if(dstMask == GL_ALPHA) { TRACE("glAlphaFragmentOp2ATI(%s, %s, %s, %s, %s, %s, %s, %s, %s)\n", debug_op(op), debug_register(dst), debug_dstmod(dstMod), debug_register(arg1), debug_rep(arg1Rep), debug_argmod(arg1Mod), @@ -223,10 +224,10 @@ static void wrap_op2(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLui } } -static void wrap_op3(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod, - GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, - GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, - GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) { +static void wrap_op3(const struct wined3d_gl_info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod, + GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, + GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) +{ if(dstMask == GL_ALPHA) { /* Leave some free space to fit "GL_NONE, " in to align most alpha and color op lines */ TRACE("glAlphaFragmentOp3ATI(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)\n", debug_op(op), debug_register(dst), debug_dstmod(dstMod), @@ -250,7 +251,7 @@ static void wrap_op3(const WineD3D_GL_Info *gl_info, GLuint op, GLuint dst, GLui } } -static GLuint register_for_arg(DWORD arg, const WineD3D_GL_Info *gl_info, +static GLuint register_for_arg(DWORD arg, const struct wined3d_gl_info *gl_info, unsigned int stage, GLuint *mod, GLuint *rep, GLuint tmparg) { GLenum ret; @@ -378,7 +379,7 @@ static GLuint find_tmpreg(const struct texture_stage_op op[MAX_TEXTURES]) } } -static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], const WineD3D_GL_Info *gl_info) +static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], const struct wined3d_gl_info *gl_info) { GLuint ret = GL_EXTCALL(glGenFragmentShadersATI(1)); unsigned int stage; @@ -1051,7 +1052,7 @@ static void atifs_enable(IWineD3DDevice *iface, BOOL enable) { LEAVE_GL(); } -static void atifs_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *caps) +static void atifs_get_caps(WINED3DDEVTYPE devtype, const struct wined3d_gl_info *gl_info, struct fragment_caps *caps) { caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE | WINED3DTEXOPCAPS_SELECTARG1 | diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index 0c2ede1ce7a..40efdd4aba6 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -928,6 +928,10 @@ static void shader_dump_register(const struct wined3d_shader_register *reg, TRACE("l"); break; + case WINED3DSPR_CONSTBUFFER: + TRACE("cb"); + break; + default: TRACE("unhandled_rtype(%#x)", reg->type); break; @@ -956,14 +960,27 @@ static void shader_dump_register(const struct wined3d_shader_register *reg, } else if (reg->type != WINED3DSPR_RASTOUT && reg->type != WINED3DSPR_MISCTYPE) { - if (reg->rel_addr) + if (reg->array_idx != ~0U) { - TRACE("["); - shader_dump_src_param(reg->rel_addr, shader_version); - TRACE(" + "); + TRACE("%u[%u", offset, reg->array_idx); + if (reg->rel_addr) + { + TRACE(" + "); + shader_dump_src_param(reg->rel_addr, shader_version); + } + TRACE("]"); + } + else + { + if (reg->rel_addr) + { + TRACE("["); + shader_dump_src_param(reg->rel_addr, shader_version); + TRACE(" + "); + } + TRACE("%u", offset); + if (reg->rel_addr) TRACE("]"); } - TRACE("%u", offset); - if (reg->rel_addr) TRACE("]"); } } @@ -1362,7 +1379,8 @@ static void shader_none_free(IWineD3DDevice *iface) {} static BOOL shader_none_dirty_const(IWineD3DDevice *iface) {return FALSE;} #define GLINFO_LOCATION (*gl_info) -static void shader_none_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *pCaps) +static void shader_none_get_caps(WINED3DDEVTYPE devtype, + const struct wined3d_gl_info *gl_info, struct shader_caps *pCaps) { /* Set the shader caps to 0 for the none shader backend */ pCaps->VertexShaderVersion = 0; diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 6971e68aede..172cd6b01a5 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -27,7 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); -#define GLINFO_LOCATION This->adapter->gl_info +#define GLINFO_LOCATION (*gl_info) /* The last used device. * @@ -44,23 +44,56 @@ void context_set_last_device(IWineD3DDeviceImpl *device) /* FBO helper functions */ /* GL locking is done by the caller */ -void context_bind_fbo(IWineD3DDevice *iface, GLenum target, GLuint *fbo) +void context_bind_fbo(struct WineD3DContext *context, GLenum target, GLuint *fbo) { - const IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + const struct wined3d_gl_info *gl_info = context->gl_info; + GLuint f; - if (!*fbo) + if (!fbo) { - GL_EXTCALL(glGenFramebuffersEXT(1, fbo)); - checkGLcall("glGenFramebuffersEXT()"); - TRACE("Created FBO %d\n", *fbo); + f = 0; + } + else + { + if (!*fbo) + { + GL_EXTCALL(glGenFramebuffersEXT(1, fbo)); + checkGLcall("glGenFramebuffersEXT()"); + TRACE("Created FBO %u.\n", *fbo); + } + f = *fbo; } - GL_EXTCALL(glBindFramebufferEXT(target, *fbo)); + switch (target) + { + case GL_READ_FRAMEBUFFER_EXT: + if (context->fbo_read_binding == f) return; + context->fbo_read_binding = f; + break; + + case GL_DRAW_FRAMEBUFFER_EXT: + if (context->fbo_draw_binding == f) return; + context->fbo_draw_binding = f; + break; + + case GL_FRAMEBUFFER_EXT: + if (context->fbo_read_binding == f + && context->fbo_draw_binding == f) return; + context->fbo_read_binding = f; + context->fbo_draw_binding = f; + break; + + default: + FIXME("Unhandled target %#x.\n", target); + break; + } + + GL_EXTCALL(glBindFramebufferEXT(target, f)); checkGLcall("glBindFramebuffer()"); } /* GL locking is done by the caller */ -static void context_clean_fbo_attachments(IWineD3DDeviceImpl *This) +static void context_clean_fbo_attachments(const struct wined3d_gl_info *gl_info) { unsigned int i; @@ -77,24 +110,23 @@ static void context_clean_fbo_attachments(IWineD3DDeviceImpl *This) } /* GL locking is done by the caller */ -static void context_destroy_fbo(IWineD3DDeviceImpl *This, const GLuint *fbo) +static void context_destroy_fbo(struct WineD3DContext *context, GLuint *fbo) { - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, *fbo)); - checkGLcall("glBindFramebuffer()"); + const struct wined3d_gl_info *gl_info = context->gl_info; - context_clean_fbo_attachments(This); + context_bind_fbo(context, GL_FRAMEBUFFER_EXT, fbo); + context_clean_fbo_attachments(gl_info); + context_bind_fbo(context, GL_FRAMEBUFFER_EXT, NULL); - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - checkGLcall("glBindFramebuffer()"); GL_EXTCALL(glDeleteFramebuffersEXT(1, fbo)); checkGLcall("glDeleteFramebuffers()"); } /* GL locking is done by the caller */ -static void context_apply_attachment_filter_states(IWineD3DDevice *iface, IWineD3DSurface *surface, BOOL force_preload) +static void context_apply_attachment_filter_states(IWineD3DSurface *surface, BOOL force_preload) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface; + IWineD3DDeviceImpl *device = surface_impl->resource.wineD3DDevice; IWineD3DBaseTextureImpl *texture_impl; BOOL update_minfilter = FALSE; BOOL update_magfilter = FALSE; @@ -119,7 +151,7 @@ static void context_apply_attachment_filter_states(IWineD3DDevice *iface, IWineD if (texture_impl->baseTexture.bindCount) { WARN("Render targets should not be bound to a sampler\n"); - IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(texture_impl->baseTexture.sampler)); + IWineD3DDeviceImpl_MarkStateDirty(device, STATE_SAMPLER(texture_impl->baseTexture.sampler)); } IWineD3DBaseTexture_Release((IWineD3DBaseTexture *)texture_impl); @@ -155,9 +187,11 @@ static void context_apply_attachment_filter_states(IWineD3DDevice *iface, IWineD } /* GL locking is done by the caller */ -void context_attach_depth_stencil_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer) +void context_attach_depth_stencil_fbo(struct WineD3DContext *context, + GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer) { IWineD3DSurfaceImpl *depth_stencil_impl = (IWineD3DSurfaceImpl *)depth_stencil; + const struct wined3d_gl_info *gl_info = context->gl_info; TRACE("Attach depth stencil %p\n", depth_stencil); @@ -183,7 +217,7 @@ void context_attach_depth_stencil_fbo(IWineD3DDeviceImpl *This, GLenum fbo_targe } else { - context_apply_attachment_filter_states((IWineD3DDevice *)This, depth_stencil, TRUE); + context_apply_attachment_filter_states(depth_stencil, TRUE); if (format_flags & WINED3DFMT_FLAG_DEPTH) { @@ -225,15 +259,17 @@ void context_attach_depth_stencil_fbo(IWineD3DDeviceImpl *This, GLenum fbo_targe } /* GL locking is done by the caller */ -void context_attach_surface_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, DWORD idx, IWineD3DSurface *surface) +void context_attach_surface_fbo(const struct WineD3DContext *context, + GLenum fbo_target, DWORD idx, IWineD3DSurface *surface) { const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface; + const struct wined3d_gl_info *gl_info = context->gl_info; TRACE("Attach surface %p to %u\n", surface, idx); if (surface) { - context_apply_attachment_filter_states((IWineD3DDevice *)This, surface, TRUE); + context_apply_attachment_filter_states(surface, TRUE); GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_COLOR_ATTACHMENT0_EXT + idx, surface_impl->texture_target, surface_impl->texture_name, surface_impl->texture_level)); @@ -245,9 +281,9 @@ void context_attach_surface_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, DWO } /* GL locking is done by the caller */ -static void context_check_fbo_status(IWineD3DDevice *iface) +static void context_check_fbo_status(struct WineD3DContext *context) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + const struct wined3d_gl_info *gl_info = context->gl_info; GLenum status; status = GL_EXTCALL(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); @@ -262,7 +298,7 @@ static void context_check_fbo_status(IWineD3DDevice *iface) /* Dump the FBO attachments */ for (i = 0; i < GL_LIMITS(buffers); ++i) { - attachment = (IWineD3DSurfaceImpl *)This->activeContext->current_fbo->render_targets[i]; + attachment = (IWineD3DSurfaceImpl *)context->current_fbo->render_targets[i]; if (attachment) { FIXME("\tColor attachment %d: (%p) %s %ux%u\n", @@ -270,7 +306,7 @@ static void context_check_fbo_status(IWineD3DDevice *iface) attachment->pow2Width, attachment->pow2Height); } } - attachment = (IWineD3DSurfaceImpl *)This->activeContext->current_fbo->depth_stencil; + attachment = (IWineD3DSurfaceImpl *)context->current_fbo->depth_stencil; if (attachment) { FIXME("\tDepth attachment: (%p) %s %ux%u\n", @@ -280,15 +316,16 @@ static void context_check_fbo_status(IWineD3DDevice *iface) } } -static struct fbo_entry *context_create_fbo_entry(IWineD3DDevice *iface) +static struct fbo_entry *context_create_fbo_entry(struct WineD3DContext *context) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; + const struct wined3d_gl_info *gl_info = context->gl_info; struct fbo_entry *entry; entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry)); entry->render_targets = HeapAlloc(GetProcessHeap(), 0, GL_LIMITS(buffers) * sizeof(*entry->render_targets)); - memcpy(entry->render_targets, This->render_targets, GL_LIMITS(buffers) * sizeof(*entry->render_targets)); - entry->depth_stencil = This->stencilBufferTarget; + memcpy(entry->render_targets, device->render_targets, GL_LIMITS(buffers) * sizeof(*entry->render_targets)); + entry->depth_stencil = device->stencilBufferTarget; entry->attached = FALSE; entry->id = 0; @@ -296,26 +333,26 @@ static struct fbo_entry *context_create_fbo_entry(IWineD3DDevice *iface) } /* GL locking is done by the caller */ -static void context_reuse_fbo_entry(IWineD3DDevice *iface, struct fbo_entry *entry) +static void context_reuse_fbo_entry(struct WineD3DContext *context, struct fbo_entry *entry) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; + const struct wined3d_gl_info *gl_info = context->gl_info; - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, entry->id)); - checkGLcall("glBindFramebuffer()"); - context_clean_fbo_attachments(This); + context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &entry->id); + context_clean_fbo_attachments(gl_info); - memcpy(entry->render_targets, This->render_targets, GL_LIMITS(buffers) * sizeof(*entry->render_targets)); - entry->depth_stencil = This->stencilBufferTarget; + memcpy(entry->render_targets, device->render_targets, GL_LIMITS(buffers) * sizeof(*entry->render_targets)); + entry->depth_stencil = device->stencilBufferTarget; entry->attached = FALSE; } /* GL locking is done by the caller */ -static void context_destroy_fbo_entry(IWineD3DDeviceImpl *This, WineD3DContext *context, struct fbo_entry *entry) +static void context_destroy_fbo_entry(struct WineD3DContext *context, struct fbo_entry *entry) { if (entry->id) { TRACE("Destroy FBO %d\n", entry->id); - context_destroy_fbo(This, &entry->id); + context_destroy_fbo(context, &entry->id); } --context->fbo_entry_count; list_remove(&entry->entry); @@ -325,15 +362,16 @@ static void context_destroy_fbo_entry(IWineD3DDeviceImpl *This, WineD3DContext * /* GL locking is done by the caller */ -static struct fbo_entry *context_find_fbo_entry(IWineD3DDevice *iface, WineD3DContext *context) +static struct fbo_entry *context_find_fbo_entry(struct WineD3DContext *context) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; + const struct wined3d_gl_info *gl_info = context->gl_info; struct fbo_entry *entry; LIST_FOR_EACH_ENTRY(entry, &context->fbo_list, struct fbo_entry, entry) { - if (!memcmp(entry->render_targets, This->render_targets, GL_LIMITS(buffers) * sizeof(*entry->render_targets)) - && entry->depth_stencil == This->stencilBufferTarget) + if (!memcmp(entry->render_targets, device->render_targets, GL_LIMITS(buffers) * sizeof(*entry->render_targets)) + && entry->depth_stencil == device->stencilBufferTarget) { list_remove(&entry->entry); list_add_head(&context->fbo_list, &entry->entry); @@ -343,14 +381,14 @@ static struct fbo_entry *context_find_fbo_entry(IWineD3DDevice *iface, WineD3DCo if (context->fbo_entry_count < WINED3D_MAX_FBO_ENTRIES) { - entry = context_create_fbo_entry(iface); + entry = context_create_fbo_entry(context); list_add_head(&context->fbo_list, &entry->entry); ++context->fbo_entry_count; } else { entry = LIST_ENTRY(list_tail(&context->fbo_list), struct fbo_entry, entry); - context_reuse_fbo_entry(iface, entry); + context_reuse_fbo_entry(context, entry); list_remove(&entry->entry); list_add_head(&context->fbo_list, &entry->entry); } @@ -359,67 +397,68 @@ static struct fbo_entry *context_find_fbo_entry(IWineD3DDevice *iface, WineD3DCo } /* GL locking is done by the caller */ -static void context_apply_fbo_entry(IWineD3DDevice *iface, struct fbo_entry *entry) +static void context_apply_fbo_entry(struct WineD3DContext *context, struct fbo_entry *entry) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; + const struct wined3d_gl_info *gl_info = context->gl_info; unsigned int i; - context_bind_fbo(iface, GL_FRAMEBUFFER_EXT, &entry->id); + context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &entry->id); if (!entry->attached) { /* Apply render targets */ for (i = 0; i < GL_LIMITS(buffers); ++i) { - IWineD3DSurface *render_target = This->render_targets[i]; - context_attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, i, render_target); + IWineD3DSurface *render_target = device->render_targets[i]; + context_attach_surface_fbo(context, GL_FRAMEBUFFER_EXT, i, render_target); } /* Apply depth targets */ - if (This->stencilBufferTarget) { - unsigned int w = ((IWineD3DSurfaceImpl *)This->render_targets[0])->pow2Width; - unsigned int h = ((IWineD3DSurfaceImpl *)This->render_targets[0])->pow2Height; + if (device->stencilBufferTarget) + { + unsigned int w = ((IWineD3DSurfaceImpl *)device->render_targets[0])->pow2Width; + unsigned int h = ((IWineD3DSurfaceImpl *)device->render_targets[0])->pow2Height; - surface_set_compatible_renderbuffer(This->stencilBufferTarget, w, h); + surface_set_compatible_renderbuffer(device->stencilBufferTarget, w, h); } - context_attach_depth_stencil_fbo(This, GL_FRAMEBUFFER_EXT, This->stencilBufferTarget, TRUE); + context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER_EXT, device->stencilBufferTarget, TRUE); entry->attached = TRUE; } else { for (i = 0; i < GL_LIMITS(buffers); ++i) { - if (This->render_targets[i]) - context_apply_attachment_filter_states(iface, This->render_targets[i], FALSE); + if (device->render_targets[i]) + context_apply_attachment_filter_states(device->render_targets[i], FALSE); } - if (This->stencilBufferTarget) - context_apply_attachment_filter_states(iface, This->stencilBufferTarget, FALSE); + if (device->stencilBufferTarget) + context_apply_attachment_filter_states(device->stencilBufferTarget, FALSE); } for (i = 0; i < GL_LIMITS(buffers); ++i) { - if (This->render_targets[i]) - This->draw_buffers[i] = GL_COLOR_ATTACHMENT0_EXT + i; + if (device->render_targets[i]) + device->draw_buffers[i] = GL_COLOR_ATTACHMENT0_EXT + i; else - This->draw_buffers[i] = GL_NONE; + device->draw_buffers[i] = GL_NONE; } } /* GL locking is done by the caller */ -static void context_apply_fbo_state(IWineD3DDevice *iface) +static void context_apply_fbo_state(struct WineD3DContext *context) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - WineD3DContext *context = This->activeContext; + IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; - if (This->render_offscreen) + if (device->render_offscreen) { - context->current_fbo = context_find_fbo_entry(iface, context); - context_apply_fbo_entry(iface, context->current_fbo); + context->current_fbo = context_find_fbo_entry(context); + context_apply_fbo_entry(context, context->current_fbo); } else { context->current_fbo = NULL; - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); + context_bind_fbo(context, GL_FRAMEBUFFER_EXT, NULL); } - context_check_fbo_status(iface); + context_check_fbo_status(context); } void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource, WINED3DRESOURCETYPE type) @@ -485,6 +524,7 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource for (i = 0; i < This->numContexts; ++i) { WineD3DContext *context = This->contexts[i]; + const struct wined3d_gl_info *gl_info = context->gl_info; struct fbo_entry *entry, *entry2; ENTER_GL(); @@ -498,13 +538,13 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource { if (entry->render_targets[j] == (IWineD3DSurface *)resource) { - context_destroy_fbo_entry(This, context, entry); + context_destroy_fbo_entry(context, entry); destroyed = TRUE; } } if (!destroyed && entry->depth_stencil == (IWineD3DSurface *)resource) - context_destroy_fbo_entry(This, context, entry); + context_destroy_fbo_entry(context, entry); } LEAVE_GL(); @@ -791,11 +831,12 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, * *****************************************************************************/ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target, HWND win_handle, BOOL create_pbuffer, const WINED3DPRESENT_PARAMETERS *pPresentParms) { - HDC oldDrawable, hdc; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; HPBUFFERARB pbuffer = NULL; - HGLRC ctx = NULL, oldCtx; WineD3DContext *ret = NULL; unsigned int s; + HGLRC ctx; + HDC hdc; TRACE("(%p): Creating a %s context for render target %p\n", This, create_pbuffer ? "offscreen" : "onscreen", target); @@ -944,7 +985,15 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar } ctx = pwglCreateContext(hdc); - if(This->numContexts) pwglShareLists(This->contexts[0]->glCtx, ctx); + if (This->numContexts) + { + if (!pwglShareLists(This->contexts[0]->glCtx, ctx)) + { + DWORD err = GetLastError(); + ERR("wglShareLists(%p, %p) failed, last error %#x.\n", + This->contexts[0]->glCtx, ctx, err); + } + } if(!ctx) { ERR("Failed to create a WGL context\n"); @@ -957,13 +1006,18 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar ret = AddContextToArray(This, win_handle, hdc, ctx, pbuffer); if(!ret) { ERR("Failed to add the newly created context to the context list\n"); - pwglDeleteContext(ctx); + if (!pwglDeleteContext(ctx)) + { + DWORD err = GetLastError(); + ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, err); + } if(create_pbuffer) { GL_EXTCALL(wglReleasePbufferDCARB(pbuffer, hdc)); GL_EXTCALL(wglDestroyPbufferARB(pbuffer)); } goto out; } + ret->gl_info = &This->adapter->gl_info; ret->surface = (IWineD3DSurface *) target; ret->isPBuffer = create_pbuffer; ret->tid = GetCurrentThreadId(); @@ -984,12 +1038,6 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar list_init(&ret->fbo_list); /* Set up the context defaults */ - oldCtx = pwglGetCurrentContext(); - oldDrawable = pwglGetCurrentDC(); - if(oldCtx && oldDrawable) { - /* See comment in ActivateContext context switching */ - This->frag_pipe->enable_extension((IWineD3DDevice *) This, FALSE); - } if(pwglMakeCurrent(hdc, ctx) == FALSE) { ERR("Cannot activate context to set up defaults\n"); goto out; @@ -1074,17 +1122,7 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar } LEAVE_GL(); - /* Never keep GL_FRAGMENT_SHADER_ATI enabled on a context that we switch away from, - * but enable it for the first context we create, and reenable it on the old context - */ - if(oldDrawable && oldCtx) { - if (!pwglMakeCurrent(oldDrawable, oldCtx)) - { - ERR("Failed to make previous GL context %p current.\n", oldCtx); - } - } else { - context_set_last_device(This); - } + context_set_last_device(This); This->frag_pipe->enable_extension((IWineD3DDevice *) This, TRUE); return ret; @@ -1165,6 +1203,7 @@ static void RemoveContextFromArray(IWineD3DDeviceImpl *This, WineD3DContext *con * *****************************************************************************/ void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context) { + const struct wined3d_gl_info *gl_info = context->gl_info; struct fbo_entry *entry, *entry2; BOOL has_glctx; @@ -1180,19 +1219,19 @@ void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context) { LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &context->fbo_list, struct fbo_entry, entry) { if (!has_glctx) entry->id = 0; - context_destroy_fbo_entry(This, context, entry); + context_destroy_fbo_entry(context, entry); } if (has_glctx) { if (context->src_fbo) { TRACE("Destroy src FBO %d\n", context->src_fbo); - context_destroy_fbo(This, &context->src_fbo); + context_destroy_fbo(context, &context->src_fbo); } if (context->dst_fbo) { TRACE("Destroy dst FBO %d\n", context->dst_fbo); - context_destroy_fbo(This, &context->dst_fbo); + context_destroy_fbo(context, &context->dst_fbo); } if (context->dummy_arbfp_prog) { @@ -1259,6 +1298,7 @@ static inline void set_blit_dimension(UINT width, UINT height) { static inline void SetupForBlit(IWineD3DDeviceImpl *This, WineD3DContext *context, UINT width, UINT height) { int i, sampler; const struct StateEntry *StateTable = This->StateTable; + const struct wined3d_gl_info *gl_info = context->gl_info; TRACE("Setting up context %p for blitting\n", context); if(context->last_was_blit) { @@ -1655,6 +1695,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf /* Context activation is done by the caller. */ static void apply_draw_buffer(IWineD3DDeviceImpl *This, IWineD3DSurface *target, BOOL blit) { + const struct wined3d_gl_info *gl_info = This->activeContext->gl_info; IWineD3DSwapChain *swapchain; if (SUCCEEDED(IWineD3DSurface_GetContainer(target, &IID_IWineD3DSwapChain, (void **)&swapchain))) @@ -1715,6 +1756,7 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU BYTE shift; WineD3DContext *context; const struct StateEntry *StateTable = This->StateTable; + const struct wined3d_gl_info *gl_info; TRACE("(%p): Selecting context for render target %p, thread %d\n", This, target, tid); if(This->lastActiveRenderTarget != target || tid != This->lastThread) { @@ -1727,6 +1769,8 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU context = This->activeContext; } + gl_info = context->gl_info; + /* Activate the opengl context */ if(last_device != This || context != This->activeContext) { BOOL ret; @@ -1764,7 +1808,7 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU case CTXUSAGE_DRAWPRIM: if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { ENTER_GL(); - context_apply_fbo_state((IWineD3DDevice *)This); + context_apply_fbo_state(context); LEAVE_GL(); } if (context->draw_buffer_dirty) { @@ -1778,14 +1822,13 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU if (This->render_offscreen) { FIXME("Activating for CTXUSAGE_BLIT for an offscreen target with ORM_FBO. This should be avoided.\n"); ENTER_GL(); - context_bind_fbo((IWineD3DDevice *)This, GL_FRAMEBUFFER_EXT, &context->dst_fbo); - context_attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, target); - context_attach_depth_stencil_fbo(This, GL_FRAMEBUFFER_EXT, NULL, FALSE); + context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &context->dst_fbo); + context_attach_surface_fbo(context, GL_FRAMEBUFFER_EXT, 0, target); + context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER_EXT, NULL, FALSE); LEAVE_GL(); } else { ENTER_GL(); - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - checkGLcall("glFramebufferRenderbufferEXT"); + context_bind_fbo(context, GL_FRAMEBUFFER_EXT, NULL); LEAVE_GL(); } context->draw_buffer_dirty = TRUE; diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index a00470bef21..4a4ce1969a4 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -140,7 +140,7 @@ static void cubetexture_cleanup(IWineD3DCubeTextureImpl *This, D3DCB_DESTROYSURF HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent) { - const WineD3D_GL_Info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info); UINT pow2_edge_length; unsigned int i, j; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 36a079df0a2..a1ed4dc1e7a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -6041,7 +6041,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, ActivateContext(This, surface, CTXUSAGE_RESOURCELOAD); ENTER_GL(); - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); + context_bind_fbo(This->activeContext, GL_FRAMEBUFFER_EXT, NULL); buffer = surface_get_gl_buffer(surface, swapchain); glDrawBuffer(buffer); checkGLcall("glDrawBuffer()"); @@ -6050,9 +6050,9 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); ENTER_GL(); - context_bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->activeContext->dst_fbo); - context_attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, surface); - context_attach_depth_stencil_fbo(This, GL_FRAMEBUFFER_EXT, NULL, FALSE); + context_bind_fbo(This->activeContext, GL_FRAMEBUFFER_EXT, &This->activeContext->dst_fbo); + context_attach_surface_fbo(This->activeContext, GL_FRAMEBUFFER_EXT, 0, surface); + context_attach_depth_stencil_fbo(This->activeContext, GL_FRAMEBUFFER_EXT, NULL, FALSE); } if (rect) { @@ -6081,10 +6081,9 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, checkGLcall("glClear"); if (This->activeContext->current_fbo) { - context_bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->activeContext->current_fbo->id); + context_bind_fbo(This->activeContext, GL_FRAMEBUFFER_EXT, &This->activeContext->current_fbo->id); } else { - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - checkGLcall("glBindFramebuffer()"); + context_bind_fbo(This->activeContext, GL_FRAMEBUFFER_EXT, NULL); } if (swapchain && surface == ((IWineD3DSwapChainImpl *)swapchain)->frontBuffer @@ -6468,17 +6467,17 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED } ENTER_GL(); - GL_EXTCALL(glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0)); + context_bind_fbo(This->activeContext, GL_READ_FRAMEBUFFER_EXT, NULL); glReadBuffer(buffer); checkGLcall("glReadBuffer()"); } else { TRACE("Source surface %p is offscreen\n", src_surface); ENTER_GL(); - context_bind_fbo(iface, GL_READ_FRAMEBUFFER_EXT, &This->activeContext->src_fbo); - context_attach_surface_fbo(This, GL_READ_FRAMEBUFFER_EXT, 0, src_surface); + context_bind_fbo(This->activeContext, GL_READ_FRAMEBUFFER_EXT, &This->activeContext->src_fbo); + context_attach_surface_fbo(This->activeContext, GL_READ_FRAMEBUFFER_EXT, 0, src_surface); glReadBuffer(GL_COLOR_ATTACHMENT0_EXT); checkGLcall("glReadBuffer()"); - context_attach_depth_stencil_fbo(This, GL_READ_FRAMEBUFFER_EXT, NULL, FALSE); + context_attach_depth_stencil_fbo(This->activeContext, GL_READ_FRAMEBUFFER_EXT, NULL, FALSE); } LEAVE_GL(); @@ -6507,18 +6506,18 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED } ENTER_GL(); - GL_EXTCALL(glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0)); + context_bind_fbo(This->activeContext, GL_DRAW_FRAMEBUFFER_EXT, NULL); glDrawBuffer(buffer); checkGLcall("glDrawBuffer()"); } else { TRACE("Destination surface %p is offscreen\n", dst_surface); ENTER_GL(); - context_bind_fbo(iface, GL_DRAW_FRAMEBUFFER_EXT, &This->activeContext->dst_fbo); - context_attach_surface_fbo(This, GL_DRAW_FRAMEBUFFER_EXT, 0, dst_surface); + context_bind_fbo(This->activeContext, GL_DRAW_FRAMEBUFFER_EXT, &This->activeContext->dst_fbo); + context_attach_surface_fbo(This->activeContext, GL_DRAW_FRAMEBUFFER_EXT, 0, dst_surface); glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT); checkGLcall("glDrawBuffer()"); - context_attach_depth_stencil_fbo(This, GL_DRAW_FRAMEBUFFER_EXT, NULL, FALSE); + context_attach_depth_stencil_fbo(This->activeContext, GL_DRAW_FRAMEBUFFER_EXT, NULL, FALSE); } glDisable(GL_SCISSOR_TEST); IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE)); @@ -6536,10 +6535,9 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED IWineD3DSurface_ModifyLocation(dst_surface, SFLAG_INDRAWABLE, TRUE); if (This->activeContext->current_fbo) { - context_bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->activeContext->current_fbo->id); + context_bind_fbo(This->activeContext, GL_FRAMEBUFFER_EXT, &This->activeContext->current_fbo->id); } else { - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - checkGLcall("glBindFramebuffer()"); + context_bind_fbo(This->activeContext, GL_FRAMEBUFFER_EXT, NULL); } /* If we switched from GL_BACK to GL_FRONT above, we need to switch back here */ diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 1ba7ca5354d..3036bfc63f0 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -213,7 +213,12 @@ static void WineD3D_ReleaseFakeGLContext(struct wined3d_fake_gl_ctx *ctx) ERR_(d3d_caps)("Failed to disable fake GL context.\n"); } - pwglDeleteContext(ctx->gl_ctx); + if (!pwglDeleteContext(ctx->gl_ctx)) + { + DWORD err = GetLastError(); + ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx->gl_ctx, err); + } + ReleaseDC(ctx->wnd, ctx->dc); DestroyWindow(ctx->wnd); } @@ -347,7 +352,8 @@ static ULONG WINAPI IWineD3DImpl_Release(IWineD3D *iface) { /* Set the shader type for this device, depending on the given capabilities, * the device type, and the user preferences in wined3d_settings */ -static void select_shader_mode(const WineD3D_GL_Info *gl_info, WINED3DDEVTYPE DeviceType, int *ps_selected, int *vs_selected) +static void select_shader_mode(const struct wined3d_gl_info *gl_info, + WINED3DDEVTYPE DeviceType, int *ps_selected, int *vs_selected) { if (wined3d_settings.vs_mode == VS_NONE) { *vs_selected = SHADER_NONE; @@ -379,11 +385,8 @@ static void select_shader_mode(const WineD3D_GL_Info *gl_info, WINED3DDEVTYPE De } /** Select the number of report maximum shader constants based on the selected shader modes */ -static void select_shader_max_constants( - int ps_selected_mode, - int vs_selected_mode, - WineD3D_GL_Info *gl_info) { - +static void select_shader_max_constants(int ps_selected_mode, int vs_selected_mode, struct wined3d_gl_info *gl_info) +{ switch (vs_selected_mode) { case SHADER_GLSL: gl_info->max_vshader_constantsF = gl_info->vs_glsl_constantsF; @@ -414,7 +417,7 @@ static void select_shader_max_constants( **********************************************************/ /* GL locking is done by the caller */ -static inline BOOL test_arb_vs_offset_limit(const WineD3D_GL_Info *gl_info) +static inline BOOL test_arb_vs_offset_limit(const struct wined3d_gl_info *gl_info) { GLuint prog; BOOL ret = FALSE; @@ -459,7 +462,7 @@ static DWORD ver_for_ext(GL_SupportedExt ext) return 0; } -static BOOL match_ati_r300_to_500(const WineD3D_GL_Info *gl_info, const char *gl_renderer) +static BOOL match_ati_r300_to_500(const struct wined3d_gl_info *gl_info, const char *gl_renderer) { if (gl_info->gl_vendor != VENDOR_ATI) return FALSE; if (gl_info->gl_card == CARD_ATI_RADEON_9500) return TRUE; @@ -468,7 +471,7 @@ static BOOL match_ati_r300_to_500(const WineD3D_GL_Info *gl_info, const char *gl return FALSE; } -static BOOL match_geforce5(const WineD3D_GL_Info *gl_info, const char *gl_renderer) +static BOOL match_geforce5(const struct wined3d_gl_info *gl_info, const char *gl_renderer) { if (gl_info->gl_vendor == VENDOR_NVIDIA) { @@ -480,7 +483,7 @@ static BOOL match_geforce5(const WineD3D_GL_Info *gl_info, const char *gl_render return FALSE; } -static BOOL match_apple(const WineD3D_GL_Info *gl_info, const char *gl_renderer) +static BOOL match_apple(const struct wined3d_gl_info *gl_info, const char *gl_renderer) { /* MacOS has various specialities in the extensions it advertises. Some have to be loaded from * the opengl 1.2+ core, while other extensions are advertised, but software emulated. So try to @@ -511,7 +514,7 @@ static BOOL match_apple(const WineD3D_GL_Info *gl_info, const char *gl_renderer) } /* Context activation is done by the caller. */ -static void test_pbo_functionality(WineD3D_GL_Info *gl_info) +static void test_pbo_functionality(struct wined3d_gl_info *gl_info) { /* Some OpenGL implementations, namely Apple's Geforce 8 driver, advertises PBOs, * but glTexSubImage from a PBO fails miserably, with the first line repeated over @@ -579,12 +582,12 @@ static void test_pbo_functionality(WineD3D_GL_Info *gl_info) } } -static BOOL match_apple_intel(const WineD3D_GL_Info *gl_info, const char *gl_renderer) +static BOOL match_apple_intel(const struct wined3d_gl_info *gl_info, const char *gl_renderer) { return gl_info->gl_vendor == VENDOR_INTEL && match_apple(gl_info, gl_renderer); } -static BOOL match_apple_nonr500ati(const WineD3D_GL_Info *gl_info, const char *gl_renderer) +static BOOL match_apple_nonr500ati(const struct wined3d_gl_info *gl_info, const char *gl_renderer) { if (!match_apple(gl_info, gl_renderer)) return FALSE; if (gl_info->gl_vendor != VENDOR_ATI) return FALSE; @@ -592,7 +595,7 @@ static BOOL match_apple_nonr500ati(const WineD3D_GL_Info *gl_info, const char *g return TRUE; } -static BOOL match_fglrx(const WineD3D_GL_Info *gl_info, const char *gl_renderer) +static BOOL match_fglrx(const struct wined3d_gl_info *gl_info, const char *gl_renderer) { if (gl_info->gl_vendor != VENDOR_ATI) return FALSE; if (match_apple(gl_info, gl_renderer)) return FALSE; @@ -600,7 +603,7 @@ static BOOL match_fglrx(const WineD3D_GL_Info *gl_info, const char *gl_renderer) return TRUE; } -static BOOL match_dx10_capable(const WineD3D_GL_Info *gl_info, const char *gl_renderer) +static BOOL match_dx10_capable(const struct wined3d_gl_info *gl_info, const char *gl_renderer) { /* DX9 cards support 40 single float varyings in hardware, most drivers report 32. ATI misreports * 44 varyings. So assume that if we have more than 44 varyings we have a dx10 card. @@ -613,7 +616,7 @@ static BOOL match_dx10_capable(const WineD3D_GL_Info *gl_info, const char *gl_re } /* A GL context is provided by the caller */ -static BOOL match_allows_spec_alpha(const WineD3D_GL_Info *gl_info, const char *gl_renderer) +static BOOL match_allows_spec_alpha(const struct wined3d_gl_info *gl_info, const char *gl_renderer) { GLenum error; DWORD data[16]; @@ -639,7 +642,7 @@ static BOOL match_allows_spec_alpha(const WineD3D_GL_Info *gl_info, const char * } } -static void quirk_arb_constants(WineD3D_GL_Info *gl_info) +static void quirk_arb_constants(struct wined3d_gl_info *gl_info) { TRACE_(d3d_caps)("Using ARB vs constant limit(=%u) for GLSL.\n", gl_info->vs_arb_constantsF); gl_info->vs_glsl_constantsF = gl_info->vs_arb_constantsF; @@ -647,7 +650,7 @@ static void quirk_arb_constants(WineD3D_GL_Info *gl_info) gl_info->ps_glsl_constantsF = gl_info->ps_arb_constantsF; } -static void quirk_apple_glsl_constants(WineD3D_GL_Info *gl_info) +static void quirk_apple_glsl_constants(struct wined3d_gl_info *gl_info) { quirk_arb_constants(gl_info); /* MacOS needs uniforms for relative addressing offsets. This can accumulate to quite a few uniforms. @@ -669,7 +672,7 @@ static void quirk_apple_glsl_constants(WineD3D_GL_Info *gl_info) * * Note that disabling the extension entirely does not gain predictability because there is no point * sprite capability flag in d3d, so the potential rendering bugs are the same if we disable the extension. */ -static void quirk_one_point_sprite(WineD3D_GL_Info *gl_info) +static void quirk_one_point_sprite(struct wined3d_gl_info *gl_info) { if (gl_info->supported[ARB_POINT_SPRITE]) { @@ -678,7 +681,7 @@ static void quirk_one_point_sprite(WineD3D_GL_Info *gl_info) } } -static void quirk_ati_dx9(WineD3D_GL_Info *gl_info) +static void quirk_ati_dx9(struct wined3d_gl_info *gl_info) { quirk_arb_constants(gl_info); @@ -703,7 +706,7 @@ static void quirk_ati_dx9(WineD3D_GL_Info *gl_info) gl_info->reserved_glsl_constants = max(gl_info->reserved_glsl_constants, 8); } -static void quirk_no_np2(WineD3D_GL_Info *gl_info) +static void quirk_no_np2(struct wined3d_gl_info *gl_info) { /* The nVidia GeForceFX series reports OpenGL 2.0 capabilities with the latest drivers versions, but * doesn't explicitly advertise the ARB_tex_npot extension in the GL extension string. @@ -724,7 +727,7 @@ static void quirk_no_np2(WineD3D_GL_Info *gl_info) gl_info->supported[ARB_TEXTURE_RECTANGLE] = TRUE; } -static void quirk_texcoord_w(WineD3D_GL_Info *gl_info) +static void quirk_texcoord_w(struct wined3d_gl_info *gl_info) { /* The Intel GPUs on MacOS set the .w register of texcoords to 0.0 by default, which causes problems * with fixed function fragment processing. Ideally this flag should be detected with a test shader @@ -743,20 +746,20 @@ static void quirk_texcoord_w(WineD3D_GL_Info *gl_info) gl_info->quirks |= WINED3D_QUIRK_SET_TEXCOORD_W; } -static void quirk_clip_varying(WineD3D_GL_Info *gl_info) +static void quirk_clip_varying(struct wined3d_gl_info *gl_info) { gl_info->quirks |= WINED3D_QUIRK_GLSL_CLIP_VARYING; } -static void quirk_allows_specular_alpha(WineD3D_GL_Info *gl_info) +static void quirk_allows_specular_alpha(struct wined3d_gl_info *gl_info) { gl_info->quirks |= WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA; } struct driver_quirk { - BOOL (*match)(const WineD3D_GL_Info *gl_info, const char *gl_renderer); - void (*apply)(WineD3D_GL_Info *gl_info); + BOOL (*match)(const struct wined3d_gl_info *gl_info, const char *gl_renderer); + void (*apply)(struct wined3d_gl_info *gl_info); const char *description; }; @@ -889,7 +892,7 @@ static const struct driver_version_information driver_version_table[] = }; /* Context activation is done by the caller. */ -static void fixup_extensions(WineD3D_GL_Info *gl_info, const char *gl_renderer) +static void fixup_extensions(struct wined3d_gl_info *gl_info, const char *gl_renderer) { unsigned int i; @@ -923,7 +926,8 @@ static void fixup_extensions(WineD3D_GL_Info *gl_info, const char *gl_renderer) } /* Context activation is done by the caller. */ -static BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { +static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info) +{ const char *GL_Extensions = NULL; const char *WGL_Extensions = NULL; const char *gl_string = NULL; @@ -2349,7 +2353,7 @@ static HRESULT WINAPI IWineD3DImpl_GetAdapterIdentifier(IWineD3D *iface, UINT Ad return WINED3D_OK; } -static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt(const WineD3D_GL_Info *gl_info, +static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt(const struct wined3d_gl_info *gl_info, const WineD3D_PixelFormat *cfg, const struct GlPixelFormatDesc *format_desc) { short redSize, greenSize, blueSize, alphaSize, colorBits; @@ -2398,7 +2402,7 @@ static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt(const WineD3D_GL_I return FALSE; } -static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithDepthFmt(const WineD3D_GL_Info *gl_info, +static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithDepthFmt(const struct wined3d_gl_info *gl_info, const WineD3D_PixelFormat *cfg, const struct GlPixelFormatDesc *format_desc) { short depthSize, stencilSize; @@ -2777,7 +2781,7 @@ static BOOL CheckRenderTargetCapability(struct WineD3DAdapter *adapter, static BOOL CheckSrgbReadCapability(struct WineD3DAdapter *adapter, const struct GlPixelFormatDesc *format_desc) { - const WineD3D_GL_Info *gl_info = &adapter->gl_info; + const struct wined3d_gl_info *gl_info = &adapter->gl_info; /* Check for supported sRGB formats (Texture loading and framebuffer) */ if(!GL_SUPPORT(EXT_TEXTURE_SRGB)) { @@ -2857,7 +2861,7 @@ static BOOL CheckWrapAndMipCapability(struct WineD3DAdapter *adapter, const stru static BOOL CheckTextureCapability(struct WineD3DAdapter *adapter, WINED3DDEVTYPE DeviceType, const struct GlPixelFormatDesc *format_desc) { - const WineD3D_GL_Info *gl_info = &adapter->gl_info; + const struct wined3d_gl_info *gl_info = &adapter->gl_info; const shader_backend_t *shader_backend; const struct fragment_pipeline *fp; @@ -3137,7 +3141,7 @@ static BOOL CheckSurfaceCapability(struct WineD3DAdapter *adapter, const struct static BOOL CheckVertexTextureCapability(struct WineD3DAdapter *adapter, const struct GlPixelFormatDesc *format_desc) { - const WineD3D_GL_Info *gl_info = &adapter->gl_info; + const struct wined3d_gl_info *gl_info = &adapter->gl_info; if (!GL_LIMITS(vertex_samplers)) { TRACE_(d3d_caps)("[FAILED]\n"); @@ -3166,7 +3170,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt WINED3DSURFTYPE SurfaceType) { IWineD3DImpl *This = (IWineD3DImpl *)iface; struct WineD3DAdapter *adapter = &This->adapters[Adapter]; - const WineD3D_GL_Info *gl_info = &adapter->gl_info; + const struct wined3d_gl_info *gl_info = &adapter->gl_info; const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(CheckFormat, gl_info); const struct GlPixelFormatDesc *adapter_format_desc = getFormatDescEntry(AdapterFormat, gl_info); DWORD UsageCaps = 0; @@ -3703,7 +3707,7 @@ static const shader_backend_t *select_shader_backend(struct WineD3DAdapter *adap static const struct fragment_pipeline *select_fragment_implementation(struct WineD3DAdapter *adapter, WINED3DDEVTYPE DeviceType) { - const WineD3D_GL_Info *gl_info = &adapter->gl_info; + const struct wined3d_gl_info *gl_info = &adapter->gl_info; int vs_selected_mode; int ps_selected_mode; @@ -3723,7 +3727,7 @@ static const struct fragment_pipeline *select_fragment_implementation(struct Win static const struct blit_shader *select_blit_implementation(struct WineD3DAdapter *adapter, WINED3DDEVTYPE DeviceType) { - const WineD3D_GL_Info *gl_info = &adapter->gl_info; + const struct wined3d_gl_info *gl_info = &adapter->gl_info; int vs_selected_mode; int ps_selected_mode; @@ -3742,7 +3746,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, IWineD3DImpl *This = (IWineD3DImpl *)iface; struct WineD3DAdapter *adapter = &This->adapters[Adapter]; - const WineD3D_GL_Info *gl_info = &adapter->gl_info; + const struct wined3d_gl_info *gl_info = &adapter->gl_info; int vs_selected_mode; int ps_selected_mode; struct shader_caps shader_caps; @@ -4519,7 +4523,7 @@ static void WINE_GLAPI warn_no_specular_func(const void *data) WARN("GL_EXT_secondary_color not supported\n"); } -static void fillGLAttribFuncs(const WineD3D_GL_Info *gl_info) +static void fillGLAttribFuncs(const struct wined3d_gl_info *gl_info) { position_funcs[WINED3D_FFP_EMIT_FLOAT1] = invalid_func; position_funcs[WINED3D_FFP_EMIT_FLOAT2] = invalid_func; @@ -4690,7 +4694,7 @@ BOOL InitAdapters(IWineD3DImpl *This) /* For now only one default adapter */ { struct WineD3DAdapter *adapter = &This->adapters[0]; - const WineD3D_GL_Info *gl_info = &adapter->gl_info; + const struct wined3d_gl_info *gl_info = &adapter->gl_info; struct wined3d_fake_gl_ctx fake_gl_ctx = {0}; int iPixelFormat; int res; diff --git a/dlls/wined3d/gl_compat.c b/dlls/wined3d/gl_compat.c index f0b59381770..dbd496b5aae 100644 --- a/dlls/wined3d/gl_compat.c +++ b/dlls/wined3d/gl_compat.c @@ -343,7 +343,8 @@ static void wine_glFogCoorddvEXT(const GLdouble *f) { /* End GL_EXT_fog_coord emulation */ #define GLINFO_LOCATION (*gl_info) -void add_gl_compat_wrappers(WineD3D_GL_Info *gl_info) { +void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info) +{ if(!GL_SUPPORT(ARB_MULTITEXTURE)) { TRACE("Applying GL_ARB_multitexture emulation hooks\n"); gl_info->glActiveTextureARB = wine_glActiveTextureARB; diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 83511aab885..018961672dc 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -177,7 +177,7 @@ static char *get_info_log_line(char **ptr) /** Prints the GLSL info log which will contain error messages if they exist */ /* GL locking is done by the caller */ -static void print_glsl_info_log(const WineD3D_GL_Info *gl_info, GLhandleARB obj) +static void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLhandleARB obj) { int infologLength = 0; char *infoLog; @@ -242,7 +242,8 @@ static void print_glsl_info_log(const WineD3D_GL_Info *gl_info, GLhandleARB obj) * Loads (pixel shader) samplers */ /* GL locking is done by the caller */ -static void shader_glsl_load_psamplers(const WineD3D_GL_Info *gl_info, DWORD *tex_unit_map, GLhandleARB programId) +static void shader_glsl_load_psamplers(const struct wined3d_gl_info *gl_info, + DWORD *tex_unit_map, GLhandleARB programId) { GLint name_loc; int i; @@ -266,7 +267,8 @@ static void shader_glsl_load_psamplers(const WineD3D_GL_Info *gl_info, DWORD *te } /* GL locking is done by the caller */ -static void shader_glsl_load_vsamplers(const WineD3D_GL_Info *gl_info, DWORD *tex_unit_map, GLhandleARB programId) +static void shader_glsl_load_vsamplers(const struct wined3d_gl_info *gl_info, + DWORD *tex_unit_map, GLhandleARB programId) { GLint name_loc; char sampler_name[20]; @@ -290,7 +292,7 @@ static void shader_glsl_load_vsamplers(const WineD3D_GL_Info *gl_info, DWORD *te } /* GL locking is done by the caller */ -static inline void walk_constant_heap(const WineD3D_GL_Info *gl_info, const float *constants, +static inline void walk_constant_heap(const struct wined3d_gl_info *gl_info, const float *constants, const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version) { int stack_idx = 0; @@ -352,7 +354,7 @@ static inline void walk_constant_heap(const WineD3D_GL_Info *gl_info, const floa } /* GL locking is done by the caller */ -static inline void apply_clamped_constant(const WineD3D_GL_Info *gl_info, GLint location, const GLfloat *data) +static inline void apply_clamped_constant(const struct wined3d_gl_info *gl_info, GLint location, const GLfloat *data) { GLfloat clamped_constant[4]; @@ -367,7 +369,7 @@ static inline void apply_clamped_constant(const WineD3D_GL_Info *gl_info, GLint } /* GL locking is done by the caller */ -static inline void walk_constant_heap_clamped(const WineD3D_GL_Info *gl_info, const float *constants, +static inline void walk_constant_heap_clamped(const struct wined3d_gl_info *gl_info, const float *constants, const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version) { int stack_idx = 0; @@ -428,7 +430,7 @@ static inline void walk_constant_heap_clamped(const WineD3D_GL_Info *gl_info, co /* Loads floating point constants (aka uniforms) into the currently set GLSL program. */ /* GL locking is done by the caller */ -static void shader_glsl_load_constantsF(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info, +static void shader_glsl_load_constantsF(IWineD3DBaseShaderImpl *This, const struct wined3d_gl_info *gl_info, const float *constants, const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, UINT version) { @@ -459,7 +461,7 @@ static void shader_glsl_load_constantsF(IWineD3DBaseShaderImpl *This, const Wine /* Loads integer constants (aka uniforms) into the currently set GLSL program. */ /* GL locking is done by the caller */ -static void shader_glsl_load_constantsI(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info, +static void shader_glsl_load_constantsI(IWineD3DBaseShaderImpl *This, const struct wined3d_gl_info *gl_info, const GLint locations[MAX_CONST_I], const int *constants, WORD constants_set) { unsigned int i; @@ -496,7 +498,7 @@ static void shader_glsl_load_constantsI(IWineD3DBaseShaderImpl *This, const Wine /* Loads boolean constants (aka uniforms) into the currently set GLSL program. */ /* GL locking is done by the caller */ -static void shader_glsl_load_constantsB(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info, +static void shader_glsl_load_constantsB(IWineD3DBaseShaderImpl *This, const struct wined3d_gl_info *gl_info, GLhandleARB programId, const BOOL *constants, WORD constants_set) { GLint tmp_loc; @@ -594,7 +596,7 @@ static void shader_glsl_load_np2fixup_constants( } if (prog->ps_args.np2_fixup && -1 != prog->np2Fixup_location) { - const WineD3D_GL_Info* gl_info = &deviceImpl->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &deviceImpl->adapter->gl_info; const IWineD3DStateBlockImpl* stateBlock = (const IWineD3DStateBlockImpl*) deviceImpl->stateBlock; UINT i; UINT fixup = prog->ps_args.np2_fixup; @@ -633,7 +635,7 @@ static void shader_glsl_load_constants( IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) device; struct shader_glsl_priv *priv = deviceImpl->shader_priv; IWineD3DStateBlockImpl* stateBlock = deviceImpl->stateBlock; - const WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &deviceImpl->adapter->gl_info; GLhandleARB programId; struct glsl_shader_prog_link *prog = priv->glsl_program; @@ -790,7 +792,7 @@ static void shader_glsl_update_float_pixel_constants(IWineD3DDevice *iface, UINT } } -static unsigned int vec4_varyings(DWORD shader_major, const WineD3D_GL_Info *gl_info) +static unsigned int vec4_varyings(DWORD shader_major, const struct wined3d_gl_info *gl_info) { unsigned int ret = GL_LIMITS(glsl_varyings) / 4; /* 4.0 shaders do not write clip coords because d3d10 does not support user clipplanes */ @@ -803,7 +805,7 @@ static unsigned int vec4_varyings(DWORD shader_major, const WineD3D_GL_Info *gl_ /** Generate the variable & register declarations for the GLSL output target */ static void shader_generate_glsl_declarations(IWineD3DBaseShader *iface, const shader_reg_maps *reg_maps, - struct wined3d_shader_buffer *buffer, const WineD3D_GL_Info *gl_info, + struct wined3d_shader_buffer *buffer, const struct wined3d_gl_info *gl_info, struct shader_glsl_ctx_priv *ctx_priv) { IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; @@ -1183,7 +1185,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device; - const WineD3D_GL_Info* gl_info = &deviceImpl->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &deviceImpl->adapter->gl_info; char pshader = shader_is_pshader_version(This->baseShader.reg_maps.shader_version.type); *is_color = FALSE; @@ -2727,7 +2729,7 @@ static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins) { IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device; - const WineD3D_GL_Info* gl_info = &deviceImpl->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &deviceImpl->adapter->gl_info; glsl_sample_function_t sample_function; glsl_src_param_t coord_param, dx_param, dy_param; DWORD sample_flags = WINED3D_GLSL_SAMPLE_GRAD; @@ -3345,7 +3347,7 @@ static struct glsl_shader_prog_link *get_glsl_program_entry(struct shader_glsl_p } /* GL locking is done by the caller */ -static void delete_glsl_program_entry(struct shader_glsl_priv *priv, const WineD3D_GL_Info *gl_info, +static void delete_glsl_program_entry(struct shader_glsl_priv *priv, const struct wined3d_gl_info *gl_info, struct glsl_shader_prog_link *entry) { glsl_program_key_t key; @@ -3364,7 +3366,7 @@ static void delete_glsl_program_entry(struct shader_glsl_priv *priv, const WineD HeapFree(GetProcessHeap(), 0, entry); } -static void handle_ps3_input(struct wined3d_shader_buffer *buffer, const WineD3D_GL_Info *gl_info, const DWORD *map, +static void handle_ps3_input(struct wined3d_shader_buffer *buffer, const struct wined3d_gl_info *gl_info, const DWORD *map, const struct wined3d_shader_signature_element *input_signature, const struct shader_reg_maps *reg_maps_in, const struct wined3d_shader_signature_element *output_signature, const struct shader_reg_maps *reg_maps_out) { @@ -3527,7 +3529,7 @@ static void handle_ps3_input(struct wined3d_shader_buffer *buffer, const WineD3D /* GL locking is done by the caller */ static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer *buffer, - IWineD3DVertexShader *vertexshader, IWineD3DPixelShader *pixelshader, const WineD3D_GL_Info *gl_info) + IWineD3DVertexShader *vertexshader, IWineD3DPixelShader *pixelshader, const struct wined3d_gl_info *gl_info) { GLhandleARB ret = 0; IWineD3DVertexShaderImpl *vs = (IWineD3DVertexShaderImpl *) vertexshader; @@ -3674,7 +3676,7 @@ static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer } /* GL locking is done by the caller */ -static void hardcode_local_constants(IWineD3DBaseShaderImpl *shader, const WineD3D_GL_Info *gl_info, +static void hardcode_local_constants(IWineD3DBaseShaderImpl *shader, const struct wined3d_gl_info *gl_info, GLhandleARB programId, char prefix) { const local_constant *lconst; @@ -3697,7 +3699,7 @@ static GLuint shader_glsl_generate_pshader(IWineD3DPixelShaderImpl *This, struct { const struct shader_reg_maps *reg_maps = &This->baseShader.reg_maps; CONST DWORD *function = This->baseShader.function; - const WineD3D_GL_Info *gl_info = &((IWineD3DDeviceImpl *)This->baseShader.device)->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)This->baseShader.device)->adapter->gl_info; struct shader_glsl_ctx_priv priv_ctx; /* Create the hw GLSL shader object and assign it as the shader->prgId */ @@ -3795,7 +3797,7 @@ static GLuint shader_glsl_generate_vshader(IWineD3DVertexShaderImpl *This, { const struct shader_reg_maps *reg_maps = &This->baseShader.reg_maps; CONST DWORD *function = This->baseShader.function; - const WineD3D_GL_Info *gl_info = &((IWineD3DDeviceImpl *)This->baseShader.device)->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)This->baseShader.device)->adapter->gl_info; struct shader_glsl_ctx_priv priv_ctx; /* Create the hw GLSL shader program and assign it as the shader->prgId */ @@ -3992,7 +3994,7 @@ static GLhandleARB find_glsl_vshader(struct wined3d_shader_buffer *buffer, IWine static void set_glsl_shader_program(IWineD3DDevice *iface, BOOL use_ps, BOOL use_vs) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; struct shader_glsl_priv *priv = This->shader_priv; - const WineD3D_GL_Info *gl_info = &This->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; IWineD3DPixelShader *pshader = use_ps ? This->stateBlock->pixelShader : NULL; IWineD3DVertexShader *vshader = use_vs ? This->stateBlock->vertexShader : NULL; struct glsl_shader_prog_link *entry = NULL; @@ -4172,7 +4174,7 @@ static void set_glsl_shader_program(IWineD3DDevice *iface, BOOL use_ps, BOOL use } /* GL locking is done by the caller */ -static GLhandleARB create_glsl_blt_shader(const WineD3D_GL_Info *gl_info, enum tex_types tex_type) +static GLhandleARB create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, enum tex_types tex_type) { GLhandleARB program_id; GLhandleARB vshader_id, pshader_id; @@ -4250,7 +4252,7 @@ static GLhandleARB create_glsl_blt_shader(const WineD3D_GL_Info *gl_info, enum t static void shader_glsl_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; struct shader_glsl_priv *priv = This->shader_priv; - const WineD3D_GL_Info *gl_info = &This->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; GLhandleARB program_id = 0; GLenum old_vertex_color_clamp, current_vertex_color_clamp; @@ -4286,7 +4288,7 @@ static void shader_glsl_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) { /* GL locking is done by the caller */ static void shader_glsl_select_depth_blt(IWineD3DDevice *iface, enum tex_types tex_type) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - const WineD3D_GL_Info *gl_info = &This->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; struct shader_glsl_priv *priv = This->shader_priv; GLhandleARB *blt_program = &priv->depth_blt_program[tex_type]; @@ -4304,7 +4306,7 @@ static void shader_glsl_select_depth_blt(IWineD3DDevice *iface, enum tex_types t /* GL locking is done by the caller */ static void shader_glsl_deselect_depth_blt(IWineD3DDevice *iface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - const WineD3D_GL_Info *gl_info = &This->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; struct shader_glsl_priv *priv = This->shader_priv; GLhandleARB program_id; @@ -4320,7 +4322,7 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) { IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *) iface; IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)This->baseShader.device; struct shader_glsl_priv *priv = device->shader_priv; - const WineD3D_GL_Info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; IWineD3DPixelShaderImpl *ps = NULL; IWineD3DVertexShaderImpl *vs = NULL; @@ -4470,7 +4472,7 @@ static const struct wine_rb_functions wined3d_glsl_program_rb_functions = static HRESULT shader_glsl_alloc(IWineD3DDevice *iface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - const WineD3D_GL_Info *gl_info = &This->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; struct shader_glsl_priv *priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct shader_glsl_priv)); SIZE_T stack_size = wined3d_log2i(max(GL_LIMITS(vshader_constantsF), GL_LIMITS(pshader_constantsF))) + 1; @@ -4522,7 +4524,7 @@ fail: /* Context activation is done by the caller. */ static void shader_glsl_free(IWineD3DDevice *iface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - const WineD3D_GL_Info *gl_info = &This->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; struct shader_glsl_priv *priv = This->shader_priv; int i; @@ -4550,7 +4552,8 @@ static BOOL shader_glsl_dirty_const(IWineD3DDevice *iface) { return FALSE; } -static void shader_glsl_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *pCaps) +static void shader_glsl_get_caps(WINED3DDEVTYPE devtype, + const struct wined3d_gl_info *gl_info, struct shader_caps *pCaps) { /* Nvidia Geforce6/7 or Ati R4xx/R5xx cards with GLSL support, support VS 3.0 but older Nvidia/Ati * models with GLSL support only support 2.0. In case of nvidia we can detect VS 2.0 support using diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index 14a758fb2f6..1448cfcac46 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -610,7 +610,8 @@ static void nvts_enable(IWineD3DDevice *iface, BOOL enable) { LEAVE_GL(); } -static void nvrc_fragment_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *pCaps) +static void nvrc_fragment_get_caps(WINED3DDEVTYPE devtype, + const struct wined3d_gl_info *gl_info, struct fragment_caps *pCaps) { pCaps->TextureOpCaps = WINED3DTEXOPCAPS_ADD | WINED3DTEXOPCAPS_ADDSIGNED | diff --git a/dlls/wined3d/shader_sm1.c b/dlls/wined3d/shader_sm1.c index a626d52a763..ead2769e34c 100644 --- a/dlls/wined3d/shader_sm1.c +++ b/dlls/wined3d/shader_sm1.c @@ -349,6 +349,7 @@ static void shader_parse_src_param(DWORD param, const struct wined3d_shader_src_ src->reg.type = ((param & WINED3DSP_REGTYPE_MASK) >> WINED3DSP_REGTYPE_SHIFT) | ((param & WINED3DSP_REGTYPE_MASK2) >> WINED3DSP_REGTYPE_SHIFT2); src->reg.idx = param & WINED3DSP_REGNUM_MASK; + src->reg.array_idx = ~0U; src->swizzle = (param & WINED3DSP_SWIZZLE_MASK) >> WINED3DSP_SWIZZLE_SHIFT; src->modifiers = (param & WINED3DSP_SRCMOD_MASK) >> WINED3DSP_SRCMOD_SHIFT; src->reg.rel_addr = rel_addr; @@ -360,6 +361,7 @@ static void shader_parse_dst_param(DWORD param, const struct wined3d_shader_src_ dst->reg.type = ((param & WINED3DSP_REGTYPE_MASK) >> WINED3DSP_REGTYPE_SHIFT) | ((param & WINED3DSP_REGTYPE_MASK2) >> WINED3DSP_REGTYPE_SHIFT2); dst->reg.idx = param & WINED3DSP_REGNUM_MASK; + dst->reg.array_idx = ~0U; dst->write_mask = (param & WINED3D_SM1_WRITEMASK_MASK) >> WINED3D_SM1_WRITEMASK_SHIFT; dst->modifiers = (param & WINED3DSP_DSTMOD_MASK) >> WINED3DSP_DSTMOD_SHIFT; dst->shift = (param & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT; diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index 5cc445db69a..8686232ccf1 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -28,6 +28,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); #define WINED3D_SM4_OPCODE_MASK 0xff +#define WINED3D_SM4_REGISTER_ORDER_SHIFT 20 +#define WINED3D_SM4_REGISTER_ORDER_MASK (0x3 << WINED3D_SM4_REGISTER_ORDER_SHIFT) + #define WINED3D_SM4_REGISTER_TYPE_SHIFT 12 #define WINED3D_SM4_REGISTER_TYPE_MASK (0xf << WINED3D_SM4_REGISTER_TYPE_SHIFT) @@ -46,19 +49,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); enum wined3d_sm4_opcode { WINED3D_SM4_OP_ADD = 0x00, + WINED3D_SM4_OP_DP3 = 0x10, + WINED3D_SM4_OP_DP4 = 0x11, WINED3D_SM4_OP_EXP = 0x19, WINED3D_SM4_OP_MOV = 0x36, WINED3D_SM4_OP_MUL = 0x38, WINED3D_SM4_OP_RET = 0x3e, + WINED3D_SM4_OP_RSQ = 0x44, WINED3D_SM4_OP_SINCOS = 0x4d, }; enum wined3d_sm4_register_type { - WINED3D_SM4_RT_TEMP = 0x0, - WINED3D_SM4_RT_INPUT = 0x1, - WINED3D_SM4_RT_OUTPUT = 0x2, - WINED3D_SM4_RT_IMMCONST = 0x4, + WINED3D_SM4_RT_TEMP = 0x0, + WINED3D_SM4_RT_INPUT = 0x1, + WINED3D_SM4_RT_OUTPUT = 0x2, + WINED3D_SM4_RT_IMMCONST = 0x4, + WINED3D_SM4_RT_CONSTBUFFER = 0x8, }; enum wined3d_sm4_immconst_type @@ -92,20 +99,27 @@ struct sysval_map static const struct wined3d_sm4_opcode_info opcode_table[] = { {WINED3D_SM4_OP_ADD, WINED3DSIH_ADD, 1, 2}, + {WINED3D_SM4_OP_DP3, WINED3DSIH_DP3, 1, 2}, + {WINED3D_SM4_OP_DP4, WINED3DSIH_DP4, 1, 2}, {WINED3D_SM4_OP_EXP, WINED3DSIH_EXP, 1, 1}, {WINED3D_SM4_OP_MOV, WINED3DSIH_MOV, 1, 1}, {WINED3D_SM4_OP_MUL, WINED3DSIH_MUL, 1, 2}, {WINED3D_SM4_OP_RET, WINED3DSIH_RET, 0, 0}, + {WINED3D_SM4_OP_RSQ, WINED3DSIH_RSQ, 1, 1}, {WINED3D_SM4_OP_SINCOS, WINED3DSIH_SINCOS, 1, 2}, }; static const WINED3DSHADER_PARAM_REGISTER_TYPE register_type_table[] = { - /* WINED3D_SM4_RT_TEMP */ WINED3DSPR_TEMP, - /* WINED3D_SM4_RT_INPUT */ WINED3DSPR_INPUT, - /* WINED3D_SM4_RT_OUTPUT */ WINED3DSPR_OUTPUT, - /* UNKNOWN */ 0, - /* WINED3D_SM4_RT_IMMCONST */ WINED3DSPR_IMMCONST, + /* WINED3D_SM4_RT_TEMP */ WINED3DSPR_TEMP, + /* WINED3D_SM4_RT_INPUT */ WINED3DSPR_INPUT, + /* WINED3D_SM4_RT_OUTPUT */ WINED3DSPR_OUTPUT, + /* UNKNOWN */ 0, + /* WINED3D_SM4_RT_IMMCONST */ WINED3DSPR_IMMCONST, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* WINED3D_SM4_RT_CONSTBUFFER */ WINED3DSPR_CONSTBUFFER, }; static const struct sysval_map sysval_map[] = @@ -265,6 +279,7 @@ static void shader_sm4_read_src_param(void *data, const DWORD **ptr, struct wine struct wined3d_sm4_data *priv = data; DWORD token = *(*ptr)++; enum wined3d_sm4_register_type register_type; + DWORD order; register_type = (token & WINED3D_SM4_REGISTER_TYPE_MASK) >> WINED3D_SM4_REGISTER_TYPE_SHIFT; if (register_type >= sizeof(register_type_table) / sizeof(*register_type_table)) @@ -277,6 +292,16 @@ static void shader_sm4_read_src_param(void *data, const DWORD **ptr, struct wine src_param->reg.type = register_type_table[register_type]; } + order = (token & WINED3D_SM4_REGISTER_ORDER_MASK) >> WINED3D_SM4_REGISTER_ORDER_SHIFT; + + if (order < 1) src_param->reg.idx = ~0U; + else src_param->reg.idx = *(*ptr)++; + + if (order < 2) src_param->reg.array_idx = ~0U; + else src_param->reg.array_idx = *(*ptr)++; + + if (order > 2) FIXME("Unhandled order %u.\n", order); + if (register_type == WINED3D_SM4_RT_IMMCONST) { enum wined3d_sm4_immconst_type immconst_type = @@ -304,7 +329,6 @@ static void shader_sm4_read_src_param(void *data, const DWORD **ptr, struct wine } else { - src_param->reg.idx = *(*ptr)++; src_param->swizzle = (token & WINED3D_SM4_SWIZZLE_MASK) >> WINED3D_SM4_SWIZZLE_SHIFT; } @@ -319,8 +343,8 @@ static void shader_sm4_read_dst_param(void *data, const DWORD **ptr, struct wine { struct wined3d_sm4_data *priv = data; DWORD token = *(*ptr)++; - UINT register_idx = *(*ptr)++; enum wined3d_sm4_register_type register_type; + DWORD order; register_type = (token & WINED3D_SM4_REGISTER_TYPE_MASK) >> WINED3D_SM4_REGISTER_TYPE_SHIFT; if (register_type >= sizeof(register_type_table) / sizeof(*register_type_table)) @@ -333,7 +357,16 @@ static void shader_sm4_read_dst_param(void *data, const DWORD **ptr, struct wine dst_param->reg.type = register_type_table[register_type]; } - dst_param->reg.idx = register_idx; + order = (token & WINED3D_SM4_REGISTER_ORDER_MASK) >> WINED3D_SM4_REGISTER_ORDER_SHIFT; + + if (order < 1) dst_param->reg.idx = ~0U; + else dst_param->reg.idx = *(*ptr)++; + + if (order < 2) dst_param->reg.array_idx = ~0U; + else dst_param->reg.array_idx = *(*ptr)++; + + if (order > 2) FIXME("Unhandled order %u.\n", order); + dst_param->write_mask = (token & WINED3D_SM4_WRITEMASK_MASK) >> WINED3D_SM4_WRITEMASK_SHIFT; dst_param->modifiers = 0; dst_param->shift = 0; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 9f77b5bb153..e4de1cf761f 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -5392,7 +5392,8 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { /* Context activation is done by the caller. */ static void ffp_enable(IWineD3DDevice *iface, BOOL enable) { } -static void ffp_fragment_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *pCaps) +static void ffp_fragment_get_caps(WINED3DDEVTYPE devtype, + const struct wined3d_gl_info *gl_info, struct fragment_caps *pCaps) { pCaps->TextureOpCaps = WINED3DTEXOPCAPS_ADD | WINED3DTEXOPCAPS_ADDSIGNED | @@ -5479,7 +5480,7 @@ static void multistate_apply_3(DWORD state, IWineD3DStateBlockImpl *stateblock, } HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs, - const WineD3D_GL_Info *gl_info, const struct StateEntryTemplate *vertex, + const struct wined3d_gl_info *gl_info, const struct StateEntryTemplate *vertex, const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc) { unsigned int i, type, handlers; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 83d02d4c29f..0122e1ef07c 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -38,7 +38,7 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); static void surface_cleanup(IWineD3DSurfaceImpl *This) { IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; - const WineD3D_GL_Info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; renderbuffer_entry_t *entry, *entry2; TRACE("(%p) : Cleaning up.\n", This); @@ -124,7 +124,7 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent) { - const WineD3D_GL_Info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, &GLINFO_LOCATION); void (*cleanup)(IWineD3DSurfaceImpl *This); unsigned int resource_size; @@ -4404,7 +4404,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { /* Note that we use depth_blt here as well, rather than glCopyTexImage2D * directly on the FBO texture. That's because we need to flip. */ - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); + context_bind_fbo(device->activeContext, GL_FRAMEBUFFER_EXT, NULL); if (This->texture_target == GL_TEXTURE_RECTANGLE_ARB) { glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding); @@ -4418,6 +4418,9 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { 0, 0, This->currentDesc.Width, This->currentDesc.Height, 0); glTexParameteri(bind_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(bind_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(bind_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(bind_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(bind_target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); glTexParameteri(bind_target, GL_DEPTH_TEXTURE_MODE_ARB, GL_LUMINANCE); glBindTexture(bind_target, old_binding); @@ -4436,20 +4439,19 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { device->depth_blt_rb_h = This->currentDesc.Height; } - context_bind_fbo((IWineD3DDevice *)device, GL_FRAMEBUFFER_EXT, &device->activeContext->dst_fbo); + context_bind_fbo(device->activeContext, GL_FRAMEBUFFER_EXT, &device->activeContext->dst_fbo); GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, device->depth_blt_rb)); checkGLcall("glFramebufferRenderbufferEXT"); - context_attach_depth_stencil_fbo(device, GL_FRAMEBUFFER_EXT, iface, FALSE); + context_attach_depth_stencil_fbo(device->activeContext, GL_FRAMEBUFFER_EXT, iface, FALSE); /* Do the actual blit */ surface_depth_blt(This, device->depth_blt_texture, This->currentDesc.Width, This->currentDesc.Height, bind_target); checkGLcall("depth_blt"); if (device->activeContext->current_fbo) { - context_bind_fbo((IWineD3DDevice *)device, GL_FRAMEBUFFER_EXT, &device->activeContext->current_fbo->id); + context_bind_fbo(device->activeContext, GL_FRAMEBUFFER_EXT, &device->activeContext->current_fbo->id); } else { - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - checkGLcall("glBindFramebuffer()"); + context_bind_fbo(device->activeContext, GL_FRAMEBUFFER_EXT, NULL); } LEAVE_GL(); @@ -4462,15 +4464,13 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { ENTER_GL(); - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - checkGLcall("glBindFramebuffer()"); + context_bind_fbo(device->activeContext, GL_FRAMEBUFFER_EXT, NULL); surface_depth_blt(This, This->texture_name, This->currentDesc.Width, This->currentDesc.Height, This->texture_target); checkGLcall("depth_blt"); if (device->activeContext->current_fbo) { - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, device->activeContext->current_fbo->id)); - checkGLcall("glBindFramebuffer()"); + context_bind_fbo(device->activeContext, GL_FRAMEBUFFER_EXT, &device->activeContext->current_fbo->id); } LEAVE_GL(); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 36a0876a5d4..7bc8d7bcaa7 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -127,7 +127,7 @@ static void texture_cleanup(IWineD3DTextureImpl *This, D3DCB_DESTROYSURFACEFN su HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent) { - const WineD3D_GL_Info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info); UINT pow2_width, pow2_height; UINT tmp_w, tmp_h; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 5e04cc67157..d2631ea0135 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -500,7 +500,7 @@ static inline int getFmtIdx(WINED3DFORMAT fmt) { return -1; } -static BOOL init_format_base_info(WineD3D_GL_Info *gl_info) +static BOOL init_format_base_info(struct wined3d_gl_info *gl_info) { UINT format_count = sizeof(formats) / sizeof(*formats); UINT i; @@ -529,7 +529,7 @@ static BOOL init_format_base_info(WineD3D_GL_Info *gl_info) return TRUE; } -static BOOL init_format_compression_info(WineD3D_GL_Info *gl_info) +static BOOL init_format_compression_info(struct wined3d_gl_info *gl_info) { unsigned int i; @@ -558,7 +558,7 @@ static BOOL init_format_compression_info(WineD3D_GL_Info *gl_info) #define GLINFO_LOCATION (*gl_info) /* Context activation is done by the caller. */ -static void check_fbo_compat(const WineD3D_GL_Info *gl_info, struct GlPixelFormatDesc *format_desc) +static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct GlPixelFormatDesc *format_desc) { /* Check if the default internal format is supported as a frame buffer * target, otherwise fall back to the render target internal. @@ -682,7 +682,7 @@ static void check_fbo_compat(const WineD3D_GL_Info *gl_info, struct GlPixelForma } /* Context activation is done by the caller. */ -static void init_format_fbo_compat_info(WineD3D_GL_Info *gl_info) +static void init_format_fbo_compat_info(struct wined3d_gl_info *gl_info) { unsigned int i; GLuint fbo; @@ -738,7 +738,7 @@ static void init_format_fbo_compat_info(WineD3D_GL_Info *gl_info) } } -static BOOL init_format_texture_info(WineD3D_GL_Info *gl_info) +static BOOL init_format_texture_info(struct wined3d_gl_info *gl_info) { unsigned int i; @@ -770,7 +770,7 @@ static BOOL init_format_texture_info(WineD3D_GL_Info *gl_info) return TRUE; } -static void apply_format_fixups(WineD3D_GL_Info *gl_info) +static void apply_format_fixups(struct wined3d_gl_info *gl_info) { int idx; @@ -890,7 +890,7 @@ static void apply_format_fixups(WineD3D_GL_Info *gl_info) } } -static BOOL init_format_vertex_info(WineD3D_GL_Info *gl_info) +static BOOL init_format_vertex_info(struct wined3d_gl_info *gl_info) { unsigned int i; @@ -918,7 +918,7 @@ static BOOL init_format_vertex_info(WineD3D_GL_Info *gl_info) return TRUE; } -BOOL initPixelFormatsNoGL(WineD3D_GL_Info *gl_info) +BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info) { if (!init_format_base_info(gl_info)) return FALSE; @@ -932,7 +932,7 @@ BOOL initPixelFormatsNoGL(WineD3D_GL_Info *gl_info) } /* Context activation is done by the caller. */ -BOOL initPixelFormats(WineD3D_GL_Info *gl_info) +BOOL initPixelFormats(struct wined3d_gl_info *gl_info) { if (!init_format_base_info(gl_info)) return FALSE; @@ -954,7 +954,7 @@ fail: #define GLINFO_LOCATION This->adapter->gl_info -const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const WineD3D_GL_Info *gl_info) +const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const struct wined3d_gl_info *gl_info) { int idx = getFmtIdx(fmt); diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c index de9d0d88e34..374a75f9169 100644 --- a/dlls/wined3d/volumetexture.c +++ b/dlls/wined3d/volumetexture.c @@ -32,7 +32,7 @@ static void volumetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINE /* Override the IWineD3DResource Preload method. */ IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; - const WineD3D_GL_Info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; BOOL srgb_mode = This->baseTexture.is_srgb; BOOL srgb_was_toggled = FALSE; unsigned int i; @@ -99,7 +99,7 @@ static void volumetexture_cleanup(IWineD3DVolumeTextureImpl *This, D3DCB_DESTROY HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT height, UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent) { - const WineD3D_GL_Info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info); UINT tmp_w, tmp_h, tmp_d; unsigned int i; diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 42efdf704d2..dcb526b0059 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -3949,67 +3949,68 @@ typedef BOOL (WINAPI * WINED3D_PFNWGLSETPIXELFORMATWINE) (HDC hdc, int iPixelFor ****************************************************/ #define USE_GL_FUNC(type, pfn, ext, replace) type pfn; -typedef struct _WineD3D_GL_Info { - GL_Vendors gl_vendor; - GL_Cards gl_card; - UINT vidmem; - DWORD driver_version; - DWORD driver_version_hipart; - const char *driver_description; - /** - * CAPS Constants - */ - UINT max_buffers; - UINT max_lights; - UINT max_textures; - UINT max_texture_stages; - UINT max_fragment_samplers; - UINT max_vertex_samplers; - UINT max_combined_samplers; - UINT max_sampler_stages; - UINT max_clipplanes; - UINT max_texture_size; - UINT max_texture3d_size; - float max_pointsize, max_pointsizemin; - UINT max_point_sprite_units; - UINT max_blends; - UINT max_anisotropy; - UINT max_glsl_varyings; - float max_shininess; - - unsigned max_vshader_constantsF; - unsigned max_pshader_constantsF; - - unsigned vs_arb_constantsF; - unsigned vs_arb_max_instructions; - unsigned vs_arb_max_temps; - unsigned ps_arb_constantsF; - unsigned ps_arb_max_local_constants; - unsigned ps_arb_max_instructions; - unsigned ps_arb_max_temps; - unsigned vs_glsl_constantsF; - unsigned ps_glsl_constantsF; - - GL_PSVersion ps_arb_version; - GL_PSVersion ps_nv_version; - - GL_VSVersion vs_arb_version; - GL_VSVersion vs_nv_version; - GL_VSVersion vs_ati_version; - - DWORD reserved_glsl_constants; - - DWORD quirks; - - BOOL supported[WINED3D_GL_EXT_COUNT]; - - /** OpenGL EXT and ARB functions ptr */ - GL_EXT_FUNCS_GEN - /** OpenGL WGL functions ptr */ - WGL_EXT_FUNCS_GEN - - struct GlPixelFormatDesc *gl_formats; -} WineD3D_GL_Info; + +struct wined3d_gl_info +{ + GL_Vendors gl_vendor; + GL_Cards gl_card; + UINT vidmem; + DWORD driver_version; + DWORD driver_version_hipart; + const char *driver_description; + + UINT max_buffers; + UINT max_lights; + UINT max_textures; + UINT max_texture_stages; + UINT max_fragment_samplers; + UINT max_vertex_samplers; + UINT max_combined_samplers; + UINT max_sampler_stages; + UINT max_clipplanes; + UINT max_texture_size; + UINT max_texture3d_size; + float max_pointsize, max_pointsizemin; + UINT max_point_sprite_units; + UINT max_blends; + UINT max_anisotropy; + UINT max_glsl_varyings; + float max_shininess; + + unsigned int max_vshader_constantsF; + unsigned int max_pshader_constantsF; + + unsigned int vs_arb_constantsF; + unsigned int vs_arb_max_instructions; + unsigned int vs_arb_max_temps; + unsigned int ps_arb_constantsF; + unsigned int ps_arb_max_local_constants; + unsigned int ps_arb_max_instructions; + unsigned int ps_arb_max_temps; + unsigned int vs_glsl_constantsF; + unsigned int ps_glsl_constantsF; + + GL_PSVersion ps_arb_version; + GL_PSVersion ps_nv_version; + + GL_VSVersion vs_arb_version; + GL_VSVersion vs_nv_version; + GL_VSVersion vs_ati_version; + + DWORD reserved_glsl_constants; + + DWORD quirks; + + BOOL supported[WINED3D_GL_EXT_COUNT]; + + /* GL function pointers */ + GL_EXT_FUNCS_GEN + /* WGL function pointers */ + WGL_EXT_FUNCS_GEN + + struct GlPixelFormatDesc *gl_formats; +}; + #undef USE_GL_FUNC #endif /* __WINE_WINED3D_GL */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 60c363cba5c..5d61c6af4ab 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -325,6 +325,7 @@ typedef enum _WINED3DSHADER_PARAM_REGISTER_TYPE WINED3DSPR_LABEL = 18, WINED3DSPR_PREDICATE = 19, WINED3DSPR_IMMCONST, + WINED3DSPR_CONSTBUFFER, } WINED3DSHADER_PARAM_REGISTER_TYPE; enum wined3d_immconst_type @@ -670,6 +671,7 @@ struct wined3d_shader_register { WINED3DSHADER_PARAM_REGISTER_TYPE type; UINT idx; + UINT array_idx; const struct wined3d_shader_src_param *rel_addr; enum wined3d_immconst_type immconst_type; DWORD immconst_data[4]; @@ -820,7 +822,7 @@ typedef struct { HRESULT (*shader_alloc_private)(IWineD3DDevice *iface); void (*shader_free_private)(IWineD3DDevice *iface); BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface); - void (*shader_get_caps)(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *caps); + void (*shader_get_caps)(WINED3DDEVTYPE devtype, const struct wined3d_gl_info *gl_info, struct shader_caps *caps); BOOL (*shader_color_fixup_supported)(struct color_fixup_desc fixup); void (*shader_add_instruction_modifiers)(const struct wined3d_shader_instruction *ins); } shader_backend_t; @@ -883,17 +885,19 @@ extern int num_lock; /* Checking of API calls */ /* --------------------- */ #ifndef WINE_NO_DEBUG_MSGS -#define checkGLcall(A) \ -do { \ - GLint err = glGetError(); \ - if (err == GL_NO_ERROR) { \ - TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \ - \ - } else do { \ - FIXME(">>>>>>>>>>>>>>>>> %s (%#x) from %s @ %s / %d\n", \ - debug_glerror(err), err, A, __FILE__, __LINE__); \ - err = glGetError(); \ - } while (err != GL_NO_ERROR); \ +#define checkGLcall(A) \ +do { \ + GLint err; \ + if(!__WINE_IS_DEBUG_ON(_FIXME, __wine_dbch___default)) break; \ + err = glGetError(); \ + if (err == GL_NO_ERROR) { \ + TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \ + \ + } else do { \ + FIXME(">>>>>>>>>>>>>>>>> %s (%#x) from %s @ %s / %d\n", \ + debug_glerror(err), err, A, __FILE__, __LINE__); \ + err = glGetError(); \ + } while (err != GL_NO_ERROR); \ } while(0) #else #define checkGLcall(A) do {} while(0) @@ -1142,7 +1146,7 @@ struct fragment_caps { struct fragment_pipeline { void (*enable_extension)(IWineD3DDevice *iface, BOOL enable); - void (*get_caps)(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *caps); + void (*get_caps)(WINED3DDEVTYPE devtype, const struct wined3d_gl_info *gl_info, struct fragment_caps *caps); HRESULT (*alloc_private)(IWineD3DDevice *iface); void (*free_private)(IWineD3DDevice *iface); BOOL (*color_fixup_supported)(struct color_fixup_desc fixup); @@ -1160,7 +1164,7 @@ extern const struct fragment_pipeline nvrc_fragment_pipeline; /* "Base" state table */ HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs, - const WineD3D_GL_Info *gl_info, const struct StateEntryTemplate *vertex, + const struct wined3d_gl_info *gl_info, const struct StateEntryTemplate *vertex, const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc); /* Shaders for color conversions in blits */ @@ -1185,7 +1189,9 @@ enum fogsource { #define WINED3D_MAX_FBO_ENTRIES 64 /* The new context manager that should deal with onscreen and offscreen rendering */ -struct WineD3DContext { +struct WineD3DContext +{ + const struct wined3d_gl_info *gl_info; /* State dirtification * dirtyArray is an array that contains markers for dirty states. numDirtyEntries states are dirty, their numbers are in indices * 0...numDirtyEntries - 1. isStateDirty is a redundant copy of the dirtyArray. Technically only one of them would be needed, @@ -1236,6 +1242,8 @@ struct WineD3DContext { struct fbo_entry *current_fbo; GLuint src_fbo; GLuint dst_fbo; + GLuint fbo_read_binding; + GLuint fbo_draw_binding; /* Extension emulation */ GLint gl_fog_source; @@ -1256,9 +1264,11 @@ WineD3DContext *getActiveContext(void); WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target, HWND win, BOOL create_pbuffer, const WINED3DPRESENT_PARAMETERS *pPresentParms); void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context); void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource, WINED3DRESOURCETYPE type); -void context_bind_fbo(IWineD3DDevice *iface, GLenum target, GLuint *fbo); -void context_attach_depth_stencil_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer); -void context_attach_surface_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, DWORD idx, IWineD3DSurface *surface); +void context_bind_fbo(struct WineD3DContext *context, GLenum target, GLuint *fbo); +void context_attach_depth_stencil_fbo(struct WineD3DContext *context, + GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer); +void context_attach_surface_fbo(const struct WineD3DContext *context, + GLenum fbo_target, DWORD idx, IWineD3DSurface *surface); void context_set_last_device(IWineD3DDeviceImpl *device); void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain); @@ -1318,7 +1328,7 @@ struct WineD3DAdapter UINT num; BOOL opengl; POINT monitorPoint; - WineD3D_GL_Info gl_info; + struct wined3d_gl_info gl_info; const char *driver; const char *description; WCHAR DeviceName[CCHDEVICENAME]; /* DeviceName for use with e.g. ChangeDisplaySettings */ @@ -1329,10 +1339,10 @@ struct WineD3DAdapter unsigned int UsedTextureRam; }; -extern BOOL initPixelFormats(WineD3D_GL_Info *gl_info); -BOOL initPixelFormatsNoGL(WineD3D_GL_Info *gl_info); +extern BOOL initPixelFormats(struct wined3d_gl_info *gl_info); +BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info); extern long WineD3DAdapterChangeGLRam(IWineD3DDeviceImpl *D3DDevice, long glram); -extern void add_gl_compat_wrappers(WineD3D_GL_Info *gl_info); +extern void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info); /***************************************************************************** * High order patch management @@ -2847,7 +2857,7 @@ struct GlPixelFormatDesc struct color_fixup_desc color_fixup; }; -const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const WineD3D_GL_Info *gl_info); +const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const struct wined3d_gl_info *gl_info); static inline BOOL use_vs(IWineD3DStateBlockImpl *stateblock) { diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 259c1bb01f5..79078aefab2 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1436,14 +1436,21 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT pixmaps[SRC] = XCreatePixmap( gdi_display, root_window, width, height, physDevDst->depth ); wine_tsx11_unlock(); - if (fStretch) - BITBLT_GetSrcAreaStretch( physDevSrc, physDevDst, pixmaps[SRC], tmpGC, - xSrc, ySrc, widthSrc, heightSrc, - xDst, yDst, widthDst, heightDst, - &visRectSrc, &visRectDst ); - else - BITBLT_GetSrcArea( physDevSrc, physDevDst, pixmaps[SRC], tmpGC, - &visRectSrc ); + + if(!X11DRV_XRender_GetSrcAreaStretch( physDevSrc, physDevDst, pixmaps[SRC], tmpGC, + xSrc, ySrc, widthSrc, heightSrc, + xDst, yDst, widthDst, heightDst, + &visRectSrc, &visRectDst)) + { + if (fStretch) + BITBLT_GetSrcAreaStretch( physDevSrc, physDevDst, pixmaps[SRC], tmpGC, + xSrc, ySrc, widthSrc, heightSrc, + xDst, yDst, widthDst, heightDst, + &visRectSrc, &visRectDst ); + else + BITBLT_GetSrcArea( physDevSrc, physDevDst, pixmaps[SRC], tmpGC, + &visRectSrc ); + } } if (useDst) BITBLT_GetDstArea( physDevDst, pixmaps[DST], tmpGC, &visRectDst ); diff --git a/dlls/winex11.drv/bitmap.c b/dlls/winex11.drv/bitmap.c index facf405b97d..4fb3ef03c78 100644 --- a/dlls/winex11.drv/bitmap.c +++ b/dlls/winex11.drv/bitmap.c @@ -36,6 +36,17 @@ X_PHYSBITMAP BITMAP_stock_phys_bitmap = { 0 }; /* phys bitmap for the default s static XContext bitmap_context; /* X context to associate a phys bitmap to a handle */ +GC get_bitmap_gc(int depth) +{ + switch(depth) + { + case 1: + return BITMAP_monoGC; + default: + return BITMAP_colorGC; + } +} + /*********************************************************************** * X11DRV_BITMAP_Init */ @@ -157,11 +168,12 @@ BOOL CDECL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID } else /* else clear the bitmap */ { + GC gc = get_bitmap_gc(physBitmap->pixmap_depth); wine_tsx11_lock(); - XSetFunction( gdi_display, BITMAP_GC(physBitmap), GXclear ); - XFillRectangle( gdi_display, physBitmap->pixmap, BITMAP_GC(physBitmap), 0, 0, + XSetFunction( gdi_display, gc, GXclear ); + XFillRectangle( gdi_display, physBitmap->pixmap, gc, 0, 0, bitmap.bmWidth, bitmap.bmHeight ); - XSetFunction( gdi_display, BITMAP_GC(physBitmap), GXcopy ); + XSetFunction( gdi_display, gc, GXcopy ); wine_tsx11_unlock(); } return TRUE; @@ -405,7 +417,7 @@ LONG CDECL X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) FIXME("Unhandled bits:%d\n", bitmap.bmBitsPixel); } - XPutImage( gdi_display, physBitmap->pixmap, BITMAP_GC(physBitmap), + XPutImage( gdi_display, physBitmap->pixmap, get_bitmap_gc(physBitmap->pixmap_depth), image, 0, 0, 0, 0, bitmap.bmWidth, height ); HeapFree( GetProcessHeap(), 0, image->data ); image->data = NULL; diff --git a/dlls/winex11.drv/brush.c b/dlls/winex11.drv/brush.c index 612968c1636..3368bbfa8d9 100644 --- a/dlls/winex11.drv/brush.c +++ b/dlls/winex11.drv/brush.c @@ -103,13 +103,14 @@ static const COLORREF WHITE = RGB(0xff, 0xff, 0xff); /*********************************************************************** * BRUSH_DitherColor */ -static Pixmap BRUSH_DitherColor( COLORREF color ) +static Pixmap BRUSH_DitherColor( COLORREF color, int depth) { /* X image for building dithered pixmap */ static XImage *ditherImage = NULL; static COLORREF prevColor = 0xffffffff; unsigned int x, y; Pixmap pixmap; + GC gc = get_bitmap_gc(depth); if (!ditherImage) { @@ -144,7 +145,7 @@ static Pixmap BRUSH_DitherColor( COLORREF color ) } pixmap = XCreatePixmap( gdi_display, root_window, MATRIX_SIZE, MATRIX_SIZE, screen_depth ); - XPutImage( gdi_display, pixmap, BITMAP_colorGC, ditherImage, 0, 0, + XPutImage( gdi_display, pixmap, gc, ditherImage, 0, 0, 0, 0, MATRIX_SIZE, MATRIX_SIZE ); wine_tsx11_unlock(); @@ -185,7 +186,7 @@ static void BRUSH_SelectSolidBrush( X11DRV_PDEVICE *physDev, COLORREF color ) if ((physDev->depth > 1) && (screen_depth <= 8) && !X11DRV_IsSolidColor( color )) { /* Dithered brush */ - physDev->brush.pixmap = BRUSH_DitherColor( color ); + physDev->brush.pixmap = BRUSH_DitherColor( color, physDev->depth ); physDev->brush.fillStyle = FillTiled; physDev->brush.pixel = 0; } @@ -222,7 +223,7 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap ) bitmap.bmWidth, bitmap.bmHeight, 1); /* FIXME: should probably convert to monochrome instead */ XCopyPlane( gdi_display, physBitmap->pixmap, physDev->brush.pixmap, - BITMAP_monoGC, 0, 0, bitmap.bmWidth, bitmap.bmHeight, 0, 0, 1 ); + get_bitmap_gc(1), 0, 0, bitmap.bmWidth, bitmap.bmHeight, 0, 0, 1 ); } else { @@ -230,7 +231,7 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap ) bitmap.bmWidth, bitmap.bmHeight, physBitmap->pixmap_depth ); XCopyArea( gdi_display, physBitmap->pixmap, physDev->brush.pixmap, - BITMAP_GC(physBitmap), 0, 0, bitmap.bmWidth, bitmap.bmHeight, 0, 0 ); + get_bitmap_gc(physBitmap->pixmap_depth), 0, 0, bitmap.bmWidth, bitmap.bmHeight, 0, 0 ); } wine_tsx11_unlock(); diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 3806080908e..82928a228aa 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -2504,6 +2504,52 @@ INT CDECL X11DRV_GetClipboardFormatName(UINT wFormat, LPWSTR retStr, INT maxlen) return strlenW(retStr); } +static void selection_acquire(void) +{ + Window owner; + Display *display; + + owner = thread_selection_wnd(); + display = thread_display(); + + wine_tsx11_lock(); + + selectionAcquired = 0; + selectionWindow = 0; + + /* Grab PRIMARY selection if not owned */ + if (use_primary_selection) + XSetSelectionOwner(display, XA_PRIMARY, owner, CurrentTime); + + /* Grab CLIPBOARD selection if not owned */ + XSetSelectionOwner(display, x11drv_atom(CLIPBOARD), owner, CurrentTime); + + if (use_primary_selection && XGetSelectionOwner(display, XA_PRIMARY) == owner) + selectionAcquired |= S_PRIMARY; + + if (XGetSelectionOwner(display,x11drv_atom(CLIPBOARD)) == owner) + selectionAcquired |= S_CLIPBOARD; + + wine_tsx11_unlock(); + + if (selectionAcquired) + { + selectionWindow = owner; + TRACE("Grabbed X selection, owner=(%08x)\n", (unsigned) owner); + } +} + +static DWORD WINAPI selection_thread_proc(LPVOID unused) +{ + selection_acquire(); + + while (selectionAcquired) + { + MsgWaitForMultipleObjectsEx(0, NULL, INFINITE, QS_SENDMESSAGE, 0); + } + + return 0; +} /************************************************************************** * AcquireClipboard (X11DRV.@) @@ -2511,8 +2557,7 @@ INT CDECL X11DRV_GetClipboardFormatName(UINT wFormat, LPWSTR retStr, INT maxlen) int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow) { DWORD procid; - Window owner; - Display *display; + HANDLE selectionThread; TRACE(" %p\n", hWndClipWindow); @@ -2540,33 +2585,21 @@ int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow) } } - owner = thread_selection_wnd(); - display = thread_display(); - - wine_tsx11_lock(); - - selectionAcquired = 0; - selectionWindow = 0; - - /* Grab PRIMARY selection if not owned */ - if (use_primary_selection) - XSetSelectionOwner(display, XA_PRIMARY, owner, CurrentTime); - - /* Grab CLIPBOARD selection if not owned */ - XSetSelectionOwner(display, x11drv_atom(CLIPBOARD), owner, CurrentTime); - - if (use_primary_selection && XGetSelectionOwner(display, XA_PRIMARY) == owner) - selectionAcquired |= S_PRIMARY; - - if (XGetSelectionOwner(display,x11drv_atom(CLIPBOARD)) == owner) - selectionAcquired |= S_CLIPBOARD; + if (hWndClipWindow) + { + selection_acquire(); + } + else + { + selectionThread = CreateThread(NULL, 0, &selection_thread_proc, NULL, 0, NULL); - wine_tsx11_unlock(); + if (!selectionThread) + { + WARN("Could not start clipboard thread\n"); + return 0; + } - if (selectionAcquired) - { - selectionWindow = owner; - TRACE("Grabbed X selection, owner=(%08x)\n", (unsigned) owner); + CloseHandle(selectionThread); } return 1; diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c index 6df41379c17..07ce9e1ebec 100644 --- a/dlls/winex11.drv/dib.c +++ b/dlls/winex11.drv/dib.c @@ -3984,7 +3984,7 @@ INT CDECL X11DRV_SetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start descr.lines = tmpheight >= 0 ? lines : -lines; descr.depth = physBitmap->pixmap_depth; descr.drawable = physBitmap->pixmap; - descr.gc = BITMAP_GC(physBitmap); + descr.gc = get_bitmap_gc(physBitmap->pixmap_depth); descr.xSrc = 0; descr.ySrc = 0; descr.xDest = 0; @@ -4138,7 +4138,7 @@ INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start descr.lines = lines; descr.depth = physBitmap->pixmap_depth; descr.drawable = physBitmap->pixmap; - descr.gc = BITMAP_GC(physBitmap); + descr.gc = get_bitmap_gc(physBitmap->pixmap_depth); descr.width = dib.dsBm.bmWidth; descr.height = dib.dsBm.bmHeight; descr.xDest = 0; @@ -4353,7 +4353,7 @@ static void X11DRV_DIB_DoUpdateDIBSection(X_PHYSBITMAP *physBitmap, BOOL toDIB) GetObjectW( physBitmap->hbitmap, sizeof(bitmap), &bitmap ); X11DRV_DIB_DoCopyDIBSection(physBitmap, toDIB, physBitmap->colorMap, physBitmap->nColorMap, - physBitmap->pixmap, BITMAP_GC(physBitmap), + physBitmap->pixmap, get_bitmap_gc(physBitmap->pixmap_depth), 0, 0, 0, 0, bitmap.bmWidth, bitmap.bmHeight); } diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 8d74c7788e3..abdd505554d 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -1072,7 +1072,7 @@ X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y ) /* to avoid a BadMatch error */ if (!pixmap) pixmap = XCreatePixmap( gdi_display, root_window, 1, 1, physDev->depth ); - XCopyArea( gdi_display, physDev->drawable, pixmap, BITMAP_colorGC, + XCopyArea( gdi_display, physDev->drawable, pixmap, get_bitmap_gc(physDev->depth), physDev->dc_rect.left + pt.x, physDev->dc_rect.top + pt.y, 1, 1, 0, 0 ); image = XGetImage( gdi_display, pixmap, 0, 0, 1, 1, AllPlanes, ZPixmap ); } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 95706eb5768..10af1832a0d 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -144,11 +144,10 @@ typedef struct } X11DRV_PDEVICE; - /* GCs used for B&W and color bitmap operations */ -extern GC BITMAP_monoGC, BITMAP_colorGC; extern X_PHYSBITMAP BITMAP_stock_phys_bitmap; /* phys bitmap for the default stock bitmap */ -#define BITMAP_GC(physBitmap) (((physBitmap)->pixmap_depth == 1) ? BITMAP_monoGC : BITMAP_colorGC) +/* Retrieve the GC used for bitmap operations */ +extern GC get_bitmap_gc(int depth); /* Wine driver X11 functions */ @@ -268,6 +267,13 @@ extern void X11DRV_XRender_DeleteDC(X11DRV_PDEVICE*); extern BOOL X11DRV_XRender_ExtTextOut(X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR wstr, UINT count, const INT *lpDx); +BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst, + Pixmap pixmap, GC gc, + INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, + INT xDst, INT yDst, + INT widthDst, INT heightDst, + RECT *visRectSrc, RECT *visRectDst); extern void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev); extern Drawable get_glxdrawable(X11DRV_PDEVICE *physDev); diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index dd53f23765e..6d290ba5caa 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -390,6 +390,29 @@ sym_not_found: else TRACE("Using X11 core fonts\n"); } +/* Helper function to convert from a color packed in a 32-bit integer to a XRenderColor */ +static void get_xrender_color(WineXRenderFormat *wxr_format, int src_color, XRenderColor *dst_color) +{ + XRenderPictFormat *pf = wxr_format->pict_format; + + if(pf->direct.redMask) + dst_color->red = ((src_color >> pf->direct.red) & pf->direct.redMask) * 65535/pf->direct.redMask; + else + dst_color->red = 0; + + if(pf->direct.greenMask) + dst_color->green = ((src_color >> pf->direct.green) & pf->direct.greenMask) * 65535/pf->direct.greenMask; + else + dst_color->green = 0; + + if(pf->direct.blueMask) + dst_color->blue = ((src_color >> pf->direct.blue) & pf->direct.blueMask) * 65535/pf->direct.blueMask; + else + dst_color->blue = 0; + + dst_color->alpha = 0xffff; +} + static WineXRenderFormat *get_xrender_format(WXRFormat format) { int i; @@ -1323,23 +1346,7 @@ static Picture get_tile_pict(WineXRenderFormat *wxr_format, int text_pixel) if(text_pixel != tile->current_color && wxr_format->format != WXR_FORMAT_MONO) { - /* Map 0 -- 0xff onto 0 -- 0xffff */ - int r_shift, r_len; - int g_shift, g_len; - int b_shift, b_len; - - ExamineBitfield (visual->red_mask, &r_shift, &r_len ); - ExamineBitfield (visual->green_mask, &g_shift, &g_len); - ExamineBitfield (visual->blue_mask, &b_shift, &b_len); - - col.red = GetField(text_pixel, r_shift, r_len); - col.red |= col.red << 8; - col.green = GetField(text_pixel, g_shift, g_len); - col.green |= col.green << 8; - col.blue = GetField(text_pixel, b_shift, b_len); - col.blue |= col.blue << 8; - col.alpha = 0xffff; - + get_xrender_color(wxr_format, text_pixel, &col); wine_tsx11_lock(); pXRenderFillRectangle(gdi_display, PictOpSrc, tile->pict, &col, 0, 0, 1, 1); wine_tsx11_unlock(); @@ -1712,6 +1719,20 @@ done_unlock: return retv; } +/* Set the x/y scaling and x/y offsets in the transformation matrix of the source picture */ +static void set_xrender_transformation(Picture src_pict, float xscale, float yscale, int xoffset, int yoffset) +{ +#ifdef HAVE_XRENDERSETPICTURETRANSFORM + XTransform xform = {{ + { XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(xoffset) }, + { XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(yoffset) }, + { XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1) } + }}; + + pXRenderSetPictureTransform(gdi_display, src_pict, &xform); +#endif +} + /****************************************************************************** * AlphaBlend (x11drv.@) */ @@ -1889,18 +1910,10 @@ BOOL CDECL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT wid HeapFree( GetProcessHeap(), 0, rgndata ); } -#ifdef HAVE_XRENDERSETPICTURETRANSFORM - if(!repeat_src && (widthDst != widthSrc || heightDst != heightSrc)) { - double xscale = widthSrc/(double)widthDst; - double yscale = heightSrc/(double)heightDst; - XTransform xform = {{ - { XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0) }, - { XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0) }, - { XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1) } - }}; - pXRenderSetPictureTransform(gdi_display, src_pict, &xform); - } -#endif + /* Make sure we ALWAYS set the transformation matrix even if we don't need to scale. The reason is + * that later on we want to reuse pictures (it can bring a lot of extra performance) and each time + * a different transformation matrix might have been used. */ + set_xrender_transformation(src_pict, widthSrc/(double)widthDst, heightSrc/(double)heightDst, 0, 0); pXRenderComposite(gdi_display, PictOpOver, src_pict, 0, dst_pict, 0, 0, 0, 0, xDst + devDst->dc_rect.left, yDst + devDst->dc_rect.top, widthDst, heightDst); @@ -1918,6 +1931,119 @@ BOOL CDECL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT wid return TRUE; } +BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst, + Pixmap pixmap, GC gc, + INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, + INT xDst, INT yDst, + INT widthDst, INT heightDst, + RECT *visRectSrc, RECT *visRectDst ) +{ + BOOL stretch = (widthSrc != widthDst) || (heightSrc != heightDst); + int width = visRectDst->right - visRectDst->left; + int height = visRectDst->bottom - visRectDst->top; + WineXRenderFormat *src_format = get_xrender_format_from_pdevice(physDevSrc); + WineXRenderFormat *dst_format = get_xrender_format_from_pdevice(physDevDst); + Picture src_pict=0, dst_pict=0, mask_pict=0; + + /* Further down a transformation matrix is used for stretching and mirroring the source data. + * xscale/yscale contain the scaling factors for the width and height. In case of mirroring + * we also need a x- and y-offset because without the pixels will be in the wrong quadrant of the x-y plane. + */ + double xscale = widthSrc/(double)widthDst; + double yscale = heightSrc/(double)heightDst; + int xoffset = (xscale<0) ? width : 0; + int yoffset = (yscale<0) ? height : 0; + + XRenderPictureAttributes pa; + pa.subwindow_mode = IncludeInferiors; + pa.repeat = RepeatNone; + + TRACE("src depth=%d widthSrc=%d heightSrc=%d xSrc=%d ySrc=%d\n", physDevSrc->depth, widthSrc, heightSrc, xSrc, ySrc); + TRACE("dst depth=%d widthDst=%d heightDst=%d xDst=%d yDst=%d\n", physDevDst->depth, widthDst, heightDst, xDst, yDst); + + if(!X11DRV_XRender_Installed) + { + TRACE("Not using XRender since it is not available or disabled\n"); + return FALSE; + } + + /* XRender can't handle palettes, so abort */ + if(X11DRV_PALETTE_XPixelToPalette) + return FALSE; + + /* XRender is of no use in this case */ + if((physDevDst->depth == 1) && (physDevSrc->depth > 1)) + return FALSE; + + /* Just use traditional X copy when the depths match and we don't need stretching */ + if((physDevSrc->depth == physDevDst->depth) && !stretch) + { + TRACE("Source and destination depth match and no stretching needed falling back to XCopyArea\n"); + wine_tsx11_lock(); + XCopyArea( gdi_display, physDevSrc->drawable, pixmap, gc, + physDevSrc->dc_rect.left + visRectSrc->left, + physDevSrc->dc_rect.top + visRectSrc->top, + width, height, 0, 0); + wine_tsx11_unlock(); + return TRUE; + } + + /* mono -> color */ + if(physDevSrc->depth == 1) + { + XRenderColor col; + get_xrender_color(dst_format, physDevDst->textPixel, &col); + + /* We use the source drawable as a mask */ + wine_tsx11_lock(); + mask_pict = pXRenderCreatePicture(gdi_display, physDevSrc->drawable, src_format->pict_format, CPSubwindowMode|CPRepeat, &pa); + set_xrender_transformation(mask_pict, xscale, yscale, xoffset, yoffset); + + /* Use backgroundPixel as the foreground color */ + src_pict = get_tile_pict(dst_format, physDevDst->backgroundPixel); + + /* Create a destination picture and fill it with textPixel color as the background color */ + dst_pict = pXRenderCreatePicture(gdi_display, pixmap, dst_format->pict_format, CPSubwindowMode|CPRepeat, &pa); + pXRenderFillRectangle(gdi_display, PictOpSrc, dst_pict, &col, 0, 0, width, height); + + /* Notice that the source coordinates have to be relative to the transformated source picture */ + pXRenderComposite(gdi_display, PictOpSrc, src_pict, mask_pict, dst_pict, + (physDevSrc->dc_rect.left + visRectSrc->left)/xscale, + (physDevSrc->dc_rect.top + visRectSrc->top)/yscale, + 0, 0, 0, 0, + width, height); + + if(dst_pict) pXRenderFreePicture(gdi_display, dst_pict); + if(mask_pict) pXRenderFreePicture(gdi_display, mask_pict); + wine_tsx11_unlock(); + } + else /* color -> color but with different depths */ + { + wine_tsx11_lock(); + src_pict = pXRenderCreatePicture(gdi_display, + physDevSrc->drawable, src_format->pict_format, + CPSubwindowMode|CPRepeat, &pa); + set_xrender_transformation(src_pict, xscale, yscale, xoffset, yoffset); + + dst_pict = pXRenderCreatePicture(gdi_display, + pixmap, dst_format->pict_format, + CPSubwindowMode|CPRepeat, &pa); + + /* Notice that the source coordinates have to be relative to the transformated source picture */ + pXRenderComposite(gdi_display, PictOpSrc, src_pict, mask_pict, dst_pict, + (physDevSrc->dc_rect.left + visRectSrc->left)/xscale, + (physDevSrc->dc_rect.top + visRectSrc->top)/yscale, + 0, 0, 0, 0, + width, height); + + if(src_pict) pXRenderFreePicture(gdi_display, src_pict); + if(dst_pict) pXRenderFreePicture(gdi_display, dst_pict); + wine_tsx11_unlock(); + } + return TRUE; +} + #else /* SONAME_LIBXRENDER */ void X11DRV_XRender_Init(void) @@ -1967,4 +2093,14 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst, return FALSE; } +BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst, + Pixmap pixmap, GC gc, + INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, + INT xDst, INT yDst, + INT widthDst, INT heightDst, + RECT *visRectSrc, RECT *visRectDst) +{ + return FALSE; +} #endif /* SONAME_LIBXRENDER */ diff --git a/dlls/winhttp/Makefile.in b/dlls/winhttp/Makefile.in index 78d3814ad20..7a61dc92f86 100644 --- a/dlls/winhttp/Makefile.in +++ b/dlls/winhttp/Makefile.in @@ -5,7 +5,7 @@ VPATH = @srcdir@ MODULE = winhttp.dll IMPORTLIB = winhttp IMPORTS = shlwapi kernel32 -DELAYIMPORTS = crypt32 +DELAYIMPORTS = crypt32 advapi32 EXTRALIBS = @SOCKETLIBS@ C_SRCS = \ diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index af1d5ad57b0..5704417a49c 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -1,5 +1,8 @@ /* + * Copyright 2004 Mike McCormack for CodeWeavers + * Copyright 2006 Rob Shearman for CodeWeavers * Copyright 2008 Hans Leidekker for CodeWeavers + * Copyright 2009 Juan Lang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -474,6 +477,47 @@ BOOL WINAPI WinHttpAddRequestHeaders( HINTERNET hrequest, LPCWSTR headers, DWORD return ret; } +static WCHAR *build_request_path( request_t *request ) +{ + WCHAR *ret; + + if (strcmpiW( request->connect->hostname, request->connect->servername )) + { + static const WCHAR http[] = { 'h','t','t','p',0 }; + static const WCHAR https[] = { 'h','t','t','p','s',0 }; + static const WCHAR fmt[] = { '%','s',':','/','/','%','s',0 }; + LPCWSTR scheme = request->netconn.secure ? https : http; + int len; + + len = strlenW( scheme ) + strlenW( request->connect->hostname ); + /* 3 characters for '://', 1 for NUL. */ + len += 4; + if (request->connect->hostport) + { + /* 1 for ':' between host and port, up to 5 for port */ + len += 6; + } + if (request->path) + len += strlenW( request->path ); + if ((ret = heap_alloc( len * sizeof(WCHAR) ))) + { + sprintfW( ret, fmt, scheme, request->connect->hostname ); + if (request->connect->hostport) + { + static const WCHAR colonFmt[] = { ':','%','d',0 }; + + sprintfW( ret + strlenW( ret ), colonFmt, + request->connect->hostport ); + } + if (request->path) + strcatW( ret, request->path ); + } + } + else + ret = request->path; + return ret; +} + static WCHAR *build_request_string( request_t *request ) { static const WCHAR space[] = {' ',0}; @@ -481,7 +525,7 @@ static WCHAR *build_request_string( request_t *request ) static const WCHAR colon[] = {':',' ',0}; static const WCHAR twocrlf[] = {'\r','\n','\r','\n',0}; - WCHAR *ret; + WCHAR *path, *ret; const WCHAR **headers, **p; unsigned int len, i = 0, j; @@ -489,9 +533,10 @@ static WCHAR *build_request_string( request_t *request ) len = request->num_headers * 4 + 7; if (!(headers = heap_alloc( len * sizeof(LPCWSTR) ))) return NULL; + path = build_request_path( request ); headers[i++] = request->verb; headers[i++] = space; - headers[i++] = request->path; + headers[i++] = path; headers[i++] = space; headers[i++] = request->version; @@ -516,13 +561,13 @@ static WCHAR *build_request_string( request_t *request ) len++; if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) - { - heap_free( headers ); - return NULL; - } + goto out; *ret = 0; for (p = headers; *p; p++) strcatW( ret, *p ); +out: + if (path != request->path) + heap_free( path ); heap_free( headers ); return ret; } @@ -710,6 +755,123 @@ BOOL WINAPI WinHttpQueryHeaders( HINTERNET hrequest, DWORD level, LPCWSTR name, return ret; } +static LPWSTR concatenate_string_list( LPCWSTR *list, int len ) +{ + LPCWSTR *t; + LPWSTR str; + + for( t = list; *t ; t++ ) + len += strlenW( *t ); + len++; + + str = heap_alloc( len * sizeof(WCHAR) ); + *str = 0; + + for( t = list; *t ; t++ ) + strcatW( str, *t ); + + return str; +} + +static LPWSTR build_header_request_string( request_t *request, LPCWSTR verb, + LPCWSTR path, LPCWSTR version ) +{ + static const WCHAR crlf[] = {'\r','\n',0}; + static const WCHAR space[] = { ' ',0 }; + static const WCHAR colon[] = { ':',' ',0 }; + static const WCHAR twocrlf[] = {'\r','\n','\r','\n', 0}; + LPWSTR requestString; + DWORD len, n; + LPCWSTR *req; + UINT i; + LPWSTR p; + + /* allocate space for an array of all the string pointers to be added */ + len = (request->num_headers) * 4 + 10; + req = heap_alloc( len * sizeof(LPCWSTR) ); + + /* add the verb, path and HTTP version string */ + n = 0; + req[n++] = verb; + req[n++] = space; + req[n++] = path; + req[n++] = space; + req[n++] = version; + + /* Append custom request headers */ + for (i = 0; i < request->num_headers; i++) + { + if (request->headers[i].is_request) + { + req[n++] = crlf; + req[n++] = request->headers[i].field; + req[n++] = colon; + req[n++] = request->headers[i].value; + + TRACE("Adding custom header %s (%s)\n", + debugstr_w(request->headers[i].field), + debugstr_w(request->headers[i].value)); + } + } + + if( n >= len ) + ERR("oops. buffer overrun\n"); + + req[n] = NULL; + requestString = concatenate_string_list( req, 4 ); + heap_free( req ); + + /* + * Set (header) termination string for request + * Make sure there's exactly two new lines at the end of the request + */ + p = &requestString[strlenW(requestString)-1]; + while ( (*p == '\n') || (*p == '\r') ) + p--; + strcpyW( p+1, twocrlf ); + + return requestString; +} + +static BOOL read_reply( request_t *request ); + +static BOOL secure_proxy_connect( request_t *request ) +{ + static const WCHAR verbConnect[] = {'C','O','N','N','E','C','T',0}; + static const WCHAR fmt[] = {'%','s',':','%','d',0}; + static const WCHAR http1_1[] = {'H','T','T','P','/','1','.','1',0}; + BOOL ret = FALSE; + LPWSTR path; + connect_t *connect = request->connect; + + path = heap_alloc( (strlenW( connect->hostname ) + 13) * sizeof(WCHAR) ); + if (path) + { + LPWSTR requestString; + + sprintfW( path, fmt, connect->hostname, connect->hostport ); + requestString = build_header_request_string( request, verbConnect, + path, http1_1 ); + heap_free( path ); + if (requestString) + { + LPSTR req_ascii = strdupWA( requestString ); + + heap_free( requestString ); + if (req_ascii) + { + int len = strlen( req_ascii ), bytes_sent; + + ret = netconn_send( &request->netconn, req_ascii, len, 0, &bytes_sent ); + heap_free( req_ascii ); + if (ret) + ret = read_reply( request ); + } + } + } + return ret; +} + #ifndef INET6_ADDRSTRLEN #define INET6_ADDRSTRLEN 46 #endif @@ -726,7 +888,7 @@ static BOOL open_connection( request_t *request ) if (netconn_connected( &request->netconn )) return TRUE; connect = request->connect; - port = connect->hostport ? connect->hostport : (request->hdr.flags & WINHTTP_FLAG_SECURE ? 443 : 80); + port = connect->serverport ? connect->serverport : (request->hdr.flags & WINHTTP_FLAG_SECURE ? 443 : 80); send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, connect->servername, strlenW(connect->servername) + 1 ); @@ -758,17 +920,29 @@ static BOOL open_connection( request_t *request ) heap_free( addressW ); return FALSE; } - if (!netconn_connect( &request->netconn, (struct sockaddr *)&connect->sockaddr, sizeof(struct sockaddr_in) )) + if (!netconn_connect( &request->netconn, (struct sockaddr *)&connect->sockaddr, slen )) { netconn_close( &request->netconn ); heap_free( addressW ); return FALSE; } - if (request->hdr.flags & WINHTTP_FLAG_SECURE && !netconn_secure_connect( &request->netconn )) + if (request->hdr.flags & WINHTTP_FLAG_SECURE) { - netconn_close( &request->netconn ); - heap_free( addressW ); - return FALSE; + if (connect->session->proxy_server && + strcmpiW( connect->hostname, connect->servername )) + { + if (!secure_proxy_connect( request )) + { + heap_free( addressW ); + return FALSE; + } + } + if (!netconn_secure_connect( &request->netconn )) + { + netconn_close( &request->netconn ); + heap_free( addressW ); + return FALSE; + } } send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, addressW, strlenW(addressW) + 1 ); @@ -1116,13 +1290,12 @@ static BOOL handle_redirect( request_t *request ) hostname[len] = 0; port = uc.nPort ? uc.nPort : (uc.nScheme == INTERNET_SCHEME_HTTPS ? 443 : 80); - if (strcmpiW( connect->servername, hostname ) || connect->serverport != port) + if (strcmpiW( connect->hostname, hostname ) || connect->serverport != port) { heap_free( connect->hostname ); connect->hostname = hostname; - heap_free( connect->servername ); - connect->servername = strdupW( connect->hostname ); - connect->serverport = connect->hostport = port; + connect->hostport = port; + if (!(ret = set_server_for_hostname( connect, hostname, port ))) goto end; netconn_close( &request->netconn ); if (!(ret = netconn_init( &request->netconn, request->hdr.flags & WINHTTP_FLAG_SECURE ))) goto end; diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 55f97794c99..e1a2b4bd1a7 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -21,11 +21,13 @@ #include "wine/debug.h" #include +#include #include "windef.h" #include "winbase.h" #include "winhttp.h" #include "wincrypt.h" +#include "winreg.h" #include "winhttp_private.h" @@ -166,13 +168,35 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWST session->hdr.vtbl = &session_vtbl; session->hdr.flags = flags; session->hdr.refs = 1; - session->access = access; session->hdr.redirect_policy = WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP; list_init( &session->cookie_cache ); if (agent && !(session->agent = strdupW( agent ))) goto end; - if (proxy && !(session->proxy_server = strdupW( proxy ))) goto end; - if (bypass && !(session->proxy_bypass = strdupW( bypass ))) goto end; + if (access == WINHTTP_ACCESS_TYPE_DEFAULT_PROXY) + { + WINHTTP_PROXY_INFO info; + + WinHttpGetDefaultProxyConfiguration( &info ); + session->access = info.dwAccessType; + if (info.lpszProxy && !(session->proxy_server = strdupW( info.lpszProxy ))) + { + GlobalFree( (LPWSTR)info.lpszProxy ); + GlobalFree( (LPWSTR)info.lpszProxyBypass ); + goto end; + } + if (info.lpszProxyBypass && !(session->proxy_bypass = strdupW( info.lpszProxyBypass ))) + { + GlobalFree( (LPWSTR)info.lpszProxy ); + GlobalFree( (LPWSTR)info.lpszProxyBypass ); + goto end; + } + } + else if (access == WINHTTP_ACCESS_TYPE_NAMED_PROXY) + { + session->access = access; + if (proxy && !(session->proxy_server = strdupW( proxy ))) goto end; + if (bypass && !(session->proxy_bypass = strdupW( bypass ))) goto end; + } if (!(handle = alloc_handle( &session->hdr ))) goto end; session->hdr.handle = handle; @@ -208,6 +232,148 @@ static const object_vtbl_t connect_vtbl = NULL }; +static BOOL domain_matches(LPCWSTR server, LPCWSTR domain) +{ + static const WCHAR localW[] = { '<','l','o','c','a','l','>',0 }; + BOOL ret = FALSE; + + if (!strcmpiW( domain, localW ) && !strchrW( server, '.' )) + ret = TRUE; + else if (*domain == '*') + { + if (domain[1] == '.') + { + LPCWSTR dot; + + /* For a hostname to match a wildcard, the last domain must match + * the wildcard exactly. E.g. if the wildcard is *.a.b, and the + * hostname is www.foo.a.b, it matches, but a.b does not. + */ + dot = strchrW( server, '.' ); + if (dot) + { + int len = strlenW( dot + 1 ); + + if (len > strlenW( domain + 2 )) + { + LPCWSTR ptr; + + /* The server's domain is longer than the wildcard, so it + * could be a subdomain. Compare the last portion of the + * server's domain. + */ + ptr = dot + len + 1 - strlenW( domain + 2 ); + if (!strcmpiW( ptr, domain + 2 )) + { + /* This is only a match if the preceding character is + * a '.', i.e. that it is a matching domain. E.g. + * if domain is '*.b.c' and server is 'www.ab.c' they + * do not match. + */ + ret = *(ptr - 1) == '.'; + } + } + else + ret = !strcmpiW( dot + 1, domain + 2 ); + } + } + } + else + ret = !strcmpiW( server, domain ); + return ret; +} + +/* Matches INTERNET_MAX_HOST_NAME_LENGTH in wininet.h, also RFC 1035 */ +#define MAX_HOST_NAME_LENGTH 256 + +static BOOL should_bypass_proxy(session_t *session, LPCWSTR server) +{ + LPCWSTR ptr; + BOOL ret = FALSE; + + ptr = session->proxy_bypass; + do { + LPCWSTR tmp = ptr; + + ptr = strchrW( ptr, ';' ); + if (!ptr) + ptr = strchrW( tmp, ' ' ); + if (ptr) + { + if (ptr - tmp < MAX_HOST_NAME_LENGTH) + { + WCHAR domain[MAX_HOST_NAME_LENGTH]; + + memcpy( domain, tmp, (ptr - tmp) * sizeof(WCHAR) ); + domain[ptr - tmp] = 0; + ret = domain_matches( server, domain ); + } + ptr += 1; + } + else if (*tmp) + ret = domain_matches( server, tmp ); + } while (ptr && !ret); + return ret; +} + +BOOL set_server_for_hostname( connect_t *connect, LPCWSTR server, INTERNET_PORT port ) +{ + session_t *session = connect->session; + BOOL ret = TRUE; + + if (session->proxy_server && !should_bypass_proxy(session, server)) + { + LPCWSTR colon; + + if ((colon = strchrW( session->proxy_server, ':' ))) + { + if (!connect->servername || strncmpiW( connect->servername, + session->proxy_server, colon - session->proxy_server - 1 )) + { + heap_free( connect->servername ); + if (!(connect->servername = heap_alloc( + (colon - session->proxy_server + 1) * sizeof(WCHAR) ))) + { + ret = FALSE; + goto end; + } + memcpy( connect->servername, session->proxy_server, + (colon - session->proxy_server) * sizeof(WCHAR) ); + connect->servername[colon - session->proxy_server] = 0; + if (*(colon + 1)) + connect->serverport = atoiW( colon + 1 ); + else + connect->serverport = INTERNET_DEFAULT_PORT; + } + } + else + { + if (!connect->servername || strcmpiW( connect->servername, + session->proxy_server )) + { + heap_free( connect->servername ); + if (!(connect->servername = strdupW( session->proxy_server ))) + { + ret = FALSE; + goto end; + } + connect->serverport = INTERNET_DEFAULT_PORT; + } + } + } + else if (server) + { + if (!(connect->servername = strdupW( server ))) + { + ret = FALSE; + goto end; + } + connect->serverport = port; + } +end: + return ret; +} + /*********************************************************************** * WinHttpConnect (winhttp.@) */ @@ -255,8 +421,8 @@ HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PO if (server && !(connect->hostname = strdupW( server ))) goto end; connect->hostport = port; - if (server && !(connect->servername = strdupW( server ))) goto end; - connect->serverport = port; + if (!set_server_for_hostname( connect, server, port )) + goto end; if (!(hconnect = alloc_handle( &connect->hdr ))) goto end; connect->hdr.handle = hconnect; @@ -648,17 +814,141 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url ) return FALSE; } +static const WCHAR Connections[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\', + 'C','o','n','n','e','c','t','i','o','n','s',0 }; +static const WCHAR WinHttpSettings[] = { + 'W','i','n','H','t','t','p','S','e','t','t','i','n','g','s',0 }; +static const DWORD WINHTTPSETTINGS_MAGIC = 0x18; +static const DWORD WINHTTP_PROXY_TYPE_DIRECT = 1; +static const DWORD WINHTTP_PROXY_TYPE_PROXY = 2; + +struct winhttp_settings_header +{ + DWORD magic; + DWORD unknown; /* always zero? */ + DWORD flags; /* one of WINHTTP_PROXY_TYPE_* */ +}; + +static inline void copy_char_to_wchar_sz(const BYTE *src, DWORD len, WCHAR *dst) +{ + const BYTE *begin; + + for (begin = src; src - begin < len; src++, dst++) + *dst = *src; + *dst = 0; +} + /*********************************************************************** * WinHttpGetDefaultProxyConfiguration (winhttp.@) */ BOOL WINAPI WinHttpGetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info ) { - FIXME("%p\n", info); + LONG l; + HKEY key; + BOOL direct = TRUE; + char *envproxy; + + TRACE("%p\n", info); + + l = RegOpenKeyExW( HKEY_LOCAL_MACHINE, Connections, 0, KEY_READ, &key ); + if (!l) + { + DWORD type, size = 0; - info->dwAccessType = WINHTTP_ACCESS_TYPE_NO_PROXY; - info->lpszProxy = NULL; - info->lpszProxyBypass = NULL; + l = RegQueryValueExW( key, WinHttpSettings, NULL, &type, NULL, &size ); + if (!l && type == REG_BINARY && + size >= sizeof(struct winhttp_settings_header) + 2 * sizeof(DWORD)) + { + BYTE *buf = heap_alloc( size ); + + if (buf) + { + struct winhttp_settings_header *hdr = + (struct winhttp_settings_header *)buf; + DWORD *len = (DWORD *)(hdr + 1); + + l = RegQueryValueExW( key, WinHttpSettings, NULL, NULL, buf, + &size ); + if (!l && hdr->magic == WINHTTPSETTINGS_MAGIC && + hdr->unknown == 0) + { + if (hdr->flags & WINHTTP_PROXY_TYPE_PROXY) + { + BOOL sane = FALSE; + + /* Sanity-check length of proxy string */ + if ((BYTE *)len - buf + *len <= size) + { + sane = TRUE; + info->lpszProxy = GlobalAlloc( 0, + (*len + 1) * sizeof(WCHAR) ); + if (info->lpszProxy) + copy_char_to_wchar_sz( (BYTE *)(len + 1), + *len, (LPWSTR)info->lpszProxy ); + len = (DWORD *)((BYTE *)(len + 1) + *len); + } + if (sane) + { + /* Sanity-check length of proxy bypass string */ + if ((BYTE *)len - buf + *len <= size) + { + info->lpszProxyBypass = GlobalAlloc( 0, + (*len + 1) * sizeof(WCHAR) ); + if (info->lpszProxyBypass) + copy_char_to_wchar_sz( (BYTE *)(len + 1), + *len, (LPWSTR)info->lpszProxyBypass ); + } + else + { + sane = FALSE; + GlobalFree( (LPWSTR)info->lpszProxy ); + info->lpszProxy = NULL; + } + } + if (sane) + { + direct = FALSE; + info->dwAccessType = + WINHTTP_ACCESS_TYPE_NAMED_PROXY; + TRACE("http proxy (from registry) = %s, bypass = %s\n", + debugstr_w(info->lpszProxy), + debugstr_w(info->lpszProxyBypass)); + } + } + } + heap_free( buf ); + } + } + RegCloseKey( key ); + } + else if ((envproxy = getenv( "http_proxy" ))) + { + WCHAR *envproxyW; + int len; + len = MultiByteToWideChar( CP_UNIXCP, 0, envproxy, -1, NULL, 0 ); + if ((envproxyW = GlobalAlloc( 0, len * sizeof(WCHAR)))) + { + MultiByteToWideChar( CP_UNIXCP, 0, envproxy, -1, envproxyW, len ); + direct = FALSE; + info->dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; + info->lpszProxy = envproxyW; + info->lpszProxyBypass = NULL; + TRACE("http proxy (from environment) = %s\n", + debugstr_w(info->lpszProxy)); + } + } + if (direct) + { + info->dwAccessType = WINHTTP_ACCESS_TYPE_NO_PROXY; + info->lpszProxy = NULL; + info->lpszProxyBypass = NULL; + } return TRUE; } @@ -703,9 +993,106 @@ BOOL WINAPI WinHttpGetProxyForUrl( HINTERNET hsession, LPCWSTR url, WINHTTP_AUTO */ BOOL WINAPI WinHttpSetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info ) { - FIXME("%p [%u, %s, %s]\n", info, info->dwAccessType, debugstr_w(info->lpszProxy), - debugstr_w(info->lpszProxyBypass)); - return TRUE; + LONG l; + HKEY key; + BOOL ret = FALSE; + const WCHAR *src; + + TRACE("%p\n", info); + + if (!info) + { + set_last_error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + switch (info->dwAccessType) + { + case WINHTTP_ACCESS_TYPE_NO_PROXY: + break; + case WINHTTP_ACCESS_TYPE_NAMED_PROXY: + if (!info->lpszProxy) + { + set_last_error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + /* Only ASCII characters are allowed */ + for (src = info->lpszProxy; *src; src++) + if (*src > 0x7f) + { + set_last_error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + if (info->lpszProxyBypass) + { + for (src = info->lpszProxyBypass; *src; src++) + if (*src > 0x7f) + { + set_last_error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + } + break; + default: + set_last_error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + l = RegCreateKeyExW( HKEY_LOCAL_MACHINE, Connections, 0, NULL, 0, + KEY_WRITE, NULL, &key, NULL ); + if (!l) + { + DWORD size = sizeof(struct winhttp_settings_header) + 2 * sizeof(DWORD); + BYTE *buf; + + if (info->dwAccessType == WINHTTP_ACCESS_TYPE_NAMED_PROXY) + { + size += strlenW( info->lpszProxy ); + if (info->lpszProxyBypass) + size += strlenW( info->lpszProxyBypass ); + } + buf = heap_alloc( size ); + if (buf) + { + struct winhttp_settings_header *hdr = + (struct winhttp_settings_header *)buf; + DWORD *len = (DWORD *)(hdr + 1); + + hdr->magic = WINHTTPSETTINGS_MAGIC; + hdr->unknown = 0; + if (info->dwAccessType == WINHTTP_ACCESS_TYPE_NAMED_PROXY) + { + BYTE *dst; + + hdr->flags = WINHTTP_PROXY_TYPE_PROXY; + *len++ = strlenW( info->lpszProxy ); + for (dst = (BYTE *)len, src = info->lpszProxy; *src; + src++, dst++) + *dst = *src; + len = (DWORD *)dst; + if (info->lpszProxyBypass) + { + *len++ = strlenW( info->lpszProxyBypass ); + for (dst = (BYTE *)len, src = info->lpszProxyBypass; *src; + src++, dst++) + *dst = *src; + } + else + *len++ = 0; + } + else + { + hdr->flags = WINHTTP_PROXY_TYPE_DIRECT; + *len++ = 0; + *len++ = 0; + } + l = RegSetValueExW( key, WinHttpSettings, 0, REG_BINARY, buf, size ); + if (!l) + ret = TRUE; + heap_free( buf ); + } + RegCloseKey( key ); + } + return ret; } /*********************************************************************** diff --git a/dlls/winhttp/tests/Makefile.in b/dlls/winhttp/tests/Makefile.in index 561efac8a1d..670ee1abdd8 100644 --- a/dlls/winhttp/tests/Makefile.in +++ b/dlls/winhttp/tests/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../../.. SRCDIR = @srcdir@ VPATH = @srcdir@ TESTDLL = winhttp.dll -IMPORTS = winhttp kernel32 +IMPORTS = winhttp advapi32 kernel32 CTESTS = \ notification.c \ diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 74e1c9a12ec..bce91fea4dd 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "wine/test.h" @@ -342,6 +343,8 @@ static void test_WinHttpAddHeaders(void) static const WCHAR test_header_begin[] = {'P','O','S','T',' ','/','p','o','s','t','t','e','s','t','.','p','h','p',' ','H','T','T','P','/','1'}; + static const WCHAR full_path_test_header_begin[] = + {'P','O','S','T',' ','h','t','t','p',':','/','/','c','r','o','s','s','o','v','e','r','.','c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',':','8','0','/','p','o','s','t','t','e','s','t','.','p','h','p',' ','H','T','T','P','/','1'}; static const WCHAR test_header_end[] = {'\r','\n','\r','\n',0}; static const WCHAR test_header_name[] = {'W','a','r','n','i','n','g',0}; @@ -475,7 +478,8 @@ static void test_WinHttpAddHeaders(void) ok(len + sizeof(WCHAR) <= oldlen, "WinHttpQueryHeaders resulting length longer than advertized.\n"); ok((len < sizeof(buffer) - sizeof(WCHAR)) && buffer[len / sizeof(WCHAR)] == 0, "WinHttpQueryHeaders did not append NULL terminator\n"); ok(len == lstrlenW(buffer) * sizeof(WCHAR), "WinHttpQueryHeaders returned incorrect length.\n"); - ok(memcmp(buffer, test_header_begin, sizeof(test_header_begin)) == 0, + ok(memcmp(buffer, test_header_begin, sizeof(test_header_begin)) == 0 || + memcmp(buffer, full_path_test_header_begin, sizeof(full_path_test_header_begin)) == 0, "WinHttpQueryHeaders returned invalid beginning of header string.\n"); ok(memcmp(buffer + lstrlenW(buffer) - 4, test_header_end, sizeof(test_header_end)) == 0, "WinHttpQueryHeaders returned invalid end of header string.\n"); @@ -502,7 +506,9 @@ static void test_WinHttpAddHeaders(void) ok(len + sizeof(WCHAR) <= oldlen, "resulting length longer than advertized\n"); ok((len < sizeof(buffer) - sizeof(WCHAR)) && !buffer[len / sizeof(WCHAR)] && !buffer[len / sizeof(WCHAR) - 1], "no double NULL terminator\n"); - ok(!memcmp(buffer, test_header_begin, sizeof(test_header_begin)), "invalid beginning of header string\n"); + ok(memcmp(buffer, test_header_begin, sizeof(test_header_begin)) == 0 || + memcmp(buffer, full_path_test_header_begin, sizeof(full_path_test_header_begin)) == 0, + "invalid beginning of header string.\n"); ok(index == 0, "header index was incremented\n"); /* tests for more indices */ @@ -817,6 +823,133 @@ static void test_request_parameter_defaults(void) WinHttpCloseHandle(ses); } +static const WCHAR Connections[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\', + 'C','o','n','n','e','c','t','i','o','n','s',0 }; +static const WCHAR WinHttpSettings[] = { + 'W','i','n','H','t','t','p','S','e','t','t','i','n','g','s',0 }; + +static DWORD get_default_proxy_reg_value( BYTE *buf, DWORD len, DWORD *type ) +{ + LONG l; + HKEY key; + DWORD ret = 0; + + l = RegOpenKeyExW( HKEY_LOCAL_MACHINE, Connections, 0, KEY_READ, &key ); + if (!l) + { + DWORD size = 0; + + l = RegQueryValueExW( key, WinHttpSettings, NULL, type, NULL, &size ); + if (!l) + { + if (size <= len) + l = RegQueryValueExW( key, WinHttpSettings, NULL, type, buf, + &size ); + if (!l) + ret = size; + } + RegCloseKey( key ); + } + return ret; +} + +static void set_default_proxy_reg_value( BYTE *buf, DWORD len, DWORD type ) +{ + LONG l; + HKEY key; + + l = RegCreateKeyExW( HKEY_LOCAL_MACHINE, Connections, 0, NULL, 0, + KEY_WRITE, NULL, &key, NULL ); + if (!l) + { + RegSetValueExW( key, WinHttpSettings, 0, type, buf, len ); + RegCloseKey( key ); + } +} + +static void test_set_default_proxy_config(void) +{ + static const WCHAR wideString[] = { 0x226f, 0x575b, 0 }; + static const WCHAR normalString[] = { 'f','o','o',0 }; + DWORD type, len; + BYTE *saved_proxy_settings = NULL; + WINHTTP_PROXY_INFO info; + BOOL ret; + + /* FIXME: it would be simpler to read the current settings using + * WinHttpGetDefaultProxyConfiguration and save them using + * WinHttpSetDefaultProxyConfiguration, but they appear to have a bug. + * + * If a proxy is configured in the registry, e.g. via 'proxcfg -p "foo"', + * the access type reported by WinHttpGetDefaultProxyConfiguration is 1, + * WINHTTP_ACCESS_TYPE_NO_PROXY, whereas it should be + * WINHTTP_ACCESS_TYPE_NAMED_PROXY. + * If WinHttpSetDefaultProxyConfiguration is called with dwAccessType = 1, + * the lpszProxy and lpszProxyBypass values are ignored. + * Thus, if a proxy is set with proxycfg, then calling + * WinHttpGetDefaultProxyConfiguration followed by + * WinHttpSetDefaultProxyConfiguration results in the proxy settings + * getting deleted from the registry. + * + * Instead I read the current registry value and restore it directly. + */ + len = get_default_proxy_reg_value( NULL, 0, &type ); + if (len) + { + saved_proxy_settings = HeapAlloc( GetProcessHeap(), 0, len ); + len = get_default_proxy_reg_value( saved_proxy_settings, len, &type ); + } + + if (0) + { + /* Crashes on Vista and higher */ + SetLastError(0xdeadbeef); + ret = WinHttpSetDefaultProxyConfiguration(NULL); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + } + + /* test with invalid access type */ + info.dwAccessType = 0xdeadbeef; + info.lpszProxy = info.lpszProxyBypass = NULL; + SetLastError(0xdeadbeef); + ret = WinHttpSetDefaultProxyConfiguration(&info); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + + /* at a minimum, the proxy server must be set */ + info.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; + info.lpszProxy = info.lpszProxyBypass = NULL; + SetLastError(0xdeadbeef); + ret = WinHttpSetDefaultProxyConfiguration(&info); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + info.lpszProxyBypass = normalString; + SetLastError(0xdeadbeef); + ret = WinHttpSetDefaultProxyConfiguration(&info); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + + /* the proxy server can't have wide characters */ + info.lpszProxy = wideString; + SetLastError(0xdeadbeef); + ret = WinHttpSetDefaultProxyConfiguration(&info); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + + info.lpszProxy = normalString; + SetLastError(0xdeadbeef); + ret = WinHttpSetDefaultProxyConfiguration(&info); + ok(ret, "WinHttpSetDefaultProxyConfiguration failed: %d\n", GetLastError()); + + set_default_proxy_reg_value( saved_proxy_settings, len, type ); +} + START_TEST (winhttp) { test_OpenRequest(); @@ -827,4 +960,5 @@ START_TEST (winhttp) test_secure_connection(); test_request_parameter_defaults(); test_QueryOption(); + test_set_default_proxy_config(); } diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 2143953c034..2431d7ce9c9 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -221,6 +221,7 @@ BOOL set_cookies( request_t *, const WCHAR * ); BOOL add_cookie_headers( request_t * ); BOOL add_request_headers( request_t *, LPCWSTR, DWORD, DWORD ); void delete_domain( domain_t * ); +BOOL set_server_for_hostname( connect_t *connect, LPCWSTR server, INTERNET_PORT port ); static inline void *heap_alloc( SIZE_T size ) { diff --git a/dlls/wininet/dialogs.c b/dlls/wininet/dialogs.c index 41494a67509..c1502ce62ef 100644 --- a/dlls/wininet/dialogs.c +++ b/dlls/wininet/dialogs.c @@ -62,12 +62,12 @@ struct WININET_ErrorDlgParams */ static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz ) { - LPWININETHTTPREQW lpwhr; - LPWININETHTTPSESSIONW lpwhs = NULL; - LPWININETAPPINFOW hIC = NULL; + http_request_t *lpwhr; + http_session_t *lpwhs = NULL; + appinfo_t *hIC = NULL; LPWSTR p; - lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest ); + lpwhr = (http_request_t*) WININET_GetObject( hRequest ); if (NULL == lpwhr) return FALSE; @@ -203,12 +203,12 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer, static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest, LPWSTR username, LPWSTR password ) { - LPWININETHTTPREQW lpwhr; - LPWININETHTTPSESSIONW lpwhs; - LPWININETAPPINFOW hIC; + http_request_t *lpwhr; + http_session_t *lpwhs; + appinfo_t *hIC; LPWSTR p; - lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest ); + lpwhr = (http_request_t*) WININET_GetObject( hRequest ); if( !lpwhr ) return FALSE; diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index dce18bb6804..dbb54cbc3d6 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -68,29 +68,29 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet); -typedef struct _WININETFTPSESSIONW WININETFTPSESSIONW; +typedef struct _ftp_session_t ftp_session_t; typedef struct { object_header_t hdr; - WININETFTPSESSIONW *lpFtpSession; + ftp_session_t *lpFtpSession; BOOL session_deleted; int nDataSocket; -} WININETFTPFILE, *LPWININETFTPFILE; +} ftp_file_t; -typedef struct _WININETFTPSESSIONW +struct _ftp_session_t { object_header_t hdr; - WININETAPPINFOW *lpAppInfo; + appinfo_t *lpAppInfo; int sndSocket; int lstnSocket; int pasvSocket; /* data socket connected by us in case of passive FTP */ - LPWININETFTPFILE download_in_progress; + ftp_file_t *download_in_progress; struct sockaddr_in socketAddress; struct sockaddr_in lstnSocketAddress; LPWSTR lpszPassword; LPWSTR lpszUserName; -} *LPWININETFTPSESSIONW; +}; typedef struct { @@ -104,7 +104,7 @@ typedef struct typedef struct { object_header_t hdr; - WININETFTPSESSIONW *lpFtpSession; + ftp_session_t *lpFtpSession; DWORD index; DWORD size; LPFILEPROPERTIESW lpafp; @@ -173,40 +173,40 @@ static const WCHAR szNoAccount[] = {'n','o','a','c','c','o','u','n','t','\0'}; static BOOL FTP_SendCommand(INT nSocket, FTP_COMMAND ftpCmd, LPCWSTR lpszParam, INTERNET_STATUS_CALLBACK lpfnStatusCB, object_header_t *hdr, DWORD_PTR dwContext); -static BOOL FTP_SendStore(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, DWORD dwType); -static BOOL FTP_GetDataSocket(LPWININETFTPSESSIONW lpwfs, LPINT nDataSocket); -static BOOL FTP_SendData(LPWININETFTPSESSIONW lpwfs, INT nDataSocket, HANDLE hFile); -static INT FTP_ReceiveResponse(LPWININETFTPSESSIONW lpwfs, DWORD_PTR dwContext); -static BOOL FTP_SendRetrieve(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, DWORD dwType); -static BOOL FTP_RetrieveFileData(LPWININETFTPSESSIONW lpwfs, INT nDataSocket, HANDLE hFile); -static BOOL FTP_InitListenSocket(LPWININETFTPSESSIONW lpwfs); -static BOOL FTP_ConnectToHost(LPWININETFTPSESSIONW lpwfs); -static BOOL FTP_SendPassword(LPWININETFTPSESSIONW lpwfs); -static BOOL FTP_SendAccount(LPWININETFTPSESSIONW lpwfs); -static BOOL FTP_SendType(LPWININETFTPSESSIONW lpwfs, DWORD dwType); -static BOOL FTP_SendPort(LPWININETFTPSESSIONW lpwfs); -static BOOL FTP_DoPassive(LPWININETFTPSESSIONW lpwfs); -static BOOL FTP_SendPortOrPasv(LPWININETFTPSESSIONW lpwfs); +static BOOL FTP_SendStore(ftp_session_t*, LPCWSTR lpszRemoteFile, DWORD dwType); +static BOOL FTP_GetDataSocket(ftp_session_t*, LPINT nDataSocket); +static BOOL FTP_SendData(ftp_session_t*, INT nDataSocket, HANDLE hFile); +static INT FTP_ReceiveResponse(ftp_session_t*, DWORD_PTR dwContext); +static BOOL FTP_SendRetrieve(ftp_session_t*, LPCWSTR lpszRemoteFile, DWORD dwType); +static BOOL FTP_RetrieveFileData(ftp_session_t*, INT nDataSocket, HANDLE hFile); +static BOOL FTP_InitListenSocket(ftp_session_t*); +static BOOL FTP_ConnectToHost(ftp_session_t*); +static BOOL FTP_SendPassword(ftp_session_t*); +static BOOL FTP_SendAccount(ftp_session_t*); +static BOOL FTP_SendType(ftp_session_t*, DWORD dwType); +static BOOL FTP_SendPort(ftp_session_t*); +static BOOL FTP_DoPassive(ftp_session_t*); +static BOOL FTP_SendPortOrPasv(ftp_session_t*); static BOOL FTP_ParsePermission(LPCSTR lpszPermission, LPFILEPROPERTIESW lpfp); static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERTIESW fileprop); -static BOOL FTP_ParseDirectory(LPWININETFTPSESSIONW lpwfs, INT nSocket, LPCWSTR lpszSearchFile, +static BOOL FTP_ParseDirectory(ftp_session_t*, INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERTIESW *lpafp, LPDWORD dwfp); -static HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONW lpwfs, INT nSocket, LPCWSTR lpszSearchFile, +static HINTERNET FTP_ReceiveFileList(ftp_session_t*, INT nSocket, LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD_PTR dwContext); static DWORD FTP_SetResponseError(DWORD dwResponse); static BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFindFileData); -static BOOL FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile, +static BOOL FTP_FtpPutFileW(ftp_session_t*, LPCWSTR lpszLocalFile, LPCWSTR lpszNewRemoteFile, DWORD dwFlags, DWORD_PTR dwContext); -static BOOL FTP_FtpSetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory); -static BOOL FTP_FtpCreateDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory); -static HINTERNET FTP_FtpFindFirstFileW(LPWININETFTPSESSIONW lpwfs, +static BOOL FTP_FtpSetCurrentDirectoryW(ftp_session_t*, LPCWSTR lpszDirectory); +static BOOL FTP_FtpCreateDirectoryW(ftp_session_t*, LPCWSTR lpszDirectory); +static HINTERNET FTP_FtpFindFirstFileW(ftp_session_t*, LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD dwFlags, DWORD_PTR dwContext); -static BOOL FTP_FtpGetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPWSTR lpszCurrentDirectory, +static BOOL FTP_FtpGetCurrentDirectoryW(ftp_session_t*, LPWSTR lpszCurrentDirectory, LPDWORD lpdwCurrentDirectory); -static BOOL FTP_FtpRenameFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszSrc, LPCWSTR lpszDest); -static BOOL FTP_FtpRemoveDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory); -static BOOL FTP_FtpDeleteFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszFileName); -static BOOL FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile, +static BOOL FTP_FtpRenameFileW(ftp_session_t*, LPCWSTR lpszSrc, LPCWSTR lpszDest); +static BOOL FTP_FtpRemoveDirectoryW(ftp_session_t*, LPCWSTR lpszDirectory); +static BOOL FTP_FtpDeleteFileW(ftp_session_t*, LPCWSTR lpszFileName); +static BOOL FTP_FtpGetFileW(ftp_session_t*, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile, BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags, DWORD_PTR dwContext); @@ -228,8 +228,8 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, LPWSTR lpwzNewRemoteFile; BOOL ret; - lpwzLocalFile = lpszLocalFile?WININET_strdup_AtoW(lpszLocalFile):NULL; - lpwzNewRemoteFile = lpszNewRemoteFile?WININET_strdup_AtoW(lpszNewRemoteFile):NULL; + lpwzLocalFile = heap_strdupAtoW(lpszLocalFile); + lpwzNewRemoteFile = heap_strdupAtoW(lpszNewRemoteFile); ret = FtpPutFileW(hConnect, lpwzLocalFile, lpwzNewRemoteFile, dwFlags, dwContext); HeapFree(GetProcessHeap(), 0, lpwzLocalFile); @@ -240,7 +240,7 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, static void AsyncFtpPutFileProc(WORKREQUEST *workRequest) { struct WORKREQ_FTPPUTFILEW const *req = &workRequest->u.FtpPutFileW; - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) workRequest->hdr; + ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; TRACE("%p\n", lpwfs); @@ -264,8 +264,8 @@ static void AsyncFtpPutFileProc(WORKREQUEST *workRequest) BOOL WINAPI FtpPutFileW(HINTERNET hConnect, LPCWSTR lpszLocalFile, LPCWSTR lpszNewRemoteFile, DWORD dwFlags, DWORD_PTR dwContext) { - LPWININETFTPSESSIONW lpwfs; - LPWININETAPPINFOW hIC = NULL; + ftp_session_t *lpwfs; + appinfo_t *hIC = NULL; BOOL r = FALSE; if (!lpszLocalFile || !lpszNewRemoteFile) @@ -274,7 +274,7 @@ BOOL WINAPI FtpPutFileW(HINTERNET hConnect, LPCWSTR lpszLocalFile, return FALSE; } - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect ); + lpwfs = (ftp_session_t*) WININET_GetObject( hConnect ); if (!lpwfs) { INTERNET_SetLastError(ERROR_INVALID_HANDLE); @@ -307,8 +307,8 @@ BOOL WINAPI FtpPutFileW(HINTERNET hConnect, LPCWSTR lpszLocalFile, workRequest.asyncproc = AsyncFtpPutFileProc; workRequest.hdr = WININET_AddRef( &lpwfs->hdr ); - req->lpszLocalFile = WININET_strdupW(lpszLocalFile); - req->lpszNewRemoteFile = WININET_strdupW(lpszNewRemoteFile); + req->lpszLocalFile = heap_strdupW(lpszLocalFile); + req->lpszNewRemoteFile = heap_strdupW(lpszNewRemoteFile); req->dwFlags = dwFlags; req->dwContext = dwContext; @@ -336,12 +336,12 @@ lend: * FALSE on failure * */ -static BOOL FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile, +static BOOL FTP_FtpPutFileW(ftp_session_t *lpwfs, LPCWSTR lpszLocalFile, LPCWSTR lpszNewRemoteFile, DWORD dwFlags, DWORD_PTR dwContext) { HANDLE hFile; BOOL bSuccess = FALSE; - LPWININETAPPINFOW hIC = NULL; + appinfo_t *hIC = NULL; INT nResCode; TRACE(" lpszLocalFile(%s) lpszNewRemoteFile(%s)\n", debugstr_w(lpszLocalFile), debugstr_w(lpszNewRemoteFile)); @@ -413,7 +413,7 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) LPWSTR lpwzDirectory; BOOL ret; - lpwzDirectory = lpszDirectory?WININET_strdup_AtoW(lpszDirectory):NULL; + lpwzDirectory = heap_strdupAtoW(lpszDirectory); ret = FtpSetCurrentDirectoryW(hConnect, lpwzDirectory); HeapFree(GetProcessHeap(), 0, lpwzDirectory); return ret; @@ -423,7 +423,7 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) static void AsyncFtpSetCurrentDirectoryProc(WORKREQUEST *workRequest) { struct WORKREQ_FTPSETCURRENTDIRECTORYW const *req = &workRequest->u.FtpSetCurrentDirectoryW; - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) workRequest->hdr; + ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; TRACE("%p\n", lpwfs); @@ -443,8 +443,8 @@ static void AsyncFtpSetCurrentDirectoryProc(WORKREQUEST *workRequest) */ BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory) { - LPWININETFTPSESSIONW lpwfs = NULL; - LPWININETAPPINFOW hIC = NULL; + ftp_session_t *lpwfs = NULL; + appinfo_t *hIC = NULL; BOOL r = FALSE; if (!lpszDirectory) @@ -453,7 +453,7 @@ BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory) goto lend; } - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect ); + lpwfs = (ftp_session_t*) WININET_GetObject( hConnect ); if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) { INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); @@ -477,7 +477,7 @@ BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory) workRequest.asyncproc = AsyncFtpSetCurrentDirectoryProc; workRequest.hdr = WININET_AddRef( &lpwfs->hdr ); req = &workRequest.u.FtpSetCurrentDirectoryW; - req->lpszDirectory = WININET_strdupW(lpszDirectory); + req->lpszDirectory = heap_strdupW(lpszDirectory); r = INTERNET_AsyncCall(&workRequest); } @@ -504,10 +504,10 @@ lend: * FALSE on failure * */ -static BOOL FTP_FtpSetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory) +static BOOL FTP_FtpSetCurrentDirectoryW(ftp_session_t *lpwfs, LPCWSTR lpszDirectory) { INT nResCode; - LPWININETAPPINFOW hIC = NULL; + appinfo_t *hIC = NULL; DWORD bSuccess = FALSE; TRACE("lpszDirectory(%s)\n", debugstr_w(lpszDirectory)); @@ -559,7 +559,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) LPWSTR lpwzDirectory; BOOL ret; - lpwzDirectory = lpszDirectory?WININET_strdup_AtoW(lpszDirectory):NULL; + lpwzDirectory = heap_strdupAtoW(lpszDirectory); ret = FtpCreateDirectoryW(hConnect, lpwzDirectory); HeapFree(GetProcessHeap(), 0, lpwzDirectory); return ret; @@ -569,7 +569,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) static void AsyncFtpCreateDirectoryProc(WORKREQUEST *workRequest) { struct WORKREQ_FTPCREATEDIRECTORYW const *req = &workRequest->u.FtpCreateDirectoryW; - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) workRequest->hdr; + ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; TRACE(" %p\n", lpwfs); @@ -589,11 +589,11 @@ static void AsyncFtpCreateDirectoryProc(WORKREQUEST *workRequest) */ BOOL WINAPI FtpCreateDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory) { - LPWININETFTPSESSIONW lpwfs; - LPWININETAPPINFOW hIC = NULL; + ftp_session_t *lpwfs; + appinfo_t *hIC = NULL; BOOL r = FALSE; - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect ); + lpwfs = (ftp_session_t*) WININET_GetObject( hConnect ); if (!lpwfs) { INTERNET_SetLastError(ERROR_INVALID_HANDLE); @@ -627,7 +627,7 @@ BOOL WINAPI FtpCreateDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory) workRequest.asyncproc = AsyncFtpCreateDirectoryProc; workRequest.hdr = WININET_AddRef( &lpwfs->hdr ); req = &workRequest.u.FtpCreateDirectoryW; - req->lpszDirectory = WININET_strdupW(lpszDirectory); + req->lpszDirectory = heap_strdupW(lpszDirectory); r = INTERNET_AsyncCall(&workRequest); } @@ -652,11 +652,11 @@ lend: * FALSE on failure * */ -static BOOL FTP_FtpCreateDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory) +static BOOL FTP_FtpCreateDirectoryW(ftp_session_t *lpwfs, LPCWSTR lpszDirectory) { INT nResCode; BOOL bSuccess = FALSE; - LPWININETAPPINFOW hIC = NULL; + appinfo_t *hIC = NULL; TRACE("lpszDirectory(%s)\n", debugstr_w(lpszDirectory)); @@ -708,7 +708,7 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect, LPWIN32_FIND_DATAW lpFindFileDataW; HINTERNET ret; - lpwzSearchFile = lpszSearchFile?WININET_strdup_AtoW(lpszSearchFile):NULL; + lpwzSearchFile = heap_strdupAtoW(lpszSearchFile); lpFindFileDataW = lpFindFileData?&wfd:NULL; ret = FtpFindFirstFileW(hConnect, lpwzSearchFile, lpFindFileDataW, dwFlags, dwContext); HeapFree(GetProcessHeap(), 0, lpwzSearchFile); @@ -723,7 +723,7 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect, static void AsyncFtpFindFirstFileProc(WORKREQUEST *workRequest) { struct WORKREQ_FTPFINDFIRSTFILEW const *req = &workRequest->u.FtpFindFirstFileW; - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) workRequest->hdr; + ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; TRACE("%p\n", lpwfs); @@ -745,11 +745,11 @@ static void AsyncFtpFindFirstFileProc(WORKREQUEST *workRequest) HINTERNET WINAPI FtpFindFirstFileW(HINTERNET hConnect, LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD dwFlags, DWORD_PTR dwContext) { - LPWININETFTPSESSIONW lpwfs; - LPWININETAPPINFOW hIC = NULL; + ftp_session_t *lpwfs; + appinfo_t *hIC = NULL; HINTERNET r = NULL; - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect ); + lpwfs = (ftp_session_t*) WININET_GetObject( hConnect ); if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) { INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); @@ -771,7 +771,7 @@ HINTERNET WINAPI FtpFindFirstFileW(HINTERNET hConnect, workRequest.asyncproc = AsyncFtpFindFirstFileProc; workRequest.hdr = WININET_AddRef( &lpwfs->hdr ); req = &workRequest.u.FtpFindFirstFileW; - req->lpszSearchFile = (lpszSearchFile == NULL) ? NULL : WININET_strdupW(lpszSearchFile); + req->lpszSearchFile = (lpszSearchFile == NULL) ? NULL : heap_strdupW(lpszSearchFile); req->lpFindFileData = lpFindFileData; req->dwFlags = dwFlags; req->dwContext= dwContext; @@ -802,11 +802,11 @@ lend: * NULL on failure * */ -static HINTERNET FTP_FtpFindFirstFileW(LPWININETFTPSESSIONW lpwfs, +static HINTERNET FTP_FtpFindFirstFileW(ftp_session_t *lpwfs, LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD dwFlags, DWORD_PTR dwContext) { INT nResCode; - LPWININETAPPINFOW hIC = NULL; + appinfo_t *hIC = NULL; HINTERNET hFindNext = NULL; TRACE("\n"); @@ -918,7 +918,7 @@ BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDire static void AsyncFtpGetCurrentDirectoryProc(WORKREQUEST *workRequest) { struct WORKREQ_FTPGETCURRENTDIRECTORYW const *req = &workRequest->u.FtpGetCurrentDirectoryW; - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) workRequest->hdr; + ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; TRACE("%p\n", lpwfs); @@ -938,13 +938,13 @@ static void AsyncFtpGetCurrentDirectoryProc(WORKREQUEST *workRequest) BOOL WINAPI FtpGetCurrentDirectoryW(HINTERNET hFtpSession, LPWSTR lpszCurrentDirectory, LPDWORD lpdwCurrentDirectory) { - LPWININETFTPSESSIONW lpwfs; - LPWININETAPPINFOW hIC = NULL; + ftp_session_t *lpwfs; + appinfo_t *hIC = NULL; BOOL r = FALSE; TRACE("%p %p %p\n", hFtpSession, lpszCurrentDirectory, lpdwCurrentDirectory); - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hFtpSession ); + lpwfs = (ftp_session_t*) WININET_GetObject( hFtpSession ); if (NULL == lpwfs) { INTERNET_SetLastError(ERROR_INVALID_HANDLE); @@ -1013,11 +1013,11 @@ lend: * FALSE on failure * */ -static BOOL FTP_FtpGetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPWSTR lpszCurrentDirectory, +static BOOL FTP_FtpGetCurrentDirectoryW(ftp_session_t *lpwfs, LPWSTR lpszCurrentDirectory, LPDWORD lpdwCurrentDirectory) { INT nResCode; - LPWININETAPPINFOW hIC = NULL; + appinfo_t *hIC = NULL; DWORD bSuccess = FALSE; /* Clear any error information */ @@ -1034,7 +1034,7 @@ static BOOL FTP_FtpGetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPWSTR lpszC if (nResCode == 257) /* Extract directory name */ { DWORD firstpos, lastpos, len; - LPWSTR lpszResponseBuffer = WININET_strdup_AtoW(INTERNET_GetResponseBuffer()); + LPWSTR lpszResponseBuffer = heap_strdupAtoW(INTERNET_GetResponseBuffer()); for (firstpos = 0, lastpos = 0; lpszResponseBuffer[lastpos]; lastpos++) { @@ -1086,8 +1086,8 @@ lend: */ static void FTPFILE_Destroy(object_header_t *hdr) { - LPWININETFTPFILE lpwh = (LPWININETFTPFILE) hdr; - LPWININETFTPSESSIONW lpwfs = lpwh->lpFtpSession; + ftp_file_t *lpwh = (ftp_file_t*) hdr; + ftp_session_t *lpwfs = lpwh->lpFtpSession; INT nResCode; TRACE("\n"); @@ -1125,7 +1125,7 @@ static DWORD FTPFILE_QueryOption(object_header_t *hdr, DWORD option, void *buffe static DWORD FTPFILE_ReadFile(object_header_t *hdr, void *buffer, DWORD size, DWORD *read) { - WININETFTPFILE *file = (WININETFTPFILE*)hdr; + ftp_file_t *file = (ftp_file_t*)hdr; int res; if (file->nDataSocket == -1) @@ -1152,7 +1152,7 @@ static DWORD FTPFILE_ReadFileExW(object_header_t *hdr, INTERNET_BUFFERSW *buffer static BOOL FTPFILE_WriteFile(object_header_t *hdr, const void *buffer, DWORD size, DWORD *written) { - LPWININETFTPFILE lpwh = (LPWININETFTPFILE) hdr; + ftp_file_t *lpwh = (ftp_file_t*) hdr; int res; res = send(lpwh->nDataSocket, buffer, size, 0); @@ -1161,7 +1161,7 @@ static BOOL FTPFILE_WriteFile(object_header_t *hdr, const void *buffer, DWORD si return res >= 0; } -static void FTP_ReceiveRequestData(WININETFTPFILE *file, BOOL first_notif) +static void FTP_ReceiveRequestData(ftp_file_t *file, BOOL first_notif) { INTERNET_ASYNC_RESULT iar; BYTE buffer[4096]; @@ -1185,14 +1185,14 @@ static void FTP_ReceiveRequestData(WININETFTPFILE *file, BOOL first_notif) static void FTPFILE_AsyncQueryDataAvailableProc(WORKREQUEST *workRequest) { - WININETFTPFILE *file = (WININETFTPFILE*)workRequest->hdr; + ftp_file_t *file = (ftp_file_t*)workRequest->hdr; FTP_ReceiveRequestData(file, FALSE); } static DWORD FTPFILE_QueryDataAvailable(object_header_t *hdr, DWORD *available, DWORD flags, DWORD_PTR ctx) { - LPWININETFTPFILE file = (LPWININETFTPFILE) hdr; + ftp_file_t *file = (ftp_file_t*) hdr; int retval, unread = 0; TRACE("(%p %p %x %lx)\n", file, available, flags, ctx); @@ -1253,14 +1253,14 @@ static const object_vtbl_t FTPFILEVtbl = { * NULL on failure * */ -HINTERNET FTP_FtpOpenFileW(LPWININETFTPSESSIONW lpwfs, +HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs, LPCWSTR lpszFileName, DWORD fdwAccess, DWORD dwFlags, DWORD_PTR dwContext) { INT nDataSocket; BOOL bSuccess = FALSE; - LPWININETFTPFILE lpwh = NULL; - LPWININETAPPINFOW hIC = NULL; + ftp_file_t *lpwh = NULL; + appinfo_t *hIC = NULL; HINTERNET handle = NULL; TRACE("\n"); @@ -1282,7 +1282,7 @@ HINTERNET FTP_FtpOpenFileW(LPWININETFTPSESSIONW lpwfs, /* Get data socket to server */ if (bSuccess && FTP_GetDataSocket(lpwfs, &nDataSocket)) { - lpwh = HeapAlloc(GetProcessHeap(), 0, sizeof(WININETFTPFILE)); + lpwh = HeapAlloc(GetProcessHeap(), 0, sizeof(ftp_file_t)); lpwh->hdr.htype = WH_HFILE; lpwh->hdr.vtbl = &FTPFILEVtbl; lpwh->hdr.dwFlags = dwFlags; @@ -1355,7 +1355,7 @@ HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession, LPWSTR lpwzFileName; HINTERNET ret; - lpwzFileName = lpszFileName?WININET_strdup_AtoW(lpszFileName):NULL; + lpwzFileName = heap_strdupAtoW(lpszFileName); ret = FtpOpenFileW(hFtpSession, lpwzFileName, fdwAccess, dwFlags, dwContext); HeapFree(GetProcessHeap(), 0, lpwzFileName); return ret; @@ -1365,7 +1365,7 @@ HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession, static void AsyncFtpOpenFileProc(WORKREQUEST *workRequest) { struct WORKREQ_FTPOPENFILEW const *req = &workRequest->u.FtpOpenFileW; - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) workRequest->hdr; + ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; TRACE("%p\n", lpwfs); @@ -1388,14 +1388,14 @@ HINTERNET WINAPI FtpOpenFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName, DWORD fdwAccess, DWORD dwFlags, DWORD_PTR dwContext) { - LPWININETFTPSESSIONW lpwfs; - LPWININETAPPINFOW hIC = NULL; + ftp_session_t *lpwfs; + appinfo_t *hIC = NULL; HINTERNET r = NULL; TRACE("(%p,%s,0x%08x,0x%08x,0x%08lx)\n", hFtpSession, debugstr_w(lpszFileName), fdwAccess, dwFlags, dwContext); - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hFtpSession ); + lpwfs = (ftp_session_t*) WININET_GetObject( hFtpSession ); if (!lpwfs) { INTERNET_SetLastError(ERROR_INVALID_HANDLE); @@ -1431,7 +1431,7 @@ HINTERNET WINAPI FtpOpenFileW(HINTERNET hFtpSession, workRequest.asyncproc = AsyncFtpOpenFileProc; workRequest.hdr = WININET_AddRef( &lpwfs->hdr ); req = &workRequest.u.FtpOpenFileW; - req->lpszFilename = WININET_strdupW(lpszFileName); + req->lpszFilename = heap_strdupW(lpszFileName); req->dwAccess = fdwAccess; req->dwFlags = dwFlags; req->dwContext = dwContext; @@ -1469,8 +1469,8 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN LPWSTR lpwzNewFile; BOOL ret; - lpwzRemoteFile = lpszRemoteFile?WININET_strdup_AtoW(lpszRemoteFile):NULL; - lpwzNewFile = lpszNewFile?WININET_strdup_AtoW(lpszNewFile):NULL; + lpwzRemoteFile = heap_strdupAtoW(lpszRemoteFile); + lpwzNewFile = heap_strdupAtoW(lpszNewFile); ret = FtpGetFileW(hInternet, lpwzRemoteFile, lpwzNewFile, fFailIfExists, dwLocalFlagsAttribute, dwInternetFlags, dwContext); HeapFree(GetProcessHeap(), 0, lpwzRemoteFile); @@ -1482,7 +1482,7 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN static void AsyncFtpGetFileProc(WORKREQUEST *workRequest) { struct WORKREQ_FTPGETFILEW const *req = &workRequest->u.FtpGetFileW; - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) workRequest->hdr; + ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; TRACE("%p\n", lpwfs); @@ -1508,8 +1508,8 @@ BOOL WINAPI FtpGetFileW(HINTERNET hInternet, LPCWSTR lpszRemoteFile, LPCWSTR lps BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags, DWORD_PTR dwContext) { - LPWININETFTPSESSIONW lpwfs; - LPWININETAPPINFOW hIC = NULL; + ftp_session_t *lpwfs; + appinfo_t *hIC = NULL; BOOL r = FALSE; if (!lpszRemoteFile || !lpszNewFile) @@ -1518,7 +1518,7 @@ BOOL WINAPI FtpGetFileW(HINTERNET hInternet, LPCWSTR lpszRemoteFile, LPCWSTR lps return FALSE; } - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hInternet ); + lpwfs = (ftp_session_t*) WININET_GetObject( hInternet ); if (!lpwfs) { INTERNET_SetLastError(ERROR_INVALID_HANDLE); @@ -1552,8 +1552,8 @@ BOOL WINAPI FtpGetFileW(HINTERNET hInternet, LPCWSTR lpszRemoteFile, LPCWSTR lps workRequest.asyncproc = AsyncFtpGetFileProc; workRequest.hdr = WININET_AddRef( &lpwfs->hdr ); req = &workRequest.u.FtpGetFileW; - req->lpszRemoteFile = WININET_strdupW(lpszRemoteFile); - req->lpszNewFile = WININET_strdupW(lpszNewFile); + req->lpszRemoteFile = heap_strdupW(lpszRemoteFile); + req->lpszNewFile = heap_strdupW(lpszNewFile); req->dwLocalFlagsAttribute = dwLocalFlagsAttribute; req->fFailIfExists = fFailIfExists; req->dwFlags = dwInternetFlags; @@ -1584,13 +1584,13 @@ lend: * FALSE on failure * */ -static BOOL FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile, +static BOOL FTP_FtpGetFileW(ftp_session_t *lpwfs, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile, BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags, DWORD_PTR dwContext) { BOOL bSuccess = FALSE; HANDLE hFile; - LPWININETAPPINFOW hIC = NULL; + appinfo_t *hIC = NULL; TRACE("lpszRemoteFile(%s) lpszNewFile(%s)\n", debugstr_w(lpszRemoteFile), debugstr_w(lpszNewFile)); @@ -1676,7 +1676,7 @@ BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName) LPWSTR lpwzFileName; BOOL ret; - lpwzFileName = lpszFileName?WININET_strdup_AtoW(lpszFileName):NULL; + lpwzFileName = heap_strdupAtoW(lpszFileName); ret = FtpDeleteFileW(hFtpSession, lpwzFileName); HeapFree(GetProcessHeap(), 0, lpwzFileName); return ret; @@ -1685,7 +1685,7 @@ BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName) static void AsyncFtpDeleteFileProc(WORKREQUEST *workRequest) { struct WORKREQ_FTPDELETEFILEW const *req = &workRequest->u.FtpDeleteFileW; - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) workRequest->hdr; + ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; TRACE("%p\n", lpwfs); @@ -1705,11 +1705,11 @@ static void AsyncFtpDeleteFileProc(WORKREQUEST *workRequest) */ BOOL WINAPI FtpDeleteFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName) { - LPWININETFTPSESSIONW lpwfs; - LPWININETAPPINFOW hIC = NULL; + ftp_session_t *lpwfs; + appinfo_t *hIC = NULL; BOOL r = FALSE; - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hFtpSession ); + lpwfs = (ftp_session_t*) WININET_GetObject( hFtpSession ); if (!lpwfs) { INTERNET_SetLastError(ERROR_INVALID_HANDLE); @@ -1743,7 +1743,7 @@ BOOL WINAPI FtpDeleteFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName) workRequest.asyncproc = AsyncFtpDeleteFileProc; workRequest.hdr = WININET_AddRef( &lpwfs->hdr ); req = &workRequest.u.FtpDeleteFileW; - req->lpszFilename = WININET_strdupW(lpszFileName); + req->lpszFilename = heap_strdupW(lpszFileName); r = INTERNET_AsyncCall(&workRequest); } @@ -1768,11 +1768,11 @@ lend: * FALSE on failure * */ -BOOL FTP_FtpDeleteFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszFileName) +BOOL FTP_FtpDeleteFileW(ftp_session_t *lpwfs, LPCWSTR lpszFileName) { INT nResCode; BOOL bSuccess = FALSE; - LPWININETAPPINFOW hIC = NULL; + appinfo_t *hIC = NULL; TRACE("%p\n", lpwfs); @@ -1821,7 +1821,7 @@ BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory) LPWSTR lpwzDirectory; BOOL ret; - lpwzDirectory = lpszDirectory?WININET_strdup_AtoW(lpszDirectory):NULL; + lpwzDirectory = heap_strdupAtoW(lpszDirectory); ret = FtpRemoveDirectoryW(hFtpSession, lpwzDirectory); HeapFree(GetProcessHeap(), 0, lpwzDirectory); return ret; @@ -1830,7 +1830,7 @@ BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory) static void AsyncFtpRemoveDirectoryProc(WORKREQUEST *workRequest) { struct WORKREQ_FTPREMOVEDIRECTORYW const *req = &workRequest->u.FtpRemoveDirectoryW; - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) workRequest->hdr; + ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; TRACE("%p\n", lpwfs); @@ -1850,11 +1850,11 @@ static void AsyncFtpRemoveDirectoryProc(WORKREQUEST *workRequest) */ BOOL WINAPI FtpRemoveDirectoryW(HINTERNET hFtpSession, LPCWSTR lpszDirectory) { - LPWININETFTPSESSIONW lpwfs; - LPWININETAPPINFOW hIC = NULL; + ftp_session_t *lpwfs; + appinfo_t *hIC = NULL; BOOL r = FALSE; - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hFtpSession ); + lpwfs = (ftp_session_t*) WININET_GetObject( hFtpSession ); if (!lpwfs) { INTERNET_SetLastError(ERROR_INVALID_HANDLE); @@ -1888,7 +1888,7 @@ BOOL WINAPI FtpRemoveDirectoryW(HINTERNET hFtpSession, LPCWSTR lpszDirectory) workRequest.asyncproc = AsyncFtpRemoveDirectoryProc; workRequest.hdr = WININET_AddRef( &lpwfs->hdr ); req = &workRequest.u.FtpRemoveDirectoryW; - req->lpszDirectory = WININET_strdupW(lpszDirectory); + req->lpszDirectory = heap_strdupW(lpszDirectory); r = INTERNET_AsyncCall(&workRequest); } @@ -1913,11 +1913,11 @@ lend: * FALSE on failure * */ -BOOL FTP_FtpRemoveDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory) +BOOL FTP_FtpRemoveDirectoryW(ftp_session_t *lpwfs, LPCWSTR lpszDirectory) { INT nResCode; BOOL bSuccess = FALSE; - LPWININETAPPINFOW hIC = NULL; + appinfo_t *hIC = NULL; TRACE("\n"); @@ -1968,8 +1968,8 @@ BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDes LPWSTR lpwzDest; BOOL ret; - lpwzSrc = lpszSrc?WININET_strdup_AtoW(lpszSrc):NULL; - lpwzDest = lpszDest?WININET_strdup_AtoW(lpszDest):NULL; + lpwzSrc = heap_strdupAtoW(lpszSrc); + lpwzDest = heap_strdupAtoW(lpszDest); ret = FtpRenameFileW(hFtpSession, lpwzSrc, lpwzDest); HeapFree(GetProcessHeap(), 0, lpwzSrc); HeapFree(GetProcessHeap(), 0, lpwzDest); @@ -1979,7 +1979,7 @@ BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDes static void AsyncFtpRenameFileProc(WORKREQUEST *workRequest) { struct WORKREQ_FTPRENAMEFILEW const *req = &workRequest->u.FtpRenameFileW; - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) workRequest->hdr; + ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; TRACE("%p\n", lpwfs); @@ -2000,11 +2000,11 @@ static void AsyncFtpRenameFileProc(WORKREQUEST *workRequest) */ BOOL WINAPI FtpRenameFileW(HINTERNET hFtpSession, LPCWSTR lpszSrc, LPCWSTR lpszDest) { - LPWININETFTPSESSIONW lpwfs; - LPWININETAPPINFOW hIC = NULL; + ftp_session_t *lpwfs; + appinfo_t *hIC = NULL; BOOL r = FALSE; - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hFtpSession ); + lpwfs = (ftp_session_t*) WININET_GetObject( hFtpSession ); if (!lpwfs) { INTERNET_SetLastError(ERROR_INVALID_HANDLE); @@ -2038,8 +2038,8 @@ BOOL WINAPI FtpRenameFileW(HINTERNET hFtpSession, LPCWSTR lpszSrc, LPCWSTR lpszD workRequest.asyncproc = AsyncFtpRenameFileProc; workRequest.hdr = WININET_AddRef( &lpwfs->hdr ); req = &workRequest.u.FtpRenameFileW; - req->lpszSrcFile = WININET_strdupW(lpszSrc); - req->lpszDestFile = WININET_strdupW(lpszDest); + req->lpszSrcFile = heap_strdupW(lpszSrc); + req->lpszDestFile = heap_strdupW(lpszDest); r = INTERNET_AsyncCall(&workRequest); } @@ -2064,12 +2064,11 @@ lend: * FALSE on failure * */ -BOOL FTP_FtpRenameFileW( LPWININETFTPSESSIONW lpwfs, - LPCWSTR lpszSrc, LPCWSTR lpszDest) +BOOL FTP_FtpRenameFileW(ftp_session_t *lpwfs, LPCWSTR lpszSrc, LPCWSTR lpszDest) { INT nResCode; BOOL bSuccess = FALSE; - LPWININETAPPINFOW hIC = NULL; + appinfo_t *hIC = NULL; TRACE("\n"); @@ -2132,7 +2131,7 @@ BOOL WINAPI FtpCommandA( HINTERNET hConnect, BOOL fExpectResponse, DWORD dwFlags return FALSE; } - if (!(cmdW = WININET_strdup_AtoW(lpszCommand))) + if (!(cmdW = heap_strdupAtoW(lpszCommand))) { INTERNET_SetLastError(ERROR_OUTOFMEMORY); return FALSE; @@ -2151,7 +2150,7 @@ BOOL WINAPI FtpCommandW( HINTERNET hConnect, BOOL fExpectResponse, DWORD dwFlags LPCWSTR lpszCommand, DWORD_PTR dwContext, HINTERNET* phFtpCommand ) { BOOL r = FALSE; - LPWININETFTPSESSIONW lpwfs; + ftp_session_t *lpwfs; LPSTR cmd = NULL; DWORD len, nBytesSent= 0; INT nResCode, nRC = 0; @@ -2171,7 +2170,7 @@ BOOL WINAPI FtpCommandW( HINTERNET hConnect, BOOL fExpectResponse, DWORD dwFlags return FALSE; } - lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect ); + lpwfs = (ftp_session_t*) WININET_GetObject( hConnect ); if (!lpwfs) { INTERNET_SetLastError(ERROR_INVALID_HANDLE); @@ -2236,7 +2235,7 @@ lend: */ static void FTPSESSION_Destroy(object_header_t *hdr) { - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) hdr; + ftp_session_t *lpwfs = (ftp_session_t*) hdr; TRACE("\n"); @@ -2249,7 +2248,7 @@ static void FTPSESSION_Destroy(object_header_t *hdr) static void FTPSESSION_CloseConnection(object_header_t *hdr) { - LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) hdr; + ftp_session_t *lpwfs = (ftp_session_t*) hdr; TRACE("\n"); @@ -2322,7 +2321,7 @@ static const object_vtbl_t FTPSESSIONVtbl = { * */ -HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, +HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext, DWORD dwInternalFlags) @@ -2339,7 +2338,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, INT nsocket = -1; UINT sock_namelen; BOOL bSuccess = FALSE; - LPWININETFTPSESSIONW lpwfs = NULL; + ftp_session_t *lpwfs = NULL; HINTERNET handle = NULL; TRACE("%p Server(%s) Port(%d) User(%s) Paswd(%s)\n", @@ -2354,7 +2353,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, goto lerror; } - lpwfs = HeapAlloc(GetProcessHeap(), 0, sizeof(WININETFTPSESSIONW)); + lpwfs = HeapAlloc(GetProcessHeap(), 0, sizeof(ftp_session_t)); if (NULL == lpwfs) { INTERNET_SetLastError(ERROR_OUTOFMEMORY); @@ -2399,7 +2398,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, WCHAR szPassword[MAX_PATH]; DWORD len = sizeof(szPassword); - lpwfs->lpszUserName = WININET_strdupW(szDefaultUsername); + lpwfs->lpszUserName = heap_strdupW(szDefaultUsername); RegOpenKeyW(HKEY_CURRENT_USER, szKey, &key); if (RegQueryValueExW(key, szValue, NULL, NULL, (LPBYTE)szPassword, &len)) { @@ -2412,15 +2411,11 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, RegCloseKey(key); TRACE("Password used for anonymous ftp : (%s)\n", debugstr_w(szPassword)); - lpwfs->lpszPassword = WININET_strdupW(szPassword); + lpwfs->lpszPassword = heap_strdupW(szPassword); } else { - lpwfs->lpszUserName = WININET_strdupW(lpszUserName); - - if (lpszPassword) - lpwfs->lpszPassword = WININET_strdupW(lpszPassword); - else - lpwfs->lpszPassword = WININET_strdupW(szEmpty); + lpwfs->lpszUserName = heap_strdupW(lpszUserName); + lpwfs->lpszPassword = heap_strdupW(lpszPassword ? lpszPassword : szEmpty); } /* Don't send a handle created callback if this handle was created with InternetOpenUrl */ @@ -2512,7 +2507,7 @@ lerror: * NULL on failure * */ -static BOOL FTP_ConnectToHost(LPWININETFTPSESSIONW lpwfs) +static BOOL FTP_ConnectToHost(ftp_session_t *lpwfs) { INT nResCode; BOOL bSuccess = FALSE; @@ -2614,7 +2609,7 @@ static BOOL FTP_SendCommand(INT nSocket, FTP_COMMAND ftpCmd, LPCWSTR lpszParam, INTERNET_STATUS_CALLBACK lpfnStatusCB, object_header_t *hdr, DWORD_PTR dwContext) { BOOL ret; - LPSTR lpszParamA = lpszParam?WININET_strdup_WtoA(lpszParam):NULL; + LPSTR lpszParamA = heap_strdupWtoA(lpszParam); ret = FTP_SendCommandA(nSocket, ftpCmd, lpszParamA, lpfnStatusCB, hdr, dwContext); HeapFree(GetProcessHeap(), 0, lpszParamA); return ret; @@ -2630,7 +2625,7 @@ static BOOL FTP_SendCommand(INT nSocket, FTP_COMMAND ftpCmd, LPCWSTR lpszParam, * 0 on failure * */ -INT FTP_ReceiveResponse(LPWININETFTPSESSIONW lpwfs, DWORD_PTR dwContext) +INT FTP_ReceiveResponse(ftp_session_t *lpwfs, DWORD_PTR dwContext) { LPSTR lpszResponse = INTERNET_GetResponseBuffer(); DWORD nRecv; @@ -2693,7 +2688,7 @@ lerror: * NULL on failure * */ -static BOOL FTP_SendPassword(LPWININETFTPSESSIONW lpwfs) +static BOOL FTP_SendPassword(ftp_session_t *lpwfs) { INT nResCode; BOOL bSuccess = FALSE; @@ -2733,7 +2728,7 @@ lend: * FALSE on failure * */ -static BOOL FTP_SendAccount(LPWININETFTPSESSIONW lpwfs) +static BOOL FTP_SendAccount(ftp_session_t *lpwfs) { INT nResCode; BOOL bSuccess = FALSE; @@ -2763,7 +2758,7 @@ lend: * FALSE on failure * */ -static BOOL FTP_SendStore(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, DWORD dwType) +static BOOL FTP_SendStore(ftp_session_t *lpwfs, LPCWSTR lpszRemoteFile, DWORD dwType) { INT nResCode; BOOL bSuccess = FALSE; @@ -2810,7 +2805,7 @@ lend: * FALSE on failure * */ -static BOOL FTP_InitListenSocket(LPWININETFTPSESSIONW lpwfs) +static BOOL FTP_InitListenSocket(ftp_session_t *lpwfs) { BOOL bSuccess = FALSE; socklen_t namelen = sizeof(lpwfs->lstnSocketAddress); @@ -2869,7 +2864,7 @@ lend: * (i.e. it sends it always), * so we probably don't want to do that either. */ -static BOOL FTP_SendType(LPWININETFTPSESSIONW lpwfs, DWORD dwType) +static BOOL FTP_SendType(ftp_session_t *lpwfs, DWORD dwType) { INT nResCode; WCHAR type[] = { 'I','\0' }; @@ -2907,7 +2902,7 @@ lend: * FALSE on failure * */ -static BOOL FTP_GetFileSize(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, DWORD *dwSize) +static BOOL FTP_GetFileSize(ftp_session_t *lpwfs, LPCWSTR lpszRemoteFile, DWORD *dwSize) { INT nResCode; BOOL bSuccess = FALSE; @@ -2951,7 +2946,7 @@ lend: * FALSE on failure * */ -static BOOL FTP_SendPort(LPWININETFTPSESSIONW lpwfs) +static BOOL FTP_SendPort(ftp_session_t *lpwfs) { static const WCHAR szIPFormat[] = {'%','d',',','%','d',',','%','d',',','%','d',',','%','d',',','%','d','\0'}; INT nResCode; @@ -2995,7 +2990,7 @@ lend: * FALSE on failure * */ -static BOOL FTP_DoPassive(LPWININETFTPSESSIONW lpwfs) +static BOOL FTP_DoPassive(ftp_session_t *lpwfs) { INT nResCode; BOOL bSuccess = FALSE; @@ -3067,7 +3062,7 @@ lend: } -static BOOL FTP_SendPortOrPasv(LPWININETFTPSESSIONW lpwfs) +static BOOL FTP_SendPortOrPasv(ftp_session_t *lpwfs) { if (lpwfs->hdr.dwFlags & INTERNET_FLAG_PASSIVE) { @@ -3096,7 +3091,7 @@ static BOOL FTP_SendPortOrPasv(LPWININETFTPSESSIONW lpwfs) * FALSE on failure * */ -static BOOL FTP_GetDataSocket(LPWININETFTPSESSIONW lpwfs, LPINT nDataSocket) +static BOOL FTP_GetDataSocket(ftp_session_t *lpwfs, LPINT nDataSocket) { struct sockaddr_in saddr; socklen_t addrlen = sizeof(struct sockaddr); @@ -3126,7 +3121,7 @@ static BOOL FTP_GetDataSocket(LPWININETFTPSESSIONW lpwfs, LPINT nDataSocket) * FALSE on failure * */ -static BOOL FTP_SendData(LPWININETFTPSESSIONW lpwfs, INT nDataSocket, HANDLE hFile) +static BOOL FTP_SendData(ftp_session_t *lpwfs, INT nDataSocket, HANDLE hFile) { BY_HANDLE_FILE_INFORMATION fi; DWORD nBytesRead = 0; @@ -3207,7 +3202,7 @@ static BOOL FTP_SendData(LPWININETFTPSESSIONW lpwfs, INT nDataSocket, HANDLE hFi * 0 on failure * */ -static BOOL FTP_SendRetrieve(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, DWORD dwType) +static BOOL FTP_SendRetrieve(ftp_session_t *lpwfs, LPCWSTR lpszRemoteFile, DWORD dwType) { INT nResCode; BOOL ret; @@ -3253,7 +3248,7 @@ lend: * FALSE on failure * */ -static BOOL FTP_RetrieveFileData(LPWININETFTPSESSIONW lpwfs, INT nDataSocket, HANDLE hFile) +static BOOL FTP_RetrieveFileData(ftp_session_t *lpwfs, INT nDataSocket, HANDLE hFile) { DWORD nBytesWritten; INT nRC = 0; @@ -3413,7 +3408,7 @@ static const object_vtbl_t FTPFINDNEXTVtbl = { * NULL on failure * */ -static HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONW lpwfs, INT nSocket, LPCWSTR lpszSearchFile, +static HINTERNET FTP_ReceiveFileList(ftp_session_t *lpwfs, INT nSocket, LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD_PTR dwContext) { DWORD dwSize = 0; @@ -3583,7 +3578,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT pszToken = strtok(NULL, szSpace); if(!pszToken) continue; - lpfp->lpszName = WININET_strdup_AtoW(pszToken); + lpfp->lpszName = heap_strdupAtoW(pszToken); TRACE("File: %s\n", debugstr_w(lpfp->lpszName)); } /* NT way of parsing ... : @@ -3632,7 +3627,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT pszToken = strtok(NULL, szSpace); if(!pszToken) continue; - lpfp->lpszName = WININET_strdup_AtoW(pszToken); + lpfp->lpszName = heap_strdupAtoW(pszToken); TRACE("Name: %s\n", debugstr_w(lpfp->lpszName)); } /* EPLF format - http://cr.yp.to/ftp/list/eplf.html */ @@ -3664,7 +3659,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT * TRUE on success * FALSE on failure */ -static BOOL FTP_ParseDirectory(LPWININETFTPSESSIONW lpwfs, INT nSocket, LPCWSTR lpszSearchFile, +static BOOL FTP_ParseDirectory(ftp_session_t *lpwfs, INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERTIESW *lpafp, LPDWORD dwfp) { BOOL bSuccess = TRUE; diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 5832a5c1ef6..b4f79248128 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -176,23 +176,23 @@ struct gzip_stream_t { BOOL end_of_data; }; -static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr); -static BOOL HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear); -static BOOL HTTP_ProcessHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field, LPCWSTR value, DWORD dwModifier); +static BOOL HTTP_OpenConnection(http_request_t *req); +static BOOL HTTP_GetResponseHeaders(http_request_t *req, BOOL clear); +static BOOL HTTP_ProcessHeader(http_request_t *req, LPCWSTR field, LPCWSTR value, DWORD dwModifier); static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer); -static BOOL HTTP_InsertCustomHeader(LPWININETHTTPREQW lpwhr, LPHTTPHEADERW lpHdr); -static INT HTTP_GetCustomHeaderIndex(LPWININETHTTPREQW lpwhr, LPCWSTR lpszField, INT index, BOOL Request); -static BOOL HTTP_DeleteCustomHeader(LPWININETHTTPREQW lpwhr, DWORD index); +static BOOL HTTP_InsertCustomHeader(http_request_t *req, LPHTTPHEADERW lpHdr); +static INT HTTP_GetCustomHeaderIndex(http_request_t *req, LPCWSTR lpszField, INT index, BOOL Request); +static BOOL HTTP_DeleteCustomHeader(http_request_t *req, DWORD index); static LPWSTR HTTP_build_req( LPCWSTR *list, int len ); -static BOOL HTTP_HttpQueryInfoW(LPWININETHTTPREQW, DWORD, LPVOID, LPDWORD, LPDWORD); -static LPWSTR HTTP_GetRedirectURL(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl); -static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl); +static BOOL HTTP_HttpQueryInfoW(http_request_t*, DWORD, LPVOID, LPDWORD, LPDWORD); +static LPWSTR HTTP_GetRedirectURL(http_request_t *req, LPCWSTR lpszUrl); +static BOOL HTTP_HandleRedirect(http_request_t *req, LPCWSTR lpszUrl); static UINT HTTP_DecodeBase64(LPCWSTR base64, LPSTR bin); -static BOOL HTTP_VerifyValidHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field); -static void HTTP_DrainContent(WININETHTTPREQW *req); -static BOOL HTTP_FinishedReading(LPWININETHTTPREQW lpwhr); +static BOOL HTTP_VerifyValidHeader(http_request_t *req, LPCWSTR field); +static void HTTP_DrainContent(http_request_t *req); +static BOOL HTTP_FinishedReading(http_request_t *req); -static LPHTTPHEADERW HTTP_GetHeader(LPWININETHTTPREQW req, LPCWSTR head) +static LPHTTPHEADERW HTTP_GetHeader(http_request_t *req, LPCWSTR head) { int HeaderIndex = 0; HeaderIndex = HTTP_GetCustomHeaderIndex(req, head, 0, TRUE); @@ -214,7 +214,7 @@ static void wininet_zfree(voidpf opaque, voidpf address) HeapFree(GetProcessHeap(), 0, address); } -static void init_gzip_stream(WININETHTTPREQW *req) +static void init_gzip_stream(http_request_t *req) { gzip_stream_t *gzip_stream; int zres; @@ -243,7 +243,7 @@ static void init_gzip_stream(WININETHTTPREQW *req) #else -static void init_gzip_stream(WININETHTTPREQW *req) +static void init_gzip_stream(http_request_t *req) { ERR("gzip stream not supported, missing zlib.\n"); } @@ -251,7 +251,7 @@ static void init_gzip_stream(WININETHTTPREQW *req) #endif /* set the request content length based on the headers */ -static DWORD set_content_length( LPWININETHTTPREQW lpwhr ) +static DWORD set_content_length( http_request_t *lpwhr ) { static const WCHAR szChunked[] = {'c','h','u','n','k','e','d',0}; WCHAR encoding[20]; @@ -356,7 +356,7 @@ static void HTTP_FreeTokens(LPWSTR * token_array) static void AsyncHttpSendRequestProc(WORKREQUEST *workRequest) { struct WORKREQ_HTTPSENDREQUESTW const *req = &workRequest->u.HttpSendRequestW; - LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) workRequest->hdr; + http_request_t *lpwhr = (http_request_t*) workRequest->hdr; TRACE("%p\n", lpwhr); @@ -367,14 +367,14 @@ static void AsyncHttpSendRequestProc(WORKREQUEST *workRequest) HeapFree(GetProcessHeap(), 0, req->lpszHeader); } -static void HTTP_FixURL( LPWININETHTTPREQW lpwhr) +static void HTTP_FixURL(http_request_t *lpwhr) { static const WCHAR szSlash[] = { '/',0 }; static const WCHAR szHttp[] = { 'h','t','t','p',':','/','/', 0 }; /* If we don't have a path we set it to root */ if (NULL == lpwhr->lpszPath) - lpwhr->lpszPath = WININET_strdupW(szSlash); + lpwhr->lpszPath = heap_strdupW(szSlash); else /* remove \r and \n*/ { int nLen = strlenW(lpwhr->lpszPath); @@ -403,7 +403,7 @@ static void HTTP_FixURL( LPWININETHTTPREQW lpwhr) } } -static LPWSTR HTTP_BuildHeaderRequestString( LPWININETHTTPREQW lpwhr, LPCWSTR verb, LPCWSTR path, LPCWSTR version ) +static LPWSTR HTTP_BuildHeaderRequestString( http_request_t *lpwhr, LPCWSTR verb, LPCWSTR path, LPCWSTR version ) { LPWSTR requestString; DWORD len, n; @@ -462,7 +462,7 @@ static LPWSTR HTTP_BuildHeaderRequestString( LPWININETHTTPREQW lpwhr, LPCWSTR ve return requestString; } -static void HTTP_ProcessCookies( LPWININETHTTPREQW lpwhr ) +static void HTTP_ProcessCookies( http_request_t *lpwhr ) { int HeaderIndex; int numCookies = 0; @@ -498,7 +498,7 @@ static inline BOOL is_basic_auth_value( LPCWSTR pszAuthValue ) ((pszAuthValue[ARRAYSIZE(szBasic)] == ' ') || !pszAuthValue[ARRAYSIZE(szBasic)]); } -static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue, +static BOOL HTTP_DoAuthorization( http_request_t *lpwhr, LPCWSTR pszAuthValue, struct HttpAuthInfo **ppAuthInfo, LPWSTR domain_and_username, LPWSTR password ) { @@ -528,7 +528,7 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue, if (is_basic_auth_value(pszAuthValue)) { static const WCHAR szBasic[] = {'B','a','s','i','c',0}; - pAuthInfo->scheme = WININET_strdupW(szBasic); + pAuthInfo->scheme = heap_strdupW(szBasic); if (!pAuthInfo->scheme) { HeapFree(GetProcessHeap(), 0, pAuthInfo); @@ -540,7 +540,7 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue, PVOID pAuthData; SEC_WINNT_AUTH_IDENTITY_W nt_auth_identity; - pAuthInfo->scheme = WININET_strdupW(pszAuthValue); + pAuthInfo->scheme = heap_strdupW(pszAuthValue); if (!pAuthInfo->scheme) { HeapFree(GetProcessHeap(), 0, pAuthInfo); @@ -713,7 +713,7 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue, /*********************************************************************** * HTTP_HttpAddRequestHeadersW (internal) */ -static BOOL HTTP_HttpAddRequestHeadersW(LPWININETHTTPREQW lpwhr, +static BOOL HTTP_HttpAddRequestHeadersW(http_request_t *lpwhr, LPCWSTR lpszHeader, DWORD dwHeaderLength, DWORD dwModifier) { LPWSTR lpszStart; @@ -800,14 +800,14 @@ BOOL WINAPI HttpAddRequestHeadersW(HINTERNET hHttpRequest, LPCWSTR lpszHeader, DWORD dwHeaderLength, DWORD dwModifier) { BOOL bSuccess = FALSE; - LPWININETHTTPREQW lpwhr; + http_request_t *lpwhr; TRACE("%p, %s, %i, %i\n", hHttpRequest, debugstr_wn(lpszHeader, dwHeaderLength), dwHeaderLength, dwModifier); if (!lpszHeader) return TRUE; - lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hHttpRequest ); + lpwhr = (http_request_t*) WININET_GetObject( hHttpRequest ); if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ) { INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); @@ -877,7 +877,7 @@ BOOL WINAPI HttpEndRequestA(HINTERNET hRequest, return HttpEndRequestW(hRequest, NULL, dwFlags, dwContext); } -static BOOL HTTP_HttpEndRequestW(LPWININETHTTPREQW lpwhr, DWORD dwFlags, DWORD_PTR dwContext) +static BOOL HTTP_HttpEndRequestW(http_request_t *lpwhr, DWORD dwFlags, DWORD_PTR dwContext) { BOOL rc = FALSE; INT responseLen; @@ -911,7 +911,7 @@ static BOOL HTTP_HttpEndRequestW(LPWININETHTTPREQW lpwhr, DWORD dwFlags, DWORD_P { /* redirects are always GETs */ HeapFree(GetProcessHeap(), 0, lpwhr->lpszVerb); - lpwhr->lpszVerb = WININET_strdupW(szGET); + lpwhr->lpszVerb = heap_strdupW(szGET); HTTP_DrainContent(lpwhr); if ((new_url = HTTP_GetRedirectURL( lpwhr, szNewLocation ))) { @@ -938,7 +938,7 @@ static BOOL HTTP_HttpEndRequestW(LPWININETHTTPREQW lpwhr, DWORD dwFlags, DWORD_P static void AsyncHttpEndRequestProc(WORKREQUEST *work) { struct WORKREQ_HTTPENDREQUESTW const *req = &work->u.HttpEndRequestW; - LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW)work->hdr; + http_request_t *lpwhr = (http_request_t*)work->hdr; TRACE("%p\n", lpwhr); @@ -959,7 +959,7 @@ BOOL WINAPI HttpEndRequestW(HINTERNET hRequest, LPINTERNET_BUFFERSW lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext) { BOOL rc = FALSE; - LPWININETHTTPREQW lpwhr; + http_request_t *lpwhr; TRACE("-->\n"); @@ -969,7 +969,7 @@ BOOL WINAPI HttpEndRequestW(HINTERNET hRequest, return FALSE; } - lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest ); + lpwhr = (http_request_t*) WININET_GetObject( hRequest ); if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ) { @@ -1018,7 +1018,7 @@ HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession, LPCWSTR lpszReferrer , LPCWSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext) { - LPWININETHTTPSESSIONW lpwhs; + http_session_t *lpwhs; HINTERNET handle = NULL; TRACE("(%p, %s, %s, %s, %s, %p, %08x, %08lx)\n", hHttpSession, @@ -1032,7 +1032,7 @@ HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession, TRACE("\taccept type: %s\n",debugstr_w(lpszAcceptTypes[i])); } - lpwhs = (LPWININETHTTPSESSIONW) WININET_GetObject( hHttpSession ); + lpwhs = (http_session_t*) WININET_GetObject( hHttpSession ); if (NULL == lpwhs || lpwhs->hdr.htype != WH_HHTTPSESSION) { INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); @@ -1074,7 +1074,7 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, { LPWSTR szVerb = NULL, szObjectName = NULL; LPWSTR szVersion = NULL, szReferrer = NULL, *szAcceptTypes = NULL; - INT len, acceptTypesCount; + INT acceptTypesCount; HINTERNET rc = FALSE; LPCSTR *types; @@ -1085,38 +1085,30 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, if (lpszVerb) { - len = MultiByteToWideChar(CP_ACP, 0, lpszVerb, -1, NULL, 0 ); - szVerb = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR) ); + szVerb = heap_strdupAtoW(lpszVerb); if ( !szVerb ) goto end; - MultiByteToWideChar(CP_ACP, 0, lpszVerb, -1, szVerb, len); } if (lpszObjectName) { - len = MultiByteToWideChar(CP_ACP, 0, lpszObjectName, -1, NULL, 0 ); - szObjectName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR) ); + szObjectName = heap_strdupAtoW(lpszObjectName); if ( !szObjectName ) goto end; - MultiByteToWideChar(CP_ACP, 0, lpszObjectName, -1, szObjectName, len ); } if (lpszVersion) { - len = MultiByteToWideChar(CP_ACP, 0, lpszVersion, -1, NULL, 0 ); - szVersion = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + szVersion = heap_strdupAtoW(lpszVersion); if ( !szVersion ) goto end; - MultiByteToWideChar(CP_ACP, 0, lpszVersion, -1, szVersion, len ); } if (lpszReferrer) { - len = MultiByteToWideChar(CP_ACP, 0, lpszReferrer, -1, NULL, 0 ); - szReferrer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + szReferrer = heap_strdupAtoW(lpszReferrer); if ( !szReferrer ) goto end; - MultiByteToWideChar(CP_ACP, 0, lpszReferrer, -1, szReferrer, len ); } if (lpszAcceptTypes) @@ -1151,13 +1143,7 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, __TRY { if (*types && **types) - { - len = MultiByteToWideChar(CP_ACP, 0, *types, -1, NULL, 0 ); - szAcceptTypes[acceptTypesCount] = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - - MultiByteToWideChar(CP_ACP, 0, *types, -1, szAcceptTypes[acceptTypesCount], len); - acceptTypesCount++; - } + szAcceptTypes[acceptTypesCount++] = heap_strdupAtoW(*types); } __EXCEPT_PAGE_FAULT { @@ -1329,7 +1315,7 @@ static UINT HTTP_DecodeBase64( LPCWSTR base64, LPSTR bin ) * * Insert or delete the authorization field in the request header. */ -static BOOL HTTP_InsertAuthorization( LPWININETHTTPREQW lpwhr, struct HttpAuthInfo *pAuthInfo, LPCWSTR header ) +static BOOL HTTP_InsertAuthorization( http_request_t *lpwhr, struct HttpAuthInfo *pAuthInfo, LPCWSTR header ) { if (pAuthInfo) { @@ -1372,7 +1358,7 @@ static BOOL HTTP_InsertAuthorization( LPWININETHTTPREQW lpwhr, struct HttpAuthIn return TRUE; } -static WCHAR *HTTP_BuildProxyRequestUrl(WININETHTTPREQW *req) +static WCHAR *HTTP_BuildProxyRequestUrl(http_request_t *req) { WCHAR new_location[INTERNET_MAX_URL_LENGTH], *url; DWORD size; @@ -1388,7 +1374,7 @@ static WCHAR *HTTP_BuildProxyRequestUrl(WININETHTTPREQW *req) static const WCHAR slash[] = { '/',0 }; static const WCHAR format[] = { 'h','t','t','p',':','/','/','%','s',':','%','d',0 }; static const WCHAR formatSSL[] = { 'h','t','t','p','s',':','/','/','%','s',':','%','d',0 }; - WININETHTTPSESSIONW *session = req->lpHttpSession; + http_session_t *session = req->lpHttpSession; size = 16; /* "https://" + sizeof(port#) + ":/\0" */ size += strlenW( session->lpszHostName ) + strlenW( req->lpszPath ); @@ -1409,8 +1395,7 @@ static WCHAR *HTTP_BuildProxyRequestUrl(WININETHTTPREQW *req) /*********************************************************************** * HTTP_DealWithProxy */ -static BOOL HTTP_DealWithProxy( LPWININETAPPINFOW hIC, - LPWININETHTTPSESSIONW lpwhs, LPWININETHTTPREQW lpwhr) +static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *lpwhs, http_request_t *lpwhr) { WCHAR buf[MAXHOSTNAME]; WCHAR proxy[MAXHOSTNAME + 15]; /* 15 == "http://" + sizeof(port#) + ":/\0" */ @@ -1441,7 +1426,7 @@ static BOOL HTTP_DealWithProxy( LPWININETAPPINFOW hIC, UrlComponents.nPort = INTERNET_DEFAULT_HTTP_PORT; HeapFree(GetProcessHeap(), 0, lpwhs->lpszServerName); - lpwhs->lpszServerName = WININET_strdupW(UrlComponents.lpszHostName); + lpwhs->lpszServerName = heap_strdupW(UrlComponents.lpszHostName); lpwhs->nServerPort = UrlComponents.nPort; TRACE("proxy server=%s port=%d\n", debugstr_w(lpwhs->lpszServerName), lpwhs->nServerPort); @@ -1452,10 +1437,10 @@ static BOOL HTTP_DealWithProxy( LPWININETAPPINFOW hIC, #define INET6_ADDRSTRLEN 46 #endif -static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr) +static BOOL HTTP_ResolveName(http_request_t *lpwhr) { char szaddr[INET6_ADDRSTRLEN]; - LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession; + http_session_t *lpwhs = lpwhr->lpHttpSession; const void *addr; INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, @@ -1502,7 +1487,7 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr) */ static void HTTPREQ_Destroy(object_header_t *hdr) { - LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) hdr; + http_request_t *lpwhr = (http_request_t*) hdr; DWORD i; TRACE("\n"); @@ -1559,7 +1544,7 @@ static void HTTPREQ_Destroy(object_header_t *hdr) static void HTTPREQ_CloseConnection(object_header_t *hdr) { - LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) hdr; + http_request_t *lpwhr = (http_request_t*) hdr; TRACE("%p\n",lpwhr); @@ -1583,7 +1568,7 @@ static void HTTPREQ_CloseConnection(object_header_t *hdr) INTERNET_STATUS_CONNECTION_CLOSED, 0, 0); } -static BOOL HTTP_GetRequestURL(WININETHTTPREQW *req, LPWSTR buf) +static BOOL HTTP_GetRequestURL(http_request_t *req, LPWSTR buf) { LPHTTPHEADERW host_header; @@ -1599,12 +1584,12 @@ static BOOL HTTP_GetRequestURL(WININETHTTPREQW *req, LPWSTR buf) static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode) { - WININETHTTPREQW *req = (WININETHTTPREQW*)hdr; + http_request_t *req = (http_request_t*)hdr; switch(option) { case INTERNET_OPTION_SECURITY_FLAGS: { - LPWININETHTTPSESSIONW lpwhs; + http_session_t *lpwhs; lpwhs = req->lpHttpSession; if (*size < sizeof(ULONG)) @@ -1798,7 +1783,7 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe static DWORD HTTPREQ_SetOption(object_header_t *hdr, DWORD option, void *buffer, DWORD size) { - WININETHTTPREQW *req = (WININETHTTPREQW*)hdr; + http_request_t *req = (http_request_t*)hdr; switch(option) { case INTERNET_OPTION_SEND_TIMEOUT: @@ -1813,12 +1798,12 @@ static DWORD HTTPREQ_SetOption(object_header_t *hdr, DWORD option, void *buffer, case INTERNET_OPTION_USERNAME: HeapFree(GetProcessHeap(), 0, req->lpHttpSession->lpszUserName); - if (!(req->lpHttpSession->lpszUserName = WININET_strdupW(buffer))) return ERROR_OUTOFMEMORY; + if (!(req->lpHttpSession->lpszUserName = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY; return ERROR_SUCCESS; case INTERNET_OPTION_PASSWORD: HeapFree(GetProcessHeap(), 0, req->lpHttpSession->lpszPassword); - if (!(req->lpHttpSession->lpszPassword = WININET_strdupW(buffer))) return ERROR_OUTOFMEMORY; + if (!(req->lpHttpSession->lpszPassword = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY; return ERROR_SUCCESS; case INTERNET_OPTION_HTTP_DECODING: if(size != sizeof(BOOL)) @@ -1831,7 +1816,7 @@ static DWORD HTTPREQ_SetOption(object_header_t *hdr, DWORD option, void *buffer, } /* read some more data into the read buffer (the read section must be held) */ -static BOOL read_more_data( WININETHTTPREQW *req, int maxlen ) +static BOOL read_more_data( http_request_t *req, int maxlen ) { int len; @@ -1854,13 +1839,13 @@ static BOOL read_more_data( WININETHTTPREQW *req, int maxlen ) } /* remove some amount of data from the read buffer (the read section must be held) */ -static void remove_data( WININETHTTPREQW *req, int count ) +static void remove_data( http_request_t *req, int count ) { if (!(req->read_size -= count)) req->read_pos = 0; else req->read_pos += count; } -static BOOL read_line( WININETHTTPREQW *req, LPSTR buffer, DWORD *len ) +static BOOL read_line( http_request_t *req, LPSTR buffer, DWORD *len ) { int count, bytes_read, pos = 0; @@ -1903,7 +1888,7 @@ static BOOL read_line( WININETHTTPREQW *req, LPSTR buffer, DWORD *len ) } /* discard data contents until we reach end of line (the read section must be held) */ -static BOOL discard_eol( WININETHTTPREQW *req ) +static BOOL discard_eol( http_request_t *req ) { do { @@ -1920,7 +1905,7 @@ static BOOL discard_eol( WININETHTTPREQW *req ) } /* read the size of the next chunk (the read section must be held) */ -static BOOL start_next_chunk( WININETHTTPREQW *req ) +static BOOL start_next_chunk( http_request_t *req ) { DWORD chunk_size = 0; @@ -1960,7 +1945,7 @@ static BOOL start_next_chunk( WININETHTTPREQW *req ) } /* check if we have reached the end of the data to read (the read section must be held) */ -static BOOL end_of_read_data( WININETHTTPREQW *req ) +static BOOL end_of_read_data( http_request_t *req ) { if (req->gzip_stream) return req->gzip_stream->end_of_data && !req->gzip_stream->buf_size; if (req->read_chunked) return (req->dwContentLength == 0); @@ -1969,7 +1954,7 @@ static BOOL end_of_read_data( WININETHTTPREQW *req ) } /* fetch some more data into the read buffer (the read section must be held) */ -static BOOL refill_buffer( WININETHTTPREQW *req ) +static BOOL refill_buffer( http_request_t *req ) { int len = sizeof(req->read_buf); @@ -1986,7 +1971,7 @@ static BOOL refill_buffer( WININETHTTPREQW *req ) return TRUE; } -static DWORD read_gzip_data(WININETHTTPREQW *req, BYTE *buf, int size, BOOL sync, int *read_ret) +static DWORD read_gzip_data(http_request_t *req, BYTE *buf, int size, BOOL sync, int *read_ret) { DWORD ret = ERROR_SUCCESS; int read = 0; @@ -2024,7 +2009,7 @@ static DWORD read_gzip_data(WININETHTTPREQW *req, BYTE *buf, int size, BOOL sync return ret; } -static void refill_gzip_buffer(WININETHTTPREQW *req) +static void refill_gzip_buffer(http_request_t *req) { DWORD res; int len; @@ -2045,7 +2030,7 @@ static void refill_gzip_buffer(WININETHTTPREQW *req) } /* return the size of data available to be read immediately (the read section must be held) */ -static DWORD get_avail_data( WININETHTTPREQW *req ) +static DWORD get_avail_data( http_request_t *req ) { if (req->gzip_stream) { refill_gzip_buffer(req); @@ -2056,7 +2041,7 @@ static DWORD get_avail_data( WININETHTTPREQW *req ) return min( req->read_size, req->dwContentLength - req->dwContentRead ); } -static void HTTP_ReceiveRequestData(WININETHTTPREQW *req, BOOL first_notif) +static void HTTP_ReceiveRequestData(http_request_t *req, BOOL first_notif) { INTERNET_ASYNC_RESULT iar; @@ -2077,7 +2062,7 @@ static void HTTP_ReceiveRequestData(WININETHTTPREQW *req, BOOL first_notif) } /* read data from the http connection (the read section must be held) */ -static DWORD HTTPREQ_Read(WININETHTTPREQW *req, void *buffer, DWORD size, DWORD *read, BOOL sync) +static DWORD HTTPREQ_Read(http_request_t *req, void *buffer, DWORD size, DWORD *read, BOOL sync) { BOOL finished_reading = FALSE; int len, bytes_read = 0; @@ -2150,14 +2135,14 @@ done: static DWORD HTTPREQ_ReadFile(object_header_t *hdr, void *buffer, DWORD size, DWORD *read) { - WININETHTTPREQW *req = (WININETHTTPREQW*)hdr; + http_request_t *req = (http_request_t*)hdr; return HTTPREQ_Read(req, buffer, size, read, TRUE); } static void HTTPREQ_AsyncReadFileExAProc(WORKREQUEST *workRequest) { struct WORKREQ_INTERNETREADFILEEXA const *data = &workRequest->u.InternetReadFileExA; - WININETHTTPREQW *req = (WININETHTTPREQW*)workRequest->hdr; + http_request_t *req = (http_request_t*)workRequest->hdr; INTERNET_ASYNC_RESULT iar; DWORD res; @@ -2177,8 +2162,7 @@ static void HTTPREQ_AsyncReadFileExAProc(WORKREQUEST *workRequest) static DWORD HTTPREQ_ReadFileExA(object_header_t *hdr, INTERNET_BUFFERSA *buffers, DWORD flags, DWORD_PTR context) { - - WININETHTTPREQW *req = (WININETHTTPREQW*)hdr; + http_request_t *req = (http_request_t*)hdr; DWORD res; if (flags & ~(IRF_ASYNC|IRF_NO_WAIT)) @@ -2230,7 +2214,7 @@ done: static void HTTPREQ_AsyncReadFileExWProc(WORKREQUEST *workRequest) { struct WORKREQ_INTERNETREADFILEEXW const *data = &workRequest->u.InternetReadFileExW; - WININETHTTPREQW *req = (WININETHTTPREQW*)workRequest->hdr; + http_request_t *req = (http_request_t*)workRequest->hdr; INTERNET_ASYNC_RESULT iar; DWORD res; @@ -2251,7 +2235,7 @@ static DWORD HTTPREQ_ReadFileExW(object_header_t *hdr, INTERNET_BUFFERSW *buffer DWORD flags, DWORD_PTR context) { - WININETHTTPREQW *req = (WININETHTTPREQW*)hdr; + http_request_t *req = (http_request_t*)hdr; DWORD res; if (flags & ~(IRF_ASYNC|IRF_NO_WAIT)) @@ -2303,7 +2287,7 @@ done: static BOOL HTTPREQ_WriteFile(object_header_t *hdr, const void *buffer, DWORD size, DWORD *written) { BOOL ret; - LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW)hdr; + http_request_t *lpwhr = (http_request_t*)hdr; INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_SENDING_REQUEST, NULL, 0); @@ -2317,14 +2301,14 @@ static BOOL HTTPREQ_WriteFile(object_header_t *hdr, const void *buffer, DWORD si static void HTTPREQ_AsyncQueryDataAvailableProc(WORKREQUEST *workRequest) { - WININETHTTPREQW *req = (WININETHTTPREQW*)workRequest->hdr; + http_request_t *req = (http_request_t*)workRequest->hdr; HTTP_ReceiveRequestData(req, FALSE); } static DWORD HTTPREQ_QueryDataAvailable(object_header_t *hdr, DWORD *available, DWORD flags, DWORD_PTR ctx) { - WININETHTTPREQW *req = (WININETHTTPREQW*)hdr; + http_request_t *req = (http_request_t*)hdr; TRACE("(%p %p %x %lx)\n", req, available, flags, ctx); @@ -2392,13 +2376,13 @@ static const object_vtbl_t HTTPREQVtbl = { * NULL on failure * */ -HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, +HINTERNET WINAPI HTTP_HttpOpenRequestW(http_session_t *lpwhs, LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion, LPCWSTR lpszReferrer , LPCWSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext) { - LPWININETAPPINFOW hIC = NULL; - LPWININETHTTPREQW lpwhr; + appinfo_t *hIC = NULL; + http_request_t *lpwhr; LPWSTR lpszHostName = NULL; HINTERNET handle = NULL; static const WCHAR szHostForm[] = {'%','s',':','%','u',0}; @@ -2409,7 +2393,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, assert( lpwhs->hdr.htype == WH_HHTTPSESSION ); hIC = lpwhs->lpAppInfo; - lpwhr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WININETHTTPREQW)); + lpwhr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(http_request_t)); if (NULL == lpwhr) { INTERNET_SetLastError(ERROR_OUTOFMEMORY); @@ -2469,7 +2453,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, }else { static const WCHAR slashW[] = {'/',0}; - lpwhr->lpszPath = WININET_strdupW(slashW); + lpwhr->lpszPath = heap_strdupW(slashW); } if (lpszReferrer && *lpszReferrer) @@ -2488,12 +2472,8 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, } } - lpwhr->lpszVerb = WININET_strdupW(lpszVerb && *lpszVerb ? lpszVerb : szGET); - - if (lpszVersion) - lpwhr->lpszVersion = WININET_strdupW(lpszVersion); - else - lpwhr->lpszVersion = WININET_strdupW(g_szHttp1_1); + lpwhr->lpszVerb = heap_strdupW(lpszVerb && *lpszVerb ? lpszVerb : szGET); + lpwhr->lpszVersion = heap_strdupW(lpszVersion ? lpszVersion : g_szHttp1_1); if (lpwhs->nHostPort != INTERNET_INVALID_PORT_NUMBER && lpwhs->nHostPort != INTERNET_DEFAULT_HTTP_PORT && @@ -2535,7 +2515,7 @@ lend: /* read any content returned by the server so that the connection can be * reused */ -static void HTTP_DrainContent(WININETHTTPREQW *req) +static void HTTP_DrainContent(http_request_t *req) { DWORD bytes_read; @@ -2634,7 +2614,7 @@ static const LPCWSTR header_lookup[] = { /*********************************************************************** * HTTP_HttpQueryInfoW (internal) */ -static BOOL HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLevel, +static BOOL HTTP_HttpQueryInfoW(http_request_t *lpwhr, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex) { LPHTTPHEADERW lphttpHdr = NULL; @@ -2862,7 +2842,7 @@ BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex) { BOOL bSuccess = FALSE; - LPWININETHTTPREQW lpwhr; + http_request_t *lpwhr; if (TRACE_ON(wininet)) { #define FE(x) { x, #x } @@ -2974,7 +2954,7 @@ BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, TRACE("\n"); } - lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hHttpRequest ); + lpwhr = (http_request_t*) WININET_GetObject( hHttpRequest ); if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ) { INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); @@ -3133,14 +3113,14 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, DWORD dwFlags, DWORD_PTR dwContext) { BOOL ret = FALSE; - LPWININETHTTPREQW lpwhr; - LPWININETHTTPSESSIONW lpwhs; - LPWININETAPPINFOW hIC; + http_request_t *lpwhr; + http_session_t *lpwhs; + appinfo_t *hIC; TRACE("(%p, %p, %p, %08x, %08lx)\n", hRequest, lpBuffersIn, lpBuffersOut, dwFlags, dwContext); - lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest ); + lpwhr = (http_request_t*) WININET_GetObject( hRequest ); if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ) { @@ -3163,11 +3143,8 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, req = &workRequest.u.HttpSendRequestW; if (lpBuffersIn) { - if (lpBuffersIn->lpcszHeader) - /* FIXME: this should use dwHeadersLength or may not be necessary at all */ - req->lpszHeader = WININET_strdupW(lpBuffersIn->lpcszHeader); - else - req->lpszHeader = NULL; + /* FIXME: this should use dwHeadersLength or may not be necessary at all */ + req->lpszHeader = heap_strdupW(lpBuffersIn->lpcszHeader); req->dwHeaderLength = lpBuffersIn->dwHeadersLength; req->lpOptional = lpBuffersIn->lpvBuffer; req->dwOptionalLength = lpBuffersIn->dwBufferLength; @@ -3221,15 +3198,15 @@ lend: BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional ,DWORD dwOptionalLength) { - LPWININETHTTPREQW lpwhr; - LPWININETHTTPSESSIONW lpwhs = NULL; - LPWININETAPPINFOW hIC = NULL; + http_request_t *lpwhr; + http_session_t *lpwhs = NULL; + appinfo_t *hIC = NULL; BOOL r; TRACE("%p, %s, %i, %p, %i)\n", hHttpRequest, debugstr_wn(lpszHeaders, dwHeaderLength), dwHeaderLength, lpOptional, dwOptionalLength); - lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hHttpRequest ); + lpwhr = (http_request_t*) WININET_GetObject( hHttpRequest ); if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ) { INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); @@ -3328,11 +3305,11 @@ BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, /*********************************************************************** * HTTP_GetRedirectURL (internal) */ -static LPWSTR HTTP_GetRedirectURL(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl) +static LPWSTR HTTP_GetRedirectURL(http_request_t *lpwhr, LPCWSTR lpszUrl) { static WCHAR szHttp[] = {'h','t','t','p',0}; static WCHAR szHttps[] = {'h','t','t','p','s',0}; - LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession; + http_session_t *lpwhs = lpwhr->lpHttpSession; URL_COMPONENTSW urlComponents; DWORD url_length = 0; LPWSTR orig_url; @@ -3390,10 +3367,10 @@ static LPWSTR HTTP_GetRedirectURL(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl) /*********************************************************************** * HTTP_HandleRedirect (internal) */ -static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl) +static BOOL HTTP_HandleRedirect(http_request_t *lpwhr, LPCWSTR lpszUrl) { - LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession; - LPWININETAPPINFOW hIC = lpwhs->lpAppInfo; + http_session_t *lpwhs = lpwhr->lpHttpSession; + appinfo_t *hIC = lpwhs->lpAppInfo; BOOL using_proxy = hIC->lpszProxy && hIC->lpszProxy[0]; WCHAR path[INTERNET_MAX_URL_LENGTH]; int index; @@ -3482,21 +3459,21 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl) sprintfW(lpwhs->lpszHostName, fmt, hostName, urlComponents.nPort); } else - lpwhs->lpszHostName = WININET_strdupW(hostName); + lpwhs->lpszHostName = heap_strdupW(hostName); HTTP_ProcessHeader(lpwhr, hostW, lpwhs->lpszHostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDHDR_FLAG_REQ); HeapFree(GetProcessHeap(), 0, lpwhs->lpszUserName); lpwhs->lpszUserName = NULL; if (userName[0]) - lpwhs->lpszUserName = WININET_strdupW(userName); + lpwhs->lpszUserName = heap_strdupW(userName); if (!using_proxy) { if (strcmpiW(lpwhs->lpszServerName, hostName) || lpwhs->nServerPort != urlComponents.nPort) { HeapFree(GetProcessHeap(), 0, lpwhs->lpszServerName); - lpwhs->lpszServerName = WININET_strdupW(hostName); + lpwhs->lpszServerName = heap_strdupW(hostName); lpwhs->nServerPort = urlComponents.nPort; NETCON_close(&lpwhr->netConnection); @@ -3564,7 +3541,7 @@ static LPWSTR HTTP_build_req( LPCWSTR *list, int len ) return str; } -static BOOL HTTP_SecureProxyConnect(LPWININETHTTPREQW lpwhr) +static BOOL HTTP_SecureProxyConnect(http_request_t *lpwhr) { LPWSTR lpszPath; LPWSTR requestString; @@ -3575,7 +3552,7 @@ static BOOL HTTP_SecureProxyConnect(LPWININETHTTPREQW lpwhr) BOOL ret; static const WCHAR szConnect[] = {'C','O','N','N','E','C','T',0}; static const WCHAR szFormat[] = {'%','s',':','%','d',0}; - LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession; + http_session_t *lpwhs = lpwhr->lpHttpSession; TRACE("\n"); @@ -3606,7 +3583,7 @@ static BOOL HTTP_SecureProxyConnect(LPWININETHTTPREQW lpwhr) return TRUE; } -static void HTTP_InsertCookies(LPWININETHTTPREQW lpwhr) +static void HTTP_InsertCookies(http_request_t *lpwhr) { static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s','%','s',0}; LPWSTR lpszCookies, lpszUrl = NULL; @@ -3646,7 +3623,7 @@ static void HTTP_InsertCookies(LPWININETHTTPREQW lpwhr) * FALSE on failure * */ -BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, +BOOL WINAPI HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength, DWORD dwContentLength, BOOL bEndRequest) { @@ -3667,7 +3644,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, /* if the verb is NULL default to GET */ if (!lpwhr->lpszVerb) - lpwhr->lpszVerb = WININET_strdupW(szGET); + lpwhr->lpszVerb = heap_strdupW(szGET); if (dwContentLength || strcmpW(lpwhr->lpszVerb, szGET)) { @@ -3815,7 +3792,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, { /* redirects are always GETs */ HeapFree(GetProcessHeap(), 0, lpwhr->lpszVerb); - lpwhr->lpszVerb = WININET_strdupW(szGET); + lpwhr->lpszVerb = heap_strdupW(szGET); HTTP_DrainContent(lpwhr); if ((new_url = HTTP_GetRedirectURL( lpwhr, szNewLocation ))) @@ -3887,7 +3864,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, b = CreateUrlCacheEntryW(url, lpwhr->dwContentLength > 0 ? lpwhr->dwContentLength : 0, NULL, cacheFileName, 0); if(b) { - lpwhr->lpszCacheFile = WININET_strdupW(cacheFileName); + lpwhr->lpszCacheFile = heap_strdupW(cacheFileName); lpwhr->hCacheFile = CreateFileW(lpwhr->lpszCacheFile, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if(lpwhr->hCacheFile == INVALID_HANDLE_VALUE) { @@ -3944,7 +3921,7 @@ lend: */ static void HTTPSESSION_Destroy(object_header_t *hdr) { - LPWININETHTTPSESSIONW lpwhs = (LPWININETHTTPSESSIONW) hdr; + http_session_t *lpwhs = (http_session_t*) hdr; TRACE("%p\n", lpwhs); @@ -3976,19 +3953,19 @@ static DWORD HTTPSESSION_QueryOption(object_header_t *hdr, DWORD option, void *b static DWORD HTTPSESSION_SetOption(object_header_t *hdr, DWORD option, void *buffer, DWORD size) { - WININETHTTPSESSIONW *ses = (WININETHTTPSESSIONW*)hdr; + http_session_t *ses = (http_session_t*)hdr; switch(option) { case INTERNET_OPTION_USERNAME: { HeapFree(GetProcessHeap(), 0, ses->lpszUserName); - if (!(ses->lpszUserName = WININET_strdupW(buffer))) return ERROR_OUTOFMEMORY; + if (!(ses->lpszUserName = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY; return ERROR_SUCCESS; } case INTERNET_OPTION_PASSWORD: { HeapFree(GetProcessHeap(), 0, ses->lpszPassword); - if (!(ses->lpszPassword = WININET_strdupW(buffer))) return ERROR_OUTOFMEMORY; + if (!(ses->lpszPassword = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY; return ERROR_SUCCESS; } default: break; @@ -4020,12 +3997,12 @@ static const object_vtbl_t HTTPSESSIONVtbl = { * NULL on failure * */ -HINTERNET HTTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, +HINTERNET HTTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext, DWORD dwInternalFlags) { - LPWININETHTTPSESSIONW lpwhs = NULL; + http_session_t *lpwhs = NULL; HINTERNET handle = NULL; TRACE("-->\n"); @@ -4038,7 +4015,7 @@ HINTERNET HTTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, assert( hIC->hdr.htype == WH_HINIT ); - lpwhs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WININETHTTPSESSIONW)); + lpwhs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(http_session_t)); if (NULL == lpwhs) { INTERNET_SetLastError(ERROR_OUTOFMEMORY); @@ -4077,13 +4054,13 @@ HINTERNET HTTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, } if (lpszServerName && lpszServerName[0]) { - lpwhs->lpszServerName = WININET_strdupW(lpszServerName); - lpwhs->lpszHostName = WININET_strdupW(lpszServerName); + lpwhs->lpszServerName = heap_strdupW(lpszServerName); + lpwhs->lpszHostName = heap_strdupW(lpszServerName); } if (lpszUserName && lpszUserName[0]) - lpwhs->lpszUserName = WININET_strdupW(lpszUserName); + lpwhs->lpszUserName = heap_strdupW(lpszUserName); if (lpszPassword && lpszPassword[0]) - lpwhs->lpszPassword = WININET_strdupW(lpszPassword); + lpwhs->lpszPassword = heap_strdupW(lpszPassword); lpwhs->nServerPort = nServerPort; lpwhs->nHostPort = nServerPort; @@ -4119,11 +4096,11 @@ lerror: * TRUE on success * FALSE on failure */ -static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr) +static BOOL HTTP_OpenConnection(http_request_t *lpwhr) { BOOL bSuccess = FALSE; - LPWININETHTTPSESSIONW lpwhs; - LPWININETAPPINFOW hIC = NULL; + http_session_t *lpwhs; + appinfo_t *hIC = NULL; char szaddr[INET6_ADDRSTRLEN]; const void *addr; @@ -4214,7 +4191,7 @@ lend: * * clear out any old response headers */ -static void HTTP_clear_response_headers( LPWININETHTTPREQW lpwhr ) +static void HTTP_clear_response_headers( http_request_t *lpwhr ) { DWORD i; @@ -4241,7 +4218,7 @@ static void HTTP_clear_response_headers( LPWININETHTTPREQW lpwhr ) * TRUE on success * FALSE on error */ -static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear) +static INT HTTP_GetResponseHeaders(http_request_t *lpwhr, BOOL clear) { INT cbreaks = 0; WCHAR buffer[MAX_REPLY_LEN]; @@ -4308,8 +4285,8 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear) HeapFree(GetProcessHeap(),0,lpwhr->lpszVersion); HeapFree(GetProcessHeap(),0,lpwhr->lpszStatusText); - lpwhr->lpszVersion= WININET_strdupW(buffer); - lpwhr->lpszStatusText = WININET_strdupW(status_text); + lpwhr->lpszVersion = heap_strdupW(buffer); + lpwhr->lpszStatusText = heap_strdupW(status_text); /* Restore the spaces */ *(status_code-1) = ' '; @@ -4483,7 +4460,7 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer) #define COALESCEFLAGS (HTTP_ADDHDR_FLAG_COALESCE|HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA|HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) -static BOOL HTTP_ProcessHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field, LPCWSTR value, DWORD dwModifier) +static BOOL HTTP_ProcessHeader(http_request_t *lpwhr, LPCWSTR field, LPCWSTR value, DWORD dwModifier) { LPHTTPHEADERW lphttpHdr = NULL; BOOL bSuccess = FALSE; @@ -4605,7 +4582,7 @@ static BOOL HTTP_ProcessHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field, LPCWSTR v * Called when all content from server has been read by client. * */ -static BOOL HTTP_FinishedReading(LPWININETHTTPREQW lpwhr) +static BOOL HTTP_FinishedReading(http_request_t *lpwhr) { WCHAR szVersion[10]; WCHAR szConnectionResponse[20]; @@ -4647,7 +4624,7 @@ static BOOL HTTP_FinishedReading(LPWININETHTTPREQW lpwhr) * Return index of custom header from header array * */ -static INT HTTP_GetCustomHeaderIndex(LPWININETHTTPREQW lpwhr, LPCWSTR lpszField, +static INT HTTP_GetCustomHeaderIndex(http_request_t *lpwhr, LPCWSTR lpszField, int requested_index, BOOL request_only) { DWORD index; @@ -4684,7 +4661,7 @@ static INT HTTP_GetCustomHeaderIndex(LPWININETHTTPREQW lpwhr, LPCWSTR lpszField, * Insert header into array * */ -static BOOL HTTP_InsertCustomHeader(LPWININETHTTPREQW lpwhr, LPHTTPHEADERW lpHdr) +static BOOL HTTP_InsertCustomHeader(http_request_t *lpwhr, LPHTTPHEADERW lpHdr) { INT count; LPHTTPHEADERW lph = NULL; @@ -4700,8 +4677,8 @@ static BOOL HTTP_InsertCustomHeader(LPWININETHTTPREQW lpwhr, LPHTTPHEADERW lpHdr if (NULL != lph) { lpwhr->pCustHeaders = lph; - lpwhr->pCustHeaders[count-1].lpszField = WININET_strdupW(lpHdr->lpszField); - lpwhr->pCustHeaders[count-1].lpszValue = WININET_strdupW(lpHdr->lpszValue); + lpwhr->pCustHeaders[count-1].lpszField = heap_strdupW(lpHdr->lpszField); + lpwhr->pCustHeaders[count-1].lpszValue = heap_strdupW(lpHdr->lpszValue); lpwhr->pCustHeaders[count-1].wFlags = lpHdr->wFlags; lpwhr->pCustHeaders[count-1].wCount= lpHdr->wCount; lpwhr->nCustHeaders++; @@ -4722,7 +4699,7 @@ static BOOL HTTP_InsertCustomHeader(LPWININETHTTPREQW lpwhr, LPHTTPHEADERW lpHdr * Delete header from array * If this function is called, the indexs may change. */ -static BOOL HTTP_DeleteCustomHeader(LPWININETHTTPREQW lpwhr, DWORD index) +static BOOL HTTP_DeleteCustomHeader(http_request_t *lpwhr, DWORD index) { if( lpwhr->nCustHeaders <= 0 ) return FALSE; @@ -4747,7 +4724,7 @@ static BOOL HTTP_DeleteCustomHeader(LPWININETHTTPREQW lpwhr, DWORD index) * Verify the given header is not invalid for the given http request * */ -static BOOL HTTP_VerifyValidHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field) +static BOOL HTTP_VerifyValidHeader(http_request_t *lpwhr, LPCWSTR field) { /* Accept-Encoding is stripped from HTTP/1.0 requests. It is invalid */ if (!strcmpW(lpwhr->lpszVersion, g_szHttp1_0) && !strcmpiW(field, szAccept_Encoding)) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index ed6a70f3ba4..236e1f66453 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -348,7 +348,7 @@ BOOL WINAPI DetectAutoProxyUrl(LPSTR lpszAutoProxyUrl, * The proxy may be specified in the form 'http=proxy.my.org' * Presumably that means there can be ftp=ftpproxy.my.org too. */ -static BOOL INTERNET_ConfigureProxy( LPWININETAPPINFOW lpwai ) +static BOOL INTERNET_ConfigureProxy( appinfo_t *lpwai ) { HKEY key; DWORD type, len, enabled = 0; @@ -489,7 +489,7 @@ static void dump_INTERNET_FLAGS(DWORD dwFlags) */ static VOID APPINFO_Destroy(object_header_t *hdr) { - LPWININETAPPINFOW lpwai = (LPWININETAPPINFOW) hdr; + appinfo_t *lpwai = (appinfo_t*)hdr; TRACE("%p\n",lpwai); @@ -503,7 +503,7 @@ static VOID APPINFO_Destroy(object_header_t *hdr) static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode) { - LPWININETAPPINFOW ai = (LPWININETAPPINFOW)hdr; + appinfo_t *ai = (appinfo_t*)hdr; switch(option) { case INTERNET_OPTION_HANDLE_TYPE: @@ -639,7 +639,7 @@ static const object_vtbl_t APPINFOVtbl = { HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags) { - LPWININETAPPINFOW lpwai = NULL; + appinfo_t *lpwai = NULL; HINTERNET handle = NULL; if (TRACE_ON(wininet)) { @@ -670,7 +670,7 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, /* Clear any error information */ INTERNET_SetLastError(0); - lpwai = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WININETAPPINFOW)); + lpwai = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(appinfo_t)); if (NULL == lpwai) { INTERNET_SetLastError(ERROR_OUTOFMEMORY); @@ -693,30 +693,12 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, goto lend; } - if (NULL != lpszAgent) - { - lpwai->lpszAgent = HeapAlloc( GetProcessHeap(),0, - (strlenW(lpszAgent)+1)*sizeof(WCHAR)); - if (lpwai->lpszAgent) - lstrcpyW( lpwai->lpszAgent, lpszAgent ); - } + lpwai->lpszAgent = heap_strdupW(lpszAgent); if(dwAccessType == INTERNET_OPEN_TYPE_PRECONFIG) INTERNET_ConfigureProxy( lpwai ); - else if (NULL != lpszProxy) - { - lpwai->lpszProxy = HeapAlloc( GetProcessHeap(), 0, - (strlenW(lpszProxy)+1)*sizeof(WCHAR)); - if (lpwai->lpszProxy) - lstrcpyW( lpwai->lpszProxy, lpszProxy ); - } - - if (NULL != lpszProxyBypass) - { - lpwai->lpszProxyBypass = HeapAlloc( GetProcessHeap(), 0, - (strlenW(lpszProxyBypass)+1)*sizeof(WCHAR)); - if (lpwai->lpszProxyBypass) - lstrcpyW( lpwai->lpszProxyBypass, lpszProxyBypass ); - } + else + lpwai->lpszProxy = heap_strdupW(lpszProxy); + lpwai->lpszProxyBypass = heap_strdupW(lpszProxyBypass); lend: if( lpwai ) @@ -741,33 +723,15 @@ lend: HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags) { - HINTERNET rc = NULL; - INT len; - WCHAR *szAgent = NULL, *szProxy = NULL, *szBypass = NULL; + WCHAR *szAgent, *szProxy, *szBypass; + HINTERNET rc; TRACE("(%s, 0x%08x, %s, %s, 0x%08x)\n", debugstr_a(lpszAgent), dwAccessType, debugstr_a(lpszProxy), debugstr_a(lpszProxyBypass), dwFlags); - if( lpszAgent ) - { - len = MultiByteToWideChar(CP_ACP, 0, lpszAgent, -1, NULL, 0); - szAgent = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, lpszAgent, -1, szAgent, len); - } - - if( lpszProxy ) - { - len = MultiByteToWideChar(CP_ACP, 0, lpszProxy, -1, NULL, 0); - szProxy = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, lpszProxy, -1, szProxy, len); - } - - if( lpszProxyBypass ) - { - len = MultiByteToWideChar(CP_ACP, 0, lpszProxyBypass, -1, NULL, 0); - szBypass = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, lpszProxyBypass, -1, szBypass, len); - } + szAgent = heap_strdupAtoW(lpszAgent); + szProxy = heap_strdupAtoW(lpszProxy); + szBypass = heap_strdupAtoW(lpszProxyBypass); rc = InternetOpenW(szAgent, dwAccessType, szProxy, szBypass, dwFlags); @@ -962,7 +926,7 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext) { - LPWININETAPPINFOW hIC; + appinfo_t *hIC; HINTERNET rc = NULL; TRACE("(%p, %s, %i, %s, %s, %i, %i, %lx)\n", hInternet, debugstr_w(lpszServerName), @@ -977,7 +941,7 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet, /* Clear any error information */ INTERNET_SetLastError(0); - hIC = (LPWININETAPPINFOW) WININET_GetObject( hInternet ); + hIC = (appinfo_t*)WININET_GetObject( hInternet ); if ( (hIC == NULL) || (hIC->hdr.htype != WH_HINIT) ) { INTERNET_SetLastError(ERROR_INVALID_HANDLE); @@ -1025,30 +989,13 @@ HINTERNET WINAPI InternetConnectA(HINTERNET hInternet, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext) { HINTERNET rc = NULL; - INT len = 0; - LPWSTR szServerName = NULL; - LPWSTR szUserName = NULL; - LPWSTR szPassword = NULL; - - if (lpszServerName) - { - len = MultiByteToWideChar(CP_ACP, 0, lpszServerName, -1, NULL, 0); - szServerName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, lpszServerName, -1, szServerName, len); - } - if (lpszUserName) - { - len = MultiByteToWideChar(CP_ACP, 0, lpszUserName, -1, NULL, 0); - szUserName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, lpszUserName, -1, szUserName, len); - } - if (lpszPassword) - { - len = MultiByteToWideChar(CP_ACP, 0, lpszPassword, -1, NULL, 0); - szPassword = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, lpszPassword, -1, szPassword, len); - } + LPWSTR szServerName; + LPWSTR szUserName; + LPWSTR szPassword; + szServerName = heap_strdupAtoW(lpszServerName); + szUserName = heap_strdupAtoW(lpszUserName); + szPassword = heap_strdupAtoW(lpszPassword); rc = InternetConnectW(hInternet, szServerName, nServerPort, szUserName, szPassword, dwService, dwFlags, dwContext); @@ -2066,7 +2013,6 @@ DWORD INET_QueryOption(DWORD option, void *buffer, DWORD *size, BOOL unicode) return ERROR_SUCCESS; case INTERNET_OPTION_CONNECTED_STATE: - if (warn) { FIXME("INTERNET_OPTION_CONNECTED_STATE: semi-stub\n"); warn = FALSE; @@ -2080,10 +2026,10 @@ DWORD INET_QueryOption(DWORD option, void *buffer, DWORD *size, BOOL unicode) return ERROR_SUCCESS; case INTERNET_OPTION_PROXY: { - WININETAPPINFOW ai; + appinfo_t ai; TRACE("Getting global proxy info\n"); - memset(&ai, 0, sizeof(WININETAPPINFOW)); + memset(&ai, 0, sizeof(appinfo_t)); INTERNET_ConfigureProxy(&ai); return APPINFO_QueryOption(&ai.hdr, INTERNET_OPTION_PROXY, buffer, size, unicode); /* FIXME */ @@ -2591,16 +2537,12 @@ BOOL WINAPI InternetTimeToSystemTimeA( LPCSTR string, SYSTEMTIME* time, DWORD re { BOOL ret = FALSE; WCHAR *stringW; - int len; TRACE( "%s %p 0x%08x\n", debugstr_a(string), time, reserved ); - len = MultiByteToWideChar( CP_ACP, 0, string, -1, NULL, 0 ); - stringW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); - + stringW = heap_strdupAtoW(string); if (stringW) { - MultiByteToWideChar( CP_ACP, 0, string, -1, stringW, len ); ret = InternetTimeToSystemTimeW( stringW, time, reserved ); HeapFree( GetProcessHeap(), 0, stringW ); } @@ -2807,17 +2749,18 @@ End: */ BOOL WINAPI InternetCheckConnectionA(LPCSTR lpszUrl, DWORD dwFlags, DWORD dwReserved) { - WCHAR *szUrl; - INT len; + WCHAR *url = NULL; BOOL rc; - len = MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, NULL, 0); - if (!(szUrl = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)))) - return FALSE; - MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, szUrl, len); - rc = InternetCheckConnectionW(szUrl, dwFlags, dwReserved); - HeapFree(GetProcessHeap(), 0, szUrl); - + if(lpszUrl) { + url = heap_strdupAtoW(lpszUrl); + if(!url) + return FALSE; + } + + rc = InternetCheckConnectionW(url, dwFlags, dwReserved); + + HeapFree(GetProcessHeap(), 0, url); return rc; } @@ -2830,7 +2773,7 @@ BOOL WINAPI InternetCheckConnectionA(LPCSTR lpszUrl, DWORD dwFlags, DWORD dwRese * RETURNS * handle of connection or NULL on failure */ -static HINTERNET INTERNET_InternetOpenUrlW(LPWININETAPPINFOW hIC, LPCWSTR lpszUrl, +static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext) { URL_COMPONENTSW urlComponents; @@ -2942,7 +2885,7 @@ static HINTERNET INTERNET_InternetOpenUrlW(LPWININETAPPINFOW hIC, LPCWSTR lpszUr static void AsyncInternetOpenUrlProc(WORKREQUEST *workRequest) { struct WORKREQ_INTERNETOPENURLW const *req = &workRequest->u.InternetOpenUrlW; - LPWININETAPPINFOW hIC = (LPWININETAPPINFOW) workRequest->hdr; + appinfo_t *hIC = (appinfo_t*) workRequest->hdr; TRACE("%p\n", hIC); @@ -2956,7 +2899,7 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext) { HINTERNET ret = NULL; - LPWININETAPPINFOW hIC = NULL; + appinfo_t *hIC = NULL; if (TRACE_ON(wininet)) { TRACE("(%p, %s, %s, %08x, %08x, %08lx)\n", hInternet, debugstr_w(lpszUrl), debugstr_w(lpszHeaders), @@ -2971,7 +2914,7 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, goto lend; } - hIC = (LPWININETAPPINFOW) WININET_GetObject( hInternet ); + hIC = (appinfo_t*)WININET_GetObject( hInternet ); if (NULL == hIC || hIC->hdr.htype != WH_HINIT) { INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); goto lend; @@ -2983,12 +2926,9 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, workRequest.asyncproc = AsyncInternetOpenUrlProc; workRequest.hdr = WININET_AddRef( &hIC->hdr ); - req = &workRequest.u.InternetOpenUrlW; - req->lpszUrl = WININET_strdupW(lpszUrl); - if (lpszHeaders) - req->lpszHeaders = WININET_strdupW(lpszHeaders); - else - req->lpszHeaders = 0; + req = &workRequest.u.InternetOpenUrlW; + req->lpszUrl = heap_strdupW(lpszUrl); + req->lpszHeaders = heap_strdupW(lpszHeaders); req->dwHeadersLength = dwHeadersLength; req->dwFlags = dwFlags; req->dwContext = dwContext; @@ -3022,20 +2962,16 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl, LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext) { HINTERNET rc = NULL; - - INT lenUrl; - INT lenHeaders = 0; + DWORD lenHeaders = 0; LPWSTR szUrl = NULL; LPWSTR szHeaders = NULL; TRACE("\n"); if(lpszUrl) { - lenUrl = MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, NULL, 0 ); - szUrl = HeapAlloc(GetProcessHeap(), 0, lenUrl*sizeof(WCHAR)); + szUrl = heap_strdupAtoW(lpszUrl); if(!szUrl) return NULL; - MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, szUrl, lenUrl); } if(lpszHeaders) { diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 4cd22d67ecb..39d80831ad0 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -55,28 +55,49 @@ typedef struct void *ssl_s; } WININET_NETCONNECTION; -static inline LPWSTR WININET_strdupW( LPCWSTR str ) +static inline LPWSTR heap_strdupW(LPCWSTR str) { - LPWSTR ret = HeapAlloc( GetProcessHeap(), 0, (strlenW(str) + 1)*sizeof(WCHAR) ); - if (ret) strcpyW( ret, str ); + LPWSTR ret = NULL; + + if(str) { + DWORD size; + + size = (strlenW(str)+1)*sizeof(WCHAR); + ret = HeapAlloc(GetProcessHeap(), 0, size); + if(ret) + memcpy(ret, str, size); + } + return ret; } -static inline LPWSTR WININET_strdup_AtoW( LPCSTR str ) +static inline WCHAR *heap_strdupAtoW(const char *str) { - int len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0); - LPWSTR ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); - if (ret) - MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len); + LPWSTR ret = NULL; + + if(str) { + DWORD len; + + len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); + ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + if(ret) + MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); + } + return ret; } -static inline LPSTR WININET_strdup_WtoA( LPCWSTR str ) +static inline char *heap_strdupWtoA(LPCWSTR str) { - int len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL); - LPSTR ret = HeapAlloc( GetProcessHeap(), 0, len ); - if (ret) - WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL); + char *ret = NULL; + + if(str) { + DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL); + ret = HeapAlloc(GetProcessHeap(), 0, size); + if(ret) + WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL); + } + return ret; } @@ -152,13 +173,13 @@ typedef struct LPWSTR lpszProxyUsername; LPWSTR lpszProxyPassword; DWORD dwAccessType; -} WININETAPPINFOW, *LPWININETAPPINFOW; +} appinfo_t; typedef struct { object_header_t hdr; - WININETAPPINFOW *lpAppInfo; + appinfo_t *lpAppInfo; LPWSTR lpszHostName; /* the final destination of the request */ LPWSTR lpszServerName; /* the name of the server we directly connect to */ LPWSTR lpszUserName; @@ -167,7 +188,7 @@ typedef struct INTERNET_PORT nServerPort; /* the port of the server we directly connect to */ struct sockaddr_storage socketAddress; socklen_t sa_len; -} WININETHTTPSESSIONW, *LPWININETHTTPSESSIONW; +} http_session_t; #define HDR_ISREQUEST 0x0001 #define HDR_COMMADELIMITED 0x0002 @@ -189,7 +210,7 @@ typedef struct gzip_stream_t gzip_stream_t; typedef struct { object_header_t hdr; - WININETHTTPSESSIONW *lpHttpSession; + http_session_t *lpHttpSession; LPWSTR lpszPath; LPWSTR lpszVerb; LPWSTR lpszRawHeaders; @@ -215,7 +236,7 @@ typedef struct BOOL decoding; gzip_stream_t *gzip_stream; -} WININETHTTPREQW, *LPWININETHTTPREQW; +} http_request_t; @@ -371,12 +392,12 @@ DWORD INET_QueryOption(DWORD,void*,DWORD*,BOOL); time_t ConvertTimeString(LPCWSTR asctime); -HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, +HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext, DWORD dwInternalFlags); -HINTERNET HTTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, +HINTERNET HTTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext, DWORD dwInternalFlags); @@ -390,10 +411,10 @@ BOOL INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest); LPSTR INTERNET_GetResponseBuffer(void); LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen); -BOOLAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, +BOOLAPI HTTP_HttpSendRequestW(http_request_t *req, LPCWSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength, DWORD dwContentLength, BOOL bEndRequest); -INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, +INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestW(http_session_t *session, LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion, LPCWSTR lpszReferrer , LPCWSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext); diff --git a/dlls/wininet/utility.c b/dlls/wininet/utility.c index 0812af5ac95..66fbecdd653 100644 --- a/dlls/wininet/utility.c +++ b/dlls/wininet/utility.c @@ -306,11 +306,11 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext, case INTERNET_STATUS_NAME_RESOLVED: case INTERNET_STATUS_CONNECTING_TO_SERVER: case INTERNET_STATUS_CONNECTED_TO_SERVER: - lpvNewInfo = WININET_strdup_AtoW(lpvStatusInfo); + lpvNewInfo = heap_strdupAtoW(lpvStatusInfo); break; case INTERNET_STATUS_RESOLVING_NAME: case INTERNET_STATUS_REDIRECT: - lpvNewInfo = WININET_strdupW(lpvStatusInfo); + lpvNewInfo = heap_strdupW(lpvStatusInfo); break; } }else { @@ -324,7 +324,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext, break; case INTERNET_STATUS_RESOLVING_NAME: case INTERNET_STATUS_REDIRECT: - lpvNewInfo = WININET_strdup_WtoA(lpvStatusInfo); + lpvNewInfo = heap_strdupWtoA(lpvStatusInfo); break; } } diff --git a/dlls/wininet/wininet_De.rc b/dlls/wininet/wininet_De.rc index 9b168b406a7..47665891bbc 100644 --- a/dlls/wininet/wininet_De.rc +++ b/dlls/wininet/wininet_De.rc @@ -18,6 +18,8 @@ #include "resource.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 diff --git a/dlls/d3dx8/Makefile.in b/dlls/wmiutils/Makefile.in similarity index 62% rename from dlls/d3dx8/Makefile.in rename to dlls/wmiutils/Makefile.in index a6edd23f9cb..084be5fc185 100644 --- a/dlls/d3dx8/Makefile.in +++ b/dlls/wmiutils/Makefile.in @@ -2,15 +2,13 @@ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ -MODULE = d3dx8.dll -IMPORTLIB = d3dx8 -IMPORTS = dxguid uuid kernel32 +MODULE = wmiutils.dll +IMPORTS = oleaut32 ole32 advapi32 kernel32 C_SRCS = \ - core.c \ - d3dx8_main.c \ - math.c \ - mesh.c + main.c \ + regsvr.c \ + statuscode.c @MAKE_DLL_RULES@ diff --git a/dlls/wmiutils/main.c b/dlls/wmiutils/main.c new file mode 100644 index 00000000000..6dda4bce6f1 --- /dev/null +++ b/dlls/wmiutils/main.c @@ -0,0 +1,147 @@ +/* + * Copyright 2009 Hans Leidekker for CodeWeavers + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "objbase.h" +#include "wbemcli.h" + +#include "wine/debug.h" +#include "wmiutils_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wmiutils); + +typedef HRESULT (*fnCreateInstance)( IUnknown *pUnkOuter, LPVOID *ppObj ); + +typedef struct +{ + const struct IClassFactoryVtbl *vtbl; + fnCreateInstance pfnCreateInstance; +} wmiutils_cf; + +static inline wmiutils_cf *impl_from_IClassFactory( IClassFactory *iface ) +{ + return (wmiutils_cf *)((char *)iface - FIELD_OFFSET( wmiutils_cf, vtbl )); +} + +static HRESULT WINAPI wmiutils_cf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj ) +{ + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IClassFactory)) + { + IClassFactory_AddRef( iface ); + *ppobj = iface; + return S_OK; + } + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI wmiutils_cf_AddRef( IClassFactory *iface ) +{ + return 2; +} + +static ULONG WINAPI wmiutils_cf_Release( IClassFactory *iface ) +{ + return 1; +} + +static HRESULT WINAPI wmiutils_cf_CreateInstance( IClassFactory *iface, LPUNKNOWN pOuter, + REFIID riid, LPVOID *ppobj ) +{ + wmiutils_cf *This = impl_from_IClassFactory( iface ); + HRESULT r; + IUnknown *punk; + + TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj); + + *ppobj = NULL; + + if (pOuter) + return CLASS_E_NOAGGREGATION; + + r = This->pfnCreateInstance( pOuter, (LPVOID *)&punk ); + if (FAILED(r)) + return r; + + r = IUnknown_QueryInterface( punk, riid, ppobj ); + if (FAILED(r)) + return r; + + IUnknown_Release( punk ); + return r; +} + +static HRESULT WINAPI wmiutils_cf_LockServer( IClassFactory *iface, BOOL dolock ) +{ + FIXME("(%p)->(%d)\n", iface, dolock); + return S_OK; +} + +static const struct IClassFactoryVtbl wmiutils_cf_vtbl = +{ + wmiutils_cf_QueryInterface, + wmiutils_cf_AddRef, + wmiutils_cf_Release, + wmiutils_cf_CreateInstance, + wmiutils_cf_LockServer +}; + +static wmiutils_cf status_code_cf = { &wmiutils_cf_vtbl, WbemStatusCodeText_create }; + +BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID lpv ) +{ + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( hinst ); + break; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv ) +{ + IClassFactory *cf = NULL; + + TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv); + + if (IsEqualGUID( rclsid, &CLSID_WbemStatusCode )) + { + cf = (IClassFactory *)&status_code_cf.vtbl; + } + if (!cf) return CLASS_E_CLASSNOTAVAILABLE; + return IClassFactory_QueryInterface( cf, iid, ppv ); +} + +HRESULT WINAPI DllCanUnloadNow( void ) +{ + FIXME("\n"); + return S_FALSE; +} diff --git a/dlls/windowscodecs/regsvr.c b/dlls/wmiutils/regsvr.c similarity index 54% copy from dlls/windowscodecs/regsvr.c copy to dlls/wmiutils/regsvr.c index ddb781a1bb6..bc5aeee19b9 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/wmiutils/regsvr.c @@ -1,5 +1,7 @@ /* - * Copyright 2009 Vincent Povirk for CodeWeavers + * self-registerable dll functions for wmiutils.dll + * + * Copyright (C) 2003 John K. Hohm * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,30 +18,44 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#define COBJMACROS + #include #include #include "windef.h" #include "winbase.h" -#include "wingdi.h" #include "winuser.h" #include "winreg.h" #include "winerror.h" - #include "objbase.h" -#include "ocidl.h" -#include "wincodec.h" +#include "wbemcli.h" #include "wine/debug.h" +#include "wine/unicode.h" -WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); +WINE_DEFAULT_DEBUG_CHANNEL(wmiutils); + +/* + * Near the bottom of this file are the exported DllRegisterServer and + * DllUnregisterServer, which make all this worthwhile. + */ /*********************************************************************** * interface for self-registering */ +struct regsvr_interface +{ + IID const *iid; /* NULL for end of list */ + LPCSTR name; /* can be NULL to omit */ + IID const *base_iid; /* can be NULL to omit */ + int num_methods; /* can be <0 to omit */ + CLSID const *ps_clsid; /* can be NULL to omit */ + CLSID const *ps_clsid32; /* can be NULL to omit */ +}; + +static HRESULT register_interfaces(struct regsvr_interface const *list); +static HRESULT unregister_interfaces(struct regsvr_interface const *list); + struct regsvr_coclass { CLSID const *clsid; /* NULL for end of list */ @@ -47,9 +63,8 @@ struct regsvr_coclass LPCSTR ips; /* can be NULL to omit */ LPCSTR ips32; /* can be NULL to omit */ LPCSTR ips32_tmodel; /* can be NULL to omit */ + LPCSTR clsid_str; /* can be NULL to omit */ LPCSTR progid; /* can be NULL to omit */ - LPCSTR viprogid; /* can be NULL to omit */ - LPCSTR progid_extra; /* can be NULL to omit */ }; static HRESULT register_coclasses(struct regsvr_coclass const *list); @@ -58,10 +73,21 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list); /*********************************************************************** * static string constants */ +static WCHAR const interface_keyname[10] = { + 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 }; +static WCHAR const base_ifa_keyname[14] = { + 'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', + 'e', 0 }; +static WCHAR const num_methods_keyname[11] = { + 'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 }; +static WCHAR const ps_clsid_keyname[15] = { + 'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's', + 'i', 'd', 0 }; +static WCHAR const ps_clsid32_keyname[17] = { + 'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's', + 'i', 'd', '3', '2', 0 }; static WCHAR const clsid_keyname[6] = { 'C', 'L', 'S', 'I', 'D', 0 }; -static WCHAR const curver_keyname[7] = { - 'C', 'u', 'r', 'V', 'e', 'r', 0 }; static WCHAR const ips_keyname[13] = { 'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r', 0 }; @@ -70,22 +96,112 @@ static WCHAR const ips32_keyname[15] = { '3', '2', 0 }; static WCHAR const progid_keyname[7] = { 'P', 'r', 'o', 'g', 'I', 'D', 0 }; -static WCHAR const viprogid_keyname[25] = { - 'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p', - 'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D', - 0 }; static char const tmodel_valuename[] = "ThreadingModel"; /*********************************************************************** * static helper functions */ +static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid); static LONG register_key_defvalueW(HKEY base, WCHAR const *name, WCHAR const *value); static LONG register_key_defvalueA(HKEY base, WCHAR const *name, char const *value); -static LONG register_progid(WCHAR const *clsid, - char const *progid, char const *curver_progid, - char const *name, char const *extra); + +/*********************************************************************** + * register_interfaces + */ +static HRESULT register_interfaces(struct regsvr_interface const *list) +{ + LONG res = ERROR_SUCCESS; + HKEY interface_key; + + res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &interface_key, NULL); + if (res != ERROR_SUCCESS) goto error_return; + + for (; res == ERROR_SUCCESS && list->iid; ++list) { + WCHAR buf[39]; + HKEY iid_key; + + StringFromGUID2(list->iid, buf, 39); + res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &iid_key, NULL); + if (res != ERROR_SUCCESS) goto error_close_interface_key; + + if (list->name) { + res = RegSetValueExA(iid_key, NULL, 0, REG_SZ, + (CONST BYTE*)(list->name), + strlen(list->name) + 1); + if (res != ERROR_SUCCESS) goto error_close_iid_key; + } + + if (list->base_iid) { + res = register_key_guid(iid_key, base_ifa_keyname, list->base_iid); + if (res != ERROR_SUCCESS) goto error_close_iid_key; + } + + if (0 <= list->num_methods) { + static WCHAR const fmt[3] = { '%', 'd', 0 }; + HKEY key; + + res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &key, NULL); + if (res != ERROR_SUCCESS) goto error_close_iid_key; + + sprintfW(buf, fmt, list->num_methods); + res = RegSetValueExW(key, NULL, 0, REG_SZ, + (CONST BYTE*)buf, + (lstrlenW(buf) + 1) * sizeof(WCHAR)); + RegCloseKey(key); + + if (res != ERROR_SUCCESS) goto error_close_iid_key; + } + + if (list->ps_clsid) { + res = register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid); + if (res != ERROR_SUCCESS) goto error_close_iid_key; + } + + if (list->ps_clsid32) { + res = register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32); + if (res != ERROR_SUCCESS) goto error_close_iid_key; + } + + error_close_iid_key: + RegCloseKey(iid_key); + } + +error_close_interface_key: + RegCloseKey(interface_key); +error_return: + return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK; +} + +/*********************************************************************** + * unregister_interfaces + */ +static HRESULT unregister_interfaces(struct regsvr_interface const *list) +{ + LONG res = ERROR_SUCCESS; + HKEY interface_key; + + res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, + KEY_READ | KEY_WRITE, &interface_key); + if (res == ERROR_FILE_NOT_FOUND) return S_OK; + if (res != ERROR_SUCCESS) goto error_return; + + for (; res == ERROR_SUCCESS && list->iid; ++list) { + WCHAR buf[39]; + + StringFromGUID2(list->iid, buf, 39); + res = RegDeleteTreeW(interface_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; + } + + RegCloseKey(interface_key); +error_return: + return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK; +} /*********************************************************************** * register_coclasses @@ -139,23 +255,26 @@ static HRESULT register_coclasses(struct regsvr_coclass const *list) if (res != ERROR_SUCCESS) goto error_close_clsid_key; } + if (list->clsid_str) { + res = register_key_defvalueA(clsid_key, clsid_keyname, + list->clsid_str); + if (res != ERROR_SUCCESS) goto error_close_clsid_key; + } + if (list->progid) { + HKEY progid_key; + res = register_key_defvalueA(clsid_key, progid_keyname, list->progid); if (res != ERROR_SUCCESS) goto error_close_clsid_key; - res = register_progid(buf, list->progid, NULL, - list->name, list->progid_extra); - if (res != ERROR_SUCCESS) goto error_close_clsid_key; - } - - if (list->viprogid) { - res = register_key_defvalueA(clsid_key, viprogid_keyname, - list->viprogid); + res = RegCreateKeyExA(HKEY_CLASSES_ROOT, list->progid, 0, + NULL, 0, KEY_READ | KEY_WRITE, NULL, + &progid_key, NULL); if (res != ERROR_SUCCESS) goto error_close_clsid_key; - res = register_progid(buf, list->viprogid, list->progid, - list->name, list->progid_extra); + res = register_key_defvalueW(progid_key, clsid_keyname, buf); + RegCloseKey(progid_key); if (res != ERROR_SUCCESS) goto error_close_clsid_key; } @@ -186,19 +305,13 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list) WCHAR buf[39]; StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); - if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; + res = RegDeleteTreeW(coclass_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; if (list->progid) { - res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid); - if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; - if (res != ERROR_SUCCESS) goto error_close_coclass_key; - } - - if (list->viprogid) { - res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid); - if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; + res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } } @@ -210,7 +323,18 @@ error_return: } /*********************************************************************** - * register_key_defvalueW + * regsvr_key_guid + */ +static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) +{ + WCHAR buf[39]; + + StringFromGUID2(guid, buf, 39); + return register_key_defvalueW(base, name, buf); +} + +/*********************************************************************** + * regsvr_key_defvalueW */ static LONG register_key_defvalueW( HKEY base, @@ -230,7 +354,7 @@ static LONG register_key_defvalueW( } /*********************************************************************** - * register_key_defvalueA + * regsvr_key_defvalueA */ static LONG register_key_defvalueA( HKEY base, @@ -250,74 +374,28 @@ static LONG register_key_defvalueA( } /*********************************************************************** - * register_progid - */ -static LONG register_progid( - WCHAR const *clsid, - char const *progid, - char const *curver_progid, - char const *name, - char const *extra) -{ - LONG res; - HKEY progid_key; - - res = RegCreateKeyExA(HKEY_CLASSES_ROOT, progid, 0, - NULL, 0, KEY_READ | KEY_WRITE, NULL, - &progid_key, NULL); - if (res != ERROR_SUCCESS) return res; - - if (name) { - res = RegSetValueExA(progid_key, NULL, 0, REG_SZ, - (CONST BYTE*)name, strlen(name) + 1); - if (res != ERROR_SUCCESS) goto error_close_progid_key; - } - - if (clsid) { - res = register_key_defvalueW(progid_key, clsid_keyname, clsid); - if (res != ERROR_SUCCESS) goto error_close_progid_key; - } - - if (curver_progid) { - res = register_key_defvalueA(progid_key, curver_keyname, - curver_progid); - if (res != ERROR_SUCCESS) goto error_close_progid_key; - } - - if (extra) { - HKEY extra_key; - - res = RegCreateKeyExA(progid_key, extra, 0, - NULL, 0, KEY_READ | KEY_WRITE, NULL, - &extra_key, NULL); - if (res == ERROR_SUCCESS) - RegCloseKey(extra_key); - } - -error_close_progid_key: - RegCloseKey(progid_key); - return res; -} - -/*********************************************************************** * coclass list */ static struct regsvr_coclass const coclass_list[] = { - { &CLSID_WICImagingFactory, - "WIC Imaging Factory", - NULL, - "windowscodecs.dll", - "Apartment" - }, - { &CLSID_WICBmpDecoder, - "WIC BMP Decoder", - NULL, - "windowscodecs.dll", - "Apartment" + { &CLSID_WbemStatusCode, + "CLSID_WbemStatusCode", + NULL, + "wmiutils.dll", + "Both" }, { NULL } /* list terminator */ }; +/*********************************************************************** + * interface list + */ +static struct regsvr_interface const interface_list[] = { + { NULL } /* list terminator */ +}; + +/*********************************************************************** + * DllRegisterServer (INETCOMM.@) + */ HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -325,9 +403,14 @@ HRESULT WINAPI DllRegisterServer(void) TRACE("\n"); hr = register_coclasses(coclass_list); + if (SUCCEEDED(hr)) + hr = register_interfaces(interface_list); return hr; } +/*********************************************************************** + * DllUnregisterServer (INETCOMM.@) + */ HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; @@ -335,5 +418,7 @@ HRESULT WINAPI DllUnregisterServer(void) TRACE("\n"); hr = unregister_coclasses(coclass_list); + if (SUCCEEDED(hr)) + hr = unregister_interfaces(interface_list); return hr; } diff --git a/dlls/wmiutils/statuscode.c b/dlls/wmiutils/statuscode.c new file mode 100644 index 00000000000..dfa3872837a --- /dev/null +++ b/dlls/wmiutils/statuscode.c @@ -0,0 +1,153 @@ +/* + * Copyright 2009 Hans Leidekker for CodeWeavers + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "config.h" +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "initguid.h" +#include "ole2.h" +#include "wbemcli.h" + +#include "wine/debug.h" +#include "wine/unicode.h" +#include "wmiutils_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wmiutils); + +typedef struct status_code +{ + const IWbemStatusCodeTextVtbl *vtbl; + LONG refs; +} status_code; + +static inline status_code *impl_from_IWbemStatusCodeText( IWbemStatusCodeText *iface ) +{ + return (status_code *)((char *)iface - FIELD_OFFSET( status_code, vtbl )); +} + +static ULONG WINAPI status_code_AddRef( + IWbemStatusCodeText *iface ) +{ + status_code *status_code = impl_from_IWbemStatusCodeText( iface ); + return InterlockedIncrement( &status_code->refs ); +} + +static ULONG WINAPI status_code_Release( + IWbemStatusCodeText *iface ) +{ + status_code *status_code = impl_from_IWbemStatusCodeText( iface ); + LONG refs = InterlockedDecrement( &status_code->refs ); + if (!refs) + { + TRACE("destroying %p\n", status_code); + HeapFree( GetProcessHeap(), 0, status_code ); + } + return refs; +} + +static HRESULT WINAPI status_code_QueryInterface( + IWbemStatusCodeText *iface, + REFIID riid, + void **ppvObject ) +{ + status_code *This = impl_from_IWbemStatusCodeText( iface ); + + TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject ); + + if ( IsEqualGUID( riid, &IID_IWbemStatusCodeText ) || + IsEqualGUID( riid, &IID_IUnknown ) ) + { + *ppvObject = iface; + } + else + { + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + IWbemStatusCodeText_AddRef( iface ); + return S_OK; +} + +static HRESULT WINAPI status_code_GetErrorCodeText( + IWbemStatusCodeText *iface, + HRESULT res, + LCID lcid, + LONG flags, + BSTR *text ) +{ + static const WCHAR fmt[] = + {'E','r','r','o','r',' ','c','o','d','e',':',' ','0','x','%','0','8','x',0}; + WCHAR msg[32]; + + FIXME("%p, 0x%08x, 0x%04x, 0x%08x, %p\n", iface, res, lcid, flags, text); + + sprintfW(msg, fmt, res); + *text = SysAllocString(msg); + return WBEM_S_NO_ERROR; +} + +static HRESULT WINAPI status_code_GetFacilityCodeText( + IWbemStatusCodeText *iface, + HRESULT res, + LCID lcid, + LONG flags, + BSTR *text ) +{ + static const WCHAR fmt[] = + {'F','a','c','i','l','i','t','y',' ','c','o','d','e',':',' ','0','x','%','0','8','x',0}; + WCHAR msg[32]; + + FIXME("%p, 0x%08x, 0x%04x, 0x%08x, %p\n", iface, res, lcid, flags, text); + + sprintfW(msg, fmt, res); + *text = SysAllocString(msg); + return WBEM_S_NO_ERROR; +} + +static const struct IWbemStatusCodeTextVtbl status_code_vtbl = +{ + status_code_QueryInterface, + status_code_AddRef, + status_code_Release, + status_code_GetErrorCodeText, + status_code_GetFacilityCodeText +}; + +HRESULT WbemStatusCodeText_create( IUnknown *pUnkOuter, LPVOID *ppObj ) +{ + status_code *sc; + + TRACE("(%p,%p)\n", pUnkOuter, ppObj); + + sc = HeapAlloc( GetProcessHeap(), 0, sizeof(*sc) ); + if (!sc) return E_OUTOFMEMORY; + + sc->vtbl = &status_code_vtbl; + sc->refs = 1; + + *ppObj = &sc->vtbl; + + TRACE("returning iface %p\n", *ppObj); + return S_OK; +} diff --git a/dlls/wmiutils/wmiutils.spec b/dlls/wmiutils/wmiutils.spec new file mode 100644 index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/wmiutils/wmiutils.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/programs/write/De.rc b/dlls/wmiutils/wmiutils_private.h similarity index 77% copy from programs/write/De.rc copy to dlls/wmiutils/wmiutils_private.h index a9535767bb6..23082ce1b0f 100644 --- a/programs/write/De.rc +++ b/dlls/wmiutils/wmiutils_private.h @@ -1,6 +1,5 @@ /* - * Copyright (C) 2007 Mikolaj Zalewski - * Copyright (C) 2008 Michael Stefaniuc + * Copyright 2009 Hans Leidekker for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,11 +16,4 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "resources.h" - -LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL - -STRINGTABLE -{ - IDS_FAILED, "Der Start von Wordpad ist fehlgeschlagen" -} +HRESULT WbemStatusCodeText_create(IUnknown *, LPVOID *); diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 464e8907cdd..96be7ca4c01 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -4933,13 +4933,13 @@ INT WINAPI WSAAddressToStringA( LPSOCKADDR sockaddr, DWORD len, TRACE( "(%p, %d, %p, %p, %p)\n", sockaddr, len, info, string, lenstr ); - if (!sockaddr || len < sizeof(SOCKADDR_IN)) return SOCKET_ERROR; + if (!sockaddr) return SOCKET_ERROR; if (!string || !lenstr) return SOCKET_ERROR; - /* sin_family is guaranteed to be the first u_short */ - switch(((SOCKADDR_IN *)sockaddr)->sin_family) + switch(sockaddr->sa_family) { case WS_AF_INET: + if (len < sizeof(SOCKADDR_IN)) return SOCKET_ERROR; sprintf( buffer, "%u.%u.%u.%u:%u", (unsigned int)(ntohl( ((SOCKADDR_IN *)sockaddr)->sin_addr.WS_s_addr ) >> 24 & 0xff), (unsigned int)(ntohl( ((SOCKADDR_IN *)sockaddr)->sin_addr.WS_s_addr ) >> 16 & 0xff), @@ -4955,6 +4955,7 @@ INT WINAPI WSAAddressToStringA( LPSOCKADDR sockaddr, DWORD len, { struct WS_sockaddr_in6 *sockaddr6 = (LPSOCKADDR_IN6) sockaddr; + if (len < sizeof(SOCKADDR_IN6)) return SOCKET_ERROR; if (!WS_inet_ntop(WS_AF_INET6, &sockaddr6->sin6_addr, buffer, sizeof(buffer))) { WSASetLastError(WSAEINVAL); @@ -5000,42 +5001,30 @@ INT WINAPI WSAAddressToStringA( LPSOCKADDR sockaddr, DWORD len, * * NOTES * The 'info' parameter is ignored. - * - * BUGS - * Only supports AF_INET addresses. */ INT WINAPI WSAAddressToStringW( LPSOCKADDR sockaddr, DWORD len, LPWSAPROTOCOL_INFOW info, LPWSTR string, LPDWORD lenstr ) { - DWORD size; - WCHAR buffer[22]; /* 12 digits + 3 dots + ':' + 5 digits + '\0' */ - static const WCHAR format[] = { '%','u','.','%','u','.','%','u','.','%','u',':','%','u',0 }; - WCHAR *p; + INT ret; + DWORD size, sizew; + WCHAR buffer[54]; /* 32 digits + 7':' + '[' + '%" + 5 digits + ']:' + 5 digits + '\0' */ + CHAR bufAddr[54]; - TRACE( "(%p, %x, %p, %p, %p)\n", sockaddr, len, info, string, lenstr ); - - if (!sockaddr || len < sizeof(SOCKADDR_IN)) return SOCKET_ERROR; - if (!string || !lenstr) return SOCKET_ERROR; - - /* sin_family is guaranteed to be the first u_short */ - if (((SOCKADDR_IN *)sockaddr)->sin_family != AF_INET) return SOCKET_ERROR; + TRACE( "(%p, %d, %p, %p, %p)\n", sockaddr, len, info, string, lenstr ); - sprintfW( buffer, format, - (unsigned int)(ntohl( ((SOCKADDR_IN *)sockaddr)->sin_addr.WS_s_addr ) >> 24 & 0xff), - (unsigned int)(ntohl( ((SOCKADDR_IN *)sockaddr)->sin_addr.WS_s_addr ) >> 16 & 0xff), - (unsigned int)(ntohl( ((SOCKADDR_IN *)sockaddr)->sin_addr.WS_s_addr ) >> 8 & 0xff), - (unsigned int)(ntohl( ((SOCKADDR_IN *)sockaddr)->sin_addr.WS_s_addr ) & 0xff), - ntohs( ((SOCKADDR_IN *)sockaddr)->sin_port ) ); + size = *lenstr; + ret = WSAAddressToStringA(sockaddr, len, NULL, bufAddr, &size); - p = strchrW( buffer, ':' ); - if (!((SOCKADDR_IN *)sockaddr)->sin_port) *p = 0; + if (ret) return ret; - size = strlenW( buffer ) + 1; + sizew = sizeof( buffer ); + MultiByteToWideChar( CP_ACP, 0, bufAddr, size, buffer, sizew ); if (*lenstr < size) { *lenstr = size; + WSASetLastError(WSAEFAULT); return SOCKET_ERROR; } diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index acb26389268..b1db361d076 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -1474,6 +1474,7 @@ end: static void test_WSAAddressToStringW(void) { + SOCKET v6 = INVALID_SOCKET; INT ret; DWORD len; int GLE; @@ -1486,6 +1487,19 @@ static void test_WSAAddressToStringW(void) WCHAR expect4[] = { '2','5','5','.','2','5','5','.','2','5','5','.','2','5','5', ':', '6', '5', '5', '3', '5', 0 }; + SOCKADDR_IN6 sockaddr6; + WCHAR address6[54]; /* 32 digits + 7':' + '[' + '%" + 5 digits + ']:' + 5 digits + '\0' */ + + CHAR addr6_1[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}; + CHAR addr6_2[] = {0x20,0xab,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}; + CHAR addr6_3[] = {0x20,0xab,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x01}; + + WCHAR expect6_1[] = {':',':','1',0}; + WCHAR expect6_2[] = {'2','0','a','b',':',':','1',0}; + WCHAR expect6_3[] = {'[','2','0','a','b',':',':','2','0','0','1',']',':','3','3','2','7','4',0}; + WCHAR expect6_3_2[] = {'[','2','0','a','b',':',':','2','0','0','1','%','4','6','6','0',']',':','3','3','2','7','4',0}; + WCHAR expect6_3_3[] = {'2','0','a','b',':',':','2','0','0','1','%','6','5','5','3','4',0}; + len = 0; sockaddr.sin_family = AF_INET; @@ -1542,7 +1556,94 @@ static void test_WSAAddressToStringW(void) ok( !ret, "WSAAddressToStringW() failed unexpectedly: %d\n", WSAGetLastError() ); ok( !lstrcmpW( address, expect4 ), "Expected different address string\n" ); - ok( len == sizeof( expect4 )/sizeof( WCHAR ), "Got size %d\n", len); + ok( len == sizeof( expect4 )/sizeof( WCHAR ), "Got %d\n", len); + + /*check to see it IPv6 is available */ + v6 = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); + if (v6 == INVALID_SOCKET) { + skip("Could not create IPv6 socket (LastError: %d; %d expected if IPv6 not available).\n", + WSAGetLastError(), WSAEAFNOSUPPORT); + goto end; + } + + /* Test a short IPv6 address */ + len = sizeof(address6)/sizeof(WCHAR); + + sockaddr6.sin6_family = AF_INET6; + sockaddr6.sin6_port = 0x0000; + sockaddr6.sin6_scope_id = 0; + memcpy (sockaddr6.sin6_addr.s6_addr, addr6_1, sizeof(addr6_1)); + + ret = WSAAddressToStringW( (SOCKADDR*)&sockaddr6, sizeof(sockaddr6), NULL, address6, &len ); + ok( !ret, "WSAAddressToStringW() failed unexpectedly: %d\n", WSAGetLastError() ); + ok( !lstrcmpW( address6, expect6_1 ), "Wrong string returned\n" ); + ok( len == sizeof(expect6_1)/sizeof(WCHAR), "Got %d\n", len); + + /* Test a longer IPv6 address */ + len = sizeof(address6)/sizeof(WCHAR); + + sockaddr6.sin6_family = AF_INET6; + sockaddr6.sin6_port = 0x0000; + sockaddr6.sin6_scope_id = 0; + memcpy (sockaddr6.sin6_addr.s6_addr, addr6_2, sizeof(addr6_2)); + + ret = WSAAddressToStringW( (SOCKADDR*)&sockaddr6, sizeof(sockaddr6), NULL, address6, &len ); + ok( !ret, "WSAAddressToStringW() failed unexpectedly: %d\n", WSAGetLastError() ); + + ok( !lstrcmpW( address6, expect6_2 ), "Wrong string returned\n" ); + ok( len == sizeof(expect6_2)/sizeof(WCHAR), "Got %d\n", len); + + /* Test IPv6 address and port number */ + len = sizeof(address6)/sizeof(WCHAR); + + sockaddr6.sin6_family = AF_INET6; + sockaddr6.sin6_port = 0xfa81; + sockaddr6.sin6_scope_id = 0; + memcpy (sockaddr6.sin6_addr.s6_addr, addr6_3, sizeof(addr6_3)); + + ret = WSAAddressToStringW( (SOCKADDR*)&sockaddr6, sizeof(sockaddr6), NULL, address6, &len ); + ok( !ret, "WSAAddressToStringW() failed unexpectedly: %d\n", WSAGetLastError() ); + todo_wine + { + ok( !lstrcmpW( address6, expect6_3 ), "Wrong string returned\n" ); + ok( len == sizeof(expect6_3)/sizeof(WCHAR), "Got %d\n", len); + } + + /* Test IPv6 address, port number and scope_id */ + len = sizeof(address6)/sizeof(WCHAR); + + sockaddr6.sin6_family = AF_INET6; + sockaddr6.sin6_port = 0xfa81; + sockaddr6.sin6_scope_id = 0x1234; + memcpy (sockaddr6.sin6_addr.s6_addr, addr6_3, sizeof(addr6_3)); + + ret = WSAAddressToStringW( (SOCKADDR*)&sockaddr6, sizeof(sockaddr6), NULL, address6, &len ); + ok( !ret, "WSAAddressToStringW() failed unexpectedly: %d\n", WSAGetLastError() ); + todo_wine + { + ok( !lstrcmpW( address6, expect6_3_2 ), "Wrong string returned\n" ); + ok( len == sizeof(expect6_3_2)/sizeof(WCHAR), "Got %d\n", len); + } + + /* Test IPv6 address and scope_id */ + len = sizeof(address6)/sizeof(WCHAR); + + sockaddr6.sin6_family = AF_INET6; + sockaddr6.sin6_port = 0x0000; + sockaddr6.sin6_scope_id = 0xfffe; + memcpy (sockaddr6.sin6_addr.s6_addr, addr6_3, sizeof(addr6_3)); + + ret = WSAAddressToStringW( (SOCKADDR*)&sockaddr6, sizeof(sockaddr6), NULL, address6, &len ); + ok( !ret, "WSAAddressToStringW() failed unexpectedly: %d\n", WSAGetLastError() ); + todo_wine + { + ok( !lstrcmpW( address6, expect6_3_3 ), "Wrong string returned\n" ); + ok( len == sizeof(expect6_3_3)/sizeof(WCHAR), "Got %d\n", len); + } + +end: + if (v6 != INVALID_SOCKET) + closesocket(v6); } static void test_WSAStringToAddressA(void) @@ -2539,17 +2640,26 @@ static void test_GetAddrInfoW(void) pFreeAddrInfoW(result); } +static int CALLBACK AlwaysDeferConditionFunc(LPWSABUF lpCallerId, LPWSABUF lpCallerData, LPQOS pQos, + LPQOS lpGQOS, LPWSABUF lpCalleeId, LPWSABUF lpCalleeData, + GROUP FAR * g, DWORD_PTR dwCallbackData) +{ + return CF_DEFER; +} + static void test_AcceptEx(void) { SOCKET listener = INVALID_SOCKET; SOCKET acceptor = INVALID_SOCKET; SOCKET connector = INVALID_SOCKET; + SOCKET connector2 = INVALID_SOCKET; struct sockaddr_in bindAddress; int socklen; GUID acceptExGuid = WSAID_ACCEPTEX; - BOOL WINAPI (*pAcceptEx)(SOCKET listener, SOCKET acceptor, PVOID dest, DWORD dest_len, - DWORD local_addr_len, DWORD rem_addr_len, LPDWORD received, - LPOVERLAPPED overlapped); + LPFN_ACCEPTEX pAcceptEx = NULL; + fd_set fds_accept, fds_send; + struct timeval timeout = {0,10}; /* wait for 10 milliseconds */ + int got, conn1, i; DWORD bytesReturned; char buffer[1024]; OVERLAPPED overlapped; @@ -2717,6 +2827,116 @@ static void test_AcceptEx(void) closesocket(acceptor); acceptor = INVALID_SOCKET; + /* Test CF_DEFER & AcceptEx interaction */ + + acceptor = socket(AF_INET, SOCK_STREAM, 0); + if (acceptor == INVALID_SOCKET) { + skip("could not create acceptor socket, error %d\n", WSAGetLastError()); + goto end; + } + connector = socket(AF_INET, SOCK_STREAM, 0); + if (connector == INVALID_SOCKET) { + skip("could not create connector socket, error %d\n", WSAGetLastError()); + goto end; + } + connector2 = socket(AF_INET, SOCK_STREAM, 0); + if (connector == INVALID_SOCKET) { + skip("could not create connector socket, error %d\n", WSAGetLastError()); + goto end; + } + + if (set_blocking(connector, FALSE)) { + skip("couldn't make socket non-blocking, error %d\n", WSAGetLastError()); + goto end; + } + + if (set_blocking(connector2, FALSE)) { + skip("couldn't make socket non-blocking, error %d\n", WSAGetLastError()); + goto end; + } + + /* Connect socket #1 */ + iret = connect(connector, (struct sockaddr*)&bindAddress, sizeof(bindAddress)); + ok(iret == 0 || + (iret == SOCKET_ERROR && WSAGetLastError() == WSAEWOULDBLOCK), "connecting to accepting socket failed, error %d\n", WSAGetLastError()); + + FD_ZERO ( &fds_accept ); + FD_ZERO ( &fds_send ); + + FD_SET ( listener, &fds_accept ); + FD_SET ( connector, &fds_send ); + + buffer[0] = '0'; + got = 0; + conn1 = 0; + + for (i = 0; i < 4000; ++i) + { + wsa_ok ( ( select ( 0, &fds_accept, &fds_send, NULL, &timeout ) ), SOCKET_ERROR !=, + "select_server (%x): select() failed: %d\n" ); + + /* check for incoming requests */ + if ( FD_ISSET ( listener, &fds_accept ) ) { + got++; + if (got == 1) { + SOCKET tmp = WSAAccept(listener, NULL, NULL, (LPCONDITIONPROC) AlwaysDeferConditionFunc, 0); + ok(tmp == INVALID_SOCKET && WSAGetLastError() == WSATRY_AGAIN, "Failed to defer connection\n"); + bret = pAcceptEx(listener, acceptor, buffer, 0, + sizeof(struct sockaddr_in) + 16, sizeof(struct sockaddr_in) + 16, + &bytesReturned, &overlapped); + ok(bret == FALSE && WSAGetLastError() == ERROR_IO_PENDING, "AcceptEx returned %d + errno %d\n", bret, WSAGetLastError()); + } + else if (got == 2) { + /* this should be socket #2 */ + SOCKET tmp = accept(listener, NULL, NULL); + ok(tmp != INVALID_SOCKET, "accept failed %d\n", WSAGetLastError()); + closesocket(tmp); + } + else { + ok(FALSE, "Got more than 2 connections?\n"); + } + } + if ( conn1 && FD_ISSET ( connector2, &fds_send ) ) { + /* Send data on second socket, and stop */ + send(connector2, "2", 1, 0); + FD_CLR ( connector2, &fds_send ); + + break; + } + if ( FD_ISSET ( connector, &fds_send ) ) { + /* Once #1 is connected, allow #2 to connect */ + conn1 = 1; + + send(connector, "1", 1, 0); + FD_CLR ( connector, &fds_send ); + + iret = connect(connector2, (struct sockaddr*)&bindAddress, sizeof(bindAddress)); + ok(iret == 0 || + (iret == SOCKET_ERROR && WSAGetLastError() == WSAEWOULDBLOCK), "connecting to accepting socket failed, error %d\n", WSAGetLastError()); + FD_SET ( connector2, &fds_send ); + } + } + + ok (got == 2, "Did not get both connections\n"); + + dwret = WaitForSingleObject(overlapped.hEvent, 0); + ok(dwret == WAIT_OBJECT_0, "Waiting for accept event failed with %d + errno %d\n", dwret, GetLastError()); + + bret = GetOverlappedResult((HANDLE)listener, &overlapped, &bytesReturned, FALSE); + ok(bret, "GetOverlappedResult failed, error %d\n", GetLastError()); + ok(bytesReturned == 0, "bytesReturned isn't supposed to be %d\n", bytesReturned); + + set_blocking(acceptor, TRUE); + iret = recv( acceptor, buffer, 2, 0); + ok(iret == 1, "Failed to get data, %d\n", iret); + + ok(buffer[0] == '1', "The wrong first client was accepted by acceptex: %c != 1\n", buffer[0]); + + closesocket(connector); + connector = INVALID_SOCKET; + closesocket(acceptor); + acceptor = INVALID_SOCKET; + /* Disconnect during receive? */ acceptor = socket(AF_INET, SOCK_STREAM, 0); @@ -2756,6 +2976,8 @@ end: closesocket(acceptor); if (connector != INVALID_SOCKET) closesocket(connector); + if (connector2 != INVALID_SOCKET) + closesocket(connector2); } /**************** Main program ***************/ diff --git a/include/Makefile.in b/include/Makefile.in index 4210bbbf446..71a20ac879d 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -50,6 +50,7 @@ PUBLIC_IDL_H_SRCS = \ mstask.idl \ msxml.idl \ msxml2.idl \ + netcon.idl \ netfw.idl \ oaidl.idl \ objidl.idl \ @@ -77,6 +78,7 @@ PUBLIC_IDL_H_SRCS = \ urlhist.idl \ urlmon.idl \ vmr9.idl \ + wbemcli.idl \ wincodec.idl \ wine/itss.idl \ wine/svcctl.idl \ @@ -139,11 +141,6 @@ SRCDIR_INCLUDES = \ d3drmobj.h \ d3dtypes.h \ d3dvec.inl \ - d3dx8.h \ - d3dx8core.h \ - d3dx8math.h \ - d3dx8math.inl \ - d3dx8mesh.h \ d3dx9.h \ d3dx9core.h \ d3dx9math.h \ @@ -349,6 +346,7 @@ SRCDIR_INCLUDES = \ npapi.h \ nspapi.h \ ntddcdrm.h \ + ntddndis.h \ ntddscsi.h \ ntddstor.h \ ntdsapi.h \ @@ -418,6 +416,7 @@ SRCDIR_INCLUDES = \ sspi.h \ storage.h \ svrapi.h \ + t2embapi.h \ tapi.h \ tchar.h \ textserv.h \ diff --git a/include/d3d10effect.h b/include/d3d10effect.h index 37d4bd1932a..b9c5c0861cb 100644 --- a/include/d3d10effect.h +++ b/include/d3d10effect.h @@ -203,6 +203,49 @@ DECLARE_INTERFACE_(ID3D10EffectConstantBuffer, ID3D10EffectVariable) }; #undef INTERFACE +DEFINE_GUID(IID_ID3D10EffectMatrixVariable, 0x50666c24, 0xb82f, 0x4eed, 0xa1, 0x72, 0x5b, 0x6e, 0x7e, 0x85, 0x22, 0xe0); + +#define INTERFACE ID3D10EffectMatrixVariable +DECLARE_INTERFACE_(ID3D10EffectMatrixVariable, ID3D10EffectVariable) +{ + /* ID3D10EffectVariable methods */ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE; + STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE; + STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE; + STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE; + STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE; + STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE; + STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE; + STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE; + STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE; + STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE; + /* ID3D10EffectMatrixVariable methods */ + STDMETHOD(SetMatrix)(THIS_ float *data) PURE; + STDMETHOD(GetMatrix)(THIS_ float *data) PURE; + STDMETHOD(SetMatrixArray)(THIS_ float *data, UINT offset, UINT count) PURE; + STDMETHOD(GetMatrixArray)(THIS_ float *data, UINT offset, UINT count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ float *data) PURE; + STDMETHOD(GetMatrixTranspose)(THIS_ float *data) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ float *data, UINT offset, UINT count) PURE; + STDMETHOD(GetMatrixTransposeArray)(THIS_ float *data, UINT offset, UINT count) PURE; +}; +#undef INTERFACE + DEFINE_GUID(IID_ID3D10EffectTechnique, 0xdb122ce8, 0xd1c9, 0x4292, 0xb2, 0x37, 0x24, 0xed, 0x3d, 0xe8, 0xb1, 0x75); #define INTERFACE ID3D10EffectTechnique diff --git a/include/d3dx8core.h b/include/d3dx8core.h deleted file mode 100644 index 6de45833949..00000000000 --- a/include/d3dx8core.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2002 Raphael Junqueira - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_D3DX8CORE_H -#define __WINE_D3DX8CORE_H - -#include - -/***************************************************************************** - * #defines and error codes - */ -#define D3DXASM_DEBUG 1 -#define D3DXASM_SKIPVALIDATION 2 - -#define _FACD3D 0x876 -#define MAKE_D3DXHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) - -/* - * Direct3D Errors - */ -#define D3DXERR_CANNOTATTRSORT MAKE_D3DXHRESULT(2158) -#define D3DXERR_CANNOTMODIFYINDEXBUFFER MAKE_D3DXHRESULT(2159) -#define D3DXERR_INVALIDMESH MAKE_D3DXHRESULT(2160) -#define D3DXERR_SKINNINGNOTSUPPORTED MAKE_D3DXHRESULT(2161) -#define D3DXERR_TOOMANYINFLUENCES MAKE_D3DXHRESULT(2162) -#define D3DXERR_INVALIDDATA MAKE_D3DXHRESULT(2163) - -/***************************************************************************** - * Predeclare the interfaces - */ -DEFINE_GUID(IID_ID3DXBuffer, 0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x12);/* FIXME */ -typedef struct ID3DXBuffer *LPD3DXBUFFER; -DEFINE_GUID(IID_ID3DXFont, 0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x13);/* FIXME */ -typedef struct ID3DXFont *LPD3DXFONT; - -/***************************************************************************** - * ID3DXBuffer interface - */ -#define INTERFACE ID3DXBuffer -DECLARE_INTERFACE_(ID3DXBuffer,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** ID3DXBuffer methods ***/ - STDMETHOD_(LPVOID,GetBufferPointer)(THIS) PURE; - STDMETHOD_(DWORD,GetBufferSize)(THIS) PURE; -}; -#undef INTERFACE - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define ID3DXBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define ID3DXBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define ID3DXBuffer_Release(p) (p)->lpVtbl->Release(p) -/*** ID3DXBuffer methods ***/ -#define ID3DXBuffer_GetBufferPointer(p) (p)->lpVtbl->GetBufferPointer(p) -#define ID3DXBuffer_GetBufferSize(p) (p)->lpVtbl->GetBufferSize(p) -#endif - -/***************************************************************************** - * ID3DXFont interface - */ -#define INTERFACE ID3DXFont -DECLARE_INTERFACE_(ID3DXFont,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** ID3DXFont methods ***/ - STDMETHOD(Begin)(THIS) PURE; - STDMETHOD(DrawTextA)(THIS) PURE; - STDMETHOD(End)(THIS) PURE; -}; -#undef INTERFACE - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define ID3DXFont_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define ID3DXFont_AddRef(p) (p)->lpVtbl->AddRef(p) -#define ID3DXFont_Release(p) (p)->lpVtbl->Release(p) -/*** ID3DXFont methods ***/ -#define ID3DXFont_Begin(p) (p)->lpVtbl->Begin(p) -#define ID3DXFont_DrawTextA(p,a,b,c,d,e)(p)->lpVtbl->DrawText(p,a,b,c,d,e) -#define ID3DXFont_End(p) (p)->lpVtbl->End(p) -#endif - -/************************************************************************************* - * Define entrypoints - */ -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont); -HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors); -HRESULT WINAPI D3DXAssembleShaderFromFileA(LPCSTR pSrcFile, DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors); -HRESULT WINAPI D3DXAssembleShaderFromFileW(LPCWSTR pSrcFile, DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors); - -#ifdef __cplusplus -} -#endif - -#endif /* __WINE_D3DX8CORE_H */ diff --git a/include/d3dx8math.h b/include/d3dx8math.h deleted file mode 100644 index ee5c220dd0e..00000000000 --- a/include/d3dx8math.h +++ /dev/null @@ -1,415 +0,0 @@ -/* - * Copyright (C) 2007 David Adam - * Copyright (C) 2007 Tony Wasserka - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include - -#ifndef __D3DX8MATH_H__ -#define __D3DX8MATH_H__ - -#include - -#define D3DX_PI ((FLOAT)3.141592654) -#define D3DX_1BYPI ((FLOAT)0.318309886) - -#define D3DXToRadian(degree) ((degree) * (D3DX_PI / 180.0f)) -#define D3DXToDegree(radian) ((radian) * (180.0f / D3DX_PI)) - -typedef struct ID3DXMatrixStack *LPD3DXMATRIXSTACK; - -DEFINE_GUID(IID_ID3DXMatrixStack, -0xe3357330, 0xcc5e, 0x11d2, 0xa4, 0x34, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); - -typedef struct D3DXVECTOR2 -{ -#ifdef __cplusplus - D3DXVECTOR2(); - D3DXVECTOR2(CONST FLOAT *pf); - D3DXVECTOR2(FLOAT fx, FLOAT fy); - - operator FLOAT* (); - operator CONST FLOAT* () const; - - D3DXVECTOR2& operator += (CONST D3DXVECTOR2&); - D3DXVECTOR2& operator -= (CONST D3DXVECTOR2&); - D3DXVECTOR2& operator *= (FLOAT); - D3DXVECTOR2& operator /= (FLOAT); - - D3DXVECTOR2 operator + () const; - D3DXVECTOR2 operator - () const; - - D3DXVECTOR2 operator + (CONST D3DXVECTOR2&) const; - D3DXVECTOR2 operator - (CONST D3DXVECTOR2&) const; - D3DXVECTOR2 operator * (FLOAT) const; - D3DXVECTOR2 operator / (FLOAT) const; - - friend D3DXVECTOR2 operator * (FLOAT, CONST D3DXVECTOR2&); - - BOOL operator == (CONST D3DXVECTOR2&) const; - BOOL operator != (CONST D3DXVECTOR2&) const; -#endif /* __cplusplus */ - FLOAT x, y; -} D3DXVECTOR2, *LPD3DXVECTOR2; - -#ifdef __cplusplus -typedef struct D3DXVECTOR3 : public D3DVECTOR -{ - D3DXVECTOR3(); - D3DXVECTOR3(CONST FLOAT *pf); - D3DXVECTOR3(CONST D3DVECTOR& v); - D3DXVECTOR3(FLOAT fx, FLOAT fy, FLOAT fz); - - operator FLOAT* (); - operator CONST FLOAT* () const; - - D3DXVECTOR3& operator += (CONST D3DXVECTOR3&); - D3DXVECTOR3& operator -= (CONST D3DXVECTOR3&); - D3DXVECTOR3& operator *= (FLOAT); - D3DXVECTOR3& operator /= (FLOAT); - - D3DXVECTOR3 operator + () const; - D3DXVECTOR3 operator - () const; - - D3DXVECTOR3 operator + (CONST D3DXVECTOR3&) const; - D3DXVECTOR3 operator - (CONST D3DXVECTOR3&) const; - D3DXVECTOR3 operator * (FLOAT) const; - D3DXVECTOR3 operator / (FLOAT) const; - - friend D3DXVECTOR3 operator * (FLOAT, CONST struct D3DXVECTOR3&); - - BOOL operator == (CONST D3DXVECTOR3&) const; - BOOL operator != (CONST D3DXVECTOR3&) const; -} D3DXVECTOR3, *LPD3DXVECTOR3; -#else /* !__cplusplus */ -typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3; -#endif /* !__cplusplus */ - -typedef struct D3DXVECTOR4 -{ -#ifdef __cplusplus - D3DXVECTOR4(); - D3DXVECTOR4(CONST FLOAT *pf); - D3DXVECTOR4(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw); - - operator FLOAT* (); - operator CONST FLOAT* () const; - - D3DXVECTOR4& operator += (CONST D3DXVECTOR4&); - D3DXVECTOR4& operator -= (CONST D3DXVECTOR4&); - D3DXVECTOR4& operator *= (FLOAT); - D3DXVECTOR4& operator /= (FLOAT); - - D3DXVECTOR4 operator + () const; - D3DXVECTOR4 operator - () const; - - D3DXVECTOR4 operator + (CONST D3DXVECTOR4&) const; - D3DXVECTOR4 operator - (CONST D3DXVECTOR4&) const; - D3DXVECTOR4 operator * (FLOAT) const; - D3DXVECTOR4 operator / (FLOAT) const; - - friend D3DXVECTOR4 operator * (FLOAT, CONST D3DXVECTOR4&); - - BOOL operator == (CONST D3DXVECTOR4&) const; - BOOL operator != (CONST D3DXVECTOR4&) const; -#endif /* __cplusplus */ - FLOAT x, y, z, w; -} D3DXVECTOR4, *LPD3DXVECTOR4; - -#ifdef __cplusplus -typedef struct D3DXMATRIX : public D3DMATRIX -{ - D3DXMATRIX(); - D3DXMATRIX(CONST FLOAT *pf); - D3DXMATRIX(CONST D3DMATRIX& mat); - D3DXMATRIX(FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14, - FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24, - FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34, - FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44); - - FLOAT& operator () (UINT row, UINT col); - FLOAT operator () (UINT row, UINT col) const; - - operator FLOAT* (); - operator CONST FLOAT* () const; - - D3DXMATRIX& operator *= (CONST D3DXMATRIX&); - D3DXMATRIX& operator += (CONST D3DXMATRIX&); - D3DXMATRIX& operator -= (CONST D3DXMATRIX&); - D3DXMATRIX& operator *= (FLOAT); - D3DXMATRIX& operator /= (FLOAT); - - D3DXMATRIX operator + () const; - D3DXMATRIX operator - () const; - - D3DXMATRIX operator * (CONST D3DXMATRIX&) const; - D3DXMATRIX operator + (CONST D3DXMATRIX&) const; - D3DXMATRIX operator - (CONST D3DXMATRIX&) const; - D3DXMATRIX operator * (FLOAT) const; - D3DXMATRIX operator / (FLOAT) const; - - friend D3DXMATRIX operator * (FLOAT, CONST D3DXMATRIX&); - - BOOL operator == (CONST D3DXMATRIX&) const; - BOOL operator != (CONST D3DXMATRIX&) const; -} D3DXMATRIX, *LPD3DXMATRIX; -#else /* !__cplusplus */ -typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX; -#endif /* !__cplusplus */ - -typedef struct D3DXQUATERNION -{ -#ifdef __cplusplus - D3DXQUATERNION(); - D3DXQUATERNION(CONST FLOAT *pf); - D3DXQUATERNION(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw); - - operator FLOAT* (); - operator CONST FLOAT* () const; - - D3DXQUATERNION& operator += (CONST D3DXQUATERNION&); - D3DXQUATERNION& operator -= (CONST D3DXQUATERNION&); - D3DXQUATERNION& operator *= (CONST D3DXQUATERNION&); - D3DXQUATERNION& operator *= (FLOAT); - D3DXQUATERNION& operator /= (FLOAT); - - D3DXQUATERNION operator + () const; - D3DXQUATERNION operator - () const; - - D3DXQUATERNION operator + (CONST D3DXQUATERNION&) const; - D3DXQUATERNION operator - (CONST D3DXQUATERNION&) const; - D3DXQUATERNION operator * (CONST D3DXQUATERNION&) const; - D3DXQUATERNION operator * (FLOAT) const; - D3DXQUATERNION operator / (FLOAT) const; - - friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION&); - - BOOL operator == (CONST D3DXQUATERNION&) const; - BOOL operator != (CONST D3DXQUATERNION&) const; -#endif /* __cplusplus */ - FLOAT x, y, z, w; -} D3DXQUATERNION, *LPD3DXQUATERNION; - -typedef struct D3DXPLANE -{ -#ifdef __cplusplus - D3DXPLANE(); - D3DXPLANE(CONST FLOAT *pf); - D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd); - - operator FLOAT* (); - operator CONST FLOAT* () const; - - D3DXPLANE operator + () const; - D3DXPLANE operator - () const; - - BOOL operator == (CONST D3DXPLANE&) const; - BOOL operator != (CONST D3DXPLANE&) const; -#endif /* __cplusplus */ - FLOAT a, b, c, d; -} D3DXPLANE, *LPD3DXPLANE; - -typedef struct D3DXCOLOR -{ -#ifdef __cplusplus - D3DXCOLOR(); - D3DXCOLOR(DWORD col); - D3DXCOLOR(CONST FLOAT *pf); - D3DXCOLOR(CONST D3DCOLORVALUE& col); - D3DXCOLOR(FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa); - - operator DWORD () const; - - operator FLOAT* (); - operator CONST FLOAT* () const; - - operator D3DCOLORVALUE* (); - operator CONST D3DCOLORVALUE* () const; - - operator D3DCOLORVALUE& (); - operator CONST D3DCOLORVALUE& () const; - - D3DXCOLOR& operator += (CONST D3DXCOLOR&); - D3DXCOLOR& operator -= (CONST D3DXCOLOR&); - D3DXCOLOR& operator *= (FLOAT); - D3DXCOLOR& operator /= (FLOAT); - - D3DXCOLOR operator + () const; - D3DXCOLOR operator - () const; - - D3DXCOLOR operator + (CONST D3DXCOLOR&) const; - D3DXCOLOR operator - (CONST D3DXCOLOR&) const; - D3DXCOLOR operator * (FLOAT) const; - D3DXCOLOR operator / (FLOAT) const; - - friend D3DXCOLOR operator * (FLOAT, CONST D3DXCOLOR&); - - BOOL operator == (CONST D3DXCOLOR&) const; - BOOL operator != (CONST D3DXCOLOR&) const; -#endif /* __cplusplus */ - FLOAT r, g, b, a; -} D3DXCOLOR, *LPD3DXCOLOR; - -#ifdef __cplusplus -extern "C" { -#endif - -D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s); -D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s); - -FLOAT WINAPI D3DXFresnelTerm(FLOAT costheta, FLOAT refractionindex); - -D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR3 *rotationcenter, CONST D3DXQUATERNION *rotation, CONST D3DXVECTOR3 *translation); -FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); -D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, CONST D3DXMATRIX *pm); -D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup); -D3DXMATRIX* WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup); -D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); -D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); -D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixOrthoRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf); -D3DXMATRIX* WINAPI D3DXMatrixReflect(D3DXMATRIX *pout, CONST D3DXPLANE *pplane); -D3DXMATRIX* WINAPI D3DXMatrixRotationAxis(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pv, FLOAT angle); -D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion(D3DXMATRIX *pout, CONST D3DXQUATERNION *pq); -D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle); -D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle); -D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll(D3DXMATRIX *pout, FLOAT yaw, FLOAT pitch, FLOAT roll); -D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle); -D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz); -D3DXMATRIX* WINAPI D3DXMatrixShadow(D3DXMATRIX *pout, CONST D3DXVECTOR4 *plight, CONST D3DXPLANE *pPlane); -D3DXMATRIX* WINAPI D3DXMatrixTransformation(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pscalingcenter, CONST D3DXQUATERNION *pscalingrotation, CONST D3DXVECTOR3 *pscaling, CONST D3DXVECTOR3 *protationcenter, CONST D3DXQUATERNION *protation, CONST D3DXVECTOR3 *ptranslation); -D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z); -D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm); - -D3DXPLANE* WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pout, CONST D3DXVECTOR3 *pvpoint, CONST D3DXVECTOR3 *pvnormal); -D3DXPLANE* WINAPI D3DXPlaneFromPoints(D3DXPLANE *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3); -D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *pp, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2); -D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp); -D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm); - -D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, FLOAT f, FLOAT g); -D3DXQUATERNION* WINAPI D3DXQuaternionExp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); -D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); -D3DXQUATERNION* WINAPI D3DXQuaternionLn(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); -D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2); -D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); -D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis(D3DXQUATERNION *pout, CONST D3DXVECTOR3 *pv, FLOAT angle); -D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix(D3DXQUATERNION *pout, CONST D3DXMATRIX *pm); -D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll(D3DXQUATERNION *pout, FLOAT yaw, FLOAT pitch, FLOAT roll); -D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, FLOAT t); -D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, CONST D3DXQUATERNION *pq4, FLOAT t); -void WINAPI D3DXQuaternionToAxisAngle(CONST D3DXQUATERNION *pq, D3DXVECTOR3 *paxis, FLOAT *pangle); - -D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g); -D3DXVECTOR2* WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv0, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT s); -D3DXVECTOR2* WINAPI D3DXVec2Hermite(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pt1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pt2, FLOAT s); -D3DXVECTOR2* WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv); -D3DXVECTOR4* WINAPI D3DXVec2Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm); -D3DXVECTOR2* WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm); -D3DXVECTOR2* WINAPI D3DXVec2TransformNormal(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm); - -D3DXVECTOR3* WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT f, FLOAT g); -D3DXVECTOR3* WINAPI D3DXVec3CatmullRom( D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv0, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT s); -D3DXVECTOR3* WINAPI D3DXVec3Hermite(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pt1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pt2, FLOAT s); -D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv); -D3DXVECTOR3* WINAPI D3DXVec3Project(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT8 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld); -D3DXVECTOR4* WINAPI D3DXVec3Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm); -D3DXVECTOR3* WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm); -D3DXVECTOR3* WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm); -D3DXVECTOR3* WINAPI D3DXVec3Unproject(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT8 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld); - -D3DXVECTOR4* WINAPI D3DXVec4BaryCentric(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT f, FLOAT g); -D3DXVECTOR4* WINAPI D3DXVec4CatmullRom(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv0, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT s); -D3DXVECTOR4* WINAPI D3DXVec4Cross(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3); -D3DXVECTOR4* WINAPI D3DXVec4Hermite(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pt1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pt2, FLOAT s); -D3DXVECTOR4* WINAPI D3DXVec4Normalize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv); -D3DXVECTOR4* WINAPI D3DXVec4Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv, CONST D3DXMATRIX *pm); - -#ifdef __cplusplus -} -#endif - -#define INTERFACE ID3DXMatrixStack -DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) -{ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(Pop)(THIS) PURE; - STDMETHOD(Push)(THIS) PURE; - STDMETHOD(LoadIdentity)(THIS) PURE; - STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX *) PURE; - STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX *) PURE; - STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX *) PURE; - STDMETHOD(RotateAxis)(THIS_ CONST D3DXVECTOR3 *, FLOAT) PURE; - STDMETHOD(RotateAxisLocal)(THIS_ CONST D3DXVECTOR3 *, FLOAT) PURE; - STDMETHOD(RotateYawPitchRoll)(THIS_ FLOAT, FLOAT, FLOAT) PURE; - STDMETHOD(RotateYawPitchRollLocal)(THIS_ FLOAT, FLOAT, FLOAT) PURE; - STDMETHOD(Scale)(THIS_ FLOAT, FLOAT, FLOAT) PURE; - STDMETHOD(ScaleLocal)(THIS_ FLOAT, FLOAT, FLOAT) PURE; - STDMETHOD(Translate)(THIS_ FLOAT, FLOAT, FLOAT) PURE; - STDMETHOD(TranslateLocal)(THIS_ FLOAT, FLOAT, FLOAT) PURE; - STDMETHOD_(LPD3DXMATRIX, GetTop)(THIS) PURE; -}; - -#undef INTERFACE - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define ID3DXMatrixStack_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define ID3DXMatrixStack_AddRef(p) (p)->lpVtbl->AddRef(p) -#define ID3DXMatrixStack_Release(p) (p)->lpVtbl->Release(p) -#define ID3DXMatrixStack_Pop(p) (p)->lpVtbl->Pop(p) -#define ID3DXMatrixStack_Push(p) (p)->lpVtbl->Push(p) -#define ID3DXMatrixStack_LoadIdentity(p) (p)->lpVtbl->LoadIdentity(p) -#define ID3DXMatrixStack_LoadMatrix(p,a) (p)->lpVtbl->LoadMatrix(p,a) -#define ID3DXMatrixStack_MultMatrix(p,a) (p)->lpVtbl->MultMatrix(p,a) -#define ID3DXMatrixStack_MultMatrixLocal(p,a) (p)->lpVtbl->MultMatrixLocal(p,a) -#define ID3DXMatrixStack_RotateAxis(p,a,b) (p)->lpVtbl->RotateAxis(p,a,b) -#define ID3DXMatrixStack_RotateAxisLocal(p,a,b) (p)->lpVtbl->RotateAxisLocal(p,a,b) -#define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c) (p)->lpVtbl->RotateYawPitchRoll(p,a,b,c) -#define ID3DXMatrixStack_RotateYawPitchRollLocal(p,a,b,c) (p)->lpVtbl->RotateYawPitchRollLocal(p,a,b,c) -#define ID3DXMatrixStack_Scale(p,a,b,c) (p)->lpVtbl->Scale(p,a,b,c) -#define ID3DXMatrixStack_ScaleLocal(p,a,b,c) (p)->lpVtbl->ScaleLocal(p,a,b,c) -#define ID3DXMatrixStack_Translate(p,a,b,c) (p)->lpVtbl->Translate(p,a,b,c) -#define ID3DXMatrixStack_TranslateLocal(p,a,b,c) (p)->lpVtbl->TranslateLocal(p,a,b,c) -#define ID3DXMatrixStack_GetTop(p) (p)->lpVtbl->GetTop(p) - -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT WINAPI D3DXCreateMatrixStack(DWORD flags, LPD3DXMATRIXSTACK* ppstack); - -#ifdef __cplusplus -} -#endif - -#include - -#endif /* __D3DX8MATH_H__ */ diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl deleted file mode 100644 index 01e7af35542..00000000000 --- a/include/d3dx8math.inl +++ /dev/null @@ -1,1268 +0,0 @@ -/* - * Copyright (C) 2007 David Adam - * Copyright (C) 2007 Tony Wasserka - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __D3DX8MATH_INL__ -#define __D3DX8MATH_INL__ - -/* constructors & operators */ -#ifdef __cplusplus - -inline D3DXVECTOR2::D3DXVECTOR2() -{ -} - -inline D3DXVECTOR2::D3DXVECTOR2(CONST FLOAT *pf) -{ - if(!pf) return; - x = pf[0]; - y = pf[1]; -} - -inline D3DXVECTOR2::D3DXVECTOR2(FLOAT fx, FLOAT fy) -{ - x = fx; - y = fy; -} - -inline D3DXVECTOR2::operator FLOAT* () -{ - return (FLOAT*)&x; -} - -inline D3DXVECTOR2::operator CONST FLOAT* () const -{ - return (CONST FLOAT*)&x; -} - -inline D3DXVECTOR2& D3DXVECTOR2::operator += (CONST D3DXVECTOR2& v) -{ - x += v.x; - y += v.y; - return *this; -} - -inline D3DXVECTOR2& D3DXVECTOR2::operator -= (CONST D3DXVECTOR2& v) -{ - x -= v.x; - y -= v.y; - return *this; -} - -inline D3DXVECTOR2& D3DXVECTOR2::operator *= (FLOAT f) -{ - x *= f; - y *= f; - return *this; -} - -inline D3DXVECTOR2& D3DXVECTOR2::operator /= (FLOAT f) -{ - x /= f; - y /= f; - return *this; -} - -inline D3DXVECTOR2 D3DXVECTOR2::operator + () const -{ - return *this; -} - -inline D3DXVECTOR2 D3DXVECTOR2::operator - () const -{ - return D3DXVECTOR2(-x, -y); -} - -inline D3DXVECTOR2 D3DXVECTOR2::operator + (CONST D3DXVECTOR2& v) const -{ - return D3DXVECTOR2(x + v.x, y + v.y); -} - -inline D3DXVECTOR2 D3DXVECTOR2::operator - (CONST D3DXVECTOR2& v) const -{ - return D3DXVECTOR2(x - v.x, y - v.y); -} - -inline D3DXVECTOR2 D3DXVECTOR2::operator * (FLOAT f) const -{ - return D3DXVECTOR2(x * f, y * f); -} - -inline D3DXVECTOR2 D3DXVECTOR2::operator / (FLOAT f) const -{ - return D3DXVECTOR2(x / f, y / f); -} - -inline D3DXVECTOR2 operator * (FLOAT f, CONST D3DXVECTOR2& v) -{ - return D3DXVECTOR2(f * v.x, f * v.y); -} - -inline BOOL D3DXVECTOR2::operator == (CONST D3DXVECTOR2& v) const -{ - return x == v.x && y == v.y; -} - -inline BOOL D3DXVECTOR2::operator != (CONST D3DXVECTOR2& v) const -{ - return x != v.x || y != v.y; -} - -inline D3DXVECTOR3::D3DXVECTOR3() -{ -} - -inline D3DXVECTOR3::D3DXVECTOR3(CONST FLOAT *pf) -{ - if(!pf) return; - x = pf[0]; - y = pf[1]; - z = pf[2]; -} - -inline D3DXVECTOR3::D3DXVECTOR3(CONST D3DVECTOR& v) -{ - x = v.x; - y = v.y; - z = v.z; -} - -inline D3DXVECTOR3::D3DXVECTOR3(FLOAT fx, FLOAT fy, FLOAT fz) -{ - x = fx; - y = fy; - z = fz; -} - -inline D3DXVECTOR3::operator FLOAT* () -{ - return (FLOAT*)&x; -} - -inline D3DXVECTOR3::operator CONST FLOAT* () const -{ - return (CONST FLOAT*)&x; -} - -inline D3DXVECTOR3& D3DXVECTOR3::operator += (CONST D3DXVECTOR3& v) -{ - x += v.x; - y += v.y; - z += v.z; - return *this; -} - -inline D3DXVECTOR3& D3DXVECTOR3::operator -= (CONST D3DXVECTOR3& v) -{ - x -= v.x; - y -= v.y; - z -= v.z; - return *this; -} - -inline D3DXVECTOR3& D3DXVECTOR3::operator *= (FLOAT f) -{ - x *= f; - y *= f; - z *= f; - return *this; -} - -inline D3DXVECTOR3& D3DXVECTOR3::operator /= (FLOAT f) -{ - x /= f; - y /= f; - z /= f; - return *this; -} - -inline D3DXVECTOR3 D3DXVECTOR3::operator + () const -{ - return *this; -} - -inline D3DXVECTOR3 D3DXVECTOR3::operator - () const -{ - return D3DXVECTOR3(-x, -y, -z); -} - -inline D3DXVECTOR3 D3DXVECTOR3::operator + (CONST D3DXVECTOR3& v) const -{ - return D3DXVECTOR3(x + v.x, y + v.y, z + v.z); -} - -inline D3DXVECTOR3 D3DXVECTOR3::operator - (CONST D3DXVECTOR3& v) const -{ - return D3DXVECTOR3(x - v.x, y - v.y, z - v.z); -} - -inline D3DXVECTOR3 D3DXVECTOR3::operator * (FLOAT f) const -{ - return D3DXVECTOR3(x * f, y * f, z * f); -} - -inline D3DXVECTOR3 D3DXVECTOR3::operator / (FLOAT f) const -{ - return D3DXVECTOR3(x / f, y / f, z / f); -} - -inline D3DXVECTOR3 operator * (FLOAT f, CONST D3DXVECTOR3& v) -{ - return D3DXVECTOR3(f * v.x, f * v.y, f * v.z); -} - -inline BOOL D3DXVECTOR3::operator == (CONST D3DXVECTOR3& v) const -{ - return x == v.x && y == v.y && z == v.z; -} - -inline BOOL D3DXVECTOR3::operator != (CONST D3DXVECTOR3& v) const -{ - return x != v.x || y != v.y || z != v.z; -} - -inline D3DXVECTOR4::D3DXVECTOR4() -{ -} - -inline D3DXVECTOR4::D3DXVECTOR4(CONST FLOAT *pf) -{ - if(!pf) return; - x = pf[0]; - y = pf[1]; - z = pf[2]; - w = pf[3]; -} - -inline D3DXVECTOR4::D3DXVECTOR4(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw) -{ - x = fx; - y = fy; - z = fz; - w = fw; -} - -inline D3DXVECTOR4::operator FLOAT* () -{ - return (FLOAT*)&x; -} - -inline D3DXVECTOR4::operator CONST FLOAT* () const -{ - return (CONST FLOAT*)&x; -} - -inline D3DXVECTOR4& D3DXVECTOR4::operator += (CONST D3DXVECTOR4& v) -{ - x += v.x; - y += v.y; - z += v.z; - w += v.w; - return *this; -} - -inline D3DXVECTOR4& D3DXVECTOR4::operator -= (CONST D3DXVECTOR4& v) -{ - x -= v.x; - y -= v.y; - z -= v.z; - w -= v.w; - return *this; -} - -inline D3DXVECTOR4& D3DXVECTOR4::operator *= (FLOAT f) -{ - x *= f; - y *= f; - z *= f; - w *= f; - return *this; -} - -inline D3DXVECTOR4& D3DXVECTOR4::operator /= (FLOAT f) -{ - x /= f; - y /= f; - z /= f; - w /= f; - return *this; -} - -inline D3DXVECTOR4 D3DXVECTOR4::operator + () const -{ - return *this; -} - -inline D3DXVECTOR4 D3DXVECTOR4::operator - () const -{ - return D3DXVECTOR4(-x, -y, -z, -w); -} - -inline D3DXVECTOR4 D3DXVECTOR4::operator + (CONST D3DXVECTOR4& v) const -{ - return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w); -} - -inline D3DXVECTOR4 D3DXVECTOR4::operator - (CONST D3DXVECTOR4& v) const -{ - return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w); -} - -inline D3DXVECTOR4 D3DXVECTOR4::operator * (FLOAT f) const -{ - return D3DXVECTOR4(x * f, y * f, z * f, w * f); -} - -inline D3DXVECTOR4 D3DXVECTOR4::operator / (FLOAT f) const -{ - return D3DXVECTOR4(x / f, y / f, z / f, w / f); -} - -inline D3DXVECTOR4 operator * (FLOAT f, CONST D3DXVECTOR4& v) -{ - return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w); -} - -inline BOOL D3DXVECTOR4::operator == (CONST D3DXVECTOR4& v) const -{ - return x == v.x && y == v.y && z == v.z && w == v.w; -} - -inline BOOL D3DXVECTOR4::operator != (CONST D3DXVECTOR4& v) const -{ - return x != v.x || y != v.y || z != v.z || w != v.w; -} - -inline D3DXMATRIX::D3DXMATRIX() -{ -} - -inline D3DXMATRIX::D3DXMATRIX(CONST FLOAT *pf) -{ - if(!pf) return; - memcpy(&_11, pf, sizeof(D3DXMATRIX)); -} - -inline D3DXMATRIX::D3DXMATRIX(CONST D3DMATRIX& mat) -{ - memcpy(&_11, &mat, sizeof(D3DXMATRIX)); -} - -inline D3DXMATRIX::D3DXMATRIX(FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14, - FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24, - FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34, - FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44) -{ - _11 = f11; _12 = f12; _13 = f13; _14 = f14; - _21 = f21; _22 = f22; _23 = f23; _24 = f24; - _31 = f31; _32 = f32; _33 = f33; _34 = f34; - _41 = f41; _42 = f42; _43 = f43; _44 = f44; -} - -inline FLOAT& D3DXMATRIX::operator () (UINT row, UINT col) -{ - return m[row][col]; -} - -inline FLOAT D3DXMATRIX::operator () (UINT row, UINT col) const -{ - return m[row][col]; -} - -inline D3DXMATRIX::operator FLOAT* () -{ - return (FLOAT*)&_11; -} - -inline D3DXMATRIX::operator CONST FLOAT* () const -{ - return (CONST FLOAT*)&_11; -} - -inline D3DXMATRIX& D3DXMATRIX::operator *= (CONST D3DXMATRIX& mat) -{ - D3DXMatrixMultiply(this, this, &mat); - return *this; -} - -inline D3DXMATRIX& D3DXMATRIX::operator += (CONST D3DXMATRIX& mat) -{ - _11 += mat._11; _12 += mat._12; _13 += mat._13; _14 += mat._14; - _21 += mat._21; _22 += mat._22; _23 += mat._23; _24 += mat._24; - _31 += mat._31; _32 += mat._32; _33 += mat._33; _34 += mat._34; - _41 += mat._41; _42 += mat._42; _43 += mat._43; _44 += mat._44; - return *this; -} - -inline D3DXMATRIX& D3DXMATRIX::operator -= (CONST D3DXMATRIX& mat) -{ - _11 -= mat._11; _12 -= mat._12; _13 -= mat._13; _14 -= mat._14; - _21 -= mat._21; _22 -= mat._22; _23 -= mat._23; _24 -= mat._24; - _31 -= mat._31; _32 -= mat._32; _33 -= mat._33; _34 -= mat._34; - _41 -= mat._41; _42 -= mat._42; _43 -= mat._43; _44 -= mat._44; - return *this; -} - -inline D3DXMATRIX& D3DXMATRIX::operator *= (FLOAT f) -{ - _11 *= f; _12 *= f; _13 *= f; _14 *= f; - _21 *= f; _22 *= f; _23 *= f; _24 *= f; - _31 *= f; _32 *= f; _33 *= f; _34 *= f; - _41 *= f; _42 *= f; _43 *= f; _44 *= f; - return *this; -} - -inline D3DXMATRIX& D3DXMATRIX::operator /= (FLOAT f) -{ - FLOAT inv = 1.0f / f; - _11 *= inv; _12 *= inv; _13 *= inv; _14 *= inv; - _21 *= inv; _22 *= inv; _23 *= inv; _24 *= inv; - _31 *= inv; _32 *= inv; _33 *= inv; _34 *= inv; - _41 *= inv; _42 *= inv; _43 *= inv; _44 *= inv; - return *this; -} - -inline D3DXMATRIX D3DXMATRIX::operator + () const -{ - return *this; -} - -inline D3DXMATRIX D3DXMATRIX::operator - () const -{ - return D3DXMATRIX(-_11, -_12, -_13, -_14, - -_21, -_22, -_23, -_24, - -_31, -_32, -_33, -_34, - -_41, -_42, -_43, -_44); -} - -inline D3DXMATRIX D3DXMATRIX::operator * (CONST D3DXMATRIX& mat) const -{ - D3DXMATRIX buf; - D3DXMatrixMultiply(&buf, this, &mat); - return buf; -} - -inline D3DXMATRIX D3DXMATRIX::operator + (CONST D3DXMATRIX& mat) const -{ - return D3DXMATRIX(_11 + mat._11, _12 + mat._12, _13 + mat._13, _14 + mat._14, - _21 + mat._21, _22 + mat._22, _23 + mat._23, _24 + mat._24, - _31 + mat._31, _32 + mat._32, _33 + mat._33, _34 + mat._34, - _41 + mat._41, _42 + mat._42, _43 + mat._43, _44 + mat._44); -} - -inline D3DXMATRIX D3DXMATRIX::operator - (CONST D3DXMATRIX& mat) const -{ - return D3DXMATRIX(_11 - mat._11, _12 - mat._12, _13 - mat._13, _14 - mat._14, - _21 - mat._21, _22 - mat._22, _23 - mat._23, _24 - mat._24, - _31 - mat._31, _32 - mat._32, _33 - mat._33, _34 - mat._34, - _41 - mat._41, _42 - mat._42, _43 - mat._43, _44 - mat._44); -} - -inline D3DXMATRIX D3DXMATRIX::operator * (FLOAT f) const -{ - return D3DXMATRIX(_11 * f, _12 * f, _13 * f, _14 * f, - _21 * f, _22 * f, _23 * f, _24 * f, - _31 * f, _32 * f, _33 * f, _34 * f, - _41 * f, _42 * f, _43 * f, _44 * f); -} - -inline D3DXMATRIX D3DXMATRIX::operator / (FLOAT f) const -{ - FLOAT inv = 1.0f / f; - return D3DXMATRIX(_11 * inv, _12 * inv, _13 * inv, _14 * inv, - _21 * inv, _22 * inv, _23 * inv, _24 * inv, - _31 * inv, _32 * inv, _33 * inv, _34 * inv, - _41 * inv, _42 * inv, _43 * inv, _44 * inv); -} - -inline D3DXMATRIX operator * (FLOAT f, CONST D3DXMATRIX& mat) -{ - return D3DXMATRIX(f * mat._11, f * mat._12, f * mat._13, f * mat._14, - f * mat._21, f * mat._22, f * mat._23, f * mat._24, - f * mat._31, f * mat._32, f * mat._33, f * mat._34, - f * mat._41, f * mat._42, f * mat._43, f * mat._44); -} - -inline BOOL D3DXMATRIX::operator == (CONST D3DXMATRIX& mat) const -{ - return (memcmp(this, &mat, sizeof(D3DXMATRIX)) == 0); -} - -inline BOOL D3DXMATRIX::operator != (CONST D3DXMATRIX& mat) const -{ - return (memcmp(this, &mat, sizeof(D3DXMATRIX)) != 0); -} - -inline D3DXQUATERNION::D3DXQUATERNION() -{ -} - -inline D3DXQUATERNION::D3DXQUATERNION(CONST FLOAT *pf) -{ - if(!pf) return; - x = pf[0]; - y = pf[1]; - z = pf[2]; - w = pf[3]; -} - -inline D3DXQUATERNION::D3DXQUATERNION(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw) -{ - x = fx; - y = fy; - z = fz; - w = fw; -} - -inline D3DXQUATERNION::operator FLOAT* () -{ - return (FLOAT*)&x; -} - -inline D3DXQUATERNION::operator CONST FLOAT* () const -{ - return (CONST FLOAT*)&x; -} - -inline D3DXQUATERNION& D3DXQUATERNION::operator += (CONST D3DXQUATERNION& quat) -{ - x += quat.x; - y += quat.y; - z += quat.z; - w += quat.w; - return *this; -} - -inline D3DXQUATERNION& D3DXQUATERNION::operator -= (CONST D3DXQUATERNION& quat) -{ - x -= quat.x; - y -= quat.y; - z -= quat.z; - w -= quat.w; - return *this; -} - -/* TODO: uncomment this when D3DXQuaternionMultiply has been implemented -inline D3DXQUATERNION& D3DXQUATERNION::operator *= (CONST D3DXQUATERNION& quat) -{ - D3DXQuaternionMultiply(this, this, &quat); - return *this; -} -*/ - -inline D3DXQUATERNION& D3DXQUATERNION::operator *= (FLOAT f) -{ - x *= f; - y *= f; - z *= f; - w *= f; - return *this; -} - -inline D3DXQUATERNION& D3DXQUATERNION::operator /= (FLOAT f) -{ - FLOAT inv = 1.0f / f; - x *= inv; - y *= inv; - z *= inv; - w *= inv; - return *this; -} - -inline D3DXQUATERNION D3DXQUATERNION::operator + () const -{ - return *this; -} - -inline D3DXQUATERNION D3DXQUATERNION::operator - () const -{ - return D3DXQUATERNION(-x, -y, -z, -w); -} - -inline D3DXQUATERNION D3DXQUATERNION::operator + (CONST D3DXQUATERNION& quat) const -{ - return D3DXQUATERNION(x + quat.x, y + quat.y, z + quat.z, w + quat.w); -} - -inline D3DXQUATERNION D3DXQUATERNION::operator - (CONST D3DXQUATERNION& quat) const -{ - return D3DXQUATERNION(x - quat.x, y - quat.y, z - quat.z, w - quat.w); -} - -/* TODO: uncomment this when D3DXQuaternionMultiply has been implemented -inline D3DXQUATERNION D3DXQUATERNION::operator * (CONST D3DXQUATERNION& quat) const -{ - D3DXQUATERNION buf; - D3DXQuaternionMultiply(&buf, this, &quat); - return buf; -} -*/ - -inline D3DXQUATERNION D3DXQUATERNION::operator * (FLOAT f) const -{ - return D3DXQUATERNION(x * f, y * f, z * f, w * f); -} - -inline D3DXQUATERNION D3DXQUATERNION::operator / (FLOAT f) const -{ - FLOAT inv = 1.0f / f; - return D3DXQUATERNION(x * inv, y * inv, z * inv, w * inv); -} - -inline D3DXQUATERNION operator * (FLOAT f, CONST D3DXQUATERNION& quat) -{ - return D3DXQUATERNION(f * quat.x, f * quat.y, f * quat.z, f * quat.w); -} - -inline BOOL D3DXQUATERNION::operator == (CONST D3DXQUATERNION& quat) const -{ - return x == quat.x && y == quat.y && z == quat.z && w == quat.w; -} - -inline BOOL D3DXQUATERNION::operator != (CONST D3DXQUATERNION& quat) const -{ - return x != quat.x || y != quat.y || z != quat.z || w != quat.w; -} - -inline D3DXPLANE::D3DXPLANE() -{ -} - -inline D3DXPLANE::D3DXPLANE(CONST FLOAT *pf) -{ - if(!pf) return; - a = pf[0]; - b = pf[1]; - c = pf[2]; - d = pf[3]; -} - -inline D3DXPLANE::D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd) -{ - a = fa; - b = fb; - c = fc; - d = fd; -} - -inline D3DXPLANE::operator FLOAT* () -{ - return (FLOAT*)&a; -} - -inline D3DXPLANE::operator CONST FLOAT* () const -{ - return (CONST FLOAT*)&a; -} - -inline D3DXPLANE D3DXPLANE::operator + () const -{ - return *this; -} - -inline D3DXPLANE D3DXPLANE::operator - () const -{ - return D3DXPLANE(-a, -b, -c, -d); -} - -inline BOOL D3DXPLANE::operator == (CONST D3DXPLANE& pl) const -{ - return a == pl.a && b == pl.b && c == pl.c && d == pl.d; -} - -inline BOOL D3DXPLANE::operator != (CONST D3DXPLANE& pl) const -{ - return a != pl.a || b != pl.b || c != pl.c || d != pl.d; -} - -inline D3DXCOLOR::D3DXCOLOR() -{ -} - -inline D3DXCOLOR::D3DXCOLOR(DWORD col) -{ - CONST FLOAT f = 1.0f / 255.0f; - r = f * (FLOAT)(unsigned char)(col >> 16); - g = f * (FLOAT)(unsigned char)(col >> 8); - b = f * (FLOAT)(unsigned char)col; - a = f * (FLOAT)(unsigned char)(col >> 24); -} - -inline D3DXCOLOR::D3DXCOLOR(CONST FLOAT *pf) -{ - if(!pf) return; - r = pf[0]; - g = pf[1]; - b = pf[2]; - a = pf[3]; -} - -inline D3DXCOLOR::D3DXCOLOR(CONST D3DCOLORVALUE& col) -{ - r = col.r; - g = col.g; - b = col.b; - a = col.a; -} - -inline D3DXCOLOR::D3DXCOLOR(FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa) -{ - r = fr; - g = fg; - b = fb; - a = fa; -} - -inline D3DXCOLOR::operator DWORD () const -{ - DWORD _r = r >= 1.0f ? 0xff : r <= 0.0f ? 0x00 : (DWORD)(r * 255.0f + 0.5f); - DWORD _g = g >= 1.0f ? 0xff : g <= 0.0f ? 0x00 : (DWORD)(g * 255.0f + 0.5f); - DWORD _b = b >= 1.0f ? 0xff : b <= 0.0f ? 0x00 : (DWORD)(b * 255.0f + 0.5f); - DWORD _a = a >= 1.0f ? 0xff : a <= 0.0f ? 0x00 : (DWORD)(a * 255.0f + 0.5f); - - return (_a << 24) | (_r << 16) | (_g << 8) | _b; -} - -inline D3DXCOLOR::operator FLOAT * () -{ - return (FLOAT*)&r; -} - -inline D3DXCOLOR::operator CONST FLOAT * () const -{ - return (CONST FLOAT*)&r; -} - -inline D3DXCOLOR::operator D3DCOLORVALUE * () -{ - return (D3DCOLORVALUE*)&r; -} - -inline D3DXCOLOR::operator CONST D3DCOLORVALUE * () const -{ - return (CONST D3DCOLORVALUE*)&r; -} - -inline D3DXCOLOR::operator D3DCOLORVALUE& () -{ - return *((D3DCOLORVALUE*)&r); -} - -inline D3DXCOLOR::operator CONST D3DCOLORVALUE& () const -{ - return *((CONST D3DCOLORVALUE*)&r); -} - -inline D3DXCOLOR& D3DXCOLOR::operator += (CONST D3DXCOLOR& col) -{ - r += col.r; - g += col.g; - b += col.b; - a += col.a; - return *this; -} - -inline D3DXCOLOR& D3DXCOLOR::operator -= (CONST D3DXCOLOR& col) -{ - r -= col.r; - g -= col.g; - b -= col.b; - a -= col.a; - return *this; -} - -inline D3DXCOLOR& D3DXCOLOR::operator *= (FLOAT f) -{ - r *= f; - g *= f; - b *= f; - a *= f; - return *this; -} - -inline D3DXCOLOR& D3DXCOLOR::operator /= (FLOAT f) -{ - FLOAT inv = 1.0f / f; - r *= inv; - g *= inv; - b *= inv; - a *= inv; - return *this; -} - -inline D3DXCOLOR D3DXCOLOR::operator + () const -{ - return *this; -} - -inline D3DXCOLOR D3DXCOLOR::operator - () const -{ - return D3DXCOLOR(-r, -g, -b, -a); -} - -inline D3DXCOLOR D3DXCOLOR::operator + (CONST D3DXCOLOR& col) const -{ - return D3DXCOLOR(r + col.r, g + col.g, b + col.b, a + col.a); -} - -inline D3DXCOLOR D3DXCOLOR::operator - (CONST D3DXCOLOR& col) const -{ - return D3DXCOLOR(r - col.r, g - col.g, b - col.b, a - col.a); -} - -inline D3DXCOLOR D3DXCOLOR::operator * (FLOAT f) const -{ - return D3DXCOLOR(r * f, g * f, b * f, a * f); -} - -inline D3DXCOLOR D3DXCOLOR::operator / (FLOAT f) const -{ - FLOAT inv = 1.0f / f; - return D3DXCOLOR(r * inv, g * inv, b * inv, a * inv); -} - -inline D3DXCOLOR operator * (FLOAT f, CONST D3DXCOLOR& col) -{ - return D3DXCOLOR(f * col.r, f * col.g, f * col.b, f * col.a); -} - -inline BOOL D3DXCOLOR::operator == (CONST D3DXCOLOR& col) const -{ - return r == col.r && g == col.g && b == col.b && a == col.a; -} - -inline BOOL D3DXCOLOR::operator != (CONST D3DXCOLOR& col) const -{ - return r != col.r || g != col.g || b != col.b || a != col.a; -} - -#endif /* __cplusplus */ - -/*_______________D3DXCOLOR_____________________*/ - -static inline D3DXCOLOR* D3DXColorAdd(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2) -{ - if ( !pout || !pc1 || !pc2 ) return NULL; - pout->r = (pc1->r) + (pc2->r); - pout->g = (pc1->g) + (pc2->g); - pout->b = (pc1->b) + (pc2->b); - pout->a = (pc1->a) + (pc2->a); - return pout; -} - -static inline D3DXCOLOR* D3DXColorLerp(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2, FLOAT s) -{ - if ( !pout || !pc1 || !pc2 ) return NULL; - pout->r = (1-s) * (pc1->r) + s *(pc2->r); - pout->g = (1-s) * (pc1->g) + s *(pc2->g); - pout->b = (1-s) * (pc1->b) + s *(pc2->b); - pout->a = (1-s) * (pc1->a) + s *(pc2->a); - return pout; -} - -static inline D3DXCOLOR* D3DXColorModulate(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2) -{ - if ( !pout || !pc1 || !pc2 ) return NULL; - pout->r = (pc1->r) * (pc2->r); - pout->g = (pc1->g) * (pc2->g); - pout->b = (pc1->b) * (pc2->b); - pout->a = (pc1->a) * (pc2->a); - return pout; -} - -static inline D3DXCOLOR* D3DXColorNegative(D3DXCOLOR *pout, CONST D3DXCOLOR *pc) -{ - if ( !pout || !pc ) return NULL; - pout->r = 1.0f - pc->r; - pout->g = 1.0f - pc->g; - pout->b = 1.0f - pc->b; - pout->a = pc->a; - return pout; -} - -static inline D3DXCOLOR* D3DXColorScale(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s) -{ - if ( !pout || !pc ) return NULL; - pout->r = s* (pc->r); - pout->g = s* (pc->g); - pout->b = s* (pc->b); - pout->a = s* (pc->a); - return pout; -} - -static inline D3DXCOLOR* D3DXColorSubtract(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2) -{ - if ( !pout || !pc1 || !pc2 ) return NULL; - pout->r = (pc1->r) - (pc2->r); - pout->g = (pc1->g) - (pc2->g); - pout->b = (pc1->b) - (pc2->b); - pout->a = (pc1->a) - (pc2->a); - return pout; -} - -/*_______________D3DXVECTOR2________________________*/ - -static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = pv1->x + pv2->x; - pout->y = pv1->y + pv2->y; - return pout; -} - -static inline FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) -{ - if ( !pv1 || !pv2) return 0.0f; - return ( (pv1->x) * (pv2->y) - (pv1->y) * (pv2->x) ); -} - -static inline FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) -{ - if ( !pv1 || !pv2) return 0.0f; - return ( (pv1->x * pv2->x + pv1->y * pv2->y) ); -} - -static inline FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv) -{ - if (!pv) return 0.0f; - return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); -} - -static inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv) -{ - if (!pv) return 0.0f; - return( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); -} - -static inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = (1-s) * (pv1->x) + s * (pv2->x); - pout->y = (1-s) * (pv1->y) + s * (pv2->y); - return pout; -} - -static inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = max(pv1->x , pv2->x); - pout->y = max(pv1->y , pv2->y); - return pout; -} - -static inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = min(pv1->x , pv2->x); - pout->y = min(pv1->y , pv2->y); - return pout; -} - -static inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s) -{ - if ( !pout || !pv) return NULL; - pout->x = s * (pv->x); - pout->y = s * (pv->y); - return pout; -} - -static inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = pv1->x - pv2->x; - pout->y = pv1->y - pv2->y; - return pout; -} - -/*__________________D3DXVECTOR3_______________________*/ - -static inline D3DXVECTOR3* D3DXVec3Add(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = pv1->x + pv2->x; - pout->y = pv1->y + pv2->y; - pout->z = pv1->z + pv2->z; - return pout; -} - -static inline D3DXVECTOR3* D3DXVec3Cross(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = (pv1->y) * (pv2->z) - (pv1->z) * (pv2->y); - pout->y = (pv1->z) * (pv2->x) - (pv1->x) * (pv2->z); - pout->z = (pv1->x) * (pv2->y) - (pv1->y) * (pv2->x); - return pout; -} - -static inline FLOAT D3DXVec3Dot(CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) -{ - if ( !pv1 || !pv2 ) return 0.0f; - return (pv1->x) * (pv2->x) + (pv1->y) * (pv2->y) + (pv1->z) * (pv2->z); -} - -static inline FLOAT D3DXVec3Length(CONST D3DXVECTOR3 *pv) -{ - if (!pv) return 0.0f; - return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) + (pv->z) * (pv->z) ); -} - -static inline FLOAT D3DXVec3LengthSq(CONST D3DXVECTOR3 *pv) -{ - if (!pv) return 0.0f; - return (pv->x) * (pv->x) + (pv->y) * (pv->y) + (pv->z) * (pv->z); -} - -static inline D3DXVECTOR3* D3DXVec3Lerp(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, FLOAT s) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = (1-s) * (pv1->x) + s * (pv2->x); - pout->y = (1-s) * (pv1->y) + s * (pv2->y); - pout->z = (1-s) * (pv1->z) + s * (pv2->z); - return pout; -} - -static inline D3DXVECTOR3* D3DXVec3Maximize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = max(pv1->x , pv2->x); - pout->y = max(pv1->y , pv2->y); - pout->z = max(pv1->z , pv2->z); - return pout; -} - -static inline D3DXVECTOR3* D3DXVec3Minimize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = min(pv1->x , pv2->x); - pout->y = min(pv1->y , pv2->y); - pout->z = min(pv1->z , pv2->z); - return pout; -} - -static inline D3DXVECTOR3* D3DXVec3Scale(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, FLOAT s) -{ - if ( !pout || !pv) return NULL; - pout->x = s * (pv->x); - pout->y = s * (pv->y); - pout->z = s * (pv->z); - return pout; -} - -static inline D3DXVECTOR3* D3DXVec3Subtract(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = pv1->x - pv2->x; - pout->y = pv1->y - pv2->y; - pout->z = pv1->z - pv2->z; - return pout; -} -/*__________________D3DXVECTOR4_______________________*/ - -static inline D3DXVECTOR4* D3DXVec4Add(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = pv1->x + pv2->x; - pout->y = pv1->y + pv2->y; - pout->z = pv1->z + pv2->z; - pout->w = pv1->w + pv2->w; - return pout; -} - -static inline FLOAT D3DXVec4Dot(CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) -{ - if (!pv1 || !pv2 ) return 0.0f; - return (pv1->x) * (pv2->x) + (pv1->y) * (pv2->y) + (pv1->z) * (pv2->z) + (pv1->w) * (pv2->w); -} - -static inline FLOAT D3DXVec4Length(CONST D3DXVECTOR4 *pv) -{ - if (!pv) return 0.0f; - return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) + (pv->z) * (pv->z) + (pv->w) * (pv->w) ); -} - -static inline FLOAT D3DXVec4LengthSq(CONST D3DXVECTOR4 *pv) -{ - if (!pv) return 0.0f; - return (pv->x) * (pv->x) + (pv->y) * (pv->y) + (pv->z) * (pv->z) + (pv->w) * (pv->w); -} - -static inline D3DXVECTOR4* D3DXVec4Lerp(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, FLOAT s) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = (1-s) * (pv1->x) + s * (pv2->x); - pout->y = (1-s) * (pv1->y) + s * (pv2->y); - pout->z = (1-s) * (pv1->z) + s * (pv2->z); - pout->w = (1-s) * (pv1->w) + s * (pv2->w); - return pout; -} - - -static inline D3DXVECTOR4* D3DXVec4Maximize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = max(pv1->x , pv2->x); - pout->y = max(pv1->y , pv2->y); - pout->z = max(pv1->z , pv2->z); - pout->w = max(pv1->w , pv2->w); - return pout; -} - -static inline D3DXVECTOR4* D3DXVec4Minimize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = min(pv1->x , pv2->x); - pout->y = min(pv1->y , pv2->y); - pout->z = min(pv1->z , pv2->z); - pout->w = min(pv1->w , pv2->w); - return pout; -} - -static inline D3DXVECTOR4* D3DXVec4Scale(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv, FLOAT s) -{ - if ( !pout || !pv) return NULL; - pout->x = s * (pv->x); - pout->y = s * (pv->y); - pout->z = s * (pv->z); - pout->w = s * (pv->w); - return pout; -} - -static inline D3DXVECTOR4* D3DXVec4Subtract(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) -{ - if ( !pout || !pv1 || !pv2) return NULL; - pout->x = pv1->x - pv2->x; - pout->y = pv1->y - pv2->y; - pout->z = pv1->z - pv2->z; - pout->w = pv1->w - pv2->w; - return pout; -} - -/*__________________D3DXMatrix____________________*/ -#ifdef NONAMELESSUNION -# define D3DX_U(x) (x).u -#else -# define D3DX_U(x) (x) -#endif - -static inline D3DXMATRIX* D3DXMatrixIdentity(D3DXMATRIX *pout) -{ - if ( !pout ) return NULL; - D3DX_U(*pout).m[0][1] = 0.0f; - D3DX_U(*pout).m[0][2] = 0.0f; - D3DX_U(*pout).m[0][3] = 0.0f; - D3DX_U(*pout).m[1][0] = 0.0f; - D3DX_U(*pout).m[1][2] = 0.0f; - D3DX_U(*pout).m[1][3] = 0.0f; - D3DX_U(*pout).m[2][0] = 0.0f; - D3DX_U(*pout).m[2][1] = 0.0f; - D3DX_U(*pout).m[2][3] = 0.0f; - D3DX_U(*pout).m[3][0] = 0.0f; - D3DX_U(*pout).m[3][1] = 0.0f; - D3DX_U(*pout).m[3][2] = 0.0f; - D3DX_U(*pout).m[0][0] = 1.0f; - D3DX_U(*pout).m[1][1] = 1.0f; - D3DX_U(*pout).m[2][2] = 1.0f; - D3DX_U(*pout).m[3][3] = 1.0f; - return pout; -} - -static inline BOOL D3DXMatrixIsIdentity(D3DXMATRIX *pm) -{ - int i,j; - D3DXMATRIX testmatrix; - - if ( !pm ) return FALSE; - D3DXMatrixIdentity(&testmatrix); - for (i=0; i<4; i++) - { - for (j=0; j<4; j++) - { - if ( D3DX_U(*pm).m[i][j] != D3DX_U(testmatrix).m[i][j] ) return FALSE; - } - } - return TRUE; -} -#undef D3DX_U - -/*__________________D3DXPLANE____________________*/ - -static inline FLOAT D3DXPlaneDot(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv) -{ - if ( !pp || !pv ) return 0.0f; - return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) + (pp->d) * (pv->w) ); -} - -static inline FLOAT D3DXPlaneDotCoord(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv) -{ - if ( !pp || !pv ) return 0.0f; - return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) + (pp->d) ); -} - -static inline FLOAT D3DXPlaneDotNormal(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv) -{ - if ( !pp || !pv ) return 0.0f; - return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) ); -} - -/*__________________D3DXQUATERNION____________________*/ - -static inline D3DXQUATERNION* D3DXQuaternionConjugate(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) -{ - if ( !pout || !pq) return NULL; - pout->x = -pq->x; - pout->y = -pq->y; - pout->z = -pq->z; - pout->w = pq->w; - return pout; -} - -static inline FLOAT D3DXQuaternionDot(CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2) -{ - if ( !pq1 || !pq2 ) return 0.0f; - return (pq1->x) * (pq2->x) + (pq1->y) * (pq2->y) + (pq1->z) * (pq2->z) + (pq1->w) * (pq2->w); -} - -static inline D3DXQUATERNION* D3DXQuaternionIdentity(D3DXQUATERNION *pout) -{ - if ( !pout) return NULL; - pout->x = 0.0f; - pout->y = 0.0f; - pout->z = 0.0f; - pout->w = 1.0f; - return pout; -} - -static inline BOOL D3DXQuaternionIsIdentity(D3DXQUATERNION *pq) -{ - if ( !pq) return FALSE; - return ( (pq->x == 0.0f) && (pq->y == 0.0f) && (pq->z == 0.0f) && (pq->w == 1.0f) ); -} - -static inline FLOAT D3DXQuaternionLength(CONST D3DXQUATERNION *pq) -{ - if (!pq) return 0.0f; - return sqrt( (pq->x) * (pq->x) + (pq->y) * (pq->y) + (pq->z) * (pq->z) + (pq->w) * (pq->w) ); -} - -static inline FLOAT D3DXQuaternionLengthSq(CONST D3DXQUATERNION *pq) -{ - if (!pq) return 0.0f; - return (pq->x) * (pq->x) + (pq->y) * (pq->y) + (pq->z) * (pq->z) + (pq->w) * (pq->w); -} - -#endif diff --git a/include/d3dx8mesh.h b/include/d3dx8mesh.h deleted file mode 100644 index 7f9262d0680..00000000000 --- a/include/d3dx8mesh.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2008 Francois Gouget - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_D3DX8MESH_H -#define __WINE_D3DX8MESH_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT WINAPI D3DXCreateBuffer(DWORD,LPD3DXBUFFER*); -UINT WINAPI D3DXGetFVFVertexSize(DWORD); -BOOL WINAPI D3DXBoxBoundProbe(CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *); -BOOL WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *,FLOAT,CONST D3DXVECTOR3 *,CONST D3DXVECTOR3 *); -BOOL CDECL D3DXIntersectTri(CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, FLOAT *, FLOAT *, FLOAT *); -HRESULT WINAPI D3DXComputeBoundingBox(PVOID, DWORD, DWORD, D3DXVECTOR3 *, D3DXVECTOR3 *); -HRESULT WINAPI D3DXComputeBoundingSphere(PVOID, DWORD, DWORD, D3DXVECTOR3 *, FLOAT *); - -#ifdef __cplusplus -} -#endif - -#endif /* __WINE_D3DX8MESH_H */ diff --git a/include/d3dx9math.h b/include/d3dx9math.h index 83b87493a5a..f842e3ece3f 100644 --- a/include/d3dx9math.h +++ b/include/d3dx9math.h @@ -30,6 +30,8 @@ #define D3DXToRadian(degree) ((degree) * (D3DX_PI / 180.0f)) #define D3DXToDegree(radian) ((radian) * (180.0f / D3DX_PI)) + + typedef struct D3DXVECTOR2 { #ifdef __cplusplus @@ -266,9 +268,11 @@ extern "C" { D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s); D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s); -D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, float scaling, D3DXVECTOR3 *rotationcenter, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation); +FLOAT WINAPI D3DXFresnelTerm(FLOAT costheta, FLOAT refractionindex); + +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR3 *rotationcenter, CONST D3DXQUATERNION *rotation, CONST D3DXVECTOR3 *translation); D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, CONST D3DXVECTOR2 *ptranslation); -HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutrotation, D3DXVECTOR3 *pouttranslation, D3DXMATRIX *pm); +HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutrotation, D3DXVECTOR3 *pouttranslation, CONST D3DXMATRIX *pm); FLOAT WINAPI D3DXMatrixDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup); @@ -358,6 +362,71 @@ D3DXVECTOR4* WINAPI D3DXVec4TransformArray(D3DXVECTOR4 *pout, UINT outstride, CO } #endif +typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK; + +DEFINE_GUID(IID_ID3DXMatrixStack, +0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85); + +#undef INTERFACE +#define INTERFACE ID3DXMatrixStack + +DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(Pop)(THIS) PURE; + STDMETHOD(Push)(THIS) PURE; + STDMETHOD(LoadIdentity)(THIS) PURE; + STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE; + STDMETHOD(RotateAxis)(THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + STDMETHOD(RotateAxisLocal)(THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + STDMETHOD(RotateYawPitchRoll)(THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + STDMETHOD(RotateYawPitchRollLocal)(THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE; + STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE; +}; + +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define ID3DXMatrixStack_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define ID3DXMatrixStack_AddRef(p) (p)->lpVtbl->AddRef(p) +#define ID3DXMatrixStack_Release(p) (p)->lpVtbl->Release(p) +#define ID3DXMatrixStack_Pop(p) (p)->lpVtbl->Pop(p) +#define ID3DXMatrixStack_Push(p) (p)->lpVtbl->Push(p) +#define ID3DXMatrixStack_LoadIdentity(p) (p)->lpVtbl->LoadIdentity(p) +#define ID3DXMatrixStack_LoadMatrix(p,a) (p)->lpVtbl->LoadMatrix(p,a) +#define ID3DXMatrixStack_MultMatrix(p,a) (p)->lpVtbl->MultMatrix(p,a) +#define ID3DXMatrixStack_MultMatrixLocal(p,a) (p)->lpVtbl->MultMatrixLocal(p,a) +#define ID3DXMatrixStack_RotateAxis(p,a,b) (p)->lpVtbl->RotateAxis(p,a,b) +#define ID3DXMatrixStack_RotateAxisLocal(p,a,b) (p)->lpVtbl->RotateAxisLocal(p,a,b) +#define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c) (p)->lpVtbl->RotateYawPitchRoll(p,a,b,c) +#define ID3DXMatrixStack_RotateYawPitchRollLocal(p,a,b,c) (p)->lpVtbl->RotateYawPitchRollLocal(p,a,b,c) +#define ID3DXMatrixStack_Scale(p,a,b,c) (p)->lpVtbl->Scale(p,a,b,c) +#define ID3DXMatrixStack_ScaleLocal(p,a,b,c) (p)->lpVtbl->ScaleLocal(p,a,b,c) +#define ID3DXMatrixStack_Translate(p,a,b,c) (p)->lpVtbl->Translate(p,a,b,c) +#define ID3DXMatrixStack_TranslateLocal(p,a,b,c) (p)->lpVtbl->TranslateLocal(p,a,b,c) +#define ID3DXMatrixStack_GetTop(p) (p)->lpVtbl->GetTop(p) + +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +HRESULT WINAPI D3DXCreateMatrixStack(DWORD flags, LPD3DXMATRIXSTACK* ppstack); + +#ifdef __cplusplus +} +#endif + #include #endif /* __D3DX9MATH_H__ */ diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 0c1e54f6bb2..2ee24bdbc38 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -409,6 +409,7 @@ GpStatus WINGDIPAPI GdipGetLineBlendCount(GpLineGradient*,INT*); GpStatus WINGDIPAPI GdipSetLineColors(GpLineGradient*,ARGB,ARGB); GpStatus WINGDIPAPI GdipSetLineGammaCorrection(GpLineGradient*,BOOL); GpStatus WINGDIPAPI GdipSetLineSigmaBlend(GpLineGradient*,REAL,REAL); +GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient*,REAL,REAL); GpStatus WINGDIPAPI GdipSetLineWrapMode(GpLineGradient*,GpWrapMode); /* Matrix */ diff --git a/include/netcon.idl b/include/netcon.idl new file mode 100644 index 00000000000..eecc1d2af3e --- /dev/null +++ b/include/netcon.idl @@ -0,0 +1,412 @@ +/* + * Copyright 2009 Jacek Caban for CodeWeavers + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef DO_NO_IMPORTS +import "oaidl.idl"; +import "unknwn.idl"; +import "wtypes.idl"; +/* import "prsht.idl"; */ +#endif + +cpp_quote("DEFINE_GUID(CLSID_NetSharingManager,0x5c63c1ad,0x3956,0x4ff8,0x84,0x86,0x40,0x03,0x47,0x58,0x31,0x5b);") + +[ + object, + uuid(c08956a1-1cd3-11d1-b1c5-00805fc1270e), + pointer_default(unique) +] +interface INetConnection : IUnknown +{ + typedef enum tagNETCON_CHARACTERISTIC_FLAGS + { + NCCF_NONE = 0x0000, + NCCF_ALL_USERS = 0x0001, + NCCF_ALLOW_DUPLICATION = 0x0002, + NCCF_ALLOW_REMOVAL = 0x0004, + NCCF_ALLOW_RENAME = 0x0008, + NCCF_INCOMING_ONLY = 0x0020, + NCCF_OUTGOING_ONLY = 0x0040, + NCCF_BRANDED = 0x0080, + NCCF_SHARED = 0x0100, + NCCF_BRIDGED = 0x0200, + NCCF_FIREWALLED = 0x0400, + NCCF_DEFAULT = 0x0800, + NCCF_HOMENET_CAPABLE = 0x1000, + NCCF_SHARED_PRIVATE = 0x2000, + NCCF_QUARANTINED = 0x4000, + NCCF_RESERVED = 0x8000, + NCCF_BLUETOOTH_MASK = 0x000F0000, + NCCF_LAN_MASK = 0x00F00000 + } NETCON_CHARACTERISTIC_FLAGS; + + typedef enum tagNETCON_STATUS + { + NCS_DISCONNECTED, + NCS_CONNECTING, + NCS_CONNECTED, + NCS_DISCONNECTING, + NCS_HARDWARE_NOT_PRESENT, + NCS_HARDWARE_DISABLED, + NCS_HARDWARE_MALFUNCTION, + NCS_MEDIA_DISCONNECTED, + NCS_AUTHENTICATING, + NCS_AUTHENTICATION_SUCCEEDED, + NCS_AUTHENTICATION_FAILED, + NCS_INVALID_ADDRESS, + NCS_CREDENTIALS_REQUIRED + } NETCON_STATUS; + + typedef enum tagNETCON_TYPE + { + NCT_DIRECT_CONNECT, + NCT_INBOUND, + NCT_INTERNET, + NCT_LAN, + NCT_PHONE, + NCT_TUNNEL, + NCT_BRIDGE + } NETCON_TYPE; + + typedef enum tagNETCON_MEDIATYPE + { + NCM_NONE, + NCM_DIRECT, + NCM_ISDN, + NCM_LAN, + NCM_PHONE, + NCM_TUNNEL, + NCM_PPPOE, + NCM_BRIDGE, + NCM_SHAREDACCESSHOST_LAN, + NCM_SHAREDACCESSHOST_RAS + } NETCON_MEDIATYPE; + + typedef struct tagNETCON_PROPERTIES + { + GUID guidId; + [string] LPWSTR pszwName; + [string] LPWSTR pszwDeviceName; + NETCON_STATUS Status; + NETCON_MEDIATYPE MediaType; + DWORD dwCharacter; + CLSID clsidThisObject; + CLSID clsidUiObject; + } NETCON_PROPERTIES; + + HRESULT Connect(); + + HRESULT Disconnect(); + + HRESULT Delete(); + + HRESULT Duplicate( + [in, string] LPCWSTR pszwDuplicateName, + [out] INetConnection **ppCon); + + HRESULT GetProperties([out] NETCON_PROPERTIES **ppProps); + + HRESULT GetUiObjectClassId([out, ref] CLSID *pclsid); + + HRESULT Rename([in, string] LPCWSTR pszwNewName); +} + +[ + object, + uuid(24b7e9b5-e38f-4685-851b-00892cf5f940), + oleautomation, + dual, + pointer_default(unique) +] +interface INetSharingPortMappingProps : IDispatch +{ + [propget, id(1)] + HRESULT Name([out, retval] BSTR *pbstrName); + + [propget, id(2)] + HRESULT IPProtocol([out, retval] UCHAR *pucIPProt); + + [propget, id(3)] + HRESULT ExternalPort([out, retval] long *pusPort); + + [propget, id(4)] + HRESULT InternalPort([out, retval] long *pusPort); + + [propget, id(5)] + HRESULT Options([out, retval] long *pdwOptions); + + [propget, id(6)] + HRESULT TargetName([out, retval] BSTR *pbstrTargetName); + + [propget, id(7)] + HRESULT TargetIPAddress([out, retval] BSTR *pbstrTargetIPAddress); + + [propget, id(8)] + HRESULT Enabled([out, retval] VARIANT_BOOL *pbool); +} + +[ + object, + uuid(c08956b1-1cd3-11d1-b1c5-00805fc1270e), + oleautomation, + dual, + pointer_default(unique) +] +interface INetSharingPortMapping : IDispatch +{ + [id(1)] + HRESULT Disable(); + + [id(2)] + HRESULT Enable(); + + [propget, id(3)] + HRESULT Properties([out, retval] INetSharingPortMappingProps **ppNSPMP); + + [id(4)] + HRESULT Delete(); +}; +[ + object, + uuid(02e4a2de-da20-4e34-89c8-ac22275a010b), + oleautomation, + dual, + pointer_default(unique) +] +interface INetSharingPortMappingCollection : IDispatch +{ + [propget, id(DISPID_NEWENUM), restricted] + HRESULT _NewEnum([out, retval] IUnknown **pVal); + + [propget, id(1)] + HRESULT Count([out, retval] long *pVal); +} + +[ + object, + uuid(c08956b6-1cd3-11d1-b1c5-00805fc1270e), + oleautomation, + dual, + pointer_default(unique) +] +interface INetSharingConfiguration : IDispatch +{ + typedef enum tagSHARINGCONNECTIONTYPE { + ICSSHARINGTYPE_PUBLIC, + ICSSHARINGTYPE_PRIVATE + } SHARINGCONNECTIONTYPE, *LPSHARINGCONNECTIONTYPE; + + typedef enum tagSHARINGCONNECTION_ENUM_FLAGS { + ICSSC_DEFAULT, + ICSSC_ENABLED + } SHARINGCONNECTION_ENUM_FLAGS; + + typedef enum tagICS_TARGETTYPE { + ICSTT_NAME, + ICSTT_IPADDRESS + }ICS_TARGETTYPE; + + [propget, id(1)] + HRESULT SharingEnabled([out, retval] VARIANT_BOOL *pbEnabled); + + [propget, id(2)] + HRESULT SharingConnectionType([out, retval] SHARINGCONNECTIONTYPE *pType); + + [id(3)] + HRESULT DisableSharing(); + + [id(4)] + HRESULT EnableSharing([in] SHARINGCONNECTIONTYPE Type); + + [propget, id(5)] + HRESULT InternetFirewallEnabled([out, retval] VARIANT_BOOL *pbEnabled); + + [id(6)] + HRESULT DisableInternetFirewall(); + + [id(7)] + HRESULT EnableInternetFirewall(); + + [propget, id(8)] + HRESULT EnumPortMappings( + [in] SHARINGCONNECTION_ENUM_FLAGS Flags, + [out, retval] INetSharingPortMappingCollection **ppColl); + + [id(9)] + HRESULT AddPortMapping( + [in] BSTR bstrName, + [in] UCHAR ucIPProtocol, + [in] USHORT usExternalPort, + [in] USHORT usInternalPort, + [in] DWORD dwOptions, + [in] BSTR bstrTargetNameOrIPAddress, + [in] ICS_TARGETTYPE eTargetType, + [out, retval] INetSharingPortMapping **ppMapping ); + + [id(10)] + HRESULT RemovePortMapping([in] INetSharingPortMapping *pMapping); +} + +[ + object, + uuid(c08956b4-1cd3-11d1-b1c5-00805fc1270e), + pointer_default(unique) +] +interface IEnumNetSharingPublicConnection : IUnknown +{ + HRESULT Next( + [in] ULONG celt, + [out, size_is(celt), length_is(*pceltFetched)] VARIANT *rgVar, + [out] ULONG *pceltFetched); + + HRESULT Skip([in] ULONG celt); + + HRESULT Reset(); + + HRESULT Clone([out] IEnumNetSharingPublicConnection **ppenum); +} + +[ + object, + uuid(c08956b5-1cd3-11d1-b1c5-00805fc1270e), + pointer_default(unique) +] +interface IEnumNetSharingPrivateConnection : IUnknown +{ + HRESULT Next( + [in] ULONG celt, + [out, size_is(celt), length_is(*pCeltFetched)] VARIANT *rgVar, + [out] ULONG *pCeltFetched); + + HRESULT Skip([in] ULONG celt); + + HRESULT Reset(); + + HRESULT Clone([out] IEnumNetSharingPrivateConnection **ppenum); +} + +[ + object, + uuid(f4277c95-ce5b-463d-8167-5662d9bcaa72), + oleautomation, + dual, + pointer_default(unique) +] +interface INetConnectionProps : IDispatch +{ + [propget, id(1)] + HRESULT Guid([out, retval] BSTR *pbstrGuid); + + [propget, id(2)] + HRESULT Name([out, retval] BSTR *pbstrName); + + [propget, id(3)] + HRESULT DeviceName([out, retval] BSTR *pbstrDeviceName); + + [propget, id(4)] + HRESULT Status([out, retval] NETCON_STATUS *pStatus); + + [propget, id(5)] + HRESULT MediaType([out, retval] NETCON_MEDIATYPE *pMediaType); + + [propget, id(6)] + HRESULT Characteristics([out, retval] DWORD *pdwFlags); +} + +[ + object, + uuid(7d7a6355-f372-4971-a149-bfc927be762a), + oleautomation, + dual, + pointer_default(unique) +] +interface INetSharingPublicConnectionCollection : IDispatch +{ + [propget, id(DISPID_NEWENUM), restricted] + HRESULT _NewEnum([out, retval] IUnknown **pVal); + + [propget, id(1)] + HRESULT Count([out, retval] long *pVal); +} + +[ + object, + uuid(33c4643c-7811-46fa-a89a-768597bd7223), + oleautomation, + dual, + pointer_default(unique) + ] +interface INetSharingEveryConnectionCollection : IDispatch +{ + [propget, id(DISPID_NEWENUM), restricted] + HRESULT _NewEnum([out, retval] IUnknown **pVal); + + [propget, id(1)] + HRESULT Count([out, retval] long *pVal); +} + +[ + object, + uuid(38ae69e0-4409-402a-a2cb-e965c727f840), + oleautomation, + dual, + pointer_default(unique) + ] +interface INetSharingPrivateConnectionCollection : IDispatch +{ + [propget, id(DISPID_NEWENUM), restricted] + HRESULT _NewEnum([out, retval] IUnknown **pVal); + + [propget, id(1)] + HRESULT Count([out, retval] long *pVal); +} + +[ + object, + uuid(c08956b7-1cd3-11d1-b1c5-00805fc1270e), + oleautomation, + dual, + pointer_default(unique) +] +interface INetSharingManager : IDispatch +{ + [propget, id(1)] + HRESULT SharingInstalled([out, retval] VARIANT_BOOL *pbInstalled); + + [propget, id(2)] + HRESULT EnumPublicConnections( + [in] SHARINGCONNECTION_ENUM_FLAGS Flags, + [out, retval] INetSharingPublicConnectionCollection **ppColl); + + [propget, id(3)] + HRESULT EnumPrivateConnections( + [in] SHARINGCONNECTION_ENUM_FLAGS Flags, + [out, retval] INetSharingPrivateConnectionCollection **ppColl); + + [propget, id(6)] + HRESULT INetSharingConfigurationForINetConnection( + [in] INetConnection *pNetConnection, + [out, retval] INetSharingConfiguration **ppNetSharingConfiguration); + + [propget, id(7)] + HRESULT EnumEveryConnection([out, retval] INetSharingEveryConnectionCollection **ppColl); + + [propget, id(8)] + HRESULT NetConnectionProps( + [in] INetConnection *pNetConnection, + [out, retval] INetConnectionProps **ppProps); +} diff --git a/include/ntddndis.h b/include/ntddndis.h new file mode 100644 index 00000000000..44566e861e9 --- /dev/null +++ b/include/ntddndis.h @@ -0,0 +1,168 @@ +/* + * Copyright 2009 Jacek Caban for CodeWeavers + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef _NTDDNDIS_ +#define _NTDDNDIS_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* #include */ +/* #include */ +/* #include */ + +#define _NDIS_CONTROL_CODE(request, method) \ + CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD, request, method, FILE_ANY_ACCESS) + +#define IOCTL_NDIS_QUERY_GLOBAL_STATS _NDIS_CONTROL_CODE(0, METHOD_OUT_DIRECT) +#define IOCTL_NDIS_QUERY_ALL_STATS _NDIS_CONTROL_CODE(1, METHOD_OUT_DIRECT) +#define IOCTL_NDIS_DO_PNP_OPERATION _NDIS_CONTROL_CODE(2, METHOD_BUFFERED) +#define IOCTL_NDIS_QUERY_SELECTED_STATS _NDIS_CONTROL_CODE(3, METHOD_OUT_DIRECT) +#define IOCTL_NDIS_ENUMERATE_INTERFACES _NDIS_CONTROL_CODE(4, METHOD_BUFFERED) +#define IOCTL_NDIS_ADD_TDI_DEVICE _NDIS_CONTROL_CODE(5, METHOD_BUFFERED) +#define IOCTL_NDIS_GET_LOG_DATA _NDIS_CONTROL_CODE(7, METHOD_OUT_DIRECT) +#define IOCTL_NDIS_GET_VERSION _NDIS_CONTROL_CODE(8, METHOD_BUFFERED) + +#define IOCTL_NDIS_RESERVED1 _NDIS_CONTROL_CODE(0x09, METHOD_BUFFERED) +#define IOCTL_NDIS_RESERVED2 _NDIS_CONTROL_CODE(0x0a, METHOD_BUFFERED) +#define IOCTL_NDIS_RESERVED3 _NDIS_CONTROL_CODE(0x0b, METHOD_BUFFERED) +#define IOCTL_NDIS_RESERVED4 _NDIS_CONTROL_CODE(0x0c, METHOD_BUFFERED) +#define IOCTL_NDIS_RESERVED5 CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD, 0x0d, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_NDIS_RESERVED6 CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD, 0x0e, METHOD_BUFFERED, FILE_WRITE_ACCESS) +#define IOCTL_NDIS_RESERVED7 _NDIS_CONTROL_CODE(0x0f, METHOD_OUT_DIRECT) +#define IOCTL_NDIS_RESERVED8 _NDIS_CONTROL_CODE(0x10, METHOD_BUFFERED) +#define IOCTL_NDIS_RESERVED9 _NDIS_CONTROL_CODE(0x11, METHOD_BUFFERED) +#define IOCTL_NDIS_RESERVED10 _NDIS_CONTROL_CODE(0x12, METHOD_BUFFERED) +#define IOCTL_NDIS_RESERVED11 _NDIS_CONTROL_CODE(0x13, METHOD_BUFFERED) +#define IOCTL_NDIS_RESERVED12 _NDIS_CONTROL_CODE(0x14, METHOD_BUFFERED) +#define IOCTL_NDIS_RESERVED13 _NDIS_CONTROL_CODE(0x15, METHOD_BUFFERED) + + +#define OID_802_11_BSSID 0x0d010101 +#define OID_802_11_SSID 0x0d010102 +#define OID_802_11_NETWORK_TYPES_SUPPORTED 0x0d010203 +#define OID_802_11_NETWORK_TYPE_IN_USE 0x0d010204 +#define OID_802_11_TX_POWER_LEVEL 0x0d010205 +#define OID_802_11_RSSI 0x0d010206 +#define OID_802_11_RSSI_TRIGGER 0x0d010207 +#define OID_802_11_INFRASTRUCTURE_MODE 0x0d010108 +#define OID_802_11_FRAGMENTATION_THRESHOLD 0x0d010209 +#define OID_802_11_RTS_THRESHOLD 0x0d01020a +#define OID_802_11_NUMBER_OF_ANTENNAS 0x0d01020b +#define OID_802_11_RX_ANTENNA_SELECTED 0x0d01020c +#define OID_802_11_TX_ANTENNA_SELECTED 0x0d01020d +#define OID_802_11_SUPPORTED_RATES 0x0d01020e +#define OID_802_11_DESIRED_RATES 0x0d010210 +#define OID_802_11_CONFIGURATION 0x0d010211 +#define OID_802_11_STATISTICS 0x0d020212 +#define OID_802_11_ADD_WEP 0x0d010113 +#define OID_802_11_REMOVE_WEP 0x0d010114 +#define OID_802_11_DISASSOCIATE 0x0d010115 +#define OID_802_11_POWER_MODE 0x0d010216 +#define OID_802_11_BSSID_LIST 0x0d010217 +#define OID_802_11_AUTHENTICATION_MODE 0x0d010118 +#define OID_802_11_PRIVACY_FILTER 0x0d010119 +#define OID_802_11_BSSID_LIST_SCAN 0x0d01011a +#define OID_802_11_WEP_STATUS 0x0d01011b +#define OID_802_11_ENCRYPTION_STATUS OID_802_11_WEP_STATUS +#define OID_802_11_RELOAD_DEFAULTS 0x0d01011c +#define OID_802_11_ADD_KEY 0x0d01011d +#define OID_802_11_REMOVE_KEY 0x0d01011e +#define OID_802_11_ASSOCIATION_INFORMATION 0x0d01011f +#define OID_802_11_TEST 0x0d010120 +#define OID_802_11_MEDIA_STREAM_MODE 0x0d010121 +#define OID_802_11_CAPABILITY 0x0d010122 +#define OID_802_11_PMKID 0x0d010123 +#define OID_802_11_NON_BCAST_SSID_LIST 0x0d010124 +#define OID_802_11_RADIO_STATUS 0x0d010125 + +#define NDIS_802_11_LENGTH_SSID 32 +#define NDIS_802_11_LENGTH_RATES 8 +#define NDIS_802_11_LENGTH_RATES_EX 16 + +typedef LONG NDIS_802_11_RSSI; + +typedef struct _NDIS_802_11_CONFIGURATION_FH { + ULONG Length; + ULONG HopPattern; + ULONG HopSet; + ULONG DwellTime; +} NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH; + +typedef struct _NDIS_802_11_CONFIGURATION { + ULONG Length; + ULONG BeaconPeriod; + ULONG ATIMWindow; + ULONG DSConfig; + NDIS_802_11_CONFIGURATION_FH FHConfig; +} NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION; + +typedef UCHAR NDIS_802_11_MAC_ADDRESS[6]; + +typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE { + Ndis802_11IBSS, + Ndis802_11Infrastructure, + Ndis802_11AutoUnknown, + Ndis802_11InfrastructureMax +} NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE; + +typedef enum _NDIS_802_11_NETWORK_TYPE { + Ndis802_11FH, + Ndis802_11DS, + Ndis802_11OFDM5, + Ndis802_11OFDM24, + Ndis802_11Automode, + Ndis802_11NetworkTypeMax +} NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE; + +typedef UCHAR NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; +typedef UCHAR NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; + +typedef struct _NDIS_802_11_SSID { + ULONG SsidLength; + UCHAR Ssid[NDIS_802_11_LENGTH_SSID]; +} NDIS_802_11_SSID, *PNDIS_802_11_SSID; + +typedef struct _NDIS_WLAN_BSSID { + ULONG Length; + NDIS_802_11_MAC_ADDRESS MacAddress; + UCHAR Reserved[2]; + NDIS_802_11_SSID Ssid; + ULONG Privacy; + NDIS_802_11_RSSI Rssi; + NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; + NDIS_802_11_CONFIGURATION Configuration; + NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; + NDIS_802_11_RATES SupportedRates; +} NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID; + +typedef struct _NDIS_802_11_BSSID_LIST { + ULONG NumberOfItems; + NDIS_WLAN_BSSID Bssid[1]; +} NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST; + +#ifndef _NDIS_ +typedef int NDIS_STATUS, *PNDIS_STATUS; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _NTDDNDIS_ */ diff --git a/include/d3dx8.h b/include/t2embapi.h similarity index 54% rename from include/d3dx8.h rename to include/t2embapi.h index 0ae27c3a52e..f1997647d09 100644 --- a/include/d3dx8.h +++ b/include/t2embapi.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 David Adam + * Copyright (c) 2009 Andrew Nguyen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,17 +16,31 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __D3DX8_H__ -#define __D3DX8_H__ +#ifndef __WINE_T2EMBAPI_H +#define __WINE_T2EMBAPI_H -#include -#include +#ifdef __cplusplus +extern "C" { +#endif + +/* Possible return values. */ +#define E_NONE 0x0000L +#define E_API_NOTIMPL 0x0001L + +typedef ULONG (WINAPIV * READEMBEDPROC)(void*,void*,ULONG); -#include -#include -/* FIXME: #include */ -#include -/* FIXME: #include */ -/* FIXME: #include */ +typedef struct +{ + unsigned short usStructSize; + unsigned short usRefStrSize; + unsigned short *pusRefStr; +} TTLOADINFO; + +LONG WINAPI TTLoadEmbeddedFont(HANDLE*,ULONG,ULONG*,ULONG,ULONG*,READEMBEDPROC, + LPVOID,LPWSTR,LPSTR,TTLOADINFO*); + +#ifdef __cplusplus +} +#endif #endif diff --git a/include/wbemcli.idl b/include/wbemcli.idl new file mode 100644 index 00000000000..b2ac6c1d988 --- /dev/null +++ b/include/wbemcli.idl @@ -0,0 +1,211 @@ +/* + * Copyright 2009 Hans Leidekker for CodeWeavers + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +cpp_quote("DEFINE_GUID(CLSID_WbemLocator, 0x4590f811,0x1d3A,0x11d0,0x89,0x1f,0x00,0xaa,0x00,0x4b,0x2e,0x24);") +cpp_quote("DEFINE_GUID(CLSID_WbemStatusCode, 0xeb87e1bd,0x3233,0x11d2,0xae,0xc9,0x00,0xc0,0x4f,0xb6,0x88,0x20);") + +import "objidl.idl"; + +interface IWbemContext; +interface IWbemServices; +interface IWbemStatusCodeText; + +typedef [v1_enum] enum tag_WBEMSTATUS +{ + WBEM_NO_ERROR = 0, + WBEM_S_NO_ERROR = 0, + WBEM_S_SAME = 0, + WBEM_S_FALSE = 1, + WBEM_S_ALREADY_EXISTS = 0x40001, + WBEM_S_RESET_TO_DEFAULT = 0x40002, + WBEM_S_DIFFERENT = 0x40003, + WBEM_S_TIMEDOUT = 0x40004, + WBEM_S_NO_MORE_DATA = 0x40005, + WBEM_S_OPERATION_CANCELLED = 0x40006, + WBEM_S_PENDING = 0x40007, + WBEM_S_DUPLICATE_OBJECTS = 0x40008, + WBEM_S_ACCESS_DENIED = 0x40009, + WBEM_S_PARTIAL_RESULTS = 0x40010, + WBEM_S_SOURCE_NOT_AVAILABLE = 0x40017, + WBEM_E_FAILED = 0x80041001, + WBEM_E_NOT_FOUND = 0x80041002, + WBEM_E_ACCESS_DENIED = 0x80041003, + WBEM_E_PROVIDER_FAILURE = 0x80041004, + WBEM_E_TYPE_MISMATCH = 0x80041005, + WBEM_E_OUT_OF_MEMORY = 0x80041006, + WBEM_E_INVALID_CONTEXT = 0x80041007, + WBEM_E_INVALID_PARAMETER = 0x80041008, + WBEM_E_NOT_AVAILABLE = 0x80041009, + WBEM_E_CRITICAL_ERROR = 0x8004100a, + WBEM_E_INVALID_STREAM = 0x8004100b, + WBEM_E_NOT_SUPPORTED = 0x8004100c, + WBEM_E_INVALID_SUPERCLASS = 0x8004100d, + WBEM_E_INVALID_NAMESPACE = 0x8004100e, + WBEM_E_INVALID_OBJECT = 0x8004100f, + WBEM_E_INVALID_CLASS = 0x80041010, + WBEM_E_PROVIDER_NOT_FOUND = 0x80041011, + WBEM_E_INVALID_PROVIDER_REGISTRATION = 0x80041012, + WBEM_E_PROVIDER_LOAD_FAILURE = 0x80041013, + WBEM_E_INITIALIZATION_FAILURE = 0x80041014, + WBEM_E_TRANSPORT_FAILURE = 0x80041015, + WBEM_E_INVALID_OPERATION = 0x80041016, + WBEM_E_INVALID_QUERY = 0x80041017, + WBEM_E_INVALID_QUERY_TYPE = 0x80041018, + WBEM_E_ALREADY_EXISTS = 0x80041019, + WBEM_E_OVERRIDE_NOT_ALLOWED = 0x8004101a, + WBEM_E_PROPAGATED_QUALIFIER = 0x8004101b, + WBEM_E_PROPAGATED_PROPERTY = 0x8004101c, + WBEM_E_UNEXPECTED = 0x8004101d, + WBEM_E_ILLEGAL_OPERATION = 0x8004101e, + WBEM_E_CANNOT_BE_KEY = 0x8004101f, + WBEM_E_INCOMPLETE_CLASS = 0x80041020, + WBEM_E_INVALID_SYNTAX = 0x80041021, + WBEM_E_NONDECORATED_OBJECT = 0x80041022, + WBEM_E_READ_ONLY = 0x80041023, + WBEM_E_PROVIDER_NOT_CAPABLE = 0x80041024, + WBEM_E_CLASS_HAS_CHILDREN = 0x80041025, + WBEM_E_CLASS_HAS_INSTANCES = 0x80041026, + WBEM_E_QUERY_NOT_IMPLEMENTED = 0x80041027, + WBEM_E_ILLEGAL_NULL = 0x80041028, + WBEM_E_INVALID_QUALIFIER_TYPE = 0x80041029, + WBEM_E_INVALID_PROPERTY_TYPE = 0x8004102a, + WBEM_E_VALUE_OUT_OF_RANGE = 0x8004102b, + WBEM_E_CANNOT_BE_SINGLETON = 0x8004102c, + WBEM_E_INVALID_CIM_TYPE = 0x8004102d, + WBEM_E_INVALID_METHOD = 0x8004102e, + WBEM_E_INVALID_METHOD_PARAMETERS = 0x8004102f, + WBEM_E_SYSTEM_PROPERTY = 0x80041030, + WBEM_E_INVALID_PROPERTY = 0x80041031, + WBEM_E_CALL_CANCELLED = 0x80041032, + WBEM_E_SHUTTING_DOWN = 0x80041033, + WBEM_E_PROPAGATED_METHOD = 0x80041034, + WBEM_E_UNSUPPORTED_PARAMETER = 0x80041035, + WBEM_E_MISSING_PARAMETER_ID = 0x80041036, + WBEM_E_INVALID_PARAMETER_ID = 0x80041037, + WBEM_E_NONCONSECUTIVE_PARAMETER_IDS = 0x80041038, + WBEM_E_PARAMETER_ID_ON_RETVAL = 0x80041039, + WBEM_E_INVALID_OBJECT_PATH = 0x8004103a, + WBEM_E_OUT_OF_DISK_SPACE = 0x8004103b, + WBEM_E_BUFFER_TOO_SMALL = 0x8004103c, + WBEM_E_UNSUPPORTED_PUT_EXTENSION = 0x8004103d, + WBEM_E_UNKNOWN_OBJECT_TYPE = 0x8004103e, + WBEM_E_UNKNOWN_PACKET_TYPE = 0x8004103f, + WBEM_E_MARSHAL_VERSION_MISMATCH = 0x80041040, + WBEM_E_MARSHAL_INVALID_SIGNATURE = 0x80041041, + WBEM_E_INVALID_QUALIFIER = 0x80041042, + WBEM_E_INVALID_DUPLICATE_PARAMETER = 0x80041043, + WBEM_E_TOO_MUCH_DATA = 0x80041044, + WBEM_E_SERVER_TOO_BUSY = 0x80041045, + WBEM_E_INVALID_FLAVOR = 0x80041046, + WBEM_E_CIRCULAR_REFERENCE = 0x80041047, + WBEM_E_UNSUPPORTED_CLASS_UPDATE = 0x80041048, + WBEM_E_CANNOT_CHANGE_KEY_INHERITANCE = 0x80041049, + WBEM_E_CANNOT_CHANGE_INDEX_INHERITANCE = 0x80041050, + WBEM_E_TOO_MANY_PROPERTIES = 0x80041051, + WBEM_E_UPDATE_TYPE_MISMATCH = 0x80041052, + WBEM_E_UPDATE_OVERRIDE_NOT_ALLOWED = 0x80041053, + WBEM_E_UPDATE_PROPAGATED_METHOD = 0x80041054, + WBEM_E_METHOD_NOT_IMPLEMENTED = 0x80041055, + WBEM_E_METHOD_DISABLED = 0x80041056, + WBEM_E_REFRESHER_BUSY = 0x80041057, + WBEM_E_UNPARSABLE_QUERY = 0x80041058, + WBEM_E_NOT_EVENT_CLASS = 0x80041059, + WBEM_E_MISSING_GROUP_WITHIN = 0x8004105a, + WBEM_E_MISSING_AGGREGATION_LIST = 0x8004105b, + WBEM_E_PROPERTY_NOT_AN_OBJECT = 0x8004105c, + WBEM_E_AGGREGATING_BY_OBJECT = 0x8004105d, + WBEM_E_UNINTERPRETABLE_PROVIDER_QUERY = 0x8004105f, + WBEM_E_BACKUP_RESTORE_WINMGMT_RUNNING = 0x80041060, + WBEM_E_QUEUE_OVERFLOW = 0x80041061, + WBEM_E_PRIVILEGE_NOT_HELD = 0x80041062, + WBEM_E_INVALID_OPERATOR = 0x80041063, + WBEM_E_LOCAL_CREDENTIALS = 0x80041064, + WBEM_E_CANNOT_BE_ABSTRACT = 0x80041065, + WBEM_E_AMENDED_OBJECT = 0x80041066, + WBEM_E_CLIENT_TOO_SLOW = 0x80041067, + WBEM_E_NULL_SECURITY_DESCRIPTOR = 0x80041068, + WBEM_E_TIMED_OUT = 0x80041069, + WBEM_E_INVALID_ASSOCIATION = 0x8004106a, + WBEM_E_AMBIGUOUS_OPERATION = 0x8004106b, + WBEM_E_QUOTA_VIOLATION = 0x8004106c, + WBEM_E_RESERVED_001 = 0x8004106d, + WBEM_E_RESERVED_002 = 0x8004106e, + WBEM_E_UNSUPPORTED_LOCALE = 0x8004106f, + WBEM_E_HANDLE_OUT_OF_DATE = 0x80041070, + WBEM_E_CONNECTION_FAILED = 0x80041071, + WBEM_E_INVALID_HANDLE_REQUEST = 0x80041072, + WBEM_E_PROPERTY_NAME_TOO_WIDE = 0x80041073, + WBEM_E_CLASS_NAME_TOO_WIDE = 0x80041074, + WBEM_E_METHOD_NAME_TOO_WIDE = 0x80041075, + WBEM_E_QUALIFIER_NAME_TOO_WIDE = 0x80041076, + WBEM_E_RERUN_COMMAND = 0x80041077, + WBEM_E_DATABASE_VER_MISMATCH = 0x80041078, + WBEM_E_VETO_DELETE = 0x80041079, + WBEM_E_VETO_PUT = 0x8004107a, + WBEM_E_INVALID_LOCALE = 0x80041080, + WBEM_E_PROVIDER_SUSPENDED = 0x80041081, + WBEM_E_SYNCHRONIZATION_REQUIRED = 0x80041082, + WBEM_E_NO_SCHEMA = 0x80041083, + WBEM_E_PROVIDER_ALREADY_REGISTERED = 0x80041084, + WBEM_E_PROVIDER_NOT_REGISTERED = 0x80041085, + WBEM_E_FATAL_TRANSPORT_ERROR = 0x80041086, + WBEM_E_ENCRYPTED_CONNECTION_REQUIRED = 0x80041087, + WBEM_E_PROVIDER_TIMED_OUT = 0x80041088, + WBEM_E_NO_KEY = 0x80041089, + WBEM_E_PROVIDER_DISABLED = 0x8004108a +} WBEMSTATUS; + +[ + object, + restricted, + local, + uuid(dc12a687-737f-11cf-884d-00aa004b2e24), + pointer_default(unique) +] +interface IWbemLocator : IUnknown +{ + HRESULT ConnectServer( + [in] const BSTR strNetworkResource, + [in] const BSTR strUser, + [in] const BSTR strPassword, + [in] const BSTR strLocale, + [in] LONG lSecurityFlags, + [in] const BSTR strAuthority, + [in] IWbemContext *pCtx, + [out] IWbemServices **ppNamespace); +}; + +[ + object, + local, + uuid(eb87e1bc-3233-11d2-aec9-00c04fb68820) +] +interface IWbemStatusCodeText : IUnknown +{ + HRESULT GetErrorCodeText( + [in] HRESULT hRes, + [in] LCID LocaleId, + [in] LONG lFlags, + [out] BSTR *MessageText); + + HRESULT GetFacilityCodeText( + [in] HRESULT hRes, + [in] LCID LocaleId, + [in] LONG lFlags, + [out] BSTR *MessageText); +}; diff --git a/include/winbase.h b/include/winbase.h index d7d87730698..613114c6b08 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2136,6 +2136,7 @@ WINBASEAPI BOOL WINAPI VirtualProtectEx(HANDLE,LPVOID,SIZE_T,DWORD,LPDWOR WINBASEAPI SIZE_T WINAPI VirtualQuery(LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T); WINBASEAPI SIZE_T WINAPI VirtualQueryEx(HANDLE,LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T); WINBASEAPI BOOL WINAPI VirtualUnlock(LPVOID,SIZE_T); +WINBASEAPI DWORD WINAPI WTSGetActiveConsoleSessionId(void); WINBASEAPI BOOL WINAPI WaitCommEvent(HANDLE,LPDWORD,LPOVERLAPPED); WINBASEAPI BOOL WINAPI WaitForDebugEvent(LPDEBUG_EVENT,DWORD); WINBASEAPI DWORD WINAPI WaitForMultipleObjects(DWORD,const HANDLE*,BOOL,DWORD); diff --git a/include/wincodec.idl b/include/wincodec.idl index 691a4fd6ae5..5850bea857c 100644 --- a/include/wincodec.idl +++ b/include/wincodec.idl @@ -390,3 +390,7 @@ cpp_quote("DEFINE_GUID(GUID_ContainerFormatJpeg, 0x19e4a5aa,0x5662,0x4fc5,0xa0,0 cpp_quote("DEFINE_GUID(GUID_ContainerFormatTiff, 0x163bcc30,0xe2e9,0x4f0b,0x96,0x1d,0xa3,0xe9,0xfd,0xb7,0x88,0xa3);") cpp_quote("DEFINE_GUID(GUID_ContainerFormatGif, 0x1f8a5601,0x7d4d,0x4cbd,0x9c,0x82,0x1b,0xc8,0xd4,0xee,0xb9,0xa5);") cpp_quote("DEFINE_GUID(GUID_ContainerFormatWmp, 0x57a37caa,0x367a,0x4540,0x91,0x6b,0xf1,0x83,0xc5,0x09,0x3a,0x4b);") + +cpp_quote("DEFINE_GUID(GUID_VendorMicrosoft, 0xf0e749ca,0xedef,0x4589,0xa7,0x3a,0xee,0x0e,0x62,0x6a,0x2a,0x2b);") + +cpp_quote("DEFINE_GUID(CATID_WICBitmapDecoders, 0x7ed96837,0x96f0,0x4812,0xb2,0x11,0xf1,0x3c,0x24,0x11,0x7e,0xd3);") diff --git a/programs/cmd/De.rc b/programs/cmd/De.rc index 1db223136ad..2ad3de1f7d1 100644 --- a/programs/cmd/De.rc +++ b/programs/cmd/De.rc @@ -3,6 +3,7 @@ * German Language Support * * Copyright 2004 Henning Gerhardt + * Copyright 2009 André Hentschel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,26 +28,26 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL STRINGTABLE { - WCMD_ATTRIB, "Hilfe für ATTRIB\n" + WCMD_ATTRIB, "ATTRIB zeigt oder ändert die DOS Dateieigenschaften.\n" WCMD_CALL, "CALL wird in einer Batchdatei genutzt, um Befehle aus\n\ einer anderen Batchdatei auszuführen. Wenn die Batchdatei exisiert, kehrt\n\ -die Kontrolle zu der Datei zurück, die sie gerufen hat. Der CALL Befehl kann\n\ -Parameter zu der rufenden Prozedure übertragen.\n\ +die Kontrolle zu der Datei zurück, die sie aufgerufen hat. Der CALL Befehl kann\n\ +Parameter zu der rufenden Prozedure übergeben.\n\ \n\ Änderungen für das aktuelle Verzeichnis, Umgebungsvariablen usw. werden in\n\ der gerufenen Prozedur gemacht, die sie von der aufgerufenen geerbt hat.\n" - WCMD_CD, "Hilfe für CD\n" - WCMD_CHDIR, "Hilfe für CHDIR\n" + WCMD_CD, "CD ist die Kurzform von CHDIR.\n" + WCMD_CHDIR, "CHDIR Wechselt in ein Verzeichnis.\n" - WCMD_CLS, "CLS löscht den Inhalt der Konsole\n" + WCMD_CLS, "CLS löscht den Bildschirminhalt der Konsole.\n" - WCMD_COPY, "Hilfe für COPY\n" - WCMD_CTTY, "Hilfe für CTTY\n" - WCMD_DATE, "Hilfe für DATE\n" - WCMD_DEL, "Hilfe für DEL\n" - WCMD_DIR, "Hilfe für DIR\n" + WCMD_COPY, "COPY Kopiert eine Datei.\n" + WCMD_CTTY, "CTTY Ändert das Eingabe/Ausgabe - Gerät.\n" + WCMD_DATE, "DATE zeigt oder ändert das Systemdatum.\n" + WCMD_DEL, "DEL löscht eine oder mehrere Dateien\n" + WCMD_DIR, "DIR listet den Inhalt eines Verzeichnisses.\n" WCMD_ECHO, "ECHO zeigt die auf dem aktuellen Terminalgerät.\n\ @@ -58,7 +59,7 @@ ECHO OFF kehrt den Effekt des vorherigen ECHO ON (ECHO ist standardmässig\n\ auf OFF) um. Um den ECHO OFF Befehl nicht anzeigen zu lassen, kann vor dessen\n\ ein @ Zeichen gesetzt werden.\n" - WCMD_ERASE, "Hilfe für ERASE\n" + WCMD_ERASE, "ERASE löscht die angegebenen Dateien.\n" WCMD_FOR, "Der FOR Befehl wird genutzt, um einen Befehl für eine Menge von Dateien\n\ @@ -67,14 +68,14 @@ einzeln auszuführen.\n\ Syntax: FOR %Variable IN (set) DO Befehl\n\ \n\ Die Anforderung das % Zeichen zu verdoppeln, sobald FOR in einer Batchdatei\n\ -benutzt wird, existiert im CMD nicht.\n" +benutzt wird, existiert in CMD nicht.\n" WCMD_GOTO, "Der GOTO Befehl transferiert die Ausführung zu einer anderen Stelle in einer\n\ Batchdatei.\n\ \n\ Die Bezeichnung, die das Ziel eines GOTO's ist, kann bis zu 255 Zeichen lang\n\ -sein, darf aber keine Leerzeichen enthakten (dies ist der Unterschied zu\n\ +sein, darf aber keine Leerzeichen enthalten (dies ist der Unterschied zu\n\ anderen Betriebssystemen). Wenn zwei oder mehr identische Bezeichnungen in\n\ einer Batchdatei existieren, dann wird immer zu der ersten Bezeichnung\n\ gesprungen. Versucht GOTO zu einer nicht vorhanden Bezeichnung zu springen,\n\ @@ -82,7 +83,7 @@ beendet sich die Ausführung der Batchdatei.\n\ \n\ GOTO hat keine Auswirkungen, wenn es interaktiv genutzt wird.\n" - WCMD_HELP, "Hilfe für HELP\n" + WCMD_HELP, "HELP zeigt die Hilfe an\n" WCMD_IF, "IF wird benutzt, um einen Befehl bedingt auszuführen.\n\ @@ -104,8 +105,8 @@ Der Befehl wartet auf die Eingabe einer neuen Bezeichnung für das angegebene\n\ Laufwerk. Sie können sich auch die Laufwerksbezeicnung mit dem VOL - Befehl\n\ anzeigen lassen.\n" - WCMD_MD, "Hilfe für MD\n" - WCMD_MKDIR, "Hilfe für MKDIR\n" + WCMD_MD, "MD ist die Kurzform von MKDIR\n" + WCMD_MKDIR, "MKDIR erstellt ein Verzeichnis\n" WCMD_MOVE, "MOVE verschiebt eine Datei oder ein Verzeichnis zu einem neuen Punkt im\n\ Dateisystem.\n\ @@ -163,10 +164,10 @@ wie 'PROMPT text'.\n" keine Aktion ausgeführt und kann deshalb auch als Kommentar in einer\n\ Batchdatei genutzt werden.\n" - WCMD_REN, "Hilfe für REN\n" - WCMD_RENAME, "Hilfe für RENAME\n" - WCMD_RD, "Hilfe für RD\n" - WCMD_RMDIR, "Hilfe für RMDIR\n" + WCMD_REN, "REN ist die Kurzform von RENAME.\n" + WCMD_RENAME, "RENAME benennt die angegebenen Dateien um.\n" + WCMD_RD, "RD ist die Kurzform von RMDIR.\n" + WCMD_RMDIR, "RMDIR löscht das angegebene Verzeichnis.\n" WCMD_SET, "SET ändert oder zeigt die CMD Umgebungsvariablen an.\n\ @@ -177,9 +178,8 @@ Um eine Umgebungsvariable zu erschaffen oder zu ändern, ist der Syntax nötig:\ \n\ SET =\n\ \n\ -Wobei und Zeichenkette sind. Es müssen keine Leerzeichen vor\n\ -dem Gleichheitszeichen sein, noch muss der Variablenname in Anführungszeichen\n\ -eingeschlossen sein.\n\ +Wobei und Zeichenkette sind. Es dürfen keine Leerzeichen vor\n\ +dem Gleichheitszeichen sein, noch darf der Variablenname Leerzeichen enthalten.\n\ \n\ In Wine werden die Umgebungsvariablen des darunterliegenden Betriebssystems\n\ mit in die Win32 Umgebung eingebunden, deshalb gibt es gewöhnlich mehr Werte\n\ @@ -190,9 +190,9 @@ beeinflussen.\n" WCMD_SHIFT, "SHIFT wird in einer Batchdatei genutzt, um einen Parameter vom Anfang der\n\ Liste zu entfernen, so das der Parameter 2 zu Parameter 1 wird und so weiter.\n\ -Es hat keine Auswirkungen, wenn es von der Befehlszeile gerufen wird.\n" +Es hat keine Auswirkungen, wenn es von der Befehlszeile aus aufgerufen wird.\n" - WCMD_TIME, "Hilfe für TIME\n" + WCMD_TIME, "TIME Setzt oder zeigt die aktuelle Systemzeit an.\n" WCMD_TITLE, "Setzt den Fenstertitel für das CMD - Fenster.\n\ @@ -202,7 +202,7 @@ Syntax: TITLE [Zeichenkette]\n" WCMD_TYPE, "TYPE kopiert zu dem Konsolengerät (oder dorthin, wohin\n\ dies umgeleitet wurde). Es wird keine Überprüfung vorgenommen, ob die\n\ -Datei lesbarer Text ist.\n" +Datei lesbaren Text enthält.\n" WCMD_VERIFY, "VERIFY wird benutzt, um das Verify Flag zu setzen, zu löschen oder zu\n\ @@ -217,7 +217,7 @@ Das Verify Flag hat keine Funktion in Wine.\n" WCMD_VER, "VER zeigt die aktuelle Version von CMD an.\n" - WCMD_VOL, "Hilfe für VOL\n" + WCMD_VOL, "VOL zeigt die Volumeseriennummer an\n" WCMD_PUSHD, "PUSHD speichert das aktuelle\n\ Verzeichnis auf einem Stack und wecheselt das Arbeitsverzeichnis\n\ @@ -226,7 +226,7 @@ zu dem angegebenen.\n" WCMD_POPD, "POPD wechselt das Arbeitsverzeichnis zu dem zuletzt\n\ mit PUSHD gespeicherten.\n" - WCMD_MORE, "MORE displays output of files or piped input in pages.\n" + WCMD_MORE, "MORE gibt Dateien und Pipes seitenweise aus.\n" WCMD_EXIT, "EXIT beendet die aktuelle Befehlssitzung und kehrt zum\n\ @@ -234,13 +234,13 @@ Betriebssystem oder der Shell zurück, von der CMD gestart wurde.\n" WCMD_ALLHELP, "CMD eingebauten Befehle sind:\n\ -ATTRIB\t\tZeigt an oder ändert die DOS Dateieigenschaften\n\ +ATTRIB\t\tZeigt oder ändert die DOS Dateieigenschaften\n\ CALL\t\tRuft eine Batch-Datei innerhalb einer anderen auf\n\ -CD (CHDIR)\tWechselt in das Verzeichnis\n\ +CD (CHDIR)\tWechselt in ein Verzeichnis\n\ CLS\t\tLöscht den Inhalt der Konsole\n\ COPY\t\tKopiert eine Datei\n\ CTTY\t\tÄndert das Eingabe/Ausgabe - Gerät\n\ -DATE\t\tZeigt an oder ändert das Systemdatum\n\ +DATE\t\tZeigt oder ändert das Systemdatum\n\ DEL (ERASE)\tLöscht eine oder mehrere Dateien\n\ DIR\t\tListet den Inhalt eines Verzeichnisses\n\ ECHO\t\tKopiert den Text direkt zur Konsolenausgabe\n\ @@ -282,7 +282,7 @@ obigen Befehle erhalten.\n" WCMD_NEWTIME, "Geben Sie die neue Zeit ein: " WCMD_MISSINGENV, "Die Umgebungsvariable %s ist nicht definiert\n" WCMD_READFAIL, "'%s' konnte nicht geöffnet werden\n" - WCMD_CALLINSCRIPT, "Cannot call batch label outside of a batch script\n" + WCMD_CALLINSCRIPT, "Kann kein Batch-Label außerhalb eines Batch-Scripts aufrufen\n" WCMD_ALL, "A" WCMD_DELPROMPT, "%s, löschen" WCMD_ECHOPROMPT, "Echo ist %s\n" @@ -296,5 +296,5 @@ obigen Befehle erhalten.\n" WCMD_CONSTITLE,"Wine Befehlsprozessor" WCMD_VERSION,"CMD Version %s\n\n" WCMD_MOREPROMPT, "Mehr? " - WCMD_LINETOOLONG, "The input line is too long.\n" + WCMD_LINETOOLONG, "Die Eingabezeile ist zu lang.\n" } diff --git a/programs/cmd/Ru.rc b/programs/cmd/Ru.rc dissimilarity index 86% index 3e0b9492b7e..9e9853746a4 100644 --- a/programs/cmd/Ru.rc +++ b/programs/cmd/Ru.rc @@ -1,284 +1,287 @@ -/* - * Wine command prompt (Russian resources) - * - * Copyright 2003 Igor Stepin - * Copyright 2007 Lyutin Anatoly - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "wcmd.h" - -LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT - -STRINGTABLE -{ - WCMD_ATTRIB, "Ñïðàâêà îá ATTRIB\n" - WCMD_CALL, -"CALL <èìÿ bat-ôàéëà> èñïîëüçóåòñÿ â bat-ôàéëàõ äëÿ çàïóñêà äðóãèõ\n\ -bat-ôàéëîâ. Ïðè âûõîäå èç bat-ôàéëà óïðàâëåíèå âîçâðàùàåòñÿ\n\ -ôàéëó, âûçâàâøåìó åãî. Êîìàíäà CALL ìîæåò ïåðåäàâàòü ïàðàìåòðû\n\ -âûçâàííîìó bat-ôàéëó.\n\ -\n\ -Èçìåíåíèÿ êàòàëîãà ïî óìîë÷àíèþ, ïåðåìåííûõ îêðóæåíèÿ è ò.ä., ñäåëàííûå\n\ -âûçâàííîé ïðîöåäóðîé, íàñëåäóþòñÿ âûçâàâøåìó.\n" - - WCMD_CD, "Ñïðàâêà î CD\n" - WCMD_CHDIR, "Ñïðàâêà î CHDIR\n" - - WCMD_CLS, "CLS î÷èùàåò ýêðàí êîíñîëè\n" - - WCMD_COPY, "Ñïðàâêà î COPY\n" - WCMD_CTTY, "Ñïðàâêà î CTTY\n" - WCMD_DATE, "Ñïðàâêà î DATE\n" - WCMD_DEL, "Ñïðàâêà î DEL\n" - WCMD_DIR, "Ñïðàâêà î DIR\n" - - WCMD_ECHO, -"ECHO <ñòðîêà> îòîáðàæàåò <ñòðîêó> íà òåêóùåì òåðìèíàëüíîì óñòðîéñòâå.\n\ -\n\ -ECHO ON âêëþ÷àåò îòîáðàæåíèå âñåõ ïîñëåäóþùèõ êîìàíä â bat-ôàéëå\n\ -â òåðìèíàë ïåðåä èõ âûïîëíåíèåì.\n\ -\n\ -ECHO OFF äà¸ò ýôôåêò, ïðîòèâîïîëîæíûé ECHO ON (ECHO îòêëþ÷åíî (OFF) ïî\n\ -óìîë÷àíèþ). Çíàê @, ïðåäøåñòâóþùèé ECHO OFF, ïðåïÿòñòâóåò å¸ îòîáðàæåíèþ.\n" - - WCMD_ERASE, "Ñïðàâêà îá ERASE\n" - - WCMD_FOR, -"FOR èñïîëüçóåòñÿ äëÿ ïðèìåíåíèÿ çàäàííîé <êîìàíäû> äëÿ\n\ -îäíîãî ôàéëà èëè íàáîðà ôàéëîâ.\n\ -\n\ -Ñèíòàêñèñ: FOR %ïåðåìåííàÿ IN (íàáîð) DO êîìàíäà\n\ -\n\ -Íåîáõîäèìîñòü â óäâîåíèè çíàêà % ïðè èñïîëüçîâàíèè FOR â bat-ôàéëàõ\n\ -îòñóòñòâóåò â cmd.\n" - - - WCMD_GOTO, -"GOTO ïåðåäà¸ò óïðàâëåíèå íà ñòðîêó, ïîìå÷åííóþ ñïåöèàëüíîé ìåòêîé, â\n\ -ïðåäåëàõ bat-ôàéëà.\n\ -\n\ -Ìåòêà, ÿâëÿþùàÿñÿ öåëüþ GOTO, ìîæåò èìåòü äëèíó äî 255 ñèìâîëîâ, íî\n\ -íå ìîæåò ñîäåðæàòü ïðîáåëû (ýòî îòëè÷èå îò äðóãèõ îïåðàöèîííûõ\n\ -ñèñòåì). Åñëè â bat-ôàéëå ïðèñóòñòâóåò äâå èëè áîëåå ìåòêè ñ îäèíàêîâûì èìåíåì,\n\ -òî ïåðåäàâàòüñÿ óïðàâëåíèå áóäåò âñåãäà íà ïåðâóþ.\n\ -Ïîïûòêà GOTO ïåðåéòè ïî íåñóùåñòâóþùåé ìåòêå ïðåðûâàåò âûïîëíåíèå bat-ôàéëà.\n\ -\n\ -Êîìàíäà GOTO íå ðàáîòàåò â èíòåðàêòèâíîì ðåæèìå.\n" - - WCMD_HELP, "Ñïðàâêà î HELP\n" - - WCMD_IF, -"IF îñóùåñòâëÿåò óñëîâíóþ îáðàáîòêó.\n\ -\n\ -Ñèíòàêñèñ: IF [NOT] EXIST ôàéë êîìàíäà\n\ - IF [NOT] \"ñòðîêà1\"==\"ñòðîêà2\" êîìàíäà\n\ - IF [NOT] ERRORLEVEL ÷èñëî êîìàíäà\n\ -\n\ - ïåðâîì ïðèìåðå êîìàíäà EXIST ïðîâåðÿåò ñóùåñòâîâàíèå ôàéëà.\n\ -Âî âòîðîì ïðèìåðå ñðàâíåíèå íå çàâèñèò îò ðåãèñòðà.\n\ - òðåòüåì ïðèìåðå ERRORLEVEL - çíà÷åíèå, âîçâðàùàåìîå ïðîãðàììîé ïîñëå âûïîëíåíèÿ.\n\ -IF ïðîâåðÿåò ERRORLEVEL íà >= <÷èñëî>.\n" - - WCMD_LABEL, -"LABEL çàäà¸ò ìåòêó äèñêà.\n\ -\n\ -Ñèíòàêñèñ: LABEL [äèñê:]\n\ -Êîìàíäà âûâîäèò ïîäñêàçêó î ñîçäàíèè íîâîé ìåòêè äëÿ äèñêà.\n\ -Ïîñìîòðåòü òåêóùóþ ìåòêó äèñêà âîçìîæíî ñ ïîìîùüþ êîìàíäû VOL.\n" - - - WCMD_MD, "Ñïðàâêà î MD\n" - WCMD_MKDIR, "Ñïðàâêà î MKDIR\n" - WCMD_MOVE, -"MOVE ïåðåìåùàåò ôàéë èëè êàòàëîã íà íîâîå ìåñòî ôàéëîâîé ñèñòåìû.\n\ -\n\ -Åñëè ïåðåìåùàåòñÿ êàòàëîã, òî âñå ôàéëû è ïîäêàòàëîãè âíóòðè íåãî\n\ -òàêæå ïåðåìåñòÿòñÿ.\n\ -\n\ -MOVE íå ðàáîòàåò äëÿ ïåðåìåùåíèÿ äàííûõ ñ îäíîãî ëîãè÷åñêîãî äèñêà íà äðóãîé.\n" - - WCMD_PATH, -"PATH îòîáðàæàåò èëè èçìåíÿåò ìàðøðóò ïîèñêà â cmd.\n\ -\n\ -Êîìàíäà PATH îòîáðàæàåò òåêóùóþ óñòàíîâêó ïóòè ïîèñêà èñïîëíÿåìûõ ôàéëîâ\n\ -(ïåðâîíà÷àëüíî ýòî çíà÷åíèå çàäà¸òñÿ â Âàøåì wine.conf ôàéëå).\n\ -Äëÿ èçìåíåíèÿ çíà÷åíèÿ âûçîâèòå PATH ñ íîâûì çíà÷åíèåì.\n\ -\n\ -Òàê æå âîçìîæíî èçìåíÿòü çíà÷åíèå PATH, èñïîëüçóÿ çíà÷åíèå ïåðåìåííîé\n\ -îêðóæåíèÿ PATH, íàïðèìåð:\n\ - PATH %PATH%;c:\\temp\n" - - WCMD_PAUSE, -"PAUSE âûâîäèò íà ýêðàí ñîîáùåíèå 'Press Return key to continue'\n\ -è æä¸ò ïîêà ïîëüçîâàòåëü íå íàæì¸ò êëàâèøó Return. Îíà èñïîëüçóåòñÿ\n\ -â bat-ôàéëàõ äëÿ òîãî, ÷òîáû ïîëüçîâàòåëü ñìîã ïðî÷åñòü âûâîä ïðåäûäóùåé êîìàíäû\n\ -ïðåæäå ÷åì îí èñ÷åçíåò ñ ýêðàíà.\n" - - WCMD_PROMPT, -"PROMPT èçìåíÿåò âèä ïîäñêàçêè êîìàíäíîé ñòðîêè.\n\ -\n\ -Ñòðîêà, èäóùàÿ ïîñëå êîìàíäû PROMPT (è çà ïðîáåëîì ïîñëå êîìàíäû),\n\ -ïîÿâëÿåòñÿ â íà÷àëå ñòðîêè, êîãäà cmd æä¸ò ââîäà.\n\ -\n\ -Ñëåäóþùèå ñòðîêè èìåþò ïðåäîïðåäåë¸ííûå çíà÷åíèÿ, êîòîðûå ìîæíî îòîáðàçèòü:\n\ -\n\ -$$ Çíàê äîëëàðà $_ Linefeed $b Çíàê Pipe (|)\n\ -$d Òåêóùàÿ äàòà $e Esc-ñèìâîë (27) $g Çíàê >\n\ -$l Çíàê < $n Òåêóùèé äèñê $p Òåêóùèé ïóòü\n\ -$q Çíàê ðàâíî $t Òåêóùåå âðåìÿ $v Âåðñèÿ cmd\n\ -\n\ -Ïðè ââîäå êîìàíäû PROMPT áåç íîâîé ñòðîêè ïîäñêàçêè\n\ -ïîäñêàçêà óñòàíàâëèâàåòñÿ ïî óìîë÷àíèþ (áóêâà òåêóùåãî äèñêà, ïóòü äî òåêóùåãî\n\ -êàòàëîãà è çíàê áîëüøå (>).\n\ -(êàê ïðè âûçîâå PROMPT $p$g).\n\ -\n\ -Ïîäñêàçêà ìîæåò áûòü òàêæå èçìåíåíà ñìåíîé ïåðåìåííîé îêðóæåíèÿ PROMPT,\n\ -ïîýòîìó êîìàíäà 'SET PROMPT=<òåêñò>' èìååò òàêîé æå ýôôåêò, êàê 'PROMPT '\n" - - WCMD_REM, -"Êîìàíäíàÿ ñòðîêà, íà÷èíàþùàÿñÿ ñ REM (ñ ïîñëåäóþùèì ïðîáåëîì) íå âûïîëíÿåò\n\ -íèêàêèõ äåéñòâèé, ïîýòîìó REM èñïîëüçóåòñÿ äëÿ êîììåíòàðèåâ â bat-ôàéëàõ.\n" - - WCMD_REN, "Ñïðàâêà î REN\n" - WCMD_RENAME, "Ñïðàâêà î RENAME\n" - WCMD_RD, "Ñïðàâêà î RD\n" - WCMD_RMDIR, "Ñïðàâêà î RMDIR\n" - - WCMD_SET, -"SET ïîêàçûâàåò èëè èçìåíÿåò ïåðåìåííûå îêðóæåíèÿ cmd.\n\ -\n\ -SET áåç ïàðàìåòðîâ ïîêàçûâàåò âñ¸ òåêóùåå îêðóæåíèå.\n\ -\n\ -Äëÿ ñîçäàíèÿ èëè èçìåíåíèÿ ïåðåìåííîé îêðóæåíèÿ èñïîëüçóéòå:\n\ -\n\ - SET <ïåðåìåííàÿ>=<çíà÷åíèå>\n\ -\n\ -ãäå <ïåðåìåííàÿ> è <çíà÷åíèå> ÿâëÿþòñÿ ñèìâîëüíûìè ñòðîêàìè. Ïåðåä çíàêîì\n\ -ðàâíî íå äîëæíî áûòü ïðîáåëîâ, èìÿ ïåðåìåííîé íå ìîæåò ñîäåðæàòü\n\ -ïðîáåëû.\n\ -\n\ - Wine ïåðåìåííûå îêðóæåíèÿ îñíîâíîé îïåðàöèîííîé ñèñòåìû âêëþ÷åíû\n\ -â îêðóæåíèå Win32, ïîýòîìó áóäåò äîñòóïíî íåñêîëüêî áîëüøå\n\ -ïåðåìåííûõ, ÷åì â îáû÷íîé Win32. Ñòîèò îòìåòèòü,\n\ -÷òî íåâîçìîæíî èçìåíèòü îêðóæåíèå îïåðàöèîííîé ñèñòåìû èç cmd.\n" - - WCMD_SHIFT, -"SHIFT èñïîëüçóåòñÿ â bat-ôàéëàõ äëÿ óäàëåíèÿ îäíîãî ïàðàìåòðà ñ âåðøèíû\n\ -ñïèñêà, òàêèì îáðàçîì ïàðàìåòð 2 ïåðåìåñòèòñÿ â ïàðàìåòð 1 è òàê äàëåå.\n\ -SHIFT íå ðàáîòàåò ïðè âûçîâå â êîìàíäíîé ñòðîêå.\n" - - WCMD_TIME, "Ñïðàâêà î TIME\n" - - WCMD_TITLE, "Óñòàíàâëèâàåò çàãîëîâîê îêíà cmd äëÿ òåêóùåé ñåññèè.\n Ñèíòàêñèñ: TITLE <ñòðîêà>\n" - - WCMD_TYPE, -"TYPE <ôàéë> êîïèðóåò <ôàéë> â óñòðîéñòâî êîíñîëè (èëè êóäà óãîäíî, åñëè îí ïåðåíàïðàâëåí).\n\ -Ïðîâåðêà íà òî, ÷òî ôàéë - ýòî òåêñò, ïðåäíàçíà÷åííûé äëÿ ÷òåíèÿ, îòñóòñòâóåò.\n" - - WCMD_VERIFY, -"VERIFY ïðåäíàçíà÷åíà äëÿ óñòàíîâêè, ñáðîñà èëè îïðåäåëåíèÿ ôëàãà ïðîâåðêè\n\ -êîððåêòíîñòè çàïèñè ôàéëîâ íà äèñê. Âîçìîæíûå çíà÷åíèÿ:\n\ -\n\ -VERIFY ON Óñòàíîâèòü ôëàã\n\ -VERIFY OFF Ñáðîñèòü ôëàã\n\ -VERIFY Âûâîäèò òåêóùåå ñîñòîÿíèå: ON èëè OFF.\n\ -\n\ -Ôëàã verify íå èñïîëüçóåòñÿ Wine.\n" - - WCMD_VER, -"VER îòîáðàæàåò âåðñèþ çàïóùåííîãî cmd\n" - - WCMD_VOL, "Ñïðàâêà î VOL\n" - - WCMD_PUSHD, "PUSHD ñîõðàíÿåò òåêóùèé êàòàëîã â ñòåê,\n\ -à çàòåì ïåðåõîäèò â óêàçàííûé êàòàëîã.\n" - - WCMD_POPD, "POPD ïåðåõîäèò â êàòàëîã, ñîõðàí¸ííûé êîìàíäîé\n\ -PUSHD.\n" - - WCMD_MORE, "MORE displays output of files or piped input in pages.\n" - - WCMD_EXIT, -"EXIT çàâåðøàåò òåêóùóþ êîìàíäíóþ ñåññèþ è âîçâðàùàåò\n\ -â îïåðàöèîííóþ ñèñòåìó èëè îáîëî÷êó èç êîòîðîé áûë çàïóùåí cmd.\n" - - WCMD_ALLHELP, "Âñòðîåííûå êîìàíäû CMD:\n\ -ATTRIB\t\tÏîêàçàòü èëè èçìåíèòü DOS-àòðèáóòû ôàéëà\n\ -CALL\t\tÇàïóñòèòü bat-ôàéë èç äðóãîãî bat-ôàéëà\n\ -CD (CHDIR)\tÑìåíèòü òåêóùóþ ïàïêó\n\ -CLS\t\tÎ÷èñòèòü ýêðàí êîíñîëè\n\ -COPY\t\tÑêîïèðîâàòü ôàéë\n\ -CTTY\t\tÑìåíèòü óñòðîéñòâî ââîäà/âûâîäà\n\ -DATE\t\tÏîêàçàòü èëè èçìåíèòü ñèñòåìíóþ äàòó\n\ -DEL (ERASE)\tÓäàëèòü ôàéë èëè íàáîð ôàéëîâ\n\ -DIR\t\tÏîêàçàòü ñîäåðæàíèå ïàïêè\n\ -ECHO\t\tÑêîïèðîâàòü òåêñò ïðÿìî íà âûõîä êîíñîëè\n\ -HELP\t\tÏîêàçàòü êðàòêóþ ïîäñêàçêó ïî êîìàíäå\n\ -MD (MKDIR)\tÑîçäàòü ïàïêó\n\ -MORE\t\tÂûâåñòè äàííûå ïî ñòðàíèöàì\n\ -MOVE\t\tÏåðåìåñòèòü ôàéë, íàáîð ôàéëîâ èëè äåðåâî ïàïîê\n\ -PATH\t\tÏîêàçàòü èëè èçìåíèòü ïóòü ïîèñêà ïðîãðàìì\n\ -POPD\t\tÂîññòàíîâèòü ïðåäûäóùåå çíà÷åíèå òåêóùåé ïàïêè, ñîõðàí¸ííîãî ñ ïîìîùüþ PUSHD\n\ -PUSHD\t\tÑîõðàíèòü çíà÷åíèå òåêóùåé ïàïêè è ïåðåõîäèò ê äðóãîé ïàïêå\n\ -PROMPT\t\tÈçìåíèòü ïðèãëàøåíèå êîìàíäíîé ñòðîêè\n\ -REN (RENAME)\tÏåðåèìåíîâàòü ôàéë\n\ -RD (RMDIR)\tÓäàëèòü ïàïêó\n\ -SET\t\tÏîêàçàòü èëè èçìåíèòü ïåðåìåííûå îêðóæåíèÿ\n\ -TIME\t\tÏîêàçàòü èëè èçìåíèòü òåêóùåå ñèñòåìíîå âðåìÿ\n\ -TITLE\t\tÓñòàíàâèòü çàãîëîâîê îêíà cmd äëÿ òåêóùåé ñåññèè\n\ -TYPE\t\tÂûâåñòè ñîäåðæàíèå òåêñòîâîãî ôàéëà\n\ -VER\t\tÏîêàçàòü òåêóùóþ âåðñèþ CMD\n\ -VOL\t\tÏîêàçàòü ìåòêó òîìà äèñêîâîãî óñòðîéñòâà\n\ -EXIT\t\tÂûéòè èç CMD\n\n\ -Âûïîëíèòå HELP <êîìàíäà> äëÿ äîïîëíèòåëüíîé èíôîðìàöèè ïî ïåðå÷èñëåííûì âûøå êîìàíäàì.\n" - - WCMD_CONFIRM, "Âû óâåðåíû?" - WCMD_YES, "Ä" - WCMD_NO, "Í" - WCMD_NOASSOC, "Ôàéë, àññîöèèðîâàííûé ñ ðàñøèðåíèåì %s,îòñóòñòâóåò\n" - WCMD_NOFTYPE, "Íå ðàáîòàåò êîìàíäà, àññîöèèðîâàííàÿ ñ ôàéëîì '%s'\n" - WCMD_OVERWRITE, "Ïåðåçàïèñàíî %s" - WCMD_MORESTR, "Äàëüøå..." - WCMD_TRUNCATEDLINE, "Ñòðîêà â îáðàáàòûâàåìîì bat-ôàéëå âîçìîæíî óðåçàíà. Èñïîëüçóåì:\n" - WCMD_NYI, "Åù¸ íå âûïîëíåíî\n\n" - WCMD_NOARG, "Îòñóòñòâóåò àðãóìåíò\n" - WCMD_SYNTAXERR, "Ñèíòàêñè÷åñêàÿ îøèáêà\n" - WCMD_FILENOTFOUND, "%s : Ôàéë íå íàéäåí\n" - WCMD_NOCMDHELP, "Ñïðàâêà äëÿ %s îòñóòñòâóåò\n" - WCMD_NOTARGET, "Öåëü äëÿ GOTO íå íàéäåíà\n" - WCMD_CURRENTDATE, "Òåêóùàÿ äàòà %s\n" - WCMD_CURRENTTIME, "Òåêóùåå âðåìÿ %s\n" - WCMD_NEWDATE, "Ââåäèòå íîâóþ äàòó: " - WCMD_NEWTIME, "Ââåäèòå íîâîå âðåìÿ: " - WCMD_MISSINGENV, "Ïåðåìåííàÿ îêðóæåíèÿ %s íå îïðåäåëåíà\n" - WCMD_READFAIL, "Îøèáêà ïðè îòêðûòèè '%s'\n" - WCMD_CALLINSCRIPT, "Íå ìîãó âûçâàòü ìåòêó bat-ôàéëà âíå bat-ñêðèïòà\n" - WCMD_ALL, "Â" - WCMD_DELPROMPT, "%s, Óäàëåíî" - WCMD_ECHOPROMPT, "Echo óñòàíîâëåíî â %s\n" - WCMD_VERIFYPROMPT, "Verify óñòàíîâëåíî â %s\n" - WCMD_VERIFYERR, "Verify äîëæåí áûòü ëèáî ON, ëèáî OFF\n"; - WCMD_ARGERR, "Íåâåðíûé ïàðàìåòð\n" - WCMD_VOLUMEDETAIL, "Îáú¸ì äèñêà %c %s\n Ñåðèéíûé íîìåð %04x-%04x\n\n" - WCMD_VOLUMEPROMPT, "Ìåòêà äèñêà (11 ñèìâîëîâ, ENTER äëÿ ââîäà ïóñòîé ìåòêè)?" - WCMD_NOPATH, "PATH íå íàéäåí\n" - WCMD_ANYKEY,"Íàæìèòå ââîä äëÿ ïðîäîëæåíèÿ: " - WCMD_CONSTITLE,"Ïðèãëàøåíèå êîìàíäíîé ñòðîêè Wine" - WCMD_VERSION,"Âåðñèÿ CMD %s\n\n" - WCMD_MOREPROMPT, "Åù¸? " - WCMD_LINETOOLONG, "The input line is too long.\n" -} +/* + * Wine command prompt (Russian resources) + * + * Copyright 2003 Igor Stepin + * Copyright 2007 Lyutin Anatoly + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wcmd.h" + +/* UTF-8 */ +#pragma code_page(65001) + +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +STRINGTABLE +{ + WCMD_ATTRIB, "Справка об ATTRIB\n" + WCMD_CALL, +"CALL <имя bat-файла> используется в bat-файлах для запуска других\n\ +bat-файлов. При выходе из bat-файла управление возвращается\n\ +файлу, вызвавшему его. Команда CALL может передавать параметры\n\ +вызванному bat-файлу.\n\ +\n\ +Изменения каталога по умолчанию, переменных окружения и т.д., сделанные\n\ +вызванной процедурой, наследуются вызвавшему.\n" + + WCMD_CD, "Справка о CD\n" + WCMD_CHDIR, "Справка о CHDIR\n" + + WCMD_CLS, "CLS очищает экран консоли\n" + + WCMD_COPY, "Справка о COPY\n" + WCMD_CTTY, "Справка о CTTY\n" + WCMD_DATE, "Справка о DATE\n" + WCMD_DEL, "Справка о DEL\n" + WCMD_DIR, "Справка о DIR\n" + + WCMD_ECHO, +"ECHO <строка> отображает <строку> на текущем терминальном устройстве.\n\ +\n\ +ECHO ON включает отображение всех последующих команд в bat-файле\n\ +в терминал перед их выполнением.\n\ +\n\ +ECHO OFF даёт эффект, противоположный ECHO ON (ECHO отключено (OFF) по\n\ +умолчанию). Знак @, предшествующий ECHO OFF, препятствует её отображению.\n" + + WCMD_ERASE, "Справка об ERASE\n" + + WCMD_FOR, +"FOR используется для применения заданной <команды> для\n\ +одного файла или набора файлов.\n\ +\n\ +Синтаксис: FOR %переменная IN (набор) DO команда\n\ +\n\ +Необходимость в удвоении знака % при использовании FOR в bat-файлах\n\ +отсутствует в cmd.\n" + + + WCMD_GOTO, +"GOTO передаёт управление на строку, помеченную специальной меткой, в\n\ +пределах bat-файла.\n\ +\n\ +Метка, являющаяся целью GOTO, может иметь длину до 255 символов, но\n\ +не может содержать пробелы (это отличие от других операционных\n\ +систем). Если в bat-файле присутствует две или более метки с одинаковым именем,\n\ +то передаваться управление будет всегда на первую.\n\ +Попытка GOTO перейти по несуществующей метке прерывает выполнение bat-файла.\n\ +\n\ +Команда GOTO не работает в интерактивном режиме.\n" + + WCMD_HELP, "Справка о HELP\n" + + WCMD_IF, +"IF осуществляет условную обработку.\n\ +\n\ +Синтаксис: IF [NOT] EXIST файл команда\n\ + IF [NOT] \"строка1\"==\"строка2\" команда\n\ + IF [NOT] ERRORLEVEL число команда\n\ +\n\ +В первом примере команда EXIST проверяет существование файла.\n\ +Во втором примере сравнение не зависит от регистра.\n\ +В третьем примере ERRORLEVEL - значение, возвращаемое программой после выполнения.\n\ +IF проверяет ERRORLEVEL на >= <число>.\n" + + WCMD_LABEL, +"LABEL задаёт метку диска.\n\ +\n\ +Синтаксис: LABEL [диск:]\n\ +Команда выводит подсказку о создании новой метки для диска.\n\ +Посмотреть текущую метку диска возможно с помощью команды VOL.\n" + + + WCMD_MD, "Справка о MD\n" + WCMD_MKDIR, "Справка о MKDIR\n" + WCMD_MOVE, +"MOVE перемещает файл или каталог на новое место файловой системы.\n\ +\n\ +Если перемещается каталог, то все файлы и подкаталоги внутри него\n\ +также переместятся.\n\ +\n\ +MOVE не работает для перемещения данных с одного логического диска на другой.\n" + + WCMD_PATH, +"PATH отображает или изменяет маршрут поиска в cmd.\n\ +\n\ +Команда PATH отображает текущую установку пути поиска исполняемых файлов\n\ +(первоначально это значение задаётся в Вашем wine.conf файле).\n\ +Для изменения значения вызовите PATH с новым значением.\n\ +\n\ +Так же возможно изменять значение PATH, используя значение переменной\n\ +окружения PATH, например:\n\ + PATH %PATH%;c:\\temp\n" + + WCMD_PAUSE, +"PAUSE выводит на экран сообщение 'Press Return key to continue'\n\ +и ждёт пока пользователь не нажмёт клавишу Return. Она используется\n\ +в bat-файлах для того, чтобы пользователь смог прочесть вывод предыдущей команды\n\ +прежде чем он исчезнет с экрана.\n" + + WCMD_PROMPT, +"PROMPT изменяет вид подсказки командной строки.\n\ +\n\ +Строка, идущая после команды PROMPT (и за пробелом после команды),\n\ +появляется в начале строки, когда cmd ждёт ввода.\n\ +\n\ +Следующие строки имеют предопределённые значения, которые можно отобразить:\n\ +\n\ +$$ Знак доллара $_ Linefeed $b Знак Pipe (|)\n\ +$d Текущая дата $e Esc-символ (27) $g Знак >\n\ +$l Знак < $n Текущий диск $p Текущий путь\n\ +$q Знак равно $t Текущее время $v Версия cmd\n\ +\n\ +При вводе команды PROMPT без новой строки подсказки\n\ +подсказка устанавливается по умолчанию (буква текущего диска, путь до текущего\n\ +каталога и знак больше (>).\n\ +(как при вызове PROMPT $p$g).\n\ +\n\ +Подсказка может быть также изменена сменой переменной окружения PROMPT,\n\ +поэтому команда 'SET PROMPT=<текст>' имеет такой же эффект, как 'PROMPT '\n" + + WCMD_REM, +"Командная строка, начинающаяся с REM (с последующим пробелом) не выполняет\n\ +никаких действий, поэтому REM используется для комментариев в bat-файлах.\n" + + WCMD_REN, "Справка о REN\n" + WCMD_RENAME, "Справка о RENAME\n" + WCMD_RD, "Справка о RD\n" + WCMD_RMDIR, "Справка о RMDIR\n" + + WCMD_SET, +"SET показывает или изменяет переменные окружения cmd.\n\ +\n\ +SET без параметров показывает всё текущее окружение.\n\ +\n\ +Для создания или изменения переменной окружения используйте:\n\ +\n\ + SET <переменная>=<значение>\n\ +\n\ +где <переменная> и <значение> являются символьными строками. Перед знаком\n\ +равно не должно быть пробелов, имя переменной не может содержать\n\ +пробелы.\n\ +\n\ +В Wine переменные окружения основной операционной системы включены\n\ +в окружение Win32, поэтому будет доступно несколько больше\n\ +переменных, чем в обычной Win32. Стоит отметить,\n\ +что невозможно изменить окружение операционной системы из cmd.\n" + + WCMD_SHIFT, +"SHIFT используется в bat-файлах для удаления одного параметра с вершины\n\ +списка, таким образом параметр 2 переместится в параметр 1 и так далее.\n\ +SHIFT не работает при вызове в командной строке.\n" + + WCMD_TIME, "Справка о TIME\n" + + WCMD_TITLE, "Устанавливает заголовок окна cmd для текущей сессии.\n Синтаксис: TITLE <строка>\n" + + WCMD_TYPE, +"TYPE <файл> копирует <файл> в устройство консоли (или куда угодно, если он перенаправлен).\n\ +Проверка на то, что файл - это текст, предназначенный для чтения, отсутствует.\n" + + WCMD_VERIFY, +"VERIFY предназначена для установки, сброса или определения флага проверки\n\ +корректности записи файлов на диск. Возможные значения:\n\ +\n\ +VERIFY ON Установить флаг\n\ +VERIFY OFF Сбросить флаг\n\ +VERIFY Выводит текущее состояние: ON или OFF.\n\ +\n\ +Флаг verify не используется Wine.\n" + + WCMD_VER, +"VER отображает версию запущенного cmd\n" + + WCMD_VOL, "Справка о VOL\n" + + WCMD_PUSHD, "PUSHD сохраняет текущий каталог в стек,\n\ +а затем переходит в указанный каталог.\n" + + WCMD_POPD, "POPD переходит в каталог, сохранённый командой\n\ +PUSHD.\n" + + WCMD_MORE, "MORE выводит содержимое файлов или каналов постранично.\n" + + WCMD_EXIT, +"EXIT завершает текущую командную сессию и возвращает\n\ +в операционную систему или оболочку из которой был запущен cmd.\n" + + WCMD_ALLHELP, "Встроенные команды CMD:\n\ +ATTRIB\t\tПоказать или изменить DOS-атрибуты файла\n\ +CALL\t\tЗапустить bat-файл из другого bat-файла\n\ +CD (CHDIR)\tСменить текущую папку\n\ +CLS\t\tОчистить экран консоли\n\ +COPY\t\tСкопировать файл\n\ +CTTY\t\tСменить устройство ввода/вывода\n\ +DATE\t\tПоказать или изменить системную дату\n\ +DEL (ERASE)\tУдалить файл или набор файлов\n\ +DIR\t\tПоказать содержание папки\n\ +ECHO\t\tСкопировать текст прямо на выход консоли\n\ +HELP\t\tПоказать краткую подсказку по команде\n\ +MD (MKDIR)\tСоздать папку\n\ +MORE\t\tВывести данные по страницам\n\ +MOVE\t\tПереместить файл, набор файлов или дерево папок\n\ +PATH\t\tПоказать или изменить путь поиска программ\n\ +POPD\t\tВосстановить предыдущее значение текущей папки, сохранённого с помощью PUSHD\n\ +PUSHD\t\tСохранить значение текущей папки и переходит к другой папке\n\ +PROMPT\t\tИзменить приглашение командной строки\n\ +REN (RENAME)\tПереименовать файл\n\ +RD (RMDIR)\tУдалить папку\n\ +SET\t\tПоказать или изменить переменные окружения\n\ +TIME\t\tПоказать или изменить текущее системное время\n\ +TITLE\t\tУстанавить заголовок окна cmd для текущей сессии\n\ +TYPE\t\tВывести содержание текстового файла\n\ +VER\t\tПоказать текущую версию CMD\n\ +VOL\t\tПоказать метку тома дискового устройства\n\ +EXIT\t\tВыйти из CMD\n\n\ +Выполните HELP <команда> для дополнительной информации по перечисленным выше командам.\n" + + WCMD_CONFIRM, "Вы уверены?" + WCMD_YES, "Д" + WCMD_NO, "Н" + WCMD_NOASSOC, "Файл, ассоциированный с расширением %s,отсутствует\n" + WCMD_NOFTYPE, "Не работает команда, ассоциированная с файлом '%s'\n" + WCMD_OVERWRITE, "Перезаписано %s" + WCMD_MORESTR, "Дальше..." + WCMD_TRUNCATEDLINE, "Строка в обрабатываемом bat-файле возможно урезана. Используем:\n" + WCMD_NYI, "Ещё не выполнено\n\n" + WCMD_NOARG, "Отсутствует аргумент\n" + WCMD_SYNTAXERR, "Синтаксическая ошибка\n" + WCMD_FILENOTFOUND, "%s : Файл не найден\n" + WCMD_NOCMDHELP, "Справка для %s отсутствует\n" + WCMD_NOTARGET, "Цель для GOTO не найдена\n" + WCMD_CURRENTDATE, "Текущая дата %s\n" + WCMD_CURRENTTIME, "Текущее время %s\n" + WCMD_NEWDATE, "Введите новую дату: " + WCMD_NEWTIME, "Введите новое время: " + WCMD_MISSINGENV, "Переменная окружения %s не определена\n" + WCMD_READFAIL, "Ошибка при открытии '%s'\n" + WCMD_CALLINSCRIPT, "Не могу вызвать метку bat-файла вне bat-скрипта\n" + WCMD_ALL, "В" + WCMD_DELPROMPT, "%s, Удалено" + WCMD_ECHOPROMPT, "Echo установлено в %s\n" + WCMD_VERIFYPROMPT, "Verify установлено в %s\n" + WCMD_VERIFYERR, "Verify должен быть либо ON, либо OFF\n"; + WCMD_ARGERR, "Неверный параметр\n" + WCMD_VOLUMEDETAIL, "Объём диска %c %s\n Серийный номер %04x-%04x\n\n" + WCMD_VOLUMEPROMPT, "Метка диска (11 символов, ENTER для ввода пустой метки)?" + WCMD_NOPATH, "PATH не найден\n" + WCMD_ANYKEY,"Нажмите ввод для продолжения: " + WCMD_CONSTITLE,"Приглашение командной строки Wine" + WCMD_VERSION,"Версия CMD %s\n\n" + WCMD_MOREPROMPT, "Ещё? " + WCMD_LINETOOLONG, "Введенная команда слишком длинная.\n" +} diff --git a/programs/reg/Pt.rc b/programs/reg/Pt.rc index 6294408973e..0de0e336149 100644 --- a/programs/reg/Pt.rc +++ b/programs/reg/Pt.rc @@ -22,7 +22,9 @@ #include "reg.h" -LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL +#pragma code_page(65001) + +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE STRINGTABLE { @@ -30,4 +32,9 @@ STRINGTABLE STRING_ADD_USAGE, "REG ADD nome_chave [/v nome_valor | /ve] [/t tipo] [/s separador] [/d dados] [/f]\n" STRING_DELETE_USAGE, "REG DELETE nome_chave [/v nome_valor | /ve | /va] [/f]\n" STRING_QUERY_USAGE, "REG QUERY nome_chave [/v nome_valor | /ve] [/s]\n" + STRING_SUCCESS, "A operação foi completada com sucesso\n" + STRING_INVALID_KEY, "Erro: Nome de chave inválido\n" + STRING_INVALID_CMDLINE, "Erro: Parâmetros da linha de comandos inválidos\n" + STRING_NO_REMOTE, "Erro: Incapaz de adicionar chaves à máquina remota\n" + STRING_CANNOT_FIND, "Erro: O sistema foi incapaz de encontrar a chave de registo ou valor especificado\n" } diff --git a/programs/taskmgr/De.rc b/programs/taskmgr/De.rc index e1d3b190f5f..0c2f5ee20e6 100644 --- a/programs/taskmgr/De.rc +++ b/programs/taskmgr/De.rc @@ -3,7 +3,7 @@ * German Language Support * * Copyright 2005 Henning Gerhardt - * Copyright 2009 André Hentschel + * Copyright 2009 André Hentschel * * * This library is free software; you can redistribute it and/or @@ -23,6 +23,8 @@ #include "resource.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL /* @@ -33,7 +35,7 @@ IDR_TASKMANAGER MENU DISCARDABLE BEGIN POPUP "&Datei" BEGIN - MENUITEM "&Neuer Task (Ausführen...)", ID_FILE_NEW + MENUITEM "&Neuer Task (Ausführen...)", ID_FILE_NEW MENUITEM SEPARATOR MENUITEM "Task-Manager &Beenden", ID_FILE_EXIT END @@ -61,10 +63,10 @@ BEGIN END MENUITEM SEPARATOR - MENUITEM "&Große Symbole", ID_VIEW_LARGE + MENUITEM "&Große Symbole", ID_VIEW_LARGE MENUITEM "&Kleine Symbole", ID_VIEW_SMALL MENUITEM "&Details", ID_VIEW_DETAILS, CHECKED - MENUITEM "&Spalten auswählen...", ID_VIEW_SELECTCOLUMNS + MENUITEM "&Spalten auswählen...", ID_VIEW_SELECTCOLUMNS POPUP "&CPU Verlauf" BEGIN MENUITEM "&Ein Graph, Alle CPUs", ID_VIEW_CPUHISTORY_ONEGRAPHALL @@ -76,7 +78,7 @@ BEGIN END POPUP "&Fenster" BEGIN - MENUITEM "&Übereinander", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "&Übereinander", ID_WINDOWS_TILEHORIZONTALLY MENUITEM "&Nebeneinander", ID_WINDOWS_TILEVERTICALLY MENUITEM "&Minimieren", ID_WINDOWS_MINIMIZE MENUITEM "Ma&ximieren", ID_WINDOWS_MAXIMIZE @@ -87,13 +89,13 @@ BEGIN BEGIN MENUITEM "Task-Manager &Hilfethemen", ID_HELP_TOPICS MENUITEM SEPARATOR - MENUITEM "&Über Task-Manager", ID_HELP_ABOUT + MENUITEM "&Über Task-Manager", ID_HELP_ABOUT END END IDR_WINDOWSMENU MENU DISCARDABLE BEGIN - MENUITEM "&Übereinander", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "&Übereinander", ID_WINDOWS_TILEHORIZONTALLY MENUITEM "&Nebeneinander", ID_WINDOWS_TILEVERTICALLY MENUITEM "&Minimieren", ID_WINDOWS_MINIMIZE MENUITEM "Ma&ximieren", ID_WINDOWS_MAXIMIZE @@ -105,9 +107,9 @@ IDR_APPLICATION_PAGE_CONTEXT1 MENU DISCARDABLE BEGIN POPUP "DUMMY" BEGIN - MENUITEM "&Neuen Task (Ausführen...)", ID_FILE_NEW + MENUITEM "&Neuen Task (Ausführen...)", ID_FILE_NEW MENUITEM SEPARATOR - MENUITEM "&Große Symbole", ID_VIEW_LARGE + MENUITEM "&Große Symbole", ID_VIEW_LARGE MENUITEM "&Kleine Symbole", ID_VIEW_SMALL MENUITEM "&Details", ID_VIEW_DETAILS, CHECKED END @@ -120,7 +122,7 @@ BEGIN MENUITEM "&Wechseln zu", ID_APPLICATION_PAGE_SWITCHTO MENUITEM "&In den Vordergrund holen", ID_WINDOWS_BRINGTOFRONT MENUITEM SEPARATOR - MENUITEM "&Übereinander", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "&Übereinander", ID_WINDOWS_TILEHORIZONTALLY MENUITEM "&Nebeneinander", ID_WINDOWS_TILEVERTICALLY MENUITEM "&Minimieren", ID_WINDOWS_MINIMIZE MENUITEM "Ma&ximieren", ID_WINDOWS_MAXIMIZE @@ -136,7 +138,7 @@ BEGIN POPUP "DUMMY" BEGIN MENUITEM "&Wiederherstellen", ID_RESTORE - MENUITEM "&Schließen", ID_FILE_EXIT + MENUITEM "&Schließen", ID_FILE_EXIT MENUITEM SEPARATOR MENUITEM "&Immer im Vordergrund", ID_OPTIONS_ALWAYSONTOP END @@ -151,17 +153,17 @@ BEGIN MENUITEM "&Debuggen", ID_PROCESS_PAGE_DEBUG MENUITEM SEPARATOR - POPUP "Setze &Priorität" + POPUP "Setze &Priorität" BEGIN MENUITEM "&Echtzeit", ID_PROCESS_PAGE_SETPRIORITY_REALTIME MENUITEM "&Hoch", ID_PROCESS_PAGE_SETPRIORITY_HIGH - MENUITEM "&Höher als Normal", ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL + MENUITEM "&Höher als Normal", ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL MENUITEM "&Normal", ID_PROCESS_PAGE_SETPRIORITY_NORMAL MENUITEM "N&iedriger als Normal", ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL MENUITEM "Nie&drig", ID_PROCESS_PAGE_SETPRIORITY_LOW END - MENUITEM "Setze Affinität...", ID_PROCESS_PAGE_SETAFFINITY - MENUITEM "Editiere Debug&kanäle...", ID_PROCESS_PAGE_DEBUGCHANNELS + MENUITEM "Setze Affinität...", ID_PROCESS_PAGE_SETAFFINITY + MENUITEM "Editiere Debug&kanäle...", ID_PROCESS_PAGE_DEBUGCHANNELS END END @@ -264,23 +266,23 @@ END IDD_DEBUG_CHANNELS_DIALOG DIALOG DISCARDABLE 0, 0, 247, 210 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Debugkanäle" +CAPTION "Debugkanäle" FONT 8, "MS Shell Dlg" BEGIN CONTROL "List2",IDC_DEBUG_CHANNELS_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP | LVS_SORTASCENDING,7,7,233,177 - PUSHBUTTON "Schließen",IDOK,171,189,69,14 + PUSHBUTTON "Schließen",IDOK,171,189,69,14 END IDD_AFFINITY_DIALOG DIALOG DISCARDABLE 0, 0, 231, 154 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Prozessoraffinität" +CAPTION "Prozessoraffinität" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,120,133,50,14 PUSHBUTTON "Abbrechen",IDCANCEL,174,133,50,14 - LTEXT "Die Prozessoraffinitätseinstellung kontrolliert, auf welchen CPUs der Prozess die Erlaubnis hat, ausgeführt werden zu können.", + LTEXT "Die Prozessoraffinitätseinstellung kontrolliert, auf welchen CPUs der Prozess die Erlaubnis hat, ausgeführt werden zu können.", IDC_STATIC,5,5,220,16 CONTROL "CPU 0",IDC_CPU0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, 11,28,37,10 @@ -350,12 +352,12 @@ END IDD_COLUMNS_DIALOG DIALOG DISCARDABLE 0, 0, 245, 199 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Spalten auswählen" +CAPTION "Spalten auswählen" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,84,178,50,14 PUSHBUTTON "Abbrechen",IDCANCEL,138,178,50,14 - LTEXT "Wählen Sie die Spalten aus, die auf der Prozess-Seite des Task-Managers erscheinen sollen", + LTEXT "Wählen Sie die Spalten aus, die auf der Prozess-Seite des Task-Managers erscheinen sollen", IDC_STATIC,7,7,181,17 CONTROL "&Name",IDC_IMAGENAME,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,7,28,56,10 @@ -367,7 +369,7 @@ BEGIN WS_TABSTOP,7,61,48,10 CONTROL "S&peicherauslastung",IDC_MEMORYUSAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,72,95,10 - CONTROL "&Veränd. der Speicherauslastung",IDC_MEMORYUSAGEDELTA,"Button", + CONTROL "&Veränd. der Speicherauslastung",IDC_MEMORYUSAGEDELTA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,83,115,10 CONTROL "&Maximale Speicherauslastung",IDC_PEAKMEMORYUSAGE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,94,115,10 @@ -383,15 +385,15 @@ BEGIN WS_TABSTOP,7,149,50,10 CONTROL "Benutzer&name",IDC_USERNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,160,80,10 - CONTROL "Verän&d. der Seitenfehler",IDC_PAGEFAULTSDELTA,"Button", + CONTROL "Verän&d. der Seitenfehler",IDC_PAGEFAULTSDELTA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,132,28,72,10 - CONTROL "&Größe des virt. Speichers",IDC_VIRTUALMEMORYSIZE,"Button", + CONTROL "&Größe des virt. Speichers",IDC_VIRTUALMEMORYSIZE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,132,39,105,10 CONTROL "Aus&gelagerter Pool",IDC_PAGEDPOOL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,132,50,90,10 CONTROL "Nich&tausgelagerter Pool",IDC_NONPAGEDPOOL,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,132,61,105,10 - CONTROL "Basisp&riorität",IDC_BASEPRIORITY,"Button", + CONTROL "Basisp&riorität",IDC_BASEPRIORITY,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,132,72,55,10 CONTROL "&Handle-Anzahl",IDC_HANDLECOUNT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,132,83,59,10 @@ -424,12 +426,12 @@ STRINGTABLE DISCARDABLE BEGIN ID_FILE_NEW "Startet ein neues Programm" ID_OPTIONS_ALWAYSONTOP "Der Task-Manager bleibt immer mit seinen gesamten Fenstern im Vordergrund, bis er minimiert wird" - ID_OPTIONS_MINIMIZEONUSE "Der Task-Manager minimiert sich, wenn eine 'Wechseln zu' Operation ausgeführt wird" + ID_OPTIONS_MINIMIZEONUSE "Der Task-Manager minimiert sich, wenn eine 'Wechseln zu' Operation ausgeführt wird" ID_OPTIONS_HIDEWHENMINIMIZED "Versteckt den Task-Manager, wenn er minimiert ist" - ID_VIEW_REFRESH "Zwingt den Task Manager zu einer Aktualisierung, unabhänig von der Aktualisierungsgeschwindigkeit" - ID_VIEW_LARGE "Zeigt Tasks mit großen Symbolen an" + ID_VIEW_REFRESH "Zwingt den Task Manager zu einer Aktualisierung, unabhänig von der Aktualisierungsgeschwindigkeit" + ID_VIEW_LARGE "Zeigt Tasks mit großen Symbolen an" ID_VIEW_SMALL "Zeigt Tasks mit kleinen Symbolen an" - ID_VIEW_DETAILS "Zeigt detailierte Informationen über jeden einzelnen Task an" + ID_VIEW_DETAILS "Zeigt detailierte Informationen über jeden einzelnen Task an" ID_VIEW_UPDATESPEED_HIGH "Aktualisiert die Anzeige zweimal pro Sekunde" ID_VIEW_UPDATESPEED_NORMAL "Aktualisiert die Anzeige alle 2 Sekunden" ID_VIEW_UPDATESPEED_LOW "Aktualisiert die Anzeige alle 4 Sekunden" @@ -438,7 +440,7 @@ END STRINGTABLE DISCARDABLE BEGIN ID_VIEW_UPDATESPEED_PAUSED "Nicht automatisch aktualisieren" - ID_WINDOWS_TILEHORIZONTALLY "Stellt die Fenster übereinander auf dem Desktop dar" + ID_WINDOWS_TILEHORIZONTALLY "Stellt die Fenster übereinander auf dem Desktop dar" ID_WINDOWS_TILEVERTICALLY "Stellt die Fenster nebeneinander auf dem Desktop dar" ID_WINDOWS_MINIMIZE "Minimiert die Fenster" ID_WINDOWS_MAXIMIZE "Maximiert die Fenster" @@ -457,29 +459,29 @@ END STRINGTABLE DISCARDABLE BEGIN - ID_ENDTASK "Weist die ausgewählten Tasks an, sich zu beenden" - ID_GOTOPROCESS "Wechselt den Fokus zu dem Prozess des ausgewählten Tasks" + ID_ENDTASK "Weist die ausgewählten Tasks an, sich zu beenden" + ID_GOTOPROCESS "Wechselt den Fokus zu dem Prozess des ausgewählten Tasks" ID_RESTORE "Stellt den Task-Manager von seiner versteckten Status wieder her" ID_PROCESS_PAGE_ENDPROCESS "Entfernt den Prozess vom System" ID_PROCESS_PAGE_ENDPROCESSTREE "Entfernt den Prozess und alle seine Kindprozesse vom System" ID_PROCESS_PAGE_DEBUG "Heftet den Debugger an diesen Prozess an" - ID_PROCESS_PAGE_SETAFFINITY "Kontrolliert, auf welchen Prozessoren ein Prozess ausgeführt werden darf" - ID_PROCESS_PAGE_SETPRIORITY_REALTIME "Setzt den Prozess in die ECHTZEIT-Prioritätsklasse" - ID_PROCESS_PAGE_SETPRIORITY_HIGH "Setzt den Prozess in die HOCH-Prioritätsklasse" - ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL "Setzt den Prozess in die HÖHER ALS NORMAL-Prioritätsklasse" - ID_PROCESS_PAGE_SETPRIORITY_NORMAL "Setzt den Prozess in die NORMAL-Prioritätsklasse" - ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL "Setzt den Prozess in die NIEDRIGER ALS NORMAL-Prioritätsklasse" - ID_PROCESS_PAGE_SETPRIORITY_LOW "Setzt den Prozess in die NIEDRIG-Prioritätsklasse" - ID_PROCESS_PAGE_DEBUGCHANNELS "Stellt Debug-Kanäle ein" + ID_PROCESS_PAGE_SETAFFINITY "Kontrolliert, auf welchen Prozessoren ein Prozess ausgeführt werden darf" + ID_PROCESS_PAGE_SETPRIORITY_REALTIME "Setzt den Prozess in die ECHTZEIT-Prioritätsklasse" + ID_PROCESS_PAGE_SETPRIORITY_HIGH "Setzt den Prozess in die HOCH-Prioritätsklasse" + ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL "Setzt den Prozess in die HÖHER ALS NORMAL-Prioritätsklasse" + ID_PROCESS_PAGE_SETPRIORITY_NORMAL "Setzt den Prozess in die NORMAL-Prioritätsklasse" + ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL "Setzt den Prozess in die NIEDRIGER ALS NORMAL-Prioritätsklasse" + ID_PROCESS_PAGE_SETPRIORITY_LOW "Setzt den Prozess in die NIEDRIG-Prioritätsklasse" + ID_PROCESS_PAGE_DEBUGCHANNELS "Stellt Debug-Kanäle ein" END STRINGTABLE DISCARDABLE BEGIN - IDS_VIEW_LARGE "&Große Symbole" + IDS_VIEW_LARGE "&Große Symbole" IDS_VIEW_SMALL "&Kleine Symbole" IDS_VIEW_DETAILS "&Details" IDS_WINDOWS "&Windows" - IDS_VIEW_SELECTCOLUMNS "&Spalten auswählen..." + IDS_VIEW_SELECTCOLUMNS "&Spalten auswählen..." IDS_OPTIONS_SHOW16BITTASKS "&16-bit-Tasks anzeigen" IDS_VIEW_CPUHISTORY "&CPU Verlauf" IDS_VIEW_CPUHISTORY_ONEGRAPHALL "&Ein Graph, Alle CPUs" @@ -500,7 +502,7 @@ BEGIN IDS_CPUUSAGE "CPU-Auslastung" IDS_CPUTIME "CPU-Zeit" IDS_MEMORYUSAGE "Speicherauslastung" - IDS_MEMORYUSAGEDELTA "Veränd. der Speicherauslastung" + IDS_MEMORYUSAGEDELTA "Veränd. der Speicherauslastung" IDS_PEAKMEMORYUSAGE "Maximale Speicherauslastung" IDS_PAGEFAULTS "Seitenfehler" IDS_USEROBJECTS "Benutzer-Objekte" @@ -508,11 +510,11 @@ BEGIN IDS_IOREADBYTES "E/A-Bytes (Lesen)" IDS_SESSIONID "Sitzungs-ID" IDS_USERNAME "Benutzername" - IDS_PAGEFAULTSDELTA "Veränd. der Seiten" - IDS_VIRTUALMEMORYSIZE "Größe des virt. Speichers" + IDS_PAGEFAULTSDELTA "Veränd. der Seiten" + IDS_VIRTUALMEMORYSIZE "Größe des virt. Speichers" IDS_PAGEDPOOL "Ausgelagerter Pool" IDS_NONPAGEDPOOL "Nichtausgelagerter Pool" - IDS_BASEPRIORITY "Basispriorität" + IDS_BASEPRIORITY "Basispriorität" IDS_HANDLECOUNT "Handle-Anzahl" IDS_THREADCOUNT "Thread-Anzahl" IDS_GDIOBJECTS "GDI-Objekte" @@ -525,32 +527,32 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_WARNING_TITLE "Task Manager Warnung" - IDS_PRIORITY_CHANGE_MESSAGE "WARNUNG: Änderung der Prioritätsklasse dieses Prozesses\n\ - kann zu unerwünschten Ergebnissen und Systeminstabilität\n\ - führen. Sind Sie sicher, dass Sie sie ändern möchten?" - IDS_PRIORITY_UNABLE2CHANGE "Die Priorität kann nicht geändert werden " - IDS_TERMINATE_MESSAGE "WARNUNG: Beenden des Prozesses kann zu unerwünschten\n\ - Ergebnissen und Systeminstabilität, sowie Datenverlust\n\ - führen. Dem Prozess wird es nicht möglich sein geänderte\n\ + IDS_PRIORITY_CHANGE_MESSAGE "WARNUNG: Änderung der Prioritätsklasse dieses Prozesses\n\ + kann zu unerwünschten Ergebnissen und Systeminstabilität\n\ + führen. Sind Sie sicher, dass Sie sie ändern möchten?" + IDS_PRIORITY_UNABLE2CHANGE "Die Priorität kann nicht geändert werden " + IDS_TERMINATE_MESSAGE "WARNUNG: Beenden des Prozesses kann zu unerwünschten\n\ + Ergebnissen und Systeminstabilität, sowie Datenverlust\n\ + führen. Dem Prozess wird es nicht möglich sein geänderte\n\ Daten oder seinen Zustand zu speichern.\n\ - Sind Sie sicher, dass Sie inh beenden möchten?" + Sind Sie sicher, dass Sie inh beenden möchten?" IDS_TERMINATE_UNABLE2TERMINATE "Der Prozess konnte nicht beendet werden" IDS_DEBUG_MESSAGE "WARNUNG: Den Prozess zu debuggen kann zu Datenverlust\n\ - führen. Sind Sie sicher, dass Sie ihn debuggen möchten?" + führen. Sind Sie sicher, dass Sie ihn debuggen möchten?" IDS_DEBUG_UNABLE2DEBUG "Konnte den Prozess nicht debuggen" IDS_AFFINITY_ERROR_MESSAGE "Der Prozess muss mindestens mit einem Prozessor affin sein" - IDS_AFFINITY_ERROR_TITLE "Option nicht möglich" - IDS_AFFINITY_UNABLE2ACCESS "Die Prozessoraffinität konnte nicht geändert werden" + IDS_AFFINITY_ERROR_TITLE "Option nicht möglich" + IDS_AFFINITY_UNABLE2ACCESS "Die Prozessoraffinität konnte nicht geändert werden" END STRINGTABLE DISCARDABLE BEGIN IDS_SYSTEM_IDLE_PROCESS "Leerlauf Prozess" IDS_APPLICATION_NOT_RESPONDING "Anwortet nicht" - IDS_APPLICATION_RUNNING "läuft" + IDS_APPLICATION_RUNNING "läuft" IDS_APPLICATION_TASK "Task" IDS_APPLICATION_STATUS "Status" - IDS_DEBUG_CHANNEL "Debug Kanäle" + IDS_DEBUG_CHANNEL "Debug Kanäle" IDS_DEBUG_CHANNEL_FIXME "Fixme" IDS_DEBUG_CHANNEL_ERR "Err" IDS_DEBUG_CHANNEL_WARN "Warn" diff --git a/programs/taskmgr/Ja.rc b/programs/taskmgr/Ja.rc index 43334f2f8cc..589575db753 100644 --- a/programs/taskmgr/Ja.rc +++ b/programs/taskmgr/Ja.rc @@ -489,4 +489,5 @@ BEGIN ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL "プロセスの優先クラスを 通常以下 に設定します。" ID_PROCESS_PAGE_SETPRIORITY_LOW "プロセスの優先クラスを 低 に設定します。" + ID_PROCESS_PAGE_DEBUGCHANNELS "デバッグのチャンネルをコントロールします。" END diff --git a/programs/taskmgr/No.rc b/programs/taskmgr/No.rc index 19b647241c8..cc61a180a91 100644 --- a/programs/taskmgr/No.rc +++ b/programs/taskmgr/No.rc @@ -1,7 +1,7 @@ /* - * Norwegian Bokmål resources for Task Manager + * Norwegian Bokmål resources for Task Manager * - * Copyright 2005 Alexander N. Sørnes + * Copyright 2005-2009 Alexander N. Sørnes * * * This library is free software; you can redistribute it and/or @@ -21,6 +21,8 @@ #include "resource.h" +#pragma code_page(65001) + LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL /* @@ -31,27 +33,27 @@ IDR_TASKMANAGER MENU DISCARDABLE BEGIN POPUP "&Fil" BEGIN - MENUITEM "&Ny oppgave (Kjør...)", ID_FILE_NEW + MENUITEM "&Ny oppgave (Kjør...)", ID_FILE_NEW MENUITEM SEPARATOR MENUITEM "&Avslutt oppgavebehandleren", ID_FILE_EXIT END POPUP "&Innstillinger" BEGIN - MENUITEM "&Alltid øverst", ID_OPTIONS_ALWAYSONTOP + MENUITEM "&Alltid øverst", ID_OPTIONS_ALWAYSONTOP , CHECKED MENUITEM "&Minimer ved bruk", ID_OPTIONS_MINIMIZEONUSE , CHECKED - MENUITEM "S&kjul når minimert", ID_OPTIONS_HIDEWHENMINIMIZED + MENUITEM "S&kjul når minimert", ID_OPTIONS_HIDEWHENMINIMIZED , CHECKED - MENUITEM "Vi&s 16-biters jobber", ID_OPTIONS_SHOW16BITTASKS + MENUITEM "Vi&s 16 bit-jobber", ID_OPTIONS_SHOW16BITTASKS , CHECKED END POPUP "&Vis" BEGIN - MENUITEM "Oppdate&r nå", ID_VIEW_REFRESH + MENUITEM "Oppdate&r nå", ID_VIEW_REFRESH POPUP "&Oppdateringsfrekvens" BEGIN - MENUITEM "&Høy", ID_VIEW_UPDATESPEED_HIGH + MENUITEM "&Høy", ID_VIEW_UPDATESPEED_HIGH MENUITEM "&Normal", ID_VIEW_UPDATESPEED_NORMAL , CHECKED MENUITEM "&Lav", ID_VIEW_UPDATESPEED_LOW @@ -60,7 +62,7 @@ BEGIN END MENUITEM SEPARATOR MENUITEM "S&tore ikoner", ID_VIEW_LARGE - MENUITEM "S&må ikoner", ID_VIEW_SMALL + MENUITEM "S&må ikoner", ID_VIEW_SMALL MENUITEM "&Detaljer", ID_VIEW_DETAILS, CHECKED MENUITEM "&Velg kolonner...", ID_VIEW_SELECTCOLUMNS POPUP "&Prosessorhistorikk" @@ -79,7 +81,7 @@ BEGIN MENUITEM "&Minimer", ID_WINDOWS_MINIMIZE MENUITEM "Ma&ksimer", ID_WINDOWS_MAXIMIZE MENUITEM "&Kortstokk", ID_WINDOWS_CASCADE - MENUITEM "&Vis øverst", ID_WINDOWS_BRINGTOFRONT + MENUITEM "&Vis øverst", ID_WINDOWS_BRINGTOFRONT END POPUP "&Hjelp" BEGIN @@ -96,17 +98,17 @@ BEGIN MENUITEM "&Minimer", ID_WINDOWS_MINIMIZE MENUITEM "Ma&ksimer", ID_WINDOWS_MAXIMIZE MENUITEM "&Kortstokk", ID_WINDOWS_CASCADE - MENUITEM "V&is øverst", ID_WINDOWS_BRINGTOFRONT + MENUITEM "V&is øverst", ID_WINDOWS_BRINGTOFRONT END IDR_APPLICATION_PAGE_CONTEXT1 MENU DISCARDABLE BEGIN POPUP "DUMMY" BEGIN - MENUITEM "&Ny oppgave (Kjør...)", ID_FILE_NEW + MENUITEM "&Ny oppgave (Kjør...)", ID_FILE_NEW MENUITEM SEPARATOR MENUITEM "&Store ikoner", ID_VIEW_LARGE - MENUITEM "S&må ikoner", ID_VIEW_SMALL + MENUITEM "S&må ikoner", ID_VIEW_SMALL MENUITEM "&Detaljer", ID_VIEW_DETAILS, CHECKED END END @@ -116,7 +118,7 @@ BEGIN POPUP "DUMMY" BEGIN MENUITEM "B&ytt til", ID_APPLICATION_PAGE_SWITCHTO - MENUITEM "Vis &øverst", ID_WINDOWS_BRINGTOFRONT + MENUITEM "Vis &øverst", ID_WINDOWS_BRINGTOFRONT MENUITEM SEPARATOR MENUITEM "Still opp &vannrett", ID_WINDOWS_TILEHORIZONTALLY MENUITEM "Still opp &loddrett", ID_WINDOWS_TILEVERTICALLY @@ -125,7 +127,7 @@ BEGIN MENUITEM "&Kortstokk", ID_WINDOWS_CASCADE MENUITEM SEPARATOR MENUITEM "Avslutt oppgav&e", ID_APPLICATION_PAGE_ENDTASK - MENUITEM "&Gå til prosess", ID_APPLICATION_PAGE_GOTOPROCESS + MENUITEM "&Gå til prosess", ID_APPLICATION_PAGE_GOTOPROCESS END END @@ -136,7 +138,7 @@ BEGIN MENUITEM "Gjenopp&rett", ID_RESTORE MENUITEM "Avlut&t", ID_FILE_EXIT MENUITEM SEPARATOR - MENUITEM "&Alltid øverst", ID_OPTIONS_ALWAYSONTOP + MENUITEM "&Alltid øverst", ID_OPTIONS_ALWAYSONTOP END END @@ -147,13 +149,13 @@ BEGIN MENUITEM "Avslutt pros&ess", ID_PROCESS_PAGE_ENDPROCESS MENUITEM "Avslu&tt prosesstre", ID_PROCESS_PAGE_ENDPROCESSTREE - MENUITEM "&Feilsøk", ID_PROCESS_PAGE_DEBUG + MENUITEM "&Feilsøk", ID_PROCESS_PAGE_DEBUG MENUITEM SEPARATOR POPUP "Angi &prioritet" BEGIN MENUITEM "&Samtid", ID_PROCESS_PAGE_SETPRIORITY_REALTIME - MENUITEM "&Høy", ID_PROCESS_PAGE_SETPRIORITY_HIGH + MENUITEM "&Høy", ID_PROCESS_PAGE_SETPRIORITY_HIGH MENUITEM "Over norm&al", ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL @@ -165,7 +167,7 @@ BEGIN END MENUITEM "&Angi slektskap...", ID_PROCESS_PAGE_SETAFFINITY - MENUITEM "&Rediger feilsøkingskanaler...", ID_PROCESS_PAGE_DEBUGCHANNELS + MENUITEM "&Rediger feilsøkingskanaler...", ID_PROCESS_PAGE_DEBUGCHANNELS END END @@ -218,8 +220,8 @@ BEGIN GROUPBOX "Virtuelt minne (K)",IDC_COMMIT_CHARGE_FRAME,5,166,111,39,0,WS_EX_TRANSPARENT GROUPBOX "Fysisk minne (K)",IDC_PHYSICAL_MEMORY_FRAME,131,122,111,39,0,WS_EX_TRANSPARENT GROUPBOX "Kjerneminne (K)",IDC_KERNEL_MEMORY_FRAME,131,166,111,39,0,WS_EX_TRANSPARENT - LTEXT "Håndtak",IDS_TOTALS_HANDLE_COUNT,12,131,27,8 - LTEXT "Tråder",IDS_TOTALS_THREAD_COUNT,12,140,27,8 + LTEXT "Håndtak",IDS_TOTALS_HANDLE_COUNT,12,131,27,8 + LTEXT "Tråder",IDS_TOTALS_THREAD_COUNT,12,140,27,8 LTEXT "Prosesser",IDS_TOTALS_PROCESS_COUNT,12,149,34,8 EDITTEXT IDC_TOTALS_HANDLE_COUNT,65,131,45,8,ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER @@ -268,7 +270,7 @@ END IDD_DEBUG_CHANNELS_DIALOG DIALOG DISCARDABLE 0, 0, 247, 210 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Feilsøkingskanaler" +CAPTION "Feilsøkingskanaler" FONT 8, "MS Shell Dlg" BEGIN CONTROL "List2",IDC_DEBUG_CHANNELS_LIST,"SysListView32",LVS_REPORT | @@ -284,7 +286,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,120,133,50,14 PUSHBUTTON "Avbryt",IDCANCEL,174,133,50,14 - LTEXT "Instillingen for prosesslektsskap bestemmer hvilke prosessorer prosessen kan kjøre på.", + LTEXT "Instillingen for prosesslektsskap bestemmer hvilke prosessorer prosessen kan kjøre på.", IDC_STATIC,5,5,220,16 CONTROL "Prosessor 0",IDC_CPU0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, 11,28,37,10 @@ -359,7 +361,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,84,178,50,14 PUSHBUTTON "Avbryt",IDCANCEL,138,178,50,14 - LTEXT "Velg kolonnene som vises på prosessiden i oppgavebehandleren.", + LTEXT "Velg kolonnene som vises på prosessiden i oppgavebehandleren.", IDC_STATIC,7,7,181,17 CONTROL "B&ildenavn",IDC_IMAGENAME,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,7,28,56,10 @@ -373,7 +375,7 @@ BEGIN WS_TABSTOP,7,72,63,10 CONTROL "Minnebruk-&delta",IDC_MEMORYUSAGEDELTA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,83,82,10 - CONTROL "Høyeste minnebru&k",IDC_PEAKMEMORYUSAGE,"Button", + CONTROL "Høyeste minnebru&k",IDC_PEAKMEMORYUSAGE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,94,82,10 CONTROL "Side&feil",IDC_PAGEFAULTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,105,53,10 @@ -383,13 +385,13 @@ BEGIN WS_TABSTOP,7,127,49,10 CONTROL "I/U leste byte",IDC_IOREADBYTES,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,138,65,10 - CONTROL "&Økt-ID",IDC_SESSIONID,"Button",BS_AUTOCHECKBOX | + CONTROL "&Økt-ID",IDC_SESSIONID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,149,50,10 CONTROL "Bruker&navn",IDC_USERNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,160,51,10 CONTROL "Sidefeil-delt&a",IDC_PAGEFAULTSDELTA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,107,28,72,10 - CONTROL "Størrelse på &virtuelt minne",IDC_VIRTUALMEMORYSIZE,"Button", + CONTROL "Størrelse på &virtuelt minne",IDC_VIRTUALMEMORYSIZE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,107,39,77,10 CONTROL "Pa&ginert samling",IDC_PAGEDPOOL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,50,53,10 @@ -397,9 +399,9 @@ BEGIN BS_AUTOCHECKBOX | WS_TABSTOP,107,61,67,10 CONTROL "Basisp&rioritet",IDC_BASEPRIORITY,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,107,72,55,10 - CONTROL "Antall &håndtak",IDC_HANDLECOUNT,"Button",BS_AUTOCHECKBOX | + CONTROL "Antall &håndtak",IDC_HANDLECOUNT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,83,59,10 - CONTROL "Antall &tråder",IDC_THREADCOUNT,"Button",BS_AUTOCHECKBOX | + CONTROL "Antall &tråder",IDC_THREADCOUNT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,94,59,10 CONTROL "GDI-objekter",IDC_GDIOBJECTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,105,55,10 @@ -426,14 +428,14 @@ END STRINGTABLE DISCARDABLE BEGIN - ID_FILE_NEW "Kjører et nytt program" + ID_FILE_NEW "Kjører et nytt program" ID_OPTIONS_ALWAYSONTOP "Oppgavebehandleren vises foran andre programmer med mindre den minimeres" ID_OPTIONS_MINIMIZEONUSE - "Oppgavebehandler minimeres når du bytter til en annen prosess" - ID_OPTIONS_HIDEWHENMINIMIZED "Skjul oppgavebehandleren skjules nå rden minimeres" - ID_VIEW_REFRESH "Tving oppgavebehandleren til å oppdatere nå, uansett oppdateringsfrekvens" + "Oppgavebehandler minimeres når du bytter til en annen prosess" + ID_OPTIONS_HIDEWHENMINIMIZED "Skjul oppgavebehandleren skjules nå rden minimeres" + ID_VIEW_REFRESH "Tving oppgavebehandleren til å oppdatere nå, uansett oppdateringsfrekvens" ID_VIEW_LARGE "Viser oppgaver med store ikoner" - ID_VIEW_SMALL "Viser oppgaver med små ikoner" + ID_VIEW_SMALL "Viser oppgaver med små ikoner" ID_VIEW_DETAILS "Viser informasjon om hver oppgave" ID_VIEW_UPDATESPEED_HIGH "Oppdaterer visningen to ganger per sekund" ID_VIEW_UPDATESPEED_NORMAL "Oppdaterer visningen annenhvert sekund" @@ -444,18 +446,18 @@ STRINGTABLE DISCARDABLE BEGIN ID_VIEW_UPDATESPEED_PAUSED "Oppdaterer ikke automatisk" ID_WINDOWS_TILEHORIZONTALLY - "Stiller vinduene opp vannrett på skrivebordet" - ID_WINDOWS_TILEVERTICALLY "Stiller vinduene opp loddrett på skrivebordet" + "Stiller vinduene opp vannrett på skrivebordet" + ID_WINDOWS_TILEVERTICALLY "Stiller vinduene opp loddrett på skrivebordet" ID_WINDOWS_MINIMIZE "Minimerer vinduene" ID_WINDOWS_MAXIMIZE "Maksimerer vinduene" - ID_WINDOWS_CASCADE "Viser vinduene oppå hverandre diagonalt over skrivebordet" + ID_WINDOWS_CASCADE "Viser vinduene oppå hverandre diagonalt over skrivebordet" ID_WINDOWS_BRINGTOFRONT "Henter vinduet fram, men setter det ikke i fokus" ID_HELP_TOPICS "Viser hjelpeemner om oppgavebehandleren" ID_HELP_ABOUT "Viser programinformasjon, versjonnumme og kopirett" ID_FILE_EXIT "Avslutter Oppgavebehandler" ID_OPTIONS_SHOW16BITTASKS "Viser 16-biters programmer under 'ntvdm.exe'" - ID_VIEW_SELECTCOLUMNS "Velger hvilke kolonner som vises på prosessiden" + ID_VIEW_SELECTCOLUMNS "Velger hvilke kolonner som vises på prosessiden" ID_VIEW_SHOWKERNELTIMES "Viser kjernetid i ytelsesgrafene" ID_VIEW_CPUHISTORY_ONEGRAPHALL "En enkelt historikk viser total prosessorbruk" @@ -466,18 +468,18 @@ END STRINGTABLE DISCARDABLE BEGIN - ID_ENDTASK "Gir den valgte oppgaven beskjed om å avslutte" + ID_ENDTASK "Gir den valgte oppgaven beskjed om å avslutte" ID_GOTOPROCESS "Bytter fokus til den valgte oppgavens prosess" ID_RESTORE "Gjenoppretter oppgavebehandleren fra dens skjulte status" ID_PROCESS_PAGE_ENDPROCESS "Fjerner prosessen fra systemet" ID_PROCESS_PAGE_ENDPROCESSTREE "Fjerner denne prosessen og alle etterkommere fra systemet" - ID_PROCESS_PAGE_DEBUG "Legger feilsøkeren til denne prosessen" + ID_PROCESS_PAGE_DEBUG "Legger feilsøkeren til denne prosessen" ID_PROCESS_PAGE_SETAFFINITY - "Kontrollerer hvilke prosessorer prosessen kan kjøre på" + "Kontrollerer hvilke prosessorer prosessen kan kjøre på" ID_PROCESS_PAGE_SETPRIORITY_REALTIME "Gir prosessen til samtidsprioritet" - ID_PROCESS_PAGE_SETPRIORITY_HIGH "Gir prosessen høy prioritet" + ID_PROCESS_PAGE_SETPRIORITY_HIGH "Gir prosessen høy prioritet" ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL "Gir prosessen over normal prioritet" ID_PROCESS_PAGE_SETPRIORITY_NORMAL @@ -485,4 +487,90 @@ BEGIN ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL "Gir prosessen under normal prioritet" ID_PROCESS_PAGE_SETPRIORITY_LOW "Gir prosessen lav prioritet" + ID_PROCESS_PAGE_DEBUGCHANNELS + "Kontrollerer feilsøkingskanaler" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_VIEW_LARGE "&Store ikoner" + IDS_VIEW_SMALL "S&må ikoner" + IDS_VIEW_DETAILS "&Detaljer" + IDS_WINDOWS "&Vinduer" + IDS_VIEW_SELECTCOLUMNS "Velg &kolonner ..." + IDS_OPTIONS_SHOW16BITTASKS "Vi&s 16 bit-jobber" + IDS_VIEW_CPUHISTORY "&Prosessorhistorikk" + IDS_VIEW_CPUHISTORY_ONEGRAPHALL "Én graf, alle pr&osessorer" + IDS_VIEW_CPUHISTORY_ONEGRAPHPERCPU "Én graf &per prosessor" + IDS_VIEW_SHOWKERNELTIMES "Vi&s kjernetider" + IDS_APPLICATIONS "Programmer" + IDS_PROCESSES "Prosesser" + IDS_PERFORMANCE "Ytelse" + IDS_STATUS_BAR_CPU_USAGE "Prosessorbruk: %3d%%" + IDS_STATUS_BAR_PROCESSES "Prosesser: %d" + IDS_STATUS_BAR_MEMORY_USAGE "Minnebruk: %dK / %dK" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_IMAGENAME "Bildenavn" + IDS_PID "PID" + IDS_CPUUSAGE "CPU" + IDS_CPUTIME "CPU-tid" + IDS_MEMORYUSAGE "Minnebruk" + IDS_MEMORYUSAGEDELTA "Minnedelta" + IDS_PEAKMEMORYUSAGE "Høyeste minnebruk" + IDS_PAGEFAULTS "Sidefeil" + IDS_USEROBJECTS "USER-objekter" + IDS_IOREADS "I/U leseøkter" + IDS_IOREADBYTES "I/U leste byte" + IDS_SESSIONID "Økt-ID" + IDS_USERNAME "Brukernavn" + IDS_PAGEFAULTSDELTA "PF-delta" + IDS_VIRTUALMEMORYSIZE "VM-størrelse" + IDS_PAGEDPOOL "Paged Pool" + IDS_NONPAGEDPOOL "NP Pool" + IDS_BASEPRIORITY "Basispri." + IDS_HANDLECOUNT "Handles" + IDS_THREADCOUNT "Tråder" + IDS_GDIOBJECTS "GDI-objekter" + IDS_IOWRITES "I/U skriveøkter" + IDS_IOWRITEBYTES "I/U skrevne byte" + IDS_IOOTHER "I/U annet" + IDS_IOOTHERBYTES "I/O annet, byte" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_WARNING_TITLE "Oppgavebehandler - advarsel" + IDS_PRIORITY_CHANGE_MESSAGE "ADVERSEL: Å endre prioritetsklassen for denne prosessen kan\n\ + føre til uønskede resultater, som et ustabilt system. Er du\n\ + sikker på at du vil endre prioritetsklassen?" + IDS_PRIORITY_UNABLE2CHANGE "Klarte ikke endre prioriteten" + IDS_TERMINATE_MESSAGE "ADVERSEL: Å avbryte en prosess kan føre til uønskede\n\ + resultater, som tap av data og et ustabilt system.\n\ + Prosessen vil ikke få anledning til å lagre gjeldende status\n\ + eller data før den avsluttes. Er du sikker på at du\n\ + vil avbryte prosessen?" + IDS_TERMINATE_UNABLE2TERMINATE "Klarte ikke avbryte prosessen" + IDS_DEBUG_MESSAGE "ADVERSEL: Å feilsøke denne prosessen kan føre til tap av data.\n\ + Er du sikker på at du vil koble til feilsøkeren?" + IDS_DEBUG_UNABLE2DEBUG "Klarte ikke feilsøke prosessen" + IDS_AFFINITY_ERROR_MESSAGE "Prosessen må ha tilhørighet til minst én prosessor" + IDS_AFFINITY_ERROR_TITLE "Ugyldig valg" + IDS_AFFINITY_UNABLE2ACCESS "Klarte ikke lese eller endre tilhørighet til prosessor" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SYSTEM_IDLE_PROCESS "Ledige ressurser" + IDS_APPLICATION_NOT_RESPONDING "Svarer ikke" + IDS_APPLICATION_RUNNING "Kjører" + IDS_APPLICATION_TASK "Oppgave" + IDS_APPLICATION_STATUS "Status" + IDS_DEBUG_CHANNEL "Feilsøkingskanaler" + IDS_DEBUG_CHANNEL_FIXME "Fiks meg" + IDS_DEBUG_CHANNEL_ERR "Feil" + IDS_DEBUG_CHANNEL_WARN "Advarsel" + IDS_DEBUG_CHANNEL_TRACE "Sporing" END diff --git a/programs/taskmgr/Pt.rc b/programs/taskmgr/Pt.rc index a7926e5e921..5d257a00856 100644 --- a/programs/taskmgr/Pt.rc +++ b/programs/taskmgr/Pt.rc @@ -22,7 +22,9 @@ #include "resource.h" -LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL +#pragma code_page(65001) + +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE /* Menu @@ -36,9 +38,9 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Sair", ID_FILE_EXIT END - POPUP "&Opções" + POPUP "&Opções" BEGIN - MENUITEM "&Sempre Visível", ID_OPTIONS_ALWAYSONTOP + MENUITEM "&Sempre Visível", ID_OPTIONS_ALWAYSONTOP , CHECKED MENUITEM "&Executar minimizado", ID_OPTIONS_MINIMIZEONUSE , CHECKED @@ -50,7 +52,7 @@ BEGIN POPUP "&Ver" BEGIN MENUITEM "&Actualizar agora", ID_VIEW_REFRESH - POPUP "&Frequência de actualização" + POPUP "&Frequência de actualização" BEGIN MENUITEM "&Alta", ID_VIEW_UPDATESPEED_HIGH MENUITEM "&Normal", ID_VIEW_UPDATESPEED_NORMAL @@ -64,11 +66,11 @@ BEGIN MENUITEM "Icones &pequenos", ID_VIEW_SMALL MENUITEM "&Detalhes", ID_VIEW_DETAILS, CHECKED MENUITEM "&Seleccionar colunas...", ID_VIEW_SELECTCOLUMNS - POPUP "&Histórico do CPU" + POPUP "&Histórico do CPU" BEGIN - MENUITEM "&Um gráfico, todos os CPUs", ID_VIEW_CPUHISTORY_ONEGRAPHALL + MENUITEM "&Um gráfico, todos os CPUs", ID_VIEW_CPUHISTORY_ONEGRAPHALL - MENUITEM "Um &gráfico por CPU", ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU + MENUITEM "Um &gráfico por CPU", ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU , CHECKED END MENUITEM "&Mostrar tempos do kernel", ID_VIEW_SHOWKERNELTIMES @@ -84,7 +86,7 @@ BEGIN END POPUP "&Ajuda" BEGIN - MENUITEM "&Tópicos de ajuda do Gestor de Tarefas", ID_HELP_TOPICS + MENUITEM "&Tópicos de ajuda do Gestor de Tarefas", ID_HELP_TOPICS MENUITEM SEPARATOR MENUITEM "&Sobre o Gestor de Tarefas", ID_HELP_ABOUT END @@ -137,7 +139,7 @@ BEGIN MENUITEM "&Restaurar", ID_RESTORE MENUITEM "&Fechar", ID_FILE_EXIT MENUITEM SEPARATOR - MENUITEM "&Sempre Visível", ID_OPTIONS_ALWAYSONTOP + MENUITEM "&Sempre Visível", ID_OPTIONS_ALWAYSONTOP END END @@ -146,7 +148,7 @@ BEGIN POPUP "DUMMY" BEGIN MENUITEM "&Terminar Processo", ID_PROCESS_PAGE_ENDPROCESS - MENUITEM "Terminar Árvore de &Processo", ID_PROCESS_PAGE_ENDPROCESSTREE + MENUITEM "Terminar Árvore de &Processo", ID_PROCESS_PAGE_ENDPROCESSTREE MENUITEM "&Depurar", ID_PROCESS_PAGE_DEBUG MENUITEM SEPARATOR @@ -166,7 +168,7 @@ BEGIN END MENUITEM "Definir &Afinidade...", ID_PROCESS_PAGE_SETAFFINITY - MENUITEM "Edi&tar canais de depuração...", ID_PROCESS_PAGE_DEBUGCHANNELS + MENUITEM "Edi&tar canais de depuração...", ID_PROCESS_PAGE_DEBUGCHANNELS END END @@ -205,7 +207,7 @@ BEGIN WS_BORDER | WS_TABSTOP,7,7,233,177 PUSHBUTTON "&Terminar Processo",IDC_ENDPROCESS,171,189,69,14 CONTROL "&Mostrar Processos de todos os utilizadores",IDC_SHOWALLPROCESSES, - "Botão",BS_AUTOCHECKBOX | WS_TABSTOP,7,191,111,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,191,111,10 END /*IDD_PERFORMANCE_PAGE DIALOGEX 0, 0, 247, 210*/ @@ -213,12 +215,12 @@ IDD_PERFORMANCE_PAGE DIALOGEX DISCARDABLE 0, 0, 247, 210 STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Utilização CPU",IDC_CPU_USAGE_FRAME,5,5,60,54,WS_TABSTOP, WS_EX_TRANSPARENT - GROUPBOX "Memória",IDC_MEM_USAGE_FRAME,5,63,60,54,BS_LEFTTEXT, WS_EX_TRANSPARENT + GROUPBOX "Utilização CPU",IDC_CPU_USAGE_FRAME,5,5,60,54,WS_TABSTOP, WS_EX_TRANSPARENT + GROUPBOX "Memória",IDC_MEM_USAGE_FRAME,5,63,60,54,BS_LEFTTEXT, WS_EX_TRANSPARENT GROUPBOX "Totais",IDC_TOTALS_FRAME,5,122,111,39,0,WS_EX_TRANSPARENT GROUPBOX "Commit Charge (K)",IDC_COMMIT_CHARGE_FRAME,5,166,111,39,0,WS_EX_TRANSPARENT - GROUPBOX "Memória Física (K)",IDC_PHYSICAL_MEMORY_FRAME,131,122,111,39,0,WS_EX_TRANSPARENT - GROUPBOX "Memória kernel (K)",IDC_KERNEL_MEMORY_FRAME,131,166,111,39,0,WS_EX_TRANSPARENT + GROUPBOX "Memória Física (K)",IDC_PHYSICAL_MEMORY_FRAME,131,122,111,39,0,WS_EX_TRANSPARENT + GROUPBOX "Memória kernel (K)",IDC_KERNEL_MEMORY_FRAME,131,166,111,39,0,WS_EX_TRANSPARENT LTEXT "Identificadores",IDS_TOTALS_HANDLE_COUNT,12,131,40,8 LTEXT "Threads",IDS_TOTALS_THREAD_COUNT,12,140,27,8 LTEXT "Processos",IDS_TOTALS_PROCESS_COUNT,12,149,34,8 @@ -248,15 +250,15 @@ BEGIN ES_READONLY | ES_NUMBER | NOT WS_BORDER LTEXT "Total",IDS_KERNEL_MEMORY_TOTAL,137,174,27,8 LTEXT "Paginada",IDS_KERNEL_MEMORY_PAGED,137,184,21,8 - LTEXT "Não paginada",IDS_KERNEL_MEMORY_NONPAGED,137,193,34,8 + LTEXT "Não paginada",IDS_KERNEL_MEMORY_NONPAGED,137,193,34,8 EDITTEXT IDC_KERNEL_MEMORY_TOTAL,185,174,48,8,ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER EDITTEXT IDC_KERNEL_MEMORY_PAGED,185,184,48,8,ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER EDITTEXT IDC_KERNEL_MEMORY_NONPAGED,185,193,48,8,ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER - GROUPBOX "Histórico da utilização do CPU", IDC_CPU_USAGE_HISTORY_FRAME, 74,5,168,54,0, WS_EX_TRANSPARENT - GROUPBOX "Histórico da Utilização de Memória Física", IDC_MEMORY_USAGE_HISTORY_FRAME,74,63,168,54,0,WS_EX_TRANSPARENT + GROUPBOX "Histórico da utilização do CPU", IDC_CPU_USAGE_HISTORY_FRAME, 74,5,168,54,0, WS_EX_TRANSPARENT + GROUPBOX "Histórico da Utilização de Memória Física", IDC_MEMORY_USAGE_HISTORY_FRAME,74,63,168,54,0,WS_EX_TRANSPARENT PUSHBUTTON "CPU Usage Display",IDC_CPU_USAGE_GRAPH,12,17,47,37,0, WS_EX_CLIENTEDGE PUSHBUTTON "MEM Usage Display",IDC_MEM_USAGE_GRAPH,12,75,47,37,0, @@ -269,7 +271,7 @@ END IDD_DEBUG_CHANNELS_DIALOG DIALOG DISCARDABLE 0, 0, 247, 210 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Canais de depuração" +CAPTION "Canais de depuração" FONT 8, "MS Shell Dlg" BEGIN CONTROL "List2",IDC_DEBUG_CHANNELS_LIST,"SysListView32",LVS_REPORT | @@ -285,7 +287,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,120,133,50,14 PUSHBUTTON "Cancelar",IDCANCEL,174,133,50,14 - LTEXT "A Afinidade do Processador controla em que CPUs o processo é permitido de executar.", + LTEXT "A Afinidade do Processador controla em que CPUs o processo é permitido de executar.", IDC_STATIC,5,5,220,16 CONTROL "CPU 0",IDC_CPU0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, 11,28,37,10 @@ -360,23 +362,23 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,84,178,50,14 PUSHBUTTON "Cancelar",IDCANCEL,138,178,50,14 - LTEXT "Seleccione as colunas que vão aparecer na página de Processos do Gestor de Tarefas.", + LTEXT "Seleccione as colunas que vão aparecer na página de Processos do Gestor de Tarefas.", IDC_STATIC,7,7,181,17 CONTROL "&Nome da Imagem",IDC_IMAGENAME,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,7,28,56,10 CONTROL "&PID (Identificador do Processo)",IDC_PID,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,39,88,10 - CONTROL "&Utilização do CPU",IDC_CPUUSAGE,"Button",BS_AUTOCHECKBOX | + CONTROL "&Utilização do CPU",IDC_CPUUSAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,50,53,10 CONTROL "&Tempo de CPU",IDC_CPUTIME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,61,48,10 - CONTROL "U&so de Memória",IDC_MEMORYUSAGE,"Button",BS_AUTOCHECKBOX | + CONTROL "U&so de Memória",IDC_MEMORYUSAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,72,63,10 - CONTROL "&Delta do uso de Memória",IDC_MEMORYUSAGEDELTA,"Button", + CONTROL "&Delta do uso de Memória",IDC_MEMORYUSAGEDELTA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,83,82,10 - CONTROL "P&ico do uso de Memória",IDC_PEAKMEMORYUSAGE,"Button", + CONTROL "P&ico do uso de Memória",IDC_PEAKMEMORYUSAGE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,94,82,10 - CONTROL "&Falhas de paginação",IDC_PAGEFAULTS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Falhas de paginação",IDC_PAGEFAULTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,105,53,10 CONTROL "&Objectos de UTILIZADOR",IDC_USEROBJECTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,116,62,10 @@ -384,17 +386,17 @@ BEGIN WS_TABSTOP,7,127,49,10 CONTROL "&Bytes de Leitura de E/S",IDC_IOREADBYTES,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,138,65,10 - CONTROL "&ID da sessão",IDC_SESSIONID,"Button",BS_AUTOCHECKBOX | + CONTROL "&ID da sessão",IDC_SESSIONID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,149,50,10 CONTROL "&Nome de utilizador",IDC_USERNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,160,51,10 - CONTROL "D&elta de Falhas de Paginação",IDC_PAGEFAULTSDELTA,"Button", + CONTROL "D&elta de Falhas de Paginação",IDC_PAGEFAULTSDELTA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,107,28,72,10 - CONTROL "&Tamanho de Memória Virtual",IDC_VIRTUALMEMORYSIZE,"Button", + CONTROL "&Tamanho de Memória Virtual",IDC_VIRTUALMEMORYSIZE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,107,39,77,10 CONTROL "&Conjunto Paginado",IDC_PAGEDPOOL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,50,53,10 - CONTROL "Conjunto Não Paginado",IDC_NONPAGEDPOOL,"Button", + CONTROL "Conjunto Não Paginado",IDC_NONPAGEDPOOL,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,107,61,67,10 CONTROL "Prioridade &Base",IDC_BASEPRIORITY,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,107,72,55,10 @@ -428,14 +430,14 @@ END STRINGTABLE DISCARDABLE BEGIN ID_FILE_NEW "Executa um novo programa" - ID_OPTIONS_ALWAYSONTOP "O Gestor de Tarefas permanece à frente de todas as outras janelas a não ser que esteja minimizado" + ID_OPTIONS_ALWAYSONTOP "O Gestor de Tarefas permanece à frente de todas as outras janelas a não ser que esteja minimizado" ID_OPTIONS_MINIMIZEONUSE - "O Gestor de Tarefas é minimizado quando se efectua uma operação de Mudar Para" - ID_OPTIONS_HIDEWHENMINIMIZED "Esconder o Gestor de Tarefas quando está minimizado" - ID_VIEW_REFRESH "Forçar o Gestor de Tarefas a actualizar agora, independentemente da velocidade de actualização definida." + "O Gestor de Tarefas é minimizado quando se efectua uma operação de Mudar Para" + ID_OPTIONS_HIDEWHENMINIMIZED "Esconder o Gestor de Tarefas quando está minimizado" + ID_VIEW_REFRESH "Forçar o Gestor de Tarefas a actualizar agora, independentemente da velocidade de actualização definida." ID_VIEW_LARGE "Mostra as tarefas usando icones grandes" ID_VIEW_SMALL "Mostra as tarefas usando icones pequenos" - ID_VIEW_DETAILS "Mostra informação sobre cada tarefa" + ID_VIEW_DETAILS "Mostra informação sobre cada tarefa" ID_VIEW_UPDATESPEED_HIGH "Actualiza o display duas vezes por segundo" ID_VIEW_UPDATESPEED_NORMAL "Actualiza o display a cada dois segundos" ID_VIEW_UPDATESPEED_LOW "Actualiza o display a cada quatro segundos" @@ -443,31 +445,31 @@ END STRINGTABLE DISCARDABLE BEGIN - ID_VIEW_UPDATESPEED_PAUSED "Não actualiza automaticamente" + ID_VIEW_UPDATESPEED_PAUSED "Não actualiza automaticamente" ID_WINDOWS_TILEHORIZONTALLY - "Dispõe as janelas em mosaico horizontal pelo desktop" - ID_WINDOWS_TILEVERTICALLY "Dispõe as janelas em mosaico vertical pelo desktop" + "Dispõe as janelas em mosaico horizontal pelo desktop" + ID_WINDOWS_TILEVERTICALLY "Dispõe as janelas em mosaico vertical pelo desktop" ID_WINDOWS_MINIMIZE "Minimiza as janelas" ID_WINDOWS_MAXIMIZE "Maximiza as janelas" - ID_WINDOWS_CASCADE "Dispõe as janelas em cascata diagonal pelo desktop" + ID_WINDOWS_CASCADE "Dispõe as janelas em cascata diagonal pelo desktop" ID_WINDOWS_BRINGTOFRONT "Traz a janela para a frente, mas sem mudar para ela" - ID_HELP_TOPICS "Mostra os tópicos de ajuda do Gestor de Tarefas" - ID_HELP_ABOUT "Mostra informação sobre o programa, versão e direitos de autor" + ID_HELP_TOPICS "Mostra os tópicos de ajuda do Gestor de Tarefas" + ID_HELP_ABOUT "Mostra informação sobre o programa, versão e direitos de autor" ID_FILE_EXIT "Sai do Gestor de Tarefas" ID_OPTIONS_SHOW16BITTASKS "Mostra as tarefas de 16-bits no ntvdm.exe associado" - ID_VIEW_SELECTCOLUMNS "Selecciona as colunas que serão visíveis na página de processos" - ID_VIEW_SHOWKERNELTIMES "Mostra o tempo do kernel nos gráficos de performance" + ID_VIEW_SELECTCOLUMNS "Selecciona as colunas que serão visíveis na página de processos" + ID_VIEW_SHOWKERNELTIMES "Mostra o tempo do kernel nos gráficos de performance" ID_VIEW_CPUHISTORY_ONEGRAPHALL - "Um único gráfico de histórico mostra o uso total do CPU" - ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU "Cada CPU tem o seu gráfico de histórico" + "Um único gráfico de histórico mostra o uso total do CPU" + ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU "Cada CPU tem o seu gráfico de histórico" ID_APPLICATION_PAGE_SWITCHTO "Coloca a tarefa no fundo e muda o foco para ela" END STRINGTABLE DISCARDABLE BEGIN - ID_ENDTASK "Diz às tarefas seleccionadas para fechar" + ID_ENDTASK "Diz às tarefas seleccionadas para fechar" ID_GOTOPROCESS "Muda o foco para o processo da tarefa seleccionada" ID_RESTORE "Restaura o Gestor de Tarefas do seu estado oculto" ID_PROCESS_PAGE_ENDPROCESS "Remove o processo do sistema" @@ -475,7 +477,7 @@ BEGIN "Remove o processo e os seus descendentes do sistema" ID_PROCESS_PAGE_DEBUG "Junta o depurador a este processo" ID_PROCESS_PAGE_SETAFFINITY - "Controla em que processadores o processo ficará autorizado a correr" + "Controla em que processadores o processo ficará autorizado a correr" ID_PROCESS_PAGE_SETPRIORITY_REALTIME "Coloca o processo na classe de prioridade em Tempo Real" ID_PROCESS_PAGE_SETPRIORITY_HIGH "Coloca o processo na classe de prioridade Alta" ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL @@ -485,4 +487,90 @@ BEGIN ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL "Coloca o processo na classe de prioridade Abaixo do Normal" ID_PROCESS_PAGE_SETPRIORITY_LOW "Coloca o processo na classe de prioridade Baixa" + ID_PROCESS_PAGE_DEBUGCHANNELS + "Controla os canais de Depuração" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_VIEW_LARGE "&Icones Grandes" + IDS_VIEW_SMALL "I&cones Pequenos" + IDS_VIEW_DETAILS "&Detalhes" + IDS_WINDOWS "&Janelas" + IDS_VIEW_SELECTCOLUMNS "&Seleccionar colunas..." + IDS_OPTIONS_SHOW16BITTASKS "&Mostrar tarefas 16-bit" + IDS_VIEW_CPUHISTORY "&Histórico do CPU" + IDS_VIEW_CPUHISTORY_ONEGRAPHALL "&Um gráfico, todos os CPUs" + IDS_VIEW_CPUHISTORY_ONEGRAPHPERCPU "Um gráfico &por CPU" + IDS_VIEW_SHOWKERNELTIMES "&Mostrar tempos do núcleo" + IDS_APPLICATIONS "Aplicações" + IDS_PROCESSES "Processos" + IDS_PERFORMANCE "Desempenho" + IDS_STATUS_BAR_CPU_USAGE "Utilização do CPU: %3d%%" + IDS_STATUS_BAR_PROCESSES "Processos: %d" + IDS_STATUS_BAR_MEMORY_USAGE "Utilização da memória: %dK / %dK" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_IMAGENAME "Nome da Imagem" + IDS_PID "PID" + IDS_CPUUSAGE "CPU" + IDS_CPUTIME "Tempo de CPU" + IDS_MEMORYUSAGE "Utilização de Memória" + IDS_MEMORYUSAGEDELTA "Intervalo de Memória" + IDS_PEAKMEMORYUSAGE "Pico de Utilização de Memória" + IDS_PAGEFAULTS "Falhas de Páginas" + IDS_USEROBJECTS "Objectos do Utilizador" + IDS_IOREADS "Leituras I/O" + IDS_IOREADBYTES "Bytes de Leituras I/O" + IDS_SESSIONID "ID da Sessão" + IDS_USERNAME "Nome de Utilizador" + IDS_PAGEFAULTSDELTA "Intervalo de PF" + IDS_VIRTUALMEMORYSIZE "Tamanho da VM" + IDS_PAGEDPOOL "Paged Pool" + IDS_NONPAGEDPOOL "NP Pool" + IDS_BASEPRIORITY "Base Pri" + IDS_HANDLECOUNT "Handles" + IDS_THREADCOUNT "Threads" + IDS_GDIOBJECTS "Objectos GDI" + IDS_IOWRITES "Escritas I/O" + IDS_IOWRITEBYTES "Bytes de Escritas I/O" + IDS_IOOTHER "Outros I/O" + IDS_IOOTHERBYTES "Bytes de Outros I/O" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_WARNING_TITLE "Aviso do Gestor de Tarefas" + IDS_PRIORITY_CHANGE_MESSAGE "AVISO: Mudar a classe de prioridade deste processo pode\n\ + causar resultados indesejáveis incluindo instabilidade do sistema. Tem a\n\ + certeza que quer mudar a classe de prioridade?" + IDS_PRIORITY_UNABLE2CHANGE "Incapaz de mudar a Prioridade" + IDS_TERMINATE_MESSAGE "AVISO: Terminar um processo pode causar resultados\n\ + indesejáveis incluindo perda de dados e instabilidade do sistema.\n\ + O processo não vai poder guardar o seu estado ou\n\ + dados antes de terminar. Tem a certeza que deseja\n\ + terminar o processo?" + IDS_TERMINATE_UNABLE2TERMINATE "Incapaz de Terminar o Processo" + IDS_DEBUG_MESSAGE "AVISO: Depurar este processo pode resultar em perda de dados.\n\ + Tem a certeza que deseja activar o depurador?" + IDS_DEBUG_UNABLE2DEBUG "Incapaz de depurar o processo" + IDS_AFFINITY_ERROR_MESSAGE "O processo tem de ter afinidade com pelo menos um processador" + IDS_AFFINITY_ERROR_TITLE "Opção Inválida" + IDS_AFFINITY_UNABLE2ACCESS "Incapaz de aceder ou alterar a Afinidade do Processo" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SYSTEM_IDLE_PROCESS "Processo de Sistema Parado" + IDS_APPLICATION_NOT_RESPONDING "Não Responde" + IDS_APPLICATION_RUNNING "A executar" + IDS_APPLICATION_TASK "Tarefa" + IDS_APPLICATION_STATUS "Estado" + IDS_DEBUG_CHANNEL "Canais de Depuração" + IDS_DEBUG_CHANNEL_FIXME "Fixme" + IDS_DEBUG_CHANNEL_ERR "Err" + IDS_DEBUG_CHANNEL_WARN "Warn" + IDS_DEBUG_CHANNEL_TRACE "Trace" END diff --git a/programs/winecfg/De.rc b/programs/winecfg/De.rc index 34af4b8a96b..8f703999851 100644 --- a/programs/winecfg/De.rc +++ b/programs/winecfg/De.rc @@ -23,6 +23,8 @@ #include "config.h" /* Needed for the PACKAGE_STRING definition */ #include "resource.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL IDR_WINECFG MENU DISCARDABLE @@ -40,10 +42,10 @@ BEGIN LTEXT PACKAGE_STRING,IDC_STATIC,119,17,120,8 CONTROL IDB_WINE,IDC_STATIC,"Static",SS_BITMAP ,15,17,157,111 LTEXT "http://www.winehq.org/",IDC_STATIC,119,31,106,8 - LTEXT "Diese Bibliothek ist freie Software; Sie dürfen sie unter den Bedingungen der GNU Lesser General Public License, wie von der Free Software Foundation veröffentlicht, weiterverteilen und/oder modifizieren; entweder gemäß Version 2.1 der Lizenz oder (nach Ihrer Option) jeder späteren Version.", + LTEXT "Diese Bibliothek ist freie Software; Sie dürfen sie unter den Bedingungen der GNU Lesser General Public License, wie von der Free Software Foundation veröffentlicht, weiterverteilen und/oder modifizieren; entweder gemäß Version 2.1 der Lizenz oder (nach Ihrer Option) jeder späteren Version.", IDC_STATIC,119,44,124,72 GROUPBOX " Windows-Registrierungs-Informationen ", IDC_STATIC, 15, 120, 230, 55 - LTEXT "&Eigentümer:", IDC_STATIC, 22, 136, 40, 20 + LTEXT "&Eigentümer:", IDC_STATIC, 22, 136, 40, 20 EDITTEXT IDC_ABT_OWNER, 75, 136, 160, 13, ES_AUTOHSCROLL | WS_TABSTOP LTEXT "&Organisation:", IDC_STATIC, 22, 150, 50, 20 EDITTEXT IDC_ABT_ORG, 75, 150, 160, 13, ES_AUTOHSCROLL | WS_TABSTOP @@ -54,11 +56,11 @@ STYLE WS_CHILD | WS_DISABLED FONT 8, "MS Shell Dlg" BEGIN GROUPBOX " Anwendungseinstellungen ",IDC_STATIC, 8,4,244,250 - LTEXT "Wine kann für jede Anwendung eine unterschiedliche Windows-Version nachahmen. Dieser Reiter ist mit den Bibliothek- und Grafik-Reiter verknüpft, damit entweder systemweite oder anwendungsabhängige Einstellungen in diesen Reitern vorgenommen werden können.", + LTEXT "Wine kann für jede Anwendung eine unterschiedliche Windows-Version nachahmen. Dieser Reiter ist mit den Bibliothek- und Grafik-Reiter verknüpft, damit entweder systemweite oder anwendungsabhängige Einstellungen in diesen Reitern vorgenommen werden können.", IDC_STATIC,15,15,227,43 CONTROL "Anwendungen",IDC_APP_LISTVIEW,"SysListView32",WS_BORDER | WS_TABSTOP | LVS_LIST | LVS_SINGLESEL | LVS_SHOWSELALWAYS, 15,58,230,152 - PUSHBUTTON "Anw. &hinzufügen",IDC_APP_ADDAPP, 90,214,75,14 + PUSHBUTTON "Anw. &hinzufügen",IDC_APP_ADDAPP, 90,214,75,14 PUSHBUTTON "Anw. &entfernen",IDC_APP_REMOVEAPP, 170,214,75,14 LTEXT "&Windows Version:",IDC_STATIC,17,236,58,8 COMBOBOX IDC_WINVER,83,234,163,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -69,22 +71,22 @@ STYLE WS_CHILD | WS_DISABLED FONT 8, "MS Shell Dlg" BEGIN GROUPBOX " Fenstereinstellungen ",IDC_STATIC,8,4,244,84 - CONTROL "DirectX-Anwendungen können Maus einfangen",IDC_DX_MOUSE_GRAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,20,230,8 + CONTROL "DirectX-Anwendungen können Maus einfangen",IDC_DX_MOUSE_GRAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,20,230,8 CONTROL "Erlaube dem Fenstermanager die Fenster zu &dekorieren",IDC_ENABLE_DECORATED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,32,230,8 CONTROL "Erlaube dem Fenstermanager die Fenster zu kontrollieren.",IDC_ENABLE_MANAGED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,44,230,8 CONTROL "Emuliere einen virtuellen Bildschirm",IDC_ENABLE_DESKTOP,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,15,56,230,8 - LTEXT "Desktop-Größe:",IDC_DESKTOP_SIZE,15,70,44,8,WS_DISABLED + LTEXT "Desktop-Größe:",IDC_DESKTOP_SIZE,15,70,44,8,WS_DISABLED LTEXT "X",IDC_DESKTOP_BY,109,70,8,8,WS_DISABLED EDITTEXT IDC_DESKTOP_WIDTH,64,68,40,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED EDITTEXT IDC_DESKTOP_HEIGHT,117,68,40,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED GROUPBOX " Direct3D ",IDC_STATIC,8,95,244,49 - LTEXT "Unterstützung für Vertex Shader: ",IDC_STATIC,15,110,80,32 + LTEXT "Unterstützung für Vertex Shader: ",IDC_STATIC,15,110,80,32 COMBOBOX IDC_D3D_VSHADER_MODE,100,108,145,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Pixel Shader aktivieren (wenn von Hardware unterstützt)", IDC_D3D_PSHADER_MODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,126,230,10 + CONTROL "Pixel Shader aktivieren (wenn von Hardware unterstützt)", IDC_D3D_PSHADER_MODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,126,230,10 - GROUPBOX " Bildschi&rmauflösung ",IDC_STATIC,8,151,244,93 + GROUPBOX " Bildschi&rmauflösung ",IDC_STATIC,8,151,244,93 CONTROL "", IDC_RES_TRACKBAR, "msctls_trackbar32",WS_TABSTOP,12,161,187,15 EDITTEXT IDC_RES_DPIEDIT,204,161,23,13,ES_NUMBER|WS_TABSTOP LTEXT "dpi",IDC_STATIC,235,163,10,8 @@ -95,13 +97,13 @@ IDD_DLLCFG DIALOG DISCARDABLE 0, 0, 260, 250 STYLE WS_CHILD | WS_DISABLED FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX " DLL Überschreibung ",IDC_STATIC,8,4,244,240 - LTEXT "DLLs (Dynamic Link Libraries) können einzeln eingestellt werden, entweder Builtin (gestellt durch Wine) oder Native (von Windows oder durch die Anwendung gestellt)." + GROUPBOX " DLL Überschreibung ",IDC_STATIC,8,4,244,240 + LTEXT "DLLs (Dynamic Link Libraries) können einzeln eingestellt werden, entweder Builtin (gestellt durch Wine) oder Native (von Windows oder durch die Anwendung gestellt)." , IDC_STATIC,15,17,228,32 - LTEXT "Neue Überschreibung für:",IDC_STATIC,16,58,100,8 + LTEXT "Neue Überschreibung für:",IDC_STATIC,16,58,100,8 COMBOBOX IDC_DLLCOMBO,16,68,140,14,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP | CBS_SORT | CBS_LOWERCASE - PUSHBUTTON "&Hinzufügen ",IDC_DLLS_ADDDLL, 164,68,82,13,BS_DEFPUSHBUTTON - LTEXT "Bestehende Überschreibungen:",IDC_STATIC,16,86,100,8 + PUSHBUTTON "&Hinzufügen ",IDC_DLLS_ADDDLL, 164,68,82,13,BS_DEFPUSHBUTTON + LTEXT "Bestehende Überschreibungen:",IDC_STATIC,16,86,100,8 LISTBOX IDC_DLLS_LIST,16,96,140,140,WS_BORDER | WS_TABSTOP | WS_VSCROLL PUSHBUTTON "&Bearbeiten",IDC_DLLS_EDITDLL,164,96,82,14 PUSHBUTTON "&Entfernen",IDC_DLLS_REMOVEDLL,164,114,82,14 @@ -109,7 +111,7 @@ END IDD_LOADORDER DIALOG DISCARDABLE 80, 90, 110, 92 STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "Bearbeite Überschreibung" +CAPTION "Bearbeite Überschreibung" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX " Ladereihenfolge ",IDC_STATIC,8,4,94,66 @@ -130,7 +132,7 @@ BEGIN LTEXT "Failed to connect to the mount manager, the drive configuration cannot be edited.", IDC_STATIC_MOUNTMGR_ERROR, 15,30,220,76 CONTROL "Listview",IDC_LIST_DRIVES,"SysListView32",LVS_REPORT | LVS_AUTOARRANGE | LVS_ALIGNLEFT | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP, 15,18,232,76 - PUSHBUTTON "&Hinzufügen",IDC_BUTTON_ADD,15,98,41,14 + PUSHBUTTON "&Hinzufügen",IDC_BUTTON_ADD,15,98,41,14 PUSHBUTTON "&Entfernen",IDC_BUTTON_REMOVE,60,98,37,14 PUSHBUTTON "&Automatisch", IDC_BUTTON_AUTODETECT,197,98,49,14 @@ -145,7 +147,7 @@ BEGIN LTEXT "Bezeichnung und Seriennummer",IDC_LABELSERIAL_STATIC,15,155,125,10 PUSHBUTTON "&Zeige Erweitert",IDC_BUTTON_SHOW_HIDE_ADVANCED,178,136,68,13 - CONTROL "Automatisch &vom Gerät:",IDC_RADIO_AUTODETECT,"Button", + CONTROL "Automatisch &vom Gerät:",IDC_RADIO_AUTODETECT,"Button", BS_AUTORADIOBUTTON,15,166,93,10 EDITTEXT IDC_EDIT_DEVICE,27,176,169,13,ES_AUTOHSCROLL PUSHBUTTON "Durch&suchen",IDC_BUTTON_BROWSE_DEVICE,201,176,45,13 @@ -165,8 +167,8 @@ STYLE WS_CHILD | WS_DISABLED FONT 8, "MS Shell Dlg" BEGIN GROUPBOX " Treiberauswahl ",IDC_STATIC,8,4,244,195 - LTEXT "Wählen Sie einen Sound-Treiber durch ankreuzen des gewünschten Treibers. Ist kein Treiber ausgewählt, wird der Sound deaktiviert. Die Auswahl mehrerer Treiber ist nicht empfohlen. Ein Treiber kann durch Rechtsklicken konfiguriert werden.",IDC_STATIC,15,15,227,35 - CONTROL "Geräte",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140 + LTEXT "Wählen Sie einen Sound-Treiber durch ankreuzen des gewünschten Treibers. Ist kein Treiber ausgewählt, wird der Sound deaktiviert. Die Auswahl mehrerer Treiber ist nicht empfohlen. Ein Treiber kann durch Rechtsklicken konfiguriert werden.",IDC_STATIC,15,15,227,35 + CONTROL "Geräte",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140 PUSHBUTTON "&Test Sound",IDC_AUDIO_TEST,170,50,59,14 PUSHBUTTON "Einstellungen",IDC_AUDIO_CONTROL_PANEL,170,70,59,14 GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60 @@ -189,22 +191,22 @@ BEGIN PUSHBUTTON "Motiv installieren...",IDC_THEME_INSTALL,152,23,93,14 LTEXT "Farbe:",IDC_THEME_COLORTEXT,15,40,112,8 COMBOBOX IDC_THEME_COLORCOMBO,15,48,112,14,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Größe:",IDC_THEME_SIZETEXT,135,40,110,8 + LTEXT "Größe:",IDC_THEME_SIZETEXT,135,40,110,8 COMBOBOX IDC_THEME_SIZECOMBO,135,48,110,14,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Element:",IDC_STATIC,15,64,112,8 COMBOBOX IDC_SYSPARAM_COMBO,15,74,112,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | CBS_SORT LTEXT "Farbe:",IDC_SYSPARAM_COLOR_TEXT,135,64,25,8,WS_DISABLED PUSHBUTTON "",IDC_SYSPARAM_COLOR,135,74,25,13,WS_DISABLED | BS_OWNERDRAW - LTEXT "Größe:",IDC_SYSPARAM_SIZE_TEXT,166,64,30,8,WS_DISABLED + LTEXT "Größe:",IDC_SYSPARAM_SIZE_TEXT,166,64,30,8,WS_DISABLED EDITTEXT IDC_SYSPARAM_SIZE,166,74,23,13,ES_AUTOHSCROLL | WS_TABSTOP | WS_DISABLED CONTROL "",IDC_SYSPARAM_SIZE_UD,UPDOWN_CLASS,UDS_SETBUDDYINT | WS_DISABLED,187,74,15,13 PUSHBUTTON "Schrift",IDC_SYSPARAM_FONT,208,74,37,13,WS_DISABLED GROUPBOX " Shell-Ordner ",IDC_STATIC,8,114,244,100 CONTROL "Listview",IDC_LIST_SFPATHS,"SysListView32",LVS_REPORT | LVS_AUTOARRANGE | LVS_ALIGNLEFT | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP, 15,126,230,64 - CONTROL "Verknüpfe:",IDC_LINK_SFPATH,"Button",BS_AUTOCHECKBOX|WS_TABSTOP|WS_DISABLED,15,195,50,13 + CONTROL "Verknüpfe:",IDC_LINK_SFPATH,"Button",BS_AUTOCHECKBOX|WS_TABSTOP|WS_DISABLED,15,195,50,13 EDITTEXT IDC_EDIT_SFPATH,65,195,145,13,ES_AUTOHSCROLL|WS_TABSTOP|WS_DISABLED - PUSHBUTTON "Wählen",IDC_BROWSE_SFPATH,215,195,30,13,WS_DISABLED + PUSHBUTTON "Wählen",IDC_BROWSE_SFPATH,215,195,30,13,WS_DISABLED END STRINGTABLE DISCARDABLE @@ -212,26 +214,26 @@ BEGIN IDS_TAB_APPLICATIONS "Anwendungen" IDS_TAB_DLLS "Bibliotheken" IDS_TAB_DRIVES "Laufwerke" - IDS_CHOOSE_PATH "Bitte wählen Sie das Ziel-Unix-Verzeichnis." + IDS_CHOOSE_PATH "Bitte wählen Sie das Ziel-Unix-Verzeichnis." IDS_HIDE_ADVANCED "Verstecke Erweitert" IDS_SHOW_ADVANCED "Zeige Erweitert" IDS_NOTHEME "(Kein Motiv)" IDS_TAB_GRAPHICS "Grafik" IDS_TAB_DESKTOP_INTEGRATION "Desktop-Integration" IDS_TAB_AUDIO "Audio" - IDS_TAB_ABOUT "Über" + IDS_TAB_ABOUT "Über" IDS_WINECFG_TITLE "Wine-Konfiguration" - IDS_WINECFG_TITLE_APP "Wine-Konfiguration für %s" + IDS_WINECFG_TITLE_APP "Wine-Konfiguration für %s" IDS_THEMEFILE "Motiv-Dateien" - IDS_THEMEFILE_SELECT "Motiv-Datei auswählen" - IDS_AUDIO_MISSING "Zur Zeit ist kein Audio Treiber in der Registry eingetragen.\n\nEin bevorzugter Treiber wurde für Sie ausgewählt.\nSie können diesen Treiber nutzen oder einen anderen verfügbaren Treiber auswählen.\n\nSie müssen auf Anwenden klicken, damit die Änderung übernommen wird." + IDS_THEMEFILE_SELECT "Motiv-Datei auswählen" + IDS_AUDIO_MISSING "Zur Zeit ist kein Audio Treiber in der Registry eingetragen.\n\nEin bevorzugter Treiber wurde für Sie ausgewählt.\nSie können diesen Treiber nutzen oder einen anderen verfügbaren Treiber auswählen.\n\nSie müssen auf Anwenden klicken, damit die Änderung übernommen wird." IDS_SHELL_FOLDER "Shell-Ordner" - IDS_LINKS_TO "Verknüpft mit" + IDS_LINKS_TO "Verknüpft mit" END STRINGTABLE DISCARDABLE BEGIN - IDS_DLL_WARNING "Das Ändern der Ladereihenfolge dieser Bibliothek wird nicht empfohlen.\nSind Sie sich sicher, dass Sie dies möchten?" + IDS_DLL_WARNING "Das Ändern der Ladereihenfolge dieser Bibliothek wird nicht empfohlen.\nSind Sie sich sicher, dass Sie dies möchten?" IDS_DLL_WARNING_CAPTION "Achtung: Systembibliothek" IDS_DLL_NATIVE "Native (Windows)" IDS_DLL_BUILTIN "Builtin (Wine)" @@ -241,7 +243,7 @@ BEGIN IDS_DEFAULT_SETTINGS "Standardeinstellungen" IDS_EXECUTABLE_FILTER "Wine-Programme (*.exe,*.exe.so)\0*.exe;*.exe.so\0" IDS_USE_GLOBAL_SETTINGS "Globale Einstellung benutzen" - IDS_SELECT_EXECUTABLE "Ausführbares Programm auswählen" + IDS_SELECT_EXECUTABLE "Ausführbares Programm auswählen" END STRINGTABLE DISCARDABLE @@ -257,12 +259,12 @@ BEGIN IDS_DRIVE_REMOTE "Netzwerkfreigabe" IDS_DRIVE_REMOVABLE "Diskette" IDS_DRIVE_CDROM "CD-ROM" - IDS_DRIVE_LETTERS_EXCEEDED "Sie können keine weiteren Laufwerke mehr hinzufügen.\n\nJedes Laufwerk muss einen Buchstaben besitzen, von A bis Z, deshalb können Sie nicht mehr als 26 haben." + IDS_DRIVE_LETTERS_EXCEEDED "Sie können keine weiteren Laufwerke mehr hinzufügen.\n\nJedes Laufwerk muss einen Buchstaben besitzen, von A bis Z, deshalb können Sie nicht mehr als 26 haben." IDS_SYSTEM_DRIVE_LABEL "Systemlaufwerk" - IDS_CONFIRM_DELETE_C "Sind Sie sich sicher, dass Sie Laufwerk C entfernen möchten?\n\nDie meisten Windows-Anwendungen erwarten, dass ein Laufwerk C existiert und funktionieren ohne nicht richtig. Wenn Sie fortfahren, vergessen Sie nicht, Laufwerk C neu zu erstellen!" + IDS_CONFIRM_DELETE_C "Sind Sie sich sicher, dass Sie Laufwerk C entfernen möchten?\n\nDie meisten Windows-Anwendungen erwarten, dass ein Laufwerk C existiert und funktionieren ohne nicht richtig. Wenn Sie fortfahren, vergessen Sie nicht, Laufwerk C neu zu erstellen!" IDS_COL_DRIVELETTER "Buchst." IDS_COL_DRIVEMAPPING "Zuordnung" - IDS_NO_DRIVE_C "Sie haben kein Laufwerk C. Das ist nicht so gut.\n\nVergessen Sie nicht, im Laufwerke-Reiter „Hinzufügen“ zu klicken um eins zu erstellen!\n" + IDS_NO_DRIVE_C "Sie haben kein Laufwerk C. Das ist nicht so gut.\n\nVergessen Sie nicht, im Laufwerke-Reiter „Hinzufügen“ zu klicken um eins zu erstellen!\n" END STRINGTABLE DISCARDABLE @@ -279,15 +281,15 @@ BEGIN IDS_DRIVER_NAS "NAS-Treiber" IDS_DRIVER_AUDIOIO "Audio-IO-Treiber (Solaris)" IDS_DRIVER_COREAUDIO "CoreAudio-Treiber" - IDS_OPEN_DRIVER_ERROR "Konnte %s nicht öffnen!" + IDS_OPEN_DRIVER_ERROR "Konnte %s nicht öffnen!" IDS_SOUNDDRIVERS "Sound_Treiber" - IDS_DEVICES_WAVEOUT "Wave-Ausgabe-Geräte" - IDS_DEVICES_WAVEIN "Wave-Eingabe-Geräte" - IDS_DEVICES_MIDIOUT "MIDI-Ausgabe-Geräte" - IDS_DEVICES_MIDIIN "MIDI-Ausgabe-Geräte" - IDS_DEVICES_AUX "Aux-Geräte" - IDS_DEVICES_MIXER "Mixer-Geräte" - IDS_UNAVAILABLE_DRIVER "In der Registry wurde ein Treiber gefunden, der nicht verfügbar ist!\n\nSoll „%s“ aus der Registry entfernt werden?" + IDS_DEVICES_WAVEOUT "Wave-Ausgabe-Geräte" + IDS_DEVICES_WAVEIN "Wave-Eingabe-Geräte" + IDS_DEVICES_MIDIOUT "MIDI-Ausgabe-Geräte" + IDS_DEVICES_MIDIIN "MIDI-Ausgabe-Geräte" + IDS_DEVICES_AUX "Aux-Geräte" + IDS_DEVICES_MIXER "Mixer-Geräte" + IDS_UNAVAILABLE_DRIVER "In der Registry wurde ein Treiber gefunden, der nicht verfügbar ist!\n\nSoll „%s“ aus der Registry entfernt werden?" IDS_WARNING "Warnung" END @@ -296,8 +298,8 @@ BEGIN IDC_SYSPARAMS_BUTTON "Steuerelementhintergrund" IDC_SYSPARAMS_BUTTON_TEXT "Steuerelementtext" IDC_SYSPARAMS_DESKTOP "Desktop" - IDC_SYSPARAMS_MENU "Menühintergrund" - IDC_SYSPARAMS_MENU_TEXT "Menütext" + IDC_SYSPARAMS_MENU "Menühintergrund" + IDC_SYSPARAMS_MENU_TEXT "Menütext" IDC_SYSPARAMS_SCROLLBAR "Bildlaufleiste" IDC_SYSPARAMS_SELECTION "Auswahlhintergrund" IDC_SYSPARAMS_SELECTION_TEXT "Auswahltext" @@ -320,9 +322,9 @@ BEGIN IDC_SYSPARAMS_BUTTON_DARK_SHADOW "Dunkler Steuerelementschatten" IDC_SYSPARAMS_BUTTON_LIGHT "Steuerelementerhellung" IDC_SYSPARAMS_BUTTON_ALTERNATE "Alternativer Steuerelementhintergrund" - IDC_SYSPARAMS_HOT_TRACKING "Heiß verfolgtes Element" + IDC_SYSPARAMS_HOT_TRACKING "Heiß verfolgtes Element" IDC_SYSPARAMS_ACTIVE_TITLE_GRADIENT "Gradient der aktiven Titelleiste" IDC_SYSPARAMS_INACTIVE_TITLE_GRADIENT "Gradient der inaktiven Titelleiste" - IDC_SYSPARAMS_MENU_HILIGHT "Menühervorhebung" - IDC_SYSPARAMS_MENUBAR "Menütitelleiste" + IDC_SYSPARAMS_MENU_HILIGHT "Menühervorhebung" + IDC_SYSPARAMS_MENUBAR "Menütitelleiste" END diff --git a/programs/winedbg/be_i386.c b/programs/winedbg/be_i386.c index ce2076c6055..c22ef145318 100644 --- a/programs/winedbg/be_i386.c +++ b/programs/winedbg/be_i386.c @@ -543,9 +543,6 @@ static unsigned be_i386_is_func_call(const void* insn, ADDRESS64* callee) } return TRUE; - case 0xCD: - WINE_FIXME("Unsupported yet call insn (0x%02x) at %p\n", ch, insn); - /* fall through */ default: return FALSE; } diff --git a/programs/winedbg/rsrc_Sv.rc b/programs/winedbg/rsrc_Sv.rc index 7a24982469b..7d7da32e6b9 100644 --- a/programs/winedbg/rsrc_Sv.rc +++ b/programs/winedbg/rsrc_Sv.rc @@ -56,5 +56,3 @@ BEGIN IDS_INVALID_PARAMS "Interna fel - ogiltiga parametrar mottogs" IDS_UNIDENTIFIED "(oidentifierad)" END - -#pragma code_page(default) diff --git a/programs/winefile/Pt.rc b/programs/winefile/Pt.rc index 5bf0c6b668d..d95b0d5b5ac 100644 --- a/programs/winefile/Pt.rc +++ b/programs/winefile/Pt.rc @@ -385,7 +385,7 @@ STRINGTABLE } -LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL STRINGTABLE { @@ -394,29 +394,12 @@ STRINGTABLE IDS_ROOT_FS "root fs" IDS_UNIXFS "unixfs" IDS_DESKTOP "Área de trabalho" - IDS_SHELL "Shell" - IDS_TITLEFMT "%s - %s" - IDS_NO_IMPL "Ainda não implementado" - IDS_WINE_FILE "Wine File" -} - -LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE - -STRINGTABLE -{ - IDS_WINEFILE "Winefile" - IDS_ERROR "Erro" - IDS_ROOT_FS "root fs" - IDS_UNIXFS "unixfs" - IDS_DESKTOP "Ecrã" - IDS_SHELL "Linha de Comandos" + IDS_SHELL "Linha de comandos" IDS_TITLEFMT "%s - %s" IDS_NO_IMPL "Ainda não implementado" IDS_WINE_FILE "Ficheiro Wine" } -LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL - STRINGTABLE { IDS_COL_NAME "Nome" diff --git a/programs/winemine/De.rc b/programs/winemine/De.rc index 63d19143c2c..0b8fcc5026e 100644 --- a/programs/winemine/De.rc +++ b/programs/winemine/De.rc @@ -41,7 +41,7 @@ MENU_WINEMINE MENU DISCARDABLE MENUITEM "&Anfänger", IDM_BEGINNER MENUITEM "&Fortgeschrittene", IDM_ADVANCED MENUITEM "&Experten", IDM_EXPERT - MENUITEM "Benutzer&definiert", IDM_CUSTOM + MENUITEM "Benutzer&definiert...", IDM_CUSTOM MENUITEM SEPARATOR MENUITEM "&Beenden\tAlt+X", IDM_EXIT } diff --git a/programs/wordpad/En.rc b/programs/wordpad/En.rc index fe92de7c2dc..b6ade3aaf3d 100644 --- a/programs/wordpad/En.rc +++ b/programs/wordpad/En.rc @@ -179,10 +179,14 @@ END STRINGTABLE DISCARDABLE BEGIN - STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)" + STRING_ALL_FILES, "All documents (*.*)" STRING_TEXT_FILES_TXT, "Text documents (*.txt)" STRING_TEXT_FILES_UNICODE_TXT, "Unicode text document (*.txt)" - STRING_ALL_FILES, "All documents (*.*)" + STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)" + STRING_NEWFILE_RICHTEXT, "Rich text document" + STRING_NEWFILE_TXT, "Text document" + STRING_NEWFILE_TXT_UNICODE, "Unicode text document" + STRING_PRINTER_FILES_PRN, "Printer files (*.PRN)" END STRINGTABLE DISCARDABLE @@ -194,18 +198,6 @@ END STRINGTABLE DISCARDABLE BEGIN - STRING_NEWFILE_RICHTEXT, "Rich text document" - STRING_NEWFILE_TXT, "Text document" - STRING_NEWFILE_TXT_UNICODE, "Unicode text document" -END - -STRINGTABLE DISCARDABLE -BEGIN - STRING_PRINTER_FILES_PRN, "Printer files (*.PRN)" -END - -STRINGTABLE DISCARDABLE -BEGIN STRING_VIEWPROPS_TITLE, "Options" STRING_VIEWPROPS_TEXT, "Text" STRING_VIEWPROPS_RICHTEXT, "Rich text" @@ -219,11 +211,7 @@ BEGIN STRING_PREVIEW_TWOPAGES, "Two pages" STRING_PREVIEW_ONEPAGE, "One page" STRING_PREVIEW_CLOSE, "Close" -END - -STRINGTABLE DISCARDABLE -BEGIN - STRING_UNITS_CM, "cm" + STRING_UNITS_CM, "cm" END STRINGTABLE DISCARDABLE diff --git a/programs/wordpad/Pt.rc b/programs/wordpad/Pt.rc index f8d7df2f889..fd512c9f1aa 100644 --- a/programs/wordpad/Pt.rc +++ b/programs/wordpad/Pt.rc @@ -20,7 +20,9 @@ #include "wordpad.h" -LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL +#pragma code_page(65001) + +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE IDM_MAINMENU MENU DISCARDABLE BEGIN @@ -32,8 +34,8 @@ BEGIN MENUITEM "Guardar &como...", ID_FILE_SAVEAS MENUITEM SEPARATOR MENUITEM "&Imprimir...\tCtrl+P", ID_PRINT - MENUITEM "&Pré visualizar...", ID_PREVIEW - MENUITEM "C&onfigurar página...", ID_PRINTSETUP + MENUITEM "&Pré visualizar...", ID_PREVIEW + MENUITEM "C&onfigurar página...", ID_PRINTSETUP MENUITEM SEPARATOR MENUITEM "&Sair", ID_FILE_EXIT END @@ -57,21 +59,21 @@ BEGIN MENUITEM SEPARATOR POPUP "E&xtras" BEGIN - MENUITEM "&Informação da selecção", ID_EDIT_SELECTIONINFO + MENUITEM "&Informação da selecção", ID_EDIT_SELECTIONINFO MENUITEM "&Formato dos caracteres", ID_EDIT_CHARFORMAT MENUITEM "&Definir formato dos caracteres", ID_EDIT_DEFCHARFORMAT - MENUITEM "F&ormato dos parágrafos", ID_EDIT_PARAFORMAT + MENUITEM "F&ormato dos parágrafos", ID_EDIT_PARAFORMAT MENUITEM "&Buscar texto", ID_EDIT_GETTEXT END END POPUP "&Ver" BEGIN MENUITEM "&Barra de Ferramentas", ID_TOGGLE_TOOLBAR - MENUITEM "Barra de &Formatação", ID_TOGGLE_FORMATBAR - MENUITEM "&Régua", ID_TOGGLE_RULER + MENUITEM "Barra de &Formatação", ID_TOGGLE_FORMATBAR + MENUITEM "&Régua", ID_TOGGLE_RULER MENUITEM "Barra de &Estado", ID_TOGGLE_STATUSBAR MENUITEM SEPARATOR - MENUITEM "&Opções...", ID_VIEWPROPERTIES + MENUITEM "&Opções...", ID_VIEWPROPERTIES END POPUP "&Inserir" BEGIN @@ -81,8 +83,8 @@ BEGIN BEGIN MENUITEM "&Tipo de Letra...", ID_FONTSETTINGS MENUITEM "&Lista de marcas" ID_BULLET - MENUITEM "&Parágrafo..." ID_PARAFORMAT - MENUITEM "T&abulações..." ID_TABSTOPS + MENUITEM "&Parágrafo..." ID_PARAFORMAT + MENUITEM "T&abulações..." ID_TABSTOPS POPUP "&Fundo" BEGIN MENUITEM "&Sistema\tCtrl+1", ID_BACK_1 @@ -104,7 +106,7 @@ BEGIN MENUITEM "Co&lar", ID_EDIT_PASTE MENUITEM SEPARATOR MENUITEM "&Lista de marcas" ID_BULLET - MENUITEM "&Parágrafo..." ID_PARAFORMAT + MENUITEM "&Parágrafo..." ID_PARAFORMAT END END @@ -113,7 +115,7 @@ STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU CAPTION "Data e hora" FONT 10, "MS Sans Serif" BEGIN - LTEXT "Formatos Disponíveis",-1,3,2,100,15 + LTEXT "Formatos Disponíveis",-1,3,2,100,15 LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&OK",IDOK,87,12,40,12 PUSHBUTTON "&Cancelar",IDCANCEL,87,26,40,12 @@ -132,10 +134,10 @@ END IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110 STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -Caption "Parágrafo" +Caption "Parágrafo" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Identação", -1, 10, 10, 120, 68 + GROUPBOX "Identação", -1, 10, 10, 120, 68 LTEXT "Esquerda", -1, 15, 22, 40, 13 EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13 LTEXT "Direita", -1, 15, 40, 40, 13 @@ -150,10 +152,10 @@ END IDD_TABSTOPS DIALOG DISCARDABLE 30, 20, 200, 110 STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -Caption "Tabulações" +Caption "Tabulações" FONT 8, "MS SHell DLg" BEGIN - GROUPBOX "Marca de tabulação", -1, 10, 10, 120, 90 + GROUPBOX "Marca de tabulação", -1, 10, 10, 120, 90 COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE DEFPUSHBUTTON "&Adicionar", ID_TAB_ADD, 20, 80, 45, 15 PUSHBUTTON "&Remover", ID_TAB_DEL, 72, 80, 45, 15 @@ -169,12 +171,12 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Moldar o texto", -1, 10, 10, 130, 85 RADIOBUTTON "&Sem moldagem", IDC_PAGEFMT_WN, 18, 25, 117, 15 - RADIOBUTTON "&Moldar à janela", IDC_PAGEFMT_WW, 18, 45, 117, 15 - RADIOBUTTON "Moldar pela &régua", IDC_PAGEFMT_WM, 18, 65, 117, 15 + RADIOBUTTON "&Moldar à janela", IDC_PAGEFMT_WW, 18, 45, 117, 15 + RADIOBUTTON "Moldar pela &régua", IDC_PAGEFMT_WM, 18, 65, 117, 15 GROUPBOX "Barras de Ferramentas", -1, 150, 10, 120, 85 CHECKBOX "&Barra de Ferramentas", IDC_PAGEFMT_TB, 160, 20, 90, 15 - CHECKBOX "Barra de &Formatação", IDC_PAGEFMT_FB, 160, 38, 90, 15 - CHECKBOX "&Régua", IDC_PAGEFMT_RU, 160, 56, 90, 15 + CHECKBOX "Barra de &Formatação", IDC_PAGEFMT_FB, 160, 38, 90, 15 + CHECKBOX "&Régua", IDC_PAGEFMT_RU, 160, 56, 90, 15 CHECKBOX "Barra de &Estado", IDC_PAGEFMT_SB, 160, 74, 90, 15 LTEXT "", IDC_PAGEFMT_ID, 0,0,0,0 END @@ -208,7 +210,7 @@ END STRINGTABLE DISCARDABLE BEGIN - STRING_VIEWPROPS_TITLE, "Opções" + STRING_VIEWPROPS_TITLE, "Opções" STRING_VIEWPROPS_TEXT, "Texto" STRING_VIEWPROPS_RICHTEXT, "Rich text" END @@ -216,10 +218,10 @@ END STRINGTABLE DISCARDABLE BEGIN STRING_PREVIEW_PRINT, "Imprimir" - STRING_PREVIEW_NEXTPAGE, "Próxima página" - STRING_PREVIEW_PREVPAGE, "Página anterior" - STRING_PREVIEW_TWOPAGES, "Duas páginas" - STRING_PREVIEW_ONEPAGE, "Uma página" + STRING_PREVIEW_NEXTPAGE, "Próxima página" + STRING_PREVIEW_PREVPAGE, "Página anterior" + STRING_PREVIEW_TWOPAGES, "Duas páginas" + STRING_PREVIEW_ONEPAGE, "Uma página" STRING_PREVIEW_CLOSE, "Fechar" END @@ -231,17 +233,18 @@ END STRINGTABLE DISCARDABLE BEGIN STRING_DEFAULT_FILENAME, "Documento" - STRING_PROMPT_SAVE_CHANGES, "Guardar alterações a '%s'?" + STRING_PROMPT_SAVE_CHANGES, "Guardar alterações a '%s'?" STRING_SEARCH_FINISHED, "Acabou a pesquisa do documento." STRING_LOAD_RICHED_FAILED, "Falhou o carregamento da biblioteca RichEdit." STRING_SAVE_LOSEFORMATTING, "Escolheu guardar em formato de texto simples, " \ - "o que vai anular todas as formatações. " \ + "o que vai anular todas as formatações. " \ "Tem a certeza que quer fazer isto?" - STRING_INVALID_NUMBER, "Formato de número inválido" - STRING_OLE_STORAGE_NOT_SUPPORTED, "Documentos OLE não são suportados" - STRING_WRITE_FAILED, "Não foi possível guardar o ficheiro." - STRING_WRITE_ACCESS_DENIED, "Não tem permissões para guardar o ficheiro." - STRING_OPEN_FAILED, "Não foi possível abrir o ficheiro." - STRING_OPEN_ACCESS_DENIED, "Não tem permissões para abrir o ficheiro." - STRING_PRINTING_NOT_IMPLEMENTED, "Impressão não implementada" + STRING_INVALID_NUMBER, "Formato de número inválido" + STRING_OLE_STORAGE_NOT_SUPPORTED, "Documentos OLE não são suportados" + STRING_WRITE_FAILED, "Não foi possível guardar o ficheiro." + STRING_WRITE_ACCESS_DENIED, "Não tem permissões para guardar o ficheiro." + STRING_OPEN_FAILED, "Não foi possível abrir o ficheiro." + STRING_OPEN_ACCESS_DENIED, "Não tem permissões para abrir o ficheiro." + STRING_PRINTING_NOT_IMPLEMENTED, "Impressão não implementada" + STRING_MAX_TAB_STOPS, "Não pode adicionar mais de 32 tabs." END diff --git a/programs/wordpad/wordpad.h b/programs/wordpad/wordpad.h index 6d3e64ab4c7..b51bec8fcb0 100644 --- a/programs/wordpad/wordpad.h +++ b/programs/wordpad/wordpad.h @@ -172,24 +172,24 @@ #define STRING_NEWFILE_TXT 1405 #define STRING_NEWFILE_TXT_UNICODE 1406 -#define STRING_ALIGN_LEFT 1407 -#define STRING_ALIGN_RIGHT 1408 -#define STRING_ALIGN_CENTER 1409 +#define STRING_PRINTER_FILES_PRN 1407 -#define STRING_PRINTER_FILES_PRN 1410 +#define STRING_ALIGN_LEFT 1416 +#define STRING_ALIGN_RIGHT 1417 +#define STRING_ALIGN_CENTER 1418 -#define STRING_VIEWPROPS_TITLE 1411 -#define STRING_VIEWPROPS_TEXT 1412 -#define STRING_VIEWPROPS_RICHTEXT 1413 +#define STRING_VIEWPROPS_TITLE 1432 +#define STRING_VIEWPROPS_TEXT 1433 +#define STRING_VIEWPROPS_RICHTEXT 1434 -#define STRING_PREVIEW_PRINT 1414 -#define STRING_PREVIEW_NEXTPAGE 1415 -#define STRING_PREVIEW_PREVPAGE 1416 -#define STRING_PREVIEW_TWOPAGES 1417 -#define STRING_PREVIEW_ONEPAGE 1418 -#define STRING_PREVIEW_CLOSE 1419 +#define STRING_PREVIEW_PRINT 1448 +#define STRING_PREVIEW_NEXTPAGE 1449 +#define STRING_PREVIEW_PREVPAGE 1450 +#define STRING_PREVIEW_TWOPAGES 1451 +#define STRING_PREVIEW_ONEPAGE 1452 +#define STRING_PREVIEW_CLOSE 1453 -#define STRING_UNITS_CM 1420 +#define STRING_UNITS_CM 1454 #define STRING_DEFAULT_FILENAME 1700 #define STRING_PROMPT_SAVE_CHANGES 1701 diff --git a/programs/write/De.rc b/programs/write/De.rc index a9535767bb6..db175a02d56 100644 --- a/programs/write/De.rc +++ b/programs/write/De.rc @@ -19,6 +19,8 @@ #include "resources.h" +#pragma code_page(65001) + LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL STRINGTABLE diff --git a/server/file.c b/server/file.c index dc93b4bcfdf..98017b9fe2f 100644 --- a/server/file.c +++ b/server/file.c @@ -602,8 +602,8 @@ void file_set_error(void) case ENOSPC: set_error( STATUS_DISK_FULL ); break; case EACCES: case ESRCH: + case EROFS: case EPERM: set_error( STATUS_ACCESS_DENIED ); break; - case EROFS: set_error( STATUS_MEDIA_WRITE_PROTECTED ); break; case EBUSY: set_error( STATUS_FILE_LOCK_CONFLICT ); break; case ENOENT: set_error( STATUS_NO_SUCH_FILE ); break; case EISDIR: set_error( STATUS_FILE_IS_A_DIRECTORY ); break; diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 3a5e2e58061..d297eb28d59 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -2208,11 +2208,12 @@ static void write_struct_members(FILE *file, const type_t *type, if (fields) LIST_FOR_EACH_ENTRY( field, fields, const var_t, entry ) { type_t *ft = field->type; + unsigned int align = 0; + unsigned int size = type_memsize(ft, &align); + if (salign < align) salign = align; + if (!is_conformant_array(ft) || type_array_is_decl_as_ptr(ft)) { - unsigned int align = 0; - unsigned int size = type_memsize(ft, &align); - if (salign < align) salign = align; if ((align - 1) & offset) { unsigned char fc = 0; diff --git a/tools/wine.inf.in b/tools/wine.inf.in index cd9e60956fe..050d3e53cf2 100644 --- a/tools/wine.inf.in +++ b/tools/wine.inf.in @@ -2427,8 +2427,10 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,rsaenh.dll,1 11,,shdocvw.dll,1 11,,urlmon.dll,1 +11,,wbemprox.dll,1 11,,windowscodecs.dll,1 11,,wintrust.dll,1 +11,,wmiutils.dll,1 11,,wuapi.dll,1 [FakeDllsSection] diff --git a/tools/wrc/parser.l b/tools/wrc/parser.l index d92e9733f5f..cafa35ad587 100644 --- a/tools/wrc/parser.l +++ b/tools/wrc/parser.l @@ -573,7 +573,7 @@ L\" { } {ws}+ want_id = wanted_id; /* Eat whitespace */ -. return yytext[0]; +[ -~] return yytext[0]; <*>.|\n { /* Catch all rule to find any unmatched text */ @@ -582,8 +582,8 @@ L\" { line_number++; char_number = 1; } - parser_warning("Unmatched text '%c' (0x%02x) YY_START=%d\n", - isprint(*yytext & 0xff) ? *yytext : '.', *yytext, YY_START); + parser_error("Unmatched text '%c' (0x%02x) YY_START=%d", + isprint((unsigned char)*yytext) ? *yytext : '.', *yytext, YY_START); } <> current_codepage = -1; yyterminate(); diff --git a/tools/wrc/parser.y b/tools/wrc/parser.y index f891f24c6a0..d9054751da1 100644 --- a/tools/wrc/parser.y +++ b/tools/wrc/parser.y @@ -386,15 +386,17 @@ resource_file $1 = rsc; /* Final statements before were done */ - head = get_resource_head($1); - if (resource_top) /* append to existing resources */ + if ((head = get_resource_head($1)) != NULL) { - resource_t *tail = resource_top; - while (tail->next) tail = tail->next; - tail->next = head; - head->prev = tail; + if (resource_top) /* append to existing resources */ + { + resource_t *tail = resource_top; + while (tail->next) tail = tail->next; + tail->next = head; + head->prev = tail; + } + else resource_top = head; } - else resource_top = head; sttres = NULL; } ; -- 2.11.4.GIT